From 7e277eac0018420ba946578fc328a5e21ab5fc96 Mon Sep 17 00:00:00 2001 From: Dark Dragon Date: Tue, 7 Apr 2026 22:38:01 +0200 Subject: [PATCH] Allow specifying the user name via environment variable --- src/common/scripts/generate_container_user | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/scripts/generate_container_user b/src/common/scripts/generate_container_user index 6c7b32b0..05d46743 100644 --- a/src/common/scripts/generate_container_user +++ b/src/common/scripts/generate_container_user @@ -1,7 +1,8 @@ # Set current user in nss_wrapper +USER=${USER:-default} USER_ID=$(id -u) GROUP_ID=$(id -g) -echo "USER_ID: $USER_ID, GROUP_ID: $GROUP_ID" +echo "USER: $USER, USER_ID: $USER_ID, GROUP_ID: $GROUP_ID" if [ x"$USER_ID" != x"0" ]; then @@ -10,7 +11,7 @@ if [ x"$USER_ID" != x"0" ]; then cat /etc/passwd > $NSS_WRAPPER_PASSWD - echo "default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> $NSS_WRAPPER_PASSWD + echo "${USER}:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/bin/bash" >> $NSS_WRAPPER_PASSWD export NSS_WRAPPER_PASSWD export NSS_WRAPPER_GROUP