diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-20 15:44:29 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-20 15:44:29 -0500 |
| commit | a55800c79ab1fe55cba151018ad849750b4e5946 (patch) | |
| tree | 53da27e3db108accbba0a7cae760647ed5b7549c /docs/prototypes | |
| parent | 7b57eb8a801887b15e8c54f25aae167e07917bec (diff) | |
| download | archsetup-a55800c79ab1fe55cba151018ad849750b4e5946.tar.gz archsetup-a55800c79ab1fe55cba151018ad849750b4e5946.zip | |
fix(installer): validate sudoers.pacnew with visudo before copying
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.
Diffstat (limited to 'docs/prototypes')
0 files changed, 0 insertions, 0 deletions
