2 # rm (without -r) must give a diagnostic for any directory.
3 # It must not prompt, even if that directory is unwritable.
5 if test "$VERBOSE" = yes; then
10 .
$srcdir/..
/envvar-check
11 .
$srcdir/..
/lang-default
14 t0
=`echo "$0"|sed 's,.*/,,'`.tmp
; tmp
=$t0/$$
15 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
16 trap '(exit $?); exit $?' 1 2 13 15
19 mkdir
-p $tmp || framework_failure
=1
20 cd $tmp || framework_failure
=1
21 mkdir
--mode=0500 unwritable-dir || framework_failure
=1
23 if test $framework_failure = 1; then
24 echo "$0: failure in testing framework" 1>&2
30 # For rm from coreutils-5.0.1, this would prompt.
31 rm --presume-input-tty unwritable-dir
< /dev
/null
> out-t
2>&1 && fail
=1
32 cat <<\EOF
> exp || fail
=1
33 rm: cannot remove
`unwritable-dir': Is a directory
36 # When run by a non-privileged user we get this:
37 # rm: cannot remove directory `unwritable-dir
': Is a directory
38 # When run by root we get this:
39 # rm: cannot remove `unwritable-dir': Is a directory
40 # Normalize the message.
41 sed 's/remove directory/remove/' out-t
> out
45 test $fail = 1 && diff out exp
2> /dev
/null
47 (exit $fail); exit $fail