aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--safepath.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/safepath.c b/safepath.c
index 270e486..b66db65 100644
--- a/safepath.c
+++ b/safepath.c
@@ -208,16 +208,9 @@ static int abs_path_check(const char *abspath)
* Non-root cannot access that symlink, and so is safe from it.
*/
char *sabspath = simplify_path(abspath);
-
- if (geteuid() == 0) {
- if (regexec(&bad_proc_rx, sabspath, 0, NULL, 0) == 0) {
- free(sabspath);
- return 0;
- }
- }
-
+ int res = regexec(&bad_proc_rx, sabspath, 0, NULL, 0);
free(sabspath);
- return 1;
+ return res != 0;
}
static int safepath_err(int eno)