Skip to content

Commit

Permalink
Don't check USER_NAME if it's not set
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad committed Nov 24, 2024
1 parent e02ba19 commit 69cf34d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-adduser/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

if grep -q "^${USER_NAME}" /etc/passwd; then
if [[ -n "$USER_NAME" ]] && grep -q "^${USER_NAME}" /etc/passwd; then
echo "*** USER_NAME cannot be set to an user that already exists in /etc/passwd. Halting init. ***"
sleep infinity
else
Expand Down

0 comments on commit 69cf34d

Please sign in to comment.