mirror of
https://github.com/apple/container.git
synced 2026-08-24 02:24:19 -05:00
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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user