diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/join.c | 2 | ||||
-rw-r--r-- | src/firejail/main.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/firejail/join.c b/src/firejail/join.c index 96d891a49..01fd6c41d 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c | |||
@@ -545,7 +545,7 @@ void join(pid_t pid, int argc, char **argv, int index) { | |||
545 | dbus_set_system_bus_env(); | 545 | dbus_set_system_bus_env(); |
546 | #endif | 546 | #endif |
547 | 547 | ||
548 | start_application(0, shfd, NULL); | 548 | start_application(arg_join_network || arg_join_filesystem, shfd, NULL); |
549 | 549 | ||
550 | __builtin_unreachable(); | 550 | __builtin_unreachable(); |
551 | } | 551 | } |
diff --git a/src/firejail/main.c b/src/firejail/main.c index c7da3c95c..72d930419 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -824,7 +824,6 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
824 | // try to join by name only | 824 | // try to join by name only |
825 | pid_t pid; | 825 | pid_t pid; |
826 | if (!read_pid(argv[i] + 16, &pid)) { | 826 | if (!read_pid(argv[i] + 16, &pid)) { |
827 | |||
828 | join(pid, argc, argv, i + 1); | 827 | join(pid, argc, argv, i + 1); |
829 | exit(0); | 828 | exit(0); |
830 | } | 829 | } |
@@ -843,6 +842,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
843 | exit(1); | 842 | exit(1); |
844 | } | 843 | } |
845 | 844 | ||
845 | if (argc <= (i+1)) | ||
846 | just_run_the_shell = 1; | ||
847 | cfg.original_program_index = i + 1; | ||
848 | |||
846 | // join sandbox by pid or by name | 849 | // join sandbox by pid or by name |
847 | pid_t pid = require_pid(argv[i] + 15); | 850 | pid_t pid = require_pid(argv[i] + 15); |
848 | join(pid, argc, argv, i + 1); | 851 | join(pid, argc, argv, i + 1); |
@@ -860,6 +863,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
860 | exit(1); | 863 | exit(1); |
861 | } | 864 | } |
862 | 865 | ||
866 | if (argc <= (i+1)) | ||
867 | just_run_the_shell = 1; | ||
868 | cfg.original_program_index = i + 1; | ||
869 | |||
863 | // join sandbox by pid or by name | 870 | // join sandbox by pid or by name |
864 | pid_t pid = require_pid(argv[i] + 18); | 871 | pid_t pid = require_pid(argv[i] + 18); |
865 | join(pid, argc, argv, i + 1); | 872 | join(pid, argc, argv, i + 1); |