aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure83
-rw-r--r--configure.ac93
-rw-r--r--etc/profile-a-l/gunzip.profile2
-rw-r--r--etc/profile-a-l/hexchat.profile5
-rw-r--r--src/firejail/fs_whitelist.c7
-rw-r--r--src/firejail/main.c4
-rw-r--r--src/firejail/shutdown.c6
-rw-r--r--src/firejail/util.c8
8 files changed, 112 insertions, 96 deletions
diff --git a/configure b/configure
index b75848bea..f31816599 100755
--- a/configure
+++ b/configure
@@ -5559,48 +5559,49 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
5559$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} 5559$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
5560fi 5560fi
5561 5561
5562cat <<EOF
5563
5564Configuration options:
5565 prefix: $prefix
5566 sysconfdir: $sysconfdir
5567 apparmor: $HAVE_APPARMOR
5568 SELinux labeling support: $HAVE_SELINUX
5569 global config: $HAVE_GLOBALCFG
5570 chroot: $HAVE_CHROOT
5571 network: $HAVE_NETWORK
5572 user namespace: $HAVE_USERNS
5573 X11 sandboxing support: $HAVE_X11
5574 whitelisting: $HAVE_WHITELIST
5575 private home support: $HAVE_PRIVATE_HOME
5576 file transfer support: $HAVE_FILE_TRANSFER
5577 overlayfs support: $HAVE_OVERLAYFS
5578 DBUS proxy support: $HAVE_DBUSPROXY
5579 allow tmpfs as regular user: $HAVE_USERTMPFS
5580 enable --ouput logging: $HAVE_OUTPUT
5581 Manpage support: $HAVE_MAN
5582 firetunnel support: $HAVE_FIRETUNNEL
5583 busybox workaround: $BUSYBOX_WORKAROUND
5584 Spectre compiler patch: $HAVE_SPECTRE
5585 EXTRA_LDFLAGS: $EXTRA_LDFLAGS
5586 EXTRA_CFLAGS: $EXTRA_CFLAGS
5587 fatal warnings: $HAVE_FATAL_WARNINGS
5588 Gcov instrumentation: $HAVE_GCOV
5589 Install contrib scripts: $HAVE_CONTRIB_INSTALL
5590 Install as a SUID executable: $HAVE_SUID
5591 LTS: $HAVE_LTS
5592 Always enforce filters: $HAVE_FORCE_NONEWPRIVS
5593
5594EOF
5562 5595
5563echo 5596if test "$HAVE_LTS" = -DHAVE_LTS; then
5564echo "Configuration options:" 5597 cat <<\EOF
5565echo " prefix: $prefix"
5566echo " sysconfdir: $sysconfdir"
5567echo " apparmor: $HAVE_APPARMOR"
5568echo " SELinux labeling support: $HAVE_SELINUX"
5569echo " global config: $HAVE_GLOBALCFG"
5570echo " chroot: $HAVE_CHROOT"
5571echo " network: $HAVE_NETWORK"
5572echo " user namespace: $HAVE_USERNS"
5573echo " X11 sandboxing support: $HAVE_X11"
5574echo " whitelisting: $HAVE_WHITELIST"
5575echo " private home support: $HAVE_PRIVATE_HOME"
5576echo " file transfer support: $HAVE_FILE_TRANSFER"
5577echo " overlayfs support: $HAVE_OVERLAYFS"
5578echo " DBUS proxy support: $HAVE_DBUSPROXY"
5579echo " allow tmpfs as regular user: $HAVE_USERTMPFS"
5580echo " enable --ouput logging: $HAVE_OUTPUT"
5581echo " Manpage support: $HAVE_MAN"
5582echo " firetunnel support: $HAVE_FIRETUNNEL"
5583echo " busybox workaround: $BUSYBOX_WORKAROUND"
5584echo " Spectre compiler patch: $HAVE_SPECTRE"
5585echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
5586echo " EXTRA_CFLAGS: $EXTRA_CFLAGS"
5587echo " fatal warnings: $HAVE_FATAL_WARNINGS"
5588echo " Gcov instrumentation: $HAVE_GCOV"
5589echo " Install contrib scripts: $HAVE_CONTRIB_INSTALL"
5590echo " Install as a SUID executable: $HAVE_SUID"
5591echo " LTS: $HAVE_LTS"
5592echo " Always enforce filters: $HAVE_FORCE_NONEWPRIVS"
5593echo
5594 5598
5595 5599
5596if test "$HAVE_LTS" = -DHAVE_LTS; then 5600*********************************************************
5597 echo 5601* Warning: Long-term support (LTS) was enabled! *
5598 echo 5602* Most compile-time options have bean rewritten! *
5599 echo "*********************************************************" 5603*********************************************************
5600 echo "* Warning: Long-term support (LTS) was enabled! *"
5601 echo "* Most compile-time options have bean rewritten! *"
5602 echo "*********************************************************"
5603 echo
5604 echo
5605fi
5606 5604
5605
5606EOF
5607fi
diff --git a/configure.ac b/configure.ac
index 4af69766d..0eb616355 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@
12# 12#
13 13
14AC_PREREQ([2.68]) 14AC_PREREQ([2.68])
15AC_INIT(firejail, 0.9.65, netblue30@protonmail.com, , https://firejail.wordpress.com) 15AC_INIT([firejail],[0.9.65],[netblue30@protonmail.com],[],[https://firejail.wordpress.com])
16AC_CONFIG_SRCDIR([src/firejail/main.c]) 16AC_CONFIG_SRCDIR([src/firejail/main.c])
17 17
18AC_CONFIG_MACRO_DIR([m4]) 18AC_CONFIG_MACRO_DIR([m4])
@@ -304,53 +304,56 @@ if test "$prefix" = /usr; then
304fi 304fi
305 305
306AC_CONFIG_FILES([mkdeb.sh], [chmod +x mkdeb.sh]) 306AC_CONFIG_FILES([mkdeb.sh], [chmod +x mkdeb.sh])
307AC_OUTPUT(Makefile src/common.mk src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/fnetfilter/Makefile \ 307AC_CONFIG_FILES([Makefile src/common.mk src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/fnetfilter/Makefile \
308src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/fsec-print/Makefile \ 308src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/fsec-print/Makefile \
309src/ftee/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile src/fsec-optimize/Makefile \ 309src/ftee/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile src/fsec-optimize/Makefile \
310src/profstats/Makefile src/man/Makefile src/zsh_completion/Makefile src/bash_completion/Makefile test/Makefile \ 310src/profstats/Makefile src/man/Makefile src/zsh_completion/Makefile src/bash_completion/Makefile test/Makefile \
311src/jailcheck/Makefile) 311src/jailcheck/Makefile])
312 312AC_OUTPUT
313echo 313
314echo "Configuration options:" 314cat <<EOF
315echo " prefix: $prefix" 315
316echo " sysconfdir: $sysconfdir" 316Configuration options:
317echo " apparmor: $HAVE_APPARMOR" 317 prefix: $prefix
318echo " SELinux labeling support: $HAVE_SELINUX" 318 sysconfdir: $sysconfdir
319echo " global config: $HAVE_GLOBALCFG" 319 apparmor: $HAVE_APPARMOR
320echo " chroot: $HAVE_CHROOT" 320 SELinux labeling support: $HAVE_SELINUX
321echo " network: $HAVE_NETWORK" 321 global config: $HAVE_GLOBALCFG
322echo " user namespace: $HAVE_USERNS" 322 chroot: $HAVE_CHROOT
323echo " X11 sandboxing support: $HAVE_X11" 323 network: $HAVE_NETWORK
324echo " whitelisting: $HAVE_WHITELIST" 324 user namespace: $HAVE_USERNS
325echo " private home support: $HAVE_PRIVATE_HOME" 325 X11 sandboxing support: $HAVE_X11
326echo " file transfer support: $HAVE_FILE_TRANSFER" 326 whitelisting: $HAVE_WHITELIST
327echo " overlayfs support: $HAVE_OVERLAYFS" 327 private home support: $HAVE_PRIVATE_HOME
328echo " DBUS proxy support: $HAVE_DBUSPROXY" 328 file transfer support: $HAVE_FILE_TRANSFER
329echo " allow tmpfs as regular user: $HAVE_USERTMPFS" 329 overlayfs support: $HAVE_OVERLAYFS
330echo " enable --ouput logging: $HAVE_OUTPUT" 330 DBUS proxy support: $HAVE_DBUSPROXY
331echo " Manpage support: $HAVE_MAN" 331 allow tmpfs as regular user: $HAVE_USERTMPFS
332echo " firetunnel support: $HAVE_FIRETUNNEL" 332 enable --ouput logging: $HAVE_OUTPUT
333echo " busybox workaround: $BUSYBOX_WORKAROUND" 333 Manpage support: $HAVE_MAN
334echo " Spectre compiler patch: $HAVE_SPECTRE" 334 firetunnel support: $HAVE_FIRETUNNEL
335echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS" 335 busybox workaround: $BUSYBOX_WORKAROUND
336echo " EXTRA_CFLAGS: $EXTRA_CFLAGS" 336 Spectre compiler patch: $HAVE_SPECTRE
337echo " fatal warnings: $HAVE_FATAL_WARNINGS" 337 EXTRA_LDFLAGS: $EXTRA_LDFLAGS
338echo " Gcov instrumentation: $HAVE_GCOV" 338 EXTRA_CFLAGS: $EXTRA_CFLAGS
339echo " Install contrib scripts: $HAVE_CONTRIB_INSTALL" 339 fatal warnings: $HAVE_FATAL_WARNINGS
340echo " Install as a SUID executable: $HAVE_SUID" 340 Gcov instrumentation: $HAVE_GCOV
341echo " LTS: $HAVE_LTS" 341 Install contrib scripts: $HAVE_CONTRIB_INSTALL
342echo " Always enforce filters: $HAVE_FORCE_NONEWPRIVS" 342 Install as a SUID executable: $HAVE_SUID
343echo 343 LTS: $HAVE_LTS
344 344 Always enforce filters: $HAVE_FORCE_NONEWPRIVS
345
346EOF
345 347
346if test "$HAVE_LTS" = -DHAVE_LTS; then 348if test "$HAVE_LTS" = -DHAVE_LTS; then
347 echo 349 cat <<\EOF
348 echo 350
349 echo "*********************************************************"
350 echo "* Warning: Long-term support (LTS) was enabled! *"
351 echo "* Most compile-time options have bean rewritten! *"
352 echo "*********************************************************"
353 echo
354 echo
355fi
356 351
352*********************************************************
353* Warning: Long-term support (LTS) was enabled! *
354* Most compile-time options have bean rewritten! *
355*********************************************************
356
357
358EOF
359fi
diff --git a/etc/profile-a-l/gunzip.profile b/etc/profile-a-l/gunzip.profile
index 6e97c6b78..584d88f85 100644
--- a/etc/profile-a-l/gunzip.profile
+++ b/etc/profile-a-l/gunzip.profile
@@ -7,5 +7,7 @@ include gunzip.local
7# added by included profile 7# added by included profile
8#include globals.local 8#include globals.local
9 9
10include allow-bin-sh.inc
11
10# Redirect 12# Redirect
11include gzip.profile 13include gzip.profile
diff --git a/etc/profile-a-l/hexchat.profile b/etc/profile-a-l/hexchat.profile
index f72af0b4a..b887de147 100644
--- a/etc/profile-a-l/hexchat.profile
+++ b/etc/profile-a-l/hexchat.profile
@@ -8,6 +8,9 @@ include globals.local
8 8
9noblacklist ${HOME}/.config/hexchat 9noblacklist ${HOME}/.config/hexchat
10 10
11# Allow /bin/sh (blacklisted by disable-shell.inc)
12include allow-bin-sh.inc
13
11# Allow perl (blacklisted by disable-interpreters.inc) 14# Allow perl (blacklisted by disable-interpreters.inc)
12include allow-perl.inc 15include allow-perl.inc
13 16
@@ -48,7 +51,7 @@ tracelog
48 51
49disable-mnt 52disable-mnt
50# debug note: private-bin requires perl, python, etc on some systems 53# debug note: private-bin requires perl, python, etc on some systems
51private-bin hexchat,python* 54private-bin hexchat,python*,sh
52private-dev 55private-dev
53#private-lib - python problems 56#private-lib - python problems
54private-tmp 57private-tmp
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c
index 77bb5e5bb..9a7a1bac7 100644
--- a/src/firejail/fs_whitelist.c
+++ b/src/firejail/fs_whitelist.c
@@ -423,6 +423,13 @@ static TopDir *add_topdir(const char *dir, TopDir *topdirs, const char *path) {
423 strcmp(dir, "/sys") == 0) 423 strcmp(dir, "/sys") == 0)
424 whitelist_error(path); 424 whitelist_error(path);
425 425
426 // whitelisting home directory is disabled if --private option is present
427 if (arg_private && strcmp(dir, cfg.homedir) == 0) {
428 if (arg_debug || arg_debug_whitelists)
429 printf("Debug %d: skip %s - a private home dir is configured!\n", __LINE__, path);
430 return NULL;
431 }
432
426 // do nothing if directory doesn't exist 433 // do nothing if directory doesn't exist
427 struct stat s; 434 struct stat s;
428 if (lstat(dir, &s) != 0) { 435 if (lstat(dir, &s) != 0) {
diff --git a/src/firejail/main.c b/src/firejail/main.c
index 31694558d..7cfa58078 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -1904,8 +1904,6 @@ int main(int argc, char **argv, char **envp) {
1904 } 1904 }
1905 else if (strcmp(argv[i], "--private") == 0) { 1905 else if (strcmp(argv[i], "--private") == 0) {
1906 arg_private = 1; 1906 arg_private = 1;
1907 // disable whitelisting in home directory
1908 profile_add("whitelist ~/*");
1909 } 1907 }
1910 else if (strncmp(argv[i], "--private=", 10) == 0) { 1908 else if (strncmp(argv[i], "--private=", 10) == 0) {
1911 if (cfg.home_private_keep) { 1909 if (cfg.home_private_keep) {
@@ -1927,8 +1925,6 @@ int main(int argc, char **argv, char **envp) {
1927 cfg.home_private = NULL; 1925 cfg.home_private = NULL;
1928 } 1926 }
1929 arg_private = 1; 1927 arg_private = 1;
1930 // disable whitelisting in home directory
1931 profile_add("whitelist ~/*");
1932 } 1928 }
1933#ifdef HAVE_PRIVATE_HOME 1929#ifdef HAVE_PRIVATE_HOME
1934 else if (strncmp(argv[i], "--private-home=", 15) == 0) { 1930 else if (strncmp(argv[i], "--private-home=", 15) == 0) {
diff --git a/src/firejail/shutdown.c b/src/firejail/shutdown.c
index fbfe1765b..d1be6eed4 100644
--- a/src/firejail/shutdown.c
+++ b/src/firejail/shutdown.c
@@ -36,8 +36,10 @@ void shut(pid_t pid) {
36 } 36 }
37 free(comm); 37 free(comm);
38 } 38 }
39 else 39 else {
40 errExit("/proc/PID/comm"); 40 fprintf(stderr, "Error: cannot find process %d\n", pid);
41 exit(1);
42 }
41 43
42 // check privileges for non-root users 44 // check privileges for non-root users
43 uid_t uid = getuid(); 45 uid_t uid = getuid();
diff --git a/src/firejail/util.c b/src/firejail/util.c
index b15b719b7..6a7318c4b 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -647,9 +647,11 @@ int find_child(pid_t parent, pid_t *child) {
647 if (parent == atoi(ptr)) { 647 if (parent == atoi(ptr)) {
648 // we don't want /usr/bin/xdg-dbus-proxy! 648 // we don't want /usr/bin/xdg-dbus-proxy!
649 char *cmdline = pid_proc_cmdline(pid); 649 char *cmdline = pid_proc_cmdline(pid);
650 if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) != 0) 650 if (cmdline) {
651 *child = pid; 651 if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) != 0)
652 free(cmdline); 652 *child = pid;
653 free(cmdline);
654 }
653 } 655 }
654 break; // stop reading the file 656 break; // stop reading the file
655 } 657 }