diff options
author | startx2017 <vradu.startx@yandex.com> | 2018-07-27 13:29:00 -0400 |
---|---|---|
committer | startx2017 <vradu.startx@yandex.com> | 2018-07-27 13:29:00 -0400 |
commit | 30cb221e5ad2ec98355f5f0829f39f6c46a680e2 (patch) | |
tree | 1026e572f373b0bd7c62d53370346037689c326c | |
parent | phase 1 (diff) | |
download | firejail-30cb221e5ad2ec98355f5f0829f39f6c46a680e2.tar.gz firejail-30cb221e5ad2ec98355f5f0829f39f6c46a680e2.tar.zst firejail-30cb221e5ad2ec98355f5f0829f39f6c46a680e2.zip |
phase1
-rwxr-xr-x | test/fs/fs.sh | 9 | ||||
-rwxr-xr-x | test/fs/private-bin.exp | 92 | ||||
-rwxr-xr-x | test/fs/private-home.exp | 102 | ||||
-rwxr-xr-x | test/fs/private-lib.exp | 48 |
4 files changed, 0 insertions, 251 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 774c61750..186dca1c0 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -28,9 +28,6 @@ echo "TESTING: kmsg access (test/fs/kmsg.exp)" | |||
28 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" | 28 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" |
29 | ./fs_var_tmp.exp | 29 | ./fs_var_tmp.exp |
30 | 30 | ||
31 | echo "TESTING: private-lib (test/fs/private-lib.exp)" | ||
32 | ./private-lib.exp | ||
33 | |||
34 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" | 31 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" |
35 | ./fs_var_lock.exp | 32 | ./fs_var_lock.exp |
36 | 33 | ||
@@ -40,9 +37,6 @@ echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)" | |||
40 | echo "TESTING: private (test/fs/private.exp)" | 37 | echo "TESTING: private (test/fs/private.exp)" |
41 | ./private.exp | 38 | ./private.exp |
42 | 39 | ||
43 | echo "TESTING: private home (test/fs/private-home.exp)" | ||
44 | ./private-home.exp | ||
45 | |||
46 | echo "TESTING: private home dir (test/fs/private-home-dir.exp)" | 40 | echo "TESTING: private home dir (test/fs/private-home-dir.exp)" |
47 | ./private-home-dir.exp | 41 | ./private-home-dir.exp |
48 | 42 | ||
@@ -55,9 +49,6 @@ echo "TESTING: private-etc (test/fs/private-etc.exp)" | |||
55 | echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" | 49 | echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" |
56 | ./private-etc-empty.exp | 50 | ./private-etc-empty.exp |
57 | 51 | ||
58 | echo "TESTING: private-bin (test/fs/private-bin.exp)" | ||
59 | ./private-bin.exp | ||
60 | |||
61 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" | 52 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" |
62 | ./whitelist-empty.exp | 53 | ./whitelist-empty.exp |
63 | 54 | ||
diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp deleted file mode 100755 index 7eca6e106..000000000 --- a/test/fs/private-bin.exp +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private-bin=bash,ls,sh\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls /bin\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "bash" | ||
21 | } | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 3\n";exit} | ||
24 | "ls" | ||
25 | } | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 4\n";exit} | ||
28 | "sh" | ||
29 | } | ||
30 | |||
31 | send -- "ls /bin\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 5\n";exit} | ||
34 | "ping" {puts "TESTING ERROR 6\n";exit} | ||
35 | "sh" | ||
36 | } | ||
37 | send -- "exit\r" | ||
38 | sleep 1 | ||
39 | |||
40 | send -- "firejail --profile=private-bin.profile\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 7\n";exit} | ||
43 | "Child process initialized" | ||
44 | } | ||
45 | sleep 1 | ||
46 | |||
47 | send -- "ls /bin\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 8\n";exit} | ||
50 | "bash" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 9\n";exit} | ||
54 | "ls" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 10\n";exit} | ||
58 | "sh" | ||
59 | } | ||
60 | |||
61 | send -- "ls /bin\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 11\n";exit} | ||
64 | "ping" {puts "TESTING ERROR 12\n";exit} | ||
65 | "sh" | ||
66 | } | ||
67 | send -- "exit\r" | ||
68 | after 100 | ||
69 | |||
70 | |||
71 | send -- "firejail --private-bin=/etc/shadow\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 13\n";exit} | ||
74 | "Warning: invalid private-bin path /etc/shadow" | ||
75 | } | ||
76 | after 100 | ||
77 | |||
78 | send -- "firejail --private-bin=\"bla;bla\"\r" | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 14\n";exit} | ||
81 | "is an invalid filename" | ||
82 | } | ||
83 | after 100 | ||
84 | |||
85 | send -- "firejail --private-etc=../bin/ls\r" | ||
86 | expect { | ||
87 | timeout {puts "TESTING ERROR 15\n";exit} | ||
88 | "is an invalid filename" | ||
89 | } | ||
90 | |||
91 | after 100 | ||
92 | puts "\nall done\n" | ||
diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp deleted file mode 100755 index 4d35e31e9..000000000 --- a/test/fs/private-home.exp +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # create some test files in user home directory | ||
11 | send -- "touch ~/_firejail_test_file1\r" | ||
12 | after 100 | ||
13 | send -- "touch ~/_firejail_test_file2\r" | ||
14 | after 100 | ||
15 | send -- "mkdir ~/_firejail_test_dir1\r" | ||
16 | after 100 | ||
17 | send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r" | ||
18 | after 100 | ||
19 | send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r" | ||
20 | after 100 | ||
21 | send -- "ln -s /etc ~/_firejail_test_link1\r" | ||
22 | after 100 | ||
23 | send -- "ln -s ~/_firejail_test_dir1 ~/_firejail_test_link2\r" | ||
24 | after 100 | ||
25 | |||
26 | send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1\n";exit} | ||
29 | "Child process initialized" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | send -- "find ~\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 2\n";exit} | ||
36 | "_firejail_test_file3" | ||
37 | } | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 3\n";exit} | ||
40 | "_firejail_test_file2" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 4\n";exit} | ||
44 | "_firejail_test_file1" | ||
45 | } | ||
46 | after 100 | ||
47 | |||
48 | send -- "exit\r" | ||
49 | sleep 1 | ||
50 | |||
51 | send -- "firejail --private-home=\"bla;bla\"\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 5\n";exit} | ||
54 | "is an invalid filename" | ||
55 | } | ||
56 | after 100 | ||
57 | |||
58 | send -- "firejail --private-home=/etc/shadow\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 6\n";exit} | ||
61 | "invalid file" | ||
62 | } | ||
63 | after 100 | ||
64 | |||
65 | send -- "firejail --private-home=/etc/passwd\r" | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 7\n";exit} | ||
68 | "invalid file" | ||
69 | } | ||
70 | after 100 | ||
71 | |||
72 | send -- "firejail --private-home=../../etc/passwd\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 8\n";exit} | ||
75 | "invalid file" | ||
76 | } | ||
77 | after 100 | ||
78 | |||
79 | send -- "firejail --private-home=_firejail_test_link1\r" | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 9\n";exit} | ||
82 | "to file or directory not owned by the user" | ||
83 | } | ||
84 | after 100 | ||
85 | |||
86 | send -- "firejail --private-home=_firejail_test_link2\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 10\n";exit} | ||
89 | "Child process initialized" | ||
90 | } | ||
91 | after 100 | ||
92 | send -- "file ~/_firejail_test_link2\r" | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 11\n";exit} | ||
95 | "broken symbolic link" | ||
96 | } | ||
97 | send -- "exit\r" | ||
98 | |||
99 | send -- "rm -f ~/_firejail_test*\r" | ||
100 | after 100 | ||
101 | |||
102 | puts "\nall done\n" | ||
diff --git a/test/fs/private-lib.exp b/test/fs/private-lib.exp deleted file mode 100755 index 79e0341a3..000000000 --- a/test/fs/private-lib.exp +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | |||
7 | set timeout 10 | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --private-lib --private-bin=sh,bash,dash,ps,grep,ls,find,echo,stty \r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | after 100 | ||
17 | send -- "stty -echo\r" | ||
18 | after 100 | ||
19 | |||
20 | send -- "cd /bin; find .\; echo done\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 2\n";exit} | ||
23 | # "grep" {puts "TESTING ERROR 3\n";exit} | ||
24 | "rm" {puts "TESTING ERROR 3\n";exit} | ||
25 | "cp" {puts "TESTING ERROR 4\n";exit} | ||
26 | "done" | ||
27 | } | ||
28 | after 100 | ||
29 | |||
30 | send -- "cd /lib; find .\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 5\n";exit} | ||
33 | "modules" {puts "TESTING ERROR 6\n";exit} | ||
34 | "firmware" {puts "TESTING ERROR 7\n";exit} | ||
35 | "libc.so" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "cd /usr/lib; find .\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 8\n";exit} | ||
42 | "grub" {puts "TESTING ERROR 9\n";exit} | ||
43 | "mozilla" {puts "TESTING ERROR 10\n";exit} | ||
44 | "libdl.so" | ||
45 | } | ||
46 | after 100 | ||
47 | |||
48 | puts "\nall done\n" | ||