summaryrefslogtreecommitdiff
path: root/tests/id
diff options
context:
space:
mode:
Diffstat (limited to 'tests/id')
-rwxr-xr-xtests/id/setgid.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/id/setgid.sh b/tests/id/setgid.sh
index 0664c47a2..6d9d74f43 100755
--- a/tests/id/setgid.sh
+++ b/tests/id/setgid.sh
@@ -20,21 +20,20 @@
print_ver_ id
require_root_
-u=$(id -u $NON_ROOT_USERNAME) || framework_failure_
-g=$u
-
-# Construct a different group number.
-gp1=$(expr $g + 1)
+# Construct a different group number
+gp1=$(expr $NON_ROOT_GID + 1)
echo $gp1 > exp || framework_failure_
-# With coreutils-8.16 and earlier, id -G would print both: $gp1 $g
-chroot --user=+$u:+$gp1 --groups='' / env PATH="$PATH" \
+# With coreutils-8.16 and earlier, id -G would print both:
+# $gp1 $NON_ROOT_GID
+chroot --user=$NON_ROOT_USERNAME:+$gp1 --groups='' / env PATH="$PATH" \
id -G > out || fail=1
-compare exp out || { cat out; fail=1; }
+compare exp out || fail=1
-# With coreutils-8.22 and earlier, id would erroneously print groups=$g
-chroot --user=+$u:+$gp1 --groups='' / env PATH="$PATH" \
+# With coreutils-8.22 and earlier, id would erroneously print
+# groups=$NON_ROOT_GID
+chroot --user=$NON_ROOT_USERNAME:+$gp1 --groups='' / env PATH="$PATH" \
id > out || fail=1
grep -F "groups=$gp1" out || { cat out; fail=1; }