2 # Ensure that rm works even from an unreadable working directory.
4 if test "$VERBOSE" = yes; then
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
19 mkdir -p a/1 b c d/2 e/3 || framework_failure=1
21 if test $framework_failure = 1; then
22 echo "$0: failure in testing framework" 1>&2
32 # With coreutils-5.2.1, this would get a failed assertion.
33 rm -r $t/a $t/b || fail=1
35 # With coreutils-5.2.1, this would get the following:
36 # rm: cannot get current directory: Permission denied
37 # rm: failed to return to initial working directory: Bad file descriptor
38 rm -r $t/d $t/e || fail=1
40 test -d $t/a && fail=1
41 test -d $t/b && fail=1
42 test -d $t/d && fail=1
43 test -d $t/e && fail=1
45 (exit $fail); exit $fail