File renamed from tests/sticky-check.
[platform/upstream/coreutils.git] / tests / setgid-check
1 # -*- sh -*-
2 # Disable the current test if the working directory seems to have
3 # the setgid bit set.
4
5 # This test should be run in the temporary directory that ends
6 # up being removed via the trap commands.
7
8 cwd_is_setgid=no
9
10 setgid_tmpdir=setgid-$$
11 (umask 77; mkdir $setgid_tmpdir)
12 p=`ls -ld $setgid_tmpdir|sed 's/ .*//'`
13 rmdir $setgid_tmpdir
14 case $p in drwx------);; *) cwd_is_setgid=yes;; esac
15 if test $cwd_is_setgid = yes; then
16   cat <<EOF >&2
17 $0: Since it looks like you're running this test in a directory with
18 the setgid bit set, we're skipping this test.
19 EOF
20   (exit 77); exit
21 fi