summaryrefslogtreecommitdiff
path: root/tests/rm
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-07-23 07:03:31 +0000
committerJim Meyering <jim@meyering.net>2003-07-23 07:03:31 +0000
commit6cf4280099a3e0efa73940b4b72137b848fd0608 (patch)
treeffddf86aa7f91c34d21992d10feb3250d6a8c6ce /tests/rm
parent5256994141b8a5b96437026c987184747f5120e1 (diff)
downloadcoreutils-6cf4280099a3e0efa73940b4b72137b848fd0608.tar.xz
Add a check for whether $NON_ROOT_USERNAME
can access the required version of rm.
Diffstat (limited to 'tests/rm')
-rwxr-xr-xtests/rm/fail-2eperm14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/rm/fail-2eperm b/tests/rm/fail-2eperm
index 8f67faebd..698ca4eff 100755
--- a/tests/rm/fail-2eperm
+++ b/tests/rm/fail-2eperm
@@ -33,7 +33,19 @@ fi
fail=0
-setuidgid $NON_ROOT_USERNAME rm -rf a 2> out && fail=1
+# Try to ensure that $NON_ROOT_USERNAME can access
+# the required version of rm.
+rm_version=`setuidgid $NON_ROOT_USERNAME rm --version|sed -n '1s/.* //p'`
+case $rm_version in
+ $PACKAGE_VERSION) ;;
+ *) echo "$0: cannot access required version ($PACKAGE_VERSION) of rm" 1>&2
+ fail=1 ;;
+esac
+setuidgid $NON_ROOT_USERNAME rm -rf a 2> out-t && fail=1
+
+# On some systems, we get `Not owner'. Convert it.
+sed 's/Not owner/Operation not permitted/' out-t > out
+
cat <<\EOF > exp
rm: cannot remove `a/b': Operation not permitted
EOF