]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: use the "nobody" user's group as the default group id
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 4 Jul 2009 08:14:31 +0000 (10:14 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 4 Jul 2009 08:47:56 +0000 (10:47 +0200)
* tests/chroot/credentials: Use the group id, not its name.
* tests/test-lib.sh (NON_ROOT_GROUP): Use the "nobody" user's group in
place of "nogroup".

tests/chroot/credentials
tests/test-lib.sh

index 58c098f537276adc1cbabd9dd194638c0d736ebd..f200f14ab0112990b3939bd11e853f1d53d424a1 100755 (executable)
@@ -37,7 +37,7 @@ test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP / whoami)" != root
     || fail=1
 
 # Verify that there are no additional groups.
-test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP --groups=$NON_ROOT_GROUP / id -nG)"\
+test "$(chroot --userspec=$NON_ROOT_USERNAME:$NON_ROOT_GROUP --groups=$NON_ROOT_GROUP / id -G)"\
     = $NON_ROOT_GROUP || fail=1
 
 # Verify that when specifying only the user name we get the current
index d99e3a96627a97821d51763f9b94b517452f765d..9797b552e3ffb4bab92a18f3622c65662606f3a6 100644 (file)
@@ -209,7 +209,7 @@ require_root_()
 {
   uid_is_privileged_ || skip_test_ "must be run as root"
   NON_ROOT_USERNAME=${NON_ROOT_USERNAME=nobody}
-  NON_ROOT_GROUP=${NON_ROOT_GROUP=nobody}
+  NON_ROOT_GROUP=${NON_ROOT_GROUP=$(id -g $NON_ROOT_USERNAME)}
 }
 
 skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; }