summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2019-06-24 09:22:57 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2019-06-24 09:22:57 -0400
commit7a181426c5f7968bbd0c60d628a2e546813aaecf (patch)
tree89bf386b45af4aafd5e01e5d6d2d128543b6ff83
parentrun cppcheck in gitlab-ci (diff)
downloadfirejail-7a181426c5f7968bbd0c60d628a2e546813aaecf.tar.gz
firejail-7a181426c5f7968bbd0c60d628a2e546813aaecf.tar.zst
firejail-7a181426c5f7968bbd0c60d628a2e546813aaecf.zip
disable firetunnel at config time (#2793)
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac18
-rw-r--r--src/common.mk.in3
-rw-r--r--src/firejail/checkcfg.c8
-rw-r--r--src/firejail/main.c3
-rwxr-xr-xtest/compile/compile.sh20
6 files changed, 66 insertions, 3 deletions
diff --git a/configure b/configure
index 6102a470e..60ec90adf 100755
--- a/configure
+++ b/configure
@@ -642,6 +642,7 @@ HAVE_GLOBALCFG
642HAVE_CHROOT 642HAVE_CHROOT
643HAVE_SECCOMP 643HAVE_SECCOMP
644HAVE_PRIVATE_HOME 644HAVE_PRIVATE_HOME
645HAVE_FIRETUNNEL
645HAVE_OVERLAYFS 646HAVE_OVERLAYFS
646EXTRA_LDFLAGS 647EXTRA_LDFLAGS
647EXTRA_CFLAGS 648EXTRA_CFLAGS
@@ -706,6 +707,7 @@ ac_user_opts='
706enable_option_checking 707enable_option_checking
707enable_apparmor 708enable_apparmor
708enable_overlayfs 709enable_overlayfs
710enable_firetunnel
709enable_private_home 711enable_private_home
710enable_seccomp 712enable_seccomp
711enable_chroot 713enable_chroot
@@ -1357,6 +1359,7 @@ Optional Features:
1357 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 1359 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1358 --enable-apparmor enable apparmor 1360 --enable-apparmor enable apparmor
1359 --disable-overlayfs disable overlayfs 1361 --disable-overlayfs disable overlayfs
1362 --disable-firetunnel disable firetunnel
1360 --disable-private-home disable private home feature 1363 --disable-private-home disable private home feature
1361 --disable-seccomp disable seccomp 1364 --disable-seccomp disable seccomp
1362 --disable-chroot disable chroot 1365 --disable-chroot disable chroot
@@ -3433,6 +3436,19 @@ if test "x$enable_overlayfs" != "xno"; then :
3433 3436
3434fi 3437fi
3435 3438
3439HAVE_FIRETUNNEL=""
3440# Check whether --enable-firetunnel was given.
3441if test "${enable_firetunnel+set}" = set; then :
3442 enableval=$enable_firetunnel;
3443fi
3444
3445if test "x$enable_firetunnel" != "xno"; then :
3446
3447 HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL"
3448
3449
3450fi
3451
3436HAVE_PRIVATEHOME="" 3452HAVE_PRIVATEHOME=""
3437# Check whether --enable-private-home was given. 3453# Check whether --enable-private-home was given.
3438if test "${enable_private_home+set}" = set; then : 3454if test "${enable_private_home+set}" = set; then :
@@ -5280,6 +5296,7 @@ echo " whitelisting: $HAVE_WHITELIST"
5280echo " private home support: $HAVE_PRIVATE_HOME" 5296echo " private home support: $HAVE_PRIVATE_HOME"
5281echo " file transfer support: $HAVE_FILE_TRANSFER" 5297echo " file transfer support: $HAVE_FILE_TRANSFER"
5282echo " overlayfs support: $HAVE_OVERLAYFS" 5298echo " overlayfs support: $HAVE_OVERLAYFS"
5299echo " firetunnel support: $HAVE_FIRETUNNEL"
5283echo " busybox workaround: $BUSYBOX_WORKAROUND" 5300echo " busybox workaround: $BUSYBOX_WORKAROUND"
5284echo " Spectre compiler patch: $HAVE_SPECTRE" 5301echo " Spectre compiler patch: $HAVE_SPECTRE"
5285echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS" 5302echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
diff --git a/configure.ac b/configure.ac
index c3ca7d912..675c8fd65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,12 @@
1#
2# Note:
3#
4# If for any reason autoconf fails, run "autoreconf -i --install " and try again.
5# We rely soley on autoconf, without automake. Apparently, in this case
6# the macros from m4 directory are not picked up by default by automake.
7# "autoreconf -i --install" seems to fix the problem.
8#
9
1AC_PREREQ([2.68]) 10AC_PREREQ([2.68])
2AC_INIT(firejail, 0.9.61, netblue30@yahoo.com, , https://firejail.wordpress.com) 11AC_INIT(firejail, 0.9.61, netblue30@yahoo.com, , https://firejail.wordpress.com)
3AC_CONFIG_SRCDIR([src/firejail/main.c]) 12AC_CONFIG_SRCDIR([src/firejail/main.c])
@@ -39,6 +48,14 @@ AS_IF([test "x$enable_overlayfs" != "xno"], [
39 AC_SUBST(HAVE_OVERLAYFS) 48 AC_SUBST(HAVE_OVERLAYFS)
40]) 49])
41 50
51HAVE_FIRETUNNEL=""
52AC_ARG_ENABLE([firetunnel],
53 AS_HELP_STRING([--disable-firetunnel], [disable firetunnel]))
54AS_IF([test "x$enable_firetunnel" != "xno"], [
55 HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL"
56 AC_SUBST(HAVE_FIRETUNNEL)
57])
58
42HAVE_PRIVATEHOME="" 59HAVE_PRIVATEHOME=""
43AC_ARG_ENABLE([private-home], 60AC_ARG_ENABLE([private-home],
44 AS_HELP_STRING([--disable-private-home], [disable private home feature])) 61 AS_HELP_STRING([--disable-private-home], [disable private home feature]))
@@ -186,6 +203,7 @@ echo " whitelisting: $HAVE_WHITELIST"
186echo " private home support: $HAVE_PRIVATE_HOME" 203echo " private home support: $HAVE_PRIVATE_HOME"
187echo " file transfer support: $HAVE_FILE_TRANSFER" 204echo " file transfer support: $HAVE_FILE_TRANSFER"
188echo " overlayfs support: $HAVE_OVERLAYFS" 205echo " overlayfs support: $HAVE_OVERLAYFS"
206echo " firetunnel support: $HAVE_FIRETUNNEL"
189echo " busybox workaround: $BUSYBOX_WORKAROUND" 207echo " busybox workaround: $BUSYBOX_WORKAROUND"
190echo " Spectre compiler patch: $HAVE_SPECTRE" 208echo " Spectre compiler patch: $HAVE_SPECTRE"
191echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS" 209echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
diff --git a/src/common.mk.in b/src/common.mk.in
index b9af977ae..1b6ad91a5 100644
--- a/src/common.mk.in
+++ b/src/common.mk.in
@@ -20,6 +20,7 @@ HAVE_WHITELIST=@HAVE_WHITELIST@
20HAVE_GLOBALCFG=@HAVE_GLOBALCFG@ 20HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
21HAVE_APPARMOR=@HAVE_APPARMOR@ 21HAVE_APPARMOR=@HAVE_APPARMOR@
22HAVE_OVERLAYFS=@HAVE_OVERLAYFS@ 22HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
23HAVE_FIRETUNNEL=@HAVE_FIRETUNNEL@
23HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@ 24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
24HAVE_GCOV=@HAVE_GCOV@ 25HAVE_GCOV=@HAVE_GCOV@
25 26
@@ -28,7 +29,7 @@ C_FILE_LIST = $(sort $(wildcard *.c))
28OBJS = $(C_FILE_LIST:.c=.o) 29OBJS = $(C_FILE_LIST:.c=.o)
29BINOBJS = $(foreach file, $(OBJS), $file) 30BINOBJS = $(foreach file, $(OBJS), $file)
30 31
31CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security 32CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_FIRETUNNEL) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
32LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread 33LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
33EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@ 34EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
34EXTRA_CFLAGS +=@EXTRA_CFLAGS@ 35EXTRA_CFLAGS +=@EXTRA_CFLAGS@
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c
index 7ca72bf30..b11d795a9 100644
--- a/src/firejail/checkcfg.c
+++ b/src/firejail/checkcfg.c
@@ -278,6 +278,14 @@ void print_compiletime_support(void) {
278#endif 278#endif
279 ); 279 );
280 280
281 printf("\t- firetunnel support is %s\n",
282#ifdef HAVE_FIRETUNNEL
283 "enabled"
284#else
285 "disabled"
286#endif
287 );
288
281 printf("\t- networking support is %s\n", 289 printf("\t- networking support is %s\n",
282#ifdef HAVE_NETWORK 290#ifdef HAVE_NETWORK
283 "enabled" 291 "enabled"
diff --git a/src/firejail/main.c b/src/firejail/main.c
index c50ed4dc4..2403cafa1 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -1498,6 +1498,7 @@ int main(int argc, char **argv) {
1498 exit_err_feature("overlayfs"); 1498 exit_err_feature("overlayfs");
1499 } 1499 }
1500#endif 1500#endif
1501#ifdef HAVE_FIRETUNNEL
1501 else if (strcmp(argv[i], "--tunnel") == 0) { 1502 else if (strcmp(argv[i], "--tunnel") == 0) {
1502 // try to connect to the default client side of the tunnel 1503 // try to connect to the default client side of the tunnel
1503 // if this fails, try the default server side of the tunnel 1504 // if this fails, try the default server side of the tunnel
@@ -1523,7 +1524,7 @@ int main(int argc, char **argv) {
1523 exit(1); 1524 exit(1);
1524 } 1525 }
1525 } 1526 }
1526 1527#endif
1527 else if (strncmp(argv[i], "--profile=", 10) == 0) { 1528 else if (strncmp(argv[i], "--profile=", 10) == 0) {
1528 // multiple profile files are allowed! 1529 // multiple profile files are allowed!
1529 1530
diff --git a/test/compile/compile.sh b/test/compile/compile.sh
index adacab616..e662b4d30 100755
--- a/test/compile/compile.sh
+++ b/test/compile/compile.sh
@@ -3,7 +3,7 @@
3arr[1]="TEST 1: standard compilation" 3arr[1]="TEST 1: standard compilation"
4arr[2]="TEST 2: compile seccomp disabled" 4arr[2]="TEST 2: compile seccomp disabled"
5arr[3]="TEST 3: compile chroot disabled" 5arr[3]="TEST 3: compile chroot disabled"
6arr[4]="deprecated: TEST 4: compile bind disabled" 6arr[4]="TEST 4: compile firetunnel disabled"
7arr[5]="TEST 5: compile user namespace disabled" 7arr[5]="TEST 5: compile user namespace disabled"
8arr[6]="TEST 6: compile network disabled" 8arr[6]="TEST 6: compile network disabled"
9arr[7]="TEST 7: compile X11 disabled" 9arr[7]="TEST 7: compile X11 disabled"
@@ -108,6 +108,24 @@ cp output-make om3
108rm output-configure output-make 108rm output-configure output-make
109 109
110#***************************************************************** 110#*****************************************************************
111# TEST 4
112#*****************************************************************
113# - disable firetunnel configuration
114#*****************************************************************
115print_title "${arr[4]}"
116# seccomp
117cd firejail
118make distclean
119./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure
120make -j4 2>&1 | tee ../output-make
121cd ..
122grep Warning output-configure output-make > ./report-test4
123grep Error output-configure output-make >> ./report-test4
124cp output-configure oc4
125cp output-make om4
126rm output-configure output-make
127
128#*****************************************************************
111# TEST 5 129# TEST 5
112#***************************************************************** 130#*****************************************************************
113# - disable user namespace configuration 131# - disable user namespace configuration