aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/fs_whitelist.c4
-rwxr-xr-xtest/environment/doubledash.exp2
-rwxr-xr-xtest/root/firecfg.exp8
-rwxr-xr-xtest/stress/stress.sh4
-rwxr-xr-xtest/utils/firecfg-fix.exp25
-rwxr-xr-xtest/utils/utils.sh5
6 files changed, 44 insertions, 4 deletions
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c
index 7ad5ffeb8..59dff5517 100644
--- a/src/firejail/fs_whitelist.c
+++ b/src/firejail/fs_whitelist.c
@@ -438,8 +438,8 @@ void fs_whitelist(void) {
438 if (strncmp(new_name, cfg.homedir, strlen(cfg.homedir)) == 0) { 438 if (strncmp(new_name, cfg.homedir, strlen(cfg.homedir)) == 0) {
439 // whitelisting home directory is disabled if --private option is present 439 // whitelisting home directory is disabled if --private option is present
440 if (arg_private) { 440 if (arg_private) {
441 if (arg_debug || arg_debug_whitelists) 441 if (!arg_quiet)
442 printf("Removed whitelist path %s, --private option is present\n", entry->data); 442 printf("Warning: \"%s\" disabled by --private\n", entry->data);
443 443
444 *entry->data = '\0'; 444 *entry->data = '\0';
445 continue; 445 continue;
diff --git a/test/environment/doubledash.exp b/test/environment/doubledash.exp
index 2eaa7d9ce..ed0419f2d 100755
--- a/test/environment/doubledash.exp
+++ b/test/environment/doubledash.exp
@@ -57,4 +57,4 @@ expect {
57 57
58after 100 58after 100
59 59
60puts "\n" 60puts "\nall done\n"
diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp
index c9085e8c8..8961aed60 100755
--- a/test/root/firecfg.exp
+++ b/test/root/firecfg.exp
@@ -43,4 +43,12 @@ expect {
43 "/usr/local/bin/firefox" 43 "/usr/local/bin/firefox"
44} 44}
45after 100 45after 100
46
47send -- "firecfg --fix\r"
48expect {
49 timeout {puts "TESTING ERROR 5\n";exit}
50 "this option is not supported for root user"
51}
52
53after 100
46puts "\nall done\n" 54puts "\nall done\n"
diff --git a/test/stress/stress.sh b/test/stress/stress.sh
index e95d304c4..6a140ab22 100755
--- a/test/stress/stress.sh
+++ b/test/stress/stress.sh
@@ -15,10 +15,11 @@ rm noblacklist.profile
15rm env.profile 15rm env.profile
16for i in `seq 1 100`; 16for i in `seq 1 100`;
17do 17do
18 echo $i
19 echo "hello" > ~/fj-stress-test/testfile$i 18 echo "hello" > ~/fj-stress-test/testfile$i
20 echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile 19 echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile
20 echo "blacklist \${PATH}/sh" >> blacklist.profile
21 echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile 21 echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile
22 echo "noblacklist \${PATH}/sh" >> noblacklist.profile
22 echo "env FJSTRESS$i=stress" >> env.profile 23 echo "env FJSTRESS$i=stress" >> env.profile
23done 24done
24echo "include blacklist.profile" >> noblacklist.profile 25echo "include blacklist.profile" >> noblacklist.profile
@@ -30,6 +31,7 @@ echo "TESTING: stress env (/test/stress/env.exp)"
30./env.exp 31./env.exp
31 32
32rm -fr ~/fj-stress-test 33rm -fr ~/fj-stress-test
34
33rm blacklist.profile 35rm blacklist.profile
34rm noblacklist.profile 36rm noblacklist.profile
35rm env.profile 37rm env.profile
diff --git a/test/utils/firecfg-fix.exp b/test/utils/firecfg-fix.exp
new file mode 100755
index 000000000..685ce9c7b
--- /dev/null
+++ b/test/utils/firecfg-fix.exp
@@ -0,0 +1,25 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firecfg --fix\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "created"
14}
15sleep 1
16
17send -- "firecfg --fix\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "skipped"
21}
22sleep 1
23
24puts "\nall done\n"
25
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index 751f1f8e7..d5ee5ef32 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -112,3 +112,8 @@ echo "TESTING: firemon interface (test/utils/firemon-interface.exp)"
112echo "TESTING: firemon name (test/utils/firemon-name.exp)" 112echo "TESTING: firemon name (test/utils/firemon-name.exp)"
113./firemon-name.exp 113./firemon-name.exp
114 114
115echo "TESTING: firecfg --fix (test/utils/firecfg-fix.exp)"
116mv ~/.local/share/applications ~/firejail-test-local-apps
117./firecfg-fix.exp
118rm -fr ~/.local/share/applications
119mv ~/firejail-test-local-apps ~/.local/share/applications