mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-28 04:24:45 +08:00
*** empty log message ***
This commit is contained in:
parent
bb4904c751
commit
f6c0c0ee16
33
tests/cp/special-bits
Executable file
33
tests/cp/special-bits
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# make sure `cp -p' preserves special bits
|
||||
# This works only when run as root.
|
||||
|
||||
if test "$VERBOSE" = yes; then
|
||||
set -x
|
||||
cp --version
|
||||
fi
|
||||
|
||||
pwd=`pwd`
|
||||
tmp=spec-bits.$$
|
||||
trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
framework_failure=0
|
||||
mkdir $tmp || framework_failure=1
|
||||
cd $tmp || framework_failure=1
|
||||
|
||||
touch a b || framework_failure=1
|
||||
chmod u+sx,go= a || framework_failure=1
|
||||
chmod u=rwx,g=sx,o= b || framework_failure=1
|
||||
|
||||
if test $framework_failure = 1; then
|
||||
echo 'failure in testing framework'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fail=0
|
||||
|
||||
cp -p a a2 || fail=1
|
||||
cp -p b b2 || fail=1
|
||||
|
||||
(exit $fail); exit
|
Loading…
Reference in New Issue
Block a user