From 375cba7a4ddb36fbb8dbe96c66002b8b13b5a39c Mon Sep 17 00:00:00 2001 From: casjay Date: Thu, 1 Aug 2024 14:52:41 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/functions/entrypoint.sh --- rootfs/usr/local/etc/docker/functions/entrypoint.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index dfb4e4e..9655491 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -505,8 +505,10 @@ __create_service_user() { grep -sq "^$create_user:" "/etc/passwd" && grep -sq "^$create_group:" "/etc/group" && return [ "$create_user" = "root" ] && [ "$create_group" = "root" ] && return 0 if [ "$RUNAS_USER" != "root" ] && [ "$RUNAS_USER" != "" ]; then - [ "$create_user" = "root" ] && create_user="$RUNAS_USER" - [ "$create_group" = "root" ] && create_group="$RUNAS_USER" + create_user="$RUNAS_USER" + create_group="$RUNAS_USER" + create_uid="${create_uid:-1000}" + create_gid="${create_gid:-1000}" fi create_uid="$(__get_uid "$set_user" || echo "$create_uid")" create_gid="$(__get_gid "$set_user" || echo "$create_gid")" @@ -526,11 +528,11 @@ __create_service_user() { fi if ! __check_for_user "$create_user"; then echo "creating system user $create_user" - useradd --force --system -u $create_uid -g $create_group -c "Account for $create_user" -d "$create_home_dir" -s /bin/false $create_user 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt" >/dev/null + useradd --system -u $create_uid -g $create_group -c "Account for $create_user" -d "$create_home_dir" -s /bin/false $create_user 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt" >/dev/null fi grep -qs "$create_group" "/etc/group" || exitStatus=$((exitCode + 1)) grep -qs "$create_user" "/etc/passwd" || exitStatus=$((exitCode + 1)) - [ $exitStatus -eq 0 ] && export WORK_DIR="${set_home_dir:-}" + [ $exitStatus -eq 0 ] && export WORK_DIR="${set_home_dir:-}" && mkdir -p "$WORK_DIR" export SERVICE_UID="$create_uid" SERVICE_GID="$create_gid" export SERVICE_USER="$create_user" SERVICE_GROUP="$create_group" return $exitStatus