diff options
author | 2016-07-12 05:22:47 +0300 | |
---|---|---|
committer | 2016-07-12 05:22:47 +0300 | |
commit | 68b9c1382593fabc0e58862a45b4d010e8bb2256 (patch) | |
tree | 58627295fad7f78a8f8d2b7ee1aabcf1d0dd629b /src | |
parent | audit work (diff) | |
download | firejail-68b9c1382593fabc0e58862a45b4d010e8bb2256.tar.gz firejail-68b9c1382593fabc0e58862a45b4d010e8bb2256.tar.zst firejail-68b9c1382593fabc0e58862a45b4d010e8bb2256.zip |
Another command line quoting fix
1. Arguments passed to shell should always be quoted by single quotes.
2. Arguments passed directly to program (--shell=none) should never be quoted.
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/main.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index 232a57499..366b41f88 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -2022,11 +2022,7 @@ int main(int argc, char **argv) { | |||
2022 | char *ptr1 = cfg.command_line; | 2022 | char *ptr1 = cfg.command_line; |
2023 | char *ptr2 = cfg.window_title; | 2023 | char *ptr2 = cfg.window_title; |
2024 | for (i = 0; i < argcnt; i++) { | 2024 | for (i = 0; i < argcnt; i++) { |
2025 | // detect bash commands | 2025 | if (arg_shell_none){ |
2026 | if (strstr(argv[i + prog_index], "&&") || strstr(argv[i + prog_index], "||")) { | ||
2027 | sprintf(ptr1, "%s ", argv[i + prog_index]); | ||
2028 | } | ||
2029 | else if (arg_command){ | ||
2030 | sprintf(ptr1, "%s ", argv[i + prog_index]); | 2026 | sprintf(ptr1, "%s ", argv[i + prog_index]); |
2031 | } | 2027 | } |
2032 | else { | 2028 | else { |