diff options
author | Austin Morton <austinpmorton@gmail.com> | 2019-05-20 19:44:40 -0400 |
---|---|---|
committer | Austin Morton <austinpmorton@gmail.com> | 2019-05-23 18:45:44 -0400 |
commit | 99a9f8d680ea5a613506d5f0a1804bf97a5d69f3 (patch) | |
tree | f4fb77e96f9e2a3f08776ae4471b5db3f059831d /test/fs/private-cwd.exp | |
parent | Create a profile for mp3splt-gtk (diff) | |
download | firejail-99a9f8d680ea5a613506d5f0a1804bf97a5d69f3.tar.gz firejail-99a9f8d680ea5a613506d5f0a1804bf97a5d69f3.tar.zst firejail-99a9f8d680ea5a613506d5f0a1804bf97a5d69f3.zip |
Add private-cwd option to control working directory within jail
Diffstat (limited to 'test/fs/private-cwd.exp')
-rwxr-xr-x | test/fs/private-cwd.exp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/fs/private-cwd.exp b/test/fs/private-cwd.exp new file mode 100755 index 000000000..0fa87a92f --- /dev/null +++ b/test/fs/private-cwd.exp | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2019 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "cd /tmp\r" | ||
11 | after 100 | ||
12 | |||
13 | # testing profile and private | ||
14 | send -- "firejail --private-cwd\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | sleep 1 | ||
20 | |||
21 | send -- "pwd\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 1\n";exit} | ||
24 | "$env(HOME)" | ||
25 | } | ||
26 | after 100 | ||
27 | |||
28 | send -- "exit\r" | ||
29 | sleep 1 | ||
30 | |||
31 | send -- "cd /\r" | ||
32 | after 100 | ||
33 | |||
34 | # testing profile and private | ||
35 | send -- "firejail --private-cwd=/tmp\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 3\n";exit} | ||
38 | "Child process initialized" | ||
39 | } | ||
40 | sleep 1 | ||
41 | |||
42 | send -- "pwd\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 4\n";exit} | ||
45 | "/tmp" | ||
46 | } | ||
47 | after 100 | ||
48 | |||
49 | send -- "exit\r" | ||
50 | sleep 1 | ||
51 | |||
52 | puts "all done\n" | ||