From 02265d4cd84c9bcd973136ee199a9c1d5cb02621 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 2 Jan 2025 19:26:38 -0700 Subject: [PATCH] python: setup: almalinux: Create /etc/sudoers.d file for sd_nspawn to modify Signed-off-by: Nathan Chancellor --- python/setup/almalinux.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/setup/almalinux.py b/python/setup/almalinux.py index 92121d20..a0455693 100755 --- a/python/setup/almalinux.py +++ b/python/setup/almalinux.py @@ -92,12 +92,15 @@ def install_packages(): lib.setup.dnf(['reinstall', '-y', 'shadow-utils']) -def setup_sudo_umask(): +def setup_sudo(username): sudo_pam, sudo_pam_txt = lib.utils.path_and_text('/etc/pam.d/sudo') if sudo_pam_txt and 'pam_umask' not in sudo_pam_txt: with sudo_pam.open('a', encoding='utf-8') as file: file.write('session optional pam_umask.so\n') + # This is expected to exist by sd_nspawn when using sudo. + Path(f"/etc/sudoers.d/00_{username}").touch() + def setup_repos(): fedora.dnf_add_repo('https://cli.github.com/packages/rpm/gh-cli.repo')