aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/main.c')
-rw-r--r--src/firejail/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 4cb87aaa6..4eb92658c 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -1495,7 +1495,8 @@ int main(int argc, char **argv) {
1495 if (!ppath) 1495 if (!ppath)
1496 errExit("strdup"); 1496 errExit("strdup");
1497 1497
1498 if (access(ppath, R_OK)) { 1498 if (*ppath == ':' || access(ppath, R_OK) || is_dir(ppath)) {
1499 int has_colon = (*ppath == ':');
1499 char *ptr = ppath; 1500 char *ptr = ppath;
1500 while (*ptr != '/' && *ptr != '.' && *ptr != '\0') 1501 while (*ptr != '/' && *ptr != '.' && *ptr != '\0')
1501 ptr++; 1502 ptr++;
@@ -1508,7 +1509,7 @@ int main(int argc, char **argv) {
1508 1509
1509 // profile was not read in previously, try to see if 1510 // profile was not read in previously, try to see if
1510 // we were given a profile name. 1511 // we were given a profile name.
1511 if (!profile_find_firejail(ppath, 1)) { 1512 if (!profile_find_firejail(ppath + has_colon, 1)) {
1512 // do not fall through to default profile, 1513 // do not fall through to default profile,
1513 // because the user should be notified that 1514 // because the user should be notified that
1514 // given profile arg could not be used. 1515 // given profile arg could not be used.