aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-lib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-lib.sh')
-rw-r--r--tests/test-lib.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index 45026f13d..17a35389b 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -262,6 +262,21 @@ mkfifo_or_skip_()
fi
}
+# Disable the current test if the working directory seems to have
+# the setgid bit set.
+skip_if_setgid_()
+{
+ setgid_tmpdir=setgid-$$
+ (umask 77; mkdir $setgid_tmpdir)
+ perms=$(stat --printf %A $setgid_tmpdir)
+ rmdir $setgid_tmpdir
+ case $perms in
+ drwx------);;
+ drwxr-xr-x);; # Windows98 + DJGPP 2.03
+ *) skip_test_ 'this directory has the setgid bit set';;
+ esac
+}
+
skip_if_mcstransd_is_running_()
{
test $# = 0 || framework_failure