diff options
-rw-r--r-- | Makefile.in | 1 | ||||
-rw-r--r-- | etc/less.profile | 7 | ||||
-rw-r--r-- | platform/debian/conffiles | 1 | ||||
-rw-r--r-- | src/firejail/main.c | 1 | ||||
-rwxr-xr-x | test/sysutils/less.exp | 20 | ||||
-rwxr-xr-x | test/sysutils/sysutils.sh | 18 | ||||
-rwxr-xr-x | test/sysutils/xz.exp | 26 |
7 files changed, 74 insertions, 0 deletions
diff --git a/Makefile.in b/Makefile.in index 5204fc34a..00131099a 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -215,6 +215,7 @@ realinstall: | |||
215 | install -c -m 0644 .etc/xzdec.profile $(DESTDIR)/$(sysconfdir)/firejail/. | 215 | install -c -m 0644 .etc/xzdec.profile $(DESTDIR)/$(sysconfdir)/firejail/. |
216 | install -c -m 0644 .etc/strings.profile $(DESTDIR)/$(sysconfdir)/firejail/. | 216 | install -c -m 0644 .etc/strings.profile $(DESTDIR)/$(sysconfdir)/firejail/. |
217 | install -c -m 0644 .etc/xz.profile $(DESTDIR)/$(sysconfdir)/firejail/. | 217 | install -c -m 0644 .etc/xz.profile $(DESTDIR)/$(sysconfdir)/firejail/. |
218 | install -c -m 0644 .etc/less.profile $(DESTDIR)/$(sysconfdir)/firejail/. | ||
218 | sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" | 219 | sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" |
219 | install -c -m 0644 etc/firejail.config $(DESTDIR)/$(sysconfdir)/firejail/. | 220 | install -c -m 0644 etc/firejail.config $(DESTDIR)/$(sysconfdir)/firejail/. |
220 | rm -fr .etc | 221 | rm -fr .etc |
diff --git a/etc/less.profile b/etc/less.profile new file mode 100644 index 000000000..9cad7ceb6 --- /dev/null +++ b/etc/less.profile | |||
@@ -0,0 +1,7 @@ | |||
1 | # less profile | ||
2 | include /etc/firejail/default.profile | ||
3 | tracelog | ||
4 | net none | ||
5 | shell none | ||
6 | private-dev | ||
7 | private-tmp | ||
diff --git a/platform/debian/conffiles b/platform/debian/conffiles index 34ab8cd81..62a4cfebe 100644 --- a/platform/debian/conffiles +++ b/platform/debian/conffiles | |||
@@ -124,4 +124,5 @@ | |||
124 | /etc/firejail/xzdec.profile | 124 | /etc/firejail/xzdec.profile |
125 | /etc/firejail/strings.profile | 125 | /etc/firejail/strings.profile |
126 | /etc/firejail/xz.profile | 126 | /etc/firejail/xz.profile |
127 | /etc/firejail/less.profile | ||
127 | 128 | ||
diff --git a/src/firejail/main.c b/src/firejail/main.c index f149dd376..463bf4f31 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -696,6 +696,7 @@ static void delete_x11_file(pid_t pid) { | |||
696 | static void detect_quiet(int argc, char **argv) { | 696 | static void detect_quiet(int argc, char **argv) { |
697 | int i; | 697 | int i; |
698 | char *progs[] = { | 698 | char *progs[] = { |
699 | "less", | ||
699 | "cpio", | 700 | "cpio", |
700 | "strings", | 701 | "strings", |
701 | "gzip", | 702 | "gzip", |
diff --git a/test/sysutils/less.exp b/test/sysutils/less.exp new file mode 100755 index 000000000..720830304 --- /dev/null +++ b/test/sysutils/less.exp | |||
@@ -0,0 +1,20 @@ | |||
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 less ../../Makefile.in\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "MYLIBS" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 2\n";exit} | ||
17 | "APPS" | ||
18 | } | ||
19 | |||
20 | puts "\nall done\n" | ||
diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh index f230c9a6b..d75738f97 100755 --- a/test/sysutils/sysutils.sh +++ b/test/sysutils/sysutils.sh | |||
@@ -42,3 +42,21 @@ else | |||
42 | echo "TESTING SKIP: xzdec not found" | 42 | echo "TESTING SKIP: xzdec not found" |
43 | fi | 43 | fi |
44 | 44 | ||
45 | which xz | ||
46 | if [ "$?" -eq 0 ]; | ||
47 | then | ||
48 | echo "TESTING: xz" | ||
49 | ./xz.exp | ||
50 | else | ||
51 | echo "TESTING SKIP: xz not found" | ||
52 | fi | ||
53 | |||
54 | which less | ||
55 | if [ "$?" -eq 0 ]; | ||
56 | then | ||
57 | echo "TESTING: less" | ||
58 | ./less.exp | ||
59 | else | ||
60 | echo "TESTING SKIP: less not found" | ||
61 | fi | ||
62 | |||
diff --git a/test/sysutils/xz.exp b/test/sysutils/xz.exp new file mode 100755 index 000000000..11d0e560c --- /dev/null +++ b/test/sysutils/xz.exp | |||
@@ -0,0 +1,26 @@ | |||
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 -- "/usr/bin/xz -c /usr/bin/firejail > firejail_t1\r" | ||
11 | sleep 1 | ||
12 | |||
13 | send -- "firejail /usr/bin/xz -c /usr/bin/firejail > firejail_t2\r" | ||
14 | sleep 1 | ||
15 | |||
16 | send -- "diff -s firejail_t1 firejail_t2\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 1\n";exit} | ||
19 | "firejail_t1 and firejail_t2 are identical" | ||
20 | } | ||
21 | |||
22 | send -- "rm firejail_t*\r" | ||
23 | sleep 1 | ||
24 | |||
25 | |||
26 | puts "\nall done\n" | ||