Skip to content

Commit

Permalink
python: setup: almalinux: Create /etc/sudoers.d file for sd_nspawn to…
Browse files Browse the repository at this point in the history
… modify

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Jan 3, 2025
1 parent d5c627b commit 02265d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/setup/almalinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 02265d4

Please sign in to comment.