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 <meyer...@redhat.com>
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                       sw...@alum.mit.edu
 Matthew Woehlke                     mw_tr...@users.sourceforge.net
 Matthias Urlichs                    sm...@noris.de
 Matti Aarnio                        matti.aar...@zmailer.org
+Mathias Brodala                     i...@noctus.net
 Mattias Wadenstein                  mas...@acc.umu.se
 Max Chang                           maxch...@ucla.edu
 Meelis Roos                         mr...@tartu.cyber.ee
@@ -562,6 +563,7 @@ Tim Waugh                           twa...@redhat
 Tobias Stoeckmann                   tob...@bugol.de
 Toby Peterson                       t...@opendarwin.org
 Todd A. Jacobs                      tjac...@codegnome.org
+Tom Fitzhenry                       t...@tom-fitzhenry.me.uk
 Tom Haynes                          tho...@netapp.com
 Tom Quinn                           t...@dionysos.thphys.ox.ac.uk
 Tomas Pospisek                      t...@sourcepole.ch
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