mirror of
https://github.com/pi-hole/pi-hole.git
synced 2026-11-23 16:48:52 +00:00
pihole-FTL-prestart.sh runs as root (ExecStartPre=+) and, right after chown-ing /etc/pihole and /var/log/pihole to the pihole user, walks them with `find ... -exec chmod`. find only builds a list of paths and chmod acts on them afterwards, so the pihole user can swap a directory or file for a symlink in between; root's chmod then follows it and changes the permissions of a file pihole has no business touching (e.g. 0755 on /etc/shadow makes it world-readable). Reproduced against the stock script: with a pihole-owned loop flipping a directory name between "real directory" and "symlink to a root-only file", the file went from 0600 to 0755 within a handful of restarts. Run the three find calls as the pihole user instead. It owns everything below those directories, and a symlink pointing anywhere else only yields a permission error. Failure stays non-fatal so it can never stop FTL from starting. Add a deterministic test: with the script's chown stubbed out, a root-owned probe stays untouched only if the fix-up does not run as root. This is independent of the other changes in this series and applies to the same pre-existing code on master/development, so it can be cherry-picked on its own. Reported-by: Keith Linneman (LinnemanLabs) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Adam Warner <me@adamwarner.co.uk> |
||
|---|---|---|
| .. | ||
| gravity.db.sql | ||
| gravity_copy.sql | ||
| logrotate | ||
| pihole-FTL-poststop.sh | ||
| pihole-FTL-prestart.sh | ||
| pihole-FTL.openrc | ||
| pihole-FTL.service | ||
| pihole-FTL.systemd | ||
| pihole.cron | ||