diff options
Diffstat (limited to 'src/firejail/main.c')
-rw-r--r-- | src/firejail/main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index c9edcec29..9f963d203 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -571,7 +571,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
571 | exit(1); | 571 | exit(1); |
572 | } | 572 | } |
573 | char *path = argv[i + 1]; | 573 | char *path = argv[i + 1]; |
574 | invalid_filename(path); | 574 | invalid_filename(path, 0); // no globbing |
575 | if (strstr(path, "..")) { | 575 | if (strstr(path, "..")) { |
576 | fprintf(stderr, "Error: invalid file name %s\n", path); | 576 | fprintf(stderr, "Error: invalid file name %s\n", path); |
577 | exit(1); | 577 | exit(1); |
@@ -595,13 +595,13 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
595 | exit(1); | 595 | exit(1); |
596 | } | 596 | } |
597 | char *path1 = argv[i + 1]; | 597 | char *path1 = argv[i + 1]; |
598 | invalid_filename(path1); | 598 | invalid_filename(path1, 0); // no globbing |
599 | if (strstr(path1, "..")) { | 599 | if (strstr(path1, "..")) { |
600 | fprintf(stderr, "Error: invalid file name %s\n", path1); | 600 | fprintf(stderr, "Error: invalid file name %s\n", path1); |
601 | exit(1); | 601 | exit(1); |
602 | } | 602 | } |
603 | char *path2 = argv[i + 2]; | 603 | char *path2 = argv[i + 2]; |
604 | invalid_filename(path2); | 604 | invalid_filename(path2, 0); // no globbing |
605 | if (strstr(path2, "..")) { | 605 | if (strstr(path2, "..")) { |
606 | fprintf(stderr, "Error: invalid file name %s\n", path2); | 606 | fprintf(stderr, "Error: invalid file name %s\n", path2); |
607 | exit(1); | 607 | exit(1); |
@@ -625,7 +625,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
625 | exit(1); | 625 | exit(1); |
626 | } | 626 | } |
627 | char *path = argv[i + 1]; | 627 | char *path = argv[i + 1]; |
628 | invalid_filename(path); | 628 | invalid_filename(path, 0); // no globbing |
629 | if (strstr(path, "..")) { | 629 | if (strstr(path, "..")) { |
630 | fprintf(stderr, "Error: invalid file name %s\n", path); | 630 | fprintf(stderr, "Error: invalid file name %s\n", path); |
631 | exit(1); | 631 | exit(1); |
@@ -1433,7 +1433,7 @@ int main(int argc, char **argv) { | |||
1433 | } | 1433 | } |
1434 | 1434 | ||
1435 | // check name | 1435 | // check name |
1436 | invalid_filename(subdirname); | 1436 | invalid_filename(subdirname, 0); // no globbing |
1437 | if (strstr(subdirname, "..") || strstr(subdirname, "/")) { | 1437 | if (strstr(subdirname, "..") || strstr(subdirname, "/")) { |
1438 | fprintf(stderr, "Error: invalid overlay name\n"); | 1438 | fprintf(stderr, "Error: invalid overlay name\n"); |
1439 | exit(1); | 1439 | exit(1); |
@@ -1482,7 +1482,7 @@ int main(int argc, char **argv) { | |||
1482 | exit(1); | 1482 | exit(1); |
1483 | } | 1483 | } |
1484 | custom_profile_dir = expand_home(argv[i] + 15, cfg.homedir); | 1484 | custom_profile_dir = expand_home(argv[i] + 15, cfg.homedir); |
1485 | invalid_filename(custom_profile_dir); | 1485 | invalid_filename(custom_profile_dir, 0); // no globbing |
1486 | if (!is_dir(custom_profile_dir) || is_link(custom_profile_dir) || strstr(custom_profile_dir, "..")) { | 1486 | if (!is_dir(custom_profile_dir) || is_link(custom_profile_dir) || strstr(custom_profile_dir, "..")) { |
1487 | fprintf(stderr, "Error: invalid profile path\n"); | 1487 | fprintf(stderr, "Error: invalid profile path\n"); |
1488 | exit(1); | 1488 | exit(1); |
@@ -1541,7 +1541,7 @@ int main(int argc, char **argv) { | |||
1541 | } | 1541 | } |
1542 | 1542 | ||
1543 | 1543 | ||
1544 | invalid_filename(argv[i] + 9); | 1544 | invalid_filename(argv[i] + 9, 0); // no globbing |
1545 | 1545 | ||
1546 | // extract chroot dirname | 1546 | // extract chroot dirname |
1547 | cfg.chrootdir = argv[i] + 9; | 1547 | cfg.chrootdir = argv[i] + 9; |
@@ -2192,7 +2192,7 @@ int main(int argc, char **argv) { | |||
2192 | fprintf(stderr, "Error: --shell=none was already specified.\n"); | 2192 | fprintf(stderr, "Error: --shell=none was already specified.\n"); |
2193 | return 1; | 2193 | return 1; |
2194 | } | 2194 | } |
2195 | invalid_filename(argv[i] + 8); | 2195 | invalid_filename(argv[i] + 8, 0); // no globbing |
2196 | 2196 | ||
2197 | if (cfg.shell) { | 2197 | if (cfg.shell) { |
2198 | fprintf(stderr, "Error: only one user shell can be specified\n"); | 2198 | fprintf(stderr, "Error: only one user shell can be specified\n"); |