Update sudoers file to not include dots (#2080)

- Closes #1713.
- Files under /etc/sudoers.d/ must not contain dots as these
  will be ignored as "backup-files". When writing the sudoers
  file, replace `.` with `_` in the username to form the filename.
This commit is contained in:
Thomas Danielsson
2026-08-07 18:36:01 -07:00
committed by GitHub
parent 0190097d06
commit af405ffd5a
@@ -42,5 +42,6 @@ fi
chown -R "${CONTAINER_UID}:${CONTAINER_GID}" "${CONTAINER_HOME}"
mkdir -p /etc/sudoers.d
echo "${CONTAINER_USER} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/${CONTAINER_USER}"
chmod 440 "/etc/sudoers.d/${CONTAINER_USER}"
sudoers_file=$(echo "${CONTAINER_USER}" | tr '.' '_')
echo "${CONTAINER_USER} ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/${sudoers_file}"
chmod 440 "/etc/sudoers.d/${sudoers_file}"