Skip to content

Commit 1e3c539

Browse files
committed
Address review comments on setup-permissions.sh
Restore explanatory comment for useradd exit code 9 handling and add trailing newline.
1 parent f0c8789 commit 1e3c539

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

aws_workload_credentials_provider_common/configuration/setup-permissions.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fi
2020

2121
groupadd -f "${PROVIDER_GROUP}"
2222
groupadd -f "${TOKEN_GROUP}"
23+
# useradd exits with code 9 if the user already exists — ignore that, but fail on any other error
2324
useradd -r -M -d "${PROVIDER_DIR}" -s /sbin/nologin -g "${PROVIDER_GROUP}" -G "${TOKEN_GROUP}" "${PROVIDER_USER}" || [ $? -eq 9 ]
2425

2526
#
@@ -30,4 +31,4 @@ mkdir -p "${PROVIDER_DIR}"
3031
chmod 755 "${PROVIDER_DIR}"
3132
chown "${PROVIDER_USER}" "${PROVIDER_DIR}"
3233

33-
echo "Permissions setup complete."
34+
echo "Permissions setup complete."

0 commit comments

Comments
 (0)