<feed xmlns='http://www.w3.org/2005/Atom'>
<title>archsetup/tests/installer-steps/test_replace_sudoers_pacnew.py, branch main</title>
<subtitle>Builds a full dev workstation from a bare Arch Linux install.
</subtitle>
<id>https://git.cjennings.net/archsetup/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/archsetup/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/archsetup/'/>
<updated>2026-07-20T20:44:29+00:00</updated>
<entry>
<title>fix(installer): validate sudoers.pacnew with visudo before copying</title>
<updated>2026-07-20T20:44:29+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-07-20T20:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/archsetup/commit/?id=c80e85545be3b1ab98b69771f502b7b36102c7f6'/>
<id>urn:sha1:c80e85545be3b1ab98b69771f502b7b36102c7f6</id>
<content type='text'>
The installer copied /etc/sudoers.pacnew over /etc/sudoers with no validation. A malformed pacnew that sudo refuses to parse would replace a working sudoers with an unparseable one, locking out privilege escalation right before the NOPASSWD rule gets appended. replace_sudoers_pacnew now runs `visudo -cf` on the pacnew first and only copies a file that validates; a failure warns and leaves the current sudoers in place.

Extracted the logic into a function taking the pacnew and target as positional args defaulting to the system paths, so the guard can run against fixtures.
</content>
</entry>
</feed>
