diff options
author | Jim Meyering <jim@meyering.net> | 2003-07-23 07:03:31 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-07-23 07:03:31 +0000 |
commit | 6cf4280099a3e0efa73940b4b72137b848fd0608 (patch) | |
tree | ffddf86aa7f91c34d21992d10feb3250d6a8c6ce /tests/rm | |
parent | 5256994141b8a5b96437026c987184747f5120e1 (diff) | |
download | coreutils-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-x | tests/rm/fail-2eperm | 14 |
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 |