3 if test "$VERBOSE" = yes; then
8 . $srcdir/../lang-default
9 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
12 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
13 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
14 trap '(exit $?); exit' 1 2 13 15
17 mkdir -p $tmp || framework_failure=1
18 cd $tmp || framework_failure=1
20 mkdir D D/D || framework_failure=1
21 touch D/a || framework_failure=1
22 chmod 0 D/a || framework_failure=1
23 chmod u=rx,go=,-st D || framework_failure=1
25 if test $framework_failure = 1; then
26 echo 'failure in testing framework'
32 # This is expected to exit non-zero, because it can't read D/a.
33 cp -pR D DD > /dev/null 2>&1 && fail=1
35 # Permissions on DD must be `dr-x------'
39 test "$1" = dr-x------ || fail=1
45 cp: accessing `symlink': Permission denied
48 cp F symlink 2> out && fail=1
49 # HPUX appears to fail with EACCES rather than EPERM.
50 # Transform their diagnostic
51 # ...: The file access permissions do not allow the specified action.
52 # to the expected one:
53 sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
54 cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; }
56 cp --target-directory=symlink F 2> out && fail=1
57 sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
58 cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; }
62 (exit $fail); exit $fail