aboutsummaryrefslogtreecommitdiffstats
path: root/safepath.c
Commit message (Collapse)AuthorAgeFilesLines
* Map safepath errors to strings.Kaz Kylheku2022-07-231-0/+21
| | | | | | | * safepath.[ch]: New function, safepath_strerr. * testsp.c (main): Use new function to print message, rather than integer code.
* Check using effective UID, not real.Kaz Kylheku2022-07-231-3/+3
| | | | | | | | | | | | | | | | | | | We don't want to behave like the access function, which is intended for use in setuid programs to determine what the original user can access. The purpose of safepath_check is to check whether the filesystem can harm the caller. For that, the effective identity that is being wielded should be used. A setuid executable might have a real user ID bob, but effective root. Root does not trust bob; root doesn't want to follow a symlink controlled by bob. * safepath.c (safe_group, tamper_proof): Replace getuid calls with geteuid. * README.md: Updated text.
* Fix some inaccurate comments.Kaz Kylheku2022-07-231-11/+10
| | | | | * safepath.c (tamper_proof, safepath_check): Reword outdated comments.
* safepath: new project.Kaz Kylheku2022-07-221-0/+384