aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/checkcfg.c12
-rwxr-xr-xtest/root/checkcfg.exp39
-rw-r--r--test/root/firejail.config5
3 files changed, 52 insertions, 4 deletions
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c
index 67bcd996a..f76f83d85 100644
--- a/src/firejail/checkcfg.c
+++ b/src/firejail/checkcfg.c
@@ -291,6 +291,10 @@ int checkcfg(int val) {
291 else if (strncmp(ptr, "quiet-by-default ", 17) == 0) { 291 else if (strncmp(ptr, "quiet-by-default ", 17) == 0) {
292 if (strcmp(ptr + 17, "yes") == 0) 292 if (strcmp(ptr + 17, "yes") == 0)
293 arg_quiet = 1; 293 arg_quiet = 1;
294 else if (strcmp(ptr + 17, "no") == 0)
295 arg_quiet = 0;
296 else
297 goto errout;
294 } 298 }
295 // remount /proc and /sys 299 // remount /proc and /sys
296 else if (strncmp(ptr, "remount-proc-sys ", 17) == 0) { 300 else if (strncmp(ptr, "remount-proc-sys ", 17) == 0) {
@@ -413,16 +417,16 @@ void print_compiletime_support(void) {
413#endif 417#endif
414 ); 418 );
415 419
416 printf("\t- networking support is %s\n", 420 printf("\t- git install support is %s\n",
417#ifdef HAVE_NETWORK 421#ifdef HAVE_GIT_INSTALL
418 "enabled" 422 "enabled"
419#else 423#else
420 "disabled" 424 "disabled"
421#endif 425#endif
422 ); 426 );
423 427
424 printf("\t- git install support is %s\n", 428 printf("\t- networking support is %s\n",
425#ifdef HAVE_GIT_INSTALL 429#ifdef HAVE_NETWORK
426 "enabled" 430 "enabled"
427#else 431#else
428 "disabled" 432 "disabled"
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
index e1ec6cf79..5ec1c4e77 100755
--- a/test/root/checkcfg.exp
+++ b/test/root/checkcfg.exp
@@ -98,6 +98,45 @@ expect {
98 "noroot feature is disabled in Firejail configuration file\r" 98 "noroot feature is disabled in Firejail configuration file\r"
99} 99}
100 100
101# error exit
102send -- "echo \"join no\" > /etc/firejail/firejail.config\r"
103after 100
104send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r"
105after 100
106send -- "echo \"file-transfer no\" >> /etc/firejail/firejail.config\r"
107after 100
108send -- "echo \"x11 no\" >> /etc/firejail/firejail.config\r"
109after 100
110send -- "echo \"firejail-prompt yes\" >> /etc/firejail/firejail.config\r"
111after 100
112send -- "echo \"follow-symlink-as-user yes\" >> /etc/firejail/firejail.config\r"
113after 100
114send -- "echo \"follow-symlink-private-bin yes\" >> /etc/firejail/firejail.config\r"
115after 100
116send -- "echo \"force-nonewprivs yes\" >> /etc/firejail/firejail.config\r"
117after 100
118send -- "echo \"seccomp no\" >> /etc/firejail/firejail.config\r"
119after 100
120send -- "echo \"restricted-network yes\" >> /etc/firejail/firejail.config\r"
121after 100
122send -- "echo \"xephyr-window-title yes\" >> /etc/firejail/firejail.config\r"
123after 100
124send -- "echo \"quiet-by-default yes\" >> /etc/firejail/firejail.config\r"
125after 100
126send -- "echo \"chroot-desktop no\" >> /etc/firejail/firejail.config\r"
127after 100
128send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r"
129after 100
130send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r"
131after 100
132send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r"
133after 100
134send -- "firejail --noprofile --force\r"
135expect {
136 timeout {puts "TESTING ERROR 10\n";exit}
137 "invalid line\r"
138}
139
101send -- "exit\r" 140send -- "exit\r"
102after 100 141after 100
103 142
diff --git a/test/root/firejail.config b/test/root/firejail.config
index 71ff2f4e9..9b57f5126 100644
--- a/test/root/firejail.config
+++ b/test/root/firejail.config
@@ -1,8 +1,13 @@
1bind yes 1bind yes
2chroot yes 2chroot yes
3chroot-desktop yes 3chroot-desktop yes
4cache-tmpfs yes
4file-transfer yes 5file-transfer yes
6firejail-prompt no
7follow-symlink-as-user no
8follow-symlink-private-bin no
5force-nonewprivs no 9force-nonewprivs no
10join yes
6network yes 11network yes
7overlayfs yes 12overlayfs yes
8private-bin-no-local no 13private-bin-no-local no