diff options
Diffstat (limited to 'src/firejail/profile.c')
-rw-r--r-- | src/firejail/profile.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index a85c8f815..5f5d94ddf 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -25,7 +25,8 @@ extern char *xephyr_screen; | |||
25 | #define MAX_READ 8192 // line buffer for profile files | 25 | #define MAX_READ 8192 // line buffer for profile files |
26 | 26 | ||
27 | // find and read the profile specified by name from dir directory | 27 | // find and read the profile specified by name from dir directory |
28 | int profile_find(const char *name, const char *dir, int add_ext) { | 28 | // return 1 if a profile was found |
29 | static int profile_find(const char *name, const char *dir, int add_ext) { | ||
29 | EUID_ASSERT(); | 30 | EUID_ASSERT(); |
30 | assert(name); | 31 | assert(name); |
31 | assert(dir); | 32 | assert(dir); |
@@ -64,6 +65,7 @@ int profile_find(const char *name, const char *dir, int add_ext) { | |||
64 | } | 65 | } |
65 | 66 | ||
66 | // search and read the profile specified by name from firejail directories | 67 | // search and read the profile specified by name from firejail directories |
68 | // return 1 if a profile was found | ||
67 | int profile_find_firejail(const char *name, int add_ext) { | 69 | int profile_find_firejail(const char *name, int add_ext) { |
68 | // look for a profile in ~/.config/firejail directory | 70 | // look for a profile in ~/.config/firejail directory |
69 | char *usercfgdir; | 71 | char *usercfgdir; |
@@ -1438,7 +1440,13 @@ void profile_read(const char *fname) { | |||
1438 | ptr2++; | 1440 | ptr2++; |
1439 | // profile path contains no / chars, do a search | 1441 | // profile path contains no / chars, do a search |
1440 | if (*ptr2 == '\0') { | 1442 | if (*ptr2 == '\0') { |
1441 | profile_find_firejail(newprofile, 0); | 1443 | int rv = profile_find_firejail(newprofile, 0); // returns 1 if a profile was found in sysconfig directory |
1444 | if (!rv) { | ||
1445 | // maybe this is a file in the local working directory? | ||
1446 | // it will stop the sandbox if not! | ||
1447 | // Note: if the file ends in .local it will not stop the program | ||
1448 | profile_read(newprofile); | ||
1449 | } | ||
1442 | } | 1450 | } |
1443 | else { | 1451 | else { |
1444 | profile_read(newprofile); | 1452 | profile_read(newprofile); |