mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 06:26:57 +02:00
fix(make_chroot): Write sudoers.d/90_cros directly.
Previously this called a file in the now deleted chroot_version_hooks.d which surprised me to say the least but it really shouldn't have...
This commit is contained in:
parent
74c4f21b68
commit
c4219e592e
@ -183,10 +183,20 @@ init_setup () {
|
|||||||
# Make sure the sudoers.d subdir exists as older stage3 base images lack it.
|
# Make sure the sudoers.d subdir exists as older stage3 base images lack it.
|
||||||
mkdir -p "${FLAGS_chroot}/etc/sudoers.d"
|
mkdir -p "${FLAGS_chroot}/etc/sudoers.d"
|
||||||
|
|
||||||
# Use the standardized upgrade script to setup proxied vars.
|
# Setup proxied vars.
|
||||||
load_environment_whitelist
|
load_environment_whitelist
|
||||||
bash -e "${SCRIPT_ROOT}/chroot_version_hooks.d/45_rewrite_sudoers.d" \
|
local extended_whitelist=(
|
||||||
"${FLAGS_chroot}" "${SUDO_USER}" "${ENVIRONMENT_WHITELIST[@]}"
|
"${ENVIRONMENT_WHITELIST[@]}"
|
||||||
|
CROS_WORKON_SRCROOT
|
||||||
|
PORTAGE_USERNAME
|
||||||
|
)
|
||||||
|
|
||||||
|
cat > "${FLAGS_chroot}/etc/sudoers.d/90_cros" <<EOF
|
||||||
|
Defaults env_keep += "${extended_whitelist[*]}"
|
||||||
|
%adm ALL=(ALL) ALL
|
||||||
|
root ALL=(ALL) ALL
|
||||||
|
${SUDO_USER} ALL=NOPASSWD: ALL
|
||||||
|
EOF
|
||||||
|
|
||||||
find "${FLAGS_chroot}/etc/"sudoers* -type f -exec chmod 0440 {} +
|
find "${FLAGS_chroot}/etc/"sudoers* -type f -exec chmod 0440 {} +
|
||||||
# Fix bad group for some.
|
# Fix bad group for some.
|
||||||
|
Loading…
Reference in New Issue
Block a user