diff options
-rw-r--r-- | src/firejail/cmdline.c | 10 | ||||
-rw-r--r-- | src/firejail/sandbox.c | 8 | ||||
-rwxr-xr-x | test/appimage/appimage-args.exp | 10 | ||||
-rwxr-xr-x | test/appimage/appimage-v1.exp | 10 | ||||
-rwxr-xr-x | test/appimage/appimage-v2.exp | 11 |
5 files changed, 44 insertions, 5 deletions
diff --git a/src/firejail/cmdline.c b/src/firejail/cmdline.c index 60301ed58..e62ed8d33 100644 --- a/src/firejail/cmdline.c +++ b/src/firejail/cmdline.c | |||
@@ -153,6 +153,9 @@ void build_cmdline(char **command_line, char **window_title, int argc, char **ar | |||
153 | errExit("malloc"); | 153 | errExit("malloc"); |
154 | 154 | ||
155 | quote_cmdline(*command_line, *window_title, len, argc, argv, index); | 155 | quote_cmdline(*command_line, *window_title, len, argc, argv, index); |
156 | |||
157 | if (arg_debug) | ||
158 | printf("Building quoted command line: %s\n", *command_line); | ||
156 | 159 | ||
157 | assert(*command_line); | 160 | assert(*command_line); |
158 | assert(*window_title); | 161 | assert(*window_title); |
@@ -163,7 +166,9 @@ void build_appimage_cmdline(char **command_line, char **window_title, int argc, | |||
163 | // the program should exit with an error before entering this function | 166 | // the program should exit with an error before entering this function |
164 | assert(index != -1); | 167 | assert(index != -1); |
165 | 168 | ||
166 | // unsigned argcount = argc - index; | 169 | if (arg_debug) |
170 | printf("Building AppImage command line: %s\n", *command_line); | ||
171 | |||
167 | 172 | ||
168 | int len1 = cmdline_length(argc, argv, index); // length of argv w/o changes | 173 | int len1 = cmdline_length(argc, argv, index); // length of argv w/o changes |
169 | int len2 = cmdline_length(1, &argv[index], 0); // apptest.AppImage | 174 | int len2 = cmdline_length(1, &argv[index], 0); // apptest.AppImage |
@@ -198,6 +203,9 @@ void build_appimage_cmdline(char **command_line, char **window_title, int argc, | |||
198 | if (asprintf(command_line, "'%s' %s", tmp1, command_line_tmp + len2) == -1) | 203 | if (asprintf(command_line, "'%s' %s", tmp1, command_line_tmp + len2) == -1) |
199 | errExit("asprintf"); | 204 | errExit("asprintf"); |
200 | 205 | ||
206 | if (arg_debug) | ||
207 | printf("AppImage quoted command line: %s\n", *command_line); | ||
208 | |||
201 | // free strdup | 209 | // free strdup |
202 | free(tmp1); | 210 | free(tmp1); |
203 | } | 211 | } |
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index d1557e8b2..f9e59f1ed 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c | |||
@@ -865,6 +865,14 @@ int sandbox(void* sandbox_arg) { | |||
865 | } | 865 | } |
866 | } | 866 | } |
867 | } | 867 | } |
868 | if (arg_debug) { | ||
869 | char *cpath = get_current_dir_name(); | ||
870 | if (cpath) { | ||
871 | printf("Current directory: %s\n", cpath); | ||
872 | free(cpath); | ||
873 | } | ||
874 | } | ||
875 | |||
868 | 876 | ||
869 | // set nice | 877 | // set nice |
870 | if (arg_nice) { | 878 | if (arg_nice) { |
diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp index f304f5b94..b93ad509d 100755 --- a/test/appimage/appimage-args.exp +++ b/test/appimage/appimage-args.exp | |||
@@ -7,6 +7,7 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | set appimage_id $spawn_id | ||
10 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage testfile\r" | 11 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage testfile\r" |
11 | expect { | 12 | expect { |
12 | timeout {puts "TESTING ERROR 1\n";exit} | 13 | timeout {puts "TESTING ERROR 1\n";exit} |
@@ -91,7 +92,14 @@ after 100 | |||
91 | 92 | ||
92 | spawn $env(SHELL) | 93 | spawn $env(SHELL) |
93 | send -- "firejail --shutdown=appimage-test\r" | 94 | send -- "firejail --shutdown=appimage-test\r" |
94 | sleep 3 | 95 | |
96 | set spawn_id $appimage_id | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 15\n";exit} | ||
99 | "AppImage unmounted" | ||
100 | } | ||
101 | |||
102 | after 100 | ||
95 | 103 | ||
96 | puts "\nall done\n" | 104 | puts "\nall done\n" |
97 | 105 | ||
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp index d9b64af1d..3364ff677 100755 --- a/test/appimage/appimage-v1.exp +++ b/test/appimage/appimage-v1.exp | |||
@@ -6,6 +6,7 @@ | |||
6 | set timeout 10 | 6 | set timeout 10 |
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | set appimage_id $spawn_id | ||
9 | 10 | ||
10 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r" | 11 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r" |
11 | expect { | 12 | expect { |
@@ -79,7 +80,14 @@ after 100 | |||
79 | 80 | ||
80 | spawn $env(SHELL) | 81 | spawn $env(SHELL) |
81 | send -- "firejail --shutdown=appimage-test\r" | 82 | send -- "firejail --shutdown=appimage-test\r" |
82 | sleep 3 | 83 | |
84 | set spawn_id $appimage_id | ||
85 | expect { | ||
86 | timeout {puts "TESTING ERROR 7\n";exit} | ||
87 | "AppImage unmounted" | ||
88 | } | ||
89 | |||
90 | after 100 | ||
83 | 91 | ||
84 | puts "\nall done\n" | 92 | puts "\nall done\n" |
85 | 93 | ||
diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp index 10443a1c7..ad741c559 100755 --- a/test/appimage/appimage-v2.exp +++ b/test/appimage/appimage-v2.exp | |||
@@ -6,8 +6,9 @@ | |||
6 | set timeout 10 | 6 | set timeout 10 |
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | set appimage_id $spawn_id | ||
9 | 10 | ||
10 | send -- "firejail --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" | 11 | send -- "firejail --name=appimage-test --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" |
11 | expect { | 12 | expect { |
12 | timeout {puts "TESTING ERROR 1\n";exit} | 13 | timeout {puts "TESTING ERROR 1\n";exit} |
13 | "Child process initialized" | 14 | "Child process initialized" |
@@ -79,7 +80,13 @@ after 100 | |||
79 | 80 | ||
80 | spawn $env(SHELL) | 81 | spawn $env(SHELL) |
81 | send -- "firejail --shutdown=appimage-test\r" | 82 | send -- "firejail --shutdown=appimage-test\r" |
82 | sleep 3 | 83 | set spawn_id $appimage_id |
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 7\n";exit} | ||
86 | "AppImage unmounted" | ||
87 | } | ||
88 | |||
89 | after 100 | ||
83 | 90 | ||
84 | puts "\nall done\n" | 91 | puts "\nall done\n" |
85 | 92 | ||