summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README2
-rw-r--r--RELNOTES3
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac9
-rw-r--r--src/firejail/Makefile.in4
-rw-r--r--src/firejail/checkcfg.c5
-rw-r--r--src/firejail/fs.c25
-rw-r--r--src/firejail/main.c2
-rw-r--r--src/include/euid_common.h4
-rw-r--r--src/man/firecfg.txt2
-rw-r--r--src/man/firejail-config.txt17
11 files changed, 73 insertions, 18 deletions
diff --git a/README b/README
index d08a11680..05c9408ec 100644
--- a/README
+++ b/README
@@ -25,6 +25,8 @@ Reiner Herrmann (https://github.com/reinerh)
25 - clang-analyzer fixes 25 - clang-analyzer fixes
26 - Debian reproducible build 26 - Debian reproducible build
27 - unit testing framework 27 - unit testing framework
28Simon Peter (https://github.com/probonopd)
29 - set $APPIMAGE and $APPDIR environment variables
28maces (https://github.com/maces) 30maces (https://github.com/maces)
29 - Franz messenger profile 31 - Franz messenger profile
30KellerFuchs (https://github.com/KellerFuchs) 32KellerFuchs (https://github.com/KellerFuchs)
diff --git a/RELNOTES b/RELNOTES
index c2552c533..04a9d7cbb 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,5 +1,8 @@
1firejail (0.9.41) baseline; urgency=low 1firejail (0.9.41) baseline; urgency=low
2 * work in progress... 2 * work in progress...
3 * compile time and run time support to disable whitelists
4 * compile time support to disable global configuration file
5 * some profiles have been converted to private-bin
3 * new profiles: Gitter, gThumb, mpv, Franz messenger 6 * new profiles: Gitter, gThumb, mpv, Franz messenger
4 -- netblue30 <netblue30@yahoo.com> Tue, 31 May 2016 08:00:00 -0500 7 -- netblue30 <netblue30@yahoo.com> Tue, 31 May 2016 08:00:00 -0500
5 8
diff --git a/configure b/configure
index da7d370d3..ca0704e91 100755
--- a/configure
+++ b/configure
@@ -634,6 +634,7 @@ HAVE_FILE_TRANSFER
634HAVE_X11 634HAVE_X11
635HAVE_USERNS 635HAVE_USERNS
636HAVE_NETWORK 636HAVE_NETWORK
637HAVE_GLOBALCFG
637HAVE_BIND 638HAVE_BIND
638HAVE_CHROOT 639HAVE_CHROOT
639HAVE_SECCOMP 640HAVE_SECCOMP
@@ -692,6 +693,7 @@ enable_option_checking
692enable_seccomp 693enable_seccomp
693enable_chroot 694enable_chroot
694enable_bind 695enable_bind
696enable_globalcfg
695enable_network 697enable_network
696enable_userns 698enable_userns
697enable_x11 699enable_x11
@@ -1320,6 +1322,8 @@ Optional Features:
1320 --disable-seccomp disable seccomp 1322 --disable-seccomp disable seccomp
1321 --disable-chroot disable chroot 1323 --disable-chroot disable chroot
1322 --disable-bind disable bind 1324 --disable-bind disable bind
1325 --disable-globalcfg disable global config file
1326 (/etc/firejail/firejail.cfg)
1323 --disable-network disable network 1327 --disable-network disable network
1324 --enable-network=restricted 1328 --enable-network=restricted
1325 restrict --net= to root only 1329 restrict --net= to root only
@@ -3104,6 +3108,19 @@ if test "x$enable_bind" != "xno"; then :
3104 3108
3105fi 3109fi
3106 3110
3111HAVE_GLOBALCFG=""
3112# Check whether --enable-globalcfg was given.
3113if test "${enable_globalcfg+set}" = set; then :
3114 enableval=$enable_globalcfg;
3115fi
3116
3117if test "x$enable_globalcfg" != "xno"; then :
3118
3119 HAVE_GLOBALCFG="-DHAVE_GLOBALCFG"
3120
3121
3122fi
3123
3107HAVE_NETWORK="" 3124HAVE_NETWORK=""
3108# Check whether --enable-network was given. 3125# Check whether --enable-network was given.
3109if test "${enable_network+set}" = set; then : 3126if test "${enable_network+set}" = set; then :
@@ -4834,6 +4851,7 @@ echo " prefix: $prefix"
4834echo " sysconfdir: $sysconfdir" 4851echo " sysconfdir: $sysconfdir"
4835echo " seccomp: $HAVE_SECCOMP" 4852echo " seccomp: $HAVE_SECCOMP"
4836echo " <linux/seccomp.h>: $HAVE_SECCOMP_H" 4853echo " <linux/seccomp.h>: $HAVE_SECCOMP_H"
4854echo " global config: $HAVE_GLOBALCFG"
4837echo " chroot: $HAVE_CHROOT" 4855echo " chroot: $HAVE_CHROOT"
4838echo " bind: $HAVE_BIND" 4856echo " bind: $HAVE_BIND"
4839echo " network: $HAVE_NETWORK" 4857echo " network: $HAVE_NETWORK"
diff --git a/configure.ac b/configure.ac
index c9061f219..93e062518 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,14 @@ AS_IF([test "x$enable_bind" != "xno"], [
33 AC_SUBST(HAVE_BIND) 33 AC_SUBST(HAVE_BIND)
34]) 34])
35 35
36HAVE_GLOBALCFG=""
37AC_ARG_ENABLE([globalcfg],
38 AS_HELP_STRING([--disable-globalcfg], [if the global config file firejail.cfg is not present, continue the program using defaults]))
39AS_IF([test "x$enable_globalcfg" != "xno"], [
40 HAVE_GLOBALCFG="-DHAVE_GLOBALCFG"
41 AC_SUBST(HAVE_GLOBALCFG)
42])
43
36HAVE_NETWORK="" 44HAVE_NETWORK=""
37AC_ARG_ENABLE([network], 45AC_ARG_ENABLE([network],
38 AS_HELP_STRING([--disable-network], [disable network])) 46 AS_HELP_STRING([--disable-network], [disable network]))
@@ -106,6 +114,7 @@ echo " prefix: $prefix"
106echo " sysconfdir: $sysconfdir" 114echo " sysconfdir: $sysconfdir"
107echo " seccomp: $HAVE_SECCOMP" 115echo " seccomp: $HAVE_SECCOMP"
108echo " <linux/seccomp.h>: $HAVE_SECCOMP_H" 116echo " <linux/seccomp.h>: $HAVE_SECCOMP_H"
117echo " global config: $HAVE_GLOBALCFG"
109echo " chroot: $HAVE_CHROOT" 118echo " chroot: $HAVE_CHROOT"
110echo " bind: $HAVE_BIND" 119echo " bind: $HAVE_BIND"
111echo " network: $HAVE_NETWORK" 120echo " network: $HAVE_NETWORK"
diff --git a/src/firejail/Makefile.in b/src/firejail/Makefile.in
index a8af1a4e0..21f415ba5 100644
--- a/src/firejail/Makefile.in
+++ b/src/firejail/Makefile.in
@@ -17,13 +17,13 @@ HAVE_USERNS=@HAVE_USERNS@
17HAVE_X11=@HAVE_X11@ 17HAVE_X11=@HAVE_X11@
18HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@ 18HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
19HAVE_WHITELIST=@HAVE_WHITELIST@ 19HAVE_WHITELIST=@HAVE_WHITELIST@
20 20HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
21 21
22H_FILE_LIST = $(sort $(wildcard *.[h])) 22H_FILE_LIST = $(sort $(wildcard *.[h]))
23C_FILE_LIST = $(sort $(wildcard *.c)) 23C_FILE_LIST = $(sort $(wildcard *.c))
24OBJS = $(C_FILE_LIST:.c=.o) 24OBJS = $(C_FILE_LIST:.c=.o)
25BINOBJS = $(foreach file, $(OBJS), $file) 25BINOBJS = $(foreach file, $(OBJS), $file)
26CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_SECCOMP) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security 26CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
27LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread 27LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
28 28
29%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/pid.h 29%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/pid.h
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c
index a69c2831e..6636e7efe 100644
--- a/src/firejail/checkcfg.c
+++ b/src/firejail/checkcfg.c
@@ -48,8 +48,13 @@ int checkcfg(int val) {
48 48
49 FILE *fp = fopen(fname, "r"); 49 FILE *fp = fopen(fname, "r");
50 if (!fp) { 50 if (!fp) {
51#ifdef HAVE_GLOBALCFG
51 fprintf(stderr, "Warning: Firejail configuration file %s not found\n", fname); 52 fprintf(stderr, "Warning: Firejail configuration file %s not found\n", fname);
52 exit(1); 53 exit(1);
54#else
55 initialized = 1;
56 return cfg_val[val];
57#endif
53 } 58 }
54 59
55 // read configuration file 60 // read configuration file
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 8cae9191c..acc03e412 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -652,26 +652,27 @@ void fs_proc_sys_dev_boot(void) {
652// disable firejail configuration in /etc/firejail and in ~/.config/firejail 652// disable firejail configuration in /etc/firejail and in ~/.config/firejail
653static void disable_firejail_config(void) { 653static void disable_firejail_config(void) {
654 struct stat s; 654 struct stat s;
655 if (stat("/etc/firejail", &s) == 0) 655// if (stat("/etc/firejail", &s) == 0)
656 disable_file(BLACKLIST_FILE, "/etc/firejail"); 656// disable_file(BLACKLIST_FILE, "/etc/firejail");
657 657
658 char *fname; 658 char *fname;
659 if (asprintf(&fname, "%s/.config/firejail", cfg.homedir) == -1) 659 if (asprintf(&fname, "%s/.config/firejail", cfg.homedir) == -1)
660 errExit("asprintf"); 660 errExit("asprintf");
661 if (stat(fname, &s) == 0) 661 if (stat(fname, &s) == 0)
662 disable_file(BLACKLIST_FILE, fname); 662 disable_file(BLACKLIST_FILE, fname);
663 free(fname);
663 664
664 if (stat("/usr/local/etc/firejail", &s) == 0) 665// if (stat("/usr/local/etc/firejail", &s) == 0)
665 disable_file(BLACKLIST_FILE, "/usr/local/etc/firejail"); 666// disable_file(BLACKLIST_FILE, "/usr/local/etc/firejail");
666 667//
667 if (strcmp(PREFIX, "/usr/local")) { 668// if (strcmp(PREFIX, "/usr/local")) {
668 if (asprintf(&fname, "%s/etc/firejail", PREFIX) == -1) 669// if (asprintf(&fname, "%s/etc/firejail", PREFIX) == -1)
669 errExit("asprintf"); 670// errExit("asprintf");
670 if (stat(fname, &s) == 0) 671// if (stat(fname, &s) == 0)
671 disable_file(BLACKLIST_FILE, fname); 672// disable_file(BLACKLIST_FILE, fname);
672 } 673// free(fname);
674// }
673 675
674 free(fname);
675 676
676 // disable run time information 677 // disable run time information
677 if (stat(RUN_FIREJAIL_NETWORK_DIR, &s) == 0) 678 if (stat(RUN_FIREJAIL_NETWORK_DIR, &s) == 0)
diff --git a/src/firejail/main.c b/src/firejail/main.c
index d027eb697..423df3752 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -854,7 +854,7 @@ int main(int argc, char **argv) {
854 854
855 855
856 // check for force-nonewprivs in /etc/firejail/firejail.config file 856 // check for force-nonewprivs in /etc/firejail/firejail.config file
857 if (!option_force && checkcfg(CFG_FORCE_NONEWPRIVS)) 857 if (checkcfg(CFG_FORCE_NONEWPRIVS))
858 arg_nonewprivs = 1; 858 arg_nonewprivs = 1;
859 859
860 // parse arguments 860 // parse arguments
diff --git a/src/include/euid_common.h b/src/include/euid_common.h
index f07cf2868..b6d341bf4 100644
--- a/src/include/euid_common.h
+++ b/src/include/euid_common.h
@@ -36,12 +36,12 @@ extern uid_t firejail_uid;
36 36
37static inline void EUID_ROOT(void) { 37static inline void EUID_ROOT(void) {
38 if (seteuid(0) == -1) 38 if (seteuid(0) == -1)
39 fprintf(stderr, "Error: cannot switch euid to root\n"); 39 fprintf(stderr, "Warning: cannot switch euid to root\n");
40} 40}
41 41
42static inline void EUID_USER(void) { 42static inline void EUID_USER(void) {
43 if (seteuid(firejail_uid) == -1) 43 if (seteuid(firejail_uid) == -1)
44 fprintf(stderr, "Error: cannot switch euid to user\n"); 44 fprintf(stderr, "Warning: cannot switch euid to user\n");
45} 45}
46 46
47static inline void EUID_PRINT(void) { 47static inline void EUID_PRINT(void) {
diff --git a/src/man/firecfg.txt b/src/man/firecfg.txt
index e2e4229b0..c12bf7731 100644
--- a/src/man/firecfg.txt
+++ b/src/man/firecfg.txt
@@ -10,7 +10,7 @@ sandbox applications automatically, just by clicking on a regular desktop
10menus and icons. 10menus and icons.
11 11
12The symbolic links are placed in /usr/local/bin. For more information, see 12The symbolic links are placed in /usr/local/bin. For more information, see
13DESKTOP INTEGRATION section in man 1 firejail. 13\fBDESKTOP INTEGRATION\fR section in \fBman 1 firejail\fR.
14 14
15.SH OPTIONS 15.SH OPTIONS
16.TP 16.TP
diff --git a/src/man/firejail-config.txt b/src/man/firejail-config.txt
index 6a66c7f75..bc29dc977 100644
--- a/src/man/firejail-config.txt
+++ b/src/man/firejail-config.txt
@@ -74,6 +74,23 @@ xephyr-screen 1024x768
74.br 74.br
75xephyr-screen 1280x1024 75xephyr-screen 1280x1024
76 76
77.TP
78\fBxephyr-window-title
79Firejail window title in Xephry, default enabled.
80
81.TP
82\fBxephyr-extra-params
83Xephyr command extra parameters. None by default, and the declaration is commented out. Examples:
84.br
85
86.br
87xephyr-extra-params -keybd ephyr,,,xkbmodel=evdev
88.br
89xephyr-extra-params -grayscale
90
91.SH COMPILE TIME CONFIGURATION
92Most of the features described in this file can also be configured at compile time, please run \fB./configure --help\fR for more details.
93
77.SH FILES 94.SH FILES
78/etc/firejail/firejail.config 95/etc/firejail/firejail.config
79 96