diff options
Diffstat (limited to 'test/fs/invalid_filename.exp')
-rwxr-xr-x | test/fs/invalid_filename.exp | 204 |
1 files changed, 204 insertions, 0 deletions
diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp new file mode 100755 index 000000000..a6efc24b6 --- /dev/null +++ b/test/fs/invalid_filename.exp | |||
@@ -0,0 +1,204 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --debug-check-filename --noprofile --blacklist=\"bla&&bla\"\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
13 | "Checking filename bla&&bla" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
17 | "Error:" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
21 | "is an invalid filename" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "firejail --debug-check-filename --noprofile --cgroup=\"bla&&bla\"\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
28 | "Checking filename bla&&bla" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
32 | "Error:" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
36 | "is an invalid filename" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "firejail --debug-check-filename --noprofile --chroot=\"bla&&bla\"\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
43 | "Checking filename bla&&bla" {puts "normal system\n"} | ||
44 | "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit} | ||
45 | } | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
48 | "Error:" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
52 | "is an invalid filename" | ||
53 | } | ||
54 | after 100 | ||
55 | |||
56 | send -- "firejail --debug-check-filename --noprofile --netfilter=\"bla&&bla\"\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
59 | "Checking filename bla&&bla" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 4.2\n";exit} | ||
63 | "Error:" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 4.3\n";exit} | ||
67 | "is an invalid filename" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | send -- "firejail --debug-check-filename --noprofile --output=\"bla&&bla\"\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
74 | "Error:" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
78 | "is an invalid filename" | ||
79 | } | ||
80 | after 100 | ||
81 | |||
82 | send -- "firejail --debug-check-filename --noprofile --private=\"bla&&bla\"\r" | ||
83 | expect { | ||
84 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
85 | "Checking filename bla&&bla" | ||
86 | } | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
89 | "Error:" | ||
90 | } | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
93 | "is an invalid filename" | ||
94 | } | ||
95 | after 100 | ||
96 | |||
97 | send -- "firejail --debug-check-filename --noprofile --private-bin=\"bla&&bla\"\r" | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 7.1\n";exit} | ||
100 | "Checking filename bla&&bla" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 7.2\n";exit} | ||
104 | "Error:" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 7.3\n";exit} | ||
108 | "is an invalid filename" | ||
109 | } | ||
110 | after 100 | ||
111 | |||
112 | send -- "firejail --debug-check-filename --noprofile --private-home=\"bla&&bla\"\r" | ||
113 | expect { | ||
114 | timeout {puts "TESTING ERROR 8.1\n";exit} | ||
115 | "Checking filename bla&&bla" | ||
116 | } | ||
117 | expect { | ||
118 | timeout {puts "TESTING ERROR 8.2\n";exit} | ||
119 | "Error:" | ||
120 | } | ||
121 | expect { | ||
122 | timeout {puts "TESTING ERROR 8.3\n";exit} | ||
123 | "is an invalid filename" | ||
124 | } | ||
125 | after 100 | ||
126 | |||
127 | send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" | ||
128 | expect { | ||
129 | timeout {puts "TESTING ERROR 9.1\n";exit} | ||
130 | "Checking filename bla&&bla" | ||
131 | } | ||
132 | expect { | ||
133 | timeout {puts "TESTING ERROR 9.2\n";exit} | ||
134 | "Error:" | ||
135 | } | ||
136 | expect { | ||
137 | timeout {puts "TESTING ERROR 9.3\n";exit} | ||
138 | "is an invalid filename" | ||
139 | } | ||
140 | after 100 | ||
141 | |||
142 | send -- "firejail --debug-check-filename --profile=\"bla&&bla\"\r" | ||
143 | expect { | ||
144 | timeout {puts "TESTING ERROR 10.1\n";exit} | ||
145 | "Checking filename bla&&bla" | ||
146 | } | ||
147 | expect { | ||
148 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
149 | "Error:" | ||
150 | } | ||
151 | expect { | ||
152 | timeout {puts "TESTING ERROR 10.3\n";exit} | ||
153 | "is an invalid filename" | ||
154 | } | ||
155 | after 100 | ||
156 | |||
157 | send -- "firejail --debug-check-filename --read-only=\"bla&&bla\"\r" | ||
158 | expect { | ||
159 | timeout {puts "TESTING ERROR 11.1\n";exit} | ||
160 | "Checking filename bla&&bla" | ||
161 | } | ||
162 | expect { | ||
163 | timeout {puts "TESTING ERROR 11.2\n";exit} | ||
164 | "Error:" | ||
165 | } | ||
166 | expect { | ||
167 | timeout {puts "TESTING ERROR 11.3\n";exit} | ||
168 | "is an invalid filename" | ||
169 | } | ||
170 | after 100 | ||
171 | |||
172 | send -- "firejail --debug-check-filename --shell=\"bla&&bla\"\r" | ||
173 | expect { | ||
174 | timeout {puts "TESTING ERROR 12.1\n";exit} | ||
175 | "Checking filename bla&&bla" | ||
176 | } | ||
177 | expect { | ||
178 | timeout {puts "TESTING ERROR 12.2\n";exit} | ||
179 | "Error:" | ||
180 | } | ||
181 | expect { | ||
182 | timeout {puts "TESTING ERROR 12.3\n";exit} | ||
183 | "is an invalid filename" | ||
184 | } | ||
185 | after 100 | ||
186 | |||
187 | |||
188 | send -- "firejail --debug-check-filename --whitelist=\"bla&&bla\"\r" | ||
189 | expect { | ||
190 | timeout {puts "TESTING ERROR 14.1\n";exit} | ||
191 | "Checking filename bla&&bla" | ||
192 | } | ||
193 | expect { | ||
194 | timeout {puts "TESTING ERROR 14.2\n";exit} | ||
195 | "Error:" | ||
196 | } | ||
197 | expect { | ||
198 | timeout {puts "TESTING ERROR 14.3\n";exit} | ||
199 | "is an invalid filename" | ||
200 | } | ||
201 | after 100 | ||
202 | |||
203 | puts "\nall done\n" | ||
204 | |||