aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-06-28 08:41:51 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-06-28 08:41:51 -0400
commite413b78c49234ae2698f0d9f27945c30ef723fe0 (patch)
tree3a653fc1e3850ab5e77b992854ef3e85be038db4
parentsysutils (diff)
downloadfirejail-e413b78c49234ae2698f0d9f27945c30ef723fe0.tar.gz
firejail-e413b78c49234ae2698f0d9f27945c30ef723fe0.tar.zst
firejail-e413b78c49234ae2698f0d9f27945c30ef723fe0.zip
sysutils
-rw-r--r--Makefile.in1
-rw-r--r--etc/less.profile7
-rw-r--r--platform/debian/conffiles1
-rw-r--r--src/firejail/main.c1
-rwxr-xr-xtest/sysutils/less.exp20
-rwxr-xr-xtest/sysutils/sysutils.sh18
-rwxr-xr-xtest/sysutils/xz.exp26
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
2include /etc/firejail/default.profile
3tracelog
4net none
5shell none
6private-dev
7private-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) {
696static void detect_quiet(int argc, char **argv) { 696static 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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail less ../../Makefile.in\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "MYLIBS"
14}
15expect {
16 timeout {puts "TESTING ERROR 2\n";exit}
17 "APPS"
18}
19
20puts "\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"
43fi 43fi
44 44
45which xz
46if [ "$?" -eq 0 ];
47then
48 echo "TESTING: xz"
49 ./xz.exp
50else
51 echo "TESTING SKIP: xz not found"
52fi
53
54which less
55if [ "$?" -eq 0 ];
56then
57 echo "TESTING: less"
58 ./less.exp
59else
60 echo "TESTING SKIP: less not found"
61fi
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "/usr/bin/xz -c /usr/bin/firejail > firejail_t1\r"
11sleep 1
12
13send -- "firejail /usr/bin/xz -c /usr/bin/firejail > firejail_t2\r"
14sleep 1
15
16send -- "diff -s firejail_t1 firejail_t2\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "firejail_t1 and firejail_t2 are identical"
20}
21
22send -- "rm firejail_t*\r"
23sleep 1
24
25
26puts "\nall done\n"