diff options
author | 2018-04-29 10:50:29 -0400 | |
---|---|---|
committer | 2018-04-29 10:50:29 -0400 | |
commit | 365317dbd11d786ee36420b384d46659ef4a9b97 (patch) | |
tree | b8a305f6bc164f554d40a0637a6faa889b6ef791 /src | |
parent | firecfg fix for Ubuntu 18.04 (diff) | |
download | firejail-365317dbd11d786ee36420b384d46659ef4a9b97.tar.gz firejail-365317dbd11d786ee36420b384d46659ef4a9b97.tar.zst firejail-365317dbd11d786ee36420b384d46659ef4a9b97.zip |
fix user database access
Diffstat (limited to 'src')
-rw-r--r-- | src/firecfg/util.c | 12 |
1 files changed, 9 insertions, 3 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 | } |