Skip to content

Commit ba29652

Browse files
committed
CI: give the rootless test user some supplemental groups
Exercise preservation of supplemental groups in the tests that use `buildah build` and `buildah from` with `--group-add keep-groups`. Signed-off-by: Nalin Dahyabhai <[email protected]>
1 parent 22201db commit ba29652

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/cirrus/lib.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,12 @@ setup_rootless() {
298298
# Guarantee independence from specific values
299299
rootless_uid=$[RANDOM+1000]
300300
rootless_gid=$[RANDOM+1000]
301-
msg "creating $rootless_uid:$rootless_gid $ROOTLESS_USER user"
301+
rootless_supplemental_gid=$[RANDOM+1000]
302+
msg "creating $rootless_uid:$rootless_gid,$rootless_supplemental_gid $ROOTLESS_USER user"
302303
groupadd -g $rootless_gid $ROOTLESS_USER
303-
useradd -g $rootless_gid -u $rootless_uid --no-user-group --create-home $ROOTLESS_USER
304+
groupadd -g $rootless_supplemental_gid ${ROOTLESS_USER}sg
305+
useradd -g $rootless_gid -G ${ROOTLESS_USER}sg -u $rootless_uid --no-user-group --create-home $ROOTLESS_USER
306+
id $ROOTLESS_USER
304307

305308
# We also set up rootless user for image-scp tests (running as root)
306309
if [[ $PRIV_NAME = "rootless" ]]; then

0 commit comments

Comments
 (0)