aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README36
-rw-r--r--README.md18
-rw-r--r--RELNOTES22
-rw-r--r--SECURITY.md23
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac2
-rw-r--r--etc-fixes/seccomp-join-bug/README11
-rw-r--r--etc-fixes/seccomp-join-bug/eecf35c-backports.zipbin0 -> 10472 bytes
-rw-r--r--etc/Xephyr.profile2
-rw-r--r--etc/bitlbee.profile2
-rw-r--r--etc/cantata.profile40
-rw-r--r--etc/disable-programs.inc11
-rw-r--r--etc/eo-common.profile47
-rw-r--r--etc/eog.profile38
-rw-r--r--etc/eom.profile34
-rw-r--r--etc/exiftool.profile2
-rw-r--r--etc/firefox-common.profile2
-rw-r--r--etc/firejail.config2
-rw-r--r--etc/gnome-chess.profile6
-rw-r--r--etc/gpg.profile3
-rw-r--r--etc/inkview.profile8
-rw-r--r--etc/keepassxc.profile2
-rw-r--r--etc/ktouch.profile50
-rw-r--r--etc/libreoffice.profile3
-rw-r--r--etc/masterpdfeditor.profile3
-rw-r--r--etc/meteo-qt.profile53
-rw-r--r--etc/mp3splt-gtk.profile41
-rw-r--r--etc/ocenaudio.profile4
-rw-r--r--etc/orage.profile2
-rw-r--r--etc/pidgin.profile5
-rw-r--r--etc/qgis.profile60
-rw-r--r--etc/seahorse.profile2
-rw-r--r--etc/spotify.profile4
-rw-r--r--etc/sysprof.profile2
-rw-r--r--etc/templates/Notes7
-rw-r--r--etc/templates/profile.template82
-rw-r--r--etc/templates/redirect_alias-profile.template36
-rw-r--r--etc/templates/syscalls.txt43
-rw-r--r--etc/transgui.profile2
-rw-r--r--etc/xiphos.profile8
-rw-r--r--etc/yelp.profile51
-rw-r--r--src/firecfg/firecfg.config8
-rw-r--r--src/firecfg/firecfg.h4
-rw-r--r--src/firejail/dbus.c15
-rw-r--r--src/firejail/env.c5
-rw-r--r--src/firejail/firejail.h6
-rw-r--r--src/firejail/fs.c6
-rw-r--r--src/firejail/fs_home.c21
-rw-r--r--src/firejail/fs_whitelist.c6
-rw-r--r--src/firejail/main.c33
-rw-r--r--src/firejail/mountinfo.c4
-rw-r--r--src/firejail/profile.c17
-rw-r--r--src/firejail/pulseaudio.c4
-rw-r--r--src/firejail/sandbox.c13
-rw-r--r--src/firejail/usage.c3
-rw-r--r--src/firejail/util.c4
-rw-r--r--src/firejail/x11.c4
-rw-r--r--src/include/rundefs.h14
-rw-r--r--src/man/firejail-profile.txt10
-rw-r--r--src/man/firejail.txt58
-rwxr-xr-xtest/environment/deterministic-exit-code.exp55
-rwxr-xr-xtest/environment/environment.sh3
-rwxr-xr-xtest/fs/fs.sh3
-rwxr-xr-xtest/fs/private-cwd.exp52
-rwxr-xr-xtest/private-lib/private-lib.sh2
65 files changed, 980 insertions, 157 deletions
diff --git a/README b/README
index fb8ccfb6a..d6cf5389b 100644
--- a/README
+++ b/README
@@ -97,6 +97,9 @@ announ (https://github.com/announ)
97Antonio Russo (https://github.com/aerusso) 97Antonio Russo (https://github.com/aerusso)
98 - enumerate root directories in apparmor profile 98 - enumerate root directories in apparmor profile
99 - fix join-or-start 99 - fix join-or-start
100Austin Morton
101 - deterministic-exit-code option
102 - private-cwd options
100Austin S. Hemmelgarn (https://github.com/Ferroin) 103Austin S. Hemmelgarn (https://github.com/Ferroin)
101 - unbound profile update 104 - unbound profile update
102avoidr (https://github.com/avoidr) 105avoidr (https://github.com/avoidr)
@@ -176,6 +179,8 @@ curiosity-seeker (https://github.com/curiosity-seeker)
176 - write-protection for thumbnailer dir 179 - write-protection for thumbnailer dir
177 - added gramps, newsboat, freeoffice-planmaker profiles 180 - added gramps, newsboat, freeoffice-planmaker profiles
178 - added freeoffice-textmaker, freeoffice-presentations profiles 181 - added freeoffice-textmaker, freeoffice-presentations profiles
182 - added cantata profile
183 - updated keypassxc profile
179da2x (https://github.com/da2x) 184da2x (https://github.com/da2x)
180 - matched RPM license tag 185 - matched RPM license tag
181Daan Bakker (https://github.com/dbakker) 186Daan Bakker (https://github.com/dbakker)
@@ -304,6 +309,8 @@ greigdp (https://github.com/greigdp)
304 - fixed spotify profile 309 - fixed spotify profile
305 - added Slack profile 310 - added Slack profile
306 - add Spotify profile 311 - add Spotify profile
312grizzlyuser (https://github.com/grizzlyuser)
313 - added support for youtube-dl in smplayer profile
307GSI (https://github.com/GSI) 314GSI (https://github.com/GSI)
308 - added Uzbl browser profile 315 - added Uzbl browser profile
309hamzadis (https://github.com/hamzadis) 316hamzadis (https://github.com/hamzadis)
@@ -353,6 +360,7 @@ Jean Lucas (https://github.com/flacks)
353 - fix wire profile 360 - fix wire profile
354 - add Beaker profile 361 - add Beaker profile
355 - fixes for gnome-music 362 - fixes for gnome-music
363 - allow reading of system-wide Flatpak locale in gajim profile
356Jericho (https://github.com/attritionorg) 364Jericho (https://github.com/attritionorg)
357 - spelling 365 - spelling
358Jesse Smith (https://github.com/slicer69) 366Jesse Smith (https://github.com/slicer69)
@@ -368,6 +376,8 @@ John Mullee (https://github.com/jmullee)
368Jonas Heinrich (https://github.com/onny) 376Jonas Heinrich (https://github.com/onny)
369 - added signal-desktop profile 377 - added signal-desktop profile
370 - fixed franz profile 378 - fixed franz profile
379Jose Riha (https://github.com/jose1711)
380 - added meteo-qt profile
371jrabe (https://github.com/jrabe) 381jrabe (https://github.com/jrabe)
372 - disallow access to kdbx files 382 - disallow access to kdbx files
373 - Epiphany profile 383 - Epiphany profile
@@ -513,6 +523,10 @@ pszxzsd (https://github.com/pszxzsd)
513 -uGet profile 523 -uGet profile
514pwnage-pineapple (https://github.com/pwnage-pineapple) 524pwnage-pineapple (https://github.com/pwnage-pineapple)
515 - update Okular profile 525 - update Okular profile
526Quentin Minster (https://github.com/laomaiweng)
527 - propagate --quiet to children Firejail'ed processes
528 - nodbus enhancements/bugfixes
529 - added vim syntax and ftdetect files
516Rafael Cavalcanti (https://github.com/rccavalcanti) 530Rafael Cavalcanti (https://github.com/rccavalcanti)
517 - chromium profile fixes for Arch Linux 531 - chromium profile fixes for Arch Linux
518Rahiel Kasim (https://github.com/rahiel) 532Rahiel Kasim (https://github.com/rahiel)
@@ -550,23 +564,11 @@ rusty-snake (https://github.com/rusty-snake)
550 - added profiles: klavaro, mypaint, mypaint-ora-thumbnailer, nano 564 - added profiles: klavaro, mypaint, mypaint-ora-thumbnailer, nano
551 - added profiles: gajim-history-manager, freemind, nomacs, kid3 565 - added profiles: gajim-history-manager, freemind, nomacs, kid3
552 - added profiles: kid3-qt, kid3-cli, anki, utox, mp3splt, mp3wrap 566 - added profiles: kid3-qt, kid3-cli, anki, utox, mp3splt, mp3wrap
553 - added profiles: oggsplt, flacsplt, cheese 567 - added profiles: oggsplt, flacsplt, cheese, inkview, mp3splt-gtk
554 - fixed profiles: kdenlive, bibletime, rhythmbox, gajim, seahorse 568 - added profiles: ktouch, yelp
555 - fixed profiles: libreoffice, gnome-maps, wget, seahorse-tool 569 - many profile fixing and hardening
556 - fixed profiles: gnome-logs, atom, brackets, gnome-builder, geany
557 - fixed profiles: vim, emacs, pycharm-community, gedit, klavaro
558 - fixed profiles: default, mpv, authenticator, gramps, webstorm
559 - fixed profiles: freeoffice-planmaker, freeoffice-presentations
560 - fixed profiles: freeoffice-textmaker, code, newsboat, aosp, clion
561 - fixed profiles: android-studio, git, gitg, github-desktop, idea.sh
562 - fixed profiles: ffmpeg, thunderbird, gnome-system-log, file-roller
563 - fixed profiles: eog, eom
564 - hardened profiles: disable-common.inc, disable-programs.inc
565 - hardened profiles: gajim, evince, ffmpeg, feh-network.inc, qtox
566 - hardened profiles: gnome-clocks, meld, minetest, youtube-dl
567 - hardened profiles: bibletime, whois, etr, display, feh, mpv
568 - gnome-mpv was renamed to celluloid
569 - some typo fixes 570 - some typo fixes
571 - added profile templates
570Salvo 'LtWorf' Tomaselli (https://github.com/ltworf) 572Salvo 'LtWorf' Tomaselli (https://github.com/ltworf)
571 - fixed ktorrent profile 573 - fixed ktorrent profile
572sarneaud (https://github.com/sarneaud) 574sarneaud (https://github.com/sarneaud)
@@ -750,6 +752,8 @@ veloute (https://github.com/veloute)
750 - add anki profile 752 - add anki profile
751Vincent43 (https://github.com/Vincent43) 753Vincent43 (https://github.com/Vincent43)
752 - apparmor enhancements 754 - apparmor enhancements
755Vincent Blillault (https://github.com/Feandil)
756 - fix mumble profile
753vismir2 (https://github.com/vismir2) 757vismir2 (https://github.com/vismir2)
754 - feh, ranger, 7z, keepass, keepassx and zathura profiles 758 - feh, ranger, 7z, keepass, keepassx and zathura profiles
755 - claws-mail, mutt, git, emacs, vim profiles 759 - claws-mail, mutt, git, emacs, vim profiles
diff --git a/README.md b/README.md
index dc02ac527..0f692006b 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,10 @@ FAQ: https://firejail.wordpress.com/support/
33Travis-CI status: https://travis-ci.org/netblue30/firejail 33Travis-CI status: https://travis-ci.org/netblue30/firejail
34 34
35 35
36## Security vulnerabilities
37
38We take security bugs very seriously. If you believe you have found one, please report it by emailing us at netblue30@yahoo.com
39
36## Compile and install 40## Compile and install
37````` 41`````
38$ git clone https://github.com/netblue30/firejail.git 42$ git clone https://github.com/netblue30/firejail.git
@@ -95,18 +99,14 @@ If you keep additional Firejail security profiles in a public repository, please
95 99
96Use this issue to request new profiles: [#1139](https://github.com/netblue30/firejail/issues/1139) 100Use this issue to request new profiles: [#1139](https://github.com/netblue30/firejail/issues/1139)
97 101
98We also keep a list of profile fixes for previous released versions in [etc-fixes](https://github.com/netblue30/firejail/tree/master/etc-fixes) directory . 102You can also use this tool to get a list of syscalls needed by a program: [https://github.com/avilum/syscalls](https://github.com/avilum/syscalls).
103
104We also keep a list of profile fixes for previous released versions in [etc-fixes](https://github.com/netblue30/firejail/tree/master/etc-fixes) directory.
99````` 105`````
100 106
101````` 107`````
102## Current development version: 0.9.60-rc2 108## Latest released version: 0.9.60
103 109
104## 0.9.60-rc1 is out! 110## Current development version: 0.9.61
105 111
106## New profiles: 112## New profiles:
107anki, assogiate, autokey-gtk, autokey-qt, autokey-run, autokey-shell, bzflag, celluoid, cheese, code-oss, crawl, crawl-tiles, crow, d-feet, dconf,
108dconf-editor, devhelp, exfalso, font-manager, freeciv, freecol, freeoffice-planmaker, freeoffice-presentations, freeoffice-textmaker, freemind,
109gconf-editor, geekbench, gnome-keyring, gnome-nettool, gnome-system-log, gramps, gsettings, kid3, kid3-cli, kid3-qt, lincity-ng, lugaru,
110Maelstrom, manaplus, megaglest, mpdris2, mypaint, nano, netactview, newsboat, nomacs, nyx, opencity, openclonk, openttd, ostrichriders, pavucontrol,
111pioneer, pragha, redshift, regextester, seahorse, seahorse-tool, scorched3d, secret-tool, simplescreenrecorder, slashem, subdownloader, sysprof,
112sysprof-cli, teeworlds, torcs, tremulous, transgui, utox, vulturesclaw, vultureseye, warsow, widelands, xfce4-mixer
diff --git a/RELNOTES b/RELNOTES
index 458f9a51e..f060e64a0 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,4 +1,19 @@
1firejail (0.9.60~rc2) baseline; urgency=low 1firejail (0.9.60) baseline; urgency=low
2 * work in progress
3 * profile templates
4 -- netblue30 <netblue30@yahoo.com> Sun, 26 May 2019 08:00:00 -0500
5
6firejail (0.9.60) baseline; urgency=low
7 * security bug reported by Austin Morton:
8 Seccomp filters are copied into /run/firejail/mnt, and are writable
9 within the jail. A malicious process can modify files from inside the
10 jail. Processes that are later joined to the jail will not have seccomp
11 filters applied.
12 * memory-deny-write-execute now also blocks memfd_create
13 * add private-cwd option to control working directory within jail
14 * blocking system D-Bus socket with --nodbus
15 * bringing back Centos 6 support
16 * drop support for flatpak/snap packages
2 * new profiles: crow, nyx, mypaint, celluoid, nano, transgui, mpdris2 17 * new profiles: crow, nyx, mypaint, celluoid, nano, transgui, mpdris2
3 * new profiles: sysprof, simplescreenrecorder, geekbench, xfce4-mixer 18 * new profiles: sysprof, simplescreenrecorder, geekbench, xfce4-mixer
4 * new profiles: pavucontrol, d-feet, seahorse, secret-tool, gnome-keyring 19 * new profiles: pavucontrol, d-feet, seahorse, secret-tool, gnome-keyring
@@ -15,9 +30,8 @@ firejail (0.9.60~rc2) baseline; urgency=low
15 * new profiles: oggsplt, flacsplt, gramps, newsboat, freeoffice-planmaker 30 * new profiles: oggsplt, flacsplt, gramps, newsboat, freeoffice-planmaker
16 * new profiles: autokey-gtk, autokey-qt, autokey-run, autokey-shell 31 * new profiles: autokey-gtk, autokey-qt, autokey-run, autokey-shell
17 * new profiles: freeoffice-presentations, freeoffice-textmaker, mp3wrap 32 * new profiles: freeoffice-presentations, freeoffice-textmaker, mp3wrap
18 * memory-deny-write-execute now also blocks memfd_create 33 * new profiles: inkview, meteo-qt, mp3splt-gtk, ktouch, yelp, cantata
19 * drop support for flatpak/snap packages 34 -- netblue30 <netblue30@yahoo.com> Sun, 26 May 2019 08:00:00 -0500
20 -- netblue30 <netblue30@yahoo.com> Sun, 21 Apr 2019 08:00:00 -0500
21 35
22firejail (0.9.58,2) baseline; urgency=low 36firejail (0.9.58,2) baseline; urgency=low
23 * cgroup flag in /etc/firejail/firejail.config file 37 * cgroup flag in /etc/firejail/firejail.config file
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..96da4aff7
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,23 @@
1# Security Policy
2
3## Supported Versions
4
5| Version | Supported by us | EOL | Supported by distribution |
6| ------- | ------------------ | ---- | ---------------------------
7| 0.9.60 | :heavy_check_mark: | | :white_check_mark: Debian experimental
8| 0.9.58 |:heavy_check_mark: | | :white_check_mark: Ubuntu 19.04 & 19.10; Debian 9 (**backports**), 10, & Sid
9| 0.9.56 | :x: | 27 Jan 2019 |
10| 0.9.54 | :x: | | :white_check_mark: Ubuntu 18.10
11| 0.9.52 | :x: | | :white_check_mark: Ubuntu 18.04 LTS
12| 0.9.50 | :x: | 12 Dec 2017 |
13| 0.9.48 | :x: | 09 Sep 2017 |
14| 0.9.46 | :x: | 12 Jun 2017 |
15| 0.9.44 | :x: | | :white_check_mark: Debian 9
16| 0.9.42 | :x: | 22 Oct 2016 |
17| 0.9.40 | :x: | 09 Sep 2016 |
18| 0.9.38 | :x: | | :white_check_mark: Ubuntu 16.04 LTS
19| <0.9.38 | :x: | Before 05 Feb 2016 |
20
21## Security vulnerabilities
22
23We take security bugs very seriously. If you believe you have found one, please report it by emailing us at netblue30@yahoo.com
diff --git a/configure b/configure
index 0eece5428..d47e0cbb0 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
1#! /bin/sh 1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles. 2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for firejail 0.9.60~rc2. 3# Generated by GNU Autoconf 2.69 for firejail 0.9.61.
4# 4#
5# Report bugs to <netblue30@yahoo.com>. 5# Report bugs to <netblue30@yahoo.com>.
6# 6#
@@ -580,8 +580,8 @@ MAKEFLAGS=
580# Identity of this package. 580# Identity of this package.
581PACKAGE_NAME='firejail' 581PACKAGE_NAME='firejail'
582PACKAGE_TARNAME='firejail' 582PACKAGE_TARNAME='firejail'
583PACKAGE_VERSION='0.9.60~rc2' 583PACKAGE_VERSION='0.9.61'
584PACKAGE_STRING='firejail 0.9.60~rc2' 584PACKAGE_STRING='firejail 0.9.61'
585PACKAGE_BUGREPORT='netblue30@yahoo.com' 585PACKAGE_BUGREPORT='netblue30@yahoo.com'
586PACKAGE_URL='https://firejail.wordpress.com' 586PACKAGE_URL='https://firejail.wordpress.com'
587 587
@@ -1275,7 +1275,7 @@ if test "$ac_init_help" = "long"; then
1275 # Omit some internal or obsolete options to make the list less imposing. 1275 # Omit some internal or obsolete options to make the list less imposing.
1276 # This message is too long to be a string in the A/UX 3.1 sh. 1276 # This message is too long to be a string in the A/UX 3.1 sh.
1277 cat <<_ACEOF 1277 cat <<_ACEOF
1278\`configure' configures firejail 0.9.60~rc2 to adapt to many kinds of systems. 1278\`configure' configures firejail 0.9.61 to adapt to many kinds of systems.
1279 1279
1280Usage: $0 [OPTION]... [VAR=VALUE]... 1280Usage: $0 [OPTION]... [VAR=VALUE]...
1281 1281
@@ -1337,7 +1337,7 @@ fi
1337 1337
1338if test -n "$ac_init_help"; then 1338if test -n "$ac_init_help"; then
1339 case $ac_init_help in 1339 case $ac_init_help in
1340 short | recursive ) echo "Configuration of firejail 0.9.60~rc2:";; 1340 short | recursive ) echo "Configuration of firejail 0.9.61:";;
1341 esac 1341 esac
1342 cat <<\_ACEOF 1342 cat <<\_ACEOF
1343 1343
@@ -1442,7 +1442,7 @@ fi
1442test -n "$ac_init_help" && exit $ac_status 1442test -n "$ac_init_help" && exit $ac_status
1443if $ac_init_version; then 1443if $ac_init_version; then
1444 cat <<\_ACEOF 1444 cat <<\_ACEOF
1445firejail configure 0.9.60~rc2 1445firejail configure 0.9.61
1446generated by GNU Autoconf 2.69 1446generated by GNU Autoconf 2.69
1447 1447
1448Copyright (C) 2012 Free Software Foundation, Inc. 1448Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1744,7 +1744,7 @@ cat >config.log <<_ACEOF
1744This file contains any messages produced by compilers while 1744This file contains any messages produced by compilers while
1745running configure, to aid debugging if configure makes a mistake. 1745running configure, to aid debugging if configure makes a mistake.
1746 1746
1747It was created by firejail $as_me 0.9.60~rc2, which was 1747It was created by firejail $as_me 0.9.61, which was
1748generated by GNU Autoconf 2.69. Invocation command line was 1748generated by GNU Autoconf 2.69. Invocation command line was
1749 1749
1750 $ $0 $@ 1750 $ $0 $@
@@ -4379,7 +4379,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4379# report actual input values of CONFIG_FILES etc. instead of their 4379# report actual input values of CONFIG_FILES etc. instead of their
4380# values after options handling. 4380# values after options handling.
4381ac_log=" 4381ac_log="
4382This file was extended by firejail $as_me 0.9.60~rc2, which was 4382This file was extended by firejail $as_me 0.9.61, which was
4383generated by GNU Autoconf 2.69. Invocation command line was 4383generated by GNU Autoconf 2.69. Invocation command line was
4384 4384
4385 CONFIG_FILES = $CONFIG_FILES 4385 CONFIG_FILES = $CONFIG_FILES
@@ -4433,7 +4433,7 @@ _ACEOF
4433cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 4433cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4434ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 4434ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
4435ac_cs_version="\\ 4435ac_cs_version="\\
4436firejail config.status 0.9.60~rc2 4436firejail config.status 0.9.61
4437configured by $0, generated by GNU Autoconf 2.69, 4437configured by $0, generated by GNU Autoconf 2.69,
4438 with options \\"\$ac_cs_config\\" 4438 with options \\"\$ac_cs_config\\"
4439 4439
diff --git a/configure.ac b/configure.ac
index 4d0b847f5..40ead1604 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
1AC_PREREQ([2.68]) 1AC_PREREQ([2.68])
2AC_INIT(firejail, 0.9.60~rc2, netblue30@yahoo.com, , https://firejail.wordpress.com) 2AC_INIT(firejail, 0.9.61, netblue30@yahoo.com, , https://firejail.wordpress.com)
3AC_CONFIG_SRCDIR([src/firejail/main.c]) 3AC_CONFIG_SRCDIR([src/firejail/main.c])
4#AC_CONFIG_HEADERS([config.h]) 4#AC_CONFIG_HEADERS([config.h])
5 5
diff --git a/etc-fixes/seccomp-join-bug/README b/etc-fixes/seccomp-join-bug/README
new file mode 100644
index 000000000..9f85a0e00
--- /dev/null
+++ b/etc-fixes/seccomp-join-bug/README
@@ -0,0 +1,11 @@
1These are patches for various Firejail versions for the security bug reported by Austin Morton
2on May 21, 2019:
3
4 Seccomp filters are copied into /run/firejail/mnt, and are writable
5 within the jail. A malicious process can modify files from inside the
6 jail. Processes that are later joined to the jail will not have seccomp
7 filters applied.
8
9The original discussion thread: https://github.com/netblue30/firejail/issues/2718
10The fix on mainline: https://github.com/netblue30/firejail/commit/eecf35c2f8249489a1d3e512bb07f0d427183134
11
diff --git a/etc-fixes/seccomp-join-bug/eecf35c-backports.zip b/etc-fixes/seccomp-join-bug/eecf35c-backports.zip
new file mode 100644
index 000000000..59782461e
--- /dev/null
+++ b/etc-fixes/seccomp-join-bug/eecf35c-backports.zip
Binary files differ
diff --git a/etc/Xephyr.profile b/etc/Xephyr.profile
index a9960ebea..b4325cd74 100644
--- a/etc/Xephyr.profile
+++ b/etc/Xephyr.profile
@@ -40,4 +40,4 @@ private
40# private-bin Xephyr,sh,xkbcomp,strace,bash,cat,ls 40# private-bin Xephyr,sh,xkbcomp,strace,bash,cat,ls
41private-dev 41private-dev
42# private-etc alternatives,ld.so.conf,ld.so.cache,resolv.conf,host.conf,nsswitch.conf,gai.conf,hosts,hostname 42# private-etc alternatives,ld.so.conf,ld.so.cache,resolv.conf,host.conf,nsswitch.conf,gai.conf,hosts,hostname
43private-tmp 43#private-tmp
diff --git a/etc/bitlbee.profile b/etc/bitlbee.profile
index 2c2f88ed5..287e5f52e 100644
--- a/etc/bitlbee.profile
+++ b/etc/bitlbee.profile
@@ -33,6 +33,6 @@ private
33private-cache 33private-cache
34private-dev 34private-dev
35private-tmp 35private-tmp
36read-write /var/lib/bitlbee
37 36
38noexec /tmp 37noexec /tmp
38read-write /var/lib/bitlbee
diff --git a/etc/cantata.profile b/etc/cantata.profile
new file mode 100644
index 000000000..e4a4de9c1
--- /dev/null
+++ b/etc/cantata.profile
@@ -0,0 +1,40 @@
1# Firejail profile for Cantata
2# Description: Multimedia player - Qt5 client for the music Player daemon (MPD)
3# This file is overwritten during software install.
4# Persistent local customizations
5include cantata.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/cantata
10noblacklist ${HOME}/.config/cantata
11noblacklist ${HOME}/.local/share/cantata
12noblacklist ${MUSIC}
13
14noblacklist ${PATH}/perl
15noblacklist /usr/lib/perl*
16noblacklist /usr/share/perl*
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-passwdmgr.inc
23include disable-programs.inc
24include disable-xdg.inc
25
26# apparmor
27caps.drop all
28ipc-namespace
29netfilter
30nonewprivs
31noroot
32nou2f
33novideo
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37
38# private-etc samba,gcrypt,drirc,fonts,mpd.conf,kde5rc,passwd,xdg,hosts,ssl
39private-bin cantata,mpd,perl
40private-dev
diff --git a/etc/disable-programs.inc b/etc/disable-programs.inc
index 7de2a620f..5481f976f 100644
--- a/etc/disable-programs.inc
+++ b/etc/disable-programs.inc
@@ -94,6 +94,7 @@ blacklist ${HOME}/.config/Nathan Osman
94blacklist ${HOME}/.config/Nylas Mail 94blacklist ${HOME}/.config/Nylas Mail
95blacklist ${HOME}/.config/PBE 95blacklist ${HOME}/.config/PBE
96blacklist ${HOME}/.config/Qlipper 96blacklist ${HOME}/.config/Qlipper
97blacklist ${HOME}/.config/QGIS
97blacklist ${HOME}/.config/QMediathekView 98blacklist ${HOME}/.config/QMediathekView
98blacklist ${HOME}/.config/QuiteRss 99blacklist ${HOME}/.config/QuiteRss
99blacklist ${HOME}/.config/QuiteRssrc 100blacklist ${HOME}/.config/QuiteRssrc
@@ -128,6 +129,7 @@ blacklist ${HOME}/.config/brasero
128blacklist ${HOME}/.config/brave 129blacklist ${HOME}/.config/brave
129blacklist ${HOME}/.config/caja 130blacklist ${HOME}/.config/caja
130blacklist ${HOME}/.config/calibre 131blacklist ${HOME}/.config/calibre
132blacklist ${HOME}/.config/cantata
131blacklist ${HOME}/.config/catfish 133blacklist ${HOME}/.config/catfish
132blacklist ${HOME}/.config/celluloid 134blacklist ${HOME}/.config/celluloid
133blacklist ${HOME}/.config/cherrytree 135blacklist ${HOME}/.config/cherrytree
@@ -208,6 +210,7 @@ blacklist ${HOME}/.config/kdeconnect
208blacklist ${HOME}/.config/knotesrc 210blacklist ${HOME}/.config/knotesrc
209blacklist ${HOME}/.config/konversationrc 211blacklist ${HOME}/.config/konversationrc
210blacklist ${HOME}/.config/ktorrentrc 212blacklist ${HOME}/.config/ktorrentrc
213blacklist ${HOME}/.config/ktouch2rc
211blacklist ${HOME}/.config/leafpad 214blacklist ${HOME}/.config/leafpad
212blacklist ${HOME}/.config/libreoffice 215blacklist ${HOME}/.config/libreoffice
213blacklist ${HOME}/.config/liferea 216blacklist ${HOME}/.config/liferea
@@ -218,6 +221,7 @@ blacklist ${HOME}/.config/mana
218blacklist ${HOME}/.config/mate-calc 221blacklist ${HOME}/.config/mate-calc
219blacklist ${HOME}/.config/mate/eom 222blacklist ${HOME}/.config/mate/eom
220blacklist ${HOME}/.config/mate/mate-dictionary 223blacklist ${HOME}/.config/mate/mate-dictionary
224blacklist ${HOME}/.config/meteo-qt
221blacklist ${HOME}/.config/mfusion 225blacklist ${HOME}/.config/mfusion
222blacklist ${HOME}/.config/midori 226blacklist ${HOME}/.config/midori
223blacklist ${HOME}/.config/mono 227blacklist ${HOME}/.config/mono
@@ -305,6 +309,7 @@ blacklist ${HOME}/.config/xreader
305blacklist ${HOME}/.config/xviewer 309blacklist ${HOME}/.config/xviewer
306blacklist ${HOME}/.config/yandex-browser 310blacklist ${HOME}/.config/yandex-browser
307blacklist ${HOME}/.config/yandex-browser-beta 311blacklist ${HOME}/.config/yandex-browser-beta
312blacklist ${HOME}/.config/yelp
308blacklist ${HOME}/.config/zathura 313blacklist ${HOME}/.config/zathura
309blacklist ${HOME}/.config/zoomus.conf 314blacklist ${HOME}/.config/zoomus.conf
310blacklist ${HOME}/.conkeror.mozdev.org 315blacklist ${HOME}/.conkeror.mozdev.org
@@ -436,6 +441,7 @@ blacklist ${HOME}/.local/share/JetBrains
436blacklist ${HOME}/.local/share/Mendeley Ltd. 441blacklist ${HOME}/.local/share/Mendeley Ltd.
437blacklist ${HOME}/.local/share/Mumble 442blacklist ${HOME}/.local/share/Mumble
438blacklist ${HOME}/.local/share/PBE 443blacklist ${HOME}/.local/share/PBE
444blacklist ${HOME}/.local/share/QGIS
439blacklist ${HOME}/.local/share/QMediathekView 445blacklist ${HOME}/.local/share/QMediathekView
440blacklist ${HOME}/.local/share/QuiteRss 446blacklist ${HOME}/.local/share/QuiteRss
441blacklist ${HOME}/.local/share/Ricochet 447blacklist ${HOME}/.local/share/Ricochet
@@ -451,6 +457,7 @@ blacklist ${HOME}/.local/share/aspyr-media
451blacklist ${HOME}/.local/share/baloo 457blacklist ${HOME}/.local/share/baloo
452blacklist ${HOME}/.local/share/bibletime 458blacklist ${HOME}/.local/share/bibletime
453blacklist ${HOME}/.local/share/caja-python 459blacklist ${HOME}/.local/share/caja-python
460blacklist ${HOME}/.local/share/cantata
454blacklist ${HOME}/.local/share/cdprojektred 461blacklist ${HOME}/.local/share/cdprojektred
455blacklist ${HOME}/.local/share/clipit 462blacklist ${HOME}/.local/share/clipit
456blacklist ${HOME}/.local/share/contacts 463blacklist ${HOME}/.local/share/contacts
@@ -491,6 +498,7 @@ blacklist ${HOME}/.local/share/knotes
491blacklist ${HOME}/.local/share/krita 498blacklist ${HOME}/.local/share/krita
492blacklist ${HOME}/.local/share/ktorrentrc 499blacklist ${HOME}/.local/share/ktorrentrc
493blacklist ${HOME}/.local/share/ktorrent 500blacklist ${HOME}/.local/share/ktorrent
501blacklist ${HOME}/.local/share/ktouch
494blacklist ${HOME}/.local/share/kwrite 502blacklist ${HOME}/.local/share/kwrite
495blacklist ${HOME}/.local/share/liferea 503blacklist ${HOME}/.local/share/liferea
496blacklist ${HOME}/.local/share/local-mail 504blacklist ${HOME}/.local/share/local-mail
@@ -549,6 +557,7 @@ blacklist ${HOME}/.minetest
549blacklist ${HOME}/.moonchild productions/basilisk 557blacklist ${HOME}/.moonchild productions/basilisk
550blacklist ${HOME}/.moonchild productions/pale moon 558blacklist ${HOME}/.moonchild productions/pale moon
551blacklist ${HOME}/.mozilla 559blacklist ${HOME}/.mozilla
560blacklist ${HOME}/.mp3splt-gtk
552blacklist ${HOME}/.mpd 561blacklist ${HOME}/.mpd
553blacklist ${HOME}/.mpdconf 562blacklist ${HOME}/.mpdconf
554blacklist ${HOME}/.mplayer 563blacklist ${HOME}/.mplayer
@@ -572,6 +581,7 @@ blacklist ${HOME}/.pingus
572blacklist ${HOME}/.pioneer 581blacklist ${HOME}/.pioneer
573blacklist ${HOME}/.purple 582blacklist ${HOME}/.purple
574blacklist ${HOME}/.qemu-launcher 583blacklist ${HOME}/.qemu-launcher
584blacklist ${HOME}/.qgis2
575blacklist ${HOME}/.qmmp 585blacklist ${HOME}/.qmmp
576blacklist ${HOME}/.quodlibet 586blacklist ${HOME}/.quodlibet
577blacklist ${HOME}/.redeclipse 587blacklist ${HOME}/.redeclipse
@@ -648,6 +658,7 @@ blacklist ${HOME}/.cache/attic
648blacklist ${HOME}/.cache/bnox 658blacklist ${HOME}/.cache/bnox
649blacklist ${HOME}/.cache/borg 659blacklist ${HOME}/.cache/borg
650blacklist ${HOME}/.cache/calibre 660blacklist ${HOME}/.cache/calibre
661blacklist ${HOME}/.cache/cantata
651blacklist ${HOME}/.cache/champlain 662blacklist ${HOME}/.cache/champlain
652blacklist ${HOME}/.cache/chromium 663blacklist ${HOME}/.cache/chromium
653blacklist ${HOME}/.cache/chromium-dev 664blacklist ${HOME}/.cache/chromium-dev
diff --git a/etc/eo-common.profile b/etc/eo-common.profile
new file mode 100644
index 000000000..ad18e10c4
--- /dev/null
+++ b/etc/eo-common.profile
@@ -0,0 +1,47 @@
1# Firejail profile for eo-common
2# Description: Common profile for Eye of GNOME/MATE graphics viewer program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include eo-common.local
6# Persistent global definitions
7# already included by caller profile
8#include globals.local
9
10noblacklist ${HOME}/.local/share/Trash
11noblacklist ${HOME}/.Steam
12noblacklist ${HOME}/.steam
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-passwdmgr.inc
19include disable-programs.inc
20
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27no3d
28nodvd
29nogroups
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,netlink
37seccomp
38shell none
39tracelog
40
41private-cache
42private-dev
43private-etc alternatives,dconf,fonts,gtk-3.0
44private-lib eog,eom,gdk-pixbuf-2.*,gio,girepository-1.*,gvfs,libgconf-2.so.*
45private-tmp
46
47#memory-deny-write-execute - breaks on Arch
diff --git a/etc/eog.profile b/etc/eog.profile
index 1dcc687fc..8e3aa42fe 100644
--- a/etc/eog.profile
+++ b/etc/eog.profile
@@ -6,46 +6,12 @@ include eog.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
9noblacklist ${HOME}/.Steam
10noblacklist ${HOME}/.config/eog 9noblacklist ${HOME}/.config/eog
11noblacklist ${HOME}/.local/share/Trash
12noblacklist ${HOME}/.steam
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-passwdmgr.inc
19include disable-programs.inc
20
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27no3d
28nodvd
29nogroups
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40 10
41# private-bin, private-etc and private-lib break 'Open With' / 'Open in file manager' 11# private-bin, private-etc and private-lib break 'Open With' / 'Open in file manager'
42# comment those if you need that functionality 12# comment those if you need that functionality
43# or put 'ignore private-bin', 'ignore private-etc' and 'ignore private-lib' in your eog.local 13# or put 'ignore private-bin', 'ignore private-etc' and 'ignore private-lib' in your eog.local
44private-bin eog 14private-bin eog
45private-cache
46private-dev
47private-etc alternatives,fonts
48private-lib eog,gdk-pixbuf-2.*,gio,girepository-1.*,gvfs,libgconf-2.so.*
49private-tmp
50 15
51# memory-deny-write-execute 16# Redirect
17include eo-common.profile
diff --git a/etc/eom.profile b/etc/eom.profile
index 7cb3f98cd..437326d38 100644
--- a/etc/eom.profile
+++ b/etc/eom.profile
@@ -6,42 +6,12 @@ include eom.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
9noblacklist ${HOME}/.Steam
10noblacklist ${HOME}/.config/mate/eom 9noblacklist ${HOME}/.config/mate/eom
11noblacklist ${HOME}/.local/share/Trash
12noblacklist ${HOME}/.steam
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-passwdmgr.inc
19include disable-programs.inc
20
21include whitelist-var-common.inc
22
23caps.drop all
24no3d
25nodvd
26nogroups
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix
34seccomp
35shell none
36tracelog
37 10
38# private-bin, private-etc and private-lib break 'Open With' / 'Open in file manager' 11# private-bin, private-etc and private-lib break 'Open With' / 'Open in file manager'
39# comment those if you need that functionality 12# comment those if you need that functionality
40# or put 'ignore private-bin', 'ignore private-etc' and 'ignore private-lib' in your eom.local 13# or put 'ignore private-bin', 'ignore private-etc' and 'ignore private-lib' in your eom.local
41private-bin eom 14private-bin eom
42private-dev
43private-etc alternatives,fonts
44private-lib
45private-tmp
46 15
47#memory-deny-write-execute - breaks on Arch 16# Redirect
17include eo-common.profile
diff --git a/etc/exiftool.profile b/etc/exiftool.profile
index 2ee4aae6f..f694ea212 100644
--- a/etc/exiftool.profile
+++ b/etc/exiftool.profile
@@ -41,7 +41,7 @@ shell none
41tracelog 41tracelog
42 42
43# To support exiftool in private-bin on Arch Linux (and derivatives), symlink /usr/bin/vendor_perl/exiftool to /usr/bin/exiftool and uncomment the below. 43# To support exiftool in private-bin on Arch Linux (and derivatives), symlink /usr/bin/vendor_perl/exiftool to /usr/bin/exiftool and uncomment the below.
44# Users on non-Arch Linux distributions can safely uncomment the below to enable extra hardening. 44# Users on non-Arch Linux distributions can safely uncomment (or put in exiftool.local) the line below to enable extra hardening.
45#private-bin exiftool,perl 45#private-bin exiftool,perl
46private-cache 46private-cache
47private-dev 47private-dev
diff --git a/etc/firefox-common.profile b/etc/firefox-common.profile
index 080d9e81a..bccbb3412 100644
--- a/etc/firefox-common.profile
+++ b/etc/firefox-common.profile
@@ -9,7 +9,7 @@ include firefox-common.local
9# noexec ${HOME} breaks DRM binaries. 9# noexec ${HOME} breaks DRM binaries.
10?BROWSER_ALLOW_DRM: ignore noexec ${HOME} 10?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
11 11
12# Uncomment the following line to allow access to common programs/addons/plugins. 12# Uncomment the following line (or put it in your firefox-common.local) to allow access to common programs/addons/plugins.
13#include firefox-common-addons.inc 13#include firefox-common-addons.inc
14 14
15noblacklist ${HOME}/.pki 15noblacklist ${HOME}/.pki
diff --git a/etc/firejail.config b/etc/firejail.config
index 497d9633e..92df8ad1a 100644
--- a/etc/firejail.config
+++ b/etc/firejail.config
@@ -32,7 +32,7 @@
32 32
33# Disable /mnt, /media, /run/mount and /run/media access. By default access 33# Disable /mnt, /media, /run/mount and /run/media access. By default access
34# to these directories is enabled. Unlike --disable-mnt profile option this 34# to these directories is enabled. Unlike --disable-mnt profile option this
35# cannot be overridden by --noblacklist. 35# cannot be overridden by --noblacklist or --ignore.
36# disable-mnt no 36# disable-mnt no
37 37
38# Enable or disable file transfer support, default enabled. 38# Enable or disable file transfer support, default enabled.
diff --git a/etc/gnome-chess.profile b/etc/gnome-chess.profile
index 2f4626891..04409a5e4 100644
--- a/etc/gnome-chess.profile
+++ b/etc/gnome-chess.profile
@@ -18,7 +18,10 @@ include disable-xdg.inc
18 18
19include whitelist-var-common.inc 19include whitelist-var-common.inc
20 20
21apparmor
21caps.drop all 22caps.drop all
23machine-id
24net none
22no3d 25no3d
23nodvd 26nodvd
24nogroups 27nogroups
@@ -35,6 +38,7 @@ tracelog
35 38
36disable-mnt 39disable-mnt
37private-bin fairymax,gnome-chess,hoichess,gnuchess 40private-bin fairymax,gnome-chess,hoichess,gnuchess
41private-cache
38private-dev 42private-dev
39private-etc alternatives,fonts,gnome-chess 43private-etc alternatives,dconf,fonts,gnome-chess,gtk-3.0
40private-tmp 44private-tmp
diff --git a/etc/gpg.profile b/etc/gpg.profile
index 47e6e5265..51662b59c 100644
--- a/etc/gpg.profile
+++ b/etc/gpg.profile
@@ -29,8 +29,7 @@ nou2f
29novideo 29novideo
30protocol unix,inet,inet6 30protocol unix,inet,inet6
31seccomp 31seccomp
32# Causes gpg to hang 32shell none
33#shell none
34tracelog 33tracelog
35 34
36# private-bin gpg,gpg-agent 35# private-bin gpg,gpg-agent
diff --git a/etc/inkview.profile b/etc/inkview.profile
new file mode 100644
index 000000000..6c0127f37
--- /dev/null
+++ b/etc/inkview.profile
@@ -0,0 +1,8 @@
1# Firejail profile for inkview
2# Description: an SVG slideshow program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include inkview.local
6
7# Redirect
8include inkscape.profile
diff --git a/etc/keepassxc.profile b/etc/keepassxc.profile
index 33b4509b7..c1adfd516 100644
--- a/etc/keepassxc.profile
+++ b/etc/keepassxc.profile
@@ -41,7 +41,7 @@ protocol netlink,unix
41seccomp 41seccomp
42shell none 42shell none
43 43
44private-bin keepassxc 44private-bin keepassxc,keepassxc-proxy
45private-dev 45private-dev
46private-etc alternatives,fonts,ld.so.cache,machine-id 46private-etc alternatives,fonts,ld.so.cache,machine-id
47private-tmp 47private-tmp
diff --git a/etc/ktouch.profile b/etc/ktouch.profile
new file mode 100644
index 000000000..446bc50ee
--- /dev/null
+++ b/etc/ktouch.profile
@@ -0,0 +1,50 @@
1# Firejail profile for KTouch
2# Description: a typing tutor by KDE
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ktouch.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/ktouch2rc
10noblacklist ${HOME}/.local/share/ktouch
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-passwdmgr.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20mkfile ${HOME}/.config/ktouch2rc
21mkdir ${HOME}/.local/share/ktouch
22whitelist ${HOME}/.config/ktouch2rc
23whitelist ${HOME}/.local/share/ktouch
24include whitelist-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29machine-id
30net none
31nodbus
32nodvd
33nogroups
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,netlink
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin ktouch
47private-cache
48private-dev
49private-etc alternatives,fonts,kde5rc,machine-id
50private-tmp
diff --git a/etc/libreoffice.profile b/etc/libreoffice.profile
index 6e77cd741..5bb943323 100644
--- a/etc/libreoffice.profile
+++ b/etc/libreoffice.profile
@@ -29,9 +29,7 @@ include whitelist-var-common.inc
29# comment the next line to use the ubuntu profile instead of firejail's apparmor profile 29# comment the next line to use the ubuntu profile instead of firejail's apparmor profile
30apparmor 30apparmor
31caps.drop all 31caps.drop all
32#machine-id
33netfilter 32netfilter
34#nodbus
35nodvd 33nodvd
36nogroups 34nogroups
37# comment nonewprivs when using the ubuntu 18.04/debian 10 apparmor profile 35# comment nonewprivs when using the ubuntu 18.04/debian 10 apparmor profile
@@ -50,5 +48,4 @@ tracelog
50private-dev 48private-dev
51private-tmp 49private-tmp
52 50
53
54join-or-start libreoffice 51join-or-start libreoffice
diff --git a/etc/masterpdfeditor.profile b/etc/masterpdfeditor.profile
index ce6486115..e4da0c66a 100644
--- a/etc/masterpdfeditor.profile
+++ b/etc/masterpdfeditor.profile
@@ -20,9 +20,7 @@ include whitelist-var-common.inc
20 20
21apparmor 21apparmor
22caps.drop all 22caps.drop all
23ipc-namespace
24machine-id 23machine-id
25no3d
26nodvd 24nodvd
27nogroups 25nogroups
28nonewprivs 26nonewprivs
@@ -36,7 +34,6 @@ seccomp
36shell none 34shell none
37tracelog 35tracelog
38 36
39private-bin masterpdfedito*
40private-cache 37private-cache
41private-dev 38private-dev
42private-etc alternatives,fonts 39private-etc alternatives,fonts
diff --git a/etc/meteo-qt.profile b/etc/meteo-qt.profile
new file mode 100644
index 000000000..a769a97ec
--- /dev/null
+++ b/etc/meteo-qt.profile
@@ -0,0 +1,53 @@
1# Firejail profile for meteo-qt
2# Description: System tray application for weather status information
3# This file is overwritten after every install/update
4# Persistent local customizations
5include meteo-qt.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/autostart
10noblacklist ${HOME}/.config/meteo-qt
11
12# Allow python (blacklisted by disable-interpreters.inc)
13noblacklist ${PATH}/python3*
14noblacklist /usr/lib/python3*
15noblacklist /usr/local/lib/python3*
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-passwdmgr.inc
22include disable-programs.inc
23include disable-xdg.inc
24
25whitelist ${HOME}/.config/autostart
26mkdir ${HOME}/.config/meteo-qt
27whitelist ${HOME}/.config/meteo-qt
28include whitelist-common.inc
29include whitelist-var-common.inc
30
31caps.drop all
32netfilter
33nodbus
34nodvd
35nogroups
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44shell none
45tracelog
46
47disable-mnt
48private-bin meteo-qt,python*
49private-cache
50private-dev
51private-tmp
52
53memory-deny-write-execute
diff --git a/etc/mp3splt-gtk.profile b/etc/mp3splt-gtk.profile
new file mode 100644
index 000000000..d14006112
--- /dev/null
+++ b/etc/mp3splt-gtk.profile
@@ -0,0 +1,41 @@
1# Firejail profile for mp3splt-gtk
2# Description: Gtk utility for mp3/ogg splitting without decoding
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mp3splt-gtk.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.mp3splt-gtk
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-passwdmgr.inc
16include disable-programs.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22net none
23no3d
24nodbus
25nodvd
26nogroups
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35tracelog
36
37private-bin mp3splt-gtk
38private-cache
39private-dev
40private-etc alsa,alternatives,asound.conf,fonts,gtk-3.0,dconf,machine-id,openal,pulse
41private-tmp
diff --git a/etc/ocenaudio.profile b/etc/ocenaudio.profile
index ceeb59384..b2249f63b 100644
--- a/etc/ocenaudio.profile
+++ b/etc/ocenaudio.profile
@@ -24,7 +24,7 @@ ipc-namespace
24# net none breaks AppArmor on Ubuntu systems 24# net none breaks AppArmor on Ubuntu systems
25netfilter 25netfilter
26no3d 26no3d
27# nodbus - breaks preferences, comment when needed 27# nodbus - breaks preferences, comment (or put 'ignore nodbus' in your oceanaudio.local) when needed
28nodbus 28nodbus
29nodvd 29nodvd
30nogroups 30nogroups
@@ -39,12 +39,10 @@ shell none
39tracelog 39tracelog
40 40
41# disable-mnt 41# disable-mnt
42# private
43private-bin ocenaudio 42private-bin ocenaudio
44private-cache 43private-cache
45private-dev 44private-dev
46private-etc alternatives,asound.conf,fonts,ld.so.cache,pulse 45private-etc alternatives,asound.conf,fonts,ld.so.cache,pulse
47# private-lib
48private-tmp 46private-tmp
49 47
50# memory-deny-write-execute - breaks on Arch 48# memory-deny-write-execute - breaks on Arch
diff --git a/etc/orage.profile b/etc/orage.profile
index 2c55ab909..4e12892d6 100644
--- a/etc/orage.profile
+++ b/etc/orage.profile
@@ -24,7 +24,7 @@ nodvd
24nogroups 24nogroups
25nonewprivs 25nonewprivs
26noroot 26noroot
27nosound 27# nosound - calendar application, It must be able to play sound to wake you up.
28notv 28notv
29nou2f 29nou2f
30novideo 30novideo
diff --git a/etc/pidgin.profile b/etc/pidgin.profile
index 444478149..bdd5404f5 100644
--- a/etc/pidgin.profile
+++ b/etc/pidgin.profile
@@ -6,9 +6,7 @@ include pidgin.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
9mkdir ${HOME}/.purple
10noblacklist ${HOME}/.purple 9noblacklist ${HOME}/.purple
11whitelist ${HOME}/.purple
12 10
13ignore noexec ${RUNUSER} 11ignore noexec ${RUNUSER}
14ignore noexec /dev/shm 12ignore noexec /dev/shm
@@ -20,6 +18,9 @@ include disable-interpreters.inc
20include disable-passwdmgr.inc 18include disable-passwdmgr.inc
21include disable-programs.inc 19include disable-programs.inc
22include disable-xdg.inc 20include disable-xdg.inc
21
22mkdir ${HOME}/.purple
23whitelist ${HOME}/.purple
23include whitelist-common.inc 24include whitelist-common.inc
24include whitelist-var-common.inc 25include whitelist-var-common.inc
25 26
diff --git a/etc/qgis.profile b/etc/qgis.profile
new file mode 100644
index 000000000..45fe59cf7
--- /dev/null
+++ b/etc/qgis.profile
@@ -0,0 +1,60 @@
1# Firejail profile for qgis
2# Description: GIS application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qgis.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/QtProject.conf
10noblacklist ${HOME}/.config/QGIS
11noblacklist ${HOME}/.local/share/QGIS
12noblacklist ${HOME}/.qgis2
13noblacklist ${DOCUMENTS}
14
15# Allow python (blacklisted by disable-interpreters.inc)
16noblacklist ${PATH}/python3*
17noblacklist /usr/lib/python3*
18noblacklist /usr/local/lib/python3*
19
20include disable-common.inc
21include disable-devel.inc
22include disable-exec.inc
23include disable-interpreters.inc
24include disable-passwdmgr.inc
25include disable-programs.inc
26include disable-xdg.inc
27
28mkdir ${HOME}/.local/share/QGIS
29mkdir ${HOME}/.qgis2
30mkdir ${HOME}/.config/QGIS
31whitelist ${HOME}/.local/share/QGIS
32whitelist ${HOME}/.qgis2
33whitelist ${HOME}/.config/QGIS
34whitelist ${DOCUMENTS}
35include whitelist-common.inc
36include whitelist-var-common.inc
37
38caps.drop all
39netfilter
40machine-id
41nodbus
42nodvd
43nogroups
44nonewprivs
45noroot
46nosound
47notv
48nou2f
49novideo
50# blacklisting of mbind system calls breaks old version
51seccomp.drop @cpu-emulation,@debug,@obsolete,@privileged,set_mempolicy,migrate_pages,move_pages,open_by_handle_at,name_to_handle_at,ioprio_set,ni_syscall,syslog,fanotify_init,kcmp,add_key,request_key,keyctl,io_setup,io_destroy,io_getevents,io_submit,io_cancel,remap_file_pages,vmsplice,umount,userfaultfd,mincore
52protocol unix,inet,inet6,netlink
53shell none
54tracelog
55
56disable-mnt
57private-cache
58private-dev
59private-etc alternatives,ca-certificates,crypto-policies,fonts,machine-id,pki,resolv.conf,ssl,QGIS,QGIS.conf,Trolltech.conf
60private-tmp
diff --git a/etc/seahorse.profile b/etc/seahorse.profile
index cd9f6c767..fc54a0716 100644
--- a/etc/seahorse.profile
+++ b/etc/seahorse.profile
@@ -50,7 +50,7 @@ nou2f
50novideo 50novideo
51protocol unix,inet,inet6 51protocol unix,inet,inet6
52seccomp 52seccomp
53# shell none - causes gpg to hang 53shell none
54tracelog 54tracelog
55 55
56disable-mnt 56disable-mnt
diff --git a/etc/spotify.profile b/etc/spotify.profile
index 6f7f6ec85..00c2aabe2 100644
--- a/etc/spotify.profile
+++ b/etc/spotify.profile
@@ -6,9 +6,6 @@ include spotify.local
6include globals.local 6include globals.local
7 7
8blacklist ${HOME}/.bashrc 8blacklist ${HOME}/.bashrc
9blacklist /lost+found
10blacklist /sbin
11blacklist /srv
12 9
13noblacklist ${HOME}/.cache/spotify 10noblacklist ${HOME}/.cache/spotify
14noblacklist ${HOME}/.config/spotify 11noblacklist ${HOME}/.config/spotify
@@ -49,5 +46,6 @@ private-bin spotify,bash,sh,zenity
49private-dev 46private-dev
50private-etc alternatives,fonts,group,ld.so.cache,machine-id,pulse,resolv.conf,hosts,nsswitch.conf,host.conf,ca-certificates,ssl,pki,crypto-policies 47private-etc alternatives,fonts,group,ld.so.cache,machine-id,pulse,resolv.conf,hosts,nsswitch.conf,host.conf,ca-certificates,ssl,pki,crypto-policies
51private-opt spotify 48private-opt spotify
49private-srv none
52private-tmp 50private-tmp
53 51
diff --git a/etc/sysprof.profile b/etc/sysprof.profile
index 3cfea5c5e..e978e03f2 100644
--- a/etc/sysprof.profile
+++ b/etc/sysprof.profile
@@ -24,7 +24,7 @@ no3d
24nodvd 24nodvd
25nogroups 25nogroups
26nonewprivs 26nonewprivs
27# Ubuntu 16.04 version needs root privileges - uncomment if you don't use that 27# Ubuntu 16.04 version needs root privileges - uncomment or put in sysprof.local if you don't use that
28#noroot 28#noroot
29nosound 29nosound
30notv 30notv
diff --git a/etc/templates/Notes b/etc/templates/Notes
new file mode 100644
index 000000000..a4170207b
--- /dev/null
+++ b/etc/templates/Notes
@@ -0,0 +1,7 @@
1Notes
2=====
3
4 * Lines with one # are often used
5 * Lines with two ## are only in special situation needed
6 * Add programs specific paths like .config/program to disable-programs.inc
7 * Add the name of the profile/program to src/firecfg/firecfg.config
diff --git a/etc/templates/profile.template b/etc/templates/profile.template
new file mode 100644
index 000000000..d7da0ed20
--- /dev/null
+++ b/etc/templates/profile.template
@@ -0,0 +1,82 @@
1# Firejail profile for PROGRAM_NAME
2# Description: DESCRIPTION
3# This file is overwritten after every install/update
4##quiet
5# Persistent local customizations
6#include PROFILE.local
7# Persistent global definitions
8#include globals.local
9
10##ignore noexec ${HOME}
11
12##blacklist PATH
13
14#noblacklist PATH
15
16# Allow python (blacklisted by disable-interpreters.inc)
17#noblacklist ${PATH}/python2*
18#noblacklist ${PATH}/python3*
19#noblacklist /usr/lib/python2*
20#noblacklist /usr/lib/python3*
21#noblacklist /usr/local/lib/python2*
22#noblacklist /usr/local/lib/python3*
23
24#include disable-common.inc
25#include disable-devel.inc
26#include disable-exec.inc
27#include disable-interpreters.inc
28#include disable-passwdmgr.inc
29#include disable-programs.inc
30#include disable-xdg.inc
31
32#mkdir PATH
33#mkfile PATH
34#whitelist PATH
35#include whitelist-common.inc
36#include whitelist-var-common.inc
37
38#apparmor
39#caps.drop all
40# CLI only
41##ipc-namespace
42#machine-id
43# 'net none' or 'netfilter'
44#net none
45#netfilter
46#no3d
47#nodbus
48#nodvd
49#nogroups
50#nonewprivs
51#noroot
52#nosound
53#notv
54#nou2f
55#novideo
56#protocol unix,inet,inet6,netlink
57#seccomp
58##seccomp.drop SYSCALLS
59#shell none
60#tracelog
61
62#disable-mnt
63##private
64#private-bin PROGRAMS
65#private-cache
66#private-dev
67#private-etc FILES
68# private-etc templates (see also #1734)
69# Internet: ca-certificates,crypto-policies,nsswitch.conf,pki,resolv.conf,ssl
70# Sound: alsa,asound.conf,machine-id,openal,pulse
71# GTK: dconf,fonts,gtk-2.0,gtk-3.0,pango,xdg
72# KDE/QT: fonts,kde4rc,kde5rc,ld.so.cache,machine-id,Trolltech.conf,xdg
73# GUIs: fonts
74# Alternatives: alternatives
75##private-lib LIBS
76##private-opt NAME
77#private-tmp
78
79##env VAR=VALUE
80#memory-deny-write-execute
81##read-only ${HOME}
82##join-or-start NAME
diff --git a/etc/templates/redirect_alias-profile.template b/etc/templates/redirect_alias-profile.template
new file mode 100644
index 000000000..56dd43ca4
--- /dev/null
+++ b/etc/templates/redirect_alias-profile.template
@@ -0,0 +1,36 @@
1# Firejail profile for PRGOGRAM_NAME
2# Description: DESCRIPTION
3# This file is overwritten after every install/update
4# Persistent local customizations
5include PROFILE.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9#NOTE: let include globals.local commented
10
11# Additional blacklisting (if needed)
12#blacklist PATH
13
14# Additional noblacklisting (if needed)
15#noblacklist PATH
16
17# Additional whitelisting (if needed)
18#mkdir PATH
19#mkfile PATH
20#whitelist PATH
21
22# Additional options if needed (see firejail-profile.example)
23
24# Add programs to private-bin (if needed)
25#private-bin PROGRAMS
26# Add files to private-etc (if needed)
27#private-etc FILES
28
29# Ignore something that is in the included profile
30#ignore net none
31#ignore private-bin
32#ignore seccomp
33#...
34
35# Redirect
36include PROFILE.profile
diff --git a/etc/templates/syscalls.txt b/etc/templates/syscalls.txt
new file mode 100644
index 000000000..ec8247517
--- /dev/null
+++ b/etc/templates/syscalls.txt
@@ -0,0 +1,43 @@
1Hints for writing seccomp.drop lines
2====================================
3
4@clock=adjtimex,clock_adjtime,clock_settime,settimeofday,stime
5@module=delete_module,finit_module,init_module
6@raw-io=ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_mmio_read,s390_mmio_write
7@reboot=kexec_load,kexec_file_load,reboot,
8@swap=swapon,swapoff
9
10@privileged=@clock,@module,@raw-io,@reboot,@swap,acct,bpf,chroot,mount,nfsservctl,pivot_root,setdomainname,sethostname,umount2,vhangup
11
12@cpu-emulation=modify_ldt,subpage_prot,switch_endian,vm86,vm86old
13@debug=lookup_dcookie,perf_event_open,process_vm_writev,rtas,s390_runtime_instr,sys_debug_setcontext
14@obsolete=_sysctl,afs_syscall,bdflush,break,create_module,ftime,get_kernel_syms,getpmsg,gtty,lock,mpx,prof,profil,putpmsg,query_module,security,sgetmask,ssetmask,stty,sysfs,tuxcall,ulimit,uselib,ustat,vserver
15@resources=set_mempolicy,migrate_pages,move_pages,mbind
16
17@default=@cpu-emulation,@debug,@obsolete,@privileged,@resources,open_by_handle_at,name_to_handle_at,ioprio_set,ni_syscall,syslog,fanotify_init,kcmp,add_key,request_key,keyctl,io_setup,io_destroy,io_getevents,io_submit,io_cancel,remap_file_pages,vmsplice,umount,userfaultfd,mincore
18
19@default-nodebuggers=@default,ptrace,personality,process_vm_readv
20
21@default-keep=execve,prctl
22
23
24+---------+----------------+---------------+
25| @clock | @cpu-emulation | @default-keep |
26| @module | @debug | |
27| @raw-io | @obsolete | |
28| @reboot | @resources | |
29| @swap | | |
30+---------+----------------+---------------+
31 : :
32+-------------+ :
33| @privileged | :
34+-------------+ :
35 : :
36+----------+ :
37| @default |........:
38+----------+
39 :
40+----------------------+
41| @default-nodebuggers |
42+----------------------+
43
diff --git a/etc/transgui.profile b/etc/transgui.profile
index 8043bfa01..0d09cef87 100644
--- a/etc/transgui.profile
+++ b/etc/transgui.profile
@@ -2,7 +2,7 @@
2# Description: Cross-platform Transmission BitTorrent client 2# Description: Cross-platform Transmission BitTorrent client
3# This file is overwritten after every install/update 3# This file is overwritten after every install/update
4# Persistent local customizations 4# Persistent local customizations
5include /etc/firejail/transgui.local 5include transgui.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
diff --git a/etc/xiphos.profile b/etc/xiphos.profile
index 3ad03e2c6..33056395e 100644
--- a/etc/xiphos.profile
+++ b/etc/xiphos.profile
@@ -13,6 +13,7 @@ noblacklist ${HOME}/.xiphos
13 13
14include disable-common.inc 14include disable-common.inc
15include disable-devel.inc 15include disable-devel.inc
16include disable-exec.inc
16include disable-interpreters.inc 17include disable-interpreters.inc
17include disable-passwdmgr.inc 18include disable-passwdmgr.inc
18include disable-programs.inc 19include disable-programs.inc
@@ -20,8 +21,11 @@ include disable-programs.inc
20whitelist ${HOME}/.sword 21whitelist ${HOME}/.sword
21whitelist ${HOME}/.xiphos 22whitelist ${HOME}/.xiphos
22include whitelist-common.inc 23include whitelist-common.inc
24include whitelist-var-common.inc
23 25
26apparmor
24caps.drop all 27caps.drop all
28machine-id
25netfilter 29netfilter
26nodvd 30nodvd
27nogroups 31nogroups
@@ -36,7 +40,9 @@ seccomp
36shell none 40shell none
37tracelog 41tracelog
38 42
43disable-mnt
39private-bin xiphos 44private-bin xiphos
45private-cache
40private-dev 46private-dev
41private-etc alternatives,fonts,resolv.conf,sword,ca-certificates,ssl,pki,crypto-policies 47private-etc alternatives,fonts,resolv.conf,sword,ca-certificates,ssli,sword.conf,pki,crypto-policies
42private-tmp 48private-tmp
diff --git a/etc/yelp.profile b/etc/yelp.profile
new file mode 100644
index 000000000..66f094e1d
--- /dev/null
+++ b/etc/yelp.profile
@@ -0,0 +1,51 @@
1# Firejail profile for yelp
2# Description: Help browser for the GNOME desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include yelp.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/yelp
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-passwdmgr.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/yelp
20whitelist ${HOME}/.config/yelp
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26net none
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37tracelog
38
39disable-mnt
40private-bin yelp
41private-cache
42private-dev
43private-etc alsa,alternatives,asound.conf,crypto-policies,cups,dconf,drirc,fonts,gcrypt,gtk-3.0,machine-id,openal,os-release,pulse,sgml,xml
44private-tmp
45
46# read-only ${HOME} breaks some not necesarry featrues, comment it if
47# you need them or put 'ignore read-only ${HOME}' into your yelp.local.
48# broken features:
49# 1. yelp --editor-mode
50# 2. saving the window geometry
51read-only ${HOME}
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config
index 2d4902b91..48789359d 100644
--- a/src/firecfg/firecfg.config
+++ b/src/firecfg/firecfg.config
@@ -92,6 +92,7 @@ calligraplanwork
92calligrasheets 92calligrasheets
93calligrastage 93calligrastage
94calligrawords 94calligrawords
95cantata
95catfish 96catfish
96celluloid 97celluloid
97checkbashisms 98checkbashisms
@@ -131,7 +132,6 @@ deluge
131devhelp 132devhelp
132dex2jar 133dex2jar
133dia 134dia
134dig
135digikam 135digikam
136dillo 136dillo
137dino 137dino
@@ -281,6 +281,7 @@ idea.sh
281imagej 281imagej
282img2txt 282img2txt
283inkscape 283inkscape
284inkview
284inox 285inox
285iridium 286iridium
286iridium-browser 287iridium-browser
@@ -313,6 +314,7 @@ kopete
313krita 314krita
314# krunner 315# krunner
315ktorrent 316ktorrent
317ktouch
316# kwin_x11 318# kwin_x11
317kwrite 319kwrite
318leafpad 320leafpad
@@ -360,11 +362,13 @@ megaglest_editor
360meld 362meld
361mencoder 363mencoder
362mendeleydesktop 364mendeleydesktop
365meteo-qt
363midori 366midori
364min 367min
365minetest 368minetest
366mousepad 369mousepad
367mp3splt 370mp3splt
371mp3splt-gtk
368mp3wrap 372mp3wrap
369mpDris2 373mpDris2
370mplayer 374mplayer
@@ -446,6 +450,7 @@ pybitmessage
446# pycharm-professional 450# pycharm-professional
447qbittorrent 451qbittorrent
448qemu-launcher 452qemu-launcher
453qgis
449qlipper 454qlipper
450qmmp 455qmmp
451qpdfview 456qpdfview
@@ -632,6 +637,7 @@ xreader-previewer
632xreader-thumbnailer 637xreader-thumbnailer
633xviewer 638xviewer
634yandex-browser 639yandex-browser
640yelp
635youtube-dl 641youtube-dl
636zaproxy 642zaproxy
637zart 643zart
diff --git a/src/firecfg/firecfg.h b/src/firecfg/firecfg.h
index e847719cf..71e5d625d 100644
--- a/src/firecfg/firecfg.h
+++ b/src/firecfg/firecfg.h
@@ -17,6 +17,8 @@
17 * with this program; if not, write to the Free Software Foundation, Inc., 17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/ 19*/
20#ifndef FIRECFG_H
21#define FIRECFG_H
20#define _GNU_SOURCE 22#define _GNU_SOURCE
21#include <stdio.h> 23#include <stdio.h>
22#include <sys/types.h> 24#include <sys/types.h>
@@ -48,3 +50,5 @@ void sound(void);
48 50
49// desktop_files.c 51// desktop_files.c
50void fix_desktop_files(char *homedir); 52void fix_desktop_files(char *homedir);
53
54#endif
diff --git a/src/firejail/dbus.c b/src/firejail/dbus.c
index baa41e85e..b856ff809 100644
--- a/src/firejail/dbus.c
+++ b/src/firejail/dbus.c
@@ -19,7 +19,7 @@
19*/ 19*/
20#include "firejail.h" 20#include "firejail.h"
21 21
22void dbus_session_disable(void) { 22void dbus_disable(void) {
23 if (!checkcfg(CFG_DBUS)) { 23 if (!checkcfg(CFG_DBUS)) {
24 fwarning("D-Bus handling is disabled in Firejail configuration file\n"); 24 fwarning("D-Bus handling is disabled in Firejail configuration file\n");
25 return; 25 return;
@@ -29,7 +29,7 @@ void dbus_session_disable(void) {
29 if (asprintf(&path, "/run/user/%d/bus", getuid()) == -1) 29 if (asprintf(&path, "/run/user/%d/bus", getuid()) == -1)
30 errExit("asprintf"); 30 errExit("asprintf");
31 char *env_var; 31 char *env_var;
32 if (asprintf(&env_var, "DBUS_SESSION_BUS_ADDRESS=unix:path=%s", path) == -1) 32 if (asprintf(&env_var, "unix:path=%s", path) == -1)
33 errExit("asprintf"); 33 errExit("asprintf");
34 34
35 // set a new environment variable: DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/<UID>/bus 35 // set a new environment variable: DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/<UID>/bus
@@ -43,6 +43,17 @@ void dbus_session_disable(void) {
43 free(path); 43 free(path);
44 free(env_var); 44 free(env_var);
45 45
46
47 // blacklist the dbus-launch user directory
48 if (asprintf(&path, "%s/.dbus", cfg.homedir) == -1)
49 errExit("asprintf");
50 disable_file_or_dir(path);
51 free(path);
52
53 // blacklist also system D-Bus socket
54 disable_file_or_dir("/run/dbus/system_bus_socket");
55
56
46 // look for a possible abstract unix socket 57 // look for a possible abstract unix socket
47 58
48 // --net=none 59 // --net=none
diff --git a/src/firejail/env.c b/src/firejail/env.c
index 2e9f516ba..f15e1362f 100644
--- a/src/firejail/env.c
+++ b/src/firejail/env.c
@@ -160,6 +160,11 @@ void env_defaults(void) {
160 // set the window title 160 // set the window title
161 if (!arg_quiet) 161 if (!arg_quiet)
162 printf("\033]0;firejail %s\007", cfg.window_title); 162 printf("\033]0;firejail %s\007", cfg.window_title);
163
164 // pass --quiet as an environment variable, in case the command calls further firejailed commands
165 if (arg_quiet)
166 setenv("FIREJAIL_QUIET", "yes", 1);
167
163 fflush(0); 168 fflush(0);
164} 169}
165 170
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h
index 2e04084e3..fd6cb9ff2 100644
--- a/src/firejail/firejail.h
+++ b/src/firejail/firejail.h
@@ -283,6 +283,7 @@ extern int arg_private_srv; // private srv directory
283extern int arg_private_bin; // private bin directory 283extern int arg_private_bin; // private bin directory
284extern int arg_private_tmp; // private tmp directory 284extern int arg_private_tmp; // private tmp directory
285extern int arg_private_lib; // private lib directory 285extern int arg_private_lib; // private lib directory
286extern int arg_private_cwd; // private working directory
286extern int arg_scan; // arp-scan all interfaces 287extern int arg_scan; // arp-scan all interfaces
287extern int arg_whitelist; // whitelist command 288extern int arg_whitelist; // whitelist command
288extern int arg_nosound; // disable sound 289extern int arg_nosound; // disable sound
@@ -315,6 +316,7 @@ extern int arg_notv; // --notv
315extern int arg_nodvd; // --nodvd 316extern int arg_nodvd; // --nodvd
316extern int arg_nou2f; // --nou2f 317extern int arg_nou2f; // --nou2f
317extern int arg_nodbus; // -nodbus 318extern int arg_nodbus; // -nodbus
319extern int arg_deterministic_exit_code; // always exit with first child's exit status
318 320
319extern int login_shell; 321extern int login_shell;
320extern int parent_to_child_fds[2]; 322extern int parent_to_child_fds[2];
@@ -521,6 +523,8 @@ void fs_private(void);
521void fs_private_homedir(void); 523void fs_private_homedir(void);
522// check new private home directory (--private= option) - exit if it fails 524// check new private home directory (--private= option) - exit if it fails
523void fs_check_private_dir(void); 525void fs_check_private_dir(void);
526// check new private working directory (--private-cwd= option) - exit if it fails
527void fs_check_private_cwd(const char *dir);
524void fs_private_home_list(void); 528void fs_private_home_list(void);
525 529
526 530
@@ -782,6 +786,6 @@ void set_x11_run_file(pid_t pid, int display);
782void set_profile_run_file(pid_t pid, const char *fname); 786void set_profile_run_file(pid_t pid, const char *fname);
783 787
784// dbus.c 788// dbus.c
785void dbus_session_disable(void); 789void dbus_disable(void);
786 790
787#endif 791#endif
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index f9d968427..f3ef97aeb 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -27,7 +27,11 @@
27#include <glob.h> 27#include <glob.h>
28#include <dirent.h> 28#include <dirent.h>
29#include <errno.h> 29#include <errno.h>
30
30#include <fcntl.h> 31#include <fcntl.h>
32#ifndef O_PATH
33# define O_PATH 010000000
34#endif
31 35
32#define MAX_BUF 4096 36#define MAX_BUF 4096
33#define EMPTY_STRING ("") 37#define EMPTY_STRING ("")
@@ -1515,6 +1519,8 @@ void fs_private_tmp(void) {
1515 1519
1516 // whitelist x11 directory 1520 // whitelist x11 directory
1517 profile_add("whitelist /tmp/.X11-unix"); 1521 profile_add("whitelist /tmp/.X11-unix");
1522 // read-only x11 directory
1523 profile_add("read-only /tmp/.X11-unix");
1518 1524
1519 // whitelist any pulse* file in /tmp directory 1525 // whitelist any pulse* file in /tmp directory
1520 // some distros use PulseAudio sockets under /tmp instead of the socket in /urn/user 1526 // some distros use PulseAudio sockets under /tmp instead of the socket in /urn/user
diff --git a/src/firejail/fs_home.c b/src/firejail/fs_home.c
index e35bf073d..3f6d78db4 100644
--- a/src/firejail/fs_home.c
+++ b/src/firejail/fs_home.c
@@ -22,7 +22,6 @@
22#include <linux/limits.h> 22#include <linux/limits.h>
23#include <glob.h> 23#include <glob.h>
24#include <dirent.h> 24#include <dirent.h>
25#include <fcntl.h>
26#include <errno.h> 25#include <errno.h>
27#include <sys/stat.h> 26#include <sys/stat.h>
28#include <sys/types.h> 27#include <sys/types.h>
@@ -31,6 +30,11 @@
31#include <grp.h> 30#include <grp.h>
32//#include <ftw.h> 31//#include <ftw.h>
33 32
33#include <fcntl.h>
34#ifndef O_PATH
35# define O_PATH 010000000
36#endif
37
34static void skel(const char *homedir, uid_t u, gid_t g) { 38static void skel(const char *homedir, uid_t u, gid_t g) {
35 char *fname; 39 char *fname;
36 40
@@ -366,6 +370,21 @@ void fs_check_private_dir(void) {
366 } 370 }
367} 371}
368 372
373// check new private working directory (--private-cwd= option) - exit if it fails
374void fs_check_private_cwd(const char *dir) {
375 EUID_ASSERT();
376 invalid_filename(dir, 0); // no globbing
377
378 // Expand the working directory
379 cfg.cwd = expand_macros(dir);
380
381 // realpath/is_dir not used because path may not exist outside of jail
382 if (strstr(cfg.cwd, "..")) {
383 fprintf(stderr, "Error: invalid private working directory\n");
384 exit(1);
385 }
386}
387
369//*********************************************************************************** 388//***********************************************************************************
370// --private-home 389// --private-home
371//*********************************************************************************** 390//***********************************************************************************
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c
index d128065d3..bce44b9e5 100644
--- a/src/firejail/fs_whitelist.c
+++ b/src/firejail/fs_whitelist.c
@@ -24,9 +24,13 @@
24#include <fnmatch.h> 24#include <fnmatch.h>
25#include <glob.h> 25#include <glob.h>
26#include <dirent.h> 26#include <dirent.h>
27#include <fcntl.h>
28#include <errno.h> 27#include <errno.h>
29 28
29#include <fcntl.h>
30#ifndef O_PATH
31# define O_PATH 010000000
32#endif
33
30// mountinfo functionality test; 34// mountinfo functionality test;
31// 1. enable TEST_MOUNTINFO definition 35// 1. enable TEST_MOUNTINFO definition
32// 2. run firejail --whitelist=/any/directory 36// 2. run firejail --whitelist=/any/directory
diff --git a/src/firejail/main.c b/src/firejail/main.c
index ece4c2cb5..c50ed4dc4 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -92,6 +92,7 @@ int arg_private_srv = 0; // private srv directory
92int arg_private_bin = 0; // private bin directory 92int arg_private_bin = 0; // private bin directory
93int arg_private_tmp = 0; // private tmp directory 93int arg_private_tmp = 0; // private tmp directory
94int arg_private_lib = 0; // private lib directory 94int arg_private_lib = 0; // private lib directory
95int arg_private_cwd = 0; // private working directory
95int arg_scan = 0; // arp-scan all interfaces 96int arg_scan = 0; // arp-scan all interfaces
96int arg_whitelist = 0; // whitelist command 97int arg_whitelist = 0; // whitelist command
97int arg_nosound = 0; // disable sound 98int arg_nosound = 0; // disable sound
@@ -125,6 +126,7 @@ int arg_notv = 0; // --notv
125int arg_nodvd = 0; // --nodvd 126int arg_nodvd = 0; // --nodvd
126int arg_nodbus = 0; // -nodbus 127int arg_nodbus = 0; // -nodbus
127int arg_nou2f = 0; // --nou2f 128int arg_nou2f = 0; // --nou2f
129int arg_deterministic_exit_code = 0; // always exit with first child's exit status
128int login_shell = 0; 130int login_shell = 0;
129 131
130 132
@@ -630,6 +632,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
630 else if (strncmp(argv[i], "--get=", 6) == 0) { 632 else if (strncmp(argv[i], "--get=", 6) == 0) {
631 if (checkcfg(CFG_FILE_TRANSFER)) { 633 if (checkcfg(CFG_FILE_TRANSFER)) {
632 logargs(argc, argv); 634 logargs(argc, argv);
635 if (arg_private_cwd) {
636 fprintf(stderr, "Error: --get and --private-cwd options are mutually exclusive\n");
637 exit(1);
638 }
633 639
634 // verify path 640 // verify path
635 if ((i + 2) != argc) { 641 if ((i + 2) != argc) {
@@ -654,6 +660,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
654 else if (strncmp(argv[i], "--put=", 6) == 0) { 660 else if (strncmp(argv[i], "--put=", 6) == 0) {
655 if (checkcfg(CFG_FILE_TRANSFER)) { 661 if (checkcfg(CFG_FILE_TRANSFER)) {
656 logargs(argc, argv); 662 logargs(argc, argv);
663 if (arg_private_cwd) {
664 fprintf(stderr, "Error: --put and --private-cwd options are mutually exclusive\n");
665 exit(1);
666 }
657 667
658 // verify path 668 // verify path
659 if ((i + 3) != argc) { 669 if ((i + 3) != argc) {
@@ -684,6 +694,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
684 else if (strncmp(argv[i], "--ls=", 5) == 0) { 694 else if (strncmp(argv[i], "--ls=", 5) == 0) {
685 if (checkcfg(CFG_FILE_TRANSFER)) { 695 if (checkcfg(CFG_FILE_TRANSFER)) {
686 logargs(argc, argv); 696 logargs(argc, argv);
697 if (arg_private_cwd) {
698 fprintf(stderr, "Error: --ls and --private-cwd options are mutually exclusive\n");
699 exit(1);
700 }
687 701
688 // verify path 702 // verify path
689 if ((i + 2) != argc) { 703 if ((i + 2) != argc) {
@@ -907,7 +921,8 @@ int main(int argc, char **argv) {
907 921
908 // get starting timestamp, process --quiet 922 // get starting timestamp, process --quiet
909 start_timestamp = getticks(); 923 start_timestamp = getticks();
910 if (check_arg(argc, argv, "--quiet", 1)) 924 char *env_quiet = getenv("FIREJAIL_QUIET");
925 if (check_arg(argc, argv, "--quiet", 1) || (env_quiet && strcmp(env_quiet, "yes") == 0))
911 arg_quiet = 1; 926 arg_quiet = 1;
912 927
913 // cleanup at exit 928 // cleanup at exit
@@ -1772,6 +1787,19 @@ int main(int argc, char **argv) {
1772 else 1787 else
1773 exit_err_feature("private-cache"); 1788 exit_err_feature("private-cache");
1774 } 1789 }
1790 else if (strcmp(argv[i], "--private-cwd") == 0) {
1791 cfg.cwd = NULL;
1792 arg_private_cwd = 1;
1793 }
1794 else if (strncmp(argv[i], "--private-cwd=", 14) == 0) {
1795 if (*(argv[i] + 14) == '\0') {
1796 fprintf(stderr, "Error: invalid private-cwd option\n");
1797 exit(1);
1798 }
1799
1800 fs_check_private_cwd(argv[i] + 14);
1801 arg_private_cwd = 1;
1802 }
1775 1803
1776 //************************************* 1804 //*************************************
1777 // hostname, etc 1805 // hostname, etc
@@ -2274,6 +2302,9 @@ int main(int argc, char **argv) {
2274 return 1; 2302 return 1;
2275 } 2303 }
2276 } 2304 }
2305 else if (strcmp(argv[i], "--deterministic-exit-code") == 0) {
2306 arg_deterministic_exit_code = 1;
2307 }
2277 else { 2308 else {
2278 // double dash - positional params to follow 2309 // double dash - positional params to follow
2279 if (strcmp(argv[i], "--") == 0) { 2310 if (strcmp(argv[i], "--") == 0) {
diff --git a/src/firejail/mountinfo.c b/src/firejail/mountinfo.c
index 0717b2044..7369ad247 100644
--- a/src/firejail/mountinfo.c
+++ b/src/firejail/mountinfo.c
@@ -19,7 +19,11 @@
19*/ 19*/
20 20
21#include "firejail.h" 21#include "firejail.h"
22
22#include <fcntl.h> 23#include <fcntl.h>
24#ifndef O_PATH
25# define O_PATH 010000000
26#endif
23 27
24#define MAX_BUF 4096 28#define MAX_BUF 4096
25 29
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index c8619f7e2..99d83c16a 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -338,7 +338,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
338 arg_private = 1; 338 arg_private = 1;
339 return 0; 339 return 0;
340 } 340 }
341 if (strncmp(ptr, "private-home ", 13) == 0) { 341 else if (strncmp(ptr, "private-home ", 13) == 0) {
342#ifdef HAVE_PRIVATE_HOME 342#ifdef HAVE_PRIVATE_HOME
343 if (checkcfg(CFG_PRIVATE_HOME)) { 343 if (checkcfg(CFG_PRIVATE_HOME)) {
344 if (cfg.home_private_keep) { 344 if (cfg.home_private_keep) {
@@ -353,6 +353,16 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
353#endif 353#endif
354 return 0; 354 return 0;
355 } 355 }
356 else if (strcmp(ptr, "private-cwd") == 0) {
357 cfg.cwd = NULL;
358 arg_private_cwd = 1;
359 return 0;
360 }
361 else if (strncmp(ptr, "private-cwd ", 12) == 0) {
362 fs_check_private_cwd(ptr + 12);
363 arg_private_cwd = 1;
364 return 0;
365 }
356 else if (strcmp(ptr, "allusers") == 0) { 366 else if (strcmp(ptr, "allusers") == 0) {
357 arg_allusers = 1; 367 arg_allusers = 1;
358 return 0; 368 return 0;
@@ -1301,6 +1311,11 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1301 return 0; 1311 return 0;
1302 } 1312 }
1303 1313
1314 if (strcmp(ptr, "deterministic-exit-code") == 0) {
1315 arg_deterministic_exit_code = 1;
1316 return 0;
1317 }
1318
1304 // rest of filesystem 1319 // rest of filesystem
1305 if (strncmp(ptr, "blacklist ", 10) == 0) 1320 if (strncmp(ptr, "blacklist ", 10) == 0)
1306 ptr += 10; 1321 ptr += 10;
diff --git a/src/firejail/pulseaudio.c b/src/firejail/pulseaudio.c
index 26beaf35a..e3f237b8e 100644
--- a/src/firejail/pulseaudio.c
+++ b/src/firejail/pulseaudio.c
@@ -24,7 +24,11 @@
24#include <sys/mount.h> 24#include <sys/mount.h>
25#include <dirent.h> 25#include <dirent.h>
26#include <sys/wait.h> 26#include <sys/wait.h>
27
27#include <fcntl.h> 28#include <fcntl.h>
29#ifndef O_PATH
30# define O_PATH 010000000
31#endif
28 32
29// disable pulseaudio socket 33// disable pulseaudio socket
30void pulseaudio_disable(void) { 34void pulseaudio_disable(void) {
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index 101a16d00..2c5c5fc12 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -271,6 +271,7 @@ static int monitor_application(pid_t app_pid) {
271 } 271 }
272 272
273 int status = 0; 273 int status = 0;
274 int app_status = 0;
274 while (monitored_pid) { 275 while (monitored_pid) {
275 usleep(20000); 276 usleep(20000);
276 char *msg; 277 char *msg;
@@ -295,6 +296,8 @@ static int monitor_application(pid_t app_pid) {
295 sleep(1); 296 sleep(1);
296 break; 297 break;
297 } 298 }
299 else if (rv == app_pid)
300 app_status = status;
298 301
299 // handle --timeout 302 // handle --timeout
300 if (options) { 303 if (options) {
@@ -352,8 +355,8 @@ static int monitor_application(pid_t app_pid) {
352 printf("Sandbox monitor: monitoring %d\n", monitored_pid); 355 printf("Sandbox monitor: monitoring %d\n", monitored_pid);
353 } 356 }
354 357
355 // return the latest exit status. 358 // return the appropriate exit status.
356 return status; 359 return arg_deterministic_exit_code ? app_status : status;
357} 360}
358 361
359static void print_time(void) { 362static void print_time(void) {
@@ -923,7 +926,7 @@ int sandbox(void* sandbox_arg) {
923 // Session D-BUS 926 // Session D-BUS
924 //**************************** 927 //****************************
925 if (arg_nodbus) 928 if (arg_nodbus)
926 dbus_session_disable(); 929 dbus_disable();
927 930
928 931
929 //**************************** 932 //****************************
@@ -1016,6 +1019,10 @@ int sandbox(void* sandbox_arg) {
1016 if (cfg.cwd) { 1019 if (cfg.cwd) {
1017 if (chdir(cfg.cwd) == 0) 1020 if (chdir(cfg.cwd) == 0)
1018 cwd = 1; 1021 cwd = 1;
1022 else if (arg_private_cwd) {
1023 fprintf(stderr, "Error: unable to enter private working directory: %s: %s\n", cfg.cwd, strerror(errno));
1024 exit(1);
1025 }
1019 } 1026 }
1020 1027
1021 if (!cwd) { 1028 if (!cwd) {
diff --git a/src/firejail/usage.c b/src/firejail/usage.c
index 7620bba82..fbace7374 100644
--- a/src/firejail/usage.c
+++ b/src/firejail/usage.c
@@ -66,6 +66,7 @@ static char *usage_str =
66#ifdef HAVE_NETWORK 66#ifdef HAVE_NETWORK
67 " --defaultgw=address - configure default gateway.\n" 67 " --defaultgw=address - configure default gateway.\n"
68#endif 68#endif
69 " --deterministic-exit-code - always exit with first child's status code.\n"
69 " --dns=address - set DNS server.\n" 70 " --dns=address - set DNS server.\n"
70 " --dns.print=name|pid - print DNS configuration.\n" 71 " --dns.print=name|pid - print DNS configuration.\n"
71 " --env=name=value - set environment variable.\n" 72 " --env=name=value - set environment variable.\n"
@@ -162,6 +163,8 @@ static char *usage_str =
162 " --private-etc=file,directory - build a new /etc in a temporary\n" 163 " --private-etc=file,directory - build a new /etc in a temporary\n"
163 "\tfilesystem, and copy the files and directories in the list.\n" 164 "\tfilesystem, and copy the files and directories in the list.\n"
164 " --private-tmp - mount a tmpfs on top of /tmp directory.\n" 165 " --private-tmp - mount a tmpfs on top of /tmp directory.\n"
166 " --private-cwd - do not inherit working directory inside jail.\n"
167 " --private-cwd=directory - set working directory inside jail.\n"
165 " --private-opt=file,directory - build a new /opt in a temporary filesystem.\n" 168 " --private-opt=file,directory - build a new /opt in a temporary filesystem.\n"
166 " --private-srv=file,directory - build a new /srv in a temporary filesystem.\n" 169 " --private-srv=file,directory - build a new /srv in a temporary filesystem.\n"
167 " --profile=filename|profile_name - use a custom profile.\n" 170 " --profile=filename|profile_name - use a custom profile.\n"
diff --git a/src/firejail/util.c b/src/firejail/util.c
index 3e2cd13d5..fff0bbf2f 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -29,7 +29,11 @@
29#include <sys/ioctl.h> 29#include <sys/ioctl.h>
30#include <termios.h> 30#include <termios.h>
31#include <sys/wait.h> 31#include <sys/wait.h>
32
32#include <fcntl.h> 33#include <fcntl.h>
34#ifndef O_PATH
35# define O_PATH 010000000
36#endif
33 37
34#define MAX_GROUPS 1024 38#define MAX_GROUPS 1024
35#define MAXBUF 4098 39#define MAXBUF 4098
diff --git a/src/firejail/x11.c b/src/firejail/x11.c
index b0ed10b30..9d821d980 100644
--- a/src/firejail/x11.c
+++ b/src/firejail/x11.c
@@ -31,7 +31,11 @@
31#include <sys/wait.h> 31#include <sys/wait.h>
32#include <errno.h> 32#include <errno.h>
33#include <limits.h> 33#include <limits.h>
34
34#include <fcntl.h> 35#include <fcntl.h>
36#ifndef O_PATH
37# define O_PATH 010000000
38#endif
35 39
36 40
37// Parse the DISPLAY environment variable and return a display number. 41// Parse the DISPLAY environment variable and return a display number.
diff --git a/src/include/rundefs.h b/src/include/rundefs.h
index 67d7cfa4f..67c693dce 100644
--- a/src/include/rundefs.h
+++ b/src/include/rundefs.h
@@ -51,13 +51,13 @@
51#define RUN_DNS_ETC "/run/firejail/mnt/dns-etc" 51#define RUN_DNS_ETC "/run/firejail/mnt/dns-etc"
52 52
53#define RUN_SECCOMP_DIR "/run/firejail/mnt/seccomp" 53#define RUN_SECCOMP_DIR "/run/firejail/mnt/seccomp"
54#define RUN_SECCOMP_LIST "/run/firejail/mnt/seccomp/seccomp.list" // list of seccomp files installed 54#define RUN_SECCOMP_LIST (RUN_SECCOMP_DIR "/seccomp.list") // list of seccomp files installed
55#define RUN_SECCOMP_PROTOCOL "/run/firejail/mnt/seccomp/seccomp.protocol" // protocol filter 55#define RUN_SECCOMP_PROTOCOL (RUN_SECCOMP_DIR "/seccomp.protocol") // protocol filter
56#define RUN_SECCOMP_CFG "/run/firejail/mnt/seccomp/seccomp" // configured filter 56#define RUN_SECCOMP_CFG (RUN_SECCOMP_DIR "/seccomp") // configured filter
57#define RUN_SECCOMP_32 "/run/firejail/mnt/seccomp/seccomp.32" // 32bit arch filter installed on 64bit architectures 57#define RUN_SECCOMP_32 (RUN_SECCOMP_DIR "/seccomp.32") // 32bit arch filter installed on 64bit architectures
58#define RUN_SECCOMP_MDWX "/run/firejail/mnt/seccomp/seccomp.mdwx" // filter for memory-deny-write-execute 58#define RUN_SECCOMP_MDWX (RUN_SECCOMP_DIR "/seccomp.mdwx") // filter for memory-deny-write-execute
59#define RUN_SECCOMP_BLOCK_SECONDARY "/run/firejail/mnt/seccomp/seccomp.block_secondary" // secondary arch blocking filter 59#define RUN_SECCOMP_BLOCK_SECONDARY (RUN_SECCOMP_DIR "/seccomp.block_secondary") // secondary arch blocking filter
60#define RUN_SECCOMP_POSTEXEC "/run/firejail/mnt/seccomp/seccomp.postexec" // filter for post-exec library 60#define RUN_SECCOMP_POSTEXEC (RUN_SECCOMP_DIR "/seccomp.postexec") // filter for post-exec library
61#define PATH_SECCOMP_DEFAULT (LIBDIR "/firejail/seccomp") // default filter built during make 61#define PATH_SECCOMP_DEFAULT (LIBDIR "/firejail/seccomp") // default filter built during make
62#define PATH_SECCOMP_DEFAULT_DEBUG (LIBDIR "/firejail/seccomp.debug") // default filter built during make 62#define PATH_SECCOMP_DEFAULT_DEBUG (LIBDIR "/firejail/seccomp.debug") // default filter built during make
63#define PATH_SECCOMP_32 (LIBDIR "/firejail/seccomp.32") // 32bit arch filter built during make 63#define PATH_SECCOMP_32 (LIBDIR "/firejail/seccomp.32") // 32bit arch filter built during make
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt
index 703fac30f..8c9989970 100644
--- a/src/man/firejail-profile.txt
+++ b/src/man/firejail-profile.txt
@@ -288,6 +288,12 @@ All modifications are discarded when the sandbox is closed.
288\fBprivate-tmp 288\fBprivate-tmp
289Mount an empty temporary filesystem on top of /tmp directory whitelisting /tmp/.X11-unix. 289Mount an empty temporary filesystem on top of /tmp directory whitelisting /tmp/.X11-unix.
290.TP 290.TP
291\fBprivate-cwd
292Set working directory inside jail to the home directory, and failing that, the root directory.
293.TP
294\fBprivate-cwd directory
295Set working directory inside the jail.
296.TP
291\fBread-only file_or_directory 297\fBread-only file_or_directory
292Make directory or file read-only. 298Make directory or file read-only.
293.TP 299.TP
@@ -661,6 +667,10 @@ instead of the default one.
661Join the sandbox identified by name or start a new one. 667Join the sandbox identified by name or start a new one.
662Same as "firejail --join=sandboxname" command if sandbox with specified name exists, otherwise same as "name sandboxname". 668Same as "firejail --join=sandboxname" command if sandbox with specified name exists, otherwise same as "name sandboxname".
663 669
670.TP
671\fBdeterministic-exit-code
672Always exit firejail with the first child's exit status. The default behavior is to use the exit status of the final child to exit, which can be nondeterministic.
673
664.SH FILES 674.SH FILES
665/etc/firejail/filename.profile, $HOME/.config/firejail/filename.profile 675/etc/firejail/filename.profile, $HOME/.config/firejail/filename.profile
666 676
diff --git a/src/man/firejail.txt b/src/man/firejail.txt
index 1b56dedcd..67b84de0e 100644
--- a/src/man/firejail.txt
+++ b/src/man/firejail.txt
@@ -410,6 +410,10 @@ Example:
410$ firejail \-\-disable-mnt firefox 410$ firejail \-\-disable-mnt firefox
411 411
412.TP 412.TP
413\fB\-\-deterministic-exit-code
414Always exit firejail with the first child's exit status. The default behavior is to use the exit status of the final child to exit, which can be nondeterministic.
415
416.TP
413\fB\-\-dns=address 417\fB\-\-dns=address
414Set a DNS server for the sandbox. Up to three DNS servers can be defined. 418Set a DNS server for the sandbox. Up to three DNS servers can be defined.
415Use this option if you don't trust the DNS setup on your network. 419Use this option if you don't trust the DNS setup on your network.
@@ -1107,9 +1111,11 @@ $ nc dict.org 2628
1107.br 1111.br
1108.TP 1112.TP
1109\fB\-\-nodbus 1113\fB\-\-nodbus
1110Disable D-Bus access. Only the regular UNIX socket is handled by this command. To 1114Disable D-Bus access (both system and session buses). Only the regular
1111disable the abstract socket you would need to request a new network namespace using 1115UNIX sockets are handled by this command. To disable the abstract
1112\-\-net command. Another option is to remove unix from \-\-protocol set. 1116sockets you would need to request a new network namespace using
1117\-\-net command. Another option is to remove unix from \-\-protocol
1118set.
1113.br 1119.br
1114 1120
1115.br 1121.br
@@ -1566,6 +1572,48 @@ drwx------ 2 nobody nogroup 4096 Apr 30 10:52 pulse-PKdhtXMmr18n
1566drwxrwxrwt 2 nobody nogroup 4096 Apr 30 10:52 .X11-unix 1572drwxrwxrwt 2 nobody nogroup 4096 Apr 30 10:52 .X11-unix
1567.br 1573.br
1568 1574
1575.TP
1576\fB\-\-private-cwd
1577Set working directory inside jail to the home directory, and failing that, the root directory.
1578.br
1579Does not impact working directory of profile include paths.
1580.br
1581
1582.br
1583Example:
1584.br
1585$ pwd
1586.br
1587/tmp
1588.br
1589$ firejail \-\-private-cwd
1590.br
1591$ pwd
1592.br
1593/home/user
1594.br
1595
1596.TP
1597\fB\-\-private-cwd=directory
1598Set working directory inside the jail.
1599.br
1600Does not impact working directory of profile include paths.
1601.br
1602
1603.br
1604Example:
1605.br
1606$ pwd
1607.br
1608/tmp
1609.br
1610$ firejail \-\-private-cwd=/opt
1611.br
1612$ pwd
1613.br
1614/opt
1615.br
1616
1569 1617
1570.TP 1618.TP
1571\fB\-\-profile=filename_or_profilename 1619\fB\-\-profile=filename_or_profilename
@@ -1631,6 +1679,10 @@ Put a file in sandbox container, see \fBFILE TRANSFER\fR section for more detail
1631.TP 1679.TP
1632\fB\-\-quiet 1680\fB\-\-quiet
1633Turn off Firejail's output. 1681Turn off Firejail's output.
1682.br
1683
1684.br
1685The same effect can be obtained by setting an environment variable FIREJAIL_QUIET to yes.
1634.TP 1686.TP
1635\fB\-\-read-only=dirname_or_filename 1687\fB\-\-read-only=dirname_or_filename
1636Set directory or file read-only. File globbing is supported, see \fBFILE GLOBBING\fR section for more details. 1688Set directory or file read-only. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
diff --git a/test/environment/deterministic-exit-code.exp b/test/environment/deterministic-exit-code.exp
new file mode 100755
index 000000000..165b9ebe0
--- /dev/null
+++ b/test/environment/deterministic-exit-code.exp
@@ -0,0 +1,55 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2019 Firejail Authors
4# License GPL v2
5
6set timeout 4
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "({ nohup bash -c \"sleep 0.2; exit 53\" &> /dev/null & } &)\r"
18send -- "exit 35\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "Parent is shutting down"
22}
23after 300
24
25send -- "echo $?\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "53"
29}
30after 100
31
32send -- "firejail --deterministic-exit-code\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "Child process initialized"
36}
37sleep 1
38
39send -- "({ nohup bash -c \"sleep 0.2; exit 53\" &> /dev/null & } &)\r"
40send -- "exit 35\r"
41expect {
42 timeout {puts "TESTING ERROR 4\n";exit}
43 "Parent is shutting down"
44}
45after 300
46
47send -- "echo $?\r"
48expect {
49 timeout {puts "TESTING ERROR 5\n";exit}
50 "35"
51}
52after 100
53
54
55puts "\nall done\n"
diff --git a/test/environment/environment.sh b/test/environment/environment.sh
index 85d6c0873..5b4aa32f4 100755
--- a/test/environment/environment.sh
+++ b/test/environment/environment.sh
@@ -116,3 +116,6 @@ echo "TESTING: rlimit errors (test/environment/rlimit-bad.exp)"
116 116
117echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)" 117echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)"
118./rlimit-bad-profile.exp 118./rlimit-bad-profile.exp
119
120echo "TESTING: deterministic exit code (test/environment/deterministic-exit-code.exp"
121./deterministic-exit-code.exp
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index 0fc216b20..7e1d46f0a 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -69,6 +69,9 @@ echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)"
69echo "TESTING: private-bin (test/fs/private-bin.exp)" 69echo "TESTING: private-bin (test/fs/private-bin.exp)"
70./private-bin.exp 70./private-bin.exp
71 71
72echo "TESTING: private-cwd (test/fs/private-cwd.exp)"
73./private-cwd.exp
74
72echo "TESTING: macros (test/fs/macro.exp)" 75echo "TESTING: macros (test/fs/macro.exp)"
73./macro.exp 76./macro.exp
74 77
diff --git a/test/fs/private-cwd.exp b/test/fs/private-cwd.exp
new file mode 100755
index 000000000..0fa87a92f
--- /dev/null
+++ b/test/fs/private-cwd.exp
@@ -0,0 +1,52 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2019 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "cd /tmp\r"
11after 100
12
13# testing profile and private
14send -- "firejail --private-cwd\r"
15expect {
16 timeout {puts "TESTING ERROR 0\n";exit}
17 "Child process initialized"
18}
19sleep 1
20
21send -- "pwd\r"
22expect {
23 timeout {puts "TESTING ERROR 1\n";exit}
24 "$env(HOME)"
25}
26after 100
27
28send -- "exit\r"
29sleep 1
30
31send -- "cd /\r"
32after 100
33
34# testing profile and private
35send -- "firejail --private-cwd=/tmp\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "Child process initialized"
39}
40sleep 1
41
42send -- "pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 4\n";exit}
45 "/tmp"
46}
47after 100
48
49send -- "exit\r"
50sleep 1
51
52puts "all done\n"
diff --git a/test/private-lib/private-lib.sh b/test/private-lib/private-lib.sh
index 5e9d75379..79913fed6 100755
--- a/test/private-lib/private-lib.sh
+++ b/test/private-lib/private-lib.sh
@@ -5,7 +5,7 @@
5 5
6export MALLOC_CHECK_=3g 6export MALLOC_CHECK_=3g
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8LIST="gnome-logs gnome-system-log gnome-nettool pavucontrol dig whois evince galculator gnome-calculator gedit leafpad mousepad pluma transmission-gtk xcalc atril gpicview eom eog" 8LIST="gnome-logs gnome-system-log gnome-nettool pavucontrol dig evince whois galculator gnome-calculator gedit leafpad mousepad pluma transmission-gtk xcalc atril gpicview eom eog"
9 9
10 10
11for app in $LIST; do 11for app in $LIST; do