diff options
author | netblue30 <netblue30@yahoo.com> | 2016-04-12 13:10:01 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-04-12 13:10:01 -0400 |
commit | 2f0e5748a03566a085c020528be947fcfba1af9e (patch) | |
tree | a0e7b8617bcf5cfbd77f288e903cf88042cd4296 | |
parent | added /usr/local/bin to private-bin (diff) | |
parent | fs_bin.c: typo (diff) | |
download | firejail-2f0e5748a03566a085c020528be947fcfba1af9e.tar.gz firejail-2f0e5748a03566a085c020528be947fcfba1af9e.tar.zst firejail-2f0e5748a03566a085c020528be947fcfba1af9e.zip |
Merge pull request #427 from avoidr/paths_fix
Paths fix
-rw-r--r-- | src/firejail/fs.c | 4 | ||||
-rw-r--r-- | src/firejail/fs_bin.c | 2 | ||||
-rw-r--r-- | src/firejail/paths.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/firejail/fs.c b/src/firejail/fs.c index 4695d8d26..b4eb708d8 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c | |||
@@ -501,12 +501,12 @@ void fs_blacklist(void) { | |||
501 | char *new_name = expand_home(ptr, homedir); | 501 | char *new_name = expand_home(ptr, homedir); |
502 | ptr = new_name; | 502 | ptr = new_name; |
503 | 503 | ||
504 | // expand path macro - look for the file in /bin, /usr/bin, /sbin and /usr/sbin directories | 504 | // expand path macro - look for the file in /usr/local/bin, /bin, /usr/bin, /sbin and /usr/sbin directories |
505 | if (ptr) { | 505 | if (ptr) { |
506 | if (strncmp(ptr, "${PATH}", 7) == 0) { | 506 | if (strncmp(ptr, "${PATH}", 7) == 0) { |
507 | char *fname = ptr + 7; | 507 | char *fname = ptr + 7; |
508 | size_t fname_len = strlen(fname); | 508 | size_t fname_len = strlen(fname); |
509 | char **paths = build_paths(); //{"/bin", "/sbin", "/usr/bin", "/usr/sbin", NULL}; | 509 | char **paths = build_paths(); //{"/usr/local/bin", "/bin", "/usr/bin/", "/sbin", "/usr/sbin", NULL}; |
510 | int i = 0; | 510 | int i = 0; |
511 | while (paths[i] != NULL) { | 511 | while (paths[i] != NULL) { |
512 | char *path = paths[i]; | 512 | char *path = paths[i]; |
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c index fe1ac9243..87d63c6e6 100644 --- a/src/firejail/fs_bin.c +++ b/src/firejail/fs_bin.c | |||
@@ -227,7 +227,7 @@ void fs_private_bin_list(void) { | |||
227 | // wait for the child to finish | 227 | // wait for the child to finish |
228 | waitpid(child, NULL, 0); | 228 | waitpid(child, NULL, 0); |
229 | 229 | ||
230 | // moun-bind | 230 | // mount-bind |
231 | i = 0; | 231 | i = 0; |
232 | while (paths[i]) { | 232 | while (paths[i]) { |
233 | if (arg_debug) | 233 | if (arg_debug) |
diff --git a/src/firejail/paths.c b/src/firejail/paths.c index 3d4b8cd8e..74b8dfe55 100644 --- a/src/firejail/paths.c +++ b/src/firejail/paths.c | |||
@@ -75,9 +75,10 @@ char **build_paths(void) { | |||
75 | memset(paths, 0, sizeof(char *) * cnt); | 75 | memset(paths, 0, sizeof(char *) * cnt); |
76 | 76 | ||
77 | // add default paths | 77 | // add default paths |
78 | add_path("/usr/local/bin"); | ||
78 | add_path("/bin"); | 79 | add_path("/bin"); |
79 | add_path("/sbin"); | ||
80 | add_path("/usr/bin"); | 80 | add_path("/usr/bin"); |
81 | add_path("/sbin"); | ||
81 | add_path("/usr/sbin"); | 82 | add_path("/usr/sbin"); |
82 | 83 | ||
83 | path2 = strdup(path1); | 84 | path2 = strdup(path1); |