diff options
author | netblue30 <netblue30@yahoo.com> | 2017-03-31 11:05:05 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-03-31 11:05:05 -0400 |
commit | 0386d562f44ebf612980c7d779336e967973f9c5 (patch) | |
tree | 00f3aa219495c984b6468c5af3723220401abd8b | |
parent | restrict more KDE files (#1181) (diff) | |
download | firejail-0386d562f44ebf612980c7d779336e967973f9c5.tar.gz firejail-0386d562f44ebf612980c7d779336e967973f9c5.tar.zst firejail-0386d562f44ebf612980c7d779336e967973f9c5.zip |
testing
-rw-r--r-- | src/firejail/fs_whitelist.c | 4 | ||||
-rwxr-xr-x | test/environment/doubledash.exp | 2 | ||||
-rwxr-xr-x | test/root/firecfg.exp | 8 | ||||
-rwxr-xr-x | test/stress/stress.sh | 4 | ||||
-rwxr-xr-x | test/utils/firecfg-fix.exp | 25 | ||||
-rwxr-xr-x | test/utils/utils.sh | 5 |
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 | ||
58 | after 100 | 58 | after 100 |
59 | 59 | ||
60 | puts "\n" | 60 | puts "\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 | } |
45 | after 100 | 45 | after 100 |
46 | |||
47 | send -- "firecfg --fix\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 5\n";exit} | ||
50 | "this option is not supported for root user" | ||
51 | } | ||
52 | |||
53 | after 100 | ||
46 | puts "\nall done\n" | 54 | puts "\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 | |||
15 | rm env.profile | 15 | rm env.profile |
16 | for i in `seq 1 100`; | 16 | for i in `seq 1 100`; |
17 | do | 17 | do |
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 |
23 | done | 24 | done |
24 | echo "include blacklist.profile" >> noblacklist.profile | 25 | echo "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 | ||
32 | rm -fr ~/fj-stress-test | 33 | rm -fr ~/fj-stress-test |
34 | |||
33 | rm blacklist.profile | 35 | rm blacklist.profile |
34 | rm noblacklist.profile | 36 | rm noblacklist.profile |
35 | rm env.profile | 37 | rm 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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firecfg --fix\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "created" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "firecfg --fix\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "skipped" | ||
21 | } | ||
22 | sleep 1 | ||
23 | |||
24 | puts "\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)" | |||
112 | echo "TESTING: firemon name (test/utils/firemon-name.exp)" | 112 | echo "TESTING: firemon name (test/utils/firemon-name.exp)" |
113 | ./firemon-name.exp | 113 | ./firemon-name.exp |
114 | 114 | ||
115 | echo "TESTING: firecfg --fix (test/utils/firecfg-fix.exp)" | ||
116 | mv ~/.local/share/applications ~/firejail-test-local-apps | ||
117 | ./firecfg-fix.exp | ||
118 | rm -fr ~/.local/share/applications | ||
119 | mv ~/firejail-test-local-apps ~/.local/share/applications | ||