summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-02-27 09:09:18 +0100
committerJim Meyering <meyering@redhat.com>2009-03-02 09:35:12 +0100
commit8c4f28b1242badb046f1a65942314420637d5cb7 (patch)
tree09b66798376bc7c87094dfa7595e0f0c3a9bd22d /tests
parent0433f90e3d388734888dad17f5fc2f106c59faf4 (diff)
downloadcoreutils-8c4f28b1242badb046f1a65942314420637d5cb7.tar.xz
tests: don't skip setgid-dir related tests on SELinux-enabled systems
* 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.
Diffstat (limited to 'tests')
-rw-r--r--tests/setgid-check9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/setgid-check b/tests/setgid-check
index 9fca2b71f..cf2618458 100644
--- a/tests/setgid-check
+++ b/tests/setgid-check
@@ -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