From 6cf4280099a3e0efa73940b4b72137b848fd0608 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 23 Jul 2003 07:03:31 +0000 Subject: Add a check for whether $NON_ROOT_USERNAME can access the required version of rm. --- tests/rm/fail-2eperm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') 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 -- cgit v1.2.3-70-g09d2