diff options
-rw-r--r-- | src/firecfg/util.c | 12 | ||||
-rw-r--r-- | src/lib/firejail_user.c | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/firecfg/util.c b/src/firecfg/util.c index f0446ca8d..7ed86c36e 100644 --- a/src/firecfg/util.c +++ b/src/firecfg/util.c | |||
@@ -58,9 +58,15 @@ int which(const char *program) { | |||
58 | // use path2 to count the entries | 58 | // use path2 to count the entries |
59 | char *ptr = strtok(path2, ":"); | 59 | char *ptr = strtok(path2, ":"); |
60 | while (ptr) { | 60 | while (ptr) { |
61 | if (find(program, ptr)) { | 61 | // Ubuntu 18.04 is adding /snap/bin to PATH; |
62 | free(path2); | 62 | // they populate /snap/bin with simbolic links to /usr/bin/ programs; |
63 | return 1; | 63 | // most simlinked programs are not installed by default. |
64 | // Removing /snap/bin from our search | ||
65 | if (strcmp(ptr, "/snap/bin") != 0) { | ||
66 | if (find(program, ptr)) { | ||
67 | free(path2); | ||
68 | return 1; | ||
69 | } | ||
64 | } | 70 | } |
65 | ptr = strtok(NULL, ":"); | 71 | ptr = strtok(NULL, ":"); |
66 | } | 72 | } |
diff --git a/src/lib/firejail_user.c b/src/lib/firejail_user.c index 09a4da0e7..0cc0ac6c1 100644 --- a/src/lib/firejail_user.c +++ b/src/lib/firejail_user.c | |||
@@ -47,7 +47,8 @@ int firejail_user_check(const char *name) { | |||
47 | return 1; | 47 | return 1; |
48 | 48 | ||
49 | // other system users will run the program as is | 49 | // other system users will run the program as is |
50 | if (getuid() < UID_MIN || strcmp(name, "nobody") == 0) | 50 | uid_t uid = getuid(); |
51 | if ((uid < UID_MIN && uid != 0) || strcmp(name, "nobody") == 0) | ||
51 | return 0; | 52 | return 0; |
52 | 53 | ||
53 | // check file existence | 54 | // check file existence |