diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-02-18 13:27:45 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-02-18 13:30:09 -0800 |
commit | f48b80ff26e331b5ab8fce69396914a65bb05b9a (patch) | |
tree | 6f42f1d45ae7725d6461e3c0de559b73de6685ae /init.cfg | |
parent | cccfae54dc416c337e40c35648a59ff7912f4ccc (diff) | |
download | coreutils-f48b80ff26e331b5ab8fce69396914a65bb05b9a.tar.gz |
tests: port better to macOS group numbers
* init.cfg (groups): Port better to macOS 12, where
group 4294967295 (nogroup) is special: you can be a member
without being able to chgrp files to the group.
Diffstat (limited to 'init.cfg')
-rw-r--r-- | init.cfg | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -488,7 +488,19 @@ require_membership_in_two_groups_() { test $# = 0 || framework_failure_ - groups=${COREUTILS_GROUPS-$( (id -G || /usr/xpg4/bin/id -G) 2>/dev/null)} + groups= + for group_ in 1 \ + ${COREUTILS_GROUPS-$( (id -G || /usr/xpg4/bin/id -G) 2>/dev/null)} + do + # Skip group numbers equal to 2**N - 1 for common N, + # as they are possibly reserved groups like 'nogroup'. + case $group_ in + 1 | 32767 | 65535 | 2147483647 | 4294967295) ;; + 9223372036854775807 | 18446744073709551615) ;; + *) test -z "$groups" || groups="$groups " + groups="$groups$group_";; + esac + done case "$groups" in *' '*) ;; *) skip_ 'requires membership in two groups |