-
-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Labels
Description
I think that this code, 404 to 416 in alpine-chroot-install,
./enter-chroot <<-EOF
set -e
apk update
apk add $ALPINE_PACKAGES
if [ -d /etc/sudoers.d ] && [ ! -e /etc/sudoers.d/wheel ]; then
echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
fi
if [ -n "${SUDO_USER:-}" ]; then
adduser -u "${SUDO_UID:-1000}" -G users -s /bin/sh -D "${SUDO_USER:-}" || true
fi
EOFis supposed to setup the user running the command as "sudo" capable if the "sudo" package is included with -p sudo. At the moment this fails because the user isn't added the wheel group.
I think that this line
adduser -u "${SUDO_UID:-1000}" -G users -s /bin/sh -D "${SUDO_USER:-}" || true
should be
adduser -u "${SUDO_UID:-1000}" -G users,wheel -s /bin/sh -D "${SUDO_USER:-}" || true
As an aside, I thought that the preferred option was to use doas in Alpine and not sudo.
My current manual workaround is to add the user to the wheel group in /etc/group after script completion.
Reactions are currently unavailable