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 | c80e85545be3b1ab98b69771f502b7b36102c7f6 (patch) | |
| tree | 53da27e3db108accbba0a7cae760647ed5b7549c /Makefile | |
| parent | 577088700e78afc9ee1d5cad352768cdf108ffe8 (diff) | |
| download | archsetup-c80e85545be3b1ab98b69771f502b7b36102c7f6.tar.gz archsetup-c80e85545be3b1ab98b69771f502b7b36102c7f6.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 'Makefile')
0 files changed, 0 insertions, 0 deletions
