bug-coreutils
[Top][All Lists]
Advanced

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

coreutils mknod test fails if built in sgid directory


From: Bob Proulx
Subject: coreutils mknod test fails if built in sgid directory
Date: Thu, 15 Jun 2006 01:46:33 -0600
User-agent: Mutt/1.5.9i

I happened to build coreutils in a directory that was sgid.  This
caused a test failure in the mknod test.  The sgid bit propagates into
the directory created testing mkdir.  The sgid mode bit was unexpected
by the test script and it failed.

Here is the relevent code from the mknod test script:

  mkdir -m 734 f3   || fail=1
  set _ `ls -dgo f3`; shift; mode=$1
  test $mode = drwx-wxr-- || fail=1

Here is the trace with the failure:

  + mkdir -m 734 f3
  ++ ls -dgo f3
  + set _ drwx-wsr-- 2 48 2006-06-15 01:11 f3
  + shift
  + mode=drwx-wsr--
  + test drwx-wsr-- = drwx-wxr--
  + fail=1
  + exit 1

It seems like this should be a reasonable thing to allow.  That was
the only failure.  Here is a trivial and obvious solution.

  test $mode = drwx-wxr-- || test $mode = drwx-wsr-- || fail=1

What do you think?

Thanks
Bob

2006-06-15  Bob Proulx  <address@hidden>

        * tests/misc/mknod: Improve permission checks to handle
        running mkdir test in set-gid directories.

Index: tests/misc/mknod
===================================================================
RCS file: /home/bob/src/coreutils-cvsroot/coreutils/tests/misc/mknod,v
retrieving revision 1.1
diff -u -r1.1 mknod
--- tests/misc/mknod    19 Dec 2005 18:19:38 -0000      1.1
+++ tests/misc/mknod    15 Jun 2006 07:36:35 -0000
@@ -34,6 +34,6 @@

 mkdir -m 734 f3   || fail=1
 set _ `ls -dgo f3`; shift; mode=$1
-test $mode = drwx-wxr-- || fail=1
+test $mode = drwx-wxr-- || test $mode = drwx-wsr-- || fail=1

 (exit $fail); exit $fail




reply via email to

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