diff --git a/init.cfg b/init.cfg index 093cd85..a68edf2 100644 --- a/init.cfg +++ b/init.cfg @@ -502,6 +502,18 @@ skip_if_setgid_() esac } +# Skip if files are created with a different group to the current user +# This can happen due to a setgid dir, or extended attributes were +# reported to trigger this on Mac OS X. +skip_if_nondefault_group_() +{ + touch grp.$$ + gen_ug=$(stat -c '%u:%g' grp.$$) + rm grp.$$ + test "$gen_ug" = "$(id -ru):$(id -rg)" || + skip_ 'Files are created with a different gid' +} + skip_if_mcstransd_is_running_() { test $# = 0 || framework_failure_ diff --git a/tests/install/install-C-root.sh b/tests/install/install-C-root.sh index d8a8d84..6e6d7eb 100755 --- a/tests/install/install-C-root.sh +++ b/tests/install/install-C-root.sh @@ -20,6 +20,7 @@ print_ver_ ginstall require_root_ skip_if_setgid_ +skip_if_nondefault_group_ u1=1 u2=2 diff --git a/tests/install/install-C-selinux.sh b/tests/install/install-C-selinux.sh index 8513d50..ce9e0c3 100755 --- a/tests/install/install-C-selinux.sh +++ b/tests/install/install-C-selinux.sh @@ -19,7 +19,7 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ ginstall require_selinux_ - +skip_if_nondefault_group_ echo test > a || framework_failure_ chcon -u system_u a || skip_ "chcon doesn't work" diff --git a/tests/install/install-C.sh b/tests/install/install-C.sh index 7d3582c..7c0c7fb 100755 --- a/tests/install/install-C.sh +++ b/tests/install/install-C.sh @@ -19,6 +19,7 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ ginstall skip_if_setgid_ +skip_if_nondefault_group_ mode1=0644 mode2=0755