diff options
-rw-r--r-- | src/firejail/main.c | 8 | ||||
-rwxr-xr-x | test/environment/environment.sh | 3 | ||||
-rwxr-xr-x | test/environment/shell-none.exp | 47 | ||||
-rwxr-xr-x | test/profiles/profile_appname.exp | 4 |
4 files changed, 3 insertions, 59 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index 695f018a5..1554209b9 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -2816,11 +2816,9 @@ int main(int argc, char **argv, char **envp) { | |||
2816 | 2816 | ||
2817 | // prog_index could still be -1 if no program was specified | 2817 | // prog_index could still be -1 if no program was specified |
2818 | if (prog_index == -1 && arg_shell_none) { | 2818 | if (prog_index == -1 && arg_shell_none) { |
2819 | just_run_the_shell = 1; | 2819 | just_run_the_shell = 1; |
2820 | if (!cfg.shell) | 2820 | if (!cfg.shell) |
2821 | cfg.shell = cfg.usershell; | 2821 | cfg.shell = cfg.usershell; |
2822 | // fprintf(stderr, "Error: shell=none configured, but no program specified\n"); | ||
2823 | // exit(1); | ||
2824 | } | 2822 | } |
2825 | 2823 | ||
2826 | // check trace configuration | 2824 | // check trace configuration |
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index 2b77973ac..9e58fdf95 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -36,9 +36,6 @@ echo "TESTING: extract command (extract_command.exp)" | |||
36 | echo "TESTING: environment variables (test/environment/env.exp)" | 36 | echo "TESTING: environment variables (test/environment/env.exp)" |
37 | ./env.exp | 37 | ./env.exp |
38 | 38 | ||
39 | echo "TESTING: shell none(test/environment/shell-none.exp)" | ||
40 | ./shell-none.exp | ||
41 | |||
42 | which dash 2>/dev/null | 39 | which dash 2>/dev/null |
43 | if [ "$?" -eq 0 ]; | 40 | if [ "$?" -eq 0 ]; |
44 | then | 41 | then |
diff --git a/test/environment/shell-none.exp b/test/environment/shell-none.exp deleted file mode 100755 index 512e2efc2..000000000 --- a/test/environment/shell-none.exp +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2022 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --shell=none\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "shell=none configured, but no program specified" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "firejail --profile=shell-none.profile\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "shell=none configured, but no program specified" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "firejail --shell=none ls\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "environment.sh" | ||
32 | } | ||
33 | after 100 | ||
34 | |||
35 | send -- "firejail --profile=shell-none.profile ls\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 4\n";exit} | ||
38 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 5\n";exit} | ||
42 | "environment.sh" | ||
43 | } | ||
44 | after 100 | ||
45 | |||
46 | |||
47 | puts "\nall done\n" | ||
diff --git a/test/profiles/profile_appname.exp b/test/profiles/profile_appname.exp index fce278b4c..c178e8e00 100755 --- a/test/profiles/profile_appname.exp +++ b/test/profiles/profile_appname.exp | |||
@@ -16,10 +16,6 @@ expect { | |||
16 | timeout {puts "TESTING ERROR 1\n";exit} | 16 | timeout {puts "TESTING ERROR 1\n";exit} |
17 | "Reading profile /etc/firejail/firefox-common.profile" | 17 | "Reading profile /etc/firejail/firefox-common.profile" |
18 | } | 18 | } |
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "shell=none configured, but no program specified" | ||
22 | } | ||
23 | 19 | ||
24 | after 100 | 20 | after 100 |
25 | puts "\nall done\n" | 21 | puts "\nall done\n" |