diff options
author | netblue30 <netblue30@yahoo.com> | 2015-11-28 07:52:23 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-11-28 07:52:23 -0500 |
commit | 544a49602b857d4fe46ebe5bb83f0c48c6048f18 (patch) | |
tree | 5d4637caaa588eb0d816fd809790caf5410219e5 | |
parent | profile cleanup, addinghexchat profile (diff) | |
download | firejail-544a49602b857d4fe46ebe5bb83f0c48c6048f18.tar.gz firejail-544a49602b857d4fe46ebe5bb83f0c48c6048f18.tar.zst firejail-544a49602b857d4fe46ebe5bb83f0c48c6048f18.zip |
bash command fix
-rw-r--r-- | src/firejail/main.c | 8 | ||||
-rwxr-xr-x | test/test.sh | 16 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index a6e95e963..0e0d685c4 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -1214,7 +1214,13 @@ int main(int argc, char **argv) { | |||
1214 | errExit("malloc"); | 1214 | errExit("malloc"); |
1215 | char *ptr = cfg.command_line; | 1215 | char *ptr = cfg.command_line; |
1216 | for (i = 0; i < argcnt; i++) { | 1216 | for (i = 0; i < argcnt; i++) { |
1217 | sprintf(ptr, "\"%s\" ", argv[i + prog_index]); | 1217 | // detect bash commands |
1218 | if (strstr(argv[i + prog_index], "&&") || strstr(argv[i + prog_index], "||")) { | ||
1219 | sprintf(ptr, "%s ", argv[i + prog_index]); | ||
1220 | } | ||
1221 | else { | ||
1222 | sprintf(ptr, "\"%s\" ", argv[i + prog_index]); | ||
1223 | } | ||
1218 | ptr += strlen(ptr); | 1224 | ptr += strlen(ptr); |
1219 | } | 1225 | } |
1220 | } | 1226 | } |
diff --git a/test/test.sh b/test/test.sh index aaae2a981..74e928473 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -287,14 +287,14 @@ else | |||
287 | echo "TESTING: weechat not found" | 287 | echo "TESTING: weechat not found" |
288 | fi | 288 | fi |
289 | 289 | ||
290 | #which wine | 290 | which wine |
291 | #if [ "$?" -eq 0 ]; | 291 | if [ "$?" -eq 0 ]; |
292 | #then | 292 | then |
293 | # echo "TESTING: wine" | 293 | echo "TESTING: wine" |
294 | # ./wine.exp | 294 | ./wine.exp |
295 | #else | 295 | else |
296 | # echo "TESTING: wine not found" | 296 | echo "TESTING: wine not found" |
297 | #fi | 297 | fi |
298 | 298 | ||
299 | 299 | ||
300 | 300 | ||