[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: umask also influences test/rm/fail-2eperm
From: |
Jim Meyering |
Subject: |
Re: umask also influences test/rm/fail-2eperm |
Date: |
Fri, 04 May 2007 12:01:34 +0200 |
address@hidden wrote:
> coreutils-6.9/tests/rm/fail-2eperm needs a 'chmod 644 a/b' or equivalent
> after the 'touch a/b || framework_failure=1' to be able to cope with
> different umasks.
> No idea though why it had shown up sometimes, not othertimes, with the same
> umask=000.
Since I am unable to reproduce that, I'm reluctant to change anything
without understanding the problem. Can you provide more detail?
> Also, in tests/rm/no-give-up, wouldn't 'chmod 755 .' (or equivalent) be better
> than 'chmod go= .' in the sense that the test should always test exactly
> the same thing, independent of umask? (i.e. the u bits also guaranteed always
> the same, in case umask was something stupid with nonzero u) Or else, maybe
> explicitly set umask?
Thanks for looking into that.
I've fixed it by adding the "chmod go=x .", below.
Avoid failure of root-only test when run with a restrictive umask.
* tests/rm/no-give-up: Ensure that non-root can access "d/" through
root-owned ".". Reported by AIDA Shinra.
diff --git a/tests/rm/no-give-up b/tests/rm/no-give-up
index dbd99eb..d90e9e6 100755
--- a/tests/rm/no-give-up
+++ b/tests/rm/no-give-up
@@ -34,10 +34,12 @@ trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
-mkdir d
-touch d/f
-chown -R $NON_ROOT_USERNAME d
-chmod go= .
+mkdir d || framework_failure=1
+touch d/f || framework_failure=1
+chown -R $NON_ROOT_USERNAME d || framework_failure=1
+
+# Ensure that non-root can access files in root-owned ".".
+chmod go=x . || framework_failure=1
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2