]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: don't skip setgid-dir related tests on SELinux-enabled systems
authorJim Meyering <meyering@redhat.com>
Fri, 27 Feb 2009 08:09:18 +0000 (09:09 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 2 Mar 2009 08:35:12 +0000 (09:35 +0100)
* tests/setgid-check: The change in ls (use ".", not "+") caused
this check always to report the working directory as set-gid.
Now, use stat, not ls.

tests/setgid-check

index 9fca2b71f95f14d72f2efe39f72f60fb1f572524..cf26184588ee9e8aca5174192b90a9cbcda6fbc2 100644 (file)
@@ -2,7 +2,7 @@
 # Disable the current test if the working directory seems to have
 # the setgid bit set.
 
-# Copyright (C) 2000, 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,12 +24,11 @@ cwd_is_setgid=no
 
 setgid_tmpdir=setgid-$$
 (umask 77; mkdir $setgid_tmpdir)
-p=`ls -ld $setgid_tmpdir|sed 's/ .*//'`
+perms=$(stat --printf %A $setgid_tmpdir)
 rmdir $setgid_tmpdir
-case $p in
+case $perms in
   drwx------);;
-  drwx------+);;
-  drwxr-xr-x);;  # Windows98 + DJGPP 2.03 + fileutils-4.1 does this.
+  drwxr-xr-x);;  # Windows98 + DJGPP 2.03
   *) cwd_is_setgid=yes;;
 esac
 if test $cwd_is_setgid = yes; then