2 # Make sure chgrp gives the right diagnostic for a readable,
3 # but inaccessible directory.
5 if test "$VERBOSE" = yes; then
10 . $srcdir/../group-names
15 . $srcdir/../lang-default
16 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
19 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
20 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
21 trap '(exit $?); exit $?' 1 2 13 15
24 mkdir -p $tmp || framework_failure=1
25 cd $tmp || framework_failure=1
26 mkdir -p d/no-x/y || framework_failure=1
27 chmod u=rw d/no-x || framework_failure=1
29 if test $framework_failure = 1; then
30 echo "$0: failure in testing framework" 1>&2
36 # This must exit nonzero.
37 chgrp -R $g2 d >/dev/null 2>out && fail=1
39 chgrp: `d/no-x': Permission denied
42 # With native fdopendir, du uses a different code path.
43 cat <<\EOF > exp-native-fdopendir
44 chmod: cannot access `d/no-x/y': Permission denied
45 chmod: fts_read failed: Permission denied
48 if cmp out exp >/dev/null 2>&1; then
51 if cmp out exp-native-fdopendir; then
58 test $fail = 1 && diff out exp 2> /dev/null
60 (exit $fail); exit $fail