aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/main.c8
-rwxr-xr-xtest/environment/environment.sh3
-rwxr-xr-xtest/environment/shell-none.exp47
-rwxr-xr-xtest/profiles/profile_appname.exp4
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) {
2819just_run_the_shell = 1; 2819 just_run_the_shell = 1;
2820if (!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)"
36echo "TESTING: environment variables (test/environment/env.exp)" 36echo "TESTING: environment variables (test/environment/env.exp)"
37./env.exp 37./env.exp
38 38
39echo "TESTING: shell none(test/environment/shell-none.exp)"
40./shell-none.exp
41
42which dash 2>/dev/null 39which dash 2>/dev/null
43if [ "$?" -eq 0 ]; 40if [ "$?" -eq 0 ];
44then 41then
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --shell=none\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "shell=none configured, but no program specified"
14}
15sleep 1
16
17send -- "firejail --profile=shell-none.profile\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "shell=none configured, but no program specified"
21}
22after 100
23
24send -- "firejail --shell=none ls\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
28}
29expect {
30 timeout {puts "TESTING ERROR 3\n";exit}
31 "environment.sh"
32}
33after 100
34
35send -- "firejail --profile=shell-none.profile ls\r"
36expect {
37 timeout {puts "TESTING ERROR 4\n";exit}
38 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
39}
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "environment.sh"
43}
44after 100
45
46
47puts "\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}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "shell=none configured, but no program specified"
22}
23 19
24after 100 20after 100
25puts "\nall done\n" 21puts "\nall done\n"