aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-17 16:25:43 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-17 16:56:58 -0300
commit497c39e89ace26b82c782b46e547afb051b771b4 (patch)
treecf8b230bba8922c23d8d9a465774ee6e7227b5e1
parentbuild(deps): bump github/codeql-action from 2.1.37 to 2.1.38 (diff)
downloadfirejail-497c39e89ace26b82c782b46e547afb051b771b4.tar.gz
firejail-497c39e89ace26b82c782b46e547afb051b771b4.tar.zst
firejail-497c39e89ace26b82c782b46e547afb051b771b4.zip
Stop forwarding own double-dash to the shell
Currently, if double-dash ("--") is passed to firejail, it is forwarded to the user shell: $ firejail --debug --noprofile -- echo test 2>&1 | grep -e execvp -e test Building quoted command line: 'echo' 'test' Building quoted command line: 'echo' 'test' Running 'echo' 'test' command through /bin/bash execvp argument 0: /bin/bash execvp argument 1: -c execvp argument 2: -- execvp argument 3: 'echo' 'test' test This causes issues when the user shell does not accept "--" / is not POSIX-compatible: $ /bin/bash -c -- 'echo test' test $ /bin/fish -c -- 'echo test' fish: Unknown command: -- fish: -- ^ Fixes #5599. Relates to #3434. Reported-by: @iltep64 Reported-by: @ferreum
-rw-r--r--src/firejail/sandbox.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index 77fe73174..1afb3a293 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -580,8 +580,6 @@ void start_application(int no_sandbox, int fd, char *set_sandbox_status) {
580 if (arg_debug) 580 if (arg_debug)
581 printf("Running %s command through %s\n", cfg.command_line, cfg.usershell); 581 printf("Running %s command through %s\n", cfg.command_line, cfg.usershell);
582 arg[index++] = "-c"; 582 arg[index++] = "-c";
583 if (arg_doubledash)
584 arg[index++] = "--";
585 arg[index++] = cfg.command_line; 583 arg[index++] = cfg.command_line;
586 } 584 }
587 else if (login_shell) { 585 else if (login_shell) {