bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#544965: Is umask o+w set?


From: Jim Meyering
Subject: Re: Bug#544965: Is umask o+w set?
Date: Sun, 06 Sep 2009 18:37:30 +0200

Tom Fitzhenry wrote:
> Is umask o+w set where the test directory 'sticky' is being created?
>
> I compiled coreutils and ran its tests. ls-misc passed.
>
> The colour your `ls` returns for the directory 'sticky' in the test
> 'ls-misc', 30;42, corresponds to other-writable sticky directories.
> The colour that's expected, 37;44, corresponds to sticky directories.
>
> From src/ls.c:
> if ((mode & S_ISVTX) && (mode & S_IWOTH))
>   type = C_STICKY_OTHER_WRITABLE;
> else if ((mode & S_IWOTH) != 0)
>   type = C_OTHER_WRITABLE;
> else if ((mode & S_ISVTX) != 0)
>   type = C_STICKY;
>
> So what may be causing the behaviour you're witnessing, is the
> directory 'sticky' being o+w.
>
> With umask set to o+w, all tests but ls-misc pass. (ls-misc fails with
> the same output as you posted)

Thanks for finding the root cause.
I've fixed it upstream like this:

>From 9403417175b40656bbaac0f109841c90f9c05838 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 6 Sep 2009 18:35:40 +0200
Subject: [PATCH] tests: ls-misc: don't let a bogus umask cause test failure

* tests/misc/ls-misc: Set umask to 022.  A umask setting permitting
world-write access, e.g., umask o+w, would cause this test to fail.
Report by Mathias Brodala and analysis by Tom Fitzhenry in
<http://bugs.debian.org/544965>.
---
 THANKS             |    2 ++
 tests/misc/ls-misc |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/THANKS b/THANKS
index 961785e..0c5bb40 100644
--- a/THANKS
+++ b/THANKS
@@ -386,6 +386,7 @@ Matthew Swift                       address@hidden
 Matthew Woehlke                     address@hidden
 Matthias Urlichs                    address@hidden
 Matti Aarnio                        address@hidden
+Mathias Brodala                     address@hidden
 Mattias Wadenstein                  address@hidden
 Max Chang                           address@hidden
 Meelis Roos                         address@hidden
@@ -562,6 +563,7 @@ Tim Waugh                           address@hidden
 Tobias Stoeckmann                   address@hidden
 Toby Peterson                       address@hidden
 Todd A. Jacobs                      address@hidden
+Tom Fitzhenry                       address@hidden
 Tom Haynes                          address@hidden
 Tom Quinn                           address@hidden
 Tomas Pospisek                      address@hidden
diff --git a/tests/misc/ls-misc b/tests/misc/ls-misc
index 63810a5..a734d5f 100755
--- a/tests/misc/ls-misc
+++ b/tests/misc/ls-misc
@@ -239,6 +239,8 @@ my @Tests =
      ],
     );

+umask 022;
+
 # Start with an unset LS_COLORS environment variable.
 delete $ENV{LS_COLORS};

--
1.6.4.2.409.g85dc3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]