aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.git-blame-ignore-revs4
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md77
-rw-r--r--.github/ISSUE_TEMPLATE/config.yml5
-rw-r--r--.github/ISSUE_TEMPLATE/feature_request.md23
-rw-r--r--.github/pull_request_template.md18
-rw-r--r--.github/workflows/build-extra.yml55
-rw-r--r--.github/workflows/build.yml35
-rw-r--r--.github/workflows/codeql-analysis.yml75
-rw-r--r--.github/workflows/sort.yml22
-rw-r--r--.gitignore23
-rw-r--r--.gitlab-ci.yml78
-rw-r--r--.travis.yml11
-rw-r--r--CONTRIBUTING.md46
-rw-r--r--COPYING85
-rw-r--r--Makefile.in303
-rw-r--r--README548
-rw-r--r--README.md254
-rw-r--r--RELNOTES376
-rw-r--r--SECURITY.md26
-rwxr-xr-xconfigure1372
-rw-r--r--configure.ac313
-rwxr-xr-xcontrib/firejail-welcome.sh128
-rwxr-xr-xcontrib/fix_private-bin.py294
-rwxr-xr-xcontrib/fj-mkdeb.py111
-rwxr-xr-xcontrib/fjclip.py11
-rwxr-xr-xcontrib/fjdisplay.py22
-rwxr-xr-xcontrib/fjresize.py21
-rwxr-xr-xcontrib/gdb-firejail.sh24
-rwxr-xr-xcontrib/jail_prober.py206
-rwxr-xr-xcontrib/sort.py108
-rwxr-xr-xcontrib/syscalls.sh29
-rwxr-xr-xcontrib/update_deb.sh20
-rw-r--r--contrib/vim/ftdetect/firejail.vim6
-rw-r--r--contrib/vim/syntax/firejail.vim100
-rw-r--r--etc-fixes/0.9.38/firefox.profile32
-rw-r--r--etc-fixes/0.9.52/atom.profile (renamed from etc/atom.profile)14
-rw-r--r--etc-fixes/0.9.52/firefox.profile99
-rw-r--r--etc-fixes/0.9.52/gedit.profile (renamed from etc/gedit.profile)4
-rw-r--r--etc-fixes/0.9.52/libreoffice.profile (renamed from etc/libreoffice.profile)10
-rw-r--r--etc-fixes/0.9.56/brave-browser.profile6
-rw-r--r--etc-fixes/0.9.56/brave.profile24
-rw-r--r--etc-fixes/0.9.58/atom.profile36
-rw-r--r--etc-fixes/0.9.60/atom.profile37
-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/0ad.profile43
-rw-r--r--etc/2048-qt.profile36
-rw-r--r--etc/7z.profile23
-rw-r--r--etc/Cyberfox.profile6
-rw-r--r--etc/FossaMail.profile6
-rw-r--r--etc/Gitter.profile6
-rw-r--r--etc/Mathematica.profile28
-rw-r--r--etc/Natron.profile6
-rw-r--r--etc/Telegram.profile6
-rw-r--r--etc/Thunar.profile30
-rw-r--r--etc/Viber.profile38
-rw-r--r--etc/VirtualBox.profile6
-rw-r--r--etc/Wire.profile6
-rw-r--r--etc/abrowser.profile48
-rw-r--r--etc/akregator.profile43
-rw-r--r--etc/amarok.profile30
-rw-r--r--etc/apktool.profile32
-rw-r--r--etc/apparmor/firejail-default141
-rw-r--r--etc/apparmor/firejail-local15
-rw-r--r--etc/arch-audit.profile40
-rw-r--r--etc/ardour4.profile6
-rw-r--r--etc/ardour5.profile37
-rw-r--r--etc/arduino.profile34
-rw-r--r--etc/ark.profile36
-rw-r--r--etc/arm.profile42
-rw-r--r--etc/atom-beta.profile29
-rw-r--r--etc/atool.profile33
-rw-r--r--etc/atril.profile40
-rw-r--r--etc/audacious.profile36
-rw-r--r--etc/audacity.profile37
-rw-r--r--etc/aweather.profile35
-rw-r--r--etc/baloo_file.profile48
-rw-r--r--etc/baobab.profile34
-rw-r--r--etc/bibletime.profile42
-rw-r--r--etc/bleachbit.profile35
-rw-r--r--etc/blender.profile30
-rw-r--r--etc/bless.profile35
-rw-r--r--etc/bluefish.profile34
-rw-r--r--etc/brackets.profile29
-rw-r--r--etc/brasero.profile34
-rw-r--r--etc/brave.profile38
-rw-r--r--etc/caja.profile37
-rw-r--r--etc/calibre.profile38
-rw-r--r--etc/calligra.profile30
-rw-r--r--etc/calligraauthor.profile6
-rw-r--r--etc/calligraconverter.profile6
-rw-r--r--etc/calligraflow.profile6
-rw-r--r--etc/calligraplan.profile6
-rw-r--r--etc/calligraplanwork.profile6
-rw-r--r--etc/calligrasheets.profile6
-rw-r--r--etc/calligrastage.profile6
-rw-r--r--etc/calligrawords.profile6
-rw-r--r--etc/cherrytree.profile36
-rw-r--r--etc/chromium-browser.profile5
-rw-r--r--etc/chromium.profile40
-rw-r--r--etc/cin.profile31
-rw-r--r--etc/cinelerra.profile6
-rw-r--r--etc/clamdscan.profile7
-rw-r--r--etc/clamdtop.profile7
-rw-r--r--etc/clamscan.profile7
-rw-r--r--etc/claws-mail.profile31
-rw-r--r--etc/clementine.profile22
-rw-r--r--etc/clipit.profile35
-rw-r--r--etc/cliqz.profile83
-rw-r--r--etc/cmus.profile26
-rw-r--r--etc/conkeror.profile33
-rw-r--r--etc/conky.profile35
-rw-r--r--etc/corebird.profile34
-rw-r--r--etc/cpio.profile30
-rw-r--r--etc/cryptocat.profile6
-rw-r--r--etc/curl.profile37
-rw-r--r--etc/cyberfox.profile72
-rw-r--r--etc/darktable.profile34
-rw-r--r--etc/default.profile41
-rw-r--r--etc/deluge.profile35
-rw-r--r--etc/dex2jar.profile33
-rw-r--r--etc/dia.profile35
-rw-r--r--etc/digikam.profile37
-rw-r--r--etc/dillo.profile30
-rw-r--r--etc/dino.profile41
-rw-r--r--etc/disable-common.inc316
-rw-r--r--etc/disable-devel.inc81
-rw-r--r--etc/disable-passwdmgr.inc15
-rw-r--r--etc/disable-programs.inc456
-rw-r--r--etc/display.profile32
-rw-r--r--etc/dnscrypt-proxy.profile33
-rw-r--r--etc/dnsmasq.profile31
-rw-r--r--etc/dolphin.profile35
-rw-r--r--etc/dooble-qt4.profile6
-rw-r--r--etc/dosbox.profile32
-rw-r--r--etc/dragon.profile35
-rw-r--r--etc/dropbox.profile43
-rw-r--r--etc/ebook-viewer.profile8
-rw-r--r--etc/electron.profile22
-rw-r--r--etc/elinks.profile35
-rw-r--r--etc/emacs.profile23
-rw-r--r--etc/enchant.profile32
-rw-r--r--etc/engrampa.profile38
-rw-r--r--etc/eog.profile41
-rw-r--r--etc/eom.profile42
-rw-r--r--etc/etr.profile32
-rw-r--r--etc/evince.profile41
-rw-r--r--etc/evolution.profile41
-rw-r--r--etc/exiftool.profile38
-rw-r--r--etc/fbreader.profile29
-rw-r--r--etc/feh.profile31
-rw-r--r--etc/fetchmail.profile29
-rw-r--r--etc/ffmpeg.profile35
-rw-r--r--etc/file-roller.profile38
-rw-r--r--etc/file.profile37
-rw-r--r--etc/filezilla.profile29
-rw-r--r--etc/firefox.profile83
-rw-r--r--etc/firejail-default161
-rw-r--r--etc/firejail-local1
-rw-r--r--etc/firejail.config103
-rw-r--r--etc/flashpeak-slimjet.profile37
-rw-r--r--etc/fontforge.profile32
-rw-r--r--etc/fossamail.profile22
-rw-r--r--etc/franz.profile41
-rw-r--r--etc/freecad.profile35
-rw-r--r--etc/freecadcmd.profile6
-rw-r--r--etc/frozen-bubble.profile32
-rw-r--r--etc/gajim.profile46
-rw-r--r--etc/galculator.profile37
-rw-r--r--etc/geary.profile26
-rw-r--r--etc/geeqie.profile31
-rw-r--r--etc/ghb.profile6
-rw-r--r--etc/gimp-2.8.profile6
-rw-r--r--etc/gimp.profile34
-rw-r--r--etc/git.profile37
-rw-r--r--etc/gitg.profile37
-rw-r--r--etc/gitter.profile42
-rw-r--r--etc/gjs.profile35
-rw-r--r--etc/gnome-2048.profile36
-rw-r--r--etc/gnome-books.profile40
-rw-r--r--etc/gnome-calculator.profile37
-rw-r--r--etc/gnome-chess.profile38
-rw-r--r--etc/gnome-clocks.profile37
-rw-r--r--etc/gnome-contacts.profile34
-rw-r--r--etc/gnome-documents.profile36
-rw-r--r--etc/gnome-font-viewer.profile33
-rw-r--r--etc/gnome-maps.profile40
-rw-r--r--etc/gnome-mplayer.profile27
-rw-r--r--etc/gnome-music.profile36
-rw-r--r--etc/gnome-photos.profile38
-rw-r--r--etc/gnome-ring.profile34
-rw-r--r--etc/gnome-weather.profile41
-rw-r--r--etc/goobox.profile30
-rw-r--r--etc/google-chrome-beta.profile36
-rw-r--r--etc/google-chrome-stable.profile6
-rw-r--r--etc/google-chrome-unstable.profile36
-rw-r--r--etc/google-chrome.profile37
-rw-r--r--etc/google-earth.profile48
-rw-r--r--etc/google-play-music-desktop-player.profile38
-rw-r--r--etc/gpg-agent.profile33
-rw-r--r--etc/gpg.profile33
-rw-r--r--etc/gpicview.profile34
-rw-r--r--etc/gpredict.profile37
-rw-r--r--etc/gtar.profile6
-rw-r--r--etc/gucharmap.profile34
-rw-r--r--etc/gwenview.profile42
-rw-r--r--etc/gzip.profile23
-rw-r--r--etc/handbrake-gtk.profile6
-rw-r--r--etc/handbrake.profile31
-rw-r--r--etc/hashcat.profile36
-rw-r--r--etc/hedgewars.profile31
-rw-r--r--etc/hexchat.profile45
-rw-r--r--etc/highlight.profile33
-rw-r--r--etc/hugin.profile33
-rw-r--r--etc/icecat.profile51
-rw-r--r--etc/icedove.profile27
-rw-r--r--etc/iceweasel.profile10
-rw-r--r--etc/ids.config142
-rw-r--r--etc/imagej.profile35
-rw-r--r--etc/img2txt.profile31
-rw-r--r--etc/inc/allow-bin-sh.inc7
-rw-r--r--etc/inc/allow-common-devel.inc31
-rw-r--r--etc/inc/allow-gjs.inc12
-rw-r--r--etc/inc/allow-java.inc9
-rw-r--r--etc/inc/allow-lua.inc12
-rw-r--r--etc/inc/allow-nodejs.inc10
-rw-r--r--etc/inc/allow-opengl-game.inc7
-rw-r--r--etc/inc/allow-perl.inc12
-rw-r--r--etc/inc/allow-php.inc7
-rw-r--r--etc/inc/allow-python2.inc9
-rw-r--r--etc/inc/allow-python3.inc10
-rw-r--r--etc/inc/allow-ruby.inc6
-rw-r--r--etc/inc/allow-ssh.inc8
-rw-r--r--etc/inc/disable-X11.inc15
-rw-r--r--etc/inc/disable-common.inc589
-rw-r--r--etc/inc/disable-devel.inc69
-rw-r--r--etc/inc/disable-exec.inc12
-rw-r--r--etc/inc/disable-interpreters.inc68
-rw-r--r--etc/inc/disable-programs.inc1129
-rw-r--r--etc/inc/disable-shell.inc15
-rw-r--r--etc/inc/disable-write-mnt.inc8
-rw-r--r--etc/inc/disable-xdg.inc12
-rw-r--r--etc/inc/whitelist-1793-workaround.inc29
-rw-r--r--etc/inc/whitelist-common.inc85
-rw-r--r--etc/inc/whitelist-player-common.inc11
-rw-r--r--etc/inc/whitelist-run-common.inc11
-rw-r--r--etc/inc/whitelist-runuser-common.inc16
-rw-r--r--etc/inc/whitelist-usr-share-common.inc70
-rw-r--r--etc/inc/whitelist-var-common.inc15
-rw-r--r--etc/inkscape.profile35
-rw-r--r--etc/inox.profile30
-rw-r--r--etc/iridium-browser.profile6
-rw-r--r--etc/iridium.profile27
-rw-r--r--etc/jd-gui.profile35
-rw-r--r--etc/k3b.profile33
-rw-r--r--etc/karbon.profile6
-rw-r--r--etc/kate.profile39
-rw-r--r--etc/kcalc.profile36
-rw-r--r--etc/kdenlive.profile30
-rw-r--r--etc/keepass2.profile6
-rw-r--r--etc/keepassx2.profile5
-rw-r--r--etc/keepassxc.profile41
-rw-r--r--etc/kino.profile31
-rw-r--r--etc/kmail.profile27
-rw-r--r--etc/knotes.profile31
-rw-r--r--etc/kodi.profile29
-rw-r--r--etc/konversation.profile33
-rw-r--r--etc/krita.profile32
-rw-r--r--etc/ktorrent.profile55
-rw-r--r--etc/kwrite.profile39
-rw-r--r--etc/leafpad.profile34
-rw-r--r--etc/less.profile31
-rw-r--r--etc/liferea.profile44
-rw-r--r--etc/linphone.profile41
-rw-r--r--etc/lmms.profile34
-rw-r--r--etc/localc.profile6
-rw-r--r--etc/lodraw.profile6
-rw-r--r--etc/loffice.profile6
-rw-r--r--etc/lofromtemplate.profile6
-rw-r--r--etc/loimpress.profile6
-rw-r--r--etc/lollypop.profile32
-rw-r--r--etc/lomath.profile6
-rw-r--r--etc/loweb.profile6
-rw-r--r--etc/lowriter.profile6
-rw-r--r--etc/lximage-qt.profile33
-rw-r--r--etc/lxmusic.profile33
-rw-r--r--etc/lynx.profile33
-rw-r--r--etc/macrofusion.profile35
-rw-r--r--etc/mate-calc.profile45
-rw-r--r--etc/mate-calculator.profile6
-rw-r--r--etc/mate-color-select.profile41
-rw-r--r--etc/mathematica.profile6
-rw-r--r--etc/mediainfo.profile33
-rw-r--r--etc/mediathekview.profile42
-rw-r--r--etc/meld.profile34
-rw-r--r--etc/midori.profile44
-rw-r--r--etc/minetest.profile39
-rw-r--r--etc/mousepad.profile32
-rw-r--r--etc/mpd.profile33
-rw-r--r--etc/mplayer.profile29
-rw-r--r--etc/mpv.profile29
-rw-r--r--etc/multimc5.profile43
-rw-r--r--etc/mumble.profile41
-rw-r--r--etc/mupdf.profile35
-rw-r--r--etc/musescore.profile38
-rw-r--r--etc/mutt.profile55
-rw-r--r--etc/nautilus.profile38
-rw-r--r--etc/nemo.profile32
-rw-r--r--etc/net/nolocal.net (renamed from etc/nolocal.net)12
-rw-r--r--etc/net/nolocal6.net41
-rw-r--r--etc/net/tcpserver.net27
-rw-r--r--etc/net/webserver.net (renamed from etc/webserver.net)0
-rw-r--r--etc/netsurf.profile30
-rw-r--r--etc/neverball.profile37
-rw-r--r--etc/nylas.profile34
-rw-r--r--etc/obs.profile31
-rw-r--r--etc/odt2txt.profile34
-rw-r--r--etc/okular.profile46
-rw-r--r--etc/open-invaders.profile32
-rw-r--r--etc/openbox.profile16
-rw-r--r--etc/openshot-qt.profile6
-rw-r--r--etc/openshot.profile31
-rw-r--r--etc/opera-beta.profile26
-rw-r--r--etc/opera.profile30
-rw-r--r--etc/palemoon.profile58
-rw-r--r--etc/parole.profile24
-rw-r--r--etc/pcmanfm.profile29
-rw-r--r--etc/pdfsam.profile34
-rw-r--r--etc/pdftotext.profile35
-rw-r--r--etc/peek.profile36
-rw-r--r--etc/picard.profile33
-rw-r--r--etc/pidgin.profile32
-rw-r--r--etc/pingus.profile32
-rw-r--r--etc/pinta.profile34
-rw-r--r--etc/pithos.profile34
-rw-r--r--etc/pluma.profile40
-rw-r--r--etc/profile-a-l/0ad.profile57
-rw-r--r--etc/profile-a-l/2048-qt.profile43
-rw-r--r--etc/profile-a-l/7z.profile14
-rw-r--r--etc/profile-a-l/7za.profile12
-rw-r--r--etc/profile-a-l/7zr.profile12
-rw-r--r--etc/profile-a-l/Books.profile7
-rw-r--r--etc/profile-a-l/Builder.profile11
-rw-r--r--etc/profile-a-l/Cheese.profile11
-rw-r--r--etc/profile-a-l/Cryptocat.profile (renamed from etc/Cryptocat.profile)15
-rw-r--r--etc/profile-a-l/Cyberfox.profile10
-rw-r--r--etc/profile-a-l/Discord.profile17
-rw-r--r--etc/profile-a-l/DiscordCanary.profile17
-rw-r--r--etc/profile-a-l/Documents.profile11
-rw-r--r--etc/profile-a-l/FossaMail.profile10
-rw-r--r--etc/profile-a-l/Fritzing.profile39
-rw-r--r--etc/profile-a-l/Gitter.profile10
-rw-r--r--etc/profile-a-l/JDownloader.profile48
-rw-r--r--etc/profile-a-l/Logs.profile11
-rw-r--r--etc/profile-a-l/abiword.profile49
-rw-r--r--etc/profile-a-l/abrowser.profile20
-rw-r--r--etc/profile-a-l/acat.profile11
-rw-r--r--etc/profile-a-l/adiff.profile11
-rw-r--r--etc/profile-a-l/agetpkg.profile59
-rw-r--r--etc/profile-a-l/akonadi_control.profile55
-rw-r--r--etc/profile-a-l/akregator.profile50
-rw-r--r--etc/profile-a-l/alacarte.profile65
-rw-r--r--etc/profile-a-l/alienarena-wrapper.profile14
-rw-r--r--etc/profile-a-l/alienarena.profile52
-rw-r--r--etc/profile-a-l/alpine.profile103
-rw-r--r--etc/profile-a-l/alpinef.profile14
-rw-r--r--etc/profile-a-l/als.profile11
-rw-r--r--etc/profile-a-l/amarok.profile47
-rw-r--r--etc/profile-a-l/amule.profile (renamed from etc/amule.profile)22
-rw-r--r--etc/profile-a-l/amuled.profile13
-rw-r--r--etc/profile-a-l/android-studio.profile (renamed from etc/android-studio.profile)27
-rw-r--r--etc/profile-a-l/anki.profile57
-rw-r--r--etc/profile-a-l/anydesk.profile36
-rw-r--r--etc/profile-a-l/aosp.profile (renamed from etc/aosp.profile)23
-rw-r--r--etc/profile-a-l/apack.profile11
-rw-r--r--etc/profile-a-l/apktool.profile38
-rw-r--r--etc/profile-a-l/apostrophe.profile72
-rw-r--r--etc/profile-a-l/ar.profile11
-rw-r--r--etc/profile-a-l/arch-audit.profile52
-rw-r--r--etc/profile-a-l/archaudit-report.profile39
-rw-r--r--etc/profile-a-l/archiver-common.profile52
-rw-r--r--etc/profile-a-l/ardour4.profile10
-rw-r--r--etc/profile-a-l/ardour5.profile43
-rw-r--r--etc/profile-a-l/arduino.profile39
-rw-r--r--etc/profile-a-l/arepack.profile11
-rw-r--r--etc/profile-a-l/aria2c.profile55
-rw-r--r--etc/profile-a-l/ark.profile46
-rw-r--r--etc/profile-a-l/arm.profile48
-rw-r--r--etc/profile-a-l/artha.profile66
-rw-r--r--etc/profile-a-l/assogiate.profile54
-rw-r--r--etc/profile-a-l/asunder.profile48
-rw-r--r--etc/profile-a-l/atom-beta.profile10
-rw-r--r--etc/profile-a-l/atom.profile31
-rw-r--r--etc/profile-a-l/atool.profile20
-rw-r--r--etc/profile-a-l/atril-previewer.profile10
-rw-r--r--etc/profile-a-l/atril-thumbnailer.profile10
-rw-r--r--etc/profile-a-l/atril.profile52
-rw-r--r--etc/profile-a-l/audacious.profile44
-rw-r--r--etc/profile-a-l/audacity.profile46
-rw-r--r--etc/profile-a-l/audio-recorder.profile54
-rw-r--r--etc/profile-a-l/aunpack.profile11
-rw-r--r--etc/profile-a-l/authenticator-rs.profile55
-rw-r--r--etc/profile-a-l/authenticator.profile49
-rw-r--r--etc/profile-a-l/autokey-common.profile42
-rw-r--r--etc/profile-a-l/autokey-gtk.profile10
-rw-r--r--etc/profile-a-l/autokey-qt.profile10
-rw-r--r--etc/profile-a-l/autokey-run.profile10
-rw-r--r--etc/profile-a-l/autokey-shell.profile10
-rw-r--r--etc/profile-a-l/avidemux.profile54
-rw-r--r--etc/profile-a-l/aweather.profile40
-rw-r--r--etc/profile-a-l/awesome.profile19
-rw-r--r--etc/profile-a-l/b2sum.profile13
-rw-r--r--etc/profile-a-l/ballbuster-wrapper.profile14
-rw-r--r--etc/profile-a-l/ballbuster.profile52
-rw-r--r--etc/profile-a-l/baloo_file.profile54
-rw-r--r--etc/profile-a-l/baloo_filemetadata_temp_extractor.profile14
-rw-r--r--etc/profile-a-l/balsa.profile82
-rw-r--r--etc/profile-a-l/baobab.profile44
-rw-r--r--etc/profile-a-l/barrier.profile45
-rw-r--r--etc/profile-a-l/basilisk.profile26
-rw-r--r--etc/profile-a-l/bcompare.profile47
-rw-r--r--etc/profile-a-l/beaker.profile28
-rw-r--r--etc/profile-a-l/bibletime.profile59
-rw-r--r--etc/profile-a-l/bibtex.profile12
-rw-r--r--etc/profile-a-l/bijiben.profile63
-rw-r--r--etc/profile-a-l/bitcoin-qt.profile50
-rw-r--r--etc/profile-a-l/bitlbee.profile (renamed from etc/bitlbee.profile)26
-rw-r--r--etc/profile-a-l/bitwarden.profile30
-rw-r--r--etc/profile-a-l/blackbox.profile18
-rw-r--r--etc/profile-a-l/bleachbit.profile42
-rw-r--r--etc/profile-a-l/blender-2.8.profile10
-rw-r--r--etc/profile-a-l/blender.profile40
-rw-r--r--etc/profile-a-l/bless.profile42
-rw-r--r--etc/profile-a-l/blobby.profile51
-rw-r--r--etc/profile-a-l/blobwars.profile50
-rw-r--r--etc/profile-a-l/bluefish.profile40
-rw-r--r--etc/profile-a-l/bnox.profile22
-rw-r--r--etc/profile-a-l/brackets.profile34
-rw-r--r--etc/profile-a-l/brasero.profile36
-rw-r--r--etc/profile-a-l/brave-browser-beta.profile10
-rw-r--r--etc/profile-a-l/brave-browser-dev.profile10
-rw-r--r--etc/profile-a-l/brave-browser-nightly.profile10
-rw-r--r--etc/profile-a-l/brave-browser-stable.profile10
-rw-r--r--etc/profile-a-l/brave-browser.profile10
-rw-r--r--etc/profile-a-l/brave.profile37
-rw-r--r--etc/profile-a-l/bsdcat.profile10
-rw-r--r--etc/profile-a-l/bsdcpio.profile10
-rw-r--r--etc/profile-a-l/bsdtar.profile12
-rw-r--r--etc/profile-a-l/bunzip2.profile12
-rw-r--r--etc/profile-a-l/bzcat.profile15
-rw-r--r--etc/profile-a-l/bzflag.profile47
-rw-r--r--etc/profile-a-l/bzip2.profile12
-rw-r--r--etc/profile-a-l/caja.profile15
-rw-r--r--etc/profile-a-l/calibre.profile38
-rw-r--r--etc/profile-a-l/calligra.profile40
-rw-r--r--etc/profile-a-l/calligraauthor.profile10
-rw-r--r--etc/profile-a-l/calligraconverter.profile10
-rw-r--r--etc/profile-a-l/calligraflow.profile10
-rw-r--r--etc/profile-a-l/calligragemini.profile12
-rw-r--r--etc/profile-a-l/calligraplan.profile12
-rw-r--r--etc/profile-a-l/calligraplanwork.profile12
-rw-r--r--etc/profile-a-l/calligrasheets.profile12
-rw-r--r--etc/profile-a-l/calligrastage.profile12
-rw-r--r--etc/profile-a-l/calligrawords.profile12
-rw-r--r--etc/profile-a-l/cameramonitor.profile55
-rw-r--r--etc/profile-a-l/cantata.profile40
-rw-r--r--etc/profile-a-l/cargo.profile72
-rw-r--r--etc/profile-a-l/catfish.profile (renamed from etc/catfish.profile)29
-rw-r--r--etc/profile-a-l/cawbird.profile46
-rw-r--r--etc/profile-a-l/celluloid.profile67
-rw-r--r--etc/profile-a-l/checkbashisms.profile55
-rw-r--r--etc/profile-a-l/cheese.profile50
-rw-r--r--etc/profile-a-l/cherrytree.profile43
-rw-r--r--etc/profile-a-l/chromium-browser-privacy.profile19
-rw-r--r--etc/profile-a-l/chromium-browser.profile10
-rw-r--r--etc/profile-a-l/chromium-common-hardened.inc.profile9
-rw-r--r--etc/profile-a-l/chromium-common.profile59
-rw-r--r--etc/profile-a-l/chromium-freeworld.profile10
-rw-r--r--etc/profile-a-l/chromium.profile24
-rw-r--r--etc/profile-a-l/cin.profile37
-rw-r--r--etc/profile-a-l/cinelerra.profile10
-rw-r--r--etc/profile-a-l/cksum.profile13
-rw-r--r--etc/profile-a-l/clamav.profile (renamed from etc/clamav.profile)16
-rw-r--r--etc/profile-a-l/clamdscan.profile10
-rw-r--r--etc/profile-a-l/clamdtop.profile10
-rw-r--r--etc/profile-a-l/clamscan.profile10
-rw-r--r--etc/profile-a-l/clamtk.profile30
-rw-r--r--etc/profile-a-l/claws-mail.profile30
-rw-r--r--etc/profile-a-l/clawsker.profile54
-rw-r--r--etc/profile-a-l/clementine.profile40
-rw-r--r--etc/profile-a-l/clion-eap.profile10
-rw-r--r--etc/profile-a-l/clion.profile43
-rw-r--r--etc/profile-a-l/clipgrab.profile47
-rw-r--r--etc/profile-a-l/clipit.profile50
-rw-r--r--etc/profile-a-l/cliqz.profile23
-rw-r--r--etc/profile-a-l/clocks.profile11
-rw-r--r--etc/profile-a-l/cmus.profile30
-rw-r--r--etc/profile-a-l/code-oss.profile10
-rw-r--r--etc/profile-a-l/code.profile40
-rw-r--r--etc/profile-a-l/cola.profile10
-rw-r--r--etc/profile-a-l/colorful-wrapper.profile14
-rw-r--r--etc/profile-a-l/colorful.profile52
-rw-r--r--etc/profile-a-l/com.github.bleakgrey.tootle.profile55
-rw-r--r--etc/profile-a-l/com.github.dahenson.agenda.profile66
-rw-r--r--etc/profile-a-l/com.github.johnfactotum.Foliate.profile63
-rw-r--r--etc/profile-a-l/com.github.phase1geo.minder.profile61
-rw-r--r--etc/profile-a-l/com.gitlab.newsflash.profile10
-rw-r--r--etc/profile-a-l/conkeror.profile36
-rw-r--r--etc/profile-a-l/conky.profile46
-rw-r--r--etc/profile-a-l/conplay.profile16
-rw-r--r--etc/profile-a-l/corebird.profile38
-rw-r--r--etc/profile-a-l/cower.profile49
-rw-r--r--etc/profile-a-l/coyim.profile49
-rw-r--r--etc/profile-a-l/cpio.profile14
-rw-r--r--etc/profile-a-l/crawl-tiles.profile12
-rw-r--r--etc/profile-a-l/crawl.profile47
-rw-r--r--etc/profile-a-l/crow.profile46
-rw-r--r--etc/profile-a-l/cryptocat.profile10
-rw-r--r--etc/profile-a-l/curl.profile57
-rw-r--r--etc/profile-a-l/cvlc.profile (renamed from etc/cvlc.profile)7
-rw-r--r--etc/profile-a-l/cyberfox.profile21
-rw-r--r--etc/profile-a-l/d-feet.profile56
-rw-r--r--etc/profile-a-l/darktable.profile40
-rw-r--r--etc/profile-a-l/dbus-send.profile59
-rw-r--r--etc/profile-a-l/dconf-editor.profile53
-rw-r--r--etc/profile-a-l/dconf.profile53
-rw-r--r--etc/profile-a-l/ddgr.profile13
-rw-r--r--etc/profile-a-l/ddgtk.profile54
-rw-r--r--etc/profile-a-l/deadbeef.profile (renamed from etc/deadbeef.profile)20
-rw-r--r--etc/profile-a-l/default.profile61
-rw-r--r--etc/profile-a-l/deluge.profile46
-rw-r--r--etc/profile-a-l/desktopeditors.profile45
-rw-r--r--etc/profile-a-l/devhelp.profile53
-rw-r--r--etc/profile-a-l/devilspie.profile59
-rw-r--r--etc/profile-a-l/devilspie2.profile24
-rw-r--r--etc/profile-a-l/dex2jar.profile42
-rw-r--r--etc/profile-a-l/dia.profile57
-rw-r--r--etc/profile-a-l/dig.profile59
-rw-r--r--etc/profile-a-l/digikam.profile43
-rw-r--r--etc/profile-a-l/dillo.profile37
-rw-r--r--etc/profile-a-l/dino-im.profile14
-rw-r--r--etc/profile-a-l/dino.profile47
-rw-r--r--etc/profile-a-l/discord-canary.profile17
-rw-r--r--etc/profile-a-l/discord-common.profile32
-rw-r--r--etc/profile-a-l/discord.profile17
-rw-r--r--etc/profile-a-l/display-im6.q16.profile10
-rw-r--r--etc/profile-a-l/display.profile47
-rw-r--r--etc/profile-a-l/dnox.profile22
-rw-r--r--etc/profile-a-l/dnscrypt-proxy.profile54
-rw-r--r--etc/profile-a-l/dnsmasq.profile37
-rw-r--r--etc/profile-a-l/dolphin-emu.profile63
-rw-r--r--etc/profile-a-l/dolphin.profile14
-rw-r--r--etc/profile-a-l/dooble-qt4.profile10
-rw-r--r--etc/profile-a-l/dooble.profile (renamed from etc/dooble.profile)22
-rw-r--r--etc/profile-a-l/dosbox.profile44
-rw-r--r--etc/profile-a-l/dragon.profile41
-rw-r--r--etc/profile-a-l/drawio.profile54
-rw-r--r--etc/profile-a-l/drill.profile55
-rw-r--r--etc/profile-a-l/dropbox.profile49
-rw-r--r--etc/profile-a-l/easystroke.profile56
-rw-r--r--etc/profile-a-l/ebook-convert.profile11
-rw-r--r--etc/profile-a-l/ebook-edit.profile11
-rw-r--r--etc/profile-a-l/ebook-meta.profile11
-rw-r--r--etc/profile-a-l/ebook-polish.profile11
-rw-r--r--etc/profile-a-l/ebook-viewer.profile11
-rw-r--r--etc/profile-a-l/electron-mail.profile56
-rw-r--r--etc/profile-a-l/electron.profile40
-rw-r--r--etc/profile-a-l/electrum.profile54
-rw-r--r--etc/profile-a-l/element-desktop.profile24
-rw-r--r--etc/profile-a-l/elinks.profile18
-rw-r--r--etc/profile-a-l/emacs.profile32
-rw-r--r--etc/profile-a-l/email-common.profile84
-rw-r--r--etc/profile-a-l/empathy.profile (renamed from etc/empathy.profile)15
-rw-r--r--etc/profile-a-l/enchant-2.profile10
-rw-r--r--etc/profile-a-l/enchant-lsmod-2.profile10
-rw-r--r--etc/profile-a-l/enchant-lsmod.profile10
-rw-r--r--etc/profile-a-l/enchant.profile58
-rw-r--r--etc/profile-a-l/engrampa.profile41
-rw-r--r--etc/profile-a-l/enox.profile24
-rw-r--r--etc/profile-a-l/enpass.profile62
-rw-r--r--etc/profile-a-l/eo-common.profile52
-rw-r--r--etc/profile-a-l/eog.profile29
-rw-r--r--etc/profile-a-l/eom.profile22
-rw-r--r--etc/profile-a-l/ephemeral.profile64
-rw-r--r--etc/profile-a-l/epiphany.profile (renamed from etc/epiphany.profile)17
-rw-r--r--etc/profile-a-l/equalx.profile63
-rw-r--r--etc/profile-a-l/et.profile11
-rw-r--r--etc/profile-a-l/etr-wrapper.profile14
-rw-r--r--etc/profile-a-l/etr.profile56
-rw-r--r--etc/profile-a-l/evince-previewer.profile10
-rw-r--r--etc/profile-a-l/evince-thumbnailer.profile10
-rw-r--r--etc/profile-a-l/evince.profile67
-rw-r--r--etc/profile-a-l/evolution.profile46
-rw-r--r--etc/profile-a-l/exfalso.profile15
-rw-r--r--etc/profile-a-l/exiftool.profile57
-rw-r--r--etc/profile-a-l/falkon.profile54
-rw-r--r--etc/profile-a-l/fbreader.profile39
-rw-r--r--etc/profile-a-l/fdns.profile49
-rw-r--r--etc/profile-a-l/feedreader.profile59
-rw-r--r--etc/profile-a-l/feh-network.inc.profile8
-rw-r--r--etc/profile-a-l/feh.profile43
-rw-r--r--etc/profile-a-l/ferdi.profile47
-rw-r--r--etc/profile-a-l/fetchmail.profile34
-rw-r--r--etc/profile-a-l/ffmpeg.profile57
-rw-r--r--etc/profile-a-l/ffmpegthumbnailer.profile18
-rw-r--r--etc/profile-a-l/ffplay.profile20
-rw-r--r--etc/profile-a-l/ffprobe.profile14
-rw-r--r--etc/profile-a-l/file-manager-common.profile52
-rw-r--r--etc/profile-a-l/file-roller.profile49
-rw-r--r--etc/profile-a-l/file.profile47
-rw-r--r--etc/profile-a-l/filezilla.profile44
-rw-r--r--etc/profile-a-l/firedragon.profile26
-rw-r--r--etc/profile-a-l/firefox-beta.profile10
-rw-r--r--etc/profile-a-l/firefox-common-addons.profile93
-rw-r--r--etc/profile-a-l/firefox-common.profile64
-rw-r--r--etc/profile-a-l/firefox-developer-edition.profile11
-rw-r--r--etc/profile-a-l/firefox-esr.profile (renamed from etc/firefox-esr.profile)8
-rw-r--r--etc/profile-a-l/firefox-nightly.profile (renamed from etc/firefox-nightly.profile)8
-rw-r--r--etc/profile-a-l/firefox-wayland.profile10
-rw-r--r--etc/profile-a-l/firefox-x11.profile10
-rw-r--r--etc/profile-a-l/firefox.profile69
-rw-r--r--etc/profile-a-l/five-or-more.profile21
-rw-r--r--etc/profile-a-l/flacsplt.profile6
-rw-r--r--etc/profile-a-l/flameshot.profile68
-rw-r--r--etc/profile-a-l/flashpeak-slimjet.profile22
-rw-r--r--etc/profile-a-l/flowblade.profile (renamed from etc/flowblade.profile)23
-rw-r--r--etc/profile-a-l/fluxbox.profile18
-rw-r--r--etc/profile-a-l/font-manager.profile57
-rw-r--r--etc/profile-a-l/fontforge.profile41
-rw-r--r--etc/profile-a-l/fossamail.profile23
-rw-r--r--etc/profile-a-l/four-in-a-row.profile19
-rw-r--r--etc/profile-a-l/fractal.profile58
-rw-r--r--etc/profile-a-l/franz.profile47
-rw-r--r--etc/profile-a-l/freecad.profile45
-rw-r--r--etc/profile-a-l/freecadcmd.profile10
-rw-r--r--etc/profile-a-l/freeciv-gtk3.profile10
-rw-r--r--etc/profile-a-l/freeciv-mp-gtk3.profile10
-rw-r--r--etc/profile-a-l/freeciv.profile47
-rw-r--r--etc/profile-a-l/freecol.profile58
-rw-r--r--etc/profile-a-l/freemind.profile53
-rw-r--r--etc/profile-a-l/freeoffice-planmaker.profile10
-rw-r--r--etc/profile-a-l/freeoffice-presentations.profile10
-rw-r--r--etc/profile-a-l/freeoffice-textmaker.profile9
-rw-r--r--etc/profile-a-l/freetube.profile22
-rw-r--r--etc/profile-a-l/freshclam.profile (renamed from etc/freshclam.profile)10
-rw-r--r--etc/profile-a-l/frogatto.profile52
-rw-r--r--etc/profile-a-l/frozen-bubble.profile50
-rw-r--r--etc/profile-a-l/funnyboat.profile56
-rw-r--r--etc/profile-a-l/gajim-history-manager.profile10
-rw-r--r--etc/profile-a-l/gajim.profile79
-rw-r--r--etc/profile-a-l/galculator.profile53
-rw-r--r--etc/profile-a-l/gallery-dl.profile18
-rw-r--r--etc/profile-a-l/gapplication.profile73
-rw-r--r--etc/profile-a-l/gcalccmd.profile13
-rw-r--r--etc/profile-a-l/gcloud.profile43
-rw-r--r--etc/profile-a-l/gconf-editor.profile17
-rw-r--r--etc/profile-a-l/gconf-merge-schema.profile11
-rw-r--r--etc/profile-a-l/gconf-merge-tree.profile11
-rw-r--r--etc/profile-a-l/gconf.profile61
-rw-r--r--etc/profile-a-l/gconfpkg.profile11
-rw-r--r--etc/profile-a-l/gconftool-2.profile11
-rw-r--r--etc/profile-a-l/geany.profile (renamed from etc/geany.profile)16
-rw-r--r--etc/profile-a-l/geary.profile86
-rw-r--r--etc/profile-a-l/gedit.profile52
-rw-r--r--etc/profile-a-l/geekbench.profile54
-rw-r--r--etc/profile-a-l/geeqie.profile33
-rw-r--r--etc/profile-a-l/gfeeds.profile70
-rw-r--r--etc/profile-a-l/gget.profile59
-rw-r--r--etc/profile-a-l/ghb.profile10
-rw-r--r--etc/profile-a-l/ghostwriter.profile59
-rw-r--r--etc/profile-a-l/gimp-2.10.profile10
-rw-r--r--etc/profile-a-l/gimp-2.8.profile10
-rw-r--r--etc/profile-a-l/gimp.profile65
-rw-r--r--etc/profile-a-l/gist-paste.profile12
-rw-r--r--etc/profile-a-l/gist.profile61
-rw-r--r--etc/profile-a-l/git-cola.profile87
-rw-r--r--etc/profile-a-l/git.profile61
-rw-r--r--etc/profile-a-l/gitg.profile64
-rw-r--r--etc/profile-a-l/github-desktop.profile40
-rw-r--r--etc/profile-a-l/gitter.profile44
-rw-r--r--etc/profile-a-l/gjs.profile45
-rw-r--r--etc/profile-a-l/gl-117-wrapper.profile14
-rw-r--r--etc/profile-a-l/gl-117.profile52
-rw-r--r--etc/profile-a-l/glaxium-wrapper.profile14
-rw-r--r--etc/profile-a-l/glaxium.profile52
-rw-r--r--etc/profile-a-l/globaltime.profile (renamed from etc/globaltime.profile)19
-rw-r--r--etc/profile-a-l/gmpc.profile54
-rw-r--r--etc/profile-a-l/gnome-2048.profile19
-rw-r--r--etc/profile-a-l/gnome-books.profile46
-rw-r--r--etc/profile-a-l/gnome-builder.profile40
-rw-r--r--etc/profile-a-l/gnome-calculator.profile55
-rw-r--r--etc/profile-a-l/gnome-calendar.profile63
-rw-r--r--etc/profile-a-l/gnome-character-map.profile10
-rw-r--r--etc/profile-a-l/gnome-characters.profile59
-rw-r--r--etc/profile-a-l/gnome-chess.profile54
-rw-r--r--etc/profile-a-l/gnome-clocks.profile47
-rw-r--r--etc/profile-a-l/gnome-contacts.profile40
-rw-r--r--etc/profile-a-l/gnome-documents.profile44
-rw-r--r--etc/profile-a-l/gnome-font-viewer.profile37
-rw-r--r--etc/profile-a-l/gnome-hexgl.profile52
-rw-r--r--etc/profile-a-l/gnome-keyring-3.profile11
-rw-r--r--etc/profile-a-l/gnome-keyring.profile62
-rw-r--r--etc/profile-a-l/gnome-klotski.profile19
-rw-r--r--etc/profile-a-l/gnome-latex.profile53
-rw-r--r--etc/profile-a-l/gnome-logs.profile54
-rw-r--r--etc/profile-a-l/gnome-mahjongg.profile16
-rw-r--r--etc/profile-a-l/gnome-maps.profile76
-rw-r--r--etc/profile-a-l/gnome-mines.profile20
-rw-r--r--etc/profile-a-l/gnome-mplayer.profile34
-rw-r--r--etc/profile-a-l/gnome-mpv.profile10
-rw-r--r--etc/profile-a-l/gnome-music.profile47
-rw-r--r--etc/profile-a-l/gnome-nettool.profile48
-rw-r--r--etc/profile-a-l/gnome-nibbles.profile23
-rw-r--r--etc/profile-a-l/gnome-passwordsafe.profile62
-rw-r--r--etc/profile-a-l/gnome-photos.profile43
-rw-r--r--etc/profile-a-l/gnome-pie.profile41
-rw-r--r--etc/profile-a-l/gnome-pomodoro.profile59
-rw-r--r--etc/profile-a-l/gnome-recipes.profile53
-rw-r--r--etc/profile-a-l/gnome-ring.profile33
-rw-r--r--etc/profile-a-l/gnome-robots.profile19
-rw-r--r--etc/profile-a-l/gnome-schedule.profile65
-rw-r--r--etc/profile-a-l/gnome-screenshot.profile51
-rw-r--r--etc/profile-a-l/gnome-sound-recorder.profile44
-rw-r--r--etc/profile-a-l/gnome-sudoku.profile19
-rw-r--r--etc/profile-a-l/gnome-system-log.profile56
-rw-r--r--etc/profile-a-l/gnome-taquin.profile19
-rw-r--r--etc/profile-a-l/gnome-tetravex.profile14
-rw-r--r--etc/profile-a-l/gnome-todo.profile64
-rw-r--r--etc/profile-a-l/gnome-twitch.profile (renamed from etc/gnome-twitch.profile)21
-rw-r--r--etc/profile-a-l/gnome-weather.profile49
-rw-r--r--etc/profile-a-l/gnome_games-common.profile49
-rw-r--r--etc/profile-a-l/gnote.profile60
-rw-r--r--etc/profile-a-l/gnubik.profile50
-rw-r--r--etc/profile-a-l/godot.profile45
-rw-r--r--etc/profile-a-l/goobox.profile35
-rw-r--r--etc/profile-a-l/google-chrome-beta.profile28
-rw-r--r--etc/profile-a-l/google-chrome-stable.profile10
-rw-r--r--etc/profile-a-l/google-chrome-unstable.profile28
-rw-r--r--etc/profile-a-l/google-chrome.profile28
-rw-r--r--etc/profile-a-l/google-earth-pro.profile29
-rw-r--r--etc/profile-a-l/google-earth.profile42
-rw-r--r--etc/profile-a-l/google-play-music-desktop-player.profile42
-rw-r--r--etc/profile-a-l/googler-common.profile61
-rw-r--r--etc/profile-a-l/googler.profile13
-rw-r--r--etc/profile-a-l/gpa.profile (renamed from etc/gpa.profile)17
-rw-r--r--etc/profile-a-l/gpg-agent.profile52
-rw-r--r--etc/profile-a-l/gpg.profile54
-rw-r--r--etc/profile-a-l/gpg2.profile13
-rw-r--r--etc/profile-a-l/gpicview.profile51
-rw-r--r--etc/profile-a-l/gpredict.profile41
-rw-r--r--etc/profile-a-l/gradio.profile55
-rw-r--r--etc/profile-a-l/gramps.profile51
-rw-r--r--etc/profile-a-l/gravity-beams-and-evaporating-stars.profile47
-rw-r--r--etc/profile-a-l/gsettings-data-convert.profile11
-rw-r--r--etc/profile-a-l/gsettings-schema-convert.profile11
-rw-r--r--etc/profile-a-l/gsettings.profile11
-rw-r--r--etc/profile-a-l/gtar.profile10
-rw-r--r--etc/profile-a-l/gthumb.profile (renamed from etc/gthumb.profile)21
-rw-r--r--etc/profile-a-l/gtk-pipe-viewer.profile12
-rw-r--r--etc/profile-a-l/gtk-straw-viewer.profile12
-rw-r--r--etc/profile-a-l/gtk-update-icon-cache.profile56
-rw-r--r--etc/profile-a-l/gtk-youtube-viewer.profile12
-rw-r--r--etc/profile-a-l/gtk2-youtube-viewer.profile17
-rw-r--r--etc/profile-a-l/gtk3-youtube-viewer.profile17
-rw-r--r--etc/profile-a-l/guayadeque.profile (renamed from etc/guayadeque.profile)20
-rw-r--r--etc/profile-a-l/gucharmap.profile54
-rw-r--r--etc/profile-a-l/gummi.profile23
-rw-r--r--etc/profile-a-l/gunzip.profile13
-rw-r--r--etc/profile-a-l/guvcview.profile55
-rw-r--r--etc/profile-a-l/gwenview.profile54
-rw-r--r--etc/profile-a-l/gzexe.profile11
-rw-r--r--etc/profile-a-l/gzip.profile15
-rw-r--r--etc/profile-a-l/handbrake-gtk.profile10
-rw-r--r--etc/profile-a-l/handbrake.profile39
-rw-r--r--etc/profile-a-l/hashcat.profile46
-rw-r--r--etc/profile-a-l/hasher-common.profile59
-rw-r--r--etc/profile-a-l/hedgewars.profile37
-rw-r--r--etc/profile-a-l/hexchat.profile58
-rw-r--r--etc/profile-a-l/highlight.profile41
-rw-r--r--etc/profile-a-l/hitori.profile14
-rw-r--r--etc/profile-a-l/homebank.profile59
-rw-r--r--etc/profile-a-l/host.profile52
-rw-r--r--etc/profile-a-l/hugin.profile42
-rw-r--r--etc/profile-a-l/hyperrogue.profile51
-rw-r--r--etc/profile-a-l/i2prouter.profile72
-rw-r--r--etc/profile-a-l/i3.profile18
-rw-r--r--etc/profile-a-l/iagno.profile40
-rw-r--r--etc/profile-a-l/icecat.profile20
-rw-r--r--etc/profile-a-l/icedove.profile28
-rw-r--r--etc/profile-a-l/iceweasel.profile13
-rw-r--r--etc/profile-a-l/idea.profile10
-rw-r--r--etc/profile-a-l/idea.sh.profile (renamed from etc/idea.sh.profile)22
-rw-r--r--etc/profile-a-l/ideaIC.profile10
-rw-r--r--etc/profile-a-l/imagej.profile41
-rw-r--r--etc/profile-a-l/img2txt.profile52
-rw-r--r--etc/profile-a-l/impressive.profile57
-rw-r--r--etc/profile-a-l/inkscape.profile61
-rw-r--r--etc/profile-a-l/inkview.profile11
-rw-r--r--etc/profile-a-l/inox.profile22
-rw-r--r--etc/profile-a-l/io.github.lainsce.Notejot.profile60
-rw-r--r--etc/profile-a-l/ipcalc-ng.profile11
-rw-r--r--etc/profile-a-l/ipcalc.profile62
-rw-r--r--etc/profile-a-l/iridium-browser.profile10
-rw-r--r--etc/profile-a-l/iridium.profile22
-rw-r--r--etc/profile-a-l/itch.profile (renamed from etc/itch.profile)19
-rw-r--r--etc/profile-a-l/jami-gnome.profile42
-rw-r--r--etc/profile-a-l/jd-gui.profile44
-rw-r--r--etc/profile-a-l/jdownloader.profile10
-rw-r--r--etc/profile-a-l/jerry.profile43
-rw-r--r--etc/profile-a-l/jitsi-meet-desktop.profile27
-rw-r--r--etc/profile-a-l/jitsi.profile (renamed from etc/jitsi.profile)18
-rw-r--r--etc/profile-a-l/jumpnbump-menu.profile16
-rw-r--r--etc/profile-a-l/jumpnbump.profile49
-rw-r--r--etc/profile-a-l/k3b.profile38
-rw-r--r--etc/profile-a-l/kaffeine.profile42
-rw-r--r--etc/profile-a-l/kalgebra.profile49
-rw-r--r--etc/profile-a-l/kalgebramobile.profile10
-rw-r--r--etc/profile-a-l/karbon.profile12
-rw-r--r--etc/profile-a-l/kate.profile60
-rw-r--r--etc/profile-a-l/kazam.profile55
-rw-r--r--etc/profile-a-l/kcalc.profile65
-rw-r--r--etc/profile-a-l/kdeinit4.profile37
-rw-r--r--etc/profile-a-l/kdenlive.profile41
-rw-r--r--etc/profile-a-l/kdiff3.profile56
-rw-r--r--etc/profile-a-l/keepass.profile (renamed from etc/keepass.profile)23
-rw-r--r--etc/profile-a-l/keepass2.profile10
-rw-r--r--etc/profile-a-l/keepassx.profile (renamed from etc/keepassx.profile)27
-rw-r--r--etc/profile-a-l/keepassx2.profile11
-rw-r--r--etc/profile-a-l/keepassxc-cli.profile11
-rw-r--r--etc/profile-a-l/keepassxc-proxy.profile10
-rw-r--r--etc/profile-a-l/keepassxc.profile110
-rw-r--r--etc/profile-a-l/kfind.profile47
-rw-r--r--etc/profile-a-l/kget.profile42
-rw-r--r--etc/profile-a-l/kid3-cli.profile6
-rw-r--r--etc/profile-a-l/kid3-qt.profile8
-rw-r--r--etc/profile-a-l/kid3.profile48
-rw-r--r--etc/profile-a-l/kino.profile37
-rw-r--r--etc/profile-a-l/kiwix-desktop.profile51
-rw-r--r--etc/profile-a-l/klatexformula.profile45
-rw-r--r--etc/profile-a-l/klatexformula_cmdl.profile10
-rw-r--r--etc/profile-a-l/klavaro.profile54
-rw-r--r--etc/profile-a-l/kmail.profile62
-rw-r--r--etc/profile-a-l/kmplayer.profile41
-rw-r--r--etc/profile-a-l/knotes.profile18
-rw-r--r--etc/profile-a-l/kodi.profile55
-rw-r--r--etc/profile-a-l/konversation.profile45
-rw-r--r--etc/profile-a-l/kopete.profile39
-rw-r--r--etc/profile-a-l/krita.profile51
-rw-r--r--etc/profile-a-l/krunner.profile37
-rw-r--r--etc/profile-a-l/ktorrent.profile64
-rw-r--r--etc/profile-a-l/ktouch.profile53
-rw-r--r--etc/profile-a-l/kube.profile81
-rw-r--r--etc/profile-a-l/kwin_x11.profile46
-rw-r--r--etc/profile-a-l/kwrite.profile55
-rw-r--r--etc/profile-a-l/latex-common.profile41
-rw-r--r--etc/profile-a-l/latex.profile12
-rw-r--r--etc/profile-a-l/lbunzip2.profile11
-rw-r--r--etc/profile-a-l/lbzcat.profile11
-rw-r--r--etc/profile-a-l/lbzip2.profile11
-rw-r--r--etc/profile-a-l/leafpad.profile41
-rw-r--r--etc/profile-a-l/less.profile51
-rw-r--r--etc/profile-a-l/librecad.profile50
-rw-r--r--etc/profile-a-l/libreoffice.profile57
-rw-r--r--etc/profile-a-l/librewolf-nightly.profile13
-rw-r--r--etc/profile-a-l/librewolf.profile56
-rw-r--r--etc/profile-a-l/lifeograph.profile57
-rw-r--r--etc/profile-a-l/liferea.profile62
-rw-r--r--etc/profile-a-l/lightsoff.profile16
-rw-r--r--etc/profile-a-l/lincity-ng.profile48
-rw-r--r--etc/profile-a-l/links-common.profile62
-rw-r--r--etc/profile-a-l/links.profile18
-rw-r--r--etc/profile-a-l/links2.profile18
-rw-r--r--etc/profile-a-l/linphone.profile50
-rw-r--r--etc/profile-a-l/lmms.profile40
-rw-r--r--etc/profile-a-l/lobase.profile10
-rw-r--r--etc/profile-a-l/localc.profile10
-rw-r--r--etc/profile-a-l/lodraw.profile10
-rw-r--r--etc/profile-a-l/loffice.profile10
-rw-r--r--etc/profile-a-l/lofromtemplate.profile10
-rw-r--r--etc/profile-a-l/loimpress.profile10
-rw-r--r--etc/profile-a-l/lollypop.profile42
-rw-r--r--etc/profile-a-l/lomath.profile10
-rw-r--r--etc/profile-a-l/loweb.profile10
-rw-r--r--etc/profile-a-l/lowriter.profile10
-rw-r--r--etc/profile-a-l/lrunzip.profile12
-rw-r--r--etc/profile-a-l/lrz.profile12
-rw-r--r--etc/profile-a-l/lrzcat.profile12
-rw-r--r--etc/profile-a-l/lrzip.profile12
-rw-r--r--etc/profile-a-l/lrztar.profile12
-rw-r--r--etc/profile-a-l/lrzuntar.profile12
-rw-r--r--etc/profile-a-l/lsar.profile13
-rw-r--r--etc/profile-a-l/lugaru.profile52
-rw-r--r--etc/profile-a-l/luminance-hdr.profile (renamed from etc/luminance-hdr.profile)21
-rw-r--r--etc/profile-a-l/lutris.profile79
-rw-r--r--etc/profile-a-l/lximage-qt.profile38
-rw-r--r--etc/profile-a-l/lxmusic.profile40
-rw-r--r--etc/profile-a-l/lynx.profile42
-rw-r--r--etc/profile-a-l/lyx.profile38
-rw-r--r--etc/profile-a-l/lzcat.profile12
-rw-r--r--etc/profile-a-l/lzcmp.profile12
-rw-r--r--etc/profile-a-l/lzdiff.profile12
-rw-r--r--etc/profile-a-l/lzegrep.profile12
-rw-r--r--etc/profile-a-l/lzfgrep.profile12
-rw-r--r--etc/profile-a-l/lzgrep.profile12
-rw-r--r--etc/profile-a-l/lzip.profile12
-rw-r--r--etc/profile-a-l/lzless.profile12
-rw-r--r--etc/profile-a-l/lzma.profile12
-rw-r--r--etc/profile-a-l/lzmadec.profile12
-rw-r--r--etc/profile-a-l/lzmainfo.profile12
-rw-r--r--etc/profile-a-l/lzmore.profile12
-rw-r--r--etc/profile-a-l/lzop.profile12
-rw-r--r--etc/profile-m-z/Maelstrom.profile46
-rw-r--r--etc/profile-m-z/Maps.profile11
-rw-r--r--etc/profile-m-z/Mathematica.profile29
-rw-r--r--etc/profile-m-z/Natron.profile10
-rw-r--r--etc/profile-m-z/PCSX2.profile56
-rw-r--r--etc/profile-m-z/PPSSPPQt.profile9
-rw-r--r--etc/profile-m-z/PPSSPPSDL.profile9
-rw-r--r--etc/profile-m-z/QMediathekView.profile59
-rw-r--r--etc/profile-m-z/QOwnNotes.profile55
-rw-r--r--etc/profile-m-z/Screenshot.profile11
-rw-r--r--etc/profile-m-z/Telegram.profile10
-rw-r--r--etc/profile-m-z/Thunar.profile12
-rw-r--r--etc/profile-m-z/Viber.profile37
-rw-r--r--etc/profile-m-z/VirtualBox.profile11
-rw-r--r--etc/profile-m-z/XMind.profile38
-rw-r--r--etc/profile-m-z/Xephyr.profile (renamed from etc/Xephyr.profile)23
-rw-r--r--etc/profile-m-z/Xvfb.profile (renamed from etc/Xvfb.profile)22
-rw-r--r--etc/profile-m-z/ZeGrapher.profile48
-rw-r--r--etc/profile-m-z/macrofusion.profile45
-rw-r--r--etc/profile-m-z/magicor.profile52
-rw-r--r--etc/profile-m-z/makepkg.profile60
-rw-r--r--etc/profile-m-z/man.profile69
-rw-r--r--etc/profile-m-z/manaplus.profile51
-rw-r--r--etc/profile-m-z/marker.profile63
-rw-r--r--etc/profile-m-z/masterpdfeditor.profile41
-rw-r--r--etc/profile-m-z/masterpdfeditor4.profile11
-rw-r--r--etc/profile-m-z/masterpdfeditor5.profile11
-rw-r--r--etc/profile-m-z/mate-calc.profile53
-rw-r--r--etc/profile-m-z/mate-calculator.profile10
-rw-r--r--etc/profile-m-z/mate-color-select.profile41
-rw-r--r--etc/profile-m-z/mate-dictionary.profile (renamed from etc/mate-dictionary.profile)27
-rw-r--r--etc/profile-m-z/mathematica.profile10
-rw-r--r--etc/profile-m-z/matrix-mirage.profile24
-rw-r--r--etc/profile-m-z/mattermost-desktop.profile29
-rw-r--r--etc/profile-m-z/mcabber.profile (renamed from etc/mcabber.profile)18
-rw-r--r--etc/profile-m-z/mcomix.profile73
-rw-r--r--etc/profile-m-z/md5sum.profile13
-rw-r--r--etc/profile-m-z/mdr.profile55
-rw-r--r--etc/profile-m-z/mediainfo.profile51
-rw-r--r--etc/profile-m-z/mediathekview.profile49
-rw-r--r--etc/profile-m-z/megaglest.profile53
-rw-r--r--etc/profile-m-z/megaglest_editor.profile10
-rw-r--r--etc/profile-m-z/meld.profile81
-rw-r--r--etc/profile-m-z/mencoder.profile34
-rw-r--r--etc/profile-m-z/mendeleydesktop.profile50
-rw-r--r--etc/profile-m-z/menulibre.profile64
-rw-r--r--etc/profile-m-z/meteo-qt.profile54
-rw-r--r--etc/profile-m-z/microsoft-edge-beta.profile20
-rw-r--r--etc/profile-m-z/microsoft-edge-dev.profile20
-rw-r--r--etc/profile-m-z/microsoft-edge.profile11
-rw-r--r--etc/profile-m-z/midori.profile64
-rw-r--r--etc/profile-m-z/min.profile15
-rw-r--r--etc/profile-m-z/mindless.profile51
-rw-r--r--etc/profile-m-z/minecraft-launcher.profile59
-rw-r--r--etc/profile-m-z/minetest.profile64
-rw-r--r--etc/profile-m-z/minitube.profile61
-rw-r--r--etc/profile-m-z/mirage.profile61
-rw-r--r--etc/profile-m-z/mirrormagic.profile51
-rw-r--r--etc/profile-m-z/mocp.profile53
-rw-r--r--etc/profile-m-z/mousepad.profile40
-rw-r--r--etc/profile-m-z/mp3splt-gtk.profile44
-rw-r--r--etc/profile-m-z/mp3splt.profile53
-rw-r--r--etc/profile-m-z/mp3wrap.profile9
-rw-r--r--etc/profile-m-z/mpDris2.profile58
-rw-r--r--etc/profile-m-z/mpd.profile44
-rw-r--r--etc/profile-m-z/mpg123-alsa.profile9
-rw-r--r--etc/profile-m-z/mpg123-id3dump.profile12
-rw-r--r--etc/profile-m-z/mpg123-jack.profile9
-rw-r--r--etc/profile-m-z/mpg123-nas.profile9
-rw-r--r--etc/profile-m-z/mpg123-openal.profile9
-rw-r--r--etc/profile-m-z/mpg123-oss.profile9
-rw-r--r--etc/profile-m-z/mpg123-portaudio.profile9
-rw-r--r--etc/profile-m-z/mpg123-pulse.profile9
-rw-r--r--etc/profile-m-z/mpg123-strip.profile9
-rw-r--r--etc/profile-m-z/mpg123.bin.profile9
-rw-r--r--etc/profile-m-z/mpg123.profile45
-rw-r--r--etc/profile-m-z/mplayer.profile40
-rw-r--r--etc/profile-m-z/mpsyt.profile72
-rw-r--r--etc/profile-m-z/mpv.profile83
-rw-r--r--etc/profile-m-z/mrrescue.profile60
-rw-r--r--etc/profile-m-z/ms-excel.profile13
-rw-r--r--etc/profile-m-z/ms-office.profile43
-rw-r--r--etc/profile-m-z/ms-onenote.profile13
-rw-r--r--etc/profile-m-z/ms-outlook.profile13
-rw-r--r--etc/profile-m-z/ms-powerpoint.profile13
-rw-r--r--etc/profile-m-z/ms-skype.profile16
-rw-r--r--etc/profile-m-z/ms-word.profile13
-rw-r--r--etc/profile-m-z/mtpaint.profile49
-rw-r--r--etc/profile-m-z/multimc.profile10
-rw-r--r--etc/profile-m-z/multimc5.profile52
-rw-r--r--etc/profile-m-z/mumble.profile45
-rw-r--r--etc/profile-m-z/mupdf-gl.profile13
-rw-r--r--etc/profile-m-z/mupdf-x11-curl.profile18
-rw-r--r--etc/profile-m-z/mupdf-x11.profile14
-rw-r--r--etc/profile-m-z/mupdf.profile43
-rw-r--r--etc/profile-m-z/mupen64plus.profile (renamed from etc/mupen64plus.profile)21
-rw-r--r--etc/profile-m-z/muraster.profile11
-rw-r--r--etc/profile-m-z/musescore.profile42
-rw-r--r--etc/profile-m-z/musictube.profile57
-rw-r--r--etc/profile-m-z/musixmatch.profile37
-rw-r--r--etc/profile-m-z/mutool.profile11
-rw-r--r--etc/profile-m-z/mutt.profile149
-rw-r--r--etc/profile-m-z/mypaint-ora-thumbnailer.profile10
-rw-r--r--etc/profile-m-z/mypaint.profile50
-rw-r--r--etc/profile-m-z/nano.profile59
-rw-r--r--etc/profile-m-z/natron.profile (renamed from etc/natron.profile)29
-rw-r--r--etc/profile-m-z/nautilus.profile15
-rw-r--r--etc/profile-m-z/ncdu.profile37
-rw-r--r--etc/profile-m-z/ncdu2.profile11
-rw-r--r--etc/profile-m-z/nemo.profile12
-rw-r--r--etc/profile-m-z/neochat.profile65
-rw-r--r--etc/profile-m-z/neomutt.profile152
-rw-r--r--etc/profile-m-z/netactview.profile55
-rw-r--r--etc/profile-m-z/nethack-vultures.profile45
-rw-r--r--etc/profile-m-z/nethack.profile47
-rw-r--r--etc/profile-m-z/netsurf.profile34
-rw-r--r--etc/profile-m-z/neverball-wrapper.profile14
-rw-r--r--etc/profile-m-z/neverball.profile51
-rw-r--r--etc/profile-m-z/neverputt-wrapper.profile14
-rw-r--r--etc/profile-m-z/neverputt.profile11
-rw-r--r--etc/profile-m-z/newsbeuter.profile31
-rw-r--r--etc/profile-m-z/newsboat.profile62
-rw-r--r--etc/profile-m-z/newsflash.profile60
-rw-r--r--etc/profile-m-z/nextcloud-desktop.profile10
-rw-r--r--etc/profile-m-z/nextcloud.profile72
-rw-r--r--etc/profile-m-z/nheko.profile61
-rw-r--r--etc/profile-m-z/nicotine.profile57
-rw-r--r--etc/profile-m-z/nitroshare-cli.profile11
-rw-r--r--etc/profile-m-z/nitroshare-nmh.profile11
-rw-r--r--etc/profile-m-z/nitroshare-send.profile11
-rw-r--r--etc/profile-m-z/nitroshare-ui.profile11
-rw-r--r--etc/profile-m-z/nitroshare.profile52
-rw-r--r--etc/profile-m-z/node.profile11
-rw-r--r--etc/profile-m-z/nodejs-common.profile95
-rw-r--r--etc/profile-m-z/nomacs.profile45
-rw-r--r--etc/profile-m-z/notify-send.profile60
-rw-r--r--etc/profile-m-z/npm.profile11
-rw-r--r--etc/profile-m-z/nslookup.profile55
-rw-r--r--etc/profile-m-z/nuclear.profile25
-rw-r--r--etc/profile-m-z/nvm.profile13
-rw-r--r--etc/profile-m-z/nylas.profile38
-rw-r--r--etc/profile-m-z/nyx.profile54
-rw-r--r--etc/profile-m-z/obs.profile43
-rw-r--r--etc/profile-m-z/ocenaudio.profile55
-rw-r--r--etc/profile-m-z/odt2txt.profile47
-rw-r--r--etc/profile-m-z/oggsplt.profile9
-rw-r--r--etc/profile-m-z/okular.profile72
-rw-r--r--etc/profile-m-z/onboard.profile56
-rw-r--r--etc/profile-m-z/onionshare-gui.profile41
-rw-r--r--etc/profile-m-z/ooffice.profile10
-rw-r--r--etc/profile-m-z/ooviewdoc.profile10
-rw-r--r--etc/profile-m-z/open-invaders.profile43
-rw-r--r--etc/profile-m-z/openarena.profile50
-rw-r--r--etc/profile-m-z/openarena_ded.profile10
-rw-r--r--etc/profile-m-z/openbox.profile20
-rw-r--r--etc/profile-m-z/opencity.profile48
-rw-r--r--etc/profile-m-z/openclonk.profile49
-rw-r--r--etc/profile-m-z/openmw-launcher.profile7
-rw-r--r--etc/profile-m-z/openmw.profile61
-rw-r--r--etc/profile-m-z/openoffice.org.profile10
-rw-r--r--etc/profile-m-z/openshot-qt.profile10
-rw-r--r--etc/profile-m-z/openshot.profile49
-rw-r--r--etc/profile-m-z/openttd.profile48
-rw-r--r--etc/profile-m-z/opera-beta.profile22
-rw-r--r--etc/profile-m-z/opera.profile26
-rw-r--r--etc/profile-m-z/orage.profile (renamed from etc/orage.profile)22
-rw-r--r--etc/profile-m-z/org.gnome.NautilusPreviewer.profile10
-rw-r--r--etc/profile-m-z/ostrichriders.profile50
-rw-r--r--etc/profile-m-z/otter-browser.profile59
-rw-r--r--etc/profile-m-z/out123.profile9
-rw-r--r--etc/profile-m-z/p7zip.profile12
-rw-r--r--etc/profile-m-z/palemoon.profile26
-rw-r--r--etc/profile-m-z/pandoc.profile56
-rw-r--r--etc/profile-m-z/parole.profile30
-rw-r--r--etc/profile-m-z/patch.profile51
-rw-r--r--etc/profile-m-z/pavucontrol-qt.profile19
-rw-r--r--etc/profile-m-z/pavucontrol.profile56
-rw-r--r--etc/profile-m-z/pcmanfm.profile12
-rw-r--r--etc/profile-m-z/pcsxr.profile56
-rw-r--r--etc/profile-m-z/pdfchain.profile43
-rw-r--r--etc/profile-m-z/pdflatex.profile12
-rw-r--r--etc/profile-m-z/pdfmod.profile (renamed from etc/pdfmod.profile)26
-rw-r--r--etc/profile-m-z/pdfsam.profile44
-rw-r--r--etc/profile-m-z/pdftotext.profile55
-rw-r--r--etc/profile-m-z/peek.profile62
-rw-r--r--etc/profile-m-z/penguin-command.profile42
-rw-r--r--etc/profile-m-z/photoflare.profile50
-rw-r--r--etc/profile-m-z/picard.profile43
-rw-r--r--etc/profile-m-z/pidgin.profile47
-rw-r--r--etc/profile-m-z/pinball-wrapper.profile14
-rw-r--r--etc/profile-m-z/pinball.profile55
-rw-r--r--etc/profile-m-z/ping.profile58
-rw-r--r--etc/profile-m-z/pingus.profile57
-rw-r--r--etc/profile-m-z/pinta.profile41
-rw-r--r--etc/profile-m-z/pioneer.profile47
-rw-r--r--etc/profile-m-z/pipe-viewer.profile21
-rw-r--r--etc/profile-m-z/pithos.profile43
-rw-r--r--etc/profile-m-z/pitivi.profile42
-rw-r--r--etc/profile-m-z/pix.profile (renamed from etc/pix.profile)20
-rw-r--r--etc/profile-m-z/pkglog.profile59
-rw-r--r--etc/profile-m-z/planmaker18.profile10
-rw-r--r--etc/profile-m-z/planmaker18free.profile10
-rw-r--r--etc/profile-m-z/playonlinux.profile23
-rw-r--r--etc/profile-m-z/pluma.profile52
-rw-r--r--etc/profile-m-z/plv.profile60
-rw-r--r--etc/profile-m-z/pngquant.profile56
-rw-r--r--etc/profile-m-z/polari.profile (renamed from etc/polari.profile)22
-rw-r--r--etc/profile-m-z/ppsspp.profile51
-rw-r--r--etc/profile-m-z/pragha.profile38
-rw-r--r--etc/profile-m-z/presentations18.profile11
-rw-r--r--etc/profile-m-z/presentations18free.profile10
-rw-r--r--etc/profile-m-z/profanity.profile53
-rw-r--r--etc/profile-m-z/psi-plus.profile45
-rw-r--r--etc/profile-m-z/psi.profile78
-rw-r--r--etc/profile-m-z/pybitmessage.profile46
-rw-r--r--etc/profile-m-z/pycharm-community.profile38
-rw-r--r--etc/profile-m-z/pycharm-professional.profile12
-rw-r--r--etc/profile-m-z/pzstd.profile10
-rw-r--r--etc/profile-m-z/qbittorrent.profile63
-rw-r--r--etc/profile-m-z/qcomicbook.profile67
-rw-r--r--etc/profile-m-z/qemu-launcher.profile (renamed from etc/qemu-launcher.profile)12
-rw-r--r--etc/profile-m-z/qemu-system-x86_64.profile (renamed from etc/qemu-system-x86_64.profile)12
-rw-r--r--etc/profile-m-z/qgis.profile59
-rw-r--r--etc/profile-m-z/qlipper.profile (renamed from etc/qlipper.profile)20
-rw-r--r--etc/profile-m-z/qmmp.profile39
-rw-r--r--etc/profile-m-z/qnapi.profile55
-rw-r--r--etc/profile-m-z/qpdfview.profile46
-rw-r--r--etc/profile-m-z/qrencode.profile57
-rw-r--r--etc/profile-m-z/qt-faststart.profile14
-rw-r--r--etc/profile-m-z/qtox.profile52
-rw-r--r--etc/profile-m-z/quadrapassel.profile20
-rw-r--r--etc/profile-m-z/quassel.profile26
-rw-r--r--etc/profile-m-z/quaternion.profile54
-rw-r--r--etc/profile-m-z/quiterss.profile (renamed from etc/quiterss.profile)35
-rw-r--r--etc/profile-m-z/quodlibet.profile66
-rw-r--r--etc/profile-m-z/qupzilla.profile24
-rw-r--r--etc/profile-m-z/qutebrowser.profile40
-rw-r--r--etc/profile-m-z/rambox.profile38
-rw-r--r--etc/profile-m-z/ranger.profile12
-rw-r--r--etc/profile-m-z/redeclipse.profile48
-rw-r--r--etc/profile-m-z/rednotebook.profile66
-rw-r--r--etc/profile-m-z/redshift.profile53
-rw-r--r--etc/profile-m-z/regextester.profile55
-rw-r--r--etc/profile-m-z/remmina.profile42
-rw-r--r--etc/profile-m-z/rhythmbox-client.profile11
-rw-r--r--etc/profile-m-z/rhythmbox.profile66
-rw-r--r--etc/profile-m-z/ricochet.profile (renamed from etc/ricochet.profile)24
-rw-r--r--etc/profile-m-z/riot-desktop.profile11
-rw-r--r--etc/profile-m-z/riot-web.profile (renamed from etc/riot-web.profile)12
-rw-r--r--etc/profile-m-z/ripperx.profile43
-rw-r--r--etc/profile-m-z/ristretto.profile42
-rw-r--r--etc/profile-m-z/rnano.profile12
-rw-r--r--etc/profile-m-z/rocketchat.profile30
-rw-r--r--etc/profile-m-z/rsync-download_only.profile58
-rw-r--r--etc/profile-m-z/rtin.profile8
-rw-r--r--etc/profile-m-z/rtorrent.profile (renamed from etc/rtorrent.profile)18
-rw-r--r--etc/profile-m-z/rtv-addons.profile28
-rw-r--r--etc/profile-m-z/rtv.profile65
-rw-r--r--etc/profile-m-z/runenpass.sh.profile10
-rw-r--r--etc/profile-m-z/rview.profile10
-rw-r--r--etc/profile-m-z/rvim.profile10
-rw-r--r--etc/profile-m-z/sayonara.profile36
-rw-r--r--etc/profile-m-z/scallion.profile44
-rw-r--r--etc/profile-m-z/scorched3d-wrapper.profile11
-rw-r--r--etc/profile-m-z/scorched3d.profile50
-rw-r--r--etc/profile-m-z/scorchwentbonkers.profile50
-rw-r--r--etc/profile-m-z/scp.profile12
-rw-r--r--etc/profile-m-z/scribus.profile64
-rw-r--r--etc/profile-m-z/sdat2img.profile44
-rw-r--r--etc/profile-m-z/seahorse-adventures.profile55
-rw-r--r--etc/profile-m-z/seahorse-daemon.profile14
-rw-r--r--etc/profile-m-z/seahorse-tool.profile15
-rw-r--r--etc/profile-m-z/seahorse.profile70
-rw-r--r--etc/profile-m-z/seamonkey-bin.profile10
-rw-r--r--etc/profile-m-z/seamonkey.profile55
-rw-r--r--etc/profile-m-z/secret-tool.profile12
-rw-r--r--etc/profile-m-z/server.profile90
-rw-r--r--etc/profile-m-z/servo.profile49
-rw-r--r--etc/profile-m-z/sftp.profile12
-rw-r--r--etc/profile-m-z/sha1sum.profile13
-rw-r--r--etc/profile-m-z/sha224sum.profile13
-rw-r--r--etc/profile-m-z/sha256sum.profile13
-rw-r--r--etc/profile-m-z/sha384sum.profile13
-rw-r--r--etc/profile-m-z/sha512sum.profile13
-rw-r--r--etc/profile-m-z/shellcheck.profile54
-rw-r--r--etc/profile-m-z/shortwave.profile50
-rw-r--r--etc/profile-m-z/shotcut.profile38
-rw-r--r--etc/profile-m-z/shotwell.profile60
-rw-r--r--etc/profile-m-z/signal-cli.profile51
-rw-r--r--etc/profile-m-z/signal-desktop.profile30
-rw-r--r--etc/profile-m-z/silentarmy.profile40
-rw-r--r--etc/profile-m-z/simple-scan.profile41
-rw-r--r--etc/profile-m-z/simplescreenrecorder.profile39
-rw-r--r--etc/profile-m-z/simutrans.profile42
-rw-r--r--etc/profile-m-z/skanlite.profile36
-rw-r--r--etc/profile-m-z/skypeforlinux.profile29
-rw-r--r--etc/profile-m-z/slack.profile32
-rw-r--r--etc/profile-m-z/slashem.profile47
-rw-r--r--etc/profile-m-z/smplayer.profile55
-rw-r--r--etc/profile-m-z/smtube.profile (renamed from etc/smtube.profile)27
-rw-r--r--etc/profile-m-z/smuxi-frontend-gnome.profile55
-rw-r--r--etc/profile-m-z/snox.profile24
-rw-r--r--etc/profile-m-z/soffice.profile10
-rw-r--r--etc/profile-m-z/softmaker-common.profile50
-rw-r--r--etc/profile-m-z/sol.profile47
-rw-r--r--etc/profile-m-z/sound-juicer.profile43
-rw-r--r--etc/profile-m-z/soundconverter.profile50
-rw-r--r--etc/profile-m-z/spectacle.profile68
-rw-r--r--etc/profile-m-z/spectral.profile58
-rw-r--r--etc/profile-m-z/spectre-meltdown-checker.profile52
-rw-r--r--etc/profile-m-z/spotify.profile54
-rw-r--r--etc/profile-m-z/sqlitebrowser.profile52
-rw-r--r--etc/profile-m-z/ssh-agent.profile (renamed from etc/ssh-agent.profile)25
-rw-r--r--etc/profile-m-z/ssh.profile53
-rw-r--r--etc/profile-m-z/standardnotes-desktop.profile44
-rw-r--r--etc/profile-m-z/start-tor-browser.desktop.profile76
-rw-r--r--etc/profile-m-z/start-tor-browser.profile10
-rw-r--r--etc/profile-m-z/steam-native.profile10
-rw-r--r--etc/profile-m-z/steam-runtime.profile10
-rw-r--r--etc/profile-m-z/steam.profile165
-rw-r--r--etc/profile-m-z/stellarium.profile46
-rw-r--r--etc/profile-m-z/straw-viewer.profile21
-rw-r--r--etc/profile-m-z/strawberry.profile49
-rw-r--r--etc/profile-m-z/strings.profile57
-rw-r--r--etc/profile-m-z/studio.sh.profile10
-rw-r--r--etc/profile-m-z/subdownloader.profile53
-rw-r--r--etc/profile-m-z/sum.profile13
-rw-r--r--etc/profile-m-z/supertux2.profile53
-rw-r--r--etc/profile-m-z/supertuxkart-wrapper.profile14
-rw-r--r--etc/profile-m-z/supertuxkart.profile63
-rw-r--r--etc/profile-m-z/surf.profile39
-rw-r--r--etc/profile-m-z/sushi.profile48
-rw-r--r--etc/profile-m-z/sway.profile19
-rw-r--r--etc/profile-m-z/swell-foop.profile21
-rw-r--r--etc/profile-m-z/sylpheed.profile26
-rw-r--r--etc/profile-m-z/synfigstudio.profile (renamed from etc/synfigstudio.profile)23
-rw-r--r--etc/profile-m-z/sysprof-cli.profile20
-rw-r--r--etc/profile-m-z/sysprof.profile77
-rw-r--r--etc/profile-m-z/tar.profile23
-rw-r--r--etc/profile-m-z/tb-starter-wrapper.profile19
-rw-r--r--etc/profile-m-z/tcpdump.profile46
-rw-r--r--etc/profile-m-z/teams-for-linux.profile26
-rw-r--r--etc/profile-m-z/teams.profile30
-rw-r--r--etc/profile-m-z/teamspeak3.profile (renamed from etc/teamspeak3.profile)25
-rw-r--r--etc/profile-m-z/teeworlds.profile47
-rw-r--r--etc/profile-m-z/telegram-desktop.profile11
-rw-r--r--etc/profile-m-z/telegram.profile56
-rw-r--r--etc/profile-m-z/terasology.profile48
-rw-r--r--etc/profile-m-z/tex.profile12
-rw-r--r--etc/profile-m-z/textmaker18.profile11
-rw-r--r--etc/profile-m-z/textmaker18free.profile11
-rw-r--r--etc/profile-m-z/thunar.profile11
-rw-r--r--etc/profile-m-z/thunderbird-beta.profile12
-rw-r--r--etc/profile-m-z/thunderbird-wayland.profile10
-rw-r--r--etc/profile-m-z/thunderbird.profile63
-rw-r--r--etc/profile-m-z/tilp.profile35
-rw-r--r--etc/profile-m-z/tin.profile68
-rw-r--r--etc/profile-m-z/tmux.profile45
-rw-r--r--etc/profile-m-z/tor-browser-ar.profile15
-rw-r--r--etc/profile-m-z/tor-browser-ca.profile15
-rw-r--r--etc/profile-m-z/tor-browser-cs.profile15
-rw-r--r--etc/profile-m-z/tor-browser-da.profile15
-rw-r--r--etc/profile-m-z/tor-browser-de.profile15
-rw-r--r--etc/profile-m-z/tor-browser-el.profile15
-rw-r--r--etc/profile-m-z/tor-browser-en-us.profile15
-rw-r--r--etc/profile-m-z/tor-browser-en.profile15
-rw-r--r--etc/profile-m-z/tor-browser-es-es.profile15
-rw-r--r--etc/profile-m-z/tor-browser-es.profile15
-rw-r--r--etc/profile-m-z/tor-browser-fa.profile15
-rw-r--r--etc/profile-m-z/tor-browser-fr.profile15
-rw-r--r--etc/profile-m-z/tor-browser-ga-ie.profile15
-rw-r--r--etc/profile-m-z/tor-browser-he.profile15
-rw-r--r--etc/profile-m-z/tor-browser-hu.profile15
-rw-r--r--etc/profile-m-z/tor-browser-id.profile15
-rw-r--r--etc/profile-m-z/tor-browser-is.profile15
-rw-r--r--etc/profile-m-z/tor-browser-it.profile15
-rw-r--r--etc/profile-m-z/tor-browser-ja.profile15
-rw-r--r--etc/profile-m-z/tor-browser-ka.profile15
-rw-r--r--etc/profile-m-z/tor-browser-ko.profile15
-rw-r--r--etc/profile-m-z/tor-browser-nb.profile15
-rw-r--r--etc/profile-m-z/tor-browser-nl.profile15
-rw-r--r--etc/profile-m-z/tor-browser-pl.profile15
-rw-r--r--etc/profile-m-z/tor-browser-pt-br.profile15
-rw-r--r--etc/profile-m-z/tor-browser-ru.profile15
-rw-r--r--etc/profile-m-z/tor-browser-sv-se.profile15
-rw-r--r--etc/profile-m-z/tor-browser-tr.profile15
-rw-r--r--etc/profile-m-z/tor-browser-vi.profile15
-rw-r--r--etc/profile-m-z/tor-browser-zh-cn.profile15
-rw-r--r--etc/profile-m-z/tor-browser-zh-tw.profile15
-rw-r--r--etc/profile-m-z/tor-browser.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ar.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ca.profile15
-rw-r--r--etc/profile-m-z/tor-browser_cs.profile15
-rw-r--r--etc/profile-m-z/tor-browser_da.profile15
-rw-r--r--etc/profile-m-z/tor-browser_de.profile15
-rw-r--r--etc/profile-m-z/tor-browser_el.profile15
-rw-r--r--etc/profile-m-z/tor-browser_en-US.profile15
-rw-r--r--etc/profile-m-z/tor-browser_en.profile15
-rw-r--r--etc/profile-m-z/tor-browser_es-ES.profile15
-rw-r--r--etc/profile-m-z/tor-browser_es.profile15
-rw-r--r--etc/profile-m-z/tor-browser_fa.profile15
-rw-r--r--etc/profile-m-z/tor-browser_fr.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ga-IE.profile15
-rw-r--r--etc/profile-m-z/tor-browser_he.profile15
-rw-r--r--etc/profile-m-z/tor-browser_hu.profile15
-rw-r--r--etc/profile-m-z/tor-browser_id.profile15
-rw-r--r--etc/profile-m-z/tor-browser_is.profile15
-rw-r--r--etc/profile-m-z/tor-browser_it.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ja.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ka.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ko.profile15
-rw-r--r--etc/profile-m-z/tor-browser_nb.profile15
-rw-r--r--etc/profile-m-z/tor-browser_nl.profile15
-rw-r--r--etc/profile-m-z/tor-browser_pl.profile15
-rw-r--r--etc/profile-m-z/tor-browser_pt-BR.profile15
-rw-r--r--etc/profile-m-z/tor-browser_ru.profile15
-rw-r--r--etc/profile-m-z/tor-browser_sv-SE.profile15
-rw-r--r--etc/profile-m-z/tor-browser_tr.profile15
-rw-r--r--etc/profile-m-z/tor-browser_vi.profile15
-rw-r--r--etc/profile-m-z/tor-browser_zh-CN.profile15
-rw-r--r--etc/profile-m-z/tor-browser_zh-TW.profile15
-rw-r--r--etc/profile-m-z/tor.profile (renamed from etc/tor.profile)30
-rw-r--r--etc/profile-m-z/torbrowser-launcher.profile65
-rw-r--r--etc/profile-m-z/torcs.profile49
-rw-r--r--etc/profile-m-z/totem.profile60
-rw-r--r--etc/profile-m-z/tracker.profile (renamed from etc/tracker.profile)18
-rw-r--r--etc/profile-m-z/transgui.profile55
-rw-r--r--etc/profile-m-z/transmission-cli.profile14
-rw-r--r--etc/profile-m-z/transmission-common.profile54
-rw-r--r--etc/profile-m-z/transmission-create.profile13
-rw-r--r--etc/profile-m-z/transmission-daemon.profile27
-rw-r--r--etc/profile-m-z/transmission-edit.profile13
-rw-r--r--etc/profile-m-z/transmission-gtk.profile18
-rw-r--r--etc/profile-m-z/transmission-qt.profile18
-rw-r--r--etc/profile-m-z/transmission-remote-cli.profile17
-rw-r--r--etc/profile-m-z/transmission-remote-gtk.profile22
-rw-r--r--etc/profile-m-z/transmission-remote.profile14
-rw-r--r--etc/profile-m-z/transmission-show.profile14
-rw-r--r--etc/profile-m-z/tremulous.profile50
-rw-r--r--etc/profile-m-z/trojita.profile64
-rw-r--r--etc/profile-m-z/truecraft.profile (renamed from etc/truecraft.profile)19
-rw-r--r--etc/profile-m-z/ts3client_runscript.sh.profile19
-rw-r--r--etc/profile-m-z/tshark.profile11
-rw-r--r--etc/profile-m-z/tutanota-desktop.profile31
-rw-r--r--etc/profile-m-z/tuxguitar.profile45
-rw-r--r--etc/profile-m-z/tvbrowser.profile53
-rw-r--r--etc/profile-m-z/twitch.profile25
-rw-r--r--etc/profile-m-z/udiskie.profile45
-rw-r--r--etc/profile-m-z/uefitool.profile (renamed from etc/uefitool.profile)22
-rw-r--r--etc/profile-m-z/uget-gtk.profile (renamed from etc/uget-gtk.profile)22
-rw-r--r--etc/profile-m-z/unar.profile13
-rw-r--r--etc/profile-m-z/unbound.profile52
-rw-r--r--etc/profile-m-z/uncompress.profile11
-rw-r--r--etc/profile-m-z/unf.profile59
-rw-r--r--etc/profile-m-z/unknown-horizons.profile44
-rw-r--r--etc/profile-m-z/unlzma.profile12
-rw-r--r--etc/profile-m-z/unrar.profile15
-rw-r--r--etc/profile-m-z/unxz.profile12
-rw-r--r--etc/profile-m-z/unzip.profile16
-rw-r--r--etc/profile-m-z/unzstd.profile10
-rw-r--r--etc/profile-m-z/utox.profile49
-rw-r--r--etc/profile-m-z/uudeview.profile47
-rw-r--r--etc/profile-m-z/uzbl-browser.profile40
-rw-r--r--etc/profile-m-z/viewnior.profile52
-rw-r--r--etc/profile-m-z/viking.profile (renamed from etc/viking.profile)20
-rw-r--r--etc/profile-m-z/vim.profile34
-rw-r--r--etc/profile-m-z/vimcat.profile10
-rw-r--r--etc/profile-m-z/vimdiff.profile10
-rw-r--r--etc/profile-m-z/vimpager.profile11
-rw-r--r--etc/profile-m-z/vimtutor.profile10
-rw-r--r--etc/profile-m-z/virtualbox.profile52
-rw-r--r--etc/profile-m-z/vivaldi-beta.profile7
-rw-r--r--etc/profile-m-z/vivaldi-snapshot.profile7
-rw-r--r--etc/profile-m-z/vivaldi-stable.profile7
-rw-r--r--etc/profile-m-z/vivaldi.profile41
-rw-r--r--etc/profile-m-z/vlc.profile53
-rw-r--r--etc/profile-m-z/vmware-player.profile8
-rw-r--r--etc/profile-m-z/vmware-view.profile56
-rw-r--r--etc/profile-m-z/vmware-workstation.profile8
-rw-r--r--etc/profile-m-z/vmware.profile43
-rw-r--r--etc/profile-m-z/vscodium.profile12
-rw-r--r--etc/profile-m-z/vulturesclaw.profile13
-rw-r--r--etc/profile-m-z/vultureseye.profile13
-rw-r--r--etc/profile-m-z/vym.profile (renamed from etc/vym.profile)20
-rw-r--r--etc/profile-m-z/w3m.profile71
-rw-r--r--etc/profile-m-z/warmux.profile56
-rw-r--r--etc/profile-m-z/warsow.profile55
-rw-r--r--etc/profile-m-z/warzone2100.profile47
-rw-r--r--etc/profile-m-z/waterfox-classic.profile7
-rw-r--r--etc/profile-m-z/waterfox-current.profile7
-rw-r--r--etc/profile-m-z/waterfox.profile28
-rw-r--r--etc/profile-m-z/webstorm.profile45
-rw-r--r--etc/profile-m-z/webui-aria2.profile38
-rw-r--r--etc/profile-m-z/weechat-curses.profile10
-rw-r--r--etc/profile-m-z/weechat.profile (renamed from etc/weechat.profile)13
-rw-r--r--etc/profile-m-z/wesnoth.profile (renamed from etc/wesnoth.profile)18
-rw-r--r--etc/profile-m-z/wget.profile60
-rw-r--r--etc/profile-m-z/whalebird.profile27
-rw-r--r--etc/profile-m-z/whois.profile57
-rw-r--r--etc/profile-m-z/widelands.profile48
-rw-r--r--etc/profile-m-z/wine.profile41
-rw-r--r--etc/profile-m-z/wire-desktop.profile32
-rw-r--r--etc/profile-m-z/wireshark-gtk.profile11
-rw-r--r--etc/profile-m-z/wireshark-qt.profile11
-rw-r--r--etc/profile-m-z/wireshark.profile53
-rw-r--r--etc/profile-m-z/wordwarvi.profile52
-rw-r--r--etc/profile-m-z/wpp.profile14
-rw-r--r--etc/profile-m-z/wps.profile49
-rw-r--r--etc/profile-m-z/wpspdf.profile11
-rw-r--r--etc/profile-m-z/x-terminal-emulator.profile (renamed from etc/x-terminal-emulator.profile)11
-rw-r--r--etc/profile-m-z/x2goclient.profile51
-rw-r--r--etc/profile-m-z/xbill.profile54
-rw-r--r--etc/profile-m-z/xcalc.profile43
-rw-r--r--etc/profile-m-z/xchat.profile (renamed from etc/xchat.profile)13
-rw-r--r--etc/profile-m-z/xed.profile54
-rw-r--r--etc/profile-m-z/xfburn.profile (renamed from etc/xfburn.profile)16
-rw-r--r--etc/profile-m-z/xfce4-dict.profile (renamed from etc/xfce4-dict.profile)22
-rw-r--r--etc/profile-m-z/xfce4-mixer.profile57
-rw-r--r--etc/profile-m-z/xfce4-notes.profile (renamed from etc/xfce4-notes.profile)22
-rw-r--r--etc/profile-m-z/xfce4-screenshooter.profile51
-rw-r--r--etc/profile-m-z/xiphos.profile51
-rw-r--r--etc/profile-m-z/xlinks.profile20
-rw-r--r--etc/profile-m-z/xlinks220
-rw-r--r--etc/profile-m-z/xmms.profile (renamed from etc/xmms.profile)17
-rw-r--r--etc/profile-m-z/xmr-stak.profile46
-rw-r--r--etc/profile-m-z/xonotic-glx.profile10
-rw-r--r--etc/profile-m-z/xonotic-sdl-wrapper.profile (renamed from etc/xonotic-glx.profile)4
-rw-r--r--etc/profile-m-z/xonotic-sdl.profile10
-rw-r--r--etc/profile-m-z/xonotic.profile57
-rw-r--r--etc/profile-m-z/xournal.profile51
-rw-r--r--etc/profile-m-z/xournalpp.profile34
-rw-r--r--etc/profile-m-z/xpdf.profile45
-rw-r--r--etc/profile-m-z/xplayer-audio-preview.profile10
-rw-r--r--etc/profile-m-z/xplayer-video-thumbnailer.profile10
-rw-r--r--etc/profile-m-z/xplayer.profile50
-rw-r--r--etc/profile-m-z/xpra.profile (renamed from etc/xpra.profile)27
-rw-r--r--etc/profile-m-z/xreader-previewer.profile10
-rw-r--r--etc/profile-m-z/xreader-thumbnailer.profile10
-rw-r--r--etc/profile-m-z/xreader.profile45
-rw-r--r--etc/profile-m-z/xviewer.profile49
-rw-r--r--etc/profile-m-z/xxd.profile12
-rw-r--r--etc/profile-m-z/xz.profile12
-rw-r--r--etc/profile-m-z/xzcat.profile12
-rw-r--r--etc/profile-m-z/xzcmp.profile12
-rw-r--r--etc/profile-m-z/xzdec.profile11
-rw-r--r--etc/profile-m-z/xzdiff.profile12
-rw-r--r--etc/profile-m-z/xzegrep.profile12
-rw-r--r--etc/profile-m-z/xzfgrep.profile12
-rw-r--r--etc/profile-m-z/xzgrep.profile11
-rw-r--r--etc/profile-m-z/xzless.profile11
-rw-r--r--etc/profile-m-z/xzmore.profile12
-rw-r--r--etc/profile-m-z/yandex-browser.profile28
-rw-r--r--etc/profile-m-z/yarn.profile10
-rw-r--r--etc/profile-m-z/yelp.profile77
-rw-r--r--etc/profile-m-z/youtube-dl-gui.profile56
-rw-r--r--etc/profile-m-z/youtube-dl.profile67
-rw-r--r--etc/profile-m-z/youtube-viewer.profile21
-rw-r--r--etc/profile-m-z/youtube-viewers-common.profile60
-rw-r--r--etc/profile-m-z/youtube.profile24
-rw-r--r--etc/profile-m-z/youtubemusic-nativefier.profile21
-rw-r--r--etc/profile-m-z/yt-dlp.profile19
-rw-r--r--etc/profile-m-z/ytmdesktop.profile21
-rw-r--r--etc/profile-m-z/zaproxy.profile47
-rw-r--r--etc/profile-m-z/zart.profile38
-rw-r--r--etc/profile-m-z/zathura.profile62
-rw-r--r--etc/profile-m-z/zcat.profile15
-rw-r--r--etc/profile-m-z/zcmp.profile11
-rw-r--r--etc/profile-m-z/zdiff.profile11
-rw-r--r--etc/profile-m-z/zeal.profile60
-rw-r--r--etc/profile-m-z/zegrep.profile11
-rw-r--r--etc/profile-m-z/zfgrep.profile11
-rw-r--r--etc/profile-m-z/zforce.profile11
-rw-r--r--etc/profile-m-z/zgrep.profile15
-rw-r--r--etc/profile-m-z/zim.profile71
-rw-r--r--etc/profile-m-z/zless.profile11
-rw-r--r--etc/profile-m-z/zmore.profile11
-rw-r--r--etc/profile-m-z/znew.profile11
-rw-r--r--etc/profile-m-z/zoom.profile35
-rw-r--r--etc/profile-m-z/zpaq.profile15
-rw-r--r--etc/profile-m-z/zstd.profile11
-rw-r--r--etc/profile-m-z/zstdcat.profile10
-rw-r--r--etc/profile-m-z/zstdgrep.profile10
-rw-r--r--etc/profile-m-z/zstdless.profile10
-rw-r--r--etc/profile-m-z/zstdmt.profile10
-rw-r--r--etc/profile-m-z/zulip.profile48
-rw-r--r--etc/psi-plus.profile43
-rw-r--r--etc/qbittorrent.profile51
-rw-r--r--etc/qpdfview.profile36
-rw-r--r--etc/qtox.profile40
-rw-r--r--etc/quassel.profile20
-rw-r--r--etc/qupzilla.profile30
-rw-r--r--etc/qutebrowser.profile32
-rw-r--r--etc/rambox.profile31
-rw-r--r--etc/ranger.profile31
-rw-r--r--etc/remmina.profile32
-rw-r--r--etc/rhythmbox.profile34
-rw-r--r--etc/ristretto.profile35
-rw-r--r--etc/rocketchat.profile14
-rw-r--r--etc/scribus.profile46
-rw-r--r--etc/sdat2img.profile33
-rw-r--r--etc/seamonkey-bin.profile6
-rw-r--r--etc/seamonkey.profile48
-rw-r--r--etc/server.profile43
-rw-r--r--etc/shotcut.profile31
-rw-r--r--etc/silentarmy.profile37
-rw-r--r--etc/simple-scan.profile33
-rw-r--r--etc/simutrans.profile32
-rw-r--r--etc/skanlite.profile32
-rw-r--r--etc/skype.profile32
-rw-r--r--etc/skypeforlinux.profile31
-rw-r--r--etc/slack.profile40
-rw-r--r--etc/smplayer.profile30
-rw-r--r--etc/snap.profile16
-rw-r--r--etc/soffice.profile6
-rw-r--r--etc/soundconverter.profile32
-rw-r--r--etc/spotify.profile50
-rw-r--r--etc/sqlitebrowser.profile35
-rw-r--r--etc/ssh.profile39
-rw-r--r--etc/start-tor-browser.profile32
-rw-r--r--etc/steam.profile51
-rw-r--r--etc/stellarium.profile43
-rw-r--r--etc/strings.profile26
-rw-r--r--etc/supertux2.profile32
-rw-r--r--etc/surf.profile35
-rw-r--r--etc/tar.profile27
-rw-r--r--etc/telegram-desktop.profile6
-rw-r--r--etc/telegram.profile27
-rw-r--r--etc/templates/profile.template227
-rw-r--r--etc/templates/redirect_alias-profile.template44
-rw-r--r--etc/templates/syscalls.txt112
-rw-r--r--etc/terasology.profile42
-rw-r--r--etc/thunar.profile6
-rw-r--r--etc/thunderbird.profile34
-rw-r--r--etc/tor-browser-en.profile6
-rw-r--r--etc/torbrowser-launcher.profile40
-rw-r--r--etc/totem.profile33
-rw-r--r--etc/transmission-cli.profile34
-rw-r--r--etc/transmission-gtk.profile41
-rw-r--r--etc/transmission-qt.profile41
-rw-r--r--etc/transmission-show.profile32
-rw-r--r--etc/tuxguitar.profile35
-rw-r--r--etc/unbound.profile33
-rw-r--r--etc/unknown-horizons.profile31
-rw-r--r--etc/unrar.profile27
-rw-r--r--etc/unzip.profile26
-rw-r--r--etc/uudeview.profile24
-rw-r--r--etc/uzbl-browser.profile34
-rw-r--r--etc/viewnior.profile42
-rw-r--r--etc/vim.profile25
-rw-r--r--etc/virtualbox.profile30
-rw-r--r--etc/vivaldi-beta.profile6
-rw-r--r--etc/vivaldi-stable.profile6
-rw-r--r--etc/vivaldi.profile33
-rw-r--r--etc/vlc.profile34
-rw-r--r--etc/w3m.profile35
-rw-r--r--etc/warzone2100.profile36
-rw-r--r--etc/waterfox.profile89
-rw-r--r--etc/weechat-curses.profile6
-rw-r--r--etc/wget.profile37
-rw-r--r--etc/whitelist-common.inc60
-rw-r--r--etc/whitelist-var-common.inc11
-rw-r--r--etc/wine.profile25
-rw-r--r--etc/wire.profile32
-rw-r--r--etc/wireshark-gtk.profile6
-rw-r--r--etc/wireshark-qt.profile6
-rw-r--r--etc/wireshark.profile36
-rw-r--r--etc/xed.profile40
-rw-r--r--etc/xiphos.profile40
-rw-r--r--etc/xmr-stak-cpu.profile42
-rw-r--r--etc/xonotic-sdl.profile6
-rw-r--r--etc/xonotic.profile39
-rw-r--r--etc/xpdf.profile33
-rw-r--r--etc/xplayer.profile32
-rw-r--r--etc/xreader.profile41
-rw-r--r--etc/xviewer.profile42
-rw-r--r--etc/xz.profile6
-rw-r--r--etc/xzdec.profile23
-rw-r--r--etc/yandex-browser.profile42
-rw-r--r--etc/youtube-dl.profile37
-rw-r--r--etc/zart.profile30
-rw-r--r--etc/zathura.profile33
-rw-r--r--etc/zoom.profile28
-rwxr-xr-xgcov.sh20
-rwxr-xr-xinstall.sh4
-rwxr-xr-xlinecnt.sh31
-rw-r--r--m4/ax_check_compile_flag.m474
-rwxr-xr-xmkasc.sh5
-rwxr-xr-xmkdeb.sh.in (renamed from mkdeb.sh)38
-rwxr-xr-xmketc.sh21
-rwxr-xr-xmkman.sh5
-rwxr-xr-xmkuid.sh17
-rw-r--r--platform/debian/conffiles417
-rw-r--r--platform/debian/control.amd64 (renamed from platform/debian/control)6
-rw-r--r--platform/debian/control.i38620
-rw-r--r--platform/debian/copyright4
-rw-r--r--platform/rpm/firejail.spec21
-rwxr-xr-xplatform/rpm/mkrpm.sh17
-rwxr-xr-xplatform/rpm/old-mkrpm.sh667
-rwxr-xr-xplatform/snap/snap.sh20
-rw-r--r--platform/snap/snapcraft.yaml20
-rw-r--r--src/bash_completion/Makefile.in17
-rw-r--r--src/bash_completion/firejail.bash_completion.in (renamed from src/bash_completion/firejail.bash_completion)19
-rw-r--r--src/common.mk.in53
-rw-r--r--src/faudit/Makefile.in25
-rw-r--r--src/faudit/caps.c78
-rw-r--r--src/faudit/dbus.c92
-rw-r--r--src/faudit/files.c75
-rw-r--r--src/faudit/main.c98
-rw-r--r--src/faudit/network.c101
-rw-r--r--src/faudit/pid.c99
-rw-r--r--src/faudit/seccomp.c101
-rw-r--r--src/faudit/syscall.c105
-rw-r--r--src/faudit/x11.c63
-rw-r--r--src/fbuilder/Makefile.in40
-rw-r--r--src/fbuilder/build_bin.c32
-rw-r--r--src/fbuilder/build_fs.c228
-rw-r--r--src/fbuilder/build_home.c66
-rw-r--r--src/fbuilder/build_profile.c209
-rw-r--r--src/fbuilder/build_seccomp.c101
-rw-r--r--src/fbuilder/fbuilder.h29
-rw-r--r--src/fbuilder/filedb.c62
-rw-r--r--src/fbuilder/main.c46
-rw-r--r--src/fbuilder/utils.c8
-rw-r--r--src/fcopy/Makefile.in44
-rw-r--r--src/fcopy/main.c194
-rwxr-xr-xsrc/fgit/fgit-install.sh4
-rw-r--r--src/fgit/fgit-uninstall.sh4
-rw-r--r--src/fids/Makefile.in18
-rw-r--r--src/fids/blake2b.c176
-rw-r--r--src/fids/config16
-rw-r--r--src/fids/db.c158
-rw-r--r--src/fids/db_exclude.c56
-rw-r--r--src/fids/fids.h51
-rw-r--r--src/fids/main.c371
-rw-r--r--src/firecfg/Makefile.in41
-rw-r--r--src/firecfg/desktop_files.c129
-rw-r--r--src/firecfg/firecfg.config590
-rw-r--r--src/firecfg/firecfg.h5
-rw-r--r--src/firecfg/main.c302
-rw-r--r--src/firecfg/sound.c10
-rw-r--r--src/firecfg/util.c14
-rw-r--r--src/firejail/Makefile.in46
-rw-r--r--src/firejail/appimage.c175
-rw-r--r--src/firejail/appimage_size.c58
-rw-r--r--src/firejail/arg-checking.txt84
-rw-r--r--src/firejail/arp.c42
-rw-r--r--src/firejail/bandwidth.c144
-rw-r--r--src/firejail/caps.c45
-rw-r--r--src/firejail/cgroup.c24
-rw-r--r--src/firejail/checkcfg.c363
-rw-r--r--src/firejail/chroot.c310
-rw-r--r--src/firejail/cmdline.c49
-rw-r--r--src/firejail/cpu.c36
-rw-r--r--src/firejail/dbus.c548
-rw-r--r--src/firejail/dhcp.c184
-rw-r--r--src/firejail/env.c175
-rw-r--r--src/firejail/firejail.h470
-rw-r--r--src/firejail/fs.c1174
-rw-r--r--src/firejail/fs_bin.c201
-rw-r--r--src/firejail/fs_dev.c201
-rw-r--r--src/firejail/fs_etc.c238
-rw-r--r--src/firejail/fs_home.c437
-rw-r--r--src/firejail/fs_hostname.c49
-rw-r--r--src/firejail/fs_lib.c579
-rw-r--r--src/firejail/fs_lib2.c356
-rw-r--r--src/firejail/fs_logger.c42
-rw-r--r--src/firejail/fs_mkdir.c48
-rw-r--r--src/firejail/fs_trace.c53
-rw-r--r--src/firejail/fs_var.c58
-rw-r--r--src/firejail/fs_whitelist.c1220
-rw-r--r--src/firejail/git.c90
-rw-r--r--src/firejail/ids.c89
-rw-r--r--src/firejail/join.c420
-rw-r--r--src/firejail/ls.c302
-rw-r--r--src/firejail/macros.c325
-rw-r--r--src/firejail/main.c1953
-rw-r--r--src/firejail/mountinfo.c281
-rw-r--r--src/firejail/netfilter.c131
-rw-r--r--src/firejail/netns.c6
-rw-r--r--src/firejail/network.c49
-rw-r--r--src/firejail/network.txt95
-rw-r--r--src/firejail/network_main.c164
-rw-r--r--src/firejail/no_sandbox.c101
-rw-r--r--src/firejail/output.c122
-rw-r--r--src/firejail/paths.c21
-rw-r--r--src/firejail/preproc.c101
-rw-r--r--src/firejail/profile.c1146
-rw-r--r--src/firejail/protocol.c38
-rw-r--r--src/firejail/pulseaudio.c202
-rw-r--r--src/firejail/restrict_users.c132
-rw-r--r--src/firejail/restricted_shell.c6
-rw-r--r--src/firejail/rlimit.c75
-rw-r--r--src/firejail/run_files.c154
-rw-r--r--src/firejail/run_symlink.c81
-rw-r--r--src/firejail/sandbox.c703
-rw-r--r--src/firejail/sbox.c352
-rw-r--r--src/firejail/seccomp.c302
-rw-r--r--src/firejail/selinux.c80
-rw-r--r--src/firejail/shutdown.c49
-rw-r--r--src/firejail/usage.c468
-rw-r--r--src/firejail/util.c1015
-rw-r--r--src/firejail/x11.c509
-rw-r--r--src/firemon/Makefile.in27
-rw-r--r--src/firemon/apparmor.c63
-rw-r--r--src/firemon/arp.c6
-rw-r--r--src/firemon/caps.c4
-rw-r--r--src/firemon/cgroup.c4
-rw-r--r--src/firemon/cpu.c4
-rw-r--r--src/firemon/firemon.c74
-rw-r--r--src/firemon/firemon.h17
-rw-r--r--src/firemon/interface.c11
-rw-r--r--src/firemon/list.c6
-rw-r--r--src/firemon/netstats.c8
-rw-r--r--src/firemon/procevent.c95
-rw-r--r--src/firemon/route.c10
-rw-r--r--src/firemon/seccomp.c4
-rw-r--r--src/firemon/top.c12
-rw-r--r--src/firemon/tree.c6
-rw-r--r--src/firemon/usage.c114
-rw-r--r--src/firemon/x11.c4
-rw-r--r--src/fldd/Makefile.in46
-rw-r--r--src/fldd/main.c83
-rw-r--r--src/floader/README.md7
-rw-r--r--src/floader/loader.c161
-rw-r--r--src/floader/makefile5
-rw-r--r--src/fnet/Makefile.in44
-rw-r--r--src/fnet/arp.c14
-rw-r--r--src/fnet/fnet.h8
-rw-r--r--src/fnet/interface.c150
-rw-r--r--src/fnet/main.c66
-rw-r--r--src/fnet/veth.c73
-rw-r--r--src/fnetfilter/Makefile.in17
-rw-r--r--src/fnetfilter/main.c212
-rw-r--r--src/fsec-optimize/Makefile.in17
-rw-r--r--src/fsec-optimize/fsec_optimize.h30
-rw-r--r--src/fsec-optimize/main.c114
-rw-r--r--src/fsec-optimize/optimizer.c135
-rw-r--r--src/fsec-print/Makefile.in17
-rw-r--r--src/fsec-print/fsec_print.h (renamed from src/libpostexecseccomp/libpostexecseccomp.h)13
-rw-r--r--src/fsec-print/main.c101
-rw-r--r--src/fsec-print/print.c332
-rw-r--r--src/fseccomp/Makefile.in44
-rw-r--r--src/fseccomp/fseccomp.h34
-rw-r--r--src/fseccomp/main.c74
-rw-r--r--src/fseccomp/protocol.c72
-rw-r--r--src/fseccomp/seccomp.c177
-rw-r--r--src/fseccomp/seccomp_file.c90
-rw-r--r--src/fseccomp/seccomp_print.c183
-rw-r--r--src/fseccomp/seccomp_secondary.c71
-rw-r--r--src/fseccomp/syscall.c590
-rwxr-xr-xsrc/fshaper/fshaper.sh37
-rw-r--r--src/ftee/Makefile.in24
-rw-r--r--src/ftee/ftee.h2
-rw-r--r--src/ftee/main.c2
-rw-r--r--src/include/common.h27
-rw-r--r--src/include/euid_common.h2
-rw-r--r--src/include/firejail_user.h32
-rw-r--r--src/include/gcov_wrapper.h46
-rw-r--r--src/include/ldd_utils.h46
-rw-r--r--src/include/libnetlink.h4
-rw-r--r--src/include/pid.h2
-rw-r--r--src/include/rundefs.h101
-rw-r--r--src/include/seccomp.h65
-rw-r--r--src/include/syscall.h5151
-rw-r--r--src/include/syscall_armeabi.h355
-rw-r--r--src/include/syscall_i386.h426
-rw-r--r--src/include/syscall_x86_64.h348
-rw-r--r--src/jailcheck/Makefile.in17
-rw-r--r--src/jailcheck/access.c143
-rw-r--r--src/jailcheck/apparmor.c40
-rw-r--r--src/jailcheck/jailcheck.h64
-rw-r--r--src/jailcheck/main.c215
-rw-r--r--src/jailcheck/network.c56
-rw-r--r--src/jailcheck/noexec.c113
-rw-r--r--src/jailcheck/seccomp.c (renamed from src/faudit/dev.c)46
-rw-r--r--src/jailcheck/sysfiles.c88
-rw-r--r--src/jailcheck/utils.c102
-rw-r--r--src/jailcheck/virtual.c125
-rw-r--r--src/lib/Makefile.in22
-rw-r--r--src/lib/common.c92
-rw-r--r--src/lib/errno.c (renamed from src/fseccomp/errno.c)8
-rw-r--r--src/lib/firejail_user.c192
-rw-r--r--src/lib/ldd_utils.c65
-rw-r--r--src/lib/libnetlink.c4
-rw-r--r--src/lib/pid.c62
-rw-r--r--src/lib/syscall.c1692
-rw-r--r--src/libpostexecseccomp/Makefile.in12
-rw-r--r--src/libpostexecseccomp/libpostexecseccomp.c24
-rw-r--r--src/libtrace/Makefile.in10
-rw-r--r--src/libtrace/libtrace.c212
-rw-r--r--src/libtracelog/Makefile.in12
-rw-r--r--src/libtracelog/libtracelog.c23
-rw-r--r--src/man/Makefile.in14
-rw-r--r--src/man/firecfg.txt44
-rw-r--r--src/man/firejail-login.txt22
-rw-r--r--src/man/firejail-profile.txt607
-rw-r--r--src/man/firejail-users.txt62
-rw-r--r--src/man/firejail.txt1758
-rw-r--r--src/man/firemon.txt53
-rw-r--r--src/man/jailcheck.txt117
-rwxr-xr-xsrc/man/preproc.awk55
-rw-r--r--src/profstats/Makefile.in17
-rw-r--r--src/profstats/main.c378
-rwxr-xr-xsrc/tools/check-caps.sh3
-rw-r--r--src/tools/config-4.4.0-1-grsec-amd647430
-rw-r--r--src/tools/extract_caps.c3
-rw-r--r--src/tools/extract_errnos.sh5
-rw-r--r--src/tools/extract_seccomp.c115
-rw-r--r--src/tools/extract_syscalls.c2
-rw-r--r--src/tools/grsec.conf98
-rwxr-xr-xsrc/tools/mkcoverit.sh3
-rw-r--r--src/tools/profcleaner.c75
-rwxr-xr-xsrc/tools/profcleaner.sh45
-rw-r--r--src/tools/rvtest.c144
-rw-r--r--src/tools/testuid.c (renamed from src/faudit/faudit.h)59
-rw-r--r--src/tools/ttytest.c20
-rw-r--r--src/tools/unixsocket.c20
-rw-r--r--src/zsh_completion/Makefile.in17
-rw-r--r--src/zsh_completion/_firejail.in286
-rw-r--r--test/Makefile.in14
-rwxr-xr-xtest/appimage/appimage-args.exp10
-rwxr-xr-xtest/appimage/appimage-trace.exp (renamed from test/tty.exp)82
-rwxr-xr-xtest/appimage/appimage-v1.exp10
-rwxr-xr-xtest/appimage/appimage-v2.exp6
-rwxr-xr-xtest/appimage/appimage.sh6
-rwxr-xr-xtest/appimage/filename.exp4
-rwxr-xr-xtest/apps-x11-xorg/apps-x11-xorg.sh18
-rwxr-xr-xtest/apps-x11-xorg/firefox.exp6
-rwxr-xr-xtest/apps-x11-xorg/thunderbird.exp6
-rwxr-xr-xtest/apps-x11-xorg/transmission-gtk.exp6
-rwxr-xr-xtest/apps-x11-xorg/transmission-qt.exp85
-rwxr-xr-xtest/apps-x11/apps-x11.sh21
-rwxr-xr-xtest/apps-x11/chromium.exp2
-rwxr-xr-xtest/apps-x11/firefox.exp2
-rwxr-xr-xtest/apps-x11/thunderbird.exp2
-rwxr-xr-xtest/apps-x11/transmission-gtk.exp2
-rwxr-xr-xtest/apps-x11/x11-none.exp2
-rwxr-xr-xtest/apps-x11/x11-xephyr.exp2
-rwxr-xr-xtest/apps-x11/xterm-xephyr.exp2
-rwxr-xr-xtest/apps-x11/xterm-xorg.exp2
-rwxr-xr-xtest/apps-x11/xterm-xpra.exp2
-rwxr-xr-xtest/apps/apps.sh189
-rwxr-xr-xtest/apps/chromium.exp2
-rwxr-xr-xtest/apps/deluge.exp2
-rwxr-xr-xtest/apps/fbreader.exp2
-rwxr-xr-xtest/apps/filezilla.exp2
-rwxr-xr-xtest/apps/firefox.exp2
-rwxr-xr-xtest/apps/gnome-mplayer.exp2
-rwxr-xr-xtest/apps/gthumb.exp2
-rwxr-xr-xtest/apps/hexchat.exp8
-rwxr-xr-xtest/apps/kcalc.exp83
-rwxr-xr-xtest/apps/ktorrent.exp83
-rwxr-xr-xtest/apps/midori.exp2
-rwxr-xr-xtest/apps/opera.exp2
-rwxr-xr-xtest/apps/qbittorrent.exp2
-rwxr-xr-xtest/apps/thunderbird.exp2
-rwxr-xr-xtest/apps/transmission-qt.exp8
-rwxr-xr-xtest/apps/uget-gtk.exp2
-rwxr-xr-xtest/apps/vlc.exp2
-rwxr-xr-xtest/apps/wine.exp2
-rwxr-xr-xtest/apps/xchat.exp2
-rwxr-xr-xtest/arguments/arguments.sh27
-rwxr-xr-xtest/arguments/bashrun.exp86
-rwxr-xr-xtest/arguments/bashrun.sh22
-rwxr-xr-xtest/arguments/joinrun.exp89
-rwxr-xr-xtest/arguments/joinrun.sh22
-rwxr-xr-xtest/arguments/outrun.exp90
-rwxr-xr-xtest/arguments/outrun.sh22
-rwxr-xr-xtest/arguments/symrun.exp71
-rwxr-xr-xtest/arguments/symrun.sh31
-rwxr-xr-xtest/blacklist-link.exp82
-rwxr-xr-xtest/blacklist.exp75
-rw-r--r--test/blacklist1.profile1
-rw-r--r--test/blacklist2.profile1
-rw-r--r--test/blacklist3.profile1
-rwxr-xr-xtest/chk_config.exp85
-rwxr-xr-xtest/chroot/chroot.sh3
-rwxr-xr-xtest/chroot/configure3
-rwxr-xr-xtest/chroot/fs_chroot.exp3
-rwxr-xr-xtest/chroot/unchroot-as-root.exp3
-rw-r--r--test/chroot/unchroot.c4
-rwxr-xr-xtest/compile/compile.sh111
-rwxr-xr-xtest/configure69
-rwxr-xr-xtest/environment/allow-debuggers.exp28
-rwxr-xr-xtest/environment/csh.exp21
-rwxr-xr-xtest/environment/dash.exp3
-rwxr-xr-xtest/environment/deterministic-exit-code.exp55
-rwxr-xr-xtest/environment/dns.exp83
-rw-r--r--test/environment/dns.profile1
-rwxr-xr-xtest/environment/doubledash.exp3
-rwxr-xr-xtest/environment/env.exp2
-rwxr-xr-xtest/environment/environment.sh32
-rwxr-xr-xtest/environment/extract_command.exp3
-rwxr-xr-xtest/environment/firejail-in-firejail.exp22
-rwxr-xr-xtest/environment/hostfile.exp2
-rwxr-xr-xtest/environment/ibus.exp3
-rwxr-xr-xtest/environment/machineid.exp2
-rwxr-xr-xtest/environment/nice.exp32
-rwxr-xr-xtest/environment/output.exp3
-rwxr-xr-xtest/environment/output.sh3
-rwxr-xr-xtest/environment/quiet.exp5
-rwxr-xr-xtest/environment/rlimit-bad-profile.exp5
-rwxr-xr-xtest/environment/rlimit-bad.exp5
-rwxr-xr-xtest/environment/rlimit-join.exp36
-rwxr-xr-xtest/environment/rlimit-profile.exp7
-rwxr-xr-xtest/environment/rlimit.exp11
-rw-r--r--test/environment/rlimit.profile7
-rwxr-xr-xtest/environment/shell-none.exp2
-rwxr-xr-xtest/environment/sound.exp2
-rwxr-xr-xtest/environment/timeout.exp31
-rwxr-xr-xtest/environment/umask.exp (renamed from test/fs_home_sanitize.exp)28
-rwxr-xr-xtest/environment/zsh.exp17
-rwxr-xr-xtest/fcopy/cmdline.exp2
-rwxr-xr-xtest/fcopy/dircopy.exp4
-rwxr-xr-xtest/fcopy/fcopy.sh8
-rwxr-xr-xtest/fcopy/filecopy.exp4
-rwxr-xr-xtest/fcopy/linkcopy.exp4
-rwxr-xr-xtest/fcopy/trailing.exp25
-rwxr-xr-xtest/features/1.1.exp3
-rwxr-xr-xtest/features/1.10.exp3
-rwxr-xr-xtest/features/1.2.exp3
-rwxr-xr-xtest/features/1.4.exp3
-rwxr-xr-xtest/features/1.5.exp3
-rwxr-xr-xtest/features/1.6.exp3
-rwxr-xr-xtest/features/1.7.exp3
-rwxr-xr-xtest/features/1.8.exp3
-rwxr-xr-xtest/features/2.1.exp3
-rwxr-xr-xtest/features/2.2.exp3
-rwxr-xr-xtest/features/2.3.exp3
-rwxr-xr-xtest/features/2.4.exp3
-rwxr-xr-xtest/features/2.5.exp3
-rwxr-xr-xtest/features/2.6.exp3
-rwxr-xr-xtest/features/3.1.exp3
-rwxr-xr-xtest/features/3.10.exp3
-rwxr-xr-xtest/features/3.11.exp3
-rwxr-xr-xtest/features/3.2.exp3
-rwxr-xr-xtest/features/3.3.exp3
-rwxr-xr-xtest/features/3.4.exp3
-rwxr-xr-xtest/features/3.5.exp3
-rwxr-xr-xtest/features/3.6.exp3
-rwxr-xr-xtest/features/3.7.exp3
-rwxr-xr-xtest/features/3.8.exp3
-rwxr-xr-xtest/features/3.9.exp3
-rwxr-xr-xtest/features/test.sh5
-rwxr-xr-xtest/filters/apparmor.exp59
-rwxr-xr-xtest/filters/caps-join.exp96
-rwxr-xr-xtest/filters/caps-print.exp2
-rwxr-xr-xtest/filters/caps.exp2
-rwxr-xr-xtest/filters/debug.exp2
-rwxr-xr-xtest/filters/filters.sh43
-rwxr-xr-xtest/filters/fseccomp.exp63
-rwxr-xr-xtest/filters/memwrexebin13168 -> 17096 bytes
-rwxr-xr-xtest/filters/memwrexe-32.exp14
-rw-r--r--test/filters/memwrexe.c35
-rwxr-xr-xtest/filters/memwrexe.exp14
-rwxr-xr-xtest/filters/noroot.exp130
-rwxr-xr-xtest/filters/protocol.exp2
-rwxr-xr-xtest/filters/seccomp-bad-empty.exp2
-rwxr-xr-xtest/filters/seccomp-chmod-profile.exp8
-rwxr-xr-xtest/filters/seccomp-chmod.exp8
-rwxr-xr-xtest/filters/seccomp-chown.exp2
-rwxr-xr-xtest/filters/seccomp-debug-32.exp5
-rwxr-xr-xtest/filters/seccomp-debug.exp57
-rwxr-xr-xtest/filters/seccomp-dualfilter.exp2
-rwxr-xr-xtest/filters/seccomp-empty.exp36
-rwxr-xr-xtest/filters/seccomp-errno.exp14
-rwxr-xr-xtest/filters/seccomp-join.exp159
-rwxr-xr-xtest/filters/seccomp-numeric.exp44
-rwxr-xr-xtest/filters/seccomp-postexec.exp33
-rwxr-xr-xtest/filters/seccomp-ptrace.exp2
-rwxr-xr-xtest/filters/seccomp-run-files.exp98
-rwxr-xr-xtest/filters/seccomp-su.exp9
-rw-r--r--test/filters/syscall_test.c4
-rwxr-xr-xtest/firemon-cgroup.exp39
-rwxr-xr-xtest/fnetfilter/cmdline.exp37
-rwxr-xr-xtest/fnetfilter/copy.exp (renamed from test/environment/firejail-in-firejail2.exp)47
-rwxr-xr-xtest/fnetfilter/default.exp40
-rwxr-xr-xtest/fnetfilter/fnetfilter.sh31
-rw-r--r--test/fnetfilter/outlocked (renamed from test/fs/testdir1/.directory/file)0
-rwxr-xr-xtest/fnetfilter/template.exp82
-rw-r--r--test/fnetfilter/test1.net18
-rw-r--r--test/fnetfilter/test2.net18
-rw-r--r--test/fnetfilter/test3.net1
-rwxr-xr-xtest/fs/fs.sh99
-rwxr-xr-xtest/fs/fs_dev_shm.exp27
-rwxr-xr-xtest/fs/fs_var_lock.exp10
-rwxr-xr-xtest/fs/fs_var_tmp.exp26
-rwxr-xr-xtest/fs/fscheck-bindnoroot.exp3
-rwxr-xr-xtest/fs/fscheck-private.exp3
-rwxr-xr-xtest/fs/fscheck-readonly.exp3
-rwxr-xr-xtest/fs/fscheck-tmpfs.exp50
-rwxr-xr-xtest/fs/invalid_filename.exp81
-rwxr-xr-xtest/fs/kmsg.exp2
-rw-r--r--test/fs/macro-blacklist.profile6
-rw-r--r--test/fs/macro-readonly.profile6
-rw-r--r--test/fs/macro-whitelist.profile6
-rwxr-xr-xtest/fs/macro.exp174
-rwxr-xr-xtest/fs/mkdir.exp40
-rw-r--r--test/fs/mkdir.profile8
-rwxr-xr-xtest/fs/mkdir_mkfile.exp16
-rwxr-xr-xtest/fs/noblacklist-blacklist-noexec.exp36
-rwxr-xr-xtest/fs/noblacklist-blacklist-readonly.exp (renamed from test/option_readonly.exp)20
-rwxr-xr-xtest/fs/option_bind_user.exp3
-rwxr-xr-xtest/fs/option_blacklist.exp7
-rwxr-xr-xtest/fs/option_blacklist_file.exp28
-rwxr-xr-xtest/fs/option_blacklist_glob.exp27
-rwxr-xr-xtest/fs/private-bin.exp12
-rwxr-xr-xtest/fs/private-cache.exp42
-rwxr-xr-xtest/fs/private-cwd.exp52
-rwxr-xr-xtest/fs/private-etc-empty.exp2
-rwxr-xr-xtest/fs/private-etc.exp7
-rwxr-xr-xtest/fs/private-home-dir.exp45
-rwxr-xr-xtest/fs/private-home.exp15
-rwxr-xr-xtest/fs/private-homedir.exp2
-rwxr-xr-xtest/fs/private-lib.exp18
-rwxr-xr-xtest/fs/private-whitelist.exp2
-rwxr-xr-xtest/fs/private.exp2
-rwxr-xr-xtest/fs/read-write.exp15
-rwxr-xr-xtest/fs/sys_fs.exp2
-rw-r--r--test/fs/testdir1/.file0
-rw-r--r--test/fs/testfile10
-rw-r--r--test/fs/user-dirs.dirs15
-rwxr-xr-xtest/fs/whitelist-dev.exp22
-rwxr-xr-xtest/fs/whitelist-double.exp12
-rwxr-xr-xtest/fs/whitelist-downloads.exp48
-rwxr-xr-xtest/fs/whitelist-empty.exp2
-rwxr-xr-xtest/fs/whitelist-noexec.exp36
-rwxr-xr-xtest/fs/whitelist-readonly.exp38
-rwxr-xr-xtest/fs/whitelist-whitespace.exp37
-rwxr-xr-xtest/fs/whitelist.exp68
-rwxr-xr-xtest/fs_chroot_asroot.exp90
-rwxr-xr-xtest/fs_sys.exp33
-rwxr-xr-xtest/fscheck-blacklist.exp13
-rwxr-xr-xtest/fscheck-chroot.exp77
-rwxr-xr-xtest/fscheck-netfilter.exp69
-rwxr-xr-xtest/fscheck-output.exp104
-rwxr-xr-xtest/fscheck-privatekeep.exp93
-rwxr-xr-xtest/fscheck-profile.exp69
-rwxr-xr-xtest/fscheck-shell.exp69
-rwxr-xr-xtest/fscheck.sh39
-rw-r--r--test/hidepid-howto25
-rwxr-xr-xtest/login_ssh.exp59
-rwxr-xr-xtest/network/4bridges_arp.exp2
-rwxr-xr-xtest/network/4bridges_ip.exp2
-rw-r--r--test/network/README2
-rwxr-xr-xtest/network/bandwidth.exp7
-rwxr-xr-xtest/network/configure4
-rwxr-xr-xtest/network/dns-print.exp3
-rwxr-xr-xtest/network/firemon-arp.exp3
-rwxr-xr-xtest/network/firemon-interfaces.exp2
-rwxr-xr-xtest/network/firemon-route.exp3
-rwxr-xr-xtest/network/hostname.exp4
-rwxr-xr-xtest/network/interface.exp3
-rwxr-xr-xtest/network/ip6.exp18
-rwxr-xr-xtest/network/iprange.exp10
-rwxr-xr-xtest/network/net_arp.exp2
-rwxr-xr-xtest/network/net_badip.exp2
-rwxr-xr-xtest/network/net_defaultgw.exp2
-rwxr-xr-xtest/network/net_defaultgw2.exp2
-rwxr-xr-xtest/network/net_defaultgw3.exp2
-rwxr-xr-xtest/network/net_ip.exp2
-rwxr-xr-xtest/network/net_local.exp2
-rwxr-xr-xtest/network/net_mac.exp2
-rwxr-xr-xtest/network/net_macvlan2.exp2
-rwxr-xr-xtest/network/net_mtu.exp2
-rwxr-xr-xtest/network/net_netfilter.exp8
-rwxr-xr-xtest/network/net_noip.exp6
-rwxr-xr-xtest/network/net_noip2.exp5
-rwxr-xr-xtest/network/net_none.exp5
-rwxr-xr-xtest/network/net_profile.exp2
-rwxr-xr-xtest/network/net_scan.exp2
-rwxr-xr-xtest/network/net_unconfigured.exp244
-rwxr-xr-xtest/network/net_veth.exp2
-rwxr-xr-xtest/network/netfilter-template.exp67
-rwxr-xr-xtest/network/netns.exp2
-rwxr-xr-xtest/network/netstats.exp2
-rwxr-xr-xtest/network/network.sh12
-rw-r--r--test/network/tcpserver.c108
-rwxr-xr-xtest/network/veth-name.exp2
-rwxr-xr-xtest/option_chroot_overlay.exp22
-rwxr-xr-xtest/overlay/firefox-x11-xorg.exp2
-rwxr-xr-xtest/overlay/firefox-x11.exp2
-rwxr-xr-xtest/overlay/firefox.exp2
-rwxr-xr-xtest/overlay/fs-named.exp7
-rwxr-xr-xtest/overlay/fs-tmpfs.exp9
-rwxr-xr-xtest/overlay/fs.exp9
-rwxr-xr-xtest/overlay/overlay.sh13
-rw-r--r--test/private-keep.profile1
-rwxr-xr-xtest/private-lib/atril.exp83
-rwxr-xr-xtest/private-lib/dig.exp17
-rwxr-xr-xtest/private-lib/eog.exp83
-rwxr-xr-xtest/private-lib/eom.exp83
-rwxr-xr-xtest/private-lib/evince.exp (renamed from test/apps/evince.exp)2
-rwxr-xr-xtest/private-lib/galculator.exp83
-rwxr-xr-xtest/private-lib/gedit.exp83
-rwxr-xr-xtest/private-lib/gnome-calculator.exp85
-rwxr-xr-xtest/private-lib/gnome-logs.exp83
-rwxr-xr-xtest/private-lib/gnome-nettool.exp84
-rwxr-xr-xtest/private-lib/gnome-system-log.exp83
-rwxr-xr-xtest/private-lib/gpicview.exp83
-rwxr-xr-xtest/private-lib/leafpad.exp83
-rwxr-xr-xtest/private-lib/mousepad.exp83
-rwxr-xr-xtest/private-lib/pavucontrol.exp83
-rwxr-xr-xtest/private-lib/pluma.exp83
-rwxr-xr-xtest/private-lib/private-lib.sh22
-rwxr-xr-xtest/private-lib/transmission-gtk.exp (renamed from test/apps/transmission-gtk.exp)17
-rwxr-xr-xtest/private-lib/whois.exp17
-rwxr-xr-xtest/private-lib/xcalc.exp83
-rw-r--r--test/private.profile1
-rwxr-xr-xtest/private_dir.exp53
-rwxr-xr-xtest/private_dir_profile.exp53
-rw-r--r--test/profiles/comment.profile3
-rw-r--r--test/profiles/cond1.profile1
-rw-r--r--test/profiles/cond2.profile1
-rw-r--r--test/profiles/cond3.profile1
-rwxr-xr-xtest/profiles/conditional.exp47
-rwxr-xr-xtest/profiles/ignore.exp45
-rw-r--r--test/profiles/ignore2.profile2
-rw-r--r--test/profiles/ignore3.profile4
-rwxr-xr-xtest/profiles/profile_appname.exp25
-rwxr-xr-xtest/profiles/profile_comment.exp52
-rwxr-xr-xtest/profiles/profile_followlnk.exp3
-rwxr-xr-xtest/profiles/profile_noperm.exp5
-rwxr-xr-xtest/profiles/profile_readonly.exp3
-rwxr-xr-xtest/profiles/profile_recursivity.exp25
-rwxr-xr-xtest/profiles/profile_syntax.exp4
-rwxr-xr-xtest/profiles/profile_syntax2.exp33
-rwxr-xr-xtest/profiles/profiles.sh36
-rwxr-xr-xtest/profiles/test-profile.exp9
-rw-r--r--test/profiles/test.profile6
-rw-r--r--test/profiles/test2.profile4
-rw-r--r--test/profiles/test3.profile1
-rwxr-xr-xtest/root/apache2.exp9
-rwxr-xr-xtest/root/cgroup.exp2
-rwxr-xr-xtest/root/checkcfg.exp4
-rwxr-xr-xtest/root/firecfg.exp18
-rwxr-xr-xtest/root/firemon-events.exp3
-rwxr-xr-xtest/root/git.exp51
-rwxr-xr-xtest/root/isc-dhcp.exp3
-rwxr-xr-xtest/root/join.exp2
-rwxr-xr-xtest/root/login_nobody.exp35
-rwxr-xr-xtest/root/nginx.exp9
-rwxr-xr-xtest/root/option_bind_directory.exp3
-rwxr-xr-xtest/root/option_bind_file.exp3
-rwxr-xr-xtest/root/option_tmpfs.exp4
-rwxr-xr-xtest/root/private.exp39
-rwxr-xr-xtest/root/profile_tmpfs.exp3
-rwxr-xr-xtest/root/root.sh34
-rwxr-xr-xtest/root/seccomp-chmod.exp4
-rwxr-xr-xtest/root/seccomp-chown.exp4
-rwxr-xr-xtest/root/seccomp-umount.exp2
-rwxr-xr-xtest/root/snmpd.exp3
-rwxr-xr-xtest/root/unbound.exp3
-rwxr-xr-xtest/root/whitelist.exp2
-rwxr-xr-xtest/ssh/login.exp52
-rwxr-xr-xtest/ssh/scp.exp66
-rwxr-xr-xtest/ssh/sftp.exp90
-rwxr-xr-xtest/ssh/ssh.sh17
-rwxr-xr-xtest/stress/blacklist.exp2
-rwxr-xr-xtest/stress/env.exp2
-rwxr-xr-xtest/stress/net_macvlan.exp2
-rwxr-xr-xtest/stress/stress.sh3
-rwxr-xr-xtest/sysutils/cpio.exp2
-rwxr-xr-xtest/sysutils/file.exp2
-rwxr-xr-xtest/sysutils/gzip.exp2
-rwxr-xr-xtest/sysutils/less.exp3
-rwxr-xr-xtest/sysutils/ping.exp23
-rwxr-xr-xtest/sysutils/strings.exp2
-rwxr-xr-xtest/sysutils/sysutils.sh26
-rwxr-xr-xtest/sysutils/tar.exp2
-rwxr-xr-xtest/sysutils/xz.exp7
-rwxr-xr-xtest/sysutils/xzdec.exp2
-rw-r--r--test/test.rv49
-rwxr-xr-xtest/test.sh69
-rwxr-xr-xtest/utils/audit.exp79
-rwxr-xr-xtest/utils/build.exp112
-rwxr-xr-xtest/utils/caps-print.exp2
-rw-r--r--test/utils/caps2.profile2
-rwxr-xr-xtest/utils/catchsignal-master.sh3
-rwxr-xr-xtest/utils/catchsignal.sh3
-rwxr-xr-xtest/utils/catchsignal2.sh3
-rwxr-xr-xtest/utils/command.exp23
-rwxr-xr-xtest/utils/cpu-print.exp18
-rwxr-xr-xtest/utils/dns-print.exp8
-rwxr-xr-xtest/utils/firemon-caps.exp2
-rwxr-xr-xtest/utils/firemon-cgroup.exp2
-rwxr-xr-xtest/utils/firemon-cpu.exp2
-rwxr-xr-xtest/utils/firemon-interface.exp2
-rwxr-xr-xtest/utils/firemon-name.exp2
-rwxr-xr-xtest/utils/firemon-seccomp.exp2
-rwxr-xr-xtest/utils/firemon-version.exp2
-rwxr-xr-xtest/utils/fs-print.exp7
-rwxr-xr-xtest/utils/help.exp2
-rwxr-xr-xtest/utils/join-profile.exp3
-rwxr-xr-xtest/utils/join.exp2
-rwxr-xr-xtest/utils/join2.exp2
-rwxr-xr-xtest/utils/join3.exp2
-rwxr-xr-xtest/utils/join4.exp2
-rwxr-xr-xtest/utils/join5.exp46
-rw-r--r--test/utils/join5.profile4
-rwxr-xr-xtest/utils/list.exp2
-rwxr-xr-xtest/utils/ls.exp3
-rwxr-xr-xtest/utils/man.exp3
-rwxr-xr-xtest/utils/name.exp157
-rwxr-xr-xtest/utils/profile_print.exp27
-rwxr-xr-xtest/utils/protocol-print.exp2
-rwxr-xr-xtest/utils/seccomp-print.exp10
-rwxr-xr-xtest/utils/shutdown.exp16
-rwxr-xr-xtest/utils/shutdown2.exp2
-rwxr-xr-xtest/utils/shutdown3.exp2
-rwxr-xr-xtest/utils/shutdown4.exp2
-rwxr-xr-xtest/utils/top.exp2
-rwxr-xr-xtest/utils/trace.exp2
-rwxr-xr-xtest/utils/tree.exp2
-rwxr-xr-xtest/utils/utils.sh47
-rwxr-xr-xtest/utils/version.exp2
-rw-r--r--video.pngbin41252 -> 0 bytes
2228 files changed, 74156 insertions, 39932 deletions
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 000000000..0c9701d1c
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,4 @@
1# move whitelist/blacklist to allow/deny
2fe0f975f447d59977d90c3226cc8c623b31b20b3
3# Revert "move whitelist/blacklist to allow/deny"
4f43382f1e9707b4fd5e63c7bfe881912aa4ee994
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..0f13afc51
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,77 @@
1---
2name: Bug report
3about: Create a report to help us improve
4title: ''
5labels: ''
6assignees: ''
7
8---
9
10### Description
11
12_Describe the bug_
13
14### Steps to Reproduce
15
16_Steps to reproduce the behavior_
17
181. Run in bash `LANG=C firejail PROGRAM` (`LANG=C` to get English messages that can be understood by everybody)
192. Click on '....'
203. Scroll down to '....'
214. See error `ERROR`
22
23### Expected behavior
24
25_What you expected to happen_
26
27### Actual behavior
28
29_What actually happened_
30
31### Behavior without a profile
32
33_What changed calling `firejail --noprofile /path/to/program` in a terminal?_
34
35### Additional context
36
37_Any other detail that may help to understand/debug the problem_
38
39### Environment
40
41- Linux distribution and version (e.g. "Ubuntu 20.04" or "Arch Linux")
42- Firejail version (`firejail --version`).
43- If you use a development version of firejail, also the commit from which it was compiled (`git rev-parse HEAD`).
44
45### Checklist
46
47- [ ] The issues is caused by firejail (i.e. running the program by path (e.g. `/usr/bin/vlc`) "fixes" it).
48- [ ] I can reproduce the issue without custom modifications (e.g. globals.local).
49- [ ] The program has a profile. (If not, request one in `https://github.com/netblue30/firejail/issues/1139`)
50- [ ] The profile (and redirect profile if exists) hasn't already been fixed [upstream](https://github.com/netblue30/firejail/tree/master/etc).
51- [ ] I have performed a short search for similar issues (to avoid opening a duplicate).
52 - [ ] I'm aware of `browser-allow-drm yes`/`browser-disable-u2f no` in `firejail.config` to allow DRM/U2F in browsers.
53- [ ] I used `--profile=PROFILENAME` to set the right profile. (Only relevant for AppImages)
54
55### Log
56
57<details>
58<summary>Output of <code>firejail /path/to/program</code></summary>
59<p>
60
61```
62output goes here
63```
64
65</p>
66</details>
67
68<details>
69<summary>Output of <code>firejail --debug /path/to/program</code></summary>
70<p>
71
72```
73output goes here
74```
75
76</p>
77</details>
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..b8fe40acd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
1blank_issues_enabled: true
2contact_links:
3 - name: Question
4 url: https://github.com/netblue30/firejail/discussions
5 about: For questions you should use GitHub Discussions.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..a723cdbde
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,23 @@
1---
2name: Feature request
3about: Suggest an idea for this project
4title: ''
5labels: ''
6assignees: ''
7---
8
9### Is your feature request related to a problem? Please describe.
10
11_A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]_
12
13### Describe the solution you'd like
14
15_A clear and concise description of what you want to happen._
16
17### Describe alternatives you've considered
18
19_A clear and concise description of any alternative solutions or features you've considered._
20
21### Additional context
22
23_Add any other context or screenshots about the feature request here._
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 000000000..57ac2e9c4
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,18 @@
1
2If your PR isn't about profiles or you have no idea how to do one of these, skip the following and go ahead with this PR.
3
4If you submit a PR for new profiles or changing profiles, please do the following:
5 - The ordering of options follow the rules described in [/usr/share/doc/firejail/profile.template](https://github.com/netblue30/firejail/blob/master/etc/templates/profile.template).
6 > Hint: The profile-template is very new. If you install firejail with your package manager, it may be missing. In order to follow the latest rules, it is recommended to use the template from the repository.
7 - Order the arguments of options alphabetically. You can easily do this with [sort.py](https://github.com/netblue30/firejail/tree/master/contrib/sort.py).
8 The path to it depends on your distro:
9
10 | Distro | Path |
11 | ------ | ---- |
12 | Arch/Fedora | `/usr/lib64/firejail/sort.py` |
13 | Debian/Ubuntu/Mint | `/usr/lib/x86_64-linux-gnu/firejail/sort.py` |
14 | local git clone | `contrib/sort.py` |
15
16 Note also that the sort.py script exists only since firejail `0.9.61`.
17
18See also [CONTRIBUTING.md](/CONTRIBUTING.md).
diff --git a/.github/workflows/build-extra.yml b/.github/workflows/build-extra.yml
new file mode 100644
index 000000000..fd1f23954
--- /dev/null
+++ b/.github/workflows/build-extra.yml
@@ -0,0 +1,55 @@
1name: Build-extra CI
2
3on:
4 push:
5 branches: [ master ]
6 paths-ignore:
7 - CONTRIBUTING.md
8 - README
9 - README.md
10 - RELNOTES
11 - SECURITY.md
12 - 'etc/**'
13 - 'src/firecfg/firecfg.config'
14 - '.github/ISSUE_TEMPLATE/*'
15 - '.github/pull_request_template.md'
16 pull_request:
17 branches: [ master ]
18 paths-ignore:
19 - CONTRIBUTING.md
20 - README
21 - README.md
22 - RELNOTES
23 - SECURITY.md
24 - 'etc/**'
25 - 'src/firecfg/firecfg.config'
26 - '.github/ISSUE_TEMPLATE/*'
27 - '.github/pull_request_template.md'
28
29jobs:
30 build-clang:
31 runs-on: ubuntu-20.04
32 steps:
33 - uses: actions/checkout@v2
34 - name: configure
35 run: CC=clang-11 ./configure --enable-fatal-warnings
36 - name: make
37 run: make
38 scan-build:
39 runs-on: ubuntu-20.04
40 steps:
41 - uses: actions/checkout@v2
42 - name: install clang-tools-11
43 run: sudo apt-get install clang-tools-11
44 - name: configure
45 run: CC=clang-11 ./configure --enable-fatal-warnings
46 - name: scan-build
47 run: NO_EXTRA_CFLAGS="yes" scan-build-11 --status-bugs make
48 cppcheck:
49 runs-on: ubuntu-20.04
50 steps:
51 - uses: actions/checkout@v2
52 - name: install cppcheck
53 run: sudo apt-get install cppcheck
54 - name: cppcheck
55 run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance .
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..141e43168
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,35 @@
1name: Build CI
2
3on:
4 push:
5 branches: [ master ]
6 paths-ignore:
7 - CONTRIBUTING.md
8 - README
9 - README.md
10 - RELNOTES
11 - SECURITY.md
12 pull_request:
13 branches: [ master ]
14 paths-ignore:
15 - CONTRIBUTING.md
16 - README
17 - README.md
18 - RELNOTES
19 - SECURITY.md
20
21jobs:
22 build_and_test:
23 runs-on: ubuntu-20.04
24 steps:
25 - uses: actions/checkout@v2
26 - name: install dependencies
27 run: sudo apt-get install gcc-11 libapparmor-dev libselinux1-dev expect xzdec
28 - name: configure
29 run: CC=gcc-11 ./configure --enable-fatal-warnings --enable-analyzer --enable-apparmor --enable-selinux --prefix=/usr
30 - name: make
31 run: make
32 - name: make install
33 run: sudo make install
34 - name: run tests
35 run: SHELL=/bin/bash make test-github
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 000000000..4476963b5
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,75 @@
1# For most projects, this workflow file will not need changing; you simply need
2# to commit it to your repository.
3#
4# You may wish to alter this file to override the set of languages analyzed,
5# or to provide custom queries or build logic.
6name: "CodeQL"
7
8on:
9 push:
10 branches: [ master ]
11 paths-ignore:
12 - CONTRIBUTING.md
13 - README
14 - README.md
15 - RELNOTES
16 - SECURITY.md
17 - 'etc/**'
18 pull_request:
19 # The branches below must be a subset of the branches above
20 branches: [ master ]
21 paths-ignore:
22 - CONTRIBUTING.md
23 - README
24 - README.md
25 - RELNOTES
26 - SECURITY.md
27 - 'etc/**'
28 schedule:
29 - cron: '0 7 * * 2'
30
31jobs:
32 analyze:
33 name: Analyze
34 runs-on: ubuntu-latest
35
36 strategy:
37 fail-fast: false
38 matrix:
39 language: [ 'cpp', 'python' ]
40 # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
41 # Learn more:
42 # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
43
44 steps:
45 - name: Checkout repository
46 uses: actions/checkout@v2
47
48 # Initializes the CodeQL tools for scanning.
49 - name: Initialize CodeQL
50 uses: github/codeql-action/init@v1
51 with:
52 languages: ${{ matrix.language }}
53 # If you wish to specify custom queries, you can do so here or in a config file.
54 # By default, queries listed here will override any specified in a config file.
55 # Prefix the list here with "+" to use these queries and those in the config file.
56 # queries: ./path/to/local/query, your-org/your-repo/queries@main
57
58 # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
59 # If this step fails, then you should remove it and run the build manually (see below)
60 - name: Autobuild
61 uses: github/codeql-action/autobuild@v1
62
63 # ℹ️ Command-line programs to run using the OS shell.
64 # 📚 https://git.io/JvXDl
65
66 # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
67 # and modify them (or add more) to build your code if your project
68 # uses a compiled language
69
70 #- run: |
71 # make bootstrap
72 # make release
73
74 - name: Perform CodeQL Analysis
75 uses: github/codeql-action/analyze@v1
diff --git a/.github/workflows/sort.yml b/.github/workflows/sort.yml
new file mode 100644
index 000000000..f3ded0f22
--- /dev/null
+++ b/.github/workflows/sort.yml
@@ -0,0 +1,22 @@
1name: sort.py
2
3on:
4 push:
5 branches: [ master ]
6 paths:
7 - 'etc/**'
8 - 'contrib/sort.py'
9 pull_request:
10 branches: [ master ]
11 paths:
12 - 'etc/**'
13 - 'contrib/sort.py'
14
15jobs:
16 profile-sort:
17 runs-on: ubuntu-20.04
18 steps:
19 - uses: actions/checkout@v2
20 - name: check profiles
21 run: ./contrib/sort.py etc/*/{*.inc,*.profile}
22
diff --git a/.gitignore b/.gitignore
index 0882eeecf..ace86f218 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,30 +2,47 @@
2*.so 2*.so
3*~ 3*~
4*.swp 4*.swp
5*.deb
5*.rpm 6*.rpm
6*.gcda 7*.gcda
7*.gcno 8*.gcno
9*.DS_Store
10.directory
11*.man
12.vscode
8Makefile 13Makefile
9autom4te.cache/ 14autom4te.cache/
10config.log 15config.log
11config.status 16config.status
17firejail-*.tar.xz
12firejail-login.5 18firejail-login.5
13firejail-profile.5 19firejail-profile.5
14firejail-config.5 20firejail-config.5
21firejail-users.5
15firejail.1 22firejail.1
16firemon.1 23firemon.1
17firecfg.1 24firecfg.1
25jailcheck.1
26mkdeb.sh
18src/firejail/firejail 27src/firejail/firejail
19src/firemon/firemon 28src/firemon/firemon
20src/firecfg/firecfg 29src/firecfg/firecfg
21src/ftee/ftee 30src/ftee/ftee
31src/fids/fids
22src/tags 32src/tags
23src/faudit/faudit 33src/faudit/faudit
24src/fnet/fnet 34src/fnet/fnet
35src/fnetfilter/fnetfilter
36src/fsec-print/fsec-print
25src/fseccomp/fseccomp 37src/fseccomp/fseccomp
38src/fsec-optimize/fsec-optimize
26src/fcopy/fcopy 39src/fcopy/fcopy
27src/fldd/fldd 40src/fldd/fldd
28src/fbuilder/fbuilder 41src/fbuilder/fbuilder
42src/profstats/profstats
43src/bash_completion/firejail.bash_completion
44src/zsh_completion/_firejail
45src/jailcheck/jailcheck
29uids.h 46uids.h
30seccomp 47seccomp
31seccomp.debug 48seccomp.debug
@@ -33,3 +50,9 @@ seccomp.32
33seccomp.64 50seccomp.64
34seccomp.block_secondary 51seccomp.block_secondary
35seccomp.mdwx 52seccomp.mdwx
53seccomp.mdwx.32
54src/common.mk
55aclocal.m4
56__pycache__
57*.pyc
58*.pyo
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..03e18d269
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,78 @@
1# Basic notes: builds firejail on 5 different systems for 2 package systems:
2# 1. Debian-based systems. Use debian:jessie to ensure reasonable backwards
3# compat and ubuntu:rolling for new setups
4# 2. Redhat-based systems. Use centos:latest for reasonable backwards compat
5# and fedora:latest for new setups
6# 3. Alpine for installing directly from source
7# Also builds apparmor package for Ubuntu LTS
8build_ubuntu_package:
9 image: ubuntu:rolling
10 script:
11 - apt-get update -qq
12 - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq build-essential lintian pkg-config python3 gawk
13 - ./configure --prefix=/usr && make deb && dpkg -i firejail*.deb
14 - python3 contrib/sort.py etc/profile-*/*.profile etc/inc/*.inc
15
16build_debian_package:
17 image: debian:stretch
18 script:
19 - apt-get update -qq
20 - apt-get install -y -qq build-essential lintian pkg-config gawk
21 - ./configure --prefix=/usr && make deb && dpkg -i firejail*.deb
22
23build_redhat_package:
24 image: centos:latest
25 script:
26 - dnf update -y
27 - dnf install -y rpm-build gcc make
28 - ./configure --prefix=/usr && make rpms && rpm -i firejail*.rpm
29
30build_fedora_package:
31 image: fedora:latest
32 script:
33 - dnf update -y
34 - dnf install -y rpm-build gcc make
35 - ./configure --prefix=/usr && make rpms && rpm -i firejail*.rpm
36 - python3 contrib/sort.py etc/profile-*/*.profile etc/inc/*.inc
37
38build_src_package:
39 image: alpine:latest
40 script:
41 - apk update
42 - apk upgrade
43 - apk add build-base linux-headers python3 gawk
44 - ./configure --prefix=/usr && make && make install-strip
45 # - python3 contrib/sort.py etc/*.{profile,inc}
46
47build_apparmor:
48 image: ubuntu:latest
49 script:
50 - apt-get update -qq
51 - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq build-essential lintian libapparmor-dev pkg-config gawk
52 - ./configure --prefix=/usr && make deb-apparmor && dpkg -i firejail*.deb
53
54debian_ci:
55 image: registry.salsa.debian.org/salsa-ci-team/ci-image-git-buildpackage:latest
56 variables:
57 DEBFULLNAME: "$GITLAB_USER_NAME"
58 DEBEMAIL: "$GITLAB_USER_EMAIL"
59 before_script:
60 - git checkout -B ci_build $CI_COMMIT_SHA
61 - gitlab-ci-enable-sid
62 - gitlab-ci-enable-experimental
63 - echo "deb-src http://deb.debian.org/debian sid main" >> /etc/apt/sources.list
64 - echo "deb-src http://deb.debian.org/debian experimental main" >> /etc/apt/sources.list
65 - apt-get update
66 - git config user.email "$GITLAB_USER_NAME" && git config user.name "$GITLAB_USER_EMAIL"
67 - cd $CI_PROJECT_DIR/.. && (apt-get source --download-only -t experimental firejail || apt-get source --download-only firejail)
68 - cd $CI_PROJECT_DIR && tar xf ../firejail_*.debian.tar.*
69 - rm -rf debian/patches/
70 # next line is a temporary fix for dh_missing failure; remove it after next release
71 - echo "etc/firejail/*.config" >> debian/firejail.install
72 - VERSION=$(grep ^PACKAGE_VERSION= configure | cut -d"'" -f2) && dch -v ${VERSION}-0.1~ci "Non-maintainer upload." && git archive -o ../firejail_${VERSION}.orig.tar.gz HEAD && pristine-tar commit ../firejail_${VERSION}.orig.tar.gz ci_build && git branch -m pristine-tar origin/pristine-tar
73 - git add debian && git commit -m "add debian/"
74 - export CI_COMMIT_SHA=$(git rev-parse HEAD)
75 script:
76 - apt-get --no-install-recommends install -y -qq gawk
77 - gitlab-ci-git-buildpackage
78 - gitlab-ci-lintian
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 5dd77e1f5..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
1language: c
2dist: trusty
3sudo: true
4
5script:
6 - sudo apt-get -y install expect csh xzdec
7 - ( cd firejail ; ./configure --prefix=/usr --enable-git-install && make && sudo make install && make test-travis )
8 - ( cd firejail ; sudo make install-strip DESTDIR=$(readlink -f appdir) )
9 - ( cd appdir/ ; tar cfvj ../firejail-build$TRAVIS_BUILD_NUMBER.tar.bz2 . )
10 - curl --upload-file ./firejail-*.tar.bz2 https://transfer.sh/firejail-build$TRAVIS_BUILD_NUMBER.tar.bz2
11 - # Could use https://github.com/probonopd/uploadtool to upload to GitHub Releases instead \ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..0f868d6c4
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,46 @@
1Welcome to firejail, and thank you for your interest in contributing!
2
3# Opening an issue:
4We welcome issues, whether to ask a question, provide information, request a new profile or
5feature, or to report a suspected bug or problem.
6
7If you want to request a program profile that we don't already have, please add a comment in
8our [dedicated issue](https://github.com/netblue30/firejail/issues/1139).
9
10When submitting a bug report, please provide the following information so that
11we can handle the report more easily:
12 - firejail version. If you're not sure, open a terminal and type `firejail --version`.
13 - Linux distribution (so that we can try to reproduce it, if necessary).
14 - If you know that the problem did not exist in an earlier version of firejail, please mention it.
15 - If you are reporting that a program does not work with firejail, please also run firejail with
16 the `--noprofile` argument.
17 For example, if `firejail firefox` does not work, please also run `firejail --noprofile firefox` and
18 let us know if it runs correctly or not.
19 - You may also try disabling various options provided in `/etc/firejail/<ProgramName.profile>` until you find out which one causes problems. It will significantly help to find solution for your issue.
20
21Please note: if you are running Debian, Ubuntu, Linux Mint, or another related
22distribution and you installed firejail from your distro's repositories, please
23ensure that **both** of the following were installed:
24`firejail` and `firejail-profiles`. A common source of issues is that
25firejail-profiles was not installed when installing firejail.
26
27We take security bugs very seriously. If you believe you have found one, please report it by
28emailing us at netblue30@protonmail.com
29
30# Opening an pull request:
31Pull requests with enhancements, bugfixes or new profiles are very welcome.
32
33If you want to write a new profile, the easiest way to do this is to use the
34[profile template](https://github.com/netblue30/firejail/blob/master/etc/templates/profile.template).
35If you have already written a profile, please make sure it follows the rules described in the template.
36
37If you add a new command, here's the checklist:
38
39 - [ ] Update manpages: firejail(1) and firejail-profile(5)
40 - [ ] Update shell completions
41 - [ ] Update vim syntax files
42 - [ ] Update --help
43
44# Editing the wiki
45
46You are highly encouraged to add your own tips and tricks to the [wiki](https://github.com/netblue30/firejail/wiki).
diff --git a/COPYING b/COPYING
index b6e1c33e0..d159169d1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,12 @@
1 GNU GENERAL PUBLIC LICENSE 1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991 2 Version 2, June 1991
3 3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies 6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed. 7 of this license document, but changing it is not allowed.
8 8
9 Preamble 9 Preamble
10 10
11 The licenses for most software are designed to take away your 11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public 12freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software 15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to 16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by 17using it. (Some other Free Software Foundation software is covered by
18the GNU Library General Public License instead.) You can apply it to 18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too. 19your programs, too.
20 20
21 When we speak of free software, we are referring to freedom, not 21 When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
55 55
56 The precise terms and conditions for copying, distribution and 56 The precise terms and conditions for copying, distribution and
57modification follow. 57modification follow.
58 58
59 GNU GENERAL PUBLIC LICENSE 59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 61
62 0. This License applies to any program or other work which contains 62 0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
110 License. (Exception: if the Program itself is interactive but 110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on 111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.) 112 the Program is not required to print an announcement.)
113 113
114These requirements apply to the modified work as a whole. If 114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program, 115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in 116and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as 168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not 169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code. 170compelled to copy the source along with the object code.
171 171
172 4. You may not copy, modify, sublicense, or distribute the Program 172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt 173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is 174otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
225 225
226This section is intended to make thoroughly clear what is believed to 226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License. 227be a consequence of the rest of this License.
228 228
229 8. If the distribution and/or use of the Program is restricted in 229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the 230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License 231original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and 255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally. 256of promoting the sharing and reuse of software generally.
257 257
258 NO WARRANTY 258 NO WARRANTY
259 259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,4 +277,63 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES. 278POSSIBILITY OF SUCH DAMAGES.
279 279
280 END OF TERMS AND CONDITIONS 280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/Makefile.in b/Makefile.in
index be5ab837f..c94d8c7a4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,3 @@
1all: apps man filters
2MYLIBS = src/lib
3APPS = src/firejail src/firemon src/firecfg src/libtrace src/libtracelog src/ftee src/faudit src/fnet src/fseccomp src/fbuilder src/fcopy src/fldd src/libpostexecseccomp
4MANPAGES = firejail.1 firemon.1 firecfg.1 firejail-profile.5 firejail-login.5
5SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.64 seccomp.block_secondary seccomp.mdwx
6
7prefix=@prefix@ 1prefix=@prefix@
8exec_prefix=@exec_prefix@ 2exec_prefix=@exec_prefix@
9bindir=@bindir@ 3bindir=@bindir@
@@ -16,43 +10,75 @@ VERSION=@PACKAGE_VERSION@
16NAME=@PACKAGE_NAME@ 10NAME=@PACKAGE_NAME@
17PACKAGE_TARNAME=@PACKAGE_TARNAME@ 11PACKAGE_TARNAME=@PACKAGE_TARNAME@
18DOCDIR=@docdir@ 12DOCDIR=@docdir@
19HAVE_SECCOMP=@HAVE_SECCOMP@
20HAVE_APPARMOR=@HAVE_APPARMOR@ 13HAVE_APPARMOR=@HAVE_APPARMOR@
21HAVE_CONTRIB_INSTALL=@HAVE_CONTRIB_INSTALL@ 14HAVE_CONTRIB_INSTALL=@HAVE_CONTRIB_INSTALL@
22HAVE_GIT_INSTALL=@HAVE_GIT_INSTALL@
23BUSYBOX_WORKAROUND=@BUSYBOX_WORKAROUND@ 15BUSYBOX_WORKAROUND=@BUSYBOX_WORKAROUND@
16HAVE_SUID=@HAVE_SUID@
17HAVE_MAN=@HAVE_MAN@
24 18
25uids.h:; ./mkuid.sh 19ifneq ($(HAVE_MAN),no)
26 20MAN_TARGET = man
27.PHONY: mylibs $(MYLIBS) 21MAN_SRC = src/man
28mylibs: $(MYLIBS) uids.h 22endif
29$(MYLIBS):
30 $(MAKE) -C $@
31 23
32.PHONY: apps $(APPS) 24COMPLETIONDIRS = src/zsh_completion src/bash_completion
33apps: $(APPS) 25
34$(APPS): $(MYLIBS) uids.h 26.PHONY: all
27all: all_items mydirs $(MAN_TARGET) filters
28APPS = src/firecfg/firecfg src/firejail/firejail src/firemon/firemon src/profstats/profstats src/jailcheck/jailcheck
29SBOX_APPS = src/fbuilder/fbuilder src/ftee/ftee src/fids/fids
30SBOX_APPS_NON_DUMPABLE = src/fcopy/fcopy src/fldd/fldd src/fnet/fnet src/fnetfilter/fnetfilter
31MYDIRS = src/lib $(MAN_SRC) $(COMPLETIONDIRS)
32MYLIBS = src/libpostexecseccomp/libpostexecseccomp.so src/libtrace/libtrace.so src/libtracelog/libtracelog.so
33COMPLETIONS = src/zsh_completion/_firejail src/bash_completion/firejail.bash_completion
34MANPAGES = firejail.1 firemon.1 firecfg.1 firejail-profile.5 firejail-login.5 firejail-users.5 jailcheck.1
35SBOX_APPS_NON_DUMPABLE += src/fsec-optimize/fsec-optimize src/fsec-print/fsec-print src/fseccomp/fseccomp
36SECCOMP_FILTERS = seccomp seccomp.debug seccomp.32 seccomp.block_secondary seccomp.mdwx seccomp.mdwx.32
37ALL_ITEMS = $(APPS) $(SBOX_APPS) $(SBOX_APPS_NON_DUMPABLE) $(MYLIBS)
38
39.PHONY: all_items $(ALL_ITEMS)
40all_items: $(ALL_ITEMS)
41$(ALL_ITEMS): $(MYDIRS)
42 $(MAKE) -C $(dir $@)
43
44.PHONY: mydirs $(MYDIRS)
45mydirs: $(MYDIRS)
46$(MYDIRS):
35 $(MAKE) -C $@ 47 $(MAKE) -C $@
36 48
37$(MANPAGES): $(wildcard src/man/*.txt) 49$(MANPAGES): src/man
38 ./mkman.sh $(VERSION) src/man/$(basename $@).txt $@ 50 ./mkman.sh $(VERSION) src/man/$(basename $@).man $@
39 51
40man: $(MANPAGES) 52man: $(MANPAGES)
41 53
42filters: src/fseccomp 54filters: $(SECCOMP_FILTERS) $(SBOX_APPS_NON_DUMPABLE)
43ifeq ($(HAVE_SECCOMP),-DHAVE_SECCOMP) 55seccomp: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize
44 src/fseccomp/fseccomp default seccomp 56 src/fseccomp/fseccomp default seccomp
57 src/fsec-optimize/fsec-optimize seccomp
58
59seccomp.debug: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize
45 src/fseccomp/fseccomp default seccomp.debug allow-debuggers 60 src/fseccomp/fseccomp default seccomp.debug allow-debuggers
61 src/fsec-optimize/fsec-optimize seccomp.debug
62
63seccomp.32: src/fseccomp/fseccomp src/fsec-optimize/fsec-optimize
46 src/fseccomp/fseccomp secondary 32 seccomp.32 64 src/fseccomp/fseccomp secondary 32 seccomp.32
47 src/fseccomp/fseccomp secondary 64 seccomp.64 65 src/fsec-optimize/fsec-optimize seccomp.32
66
67seccomp.block_secondary: src/fseccomp/fseccomp
48 src/fseccomp/fseccomp secondary block seccomp.block_secondary 68 src/fseccomp/fseccomp secondary block seccomp.block_secondary
69
70seccomp.mdwx: src/fseccomp/fseccomp
49 src/fseccomp/fseccomp memory-deny-write-execute seccomp.mdwx 71 src/fseccomp/fseccomp memory-deny-write-execute seccomp.mdwx
50endif
51 72
73seccomp.mdwx.32: src/fseccomp/fseccomp
74 src/fseccomp/fseccomp memory-deny-write-execute.32 seccomp.mdwx.32
75
76.PHONY: clean
52clean: 77clean:
53 for dir in $(APPS) $(MYLIBS); do \ 78 for dir in $$(dirname $(ALL_ITEMS)) $(MYDIRS); do \
54 $(MAKE) -C $$dir clean; \ 79 $(MAKE) -C $$dir clean; \
55 done 80 done
81 $(MAKE) -C test clean
56 rm -f $(MANPAGES) $(MANPAGES:%=%.gz) firejail*.rpm 82 rm -f $(MANPAGES) $(MANPAGES:%=%.gz) firejail*.rpm
57 rm -f $(SECCOMP_FILTERS) 83 rm -f $(SECCOMP_FILTERS)
58 rm -f test/utils/index.html* 84 rm -f test/utils/index.html*
@@ -67,132 +93,114 @@ clean:
67 rm -f test/sysutils/firejail_t* 93 rm -f test/sysutils/firejail_t*
68 cd test/compile; ./compile.sh --clean; cd ../.. 94 cd test/compile; ./compile.sh --clean; cd ../..
69 95
96.PHONY: distclean
70distclean: clean 97distclean: clean
71 for dir in $(APPS) $(MYLIBS); do \ 98 for dir in $$(dirname $(ALL_ITEMS)) $(MYDIRS); do \
72 $(MAKE) -C $$dir distclean; \ 99 $(MAKE) -C $$dir distclean; \
73 done 100 done
74 rm -fr Makefile autom4te.cache config.log config.status config.h uids.h 101 $(MAKE) -C test distclean
102 rm -fr Makefile autom4te.cache config.log config.status config.h src/common.mk mkdeb.sh
75 103
76realinstall: 104realinstall:
77 # firejail executable 105 # firejail executable
78 install -m 0755 -d $(DESTDIR)/$(bindir) 106 install -m 0755 -d $(DESTDIR)$(bindir)
79 install -c -m 0755 src/firejail/firejail $(DESTDIR)/$(bindir)/. 107 install -m 0755 src/firejail/firejail $(DESTDIR)$(bindir)
80 chmod u+s $(DESTDIR)/$(bindir)/firejail 108ifeq ($(HAVE_SUID),yes)
109 chmod u+s $(DESTDIR)$(bindir)/firejail
110endif
81 # firemon executable 111 # firemon executable
82 install -c -m 0755 src/firemon/firemon $(DESTDIR)/$(bindir)/. 112 install -m 0755 src/firemon/firemon $(DESTDIR)$(bindir)
83 # firecfg executable 113 # firecfg executable
84 install -c -m 0755 src/firecfg/firecfg $(DESTDIR)/$(bindir)/. 114 install -m 0755 src/firecfg/firecfg $(DESTDIR)$(bindir)
115 # jailcheck executable
116 install -m 0755 src/jailcheck/jailcheck $(DESTDIR)$(bindir)
85 # libraries and plugins 117 # libraries and plugins
86 install -m 0755 -d $(DESTDIR)/$(libdir)/firejail 118 install -m 0755 -d $(DESTDIR)$(libdir)/firejail
87 install -c -m 0644 src/libtrace/libtrace.so $(DESTDIR)/$(libdir)/firejail/. 119 install -m 0644 -t $(DESTDIR)$(libdir)/firejail $(MYLIBS) $(SECCOMP_FILTERS) src/firecfg/firecfg.config
88 install -c -m 0644 src/libtracelog/libtracelog.so $(DESTDIR)/$(libdir)/firejail/. 120 install -m 0755 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS)
89 install -c -m 0644 src/libpostexecseccomp/libpostexecseccomp.so $(DESTDIR)/$(libdir)/firejail/. 121 # plugins w/o read permission (non-dumpable)
90 install -c -m 0755 src/ftee/ftee $(DESTDIR)/$(libdir)/firejail/. 122 install -m 0711 -t $(DESTDIR)$(libdir)/firejail $(SBOX_APPS_NON_DUMPABLE)
91 install -c -m 0755 src/fshaper/fshaper.sh $(DESTDIR)/$(libdir)/firejail/. 123 install -m 0711 -t $(DESTDIR)$(libdir)/firejail src/fshaper/fshaper.sh
92ifeq ($(HAVE_GIT_INSTALL),-DHAVE_GIT_INSTALL)
93 install -c -m 0755 src/fgit/fgit-install.sh $(DESTDIR)/$(libdir)/firejail/.
94 install -c -m 0755 src/fgit/fgit-uninstall.sh $(DESTDIR)/$(libdir)/firejail/.
95endif
96
97 install -c -m 0644 src/firecfg/firecfg.config $(DESTDIR)/$(libdir)/firejail/.
98 install -c -m 0755 src/faudit/faudit $(DESTDIR)/$(libdir)/firejail/.
99 install -c -m 0755 src/fnet/fnet $(DESTDIR)/$(libdir)/firejail/.
100 install -c -m 0755 src/fcopy/fcopy $(DESTDIR)/$(libdir)/firejail/.
101 install -c -m 0755 src/fldd/fldd $(DESTDIR)/$(libdir)/firejail/.
102 install -c -m 0755 src/fbuilder/fbuilder $(DESTDIR)/$(libdir)/firejail/.
103ifeq ($(HAVE_SECCOMP),-DHAVE_SECCOMP)
104 install -c -m 0755 src/fseccomp/fseccomp $(DESTDIR)/$(libdir)/firejail/.
105 install -c -m 0644 seccomp $(DESTDIR)/$(libdir)/firejail/.
106 install -c -m 0644 seccomp.debug $(DESTDIR)/$(libdir)/firejail/.
107 install -c -m 0644 seccomp.32 $(DESTDIR)/$(libdir)/firejail/.
108 install -c -m 0644 seccomp.64 $(DESTDIR)/$(libdir)/firejail/.
109 install -c -m 0644 seccomp.block_secondary $(DESTDIR)/$(libdir)/firejail/.
110 install -c -m 0644 seccomp.mdwx $(DESTDIR)/$(libdir)/firejail/.
111endif
112ifeq ($(HAVE_CONTRIB_INSTALL),yes) 124ifeq ($(HAVE_CONTRIB_INSTALL),yes)
113 install -c -m 0755 contrib/fix_private-bin.py $(DESTDIR)/$(libdir)/firejail/. 125 # contrib scripts
114 install -c -m 0755 contrib/fjclip.py $(DESTDIR)/$(libdir)/firejail/. 126 install -m 0755 -t $(DESTDIR)$(libdir)/firejail contrib/*.py contrib/*.sh
115 install -c -m 0755 contrib/fjdisplay.py $(DESTDIR)/$(libdir)/firejail/. 127 # vim syntax
116 install -c -m 0755 contrib/fjresize.py $(DESTDIR)/$(libdir)/firejail/. 128 install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect
117 install -c -m 0755 contrib/fj-mkdeb.py $(DESTDIR)/$(libdir)/firejail/. 129 install -m 0755 -d $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax
130 install -m 0644 contrib/vim/ftdetect/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/ftdetect
131 install -m 0644 contrib/vim/syntax/firejail.vim $(DESTDIR)$(datarootdir)/vim/vimfiles/syntax
118endif 132endif
119 # documents 133 # documents
120 install -m 0755 -d $(DESTDIR)/$(DOCDIR) 134 install -m 0755 -d $(DESTDIR)$(DOCDIR)
121 install -c -m 0644 COPYING $(DESTDIR)/$(DOCDIR)/. 135 install -m 0644 -t $(DESTDIR)$(DOCDIR) COPYING README RELNOTES etc/templates/*
122 install -c -m 0644 README $(DESTDIR)/$(DOCDIR)/. 136 # profiles and settings
123 install -c -m 0644 RELNOTES $(DESTDIR)/$(DOCDIR)/. 137 install -m 0755 -d $(DESTDIR)$(sysconfdir)/firejail
124 # etc files 138 install -m 0644 -t $(DESTDIR)$(sysconfdir)/firejail etc/profile-a-l/*.profile etc/profile-m-z/*.profile etc/inc/*.inc etc/net/*.net etc/firejail.config etc/ids.config
125 ./mketc.sh $(sysconfdir) $(BUSYBOX_WORKAROUND)
126 install -m 0755 -d $(DESTDIR)/$(sysconfdir)/firejail
127 for file in .etc/* etc/firejail.config; do \
128 install -c -m 0644 $$file $(DESTDIR)/$(sysconfdir)/firejail; \
129 done
130 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;" 139 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/firejail/login.users ]; then install -c -m 0644 etc/login.users $(DESTDIR)/$(sysconfdir)/firejail/.; fi;"
131 rm -fr .etc 140ifeq ($(BUSYBOX_WORKAROUND),yes)
141 ./mketc.sh $(DESTDIR)$(sysconfdir)/firejail/disable-common.inc
142endif
132ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR) 143ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR)
133 # install apparmor profile 144 # install apparmor profile
134 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;" 145 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;"
135 install -c -m 0644 etc/firejail-default $(DESTDIR)/$(sysconfdir)/apparmor.d/. 146 install -m 0644 etc/apparmor/firejail-default $(DESTDIR)$(sysconfdir)/apparmor.d
136 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;" 147 sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;"
137 install -c -m 0644 etc/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/. 148 # install apparmor profile customization file
149 sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default ]; then install -c -m 0644 etc/apparmor/firejail-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/firejail-default; fi;"
138endif 150endif
151ifneq ($(HAVE_MAN),no)
139 # man pages 152 # man pages
140 install -m 0755 -d $(DESTDIR)/$(mandir)/man1 153 install -m 0755 -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
141 install -m 0755 -d $(DESTDIR)/$(mandir)/man5
142 for man in $(MANPAGES); do \ 154 for man in $(MANPAGES); do \
143 rm -f $$man.gz; \ 155 rm -f $$man.gz; \
144 gzip -9n $$man; \ 156 gzip -9n $$man; \
145 case "$$man" in \ 157 case "$$man" in \
146 *.1) install -c -m 0644 $$man.gz $(DESTDIR)/$(mandir)/man1/; ;; \ 158 *.1) install -m 0644 $$man.gz $(DESTDIR)$(mandir)/man1/; ;; \
147 *.5) install -c -m 0644 $$man.gz $(DESTDIR)/$(mandir)/man5/; ;; \ 159 *.5) install -m 0644 $$man.gz $(DESTDIR)$(mandir)/man5/; ;; \
148 esac; \ 160 esac; \
149 done 161 done
150 rm -f $(MANPAGES) $(MANPAGES:%=%.gz) 162 rm -f $(MANPAGES) $(MANPAGES:%=%.gz)
163endif
151 # bash completion 164 # bash completion
152 install -m 0755 -d $(DESTDIR)/$(datarootdir)/bash-completion/completions 165 install -m 0755 -d $(DESTDIR)$(datarootdir)/bash-completion/completions
153 install -c -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)/$(datarootdir)/bash-completion/completions/firejail 166 install -m 0644 src/bash_completion/firejail.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail
154 install -c -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)/$(datarootdir)/bash-completion/completions/firemon 167 install -m 0644 src/bash_completion/firemon.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon
155 install -c -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg 168 install -m 0644 src/bash_completion/firecfg.bash_completion $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg
169 # zsh completion
170 install -m 0755 -d $(DESTDIR)$(datarootdir)/zsh/site-functions
171 install -m 0644 src/zsh_completion/_firejail $(DESTDIR)$(datarootdir)/zsh/site-functions/
156 172
157install: all 173install: all
158 $(MAKE) realinstall 174 $(MAKE) realinstall
159 175
160install-strip: all 176install-strip: all
161 strip src/firejail/firejail 177 strip $(ALL_ITEMS)
162 strip src/firemon/firemon
163 strip src/firecfg/firecfg
164 strip src/libtrace/libtrace.so
165 strip src/libtracelog/libtracelog.so
166 strip src/libpostexecseccomp/libpostexecseccomp.so
167 strip src/ftee/ftee
168 strip src/faudit/faudit
169 strip src/fnet/fnet
170 strip src/fseccomp/fseccomp
171 strip src/fcopy/fcopy
172 strip src/fldd/fldd
173 strip src/fbuilder/fbuilder
174 $(MAKE) realinstall 178 $(MAKE) realinstall
175 179
176uninstall: 180uninstall:
177 rm -f $(DESTDIR)/$(bindir)/firejail 181 rm -f $(DESTDIR)$(bindir)/firejail
178 rm -f $(DESTDIR)/$(bindir)/firemon 182 rm -f $(DESTDIR)$(bindir)/firemon
179 rm -f $(DESTDIR)/$(bindir)/firecfg 183 rm -f $(DESTDIR)$(bindir)/firecfg
180 rm -fr $(DESTDIR)/$(libdir)/firejail 184 rm -fr $(DESTDIR)$(libdir)/firejail
181 rm -fr $(DESTDIR)/$(datarootdir)/doc/firejail 185 rm -fr $(DESTDIR)$(libdir)/jailcheck
186 rm -fr $(DESTDIR)$(datarootdir)/doc/firejail
182 for man in $(MANPAGES); do \ 187 for man in $(MANPAGES); do \
183 rm -f $(DESTDIR)/$(mandir)/man5/$$man*; \ 188 rm -f $(DESTDIR)$(mandir)/man5/$$man*; \
184 rm -f $(DESTDIR)/$(mandir)/man1/$$man*; \ 189 rm -f $(DESTDIR)$(mandir)/man1/$$man*; \
185 done 190 done
186 rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firejail 191 rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firejail
187 rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firemon 192 rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firemon
188 rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg 193 rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/firecfg
194 @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038."
189 195
190DISTFILES = "src etc platform contrib configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES" 196DISTFILES = "src etc m4 platform contrib configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh.in COPYING README RELNOTES"
191DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/root test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils test/chroot" 197DISTFILES_TEST = "test/Makefile.in test/apps test/apps-x11 test/apps-x11-xorg test/root test/private-lib test/fnetfilter test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/fs test/sysutils test/chroot"
192 198
193dist: 199dist:
194 mv config.status config.status.old 200 mv config.status config.status.old
201 mv mkdeb.sh mkdeb.sh.old
195 make distclean 202 make distclean
203 mv mkdeb.sh.old mkdeb.sh
196 mv config.status.old config.status 204 mv config.status.old config.status
197 rm -fr $(NAME)-$(VERSION) $(NAME)-$(VERSION).tar.xz 205 rm -fr $(NAME)-$(VERSION) $(NAME)-$(VERSION).tar.xz
198 mkdir -p $(NAME)-$(VERSION)/test 206 mkdir -p $(NAME)-$(VERSION)/test
@@ -206,107 +214,80 @@ dist:
206asc:; ./mkasc.sh $(VERSION) 214asc:; ./mkasc.sh $(VERSION)
207 215
208deb: dist 216deb: dist
209 ./mkdeb.sh $(NAME) $(VERSION) 217 ./mkdeb.sh
210
211snap: all
212 cd platform/snap; ./snap.sh
213 218
214install-snap: snap 219deb-apparmor: dist
215 sudo snap remove faudit; sudo snap install faudit*.snap 220 ./mkdeb.sh -apparmor
216 221
217test-compile: dist 222test-compile: dist
218 cd test/compile; ./compile.sh $(NAME)-$(VERSION) 223 cd test/compile; ./compile.sh $(NAME)-$(VERSION)
219 224
220.PHONY: rpms 225.PHONY: rpms
221rpms: 226rpms: src/man
222 ./platform/rpm/mkrpm.sh $(NAME) $(VERSION) 227 ./platform/rpm/mkrpm.sh $(NAME) $(VERSION)
223 228
224extras: all 229extras: all
225 $(MAKE) -C extras/firetools 230 $(MAKE) -C extras/firetools
226 231
227cppcheck: clean 232cppcheck: clean
228 cppcheck --force . 233 cppcheck --force --error-exitcode=1 --enable=warning,performance .
229 234
230scan-build: clean 235scan-build: clean
231 scan-build make 236 NO_EXTRA_CFLAGS="yes" scan-build make
232
233 237
234# 238#
235# make test 239# make test
236# 240#
237 241
242TESTS=profiles private-lib apps apps-x11 apps-x11-xorg sysutils utils environment filters fs fcopy fnetfilter
243TEST_TARGETS=$(patsubst %,test-%,$(TESTS))
238 244
239test-profiles: 245$(TEST_TARGETS):
240 cd test/profiles; ./profiles.sh | grep TESTING 246 $(MAKE) -C test $(subst test-,,$@)
241
242test-apps:
243 cd test/apps; ./apps.sh | grep TESTING
244
245test-apps-x11:
246 cd test/apps-x11; ./apps-x11.sh | grep TESTING
247
248test-apps-x11-xorg:
249 cd test/apps-x11-xorg; ./apps-x11-xorg.sh | grep TESTING
250
251test-sysutils:
252 cd test/sysutils; ./sysutils.sh | grep TESTING
253
254test-utils:
255 cd test/utils; ./utils.sh | grep TESTING
256 247
257test-environment: 248test: test-profiles test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters
258 cd test/environment; ./environment.sh | grep TESTING 249 echo "TEST COMPLETE"
259
260test-filters:
261ifeq ($(HAVE_SECCOMP),-DHAVE_SECCOMP)
262 cd test/filters; ./filters.sh | grep TESTING
263endif
264
265test-arguments:
266 cd test/arguments; ./arguments.sh | grep TESTING
267
268test-fs:
269 cd test/fs; ./fs.sh | grep TESTING
270
271test-fcopy:
272 cd test/fcopy; ./fcopy.sh | grep TESTING
273 250
274test: test-profiles test-fcopy test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments 251test-noprofiles: test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters
275 echo "TEST COMPLETE" 252 echo "TEST COMPLETE"
276 253
277test-travis: test-profiles test-fcopy test-fs test-utils test-sysutils test-environment test-filters test-arguments 254test-github: test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment
278 echo "TEST COMPLETE" 255 echo "TEST COMPLETE"
279 256
280########################################## 257##########################################
281# Individual tests, some of them require root access 258# Individual tests, some of them require root access
282# The tests are very intrussive, by the time you are done 259# The tests are very intrusive, by the time you are done
283# with them you will need to restart your computer. 260# with them you will need to restart your computer.
284########################################## 261##########################################
285 262
263# a firejail-test account is required, public/private key setup
264test-ssh:
265 $(MAKE) -C test $(subst test-,,$@)
266
286# requires root access 267# requires root access
287test-chroot: 268test-chroot:
288 cd test/chroot; ./chroot.sh | grep testing 269 $(MAKE) -C test $(subst test-,,$@)
289 270
290# Huge appimage files, not included in "make dist" archive 271# Huge appimage files, not included in "make dist" archive
291test-appimage: 272test-appimage:
292 cd test/appimage; ./appimage.sh | grep TESTING 273 $(MAKE) -C test $(subst test-,,$@)
293 274
294# Root access, network devices are created before the test 275# Root access, network devices are created before the test
295# restart your computer to get rid of these devices 276# restart your computer to get rid of these devices
296test-network: 277test-network:
297 cd test/network; ./network.sh | grep TESTING 278 $(MAKE) -C test $(subst test-,,$@)
298 279
299# requires the same setup as test-network 280# requires the same setup as test-network
300test-stress: 281test-stress:
301 cd test/stress; ./stress.sh | grep TESTING 282 $(MAKE) -C test $(subst test-,,$@)
302 283
303# Tesets running a root user 284# Tests running a root user
304test-root: 285test-root:
305 cd test/root; su -c ./root.sh | grep TESTING 286 $(MAKE) -C test $(subst test-,,$@)
306 287
307# OverlayFS is not available on all platforms 288# OverlayFS is not available on all platforms
308test-overlay: 289test-overlay:
309 cd test/overlay; ./overlay.sh | grep TESTING 290 $(MAKE) -C test $(subst test-,,$@)
310 291
311# For testing hidepid system, the command to set it up is "mount -o remount,rw,hidepid=2 /proc" 292# For testing hidepid system, the command to set it up is "mount -o remount,rw,hidepid=2 /proc"
312 293
diff --git a/README b/README
index ccc3e2588..a15e493ff 100644
--- a/README
+++ b/README
@@ -9,13 +9,15 @@ Pidgin, Quassel, and XChat.
9Firejail also expands the restricted shell facility found in bash by adding 9Firejail also expands the restricted shell facility found in bash by adding
10Linux namespace support. It supports sandboxing specific users upon login. 10Linux namespace support. It supports sandboxing specific users upon login.
11 11
12Download: http://sourceforge.net/projects/firejail/files/ 12Download: https://sourceforge.net/projects/firejail/files/
13Build and install: ./configure && make && sudo make install 13Build and install: ./configure && make && sudo make install
14Documentation and support: https://firejail.wordpress.com/ 14Documentation and support: https://firejail.wordpress.com/
15Video Channel: https://www.youtube.com/channel/UCi5u-syndQYyOeV4NZ04hNA
16Backup Video Channel: https://www.bitchute.com/profile/JSBsA1aoQVfW/
15Development: https://github.com/netblue30/firejail 17Development: https://github.com/netblue30/firejail
16License: GPL v2 18License: GPL v2
17 19
18 20Please report all security vulnerabilities at netblue30@protonmail.com
19 21
20Compile and install mainline version from GitHub: 22Compile and install mainline version from GitHub:
21 23
@@ -23,32 +25,64 @@ $ git clone https://github.com/netblue30/firejail.git
23$ cd firejail 25$ cd firejail
24$ ./configure && make && sudo make install-strip 26$ ./configure && make && sudo make install-strip
25 27
26On Debian/Ubuntu you will need to install git and a compiler: 28On Debian/Ubuntu you will need to install git and gcc compiler. AppArmor
27 29development libraries and pkg-config are required when using --apparmor
28$ sudo apt-get install build-essential 30./configure option:
29 31
32$ sudo apt-get install git build-essential libapparmor-dev pkg-config gawk
30 33
34For --selinux option, add libselinux1-dev (libselinux-devel for Fedora).
31 35
32Maintainer: 36Maintainer:
33- netblue30 (netblue30@yahoo.com) 37- netblue30 (netblue30@protonmail.com)
34 38
35Committers 39Committers
40- chiraag-nataraj (https://github.com/chiraag-nataraj)
41- crass (https://github.com/crass)
42- curiosityseeker (https://github.com/curiosityseeker)
43- glitsj16 (https://github.com/glitsj16)
36- Fred-Barclay (https://github.com/Fred-Barclay) 44- Fred-Barclay (https://github.com/Fred-Barclay)
37- Reiner Herrmann (https://github.com/reinerh) 45- Kelvin M. Klann (https://github.com/kmk3)
38- smithsohu (https://github.com/smitsohu) 46- Kristóf Marussy (https://github.com/kris7t)
39- SpotComms (https://github.com/SpotComms) 47- Neo00001 (https://github.com/Neo00001)
40- startx2017 (https://github.com/startx2017) - 0.9.38-LTS and *bugfixes branches maintainer 48- pirate486743186 (https://github.com/pirate486743186)
49- Reiner Herrmann (https://github.com/reinerh - Debian/Ubuntu maintainer)
50- rusty-snake (https://github.com/rusty-snake)
51- smitsohu (https://github.com/smitsohu)
52- SkewedZeppelin (https://github.com/SkewedZeppelin)
53- startx2017 (https://github.com/startx2017) - LTS and *bugfixes branches maintainer)
41- Topi Miettinen (https://github.com/topimiettinen) 54- Topi Miettinen (https://github.com/topimiettinen)
42- netblue30 (netblue30@yahoo.com) 55- veloute (https://github.com/veloute)
56- Vincent43 (https://github.com/Vincent43)
57- netblue30 (netblue30@protonmail.com)
43 58
44 59
45 60
46Firejail Authors (alphabetical order) 61Firejail Authors (alphabetical order)
47 62
630x7969 (https://github.com/0x7969)
64 - fix wire-desktop.profile
65 - add ferdi.profile
667twin (https://github.com/7twin_)
67 - fix typos
68 - fix flameshot raw screenshots
691dnrr (https://github.com/1dnrr)
70 - add pybitmessage profile
71Ádler Jonas Gross (https://github.com/adgross)
72 - AppArmor fix
73Adrian L. Shaw (https://github.com/adrianlshaw)
74 - add profanity profile
75 - add barrirer profile
48Aidan Gauland (https://github.com/aidalgol) 76Aidan Gauland (https://github.com/aidalgol)
49 - added electron and riot-web profiles 77 - added electron, riot-web and npm profiles
78 - whitelist Bohemia Interactive config dir for Steam
50Akhil Hans Maulloo (https://github.com/kouul) 79Akhil Hans Maulloo (https://github.com/kouul)
51 - xz profile 80 - xz profile
81Albin Kauffmann (https://github.com/albinou)
82 - Firefox and Chromium profile fixes
83 - info to allow screen sharing in profiles
84Alex Leahu (https://github.com/alxjsn)
85 - fix screen sharing configuration on Wayland
52Alexey Kuznetsov (kuznet@ms2.inr.ac.ru) 86Alexey Kuznetsov (kuznet@ms2.inr.ac.ru)
53 - src/lib/libnetlink.c extracted from iproute2 software package 87 - src/lib/libnetlink.c extracted from iproute2 software package
54Aleksey Manevich (https://github.com/manevich) 88Aleksey Manevich (https://github.com/manevich)
@@ -58,7 +92,7 @@ Aleksey Manevich (https://github.com/manevich)
58 - fix double quotes/single quotes problem 92 - fix double quotes/single quotes problem
59 - big rework of argument processing subsystem 93 - big rework of argument processing subsystem
60 - --join fixes 94 - --join fixes
61 - spliting up cmdline.c 95 - splitting up cmdline.c
62 - Busybox support 96 - Busybox support
63 - X11 support rewrite 97 - X11 support rewrite
64 - gether shell selection code in one place 98 - gether shell selection code in one place
@@ -69,19 +103,50 @@ Aleksey Manevich (https://github.com/manevich)
69 - x11 xpra, xphyr, none profile commands 103 - x11 xpra, xphyr, none profile commands
70 - added --join-or-start command 104 - added --join-or-start command
71 - CVE-2016-7545 105 - CVE-2016-7545
106Alexander Gerasiov (https://github.com/gerasiov)
107 - read-only ~/.ssh/authorized_keys
108 - profile updates
72Alexander Stein (https://github.com/ajstein) 109Alexander Stein (https://github.com/ajstein)
73 - added profile for qutebrowser 110 - added profile for qutebrowser
111Amin Vakil (https://github.com/aminvakil)
112 - whois profile fix
113 - added profile for strawberry
114 - w3m profile fix
115 - disable seccomp in wireshark profile
116Andreas Hunkeler (https://github.com/Karneades)
117 - Add profile for offical Linux Teams application
74Andrey Alekseenko (https://github.com/al42and) 118Andrey Alekseenko (https://github.com/al42and)
75 - fixing lintian warnings 119 - fixing lintian warnings
76 - fixed Skype profile 120 - fixed Skype profile
77andrew160 (https://github.com/andrew160) 121andrew160 (https://github.com/andrew160)
78 - profile and man pages fixes 122 - profile and man pages fixes
123Andrew Branson (https://github.com/abranson)
124 - 32bit ARM syscall table
79announ (https://github.com/announ) 125announ (https://github.com/announ)
80 - mpv and youtube-dl profile fixes 126 - mpv and youtube-dl profile fixes
127 - git profile fix
128 - evince profile fix
129Anton Shestakov (https://github.com/antonv6)
130 - add whitelist items for uim
81Antonio Russo (https://github.com/aerusso) 131Antonio Russo (https://github.com/aerusso)
82 - enumerate root directories in apparmor profile 132 - enumerate root directories in apparmor profile
133 - fix join-or-start
134 - wusc fixes
135 - okular profile fixes
136 - manpage fixes
137aoand (https://github.com/aoand)
138 - seccomp fix: allow numeric syscalls
139Arne Welzel (https://github.com/awelzel)
140 - ignore SIGTTOU during flush_stdin()
141Atrate (https://github.com/Atrate)
142 - BetterDiscord support
143Austin Morton (https://github.com/apmorton)
144 - deterministic-exit-code option
145 - private-cwd options
83Austin S. Hemmelgarn (https://github.com/Ferroin) 146Austin S. Hemmelgarn (https://github.com/Ferroin)
84 - unbound profile update 147 - unbound profile update
148Avi Lumelsky (https://github.com/avilum)
149 - syscall.sh improvements
85avoidr (https://github.com/avoidr) 150avoidr (https://github.com/avoidr)
86 - whitelist fix 151 - whitelist fix
87 - recently-used.xbel fix 152 - recently-used.xbel fix
@@ -97,23 +162,71 @@ avoidr (https://github.com/avoidr)
97 - added mcabber profile 162 - added mcabber profile
98 - fixed mpv profile 163 - fixed mpv profile
99 - various other fixes 164 - various other fixes
165backspac (https://github.com/backspac)
166 - firecfg fixes
167 - add steam-runtime alias
100Bader Zaidan (https://github.com/BaderSZ) 168Bader Zaidan (https://github.com/BaderSZ)
101 - Telegram profile 169 - Telegram profile
170Bandie (https://github.com/Bandie)
171 - fixed riot-desktop
172Barış Ekin Yıldırım (https://github.com/circuitshaker)
173 - removing net none from code.profile
174Bart Bakker (https://github.com/bjpbakker)
175 - multimc5: fix exec of LWJGL libraries
176bbhtt (https://github.com/bbhtt)
177 - improvements to balsa,fractal,gajim,trojita profiles
178 - improvements to nheko, spectral, feh, links, lynx, smplayer profiles
179 - added alacarte, com.github.bleakgrey.tootle, photoflare profiles
180 - add profiles for MS Edge dev build for Linux and Librewolf
181 - fixes to cheese, authenticator, liferea
182 - add profile for straw-viewer
183 - email clients whitelisting and fixes
102Benjamin Kampmann (https://github.com/ligthyear) 184Benjamin Kampmann (https://github.com/ligthyear)
103 - Forward exit code from child process 185 - Forward exit code from child process
186bitfreak25 (https://github.com/bitfreak25)
187 - added PlayOnLinux profile
188 - minetest profile fix
189 - added sylpheed profile
190
191bn0785ac (https://github.com/bn0785ac)
192 - fixed bnox, dnox profiles
193 - support all tor-browser langpacks
194 - chromium canary (inox-family) fixes
195 - allow multithreading for cin and natron
196 - fix dbus access for libreoffice on KDE
197 - fix inox, add snox profile
104BogDan Vatra (https://github.com/bog-dan-ro) 198BogDan Vatra (https://github.com/bog-dan-ro)
105 - zoom profile 199 - zoom profile
200Brad Ackerman
201 - blacklist Bitwarden config in disable-passwdmgr.inc
202briaeros (https://github.com/briaeros)
203 - fix command test in jail_prober.py
204botherer (https://github.com/botherder)
205 - add CoyIM profile
106Bruno Nova (https://github.com/brunonova) 206Bruno Nova (https://github.com/brunonova)
107 - whitelist fix 207 - whitelist fix
108 - bash arguments fix 208 - bash arguments fix
209Bundy01 (https://github.com/Bundy01)
210 - fixup geary
211 - add gradio profile
212 - update virtualbox.profile
213 - Quodlibet profile
109BytesTuner (https://github.com/BytesTuner) 214BytesTuner (https://github.com/BytesTuner)
110 - provided keepassxc profile 215 - provided keepassxc profile
111caoliver (https://github.com/caoliver) 216caoliver (https://github.com/caoliver)
112 - network system fixes 217 - network system fixes
218Carlo Abelli (https://github.com/carloabelli)
219 - fixed udiskie profile
220 - Allow mbind syscall for GIMP
221 - fixed simple-scan
113Cat (https://github.com/ecat3) 222Cat (https://github.com/ecat3)
114 - prevent tmux connecting to an existing session 223 - prevent tmux connecting to an existing session
224Christian Pinedo (https://github.com/chrpinedo)
225 - added nicotine profile
226 - allow python3 in totem profile
115creideiki (https://github.com/creideiki) 227creideiki (https://github.com/creideiki)
116 - make the sandbox process reap all children 228 - make the sandbox process reap all children
229 - tor browser profile fix
117chiraag-nataraj (https://github.com/chiraag-nataraj) 230chiraag-nataraj (https://github.com/chiraag-nataraj)
118 - support for newer Xpra versions (2.1+) 231 - support for newer Xpra versions (2.1+)
119 - added Viber, amule, ardour5, brackets, calligra, cin, fetchmail profiles 232 - added Viber, amule, ardour5, brackets, calligra, cin, fetchmail profiles
@@ -123,7 +236,18 @@ chiraag-nataraj (https://github.com/chiraag-nataraj)
123Christian Stadelmann (https://github.com/genodeftest) 236Christian Stadelmann (https://github.com/genodeftest)
124 - profile fixes 237 - profile fixes
125 - evolution profile fix 238 - evolution profile fix
126curiosity-seeker (https://github.com/curiosity-seeker) 239Clayton Williams (https://github.com/gosre)
240 - addition of RLIMIT_AS
241corecontingency (https://https://github.com/corecontingency)
242 - tighten private-bin and etc for torbrowser-launcher.profile
243 - added i2prouter profile
244 - add several games to steam and disable-programs
245crass (https://github.com/crass)
246 - extract_command_name fixes
247 - update appimage size calculation to newest code from libappimage
248 - firejail should look for processes with names exactly named
249curiosity-seeker (https://github.com/curiosity-seeker - old)
250curiosityseeker (https://github.com/curiosityseeker - new)
127 - tightening unbound and dnscrypt-proxy profiles 251 - tightening unbound and dnscrypt-proxy profiles
128 - correct and tighten QuiteRss profile 252 - correct and tighten QuiteRss profile
129 - dnsmasq profile 253 - dnsmasq profile
@@ -134,36 +258,90 @@ curiosity-seeker (https://github.com/curiosity-seeker)
134 - added VirtualBox.profile 258 - added VirtualBox.profile
135 - various other profile fixes 259 - various other profile fixes
136 - added digiKam profile 260 - added digiKam profile
261 - write-protection for thumbnailer dir
262 - added gramps, newsboat, freeoffice-planmaker profiles
263 - added freeoffice-textmaker, freeoffice-presentations profiles
264 - added cantata profile
265 - updated keypassxc profile
266 - added syscalls.sh, which determine the necessary syscalls for a program
267 - fixed conky profile
268 - thunderbird.profile: harden and enable the rules necessary to make Firefox open links
137da2x (https://github.com/da2x) 269da2x (https://github.com/da2x)
138 - matched RPM license tag 270 - matched RPM license tag
139Daan Bakker (https://github.com/dbakker) 271Daan Bakker (https://github.com/dbakker)
140 - protect shell startup files 272 - protect shell startup files
273Danil Semelenov (https://github.com/sgtpep)
274 - blacklist the Electron Cash Wallet
275 - blacklist s3cmd and s3fs configs
276 - blacklist Ethereum, Monero wallets
277 - blacklist Dash Core wallet
141Dara Adib (https://github.com/daradib) 278Dara Adib (https://github.com/daradib)
142 - ssh profile fix 279 - ssh profile fix
143 - evince profile fix 280 - evince profile fix
281 - linphone profile fix
282Dario Pellegrini (https://github.com/dpellegr)
283 - allowing links in netns
284David Thole (https://github.com/TheDarkTrumpet)
285 - added profile for teams-for-linux
286Davide Beatrici (https://github.com/davidebeatrici)
287 - steam.profile: correctly blacklist unneeded directories in user's home
288 - minetest fixes
289 - map /dev/input with "--private-dev", add "--no-input" option to disable it
290 - whitelist /usr/share/TelegramDesktop in telegram.profile
291David Hyrule (https://github.com/Svaag)
292 - remove nou2f in ssh profile
144Deelvesh Bunjun (https://github.com/DeelveshBunjun) 293Deelvesh Bunjun (https://github.com/DeelveshBunjun)
145 - added xpdf profile 294 - added xpdf profile
295Denys Havrysh (https://github.com/vutny)
296 - update SkypeForLinux profile for latest version
297 - removed outdated Skype profile
146dewbasaur (https://github.com/dewbasaur) 298dewbasaur (https://github.com/dewbasaur)
147 - block access to history files 299 - block access to history files
148 - Firefox PDF.js exploit (CVE-2015-4495) fixes 300 - Firefox PDF.js exploit (CVE-2015-4495) fixes
149 - Steam profile 301 - Steam profile
302DiGitHubCap (https://github.com/DiGitHubCap)
303 - deluge profile fix
304 - fix qt5ct colour schemes and QSS
305Disconnect3d (https://github.com/disconnect3d)
306 - code cleanup
307dmfreemon (https://github.com/dmfreemon)
308 - add sandbox name or name of private directory to the window title when xpra is used
309 - handle malloc() failures; use gnu_basename() instead of basenaem()
150dshmgh (https://github.com/dshmgh) 310dshmgh (https://github.com/dshmgh)
151 - overlayfs fix for systems with /home mounted on a separate partition 311 - overlayfs fix for systems with /home mounted on a separate partition
152Duncan Overbruck (https://github.com/Duncaen) 312Duncan Overbruck (https://github.com/Duncaen)
153 - musl libc fix 313 - musl libc fix
154 - utmp fix 314 - utmp fix
155 - fix install for --disable-seccomp software configurations 315 - fix install for --disable-seccomp software configurations
316Eduard Tolosa (https://github.com/Edu4rdSHL)
317 - fixed and hardened qpdfview.profile
318 - fixed gajim.profile
156emacsomancer (https://github.com/emacsomancer) 319emacsomancer (https://github.com/emacsomancer)
157 - added profile for Conkeror browser 320 - added profile for Conkeror browser
321Emil Gedda (https://github.com/EmilGedda)
322 - fix multicast CIDR address in nolocal.net
158eventyrer (https://github.com/eventyrer) 323eventyrer (https://github.com/eventyrer)
159 - update gnome-mplayer.profile 324 - update gnome-mplayer.profile
325Ethan R (https://github.com/AN3223)
326 - add allow-perl.inc to w3m.profile
160Fabian Würfl (https://github.com/BafDyce) 327Fabian Würfl (https://github.com/BafDyce)
161 - fixed race condition when creating a new directory 328 - fixed race condition when creating a new directory
162 - Liferea profile 329 - Liferea profile
163Felipe Barriga Richards (https://github.com/fbarriga) 330Felipe Barriga Richards (https://github.com/fbarriga)
164 - --private-etc fix 331 - --private-etc fix
332fenuks (https://github.com/fenuks)
333 - fix sound in games using FMOD
334Florian Begusch (https://github.com/florianbegusch)
335 - (la)tex profiles
336 - fixed transmission-common.profile
337 - fixed standardnotes-desktop.profile
338 - fix jailprober.py
339floxo (https://github.com/floxo)
340 - fixed qml disk cache issue
165Franco (nextime) Lanza (https://github.com/nextime) 341Franco (nextime) Lanza (https://github.com/nextime)
166 - added --private-template/--private-home 342 - added --private-template/--private-home
343František Polášek (https://github.com/fandaa)
344 - fix QOwnNotes profile
167fuelflo (https://github.com/fuelflo) 345fuelflo (https://github.com/fuelflo)
168 - added rambox profile 346 - added rambox profile
169Fred-Barclay (https://github.com/Fred-Barclay) 347Fred-Barclay (https://github.com/Fred-Barclay)
@@ -212,13 +390,44 @@ Fred-Barclay (https://github.com/Fred-Barclay)
212 - added BibleTime profile 390 - added BibleTime profile
213 - added caja and galculator profiles 391 - added caja and galculator profiles
214 - added Catfish profile 392 - added Catfish profile
215G4JC (http://sourceforge.net/u/gaming4jc/profile/) 393Frederik Olesen (https://github.com/Freso)
394 - added many vim profiles
395g3ngr33n (https://github.com/g3ngr33n)
396 - fix musl compilation
397G4JC (https://sourceforge.net/u/gaming4jc/profile/)
216 - ARM support 398 - ARM support
217 - profile fixes 399 - profile fixes
218Gaman Gabriel (https://github.com/stelariusinfinitek) 400Gaman Gabriel (https://github.com/stelariusinfinitek)
219 - inox profile 401 - inox profile
220geg2048 (https://github.com/geg2048) 402geg2048 (https://github.com/geg2048)
221 - kwallet profile fixes 403 - kwallet profile fixes
404glitsj16 (https://github.com/glitsj16)
405 - evince-previewer, evince-thumbnailer profiles
406 - gnome-recipes, gnome-logs profiles
407 - fixed private-lib for gnome-calculator
408 - gunzip, bunzip2 profiles
409 - enchant, enchat-2, enchant-lsmod, enchant-lsmod-2 profiles
410 - atool, soundconvertor, mpd, gnome-calculator, makepkg profile fixes
411 - acat, adiff, als, apack, arepack, aunpack profiles,
412 - fix sqlitebrowser blacklist
413 - spelling fixes
414 - bitblbee profile fixes
415 - fix firefox common addons
416 - many profile fixes
417 - profile fixes: file, strings, claws-mail,
418 - new profiles: QMediathekView, aria2c, Authenticator, checkbashisms
419 - new profiles: devilspie, devilspie2, easystroke, github-desktop, min
420 - new profiles: bsdcat, bsdcpio, bsdtar, lzmadec, lbunzip2, lbzcat
421 - new profiles: lbzip2, lzcat, lzcmp, lzdiff, lzegrep, lzfgrep, lzgrep
422 - new profiles: lzless, lzma, lzmainfo, lzmore, unlzma, unxz, xzcat
423 - new profiles: xzcmp, xzdiff, xzegrep, xzfgrep, xzgrep, xzless, xzmore
424 - new profiles: lzip, artha, nitroshare, nitroshare-cli, nitroshare-nmh
425 - new profiles: nirtoshare-send, nitroshare-ui, mencoder, gnome-pie
426 - new profiles: masterpdfeditor
427gm10 (https://github.com/gm10)
428 - get_user() do not use the unreliable getlogin()
429GovanifY (https://github.com/GovanifY)
430 - Blacklisting openrc paths by defaults
222graywolf (https://github.com/graywolf) 431graywolf (https://github.com/graywolf)
223 - spelling fix 432 - spelling fix
224greigdp (https://github.com/greigdp) 433greigdp (https://github.com/greigdp)
@@ -226,18 +435,32 @@ greigdp (https://github.com/greigdp)
226 - fixed spotify profile 435 - fixed spotify profile
227 - added Slack profile 436 - added Slack profile
228 - add Spotify profile 437 - add Spotify profile
438grizzlyuser (https://github.com/grizzlyuser)
439 - added support for youtube-dl in smplayer profile
229GSI (https://github.com/GSI) 440GSI (https://github.com/GSI)
230 - added Uzbl browser profile 441 - added Uzbl browser profile
442haarp (https://github.com/haarp)
443 - Allow sound for hexchat
231hamzadis (https://github.com/hamzadis) 444hamzadis (https://github.com/hamzadis)
232 - added --overlay-named=name and --overlay-path=path 445 - added --overlay-named=name and --overlay-path=path
446Hans-Christoph Steiner (https://github.com/eighthave)
447 - added xournal profile
448Harald Kubota (https://github.com/haraldkubota)
449 - zsh completion
233hawkey116477 (https://github.com/hawkeye116477) 450hawkey116477 (https://github.com/hawkeye116477)
234 - added Waterfox profile 451 - added Waterfox profile
235 - updated Cyberfox profile 452 - updated Cyberfox profile
236 - updated Waterfox profile 453 - updated Waterfox profile
237Helmut Grohne (https://github.com/helmutg) 454Helmut Grohne (https://github.com/helmutg)
238 - compiler support in the build system - Debian bug #869707 455 - compiler support in the build system - Debian bug #869707
456hhzek0014 (https://github.com/hhzek0014)
457 - updated bibletime.profile
458hlein (https://github.com/hlein)
459 - strip out \r's from jail prober
239Holger Heinz (https://github.com/hheinz) 460Holger Heinz (https://github.com/hheinz)
240 - manpage work 461 - manpage work
462Haowei Yu (https://github.com/sfc-gh-hyu)
463 - add configure options when building rpm
241Icaro Perseo (https://github.com/icaroperseo) 464Icaro Perseo (https://github.com/icaroperseo)
242 - Icecat profile 465 - Icecat profile
243 - several profile fixes 466 - several profile fixes
@@ -247,17 +470,47 @@ iiotx (https://github.com/iiotx)
247 - use generic.profile by default 470 - use generic.profile by default
248Impyy (https://github.com/Impyy) 471Impyy (https://github.com/Impyy)
249 - added mumble profile 472 - added mumble profile
473intika (https://github.com/intika)
474 - added musixmatch profile
475irandms (https://github.com/irandms)
476 - man firecfg fixes
250irregulator (https://github.com/irregulator) 477irregulator (https://github.com/irregulator)
251 - thunderbird profile fixes for debian stretch 478 - thunderbird profile fixes for debian stretch
252Irvine (https://github.com/Irvinehimself) 479Irvine (https://github.com/Irvinehimself)
253 - added conky profile 480 - added conky profile
481 - added ping, bsdtar, makepkg (Arch), archaudit-report, cower (Arch) profiles
482Ivan (https://github.com/ordinary-dev)
483 - fix telegram profile
254Ivan Kozik (https://github.com/ivan) 484Ivan Kozik (https://github.com/ivan)
255 - speed up sandbox exit 485 - speed up sandbox exit
256Jaykishan Mutkawoa (https://github.com/jmutkawoa) 486Jaykishan Mutkawoa (https://github.com/jmutkawoa)
257 - cpio profile 487 - cpio profile
258James Elford (https://github.com/jelford) 488James Elford (https://github.com/jelford)
259 - pass password manager support 489 - pass password manager support
260 - removed shell none from ssh-agent configuration, fixing the infinit loop 490 - removed shell none from ssh-agent configuration, fixing the infinite loop
491 - added gcloud profile
492 - blacklist sensitive cloud provider files in disable-common
493Jean Lucas (https://github.com/flacks)
494 - fix Discord profile
495 - add AnyDesk profile
496 - add WebStorm profile
497 - add XMind profile
498 - add Whalebird profile
499 - add zulip profile
500 - add nvm to list of disabled interpreters
501 - fixes for tor-browser-* profiles
502 - alias for riot-desktop
503 - add gnome-mpv profile
504 - fix wire profile
505 - fix itch profile
506 - add Beaker profile
507 - fixes for gnome-music
508 - allow reading of system-wide Flatpak locale in gajim profile
509Jean-Philippe Eisenbarth (https://github.com/jpeisenbarth)
510 - fixed spotify.profile
511Jeff Squyres (https://github.com/jsquyres)
512 - various manpage fixes
513 - cmdline.c: optionally quote the resulting command line
261Jericho (https://github.com/attritionorg) 514Jericho (https://github.com/attritionorg)
262 - spelling 515 - spelling
263Jesse Smith (https://github.com/slicer69) 516Jesse Smith (https://github.com/slicer69)
@@ -270,6 +523,19 @@ Joan Figueras (https://github.com/figue)
270 - added cyberfox profile 523 - added cyberfox profile
271John Mullee (https://github.com/jmullee) 524John Mullee (https://github.com/jmullee)
272 - fix empty-string assignment in whitelisting code 525 - fix empty-string assignment in whitelisting code
526Jonas Heinrich (https://github.com/onny)
527 - added signal-desktop profile
528 - fixed franz profile
529Jose Riha (https://github.com/jose1711)
530 - added meteo-qt profile
531 - created qgis, links, xlinks profiles
532 - extended profile.template with comments
533 - some typo and comment fixes in profile.template
534 - Make it possible for cheese app to save pictures too
535 - Add davfs2 secrets file to blacklist
536 - Add profile for udiskie
537 - fix udiskie.profile
538 - improve hints for allowing browser access to Gnome extensions connector
273jrabe (https://github.com/jrabe) 539jrabe (https://github.com/jrabe)
274 - disallow access to kdbx files 540 - disallow access to kdbx files
275 - Epiphany profile 541 - Epiphany profile
@@ -282,6 +548,8 @@ juan (https://github.com/nyancat18)
282 - profile hardening 548 - profile hardening
283Kaan Genç (https://github.com/SeriousBug) 549Kaan Genç (https://github.com/SeriousBug)
284 - dynamic allocation of noblacklist buffer 550 - dynamic allocation of noblacklist buffer
551Karoshi42 (https://github.com/karoshi42)
552 - update dino-im.profile
285KellerFuchs (https://github.com/KellerFuchs) 553KellerFuchs (https://github.com/KellerFuchs)
286 - nonewpriv support, extended profiles for this feature 554 - nonewpriv support, extended profiles for this feature
287 - make `restricted-network` prevent use of netfilter 555 - make `restricted-network` prevent use of netfilter
@@ -290,8 +558,35 @@ KellerFuchs (https://github.com/KellerFuchs)
290 - added support for .local profile files in /etc/firejail 558 - added support for .local profile files in /etc/firejail
291 - fixed Cryptocat profile 559 - fixed Cryptocat profile
292 - make ~/.local read-only 560 - make ~/.local read-only
561Kelvin (https://github.com/kmk3)
562 - disable ldns utilities, dnssec-*, khost, unbound-host
563 - sort DNS / RUNUSER paths
564 - improve bug_report.md
565 - fix keypassxc
566 - blacklist oksh shell in disable-shell.inc
567Kishore96in (https://github.com/Kishore96in)
568 - added falkon profile
569 - kxmlgui fixes
570 - okular profile fixes
571 - jitsi-meet-desktop profile
572 - konversatin profile fix
573 - added Neochat profile
574 - added whitelist-1793-workaround.inc
293KOLANICH (https://github.com/KOLANICH) 575KOLANICH (https://github.com/KOLANICH)
294 - added symlink fixer fix_private-bin.py in contrib section 576 - added symlink fixer fix_private-bin.py in contrib section
577 - update fix_private-bin.py
578 - fix meld
579kortewegdevries (https://github.com/kortewegdevries)
580 - a whole bunch of new profiles and fixes
581 - whitelisting evolution, kmail
582Kristóf Marussy (https://github.com/kris7t)
583 - dns support
584kuesji koesnu (https://github.com/kuesji)
585 - unit suffixes for rlimit-fsize and rlimit-as
586 - util.c and firejail.h fixes
587 - better parser for size strings
588Kunal Mehta (https://github.com/legoktm)
589 - converted all links to https in manpages
295laniakea64 (https://github.com/laniakea64) 590laniakea64 (https://github.com/laniakea64)
296 - added fj-mkdeb.py script to build deb packages 591 - added fj-mkdeb.py script to build deb packages
297Lari Rauno (https://github.com/tuutti) 592Lari Rauno (https://github.com/tuutti)
@@ -302,6 +597,21 @@ LaurentGH (https://github.com/LaurentGH)
302 - allow private-bin parameters to be absolute paths 597 - allow private-bin parameters to be absolute paths
303Loïc Damien (https://github.com/dzamlo) 598Loïc Damien (https://github.com/dzamlo)
304 - small fixes 599 - small fixes
600Liorst4 (https://github.com/Liorst4)
601 - Preserve CFLAGS given to configure in common.mk.in
602 - fix emacs config to load as read-write
603 - disable browser drm by default
604 - minetest fixes
605Lockdis (https://github.com/Lockdis)
606 - Added crow, nyx, and google-earth-pro profiles
607Lukáš Krejčí (https://github.com/lskrejci)
608 - fixed parsing of --keep-var-tmp
609luzpaz (https://github.com/luzpaz)
610 - code spelling fixes
611lxeiqr (https://github.com/lxeiqr)
612 - fix sndio support
613Mace Muilman (https://github.com/mace015)
614 - google-chrome{,beta,unstable} flags
305maces (https://github.com/maces) 615maces (https://github.com/maces)
306 - Franz messenger profile 616 - Franz messenger profile
307Madura A (https://github.com/manushanga) 617Madura A (https://github.com/manushanga)
@@ -309,6 +619,8 @@ Madura A (https://github.com/manushanga)
309mahdi1234 (https://github.com/mahdi1234) 619mahdi1234 (https://github.com/mahdi1234)
310 - cherrytree profile 620 - cherrytree profile
311 - Seamonkey profiles 621 - Seamonkey profiles
622Manuel Dipolt (https://github.com/xeniter)
623 - stack alignment for the ARM Architecture
312Martin Carpenter (https://github.com/mcarpenter) 624Martin Carpenter (https://github.com/mcarpenter)
313 - security audit and bug fixes 625 - security audit and bug fixes
314 - Centos 6.x support 626 - Centos 6.x support
@@ -321,31 +633,92 @@ Mattias Wadman (https://github.com/wader)
321 - seccomp errno filter support 633 - seccomp errno filter support
322Matthew Gyurgyik (https://github.com/pyther) 634Matthew Gyurgyik (https://github.com/pyther)
323 - rpm spec and several fixes 635 - rpm spec and several fixes
324melvinvermeeren (https://github.com/melvinvermeeren) 636Matthew Cline (https://github.com/matthew-cline)
637 - steam profile and dropbox profile fixes
638matu3ba (https://github.com/matu3ba)
639 - evince hardening, dbus removed
640 - fix dia profile
641 - several template fixes
642maxice8 (https://github.com/maxice8)
643 - fixed missing header
644Melvin Vermeeren (https://github.com/melvinvermeeren)
325 - added teamspeak3 profile 645 - added teamspeak3 profile
646 - added --noautopulse command line option
326Michael Haas (https://github.com/mhaas) 647Michael Haas (https://github.com/mhaas)
327 - bugfixes 648 - bugfixes
649Michael Hoffmann (https://github.com/brisad)
650 - added support for subdirs in private-etc
328Mike Frysinger (vapier@gentoo.org) 651Mike Frysinger (vapier@gentoo.org)
329 - Gentoo compile patch 652 - Gentoo compile patch
653minus7 (https://github.com/minus7)
654 - fix hanging arp_check
655mirabellette (https://github.com/mirabellette)
656 - add comment to thunderbird.profile to allow Firefox to load profiles
330mjudtmann (https://github.com/mjudtmann) 657mjudtmann (https://github.com/mjudtmann)
331 - lock firejail configuration in disable-mgmt.inc 658 - lock firejail configuration in disable-mgmt.inc
332mustaqimM (https://github.com/mustaqimM) 659mustaqimM (https://github.com/mustaqimM)
333 - added profile for Nylas Mail 660 - added profile for Nylas Mail
334n1trux (https://github.com/n1trux) 661n1trux (https://github.com/n1trux)
335 - fix flashpeak-slimjet profile typos 662 - fix flashpeak-slimjet profile typos
336netblue30 (netblue30@yahoo.com) 663nblock (https://github.com/nblock)
664 - cmus: allow access to resolv.conf
665neirenoir (https://github.com/neirenoir) and noir <noir@neire.dev>
666 - fixed Blender profile being unable to import numpy
667Neo00001 (https://github.com/Neo00001)
668 - add vmware profile
669 - update virtualbox profile
670 - update telegram profile
671 - add spectacle profile
672 - add kdiff3 profile
673NetSysFire (https://github.com/NetSysFire)
674 - update weechat profile
675Nick Fox (https://github.com/njfox)
676 - add a profile alias for code-oss
677 - add code-oss config directory
678 - fix wire-desktop.profile on arch
679NickMolloy (https://github.com/NickMolloy)
680 - ARP address length fix
681Nico (https://github.com/dr460nf1r3)
682 - added FireDragon profile
683Nicola Davide Mannarelli (https://github.com/nidamanx)
684 - fix "Could not create AF_NETLINK socket"
685 - added nextcloud profiles
686 - Firefox, KeepassXC, Telegram fixes
337Niklas Haas (https://github.com/haasn) 687Niklas Haas (https://github.com/haasn)
338 - blacklisting for keybase.io's client 688 - blacklisting for keybase.io's client
689Niklas Goerke (https://github.com/Niklas974)
690 - update QOwnNotes profile
691Nikos Chantziaras (https://github.com/realnc)
692 - fix audio support for Discord
693nolanl (https://github.com/nolanl)
694 - added localtime to signal-desktop's profile
339nyancat18 (https://github.com/nyancat18) 695nyancat18 (https://github.com/nyancat18)
340 - added ardour4, dooble, karbon, krita profiles 696 - added ardour4, dooble, karbon, krita profiles
341Ondra Nekola (https://github.com/satai) 697Ondra Nekola (https://github.com/satai)
342 - allow firefox theming with non-global themes 698 - allow firefox theming with non-global themes
699OndrejMalek (https://github.com/OndrejMalek)
700 - various manpage fixes
701Ondřej Nový (https://github.com/onovy)
702 - allow video for Signal profile
703 - added Mattermost desktop profile
704 - hardened Zoom profile
705 - hardened Signal desktop profile
706Lorenzo "Palinuro" Faletra (https://github.com/PalinuroSec)
707 - prevent thunderbird conflicts when firefox is running
708 - add join-or-start to pluma to open multiple files in tabs
709 - fixes to keepassxc, thunderbird and pluma
343Panzerfather (https://github.com/Panzerfather) 710Panzerfather (https://github.com/Panzerfather)
344 - allow eog to access user's trash 711 - allow eog to access user's trash
345Patrick Toomey (http://sourceforge.net/u/ptoomey/profile/) 712Patrick Schleizer (https://github.com/adrelanos)
713 - fix tb-starter-wrapper profile
714Patrick Toomey (https://sourceforge.net/u/ptoomey/profile/)
346 - user namespace implementation 715 - user namespace implementation
716Paul Moore <pmoore@redhat.com>
717 -src/fsec-print/print.c extracted from libseccomp software package
347Paupiah Yash (https://github.com/CaffeinatedStud) 718Paupiah Yash (https://github.com/CaffeinatedStud)
348 - gzip profile 719 - gzip profile
720Pawel (https://github.com/grimskies)
721 - make --join return exit code of the invoked program
349Peter Millerchip (https://github.com/pmillerchip) 722Peter Millerchip (https://github.com/pmillerchip)
350 - memory allocation fix 723 - memory allocation fix
351 - --private.keep to --private-home transition 724 - --private.keep to --private-home transition
@@ -359,18 +732,43 @@ Peter Hogg (https://github.com/pigmonkey)
359 - bitlbee profile fixes 732 - bitlbee profile fixes
360 - mutt profile fixes 733 - mutt profile fixes
361 - fixes for youtube-dl in mpv profile 734 - fixes for youtube-dl in mpv profile
735Peter Sanford (https://github.com/psanford)
736 - fix QtWebEngine in zoom
362Petter Reinholdtsen (pere@hungry.com) 737Petter Reinholdtsen (pere@hungry.com)
363 - Opera profile patch 738 - Opera profile patch
364PharmaceuticalCobweb (https://github.com/PharmaceuticalCobweb) 739PharmaceuticalCobweb (https://github.com/PharmaceuticalCobweb)
365 - fix quiterss profile 740 - fix quiterss profile
366 - added profile for gnome-ring 741 - added profile for gnome-ring
742pholodniak (https://github.com/pholodniak)
743 - profstats fixes
744pianoslum (https://github.com/pianoslum)
745 - nodbus breaking evince two-page-view warning
367pirate486743186 (https://github.com/pirate486743186) 746pirate486743186 (https://github.com/pirate486743186)
368 - KMail profile 747 - KMail profile
748 - mpsyt profile
749 - fix youtube-dl and mpv
750 - fix gnome-mpv profile
751 - fix gunzip profile
752 - reorganizing youtube-viewers
753 - fix pluma profile
754 - whitelist /var/lib/aspell
755 - mcomix fixes
756 - fixing engrampa profile
757 - adding qcomicbook and pipe-viewer in disable-programs
758 - newsboat/newsbeuter profiles
759 - fix atril profile
760 - reorganizing links browsers
761 - added rtv, alpine, mcomix, qcomicbook, googler, ddgr profiles
762 - w3m, zahura, profile.template fixes
369Pixel Fairy (https://github.com/xahare) 763Pixel Fairy (https://github.com/xahare)
370 - added fjclip.py, fjdisplay.py and fjresize.py in contrib section 764 - added fjclip.py, fjdisplay.py and fjresize.py in contrib section
371PizzaDude (https://github.com/pizzadude) 765PizzaDude (https://github.com/pizzadude)
372 - add mpv support to smplayer 766 - add mpv support to smplayer
373 - added profile for torbrowser-launcher 767 - added profile for torbrowser-launcher
768 - added profile for sayonara and qmmp
769 - remove tracelog from Firefox profile
770polyzen (https://github.com/polyzen)
771 - fixed wusc issue with mpv/Vulkan
374probonopd (https://github.com/probonopd) 772probonopd (https://github.com/probonopd)
375 - automatic build on Travis CI 773 - automatic build on Travis CI
376pshpsh (https://github.com/pshpsh) 774pshpsh (https://github.com/pshpsh)
@@ -381,6 +779,11 @@ pszxzsd (https://github.com/pszxzsd)
381 -uGet profile 779 -uGet profile
382pwnage-pineapple (https://github.com/pwnage-pineapple) 780pwnage-pineapple (https://github.com/pwnage-pineapple)
383 - update Okular profile 781 - update Okular profile
782Quentin Minster (https://github.com/laomaiweng)
783 - propagate --quiet to children Firejail'ed processes
784 - nodbus enhancements/bugfixes
785 - added vim syntax and ftdetect files
786 - Allow exec from /usr/libexec & co. with AppArmor
384Rafael Cavalcanti (https://github.com/rccavalcanti) 787Rafael Cavalcanti (https://github.com/rccavalcanti)
385 - chromium profile fixes for Arch Linux 788 - chromium profile fixes for Arch Linux
386Rahiel Kasim (https://github.com/rahiel) 789Rahiel Kasim (https://github.com/rahiel)
@@ -390,8 +793,14 @@ Rahiel Kasim (https://github.com/rahiel)
390 - added telegram-desktop profile 793 - added telegram-desktop profile
391Rahul Golam (https://github.com/technoLord) 794Rahul Golam (https://github.com/technoLord)
392 - strings profile 795 - strings profile
796RandomVoid (https://github.com/RandomVoid)
797 - fix building C# projects in Godot
798 - fix Lutris profile
799 - fix running games with enabled Feral GameMode in Lutris
393Raphaël Droz (https://github.com/drzraf) 800Raphaël Droz (https://github.com/drzraf)
394 - zoom profile fixes 801 - zoom profile fixes
802realaltffour (https://github.com/realaltffour)
803 - add lynx support to newsboat profile
395Reiner Herrmann (https://github.com/reinerh) 804Reiner Herrmann (https://github.com/reinerh)
396 - a number of build patches 805 - a number of build patches
397 - man page fixes 806 - man page fixes
@@ -405,16 +814,50 @@ Reiner Herrmann (https://github.com/reinerh)
405Remco Verhoef (https://github.com/nl5887) 814Remco Verhoef (https://github.com/nl5887)
406 - add overlay configuration to profiles 815 - add overlay configuration to profiles
407 - prevent running shells recursively 816 - prevent running shells recursively
817RD PROJEKT (https://github.com/RDProjekt)
818 - noblacklist support for /sys/module directory
819 - whitelist support for /sys/module directory
820 - support AMD GPU by OpenCL in Blender
408rogshdo (https://github.com/rogshdo) 821rogshdo (https://github.com/rogshdo)
409 - BitlBee profile 822 - BitlBee profile
823rootalc (https://github.com/rootalc)
824 - add nolocal6.net filter
410Ruan (https://github.com/ruany) 825Ruan (https://github.com/ruany)
411 - fixed hexchat profile 826 - fixed hexchat profile
827rusty-snake (https://github.com/rusty-snake)
828 - added profiles: thunderbird-wayland, supertuxkart, ghostwriter
829 - added profiles: klavaro, mypaint, mypaint-ora-thumbnailer, nano
830 - added profiles: gajim-history-manager, freemind, nomacs, kid3
831 - added profiles: kid3-qt, kid3-cli, anki, utox, mp3splt, mp3wrap
832 - added profiles: oggsplt, flacsplt, cheese, inkview, mp3splt-gtk
833 - added profiles: ktouch, yelp, klatexformula, klatexformula_cmdl
834 - added profiles: pandoc, gnome-sound-recorder, godot, newsbeuter
835 - added profiles: keepassxc-cli, keepassxc-proxy, rhythmbox-client
836 - added profiles: zeal, gnome-characters, gnome-character-map
837 - many profile fixing and hardening
838 - some typo fixes
839 - added profile templates
840 - added sort.py to contrib
841sak96 (https://github.com/sak96)
842 - discord profile fixes
843Salvo 'LtWorf' Tomaselli (https://github.com/ltworf)
844 - fixed ktorrent profile
412sarneaud (https://github.com/sarneaud) 845sarneaud (https://github.com/sarneaud)
413 - rewrite globbing code to fix various minor issues 846 - rewrite globbing code to fix various minor issues
414 - added noblacklist command for profile files 847 - added noblacklist command for profile files
415 - various enhancements and bug fixes 848 - various enhancements and bug fixes
849Sebastian Hafner (https://github.com/DropNib)
850 - profile support for allow-debuggers
851Senemu (https://github.com/Senemu)
852 - protection for .pythonrc.py
853 - fixed evince
416Sergey Alirzaev (https://github.com/l29ah) 854Sergey Alirzaev (https://github.com/l29ah)
417 - firejail.h enum fix 855 - firejail.h enum fix
856 - firefox-common-addons.inc: + tridactyl
857Slava Monich (https://github.com/monich)
858 - added configure option to disable man pages
859Tobias Schmidl (https://github.com/schtobia)
860 - added profile for webui-aria2
418Simon Peter (https://github.com/probonopd) 861Simon Peter (https://github.com/probonopd)
419 - set $APPIMAGE and $APPDIR environment variables 862 - set $APPIMAGE and $APPDIR environment variables
420 - AppImage version detection 863 - AppImage version detection
@@ -423,7 +866,11 @@ Simon Peter (https://github.com/probonopd)
423sinkuu (https://github.com/sinkuu) 866sinkuu (https://github.com/sinkuu)
424 - blacklisting kwalletd 867 - blacklisting kwalletd
425 - fix symlink invocation for programs placing symlinks in $PATH 868 - fix symlink invocation for programs placing symlinks in $PATH
426smithsohu (https://github.com/smitsohu) 869Simo Piiroinen (https://github.com/spiiroin)
870 - Jolla/SailfishOS patches
871slowpeek (https://github.com/slowpeek)
872 - refine appimage example in docs
873smitsohu (https://github.com/smitsohu)
427 - read-only kde4 services directory 874 - read-only kde4 services directory
428 - enhanced mediathekview profile 875 - enhanced mediathekview profile
429 - added tuxguitar profile 876 - added tuxguitar profile
@@ -439,7 +886,11 @@ smithsohu (https://github.com/smitsohu)
439soredake (https://github.com/soredake) 886soredake (https://github.com/soredake)
440 - fix steam startup with >=llvm-4 887 - fix steam startup with >=llvm-4
441 - fix handling of STEAM_RUNTIME_PREFER_HOST_LIBRARIES in steam profile 888 - fix handling of STEAM_RUNTIME_PREFER_HOST_LIBRARIES in steam profile
442SpotComms (https://github.com/SpotComms) 889 - fix keepassxc.profile
890 - fix qtox.profile
891 - add localtime to private-etc to make qtox show correct time
892 - fixes for the keepassxc 2.2.5 version
893SkewedZeppelin (https://github.com/SkewedZeppelin)
443 - added Bless, Gnome 2048, Gnome Calculator, Gnome Contacts, JD-GUI, Lollypop, MultiMC5 profiles 894 - added Bless, Gnome 2048, Gnome Calculator, Gnome Contacts, JD-GUI, Lollypop, MultiMC5 profiles
444 - added PDFSam, Pithos, and Xonotic profiles 895 - added PDFSam, Pithos, and Xonotic profiles
445 - disabled Go, Rust, and OpenSSL in disable-devel.conf 896 - disabled Go, Rust, and OpenSSL in disable-devel.conf
@@ -470,7 +921,7 @@ SpotComms (https://github.com/SpotComms)
470 - hardern /var 921 - hardern /var
471 - profile standard layout 922 - profile standard layout
472 - Spotify and itch.io profile fixes 923 - Spotify and itch.io profile fixes
473sshirokov (http://sourceforge.net/u/yshirokov/profile/) 924sshirokov (https://sourceforge.net/u/yshirokov/profile/)
474 - Patch to output "Reading profile" to stderr instead of stdout 925 - Patch to output "Reading profile" to stderr instead of stdout
475SYN-cook (https://github.com/SYN-cook) 926SYN-cook (https://github.com/SYN-cook)
476 - keepass/keepassx browser fixes 927 - keepass/keepassx browser fixes
@@ -505,6 +956,12 @@ startx2017 (https://github.com/startx2017)
505 - handbrake profile 956 - handbrake profile
506 - mplayer and smplayer profiles 957 - mplayer and smplayer profiles
507 - kwrite and geary profiles 958 - kwrite and geary profiles
959StelFux (https://github.com/StelFux)
960 - Fix youtube video in totem
961the-antz (https://github.com/the-antz)
962 - Fix libx265 encoding in ffmpeg profile
963 - Fix Firefox profile
964 - Profile tweaks
508thewisenerd (https://github.com/thewisenerd) 965thewisenerd (https://github.com/thewisenerd)
509 - allow multiple private-home commands 966 - allow multiple private-home commands
510 - use $SHELL variable if the shell is not specified 967 - use $SHELL variable if the shell is not specified
@@ -519,10 +976,17 @@ Thomas Jarosch (https://github.com/thomasjfox)
519 - added lstat() / lstat64() support to libtrace 976 - added lstat() / lstat64() support to libtrace
520 - include mkuid.sh in make dist 977 - include mkuid.sh in make dist
521 - cppcheck bugfixes 978 - cppcheck bugfixes
979Timo Hardebusch (https://github.com/tihadot)
980 - add signal-cli profile
981 - KeePassXC: added a warning regarding tray icon
982tinmanx (https://github.com/tinmanx)
983 - remove network access from cherrytree.profile
522Tom Mellor (https://github.com/kalegrill) 984Tom Mellor (https://github.com/kalegrill)
523 - mupen64plus profile 985 - mupen64plus profile
524Tomasz Jan Góralczyk (https://github.com/tjg) 986Tomasz Jan Góralczyk (https://github.com/tjg)
525 - fixed Steam profile 987 - fixed Steam profile
988Tomi Leppänen (https://github.com/Tomin1)
989 - Jolla/SailfishOS patches
526Topi Miettinen (https://github.com/topimiettinen) 990Topi Miettinen (https://github.com/topimiettinen)
527 - improved seccomp printing 991 - improved seccomp printing
528 - improve mount handling, fix /run/user handling 992 - improve mount handling, fix /run/user handling
@@ -530,8 +994,15 @@ Topi Miettinen (https://github.com/topimiettinen)
530 - seccomp default list update 994 - seccomp default list update
531 - improve loading of seccomp filter and memory-deny-write-execute feature 995 - improve loading of seccomp filter and memory-deny-write-execute feature
532 - private-lib feature 996 - private-lib feature
997 - make --nodbus block also system D-Bus socket
998Ted Robertson (https://github.com/tredondo)
999 - webstorm profile fixes
1000 - added bcompare profile
1001 - various documentation fixes
533user1024 (user1024@tut.by) 1002user1024 (user1024@tut.by)
534 - electron profile whitelisting 1003 - electron profile whitelisting
1004 - fixed Rocket.Chat profile
1005 - nheko profile
535valoq (https://github.com/valoq) 1006valoq (https://github.com/valoq)
536 - lots of profile fixes 1007 - lots of profile fixes
537 - added support for /srv in --whitelist feature 1008 - added support for /srv in --whitelist feature
@@ -559,21 +1030,47 @@ Vasya Novikov (https://github.com/vn971)
559 - fixed firecfg clean/clear issue 1030 - fixed firecfg clean/clear issue
560 - found the ugliest bug so far 1031 - found the ugliest bug so far
561 - seccomp debug description in man page 1032 - seccomp debug description in man page
1033 - seccomp syscall list update for glibc 2.26-10
562Veeti Paananen (https://github.com/veeti) 1034Veeti Paananen (https://github.com/veeti)
563 - fixed Spotify profile 1035 - fixed Spotify profile
1036veloute (https://github.com/veloute)
1037 - added standardnotes profile
1038 - added flameshot profile
1039 - added jdownloader profile
1040 - fixed discord profile
1041 - fixes for various profiles
1042 - removed vim and ranger from firecfg
1043 - fixing keepassxc auto-type, noexec /tmp
1044 - fix ipc-namespace prblem in file-roller
1045 - fix exiftool, viewnior, aria2c, ffmpegthumbnailer
1046 - fix pavucontrol (ipcnamespace)
1047 - fix gnuchess
1048 - add anki profile
1049Vincent43 (https://github.com/Vincent43)
1050 - apparmor enhancements
1051Vincent Blillault (https://github.com/Feandil)
1052 - fix mumble profile
564vismir2 (https://github.com/vismir2) 1053vismir2 (https://github.com/vismir2)
565 - feh, ranger, 7z, keepass, keepassx and zathura profiles 1054 - feh, ranger, 7z, keepass, keepassx and zathura profiles
566 - claws-mail, mutt, git, emacs, vim profiles 1055 - claws-mail, mutt, git, emacs, vim profiles
567 - lots of profile fixes 1056 - lots of profile fixes
568 - support for truecrypt and zuluCrypt 1057 - support for truecrypt and zuluCrypt
1058viq (https://github.com/viq)
1059 - discord-canary profile
569Vladimir Gorelov (https://github.com/larkvirtual) 1060Vladimir Gorelov (https://github.com/larkvirtual)
570 - added Yandex browser profile 1061 - added Yandex browser profile
571Vladimir Schowalter (https://github.com/VladimirSchowalter20) 1062Vladimir Schowalter (https://github.com/VladimirSchowalter20)
572 - apparmor profile enhancements 1063 - apparmor profile enhancements
573 - various KDE profile enhancements 1064 - various KDE profile enhancements
574 read-only kde5 services directory 1065 read-only kde5 services directory
1066Vladislav Nepogodin (https://github.com/vnepogodin)
1067 - added Librewolf profiles
1068 - added Sway profile
1069 - fix CLion profile
575xee5ch (https://github.com/xee5ch) 1070xee5ch (https://github.com/xee5ch)
576 - skypeforlinux profile 1071 - skypeforlinux profile
1072Ypnose (https://github.com/Ypnose)
1073 - disable-shell.inc: add mksh shell
577yumkam (https://github.com/yumkam) 1074yumkam (https://github.com/yumkam)
578 - add compile-time option to restrict --net= to root only 1075 - add compile-time option to restrict --net= to root only
579 - man page fixes 1076 - man page fixes
@@ -596,4 +1093,7 @@ Zack Weinberg (https://github.com/zackw)
596 with firejail --x11 1093 with firejail --x11
597 - support for xpra-extra-params in firejail.config 1094 - support for xpra-extra-params in firejail.config
598 1095
599Copyright (C) 2014-2017 Firejail Authors 1096zupatisc (https://github.com/zupatisc)
1097 - patch-util fix
1098
1099Copyright (C) 2014-2021 Firejail Authors
diff --git a/README.md b/README.md
index 57f9a3e25..0623d9463 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
1# Firejail 1# Firejail
2[![Build Status](https://travis-ci.org/netblue30/firejail.svg?branch=master)](https://travis-ci.org/netblue30/firejail) 2[![Build Status](https://gitlab.com/Firejail/firejail_ci/badges/master/pipeline.svg)](https://gitlab.com/Firejail/firejail_ci/pipelines/)
3[![CodeQL](https://github.com/netblue30/firejail/workflows/CodeQL/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3ACodeQL)
4[![Build CI](https://github.com/netblue30/firejail/workflows/Build%20CI/badge.svg)](https://github.com/netblue30/firejail/actions?query=workflow%3A%22Build+CI%22)
5[![Packaging status](https://repology.org/badge/tiny-repos/firejail.svg)](https://repology.org/project/firejail/versions)
3 6
4Firejail is a SUID sandbox program that reduces the risk of security breaches by restricting 7Firejail is a SUID sandbox program that reduces the risk of security breaches by restricting
5the running environment of untrusted applications using Linux namespaces, seccomp-bpf 8the running environment of untrusted applications using Linux namespaces, seccomp-bpf
@@ -16,8 +19,47 @@ The sandbox is lightweight, the overhead is low. There are no complicated config
16no socket connections open, no daemons running in the background. All security features are 19no socket connections open, no daemons running in the background. All security features are
17implemented directly in Linux kernel and available on any Linux computer. 20implemented directly in Linux kernel and available on any Linux computer.
18 21
19[![About Firejail](video.png)](http://www.youtube.com/watch?v=Yk1HVPOeoTc) 22<table><tr>
20 23
24<td>
25<a href="http://www.youtube.com/watch?feature=player_embedded&v=8jfXL0ePV7U
26" target="_blank"><img src="http://img.youtube.com/vi/8jfXL0ePV7U/0.jpg"
27alt="Firejail Introduction" width="240" height="180" border="10" /><br/>Firejail Intro</a>
28</td>
29
30<td>
31<a href="http://www.youtube.com/watch?feature=player_embedded&v=J1ZsXrpAgBU
32" target="_blank"><img src="http://img.youtube.com/vi/J1ZsXrpAgBU/0.jpg"
33alt="Firejail Demo" width="240" height="180" border="10" /><br/>Firejail Demo</a>
34</td>
35
36<td>
37<a href="http://www.youtube.com/watch?feature=player_embedded&v=EyEz65RYfw4
38" target="_blank"><img src="http://img.youtube.com/vi/EyEz65RYfw4/0.jpg"
39alt="Debian Install" width="240" height="180" border="10" /><br/>Debian Install</a>
40</td>
41
42
43</tr><tr>
44<td>
45<a href="http://www.youtube.com/watch?feature=player_embedded&v=Uy2ZTHc4s0w
46" target="_blank"><img src="http://img.youtube.com/vi/Uy2ZTHc4s0w/0.jpg"
47alt="Arch Linux Install" width="240" height="180" border="10" /><br/>Arch Linux Install</a>
48
49</td>
50<td>
51<a href="http://www.youtube.com/watch?feature=player_embedded&v=xuMxRx0zSfQ
52" target="_blank"><img src="http://img.youtube.com/vi/xuMxRx0zSfQ/0.jpg"
53alt="Disable Network Access" width="240" height="180" border="10" /><br/>Disable Network Access</a>
54
55</td>
56<td>
57<a href="http://www.youtube.com/watch?feature=player_embedded&v=N-Mso2bSr3o
58" target="_blank"><img src="http://img.youtube.com/vi/N-Mso2bSr3o/0.jpg"
59alt="Firejail Security Deep Dive" width="240" height="180" border="10" /><br/>Firejail Security Deep Dive</a>
60
61</td>
62</tr></table>
21 63
22Project webpage: https://firejail.wordpress.com/ 64Project webpage: https://firejail.wordpress.com/
23 65
@@ -27,26 +69,75 @@ Features: https://firejail.wordpress.com/features-3/
27 69
28Documentation: https://firejail.wordpress.com/documentation-2/ 70Documentation: https://firejail.wordpress.com/documentation-2/
29 71
30FAQ: https://firejail.wordpress.com/support/frequently-asked-questions/ 72FAQ: https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions
73
74Wiki: https://github.com/netblue30/firejail/wiki
75
76GitLab-CI status: https://gitlab.com/Firejail/firejail_ci/pipelines/
77
78Video Channel: https://www.youtube.com/channel/UCi5u-syndQYyOeV4NZ04hNA
79
80Backup Video Channel: https://www.bitchute.com/profile/JSBsA1aoQVfW/
81
82## Security vulnerabilities
83
84We take security bugs very seriously. If you believe you have found one, please report it by emailing us at netblue30@protonmail.com
85
86`````
87Security Advisory - Feb 8, 2021
88
89Summary: A vulnerability resulting in root privilege escalation was discovered in
90Firejail's OverlayFS code,
91
92Versions affected: Firejail software versions starting with 0.9.30.
93Long Term Support (LTS) Firejail branch is not affected by this bug.
94
95Workaround: Disable overlayfs feature at runtime.
96In a text editor open /etc/firejail/firejail.config file, and set "overlayfs" entry to "no".
97
98 $ grep overlayfs /etc/firejail/firejail.config
99 # Enable or disable overlayfs features, default enabled.
100 overlayfs no
31 101
32Travis-CI status: https://travis-ci.org/netblue30/firejail 102Fix: The bug is fixed in Firejail version 0.9.64.4
33 103
104GitHub commit: (file configure.ac)
105https://github.com/netblue30/firejail/commit/97d8a03cad19501f017587cc4e47d8418273834b
106
107Credit: Security researcher Roman Fiedler analyzed the code and discovered the vulnerability.
108Functional PoC exploit code was provided to Firejail development team.
109A description of the problem is here on Roman's blog:
110
111https://unparalleled.eu/publications/2021/advisory-unpar-2021-0.txt
112https://unparalleled.eu/blog/2021/20210208-rigged-race-against-firejail-for-local-root/
113`````
114
115## Installing
116
117Try installing Firejail from your system packages first. Firejail is included in Alpine, ALT Linux, Arch, Artix, Chakra, Debian, Deepin, Devuan, Fedora, Gentoo, Manjaro, Mint, NixOS, Parabola, Parrot, PCLinuxOS, ROSA, Solus, Slackware/SlackBuilds, Trisquel, Ubuntu, Void and possibly others.
118
119The firejail 0.9.52-LTS version is deprecated. On Ubuntu 18.04 LTS users are advised to use the [PPA](https://launchpad.net/~deki/+archive/ubuntu/firejail). On Debian buster we recommend to use the [backports](https://packages.debian.org/buster-backports/firejail) package.
120
121You can also install one of the [released packages](http://sourceforge.net/projects/firejail/files/firejail), or clone Firejail’s source code from our Git repository and compile manually:
34 122
35## Compile and install
36````` 123`````
37$ git clone https://github.com/netblue30/firejail.git 124$ git clone https://github.com/netblue30/firejail.git
38$ cd firejail 125$ cd firejail
39$ ./configure && make && sudo make install-strip 126$ ./configure && make && sudo make install-strip
40````` 127`````
41On Debian/Ubuntu you will need to install git and a compiler: 128On Debian/Ubuntu you will need to install git and gcc compiler. AppArmor
129development libraries and pkg-config are required when using `--apparmor`
130./configure option:
42````` 131`````
43$ sudo apt-get install git build-essential 132$ sudo apt-get install git build-essential libapparmor-dev pkg-config gawk
44````` 133`````
134For `--selinux` option, add libselinux1-dev (libselinux-devel for Fedora).
45 135
136Detailed information on using firejail from git is available on the [wiki](https://github.com/netblue30/firejail/wiki/Using-firejail-from-git).
46 137
47## Running the sandbox 138## Running the sandbox
48 139
49To start the sandbox, prefix your command with firejail: 140To start the sandbox, prefix your command with `firejail`:
50 141
51````` 142`````
52$ firejail firefox # starting Mozilla Firefox 143$ firejail firefox # starting Mozilla Firefox
@@ -54,7 +145,7 @@ $ firejail transmission-gtk # starting Transmission BitTorrent
54$ firejail vlc # starting VideoLAN Client 145$ firejail vlc # starting VideoLAN Client
55$ sudo firejail /etc/init.d/nginx start 146$ sudo firejail /etc/init.d/nginx start
56````` 147`````
57Run "firejail --list" in a terminal to list all active sandboxes. Example: 148Run `firejail --list` in a terminal to list all active sandboxes. Example:
58````` 149`````
59$ firejail --list 150$ firejail --list
601617:netblue:/usr/bin/firejail /usr/bin/firefox-esr 1511617:netblue:/usr/bin/firejail /usr/bin/firefox-esr
@@ -93,92 +184,87 @@ If you keep additional Firejail security profiles in a public repository, please
93* https://github.com/triceratops1/fe 184* https://github.com/triceratops1/fe
94 185
95Use this issue to request new profiles: [#1139](https://github.com/netblue30/firejail/issues/1139) 186Use this issue to request new profiles: [#1139](https://github.com/netblue30/firejail/issues/1139)
96`````
97 187
98````` 188You can also use this tool to get a list of syscalls needed by a program: [contrib/syscalls.sh](contrib/syscalls.sh).
99# Current development version: 0.9.51
100 189
101## Whitelisting /var 190We also keep a list of profile fixes for previous released versions in [etc-fixes](https://github.com/netblue30/firejail/tree/master/etc-fixes) directory.
102 191
103Add "include /etc/firejail/whitelist-var-common.inc" to an application profile and test it. If it's working, 192## Latest released version: 0.9.66
104send a pull request. I did it so far for some more common applications like Firefox, Chromium etc.
105 193
106## Profile build tool 194## Current development version: 0.9.67
107`````
108$ firejail --build appname
109`````
110The command builds a whitelisted profile. If /usr/bin/strace is installed on the system, it also
111builds a whitelisted seccomp profile. The program is run in a very relaxed sandbox,
112with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported
113in order to allow strace to run. Chromium and Chromium-based browsers will not work.
114
115Example:
116`````
117$ firejail --build /usr/bin/vlc ~/Videos/test.mp4
118
119[...]
120
121############################################
122# /usr/bin/vlc profile
123############################################
124# Persistent global definitions
125# include /etc/firejail/globals.local
126 195
127### basic blacklisting 196Milestone page: https://github.com/netblue30/firejail/milestone/1
128include /etc/firejail/disable-common.inc 197Release discussion: https://github.com/netblue30/firejail/issues/3696
129# include /etc/firejail/disable-devel.inc
130include /etc/firejail/disable-passwdmgr.inc
131# include /etc/firejail/disable-programs.inc
132 198
133### home directory whitelisting 199Moving from whitelist/blacklist to allow/deny is under way! We are still open to other options, so it might change!
134whitelist ~/Videos
135whitelist ~/.local/share/vlc
136whitelist ~/.config/vlc
137include /etc/firejail/whitelist-common.inc
138 200
139### filesystem 201The old whitelist/blacklist will remain as aliasses for the next one or two releases
140private-tmp 202in order to give users a chance to switch their local profiles.
141private-dev 203The latest discussion on this issue is here: https://github.com/netblue30/firejail/issues/4379
142private-etc vdpau_wrapper.cfg,udev,drirc,fonts,xdg,gtk-3.0,machine-id,selinux,
143whitelist /var/lib/menu-xdg
144# private-bin vlc,
145 204
146### security filters 205### Intrusion Detection System ###
147caps.drop all
148nonewprivs
149seccomp
150# seccomp.keep futex,poll,rt_sigtimedwait,ioctl,fdatasync,read,writev,sendmsg,sendto,write,recvmsg,mmap,mprotect,getpid,stat,clock_nanosleep,munmap,close,access,lseek,fcntl,open,fstat,lstat,brk,rt_sigaction,rt_sigprocmask,rt_sigreturn,madvise,shmget,shmat,shmctl,alarm,socket,connect,recvfrom,shutdown,getsockname,getpeername,setsockopt,getsockopt,clone,execve,uname,shmdt,flock,ftruncate,getdents,rename,mkdir,unlink,readlink,chmod,getrlimit,sysinfo,getuid,getgid,geteuid,getegid,getresuid,getresgid,statfs,fstatfs,prctl,arch_prctl,sched_getaffinity,set_tid_address,fadvise64,clock_getres,tgkill,set_robust_list,eventfd2,dup3,pipe2,getrandom,memfd_create
151# 76 syscalls total
152# Probably you will need to add more syscalls to seccomp.keep. Look for
153# seccomp errors in /var/log/syslog or /var/log/audit/audit.log while
154# running your sandbox.
155 206
156### network 207We are adding IDS capabilities in the next release. We have the list of files in [/etc/firejail/ids.config](https://github.com/netblue30/firejail/blob/master/etc/ids.config),
157protocol unix,netlink, 208and we generate a [BLAKE2](https://en.wikipedia.org/wiki/BLAKE_%28hash_function%29) checksum in /var/lib/firejail/username.ids.
158net none 209The program runs as regular user, each user has his own file in /var/lib/firejail.
159 210
160### environment 211Initialize the database:
161shell none
162$
163````` 212`````
164 213$ firejail --ids-init
165## New command line options 214Loading /etc/firejail/ids.config config file
215500 1000 1500 2000
2162457 files scanned
217IDS database initialized
166````` 218`````
167 --writable-run-user
168 This options disables the default blacklisting of
169 run/user/$UID/systemd and /run/user/$UID/gnupg.
170 219
171 Example: 220Later, we check it:
172 $ sudo firejail --writable-run-user
173````` 221`````
174 222$ firejail --ids-check
175## New profiles: 223Loading /etc/firejail/ids.config config file
176 224500 1000 1500
177terasology, surf, rocketchat, clamscan, clamdscan, clamdtop, freshclam, xmr-stak-cpu, 225Warning: modified /home/netblue/.bashrc
178amule, ardour4, ardour5, brackets, calligra, calligraauthor, calligraconverter, 2262000
179calligraflow, calligraplan, calligraplanwork, calligrasheets, calligrastage, 2272457 files scanned: modified 1, permissions 0, new 0, removed 0
180calligrawords, cin, dooble, dooble-qt4, fetchmail, freecad, freecadcmd, google-earth, 228`````
181imagej, karbon, kdenlive, krita, linphone, lmms, macrofusion, mpd, natron, Natron, 229The program will print the files that have been modified since the database was created, or the files with different access permissions.
182ricochet, shotcut, teamspeak3, tor, tor-browser-en, Viber, x-terminal-emulator, zart, 230New files and deleted files are also flagged.
183conky, arch-audit, ffmpeg, bluefish, cliqz, cinelerra, openshot-qt, pinta, uefitool, 231
184aosp, pdfmod, gnome-ring 232Currently while scanning the file system symbolic links are not followed, and files the user doesn't have read access to are silently dropped.
233The program can also be run as root (sudo firejail --ids-init/--ids-check).
234
235### Profile Statistics
236
237A small tool to print profile statistics. Compile as usual and run in /etc/profiles:
238```
239$ sudo cp src/profstats/profstats /etc/firejail/.
240$ cd /etc/firejail
241$ ./profstats *.profile
242 profiles 1150
243 include local profile 1150 (include profile-name.local)
244 include globals 1120 (include globals.local)
245 blacklist ~/.ssh 1026 (include disable-common.inc)
246 seccomp 1050
247 capabilities 1146
248 noexec 1030 (include disable-exec.inc)
249 noroot 959
250 memory-deny-write-execute 253
251 apparmor 681
252 private-bin 667
253 private-dev 1009
254 private-etc 523
255 private-tmp 883
256 whitelist home directory 547
257 whitelist var 818 (include whitelist-var-common.inc)
258 whitelist run/user 616 (include whitelist-runuser-common.inc
259 or blacklist ${RUNUSER})
260 whitelist usr/share 591 (include whitelist-usr-share-common.inc
261 net none 391
262 dbus-user none 641
263 dbus-user filter 105
264 dbus-system none 792
265 dbus-system filter 7
266```
267
268### New profiles:
269
270clion-eap, lifeograph, io.github.lainsce.Notejot, rednotebook, zim, microsoft-edge-beta, ncdu2, gallery-dl, yt-dlp
diff --git a/RELNOTES b/RELNOTES
index 4c272ccee..86c4a6104 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,10 +1,376 @@
1firejail (0.9.51) baseline; urgency=low 1firejail (0.9.67) baseline; urgency=low
2 * work in progress! 2 * work in progress
3 * deprecated --disable-whitelist at compile time
4 * deprecated whitelist=yes/no in /etc/firejail/firejail.config
5 * remove (some) environment variables with auth-tokens
6 * new includes: whitelist-run-common.inc, disable-X11.inc
7 * removed includes: disable-passwordmgr.inc
8 * new profiles: microsoft-edge-beta, clion-eap, lifeograph, zim
9 * new profiles: io.github.lainsce.Notejot, rednotebook, gallery-dl
10 * new profiles: yt-dlp
11 -- netblue30 <netblue30@yahoo.com> Thu, 29 Jul 2021 09:00:00 -0500
12
13firejail (0.9.66) baseline; urgency=low
14 * deprecated --audit options, relpaced by jailcheck utility
15 * deprecated follow-symlink-as-user from firejail.config
16 * new firejail.config settings: private-bin, private-etc
17 * new firejail.config settings: private-opt, private-srv
18 * new firejail.config settings: whitelist-disable-topdir
19 * new firejail.config settings: seccomp-filter-add
20 * removed kcmp syscall from seccomp default filter
21 * rename --noautopulse to keep-config-pulse
22 * filtering environment variables
23 * zsh completion
24 * command line: --mkdir, --mkfile
25 * --protocol now accumulates
26 * Jolla/SailfishOS patches
27 * private-lib rework
28 * whitelist rework
29 * jailtest utility for testing running sandboxes
30 * capabilities list update
31 * faccessat2 syscall support
32 * --private-dev keeps /dev/input
33 * added --noinput to disable /dev/input
34 * add support for subdirs in --private-etc
35 * compile time: --enable-force-nonewprivs
36 * compile time: --disable-output
37 * compile time: --enable-lts
38 * subdirs support in private-etc
39 * input devices support in private-dev, --no-input
40 * support trailing comments on profile lines
41 * new profiles: vmware-view, display-im6.q16, ipcalc, ipcalc-ng
42 * ebook-convert, ebook-edit, ebook-meta, ebook-polish, lzop,
43 * avidemux, calligragemini, vmware-player, vmware-workstation
44 * gget, com.github.phase1geo.minder, nextcloud-desktop, pcsxr
45 * PPSSPPSDL, openmw, openmw-launcher, jami-gnome, PCSX2, sum
46 * bcompare, b2sum, cksum, md5sum, sha1sum, sha224sum, sha256sum
47 * sha384sum, sha512sum, librewold-nightly, Quodlibet, tmux, sway
48 * alienarena, alienarena-wrapper, ballbuster, ballbuster-wrapper,
49 * colorful, colorful-wrapper, gl-117, gl-117-wrapper, glaxium,
50 * glaxium-wrapper, pinball, pinball-wrapper, etr-wrapper, firedragon
51 * neverball-wrapper, neverputt-wrapper, supertuxkart-wrapper, neochat,
52 * cargo, LibreCAD, blobby, funnyboat, pipe-viewer, gtk-pipe-viewer
53 * links2, xlinks2, googler, ddgr, tin
54 -- netblue30 <netblue30@yahoo.com> Mon, 28 Jun 2021 09:00:00 -0500
55
56firejail (0.9.64.4) baseline; urgency=low
57 * disabled overlayfs, pending multiple fixes (CVE-2021-26910)
58 -- netblue30 <netblue30@yahoo.com> Sun, 7 Feb 2021 09:00:00 -0500
59
60firejail (0.9.64.2) baseline; urgency=low
61 * allow --tmpfs inside $HOME for unprivileged users
62 * --disable-usertmpfs compile time option
63 * allow AF_BLUETOOTH via --protocol=bluetooth
64 * Setup guide for new users: contrib/firejail-welcome.sh
65 * implement netns in profiles
66 * added nolocal6.net IPv6 network filter
67 * new profiles: spectacle, chromium-browser-privacy, gtk-straw-viewer
68 * new profiles: gtk-youtube-viewer, gtk2-youtube-viewer, gtk3-youtube-viewer
69 * new profiles: straw-viewer, lutris, dolphin-emu, authenticator-rs, servo
70 * new profiles: npm, marker, yarn, lsar, unar, agetpkg, mdr, shotwell, qnapi
71 * new profiles: guvcview, pkglog, kdiff3, CoyIM
72 -- netblue30 <netblue30@yahoo.com> Tue, 26 Jan 2021 09:00:00 -0500
73
74firejail (0.9.64) baseline; urgency=low
75 * replaced --nowrap option with --wrap in firemon
76 * The blocking action of seccomp filters has been changed from
77 killing the process to returning EPERM to the caller. To get the
78 previous behaviour, use --seccomp-error-action=kill or
79 syscall:kill syntax when constructing filters, or override in
80 /etc/firejail/firejail.config file.
81 * Fine-grained D-Bus sandboxing with xdg-dbus-proxy.
82 xdg-dbus-proxy must be installed, if not D-Bus access will be allowed.
83 With this version nodbus is deprecated, in favor of dbus-user none and
84 dbus-system none and will be removed in a future version.
85 * DHCP client support
86 * firecfg only fix dektop-files if started with sudo
87 * SELinux labeling support
88 * custom 32-bit seccomp filter support
89 * restrict ${RUNUSER} in several profiles
90 * blacklist shells such as bash in several profiles
91 * whitelist globbing
92 * mkdir and mkfile support for /run/user directory
93 * support ignore for include
94 * --include on the command line
95 * splitting up media players whitelists in whitelist-players.inc
96 * new condition: HAS_NOSOUND
97 * new profiles: gfeeds, firefox-x11, tvbrowser, rtv, clipgrab, muraster
98 * new profiles: gnome-passwordsafe, bibtex, gummi, latex, mupdf-x11-curl
99 * new profiles: pdflatex, tex, wpp, wpspdf, wps, et, multimc, mupdf-x11
100 * new profiles: gnome-hexgl, com.github.johnfactotum.Foliate, mupdf-gl, mutool
101 * new profiles: desktopeditors, impressive, planmaker18, planmaker18free
102 * new profiles: presentations18, presentations18free, textmaker18, teams
103 * new profiles: textmaker18free, xournal, gnome-screenshot, ripperX
104 * new profiles: sound-juicer, com.github.dahenson.agenda, gnome-pomodoro
105 * new profiles: gnome-todo, x2goclient, iagno, kmplayer, penguin-command
106 * new profiles: frogatto, gnome-mines, gnome-nibbles, lightsoff, warmux
107 * new profiles: ts3client_runscript.sh, ferdi, abiword, four-in-a-row
108 * new profiles: gnome-mahjongg, gnome-robots, gnome-sudoku, gnome-taquin
109 * new profiles: gnome-tetravex, blobwars, gravity-beams-and-evaporating-stars
110 * new profiles: hyperrogue, jumpnbump-menu, jumpnbump, magicor, mindless
111 * new profiles: mirrormagic, mrrescue, scorched3d-wrapper, scorchwentbonkers
112 * new profiles: seahorse-adventures, wordwarvi, xbill, gnome-klotski
113 * new profiles: swell-foop, fdns, five-or-more, steam-runtime
114 * new profiles: nicotine, plv, mocp, apostrophe, quadrapassel, dino-im
115 * new profiles: hitori, bijiben, gnote, gnubik, ZeGrapher, xonotic-sdl-wrapper
116 * new profiles: gapplication, openarena_ded, element-desktop, cawbird
117 * new profiles: freetube, strawberry, jitsi-meet-desktop
118 * new profiles: homebank, mattermost-desktop, newsflash, com.gitlab.newsflash
119 * new profiles: sushi, xfce4-screenshooter, org.gnome.NautilusPreviewer, lyx
120 * new profiles: minitube, nuclear, mtpaint, minecraft-launcher, gnome-calendar
121 * new profiles: vmware, git-cola, otter-browser, kazam, menulibre, musictube
122 * new profiles: onboard, fractal, mirage, quaternion, spectral, man, psi
123 * new profiles: smuxi-frontend-gnome, balsa, kube, trojita, youtube
124 * new profiles: youtubemusic-nativefier, cola, dbus-send, notify-send
125 * new profiles: qrencode, ytmdesktop, twitch
126 * new profiles: xournalpp, chromium-freeworld, equalx
127 -- netblue30 <netblue30@yahoo.com> Wed, 21 Oct 2020 08:00:00 -0500
128
129firejail (0.9.62) baseline; urgency=low
130 * added file-copy-limit in /etc/firejail/firejail.config
131 * profile templates (/usr/share/doc/firejail)
132 * allow-debuggers support in profiles
133 * several seccomp enhancements
134 * compiler flags autodetection
135 * move chroot entirely from path based to file descriptor based mounts
136 * whitelisting /usr/share in a large number of profiles
137 * new scripts in conrib: gdb-firejail.sh and sort.py
138 * enhancement: whitelist /usr/share in some profiles
139 * added signal mediation ot apparmor profile
140 * new conditions: HAS_X11, HAS_NET
141 * new profiles: qgis, klatexformula, klatexformula_cmdl, links, xlinks
142 * new profiles: pandoc, teams-for-linux, OpenArena, gnome-sound-recorder
143 * new profiles: godot, tcpdump, tshark, newsbeuter, keepassxc-cli
144 * new profiles: keepassxc-proxy, rhythmbox-client, jerry, zeal, mpg123
145 * new profiles: conplay, mpg123.bin, mpg123-alsa, mpg123-id3dump, out123
146 * new profiles: mpg123-jack, mpg123-nas, mpg123-openal, mpg123-oss
147 * new profiles: mpg123-portaudio, mpg123-pulse, mpg123-strip, pavucontrol-qt
148 * new profiles: gnome-characters, gnome-character-map, rsync, Whalebird,
149 * new profiles: tor-browser (AUR), Zulip, tb-starter-wrapper, bzcat,
150 * new profiles: kiwix-desktop, bzcat, zstd, pzstd, zstdcat, zstdgrep, zstdless
151 * new profiles: zstdmt, unzstd, i2p, ar, gnome-latex, pngquant, kalgebra
152 * new profiles: kalgebramobile, signal-cli, amuled, kfind, profanity
153 * new profiles: audio-recorder, cameramonitor, ddgtk, drawio, unf, gmpc
154 * new profiles: electron-mail, gist, gist-paste
155 -- netblue30 <netblue30@yahoo.com> Sat, 28 Dec 2019 08:00:00 -0500
156
157firejail (0.9.60) baseline; urgency=low
158 * security bug reported by Austin Morton:
159 Seccomp filters are copied into /run/firejail/mnt, and are writable
160 within the jail. A malicious process can modify files from inside the
161 jail. Processes that are later joined to the jail will not have seccomp
162 filters applied.
163 * memory-deny-write-execute now also blocks memfd_create
164 * add private-cwd option to control working directory within jail
165 * blocking system D-Bus socket with --nodbus
166 * bringing back Centos 6 support
167 * drop support for flatpak/snap packages
168 * new profiles: crow, nyx, mypaint, celluoid, nano, transgui, mpdris2
169 * new profiles: sysprof, simplescreenrecorder, geekbench, xfce4-mixer
170 * new profiles: pavucontrol, d-feet, seahorse, secret-tool, gnome-keyring
171 * new profiles: regextester, hardinfo, gnome-system-log, gnome-nettool
172 * new profiles: netactview, redshift, devhelp, assogiate, subdownloader
173 * new profiles: font-manager, exfalso, gconf-editor, dconf-editor
174 * new profiles: sysprof-cli, seahorse-tool, secret-tool, dconf, gsettings
175 * new profiles: code-oss, pragha, Maelstrom, ostrichriders, bzflag
176 * new profiles: freeciv, lincity-ng, megaglest, openttd, crawl, crawl-tiles
177 * new profiles: teeworlds, torcs, tremulous, warsow, lugaru, manaplus
178 * new profiles: pioneer, scorched3d, widelands, freemind, kid3, kid3-qt
179 * new profiles: kid3-cli, nomacs, freecol, opencity, openclonk, slashem
180 * new profiles: vultureseye, vulturesclaw, anki, cheese, utox, mp3splt
181 * new profiles: oggsplt, flacsplt, gramps, newsboat, freeoffice-planmaker
182 * new profiles: autokey-gtk, autokey-qt, autokey-run, autokey-shell
183 * new profiles: freeoffice-presentations, freeoffice-textmaker, mp3wrap
184 * new profiles: inkview, meteo-qt, mp3splt-gtk, ktouch, yelp, cantata
185 -- netblue30 <netblue30@yahoo.com> Sun, 26 May 2019 08:00:00 -0500
186
187firejail (0.9.58,2) baseline; urgency=low
188 * cgroup flag in /etc/firejail/firejail.config file
189 * name-change flag in /etc/firejail.config file
190 * --name rework
191 * new profiles: klavaro, vscodium
192 * browser profiles fixes
193 * various other bugfixes
194 -- netblue30 <netblue30@yahoo.com> Fri, 8 Feb 2019 08:00:00 -0500
195
196firejail (0.9.58) baseline; urgency=low
197 * --disable-mnt rework
198 * --net.print command
199 * GitLab CI/CD integration: disto specific builds
200 * profile parser enhancements and conditional handling support
201 for HAS_APPIMAGE, HAS_NODBUS, BROWSER_DISABLE_U2F
202 * profile name support
203 * added explicit nonewprivs support to join option
204 * new profiles: QMediathekView, aria2c, Authenticator, checkbashisms
205 * new profiles: devilspie, devilspie2, easystroke, github-desktop, min
206 * new profiles: bsdcat, bsdcpio, bsdtar, lzmadec, lbunzip2, lbzcat
207 * new profiles: lbzip2, lzcat, lzcmp, lzdiff, lzegrep, lzfgrep, lzgrep
208 * new profiles: lzless, lzma, lzmainfo, lzmore, unlzma, unxz, xzcat
209 * new profiles: xzcmp, xzdiff, xzegrep, xzfgrep, xzgrep, xzless, xzmore
210 * new profiles: lzip, artha, nitroshare, nitroshare-cli, nitroshare-nmh
211 * new profiles: nirtoshare-send, nitroshare-ui, mencoder, gnome-pie
212 * new profiles: masterpdfeditor, QOwnNotes, aisleriot, Mendeley
213 * new profiles: feedreader, ocenaudio, mpsyt, thunderbird-wayland
214 * new profiles: supertuxkart, ghostwriter, gajim-history-manager
215 * bugfixes
216 -- netblue30 <netblue30@yahoo.com> Sat, 26 Jan 2019 08:00:00 -0500
217
218firejail (0.9.56) baseline; urgency=low
219 * modif: removed CFG_CHROOT_DESKTOP configuration option
220 * modif: removed compile time --enable-network=restricted
221 * modif: removed compile time --disable-bind
222 * modif: --net=none allowed even if networking was disabled at compile
223 time or at run time
224 * modif: allow system users to run the sandbox
225 * support wireless devices in --net option
226 * support tap devices in --net option (tunneling support)
227 * allow IP address configuration if the parent interface specified
228 by --net is not configured (--netmask)
229 * support for firetunnel utility
230 * disable U2F devices (--nou2f)
231 * add --private-cache to support private ~/.cache
232 * support full paths in private-lib
233 * globbing support in private-lib
234 * support for local user directories in firecfg (--bindir)
235 * new profiles: ms-excel, ms-office, ms-onenote, ms-outlook, ms-powerpoint,
236 * new profiles: ms-skype, ms-word, riot-desktop, gnome-mpv, snox, gradio,
237 * new profiles: standardnotes-desktop, shellcheck, patch, flameshot,
238 * new profiles: rview, rvim, vimcat, vimdiff, vimpager, vimtutor, xxd,
239 * new profiles: Beaker, electrum, clamtk, pybitmessage, dig, whois,
240 * new profiles: jdownloader, Fluxbox, Blackbox, Awesome, i3
241 * new profiles: start-tor-browser.desktop
242 -- netblue30 <netblue30@yahoo.com> Tue, 18 Sep 2018 08:00:00 -0500
243
244firejail (0.9.54) baseline; urgency=low
245 * modif: --force removed
246 * modif: --csh, --zsh removed
247 * modif: --debug-check-filename removed
248 * modif: --git-install and --git-uninstall removed
249 * modif: support for private-bin, private-lib and shell none has been
250 disabled while running AppImage archives in order to be able to use
251 our regular profile files with AppImages.
252 * modif: restrictions for /proc, /sys and /run/user directories
253 are moved from AppArmor profile into firejail executable
254 * modif: unifying Chromium and Firefox browsers profiles.
255 All users of Firefox-based browsers who use addons and plugins
256 that read/write from ${HOME} will need to uncomment the includes for
257 firefox-common-addons.inc in firefox-common.profile.
258 * modif: split disable-devel.inc into disable-devel and
259 disable-interpreters.inc
260 * Firejail user access database (/etc/firejail/firejail.users,
261 man firejail-users)
262 * add --noautopulse to disable automatic ~/.config/pulse (for complex setups)
263 * Spectre mitigation patch for gcc and clang compiler
264 * D-Bus handling (--nodbus)
265 * AppArmor support for overlayfs and chroot sandboxes
266 * AppArmor support for AppImages
267 * Enable AppArmor by default for a large number of programs
268 * firejail --apparmor.print option
269 * firemon --apparmor option
270 * apparmor yes/no flag in /etc/firejail/firejail.config
271 * seccomp syscall list update for glibc 2.26-10
272 * seccomp disassembler for --seccomp.print option
273 * seccomp machine code optimizer for default seccomp filters
274 * IPv6 DNS support
275 * whitelist support for overlay and chroot sandboxes
276 * private-dev support for overlay and chroot sandboxes
277 * private-tmp support for overlay and chroot sandboxes
278 * added sandbox name support in firemon
279 * firemon/prctl enhancements
280 * noblacklist support for /sys/module directory
281 * whitelist support for /sys/module directory
282 * new profiles: basilisk, Tor Browser language packs, PlayOnLinux, sylpheed,
283 * new profiles: discord-canary, pycharm-community, pycharm-professional,
284 * new profiles: pdfchain, tilp, vivaldi-snapshot, bitcoin-qt, kaffeine,
285 * new profiles: falkon, gnome-builder, asunder, VS Code, gnome-recipes,
286 * new profiles: akonadi_controle, evince-previewer, evince-thumbnailer,
287 * new profiles: blender-2.8, thunderbird-beta, ncdu, gnome-logs, gcloud,
288 * new profiles: musixmatch, gunzip, bunzip2, enchant-lsmod, enchant-lsmod-2,
289 * new profiles: enchant, enchant-2, Discord, acat, adiff, als, apack,
290 * new profiles: arepack, aunpack profiles, ppsspp, scallion, clion,
291 * new profiles: baloo_filemetadata_temp_extractor, AnyDesk, webstorm, xmind,
292 * new profiles: qmmp, sayonara
293 -- netblue30 <netblue30@yahoo.com> Wed, 16 May 2018 08:00:00 -0500
294
295firejail (0.9.52) baseline; urgency=low
296 * modif: --allow-private-blacklists was deprecated; blacklisting,
297 read-only, read-write, tmpfs and noexec are allowed in
298 private home directories
299 * modif: remount-proc-sys deprecated from firejail.config
300 * modif: follow-symlink-private-bin deprecated from firejail.config
301 * modif: --profile-path was deprecated
3 * enhancement: support Firejail user config directory in firecfg 302 * enhancement: support Firejail user config directory in firecfg
4 * enhancement: disable DBus activation in firecfg 303 * enhancement: disable DBus activation in firecfg
304 * enhancement; enumerate root directories in apparmor profile
305 * enhancement: /etc and /usr/share whitelisting support
306 * enhancement: globbing support for --private-bin
307 * feature: systemd-resolved integration
308 * feature: whitelisting /var directory in most profiles
309 * feature: GTK2, GTK3 and Qt4 private-lib support
310 * feature: --debug-private-lib
311 * feature: test deployment of private-lib for the following
312 applications: evince, galculator, gnome-calculator,
313 leafpad, mousepad, transmission-gtk, xcalc, xmr-stak-cpu,
314 atril, mate-color-select, tar, file, strings, gpicview,
315 eom, eog, gedit, pluma
5 * feature: --writable-run-user 316 * feature: --writable-run-user
317 * feature: --rlimit-as
318 * feature: --rlimit-cpu
319 * feature: --timeout
6 * feature: profile build tool (--build) 320 * feature: profile build tool (--build)
7 -- netblue30 <netblue30@yahoo.com> Thu, 14 Sep 2017 20:00:00 -0500 321 * feature: --netfilter.print
322 * feature: --netfilter6.print
323 * feature: netfilter template support
324 * new profiles: upstreamed many profiles from the following sources:
325 https://github.com/chiraag-nataraj/firejail-profiles,
326 https://github.com/nyancat18/fe,
327 https://aur.archlinux.org/packages/firejail-profiles.
328 * new profiles: terasology, surf, rocketchat, clamscan, clamdscan,
329 clamdtop, freshclam, xmr-stak-cpu, amule, ardour4, ardour5,
330 brackets, calligra, calligraauthor, calligraconverter, calligraflow,
331 calligraplan, calligraplanwork, calligrasheets, calligrastage,
332 calligrawords, cin, dooble, dooble-qt4, fetchmail, freecad, freecadcmd,
333 google-earth,imagej, karbon, kdenlive, krita, linphone, lmms, macrofusion,
334 mpd, natron, Natron, ricochet, shotcut, teamspeak3, tor, tor-browser-en,
335 Viber, x-terminal-emulator, zart, conky, arch-audit, ffmpeg, bluefish,
336 cinelerra, openshot-qt, pinta, uefitool, aosp, pdfmod, gnome-ring,
337 xcalc, zaproxy, kopete, cliqz, signal-desktop, kget, nheko, Enpass,
338 kwin_x11, krunner, ping, bsdtar, makepkg (Arch), archaudit-report
339 cower (Arch), kdeinit4
340 -- netblue30 <netblue30@yahoo.com> Thu, 7 Dec 2017 08:00:00 -0500
341
342firejail (0.9.50) baseline; urgency=low
343 * modif: --output split in two commands, --output and --output-stderr
344 * feature: per-profile disable-mnt (--disable-mnt)
345 * feature: per-profile support to set X11 Xephyr screen size (--xephyr-screen)
346 * feature: private /lib directory (--private-lib)
347 * feature: disable CDROM/DVD drive (--nodvd)
348 * feature: disable DVB devices (--notv)
349 * feature: --profile.print
350 * enhancement: print all seccomp filters under --debug
351 * enhancement: /proc/sys mounting
352 * enhancement: rework IP address assignment for --net options
353 * enhancement: support for newer Xpra versions (2.1+) -
354 set xpra-attach yes in /etc/firejail/firejail.config
355 * enhancement: all profiles use a standard layout style
356 * enhancement: create /usr/local for firecfg if the directory doesn't exist
357 * enhancement: allow full paths in --private-bin
358 * seccomp feature: --memory-deny-write-execute
359 * seccomp feature: seccomp post-exec
360 * seccomp feature: block secondary architecture (--seccomp.block_secondary)
361 * seccomp feature: seccomp syscall groups
362 * seccomp enhancement: print all seccomp filters under --debug
363 * seccomp enhancement: default seccomp list update
364 * new profiles: curl, mplayer2, SMPlayer, Calibre, ebook-viewer, KWrite,
365 * new profiles: Geary, Liferea, peek, silentarmy, IntelliJ IDEA,
366 * new profiles: Android Studio, electron, riot-web, Extreme Tux Racer,
367 * new profiles: Frozen Bubble, Open Invaders, Pingus, Simutrans, SuperTux
368 * new profiles: telegram-desktop, arm, rambox, apktool, baobab, dex2jar, gitg,
369 * new profiles: hashcat, obs, picard, remmina, sdat2img, soundconverter
370 * new profiles: truecraft, gnome-twitch, tuxguitar, musescore, neverball
371 * new profiles: sqlitebrowse, Yandex Browser, minetest
372 * bugfixes
373 -- netblue30 <netblue30@yahoo.com> Sat, 30 Sep 2017 08:00:00 -0500
8 374
9firejail (0.9.50~rc1) baseline; urgency=low 375firejail (0.9.50~rc1) baseline; urgency=low
10 * release pending! 376 * release pending!
@@ -17,7 +383,7 @@ firejail (0.9.50~rc1) baseline; urgency=low
17 * feature: --profile.print 383 * feature: --profile.print
18 * enhancement: print all seccomp filters under --debug 384 * enhancement: print all seccomp filters under --debug
19 * enhancement: /proc/sys mounting 385 * enhancement: /proc/sys mounting
20 * enhancement: rework IP address assingment for --net options 386 * enhancement: rework IP address assignment for --net options
21 * enhancement: support for newer Xpra versions (2.1+) - 387 * enhancement: support for newer Xpra versions (2.1+) -
22 set xpra-attach yes in /etc/firejail/firejail.config 388 set xpra-attach yes in /etc/firejail/firejail.config
23 * enhancement: all profiles use a standard layout style 389 * enhancement: all profiles use a standard layout style
@@ -239,7 +605,7 @@ firejail (0.9.42) baseline; urgency=low
239 * feature: option to fix desktop files (firecfg --fix) 605 * feature: option to fix desktop files (firecfg --fix)
240 * compile time: Busybox support (--enable-busybox-workaround) 606 * compile time: Busybox support (--enable-busybox-workaround)
241 * compile time: disable overlayfs (--disable-overlayfs) 607 * compile time: disable overlayfs (--disable-overlayfs)
242 * compile time: disable whitlisting (--disable-whitelist) 608 * compile time: disable whitelisting (--disable-whitelist)
243 * compile time: disable global config (--disable-globalcfg) 609 * compile time: disable global config (--disable-globalcfg)
244 * run time: enable/disable overlayfs (overlayfs yes/no) 610 * run time: enable/disable overlayfs (overlayfs yes/no)
245 * run time: enable/disable quiet as default (quiet-by-default yes/no) 611 * run time: enable/disable quiet as default (quiet-by-default yes/no)
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..ef9b9b5fb
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,26 @@
1# Security Policy
2
3## Supported Versions
4
5| Version | Supported by us | EOL | Supported by distribution |
6| ------- | ------------------ | ------------------ | --------------------------------------------------------------------------------- |
7| 0.9.66 | :heavy_check_mark: | | :white_check_mark: Debian 11 **backports**, Debian 12 (testing/unstable) |
8| 0.9.64 | :x: | | :white_check_mark: Debian 10 **backports**, Debian 11, Ubuntu 21.04, Ubuntu 21.10 |
9| 0.9.62 | :x: | | :white_check_mark: Ubuntu 20.04 LTS, Ubuntu 20.10 |
10| 0.9.60 | :x: | 29 Dec 2019 | |
11| 0.9.58 | :x: | | :white_check_mark: Debian 9 **backports**, Debian 10 |
12| 0.9.56 | :x: | 27 Jan 2019 | |
13| 0.9.54 | :x: | 18 Sep 2018 | |
14| 0.9.52 | :x: | | :white_check_mark: Ubuntu 18.04 LTS |
15| 0.9.50 | :x: | 12 Dec 2017 | |
16| 0.9.48 | :x: | 09 Sep 2017 | |
17| 0.9.46 | :x: | 12 Jun 2017 | |
18| 0.9.44 | :x: | | :white_check_mark: Debian 9 |
19| 0.9.42 | :x: | 22 Oct 2016 | |
20| 0.9.40 | :x: | 09 Sep 2016 | |
21| 0.9.38 | :x: | | :white_check_mark: Ubuntu 16.04 LTS |
22| <0.9.38 | :x: | Before 05 Feb 2016 | |
23
24## Security vulnerabilities
25
26We take security bugs very seriously. If you believe you have found one, please report it by emailing us at netblue30@@protonmail.com
diff --git a/configure b/configure
index f64aa2dac..33a4ca9fb 100755
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
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.51. 3# Generated by GNU Autoconf 2.69 for firejail 0.9.67.
4# 4#
5# Report bugs to <netblue30@yahoo.com>. 5# Report bugs to <netblue30@protonmail.com>.
6# 6#
7# 7#
8# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. 8# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -267,10 +267,10 @@ fi
267 $as_echo "$0: be upgraded to zsh 4.3.4 or later." 267 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
268 else 268 else
269 $as_echo "$0: Please tell bug-autoconf@gnu.org and 269 $as_echo "$0: Please tell bug-autoconf@gnu.org and
270$0: netblue30@yahoo.com about your system, including any 270$0: netblue30@protonmail.com about your system, including
271$0: error possibly output before this message. Then install 271$0: any error possibly output before this message. Then
272$0: a modern shell, or manually run the script under such a 272$0: install a modern shell, or manually run the script
273$0: shell if you do have one." 273$0: under such a shell if you do have one."
274 fi 274 fi
275 exit 1 275 exit 1
276fi 276fi
@@ -580,10 +580,10 @@ 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.51' 583PACKAGE_VERSION='0.9.67'
584PACKAGE_STRING='firejail 0.9.51' 584PACKAGE_STRING='firejail 0.9.67'
585PACKAGE_BUGREPORT='netblue30@yahoo.com' 585PACKAGE_BUGREPORT='netblue30@protonmail.com'
586PACKAGE_URL='http://firejail.wordpress.com' 586PACKAGE_URL='https://firejail.wordpress.com'
587 587
588ac_unique_file="src/firejail/main.c" 588ac_unique_file="src/firejail/main.c"
589# Factoring default headers for most tests. 589# Factoring default headers for most tests.
@@ -624,28 +624,39 @@ ac_includes_default="\
624 624
625ac_subst_vars='LTLIBOBJS 625ac_subst_vars='LTLIBOBJS
626LIBOBJS 626LIBOBJS
627HAVE_SECCOMP_H 627EGREP
628GREP
629CPP
630HAVE_LTS
631HAVE_FORCE_NONEWPRIVS
628HAVE_CONTRIB_INSTALL 632HAVE_CONTRIB_INSTALL
629HAVE_GIT_INSTALL
630HAVE_GCOV 633HAVE_GCOV
631BUSYBOX_WORKAROUND 634BUSYBOX_WORKAROUND
632HAVE_FATAL_WARNINGS 635HAVE_FATAL_WARNINGS
633HAVE_WHITELIST 636HAVE_SUID
634HAVE_FILE_TRANSFER 637HAVE_FILE_TRANSFER
635HAVE_X11 638HAVE_X11
636HAVE_USERNS 639HAVE_USERNS
637HAVE_NETWORK 640HAVE_NETWORK
638HAVE_GLOBALCFG 641HAVE_GLOBALCFG
639HAVE_BIND
640HAVE_CHROOT 642HAVE_CHROOT
641HAVE_SECCOMP
642HAVE_PRIVATE_HOME 643HAVE_PRIVATE_HOME
644HAVE_FIRETUNNEL
645HAVE_GAWK
646HAVE_MAN
647HAVE_USERTMPFS
648HAVE_OUTPUT
643HAVE_OVERLAYFS 649HAVE_OVERLAYFS
650HAVE_DBUSPROXY
644EXTRA_LDFLAGS 651EXTRA_LDFLAGS
645EGREP 652EXTRA_CFLAGS
646GREP 653HAVE_SELINUX
647CPP
648HAVE_APPARMOR 654HAVE_APPARMOR
655AA_LIBS
656AA_CFLAGS
657PKG_CONFIG_LIBDIR
658PKG_CONFIG_PATH
659PKG_CONFIG
649RANLIB 660RANLIB
650INSTALL_DATA 661INSTALL_DATA
651INSTALL_SCRIPT 662INSTALL_SCRIPT
@@ -699,23 +710,28 @@ SHELL'
699ac_subst_files='' 710ac_subst_files=''
700ac_user_opts=' 711ac_user_opts='
701enable_option_checking 712enable_option_checking
713enable_analyzer
702enable_apparmor 714enable_apparmor
703enable_overlayfs 715enable_selinux
716enable_dbusproxy
717enable_output
718enable_usertmpfs
719enable_man
720enable_firetunnel
704enable_private_home 721enable_private_home
705enable_seccomp
706enable_chroot 722enable_chroot
707enable_bind
708enable_globalcfg 723enable_globalcfg
709enable_network 724enable_network
710enable_userns 725enable_userns
711enable_x11 726enable_x11
712enable_file_transfer 727enable_file_transfer
713enable_whitelist 728enable_suid
714enable_fatal_warnings 729enable_fatal_warnings
715enable_busybox_workaround 730enable_busybox_workaround
716enable_gcov 731enable_gcov
717enable_git_install
718enable_contrib_install 732enable_contrib_install
733enable_force_nonewprivs
734enable_lts
719' 735'
720 ac_precious_vars='build_alias 736 ac_precious_vars='build_alias
721host_alias 737host_alias
@@ -725,6 +741,11 @@ CFLAGS
725LDFLAGS 741LDFLAGS
726LIBS 742LIBS
727CPPFLAGS 743CPPFLAGS
744PKG_CONFIG
745PKG_CONFIG_PATH
746PKG_CONFIG_LIBDIR
747AA_CFLAGS
748AA_LIBS
728CPP' 749CPP'
729 750
730 751
@@ -1276,7 +1297,7 @@ if test "$ac_init_help" = "long"; then
1276 # Omit some internal or obsolete options to make the list less imposing. 1297 # Omit some internal or obsolete options to make the list less imposing.
1277 # This message is too long to be a string in the A/UX 3.1 sh. 1298 # This message is too long to be a string in the A/UX 3.1 sh.
1278 cat <<_ACEOF 1299 cat <<_ACEOF
1279\`configure' configures firejail 0.9.51 to adapt to many kinds of systems. 1300\`configure' configures firejail 0.9.67 to adapt to many kinds of systems.
1280 1301
1281Usage: $0 [OPTION]... [VAR=VALUE]... 1302Usage: $0 [OPTION]... [VAR=VALUE]...
1282 1303
@@ -1338,7 +1359,7 @@ fi
1338 1359
1339if test -n "$ac_init_help"; then 1360if test -n "$ac_init_help"; then
1340 case $ac_init_help in 1361 case $ac_init_help in
1341 short | recursive ) echo "Configuration of firejail 0.9.51:";; 1362 short | recursive ) echo "Configuration of firejail 0.9.67:";;
1342 esac 1363 esac
1343 cat <<\_ACEOF 1364 cat <<\_ACEOF
1344 1365
@@ -1346,28 +1367,32 @@ Optional Features:
1346 --disable-option-checking ignore unrecognized --enable/--with options 1367 --disable-option-checking ignore unrecognized --enable/--with options
1347 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 1368 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1348 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 1369 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1370 --enable-analyzer enable GCC static analyzer
1349 --enable-apparmor enable apparmor 1371 --enable-apparmor enable apparmor
1350 --disable-overlayfs disable overlayfs 1372 --enable-selinux SELinux labeling support
1373 --disable-dbusproxy disable dbus proxy
1374 --disable-output disable --output logging
1375 --disable-usertmpfs disable tmpfs as regular user
1376 --disable-man disable man pages
1377 --disable-firetunnel disable firetunnel
1351 --disable-private-home disable private home feature 1378 --disable-private-home disable private home feature
1352 --disable-seccomp disable seccomp
1353 --disable-chroot disable chroot 1379 --disable-chroot disable chroot
1354 --disable-bind disable bind
1355 --disable-globalcfg if the global config file firejail.cfg is not 1380 --disable-globalcfg if the global config file firejail.cfg is not
1356 present, continue the program using defaults 1381 present, continue the program using defaults
1357 --disable-network disable network 1382 --disable-network disable network
1358 --enable-network=restricted
1359 restrict --net= to root only
1360 --disable-userns disable user namespace 1383 --disable-userns disable user namespace
1361 --disable-x11 disable X11 sandboxing support 1384 --disable-x11 disable X11 sandboxing support
1362 --disable-file-transfer disable file transfer 1385 --disable-file-transfer disable file transfer
1363 --disable-whitelist disable whitelist 1386 --disable-suid install as a non-SUID executable
1364 --enable-fatal-warnings -W -Wall -Werror 1387 --enable-fatal-warnings -W -Wall -Werror
1365 --enable-busybox-workaround 1388 --enable-busybox-workaround
1366 enable busybox workaround 1389 enable busybox workaround
1367 --enable-gcov Gcov instrumentation 1390 --enable-gcov Gcov instrumentation
1368 --enable-git-install enable git install feature
1369 --enable-contrib-install 1391 --enable-contrib-install
1370 install contrib scripts 1392 install contrib scripts
1393 --enable-force-nonewprivs
1394 enable force nonewprivs
1395 --enable-lts enable long-term support software version (LTS)
1371 1396
1372Some influential environment variables: 1397Some influential environment variables:
1373 CC C compiler command 1398 CC C compiler command
@@ -1377,13 +1402,20 @@ Some influential environment variables:
1377 LIBS libraries to pass to the linker, e.g. -l<library> 1402 LIBS libraries to pass to the linker, e.g. -l<library>
1378 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if 1403 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1379 you have headers in a nonstandard directory <include dir> 1404 you have headers in a nonstandard directory <include dir>
1405 PKG_CONFIG path to pkg-config utility
1406 PKG_CONFIG_PATH
1407 directories to add to pkg-config's search path
1408 PKG_CONFIG_LIBDIR
1409 path overriding pkg-config's built-in search path
1410 AA_CFLAGS C compiler flags for AA, overriding pkg-config
1411 AA_LIBS linker flags for AA, overriding pkg-config
1380 CPP C preprocessor 1412 CPP C preprocessor
1381 1413
1382Use these variables to override the choices made by `configure' or to help 1414Use these variables to override the choices made by `configure' or to help
1383it to find libraries and programs with nonstandard names/locations. 1415it to find libraries and programs with nonstandard names/locations.
1384 1416
1385Report bugs to <netblue30@yahoo.com>. 1417Report bugs to <netblue30@protonmail.com>.
1386firejail home page: <http://firejail.wordpress.com>. 1418firejail home page: <https://firejail.wordpress.com>.
1387_ACEOF 1419_ACEOF
1388ac_status=$? 1420ac_status=$?
1389fi 1421fi
@@ -1446,7 +1478,7 @@ fi
1446test -n "$ac_init_help" && exit $ac_status 1478test -n "$ac_init_help" && exit $ac_status
1447if $ac_init_version; then 1479if $ac_init_version; then
1448 cat <<\_ACEOF 1480 cat <<\_ACEOF
1449firejail configure 0.9.51 1481firejail configure 0.9.67
1450generated by GNU Autoconf 2.69 1482generated by GNU Autoconf 2.69
1451 1483
1452Copyright (C) 2012 Free Software Foundation, Inc. 1484Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1498,6 +1530,52 @@ fi
1498 1530
1499} # ac_fn_c_try_compile 1531} # ac_fn_c_try_compile
1500 1532
1533# ac_fn_c_try_link LINENO
1534# -----------------------
1535# Try to link conftest.$ac_ext, and return whether this succeeded.
1536ac_fn_c_try_link ()
1537{
1538 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1539 rm -f conftest.$ac_objext conftest$ac_exeext
1540 if { { ac_try="$ac_link"
1541case "(($ac_try" in
1542 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1543 *) ac_try_echo=$ac_try;;
1544esac
1545eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1546$as_echo "$ac_try_echo"; } >&5
1547 (eval "$ac_link") 2>conftest.err
1548 ac_status=$?
1549 if test -s conftest.err; then
1550 grep -v '^ *+' conftest.err >conftest.er1
1551 cat conftest.er1 >&5
1552 mv -f conftest.er1 conftest.err
1553 fi
1554 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1555 test $ac_status = 0; } && {
1556 test -z "$ac_c_werror_flag" ||
1557 test ! -s conftest.err
1558 } && test -s conftest$ac_exeext && {
1559 test "$cross_compiling" = yes ||
1560 test -x conftest$ac_exeext
1561 }; then :
1562 ac_retval=0
1563else
1564 $as_echo "$as_me: failed program was:" >&5
1565sed 's/^/| /' conftest.$ac_ext >&5
1566
1567 ac_retval=1
1568fi
1569 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1570 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1571 # interfere with the next link command; also delete a directory that is
1572 # left behind by Apple's compiler. We do this before executing the actions.
1573 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1574 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1575 as_fn_set_status $ac_retval
1576
1577} # ac_fn_c_try_link
1578
1501# ac_fn_c_try_cpp LINENO 1579# ac_fn_c_try_cpp LINENO
1502# ---------------------- 1580# ----------------------
1503# Try to preprocess conftest.$ac_ext, and return whether this succeeded. 1581# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -1605,9 +1683,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1605$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} 1683$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
1606 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 1684 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1607$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} 1685$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1608( $as_echo "## ---------------------------------- ## 1686( $as_echo "## --------------------------------------- ##
1609## Report this to netblue30@yahoo.com ## 1687## Report this to netblue30@protonmail.com ##
1610## ---------------------------------- ##" 1688## --------------------------------------- ##"
1611 ) | sed "s/^/$as_me: WARNING: /" >&2 1689 ) | sed "s/^/$as_me: WARNING: /" >&2
1612 ;; 1690 ;;
1613esac 1691esac
@@ -1698,57 +1776,11 @@ $as_echo "$ac_res" >&6; }
1698 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno 1776 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1699 1777
1700} # ac_fn_c_check_header_compile 1778} # ac_fn_c_check_header_compile
1701
1702# ac_fn_c_try_link LINENO
1703# -----------------------
1704# Try to link conftest.$ac_ext, and return whether this succeeded.
1705ac_fn_c_try_link ()
1706{
1707 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1708 rm -f conftest.$ac_objext conftest$ac_exeext
1709 if { { ac_try="$ac_link"
1710case "(($ac_try" in
1711 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1712 *) ac_try_echo=$ac_try;;
1713esac
1714eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1715$as_echo "$ac_try_echo"; } >&5
1716 (eval "$ac_link") 2>conftest.err
1717 ac_status=$?
1718 if test -s conftest.err; then
1719 grep -v '^ *+' conftest.err >conftest.er1
1720 cat conftest.er1 >&5
1721 mv -f conftest.er1 conftest.err
1722 fi
1723 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1724 test $ac_status = 0; } && {
1725 test -z "$ac_c_werror_flag" ||
1726 test ! -s conftest.err
1727 } && test -s conftest$ac_exeext && {
1728 test "$cross_compiling" = yes ||
1729 test -x conftest$ac_exeext
1730 }; then :
1731 ac_retval=0
1732else
1733 $as_echo "$as_me: failed program was:" >&5
1734sed 's/^/| /' conftest.$ac_ext >&5
1735
1736 ac_retval=1
1737fi
1738 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1739 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1740 # interfere with the next link command; also delete a directory that is
1741 # left behind by Apple's compiler. We do this before executing the actions.
1742 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1743 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1744 as_fn_set_status $ac_retval
1745
1746} # ac_fn_c_try_link
1747cat >config.log <<_ACEOF 1779cat >config.log <<_ACEOF
1748This file contains any messages produced by compilers while 1780This file contains any messages produced by compilers while
1749running configure, to aid debugging if configure makes a mistake. 1781running configure, to aid debugging if configure makes a mistake.
1750 1782
1751It was created by firejail $as_me 0.9.51, which was 1783It was created by firejail $as_me 0.9.67, which was
1752generated by GNU Autoconf 2.69. Invocation command line was 1784generated by GNU Autoconf 2.69. Invocation command line was
1753 1785
1754 $ $0 $@ 1786 $ $0 $@
@@ -2097,7 +2129,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
2097 2129
2098 2130
2099 2131
2100#AC_CONFIG_HEADERS([config.h]) 2132
2101 2133
2102 2134
2103ac_ext=c 2135ac_ext=c
@@ -2889,7 +2921,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2889ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 2921ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2890ac_compiler_gnu=$ac_cv_c_compiler_gnu 2922ac_compiler_gnu=$ac_cv_c_compiler_gnu
2891 2923
2892#AC_PROG_CXX
2893ac_aux_dir= 2924ac_aux_dir=
2894for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do 2925for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2895 if test -f "$ac_dir/install-sh"; then 2926 if test -f "$ac_dir/install-sh"; then
@@ -3105,21 +3136,799 @@ else
3105fi 3136fi
3106 3137
3107 3138
3139HAVE_SPECTRE="no"
3140
3141{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch=thunk" >&5
3142$as_echo_n "checking whether C compiler accepts -mindirect-branch=thunk... " >&6; }
3143if ${ax_cv_check_cflags___mindirect_branch_thunk+:} false; then :
3144 $as_echo_n "(cached) " >&6
3145else
3146
3147 ax_check_save_flags=$CFLAGS
3148 CFLAGS="$CFLAGS -mindirect-branch=thunk"
3149 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3150/* end confdefs.h. */
3151
3152int
3153main ()
3154{
3155
3156 ;
3157 return 0;
3158}
3159_ACEOF
3160if ac_fn_c_try_compile "$LINENO"; then :
3161 ax_cv_check_cflags___mindirect_branch_thunk=yes
3162else
3163 ax_cv_check_cflags___mindirect_branch_thunk=no
3164fi
3165rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3166 CFLAGS=$ax_check_save_flags
3167fi
3168{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_thunk" >&5
3169$as_echo "$ax_cv_check_cflags___mindirect_branch_thunk" >&6; }
3170if test "x$ax_cv_check_cflags___mindirect_branch_thunk" = xyes; then :
3171 HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -mindirect-branch=thunk"
3172
3173else
3174 :
3175fi
3176
3177{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mretpoline" >&5
3178$as_echo_n "checking whether C compiler accepts -mretpoline... " >&6; }
3179if ${ax_cv_check_cflags___mretpoline+:} false; then :
3180 $as_echo_n "(cached) " >&6
3181else
3182
3183 ax_check_save_flags=$CFLAGS
3184 CFLAGS="$CFLAGS -mretpoline"
3185 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3186/* end confdefs.h. */
3187
3188int
3189main ()
3190{
3191
3192 ;
3193 return 0;
3194}
3195_ACEOF
3196if ac_fn_c_try_compile "$LINENO"; then :
3197 ax_cv_check_cflags___mretpoline=yes
3198else
3199 ax_cv_check_cflags___mretpoline=no
3200fi
3201rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3202 CFLAGS=$ax_check_save_flags
3203fi
3204{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mretpoline" >&5
3205$as_echo "$ax_cv_check_cflags___mretpoline" >&6; }
3206if test "x$ax_cv_check_cflags___mretpoline" = xyes; then :
3207 HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -mretpoline"
3208
3209else
3210 :
3211fi
3212
3213{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-clash-protection" >&5
3214$as_echo_n "checking whether C compiler accepts -fstack-clash-protection... " >&6; }
3215if ${ax_cv_check_cflags___fstack_clash_protection+:} false; then :
3216 $as_echo_n "(cached) " >&6
3217else
3218
3219 ax_check_save_flags=$CFLAGS
3220 CFLAGS="$CFLAGS -fstack-clash-protection"
3221 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3222/* end confdefs.h. */
3223
3224int
3225main ()
3226{
3227
3228 ;
3229 return 0;
3230}
3231_ACEOF
3232if ac_fn_c_try_compile "$LINENO"; then :
3233 ax_cv_check_cflags___fstack_clash_protection=yes
3234else
3235 ax_cv_check_cflags___fstack_clash_protection=no
3236fi
3237rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3238 CFLAGS=$ax_check_save_flags
3239fi
3240{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_clash_protection" >&5
3241$as_echo "$ax_cv_check_cflags___fstack_clash_protection" >&6; }
3242if test "x$ax_cv_check_cflags___fstack_clash_protection" = xyes; then :
3243 HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -fstack-clash-protection"
3244
3245else
3246 :
3247fi
3248
3249{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector-strong" >&5
3250$as_echo_n "checking whether C compiler accepts -fstack-protector-strong... " >&6; }
3251if ${ax_cv_check_cflags___fstack_protector_strong+:} false; then :
3252 $as_echo_n "(cached) " >&6
3253else
3254
3255 ax_check_save_flags=$CFLAGS
3256 CFLAGS="$CFLAGS -fstack-protector-strong"
3257 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3258/* end confdefs.h. */
3259
3260int
3261main ()
3262{
3263
3264 ;
3265 return 0;
3266}
3267_ACEOF
3268if ac_fn_c_try_compile "$LINENO"; then :
3269 ax_cv_check_cflags___fstack_protector_strong=yes
3270else
3271 ax_cv_check_cflags___fstack_protector_strong=no
3272fi
3273rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3274 CFLAGS=$ax_check_save_flags
3275fi
3276{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_protector_strong" >&5
3277$as_echo "$ax_cv_check_cflags___fstack_protector_strong" >&6; }
3278if test "x$ax_cv_check_cflags___fstack_protector_strong" = xyes; then :
3279 HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -fstack-protector-strong"
3280
3281else
3282 :
3283fi
3284
3285
3286# Check whether --enable-analyzer was given.
3287if test "${enable_analyzer+set}" = set; then :
3288 enableval=$enable_analyzer;
3289fi
3290
3291if test "x$enable_analyzer" = "xyes"; then :
3292
3293 EXTRA_CFLAGS="$EXTRA_CFLAGS -fanalyzer -Wno-analyzer-malloc-leak"
3294
3295fi
3296
3108HAVE_APPARMOR="" 3297HAVE_APPARMOR=""
3109# Check whether --enable-apparmor was given. 3298# Check whether --enable-apparmor was given.
3110if test "${enable_apparmor+set}" = set; then : 3299if test "${enable_apparmor+set}" = set; then :
3111 enableval=$enable_apparmor; 3300 enableval=$enable_apparmor;
3112fi 3301fi
3113 3302
3303
3304
3305
3306
3307
3308
3309
3310if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
3311 if test -n "$ac_tool_prefix"; then
3312 # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3313set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3314{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3315$as_echo_n "checking for $ac_word... " >&6; }
3316if ${ac_cv_path_PKG_CONFIG+:} false; then :
3317 $as_echo_n "(cached) " >&6
3318else
3319 case $PKG_CONFIG in
3320 [\\/]* | ?:[\\/]*)
3321 ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
3322 ;;
3323 *)
3324 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3325for as_dir in $PATH
3326do
3327 IFS=$as_save_IFS
3328 test -z "$as_dir" && as_dir=.
3329 for ac_exec_ext in '' $ac_executable_extensions; do
3330 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3331 ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3332 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3333 break 2
3334 fi
3335done
3336 done
3337IFS=$as_save_IFS
3338
3339 ;;
3340esac
3341fi
3342PKG_CONFIG=$ac_cv_path_PKG_CONFIG
3343if test -n "$PKG_CONFIG"; then
3344 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
3345$as_echo "$PKG_CONFIG" >&6; }
3346else
3347 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3348$as_echo "no" >&6; }
3349fi
3350
3351
3352fi
3353if test -z "$ac_cv_path_PKG_CONFIG"; then
3354 ac_pt_PKG_CONFIG=$PKG_CONFIG
3355 # Extract the first word of "pkg-config", so it can be a program name with args.
3356set dummy pkg-config; ac_word=$2
3357{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3358$as_echo_n "checking for $ac_word... " >&6; }
3359if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
3360 $as_echo_n "(cached) " >&6
3361else
3362 case $ac_pt_PKG_CONFIG in
3363 [\\/]* | ?:[\\/]*)
3364 ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
3365 ;;
3366 *)
3367 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3368for as_dir in $PATH
3369do
3370 IFS=$as_save_IFS
3371 test -z "$as_dir" && as_dir=.
3372 for ac_exec_ext in '' $ac_executable_extensions; do
3373 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3374 ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
3375 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3376 break 2
3377 fi
3378done
3379 done
3380IFS=$as_save_IFS
3381
3382 ;;
3383esac
3384fi
3385ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
3386if test -n "$ac_pt_PKG_CONFIG"; then
3387 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
3388$as_echo "$ac_pt_PKG_CONFIG" >&6; }
3389else
3390 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3391$as_echo "no" >&6; }
3392fi
3393
3394 if test "x$ac_pt_PKG_CONFIG" = x; then
3395 PKG_CONFIG=""
3396 else
3397 case $cross_compiling:$ac_tool_warned in
3398yes:)
3399{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3400$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3401ac_tool_warned=yes ;;
3402esac
3403 PKG_CONFIG=$ac_pt_PKG_CONFIG
3404 fi
3405else
3406 PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
3407fi
3408
3409fi
3410if test -n "$PKG_CONFIG"; then
3411 _pkg_min_version=0.9.0
3412 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
3413$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
3414 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
3415 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3416$as_echo "yes" >&6; }
3417 else
3418 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3419$as_echo "no" >&6; }
3420 PKG_CONFIG=""
3421 fi
3422fi
3114if test "x$enable_apparmor" = "xyes"; then : 3423if test "x$enable_apparmor" = "xyes"; then :
3115 3424
3116 HAVE_APPARMOR="-DHAVE_APPARMOR" 3425 HAVE_APPARMOR="-DHAVE_APPARMOR"
3117 3426
3427pkg_failed=no
3428{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AA" >&5
3429$as_echo_n "checking for AA... " >&6; }
3430
3431if test -n "$AA_CFLAGS"; then
3432 pkg_cv_AA_CFLAGS="$AA_CFLAGS"
3433 elif test -n "$PKG_CONFIG"; then
3434 if test -n "$PKG_CONFIG" && \
3435 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libapparmor\""; } >&5
3436 ($PKG_CONFIG --exists --print-errors "libapparmor") 2>&5
3437 ac_status=$?
3438 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3439 test $ac_status = 0; }; then
3440 pkg_cv_AA_CFLAGS=`$PKG_CONFIG --cflags "libapparmor" 2>/dev/null`
3441 test "x$?" != "x0" && pkg_failed=yes
3442else
3443 pkg_failed=yes
3444fi
3445 else
3446 pkg_failed=untried
3447fi
3448if test -n "$AA_LIBS"; then
3449 pkg_cv_AA_LIBS="$AA_LIBS"
3450 elif test -n "$PKG_CONFIG"; then
3451 if test -n "$PKG_CONFIG" && \
3452 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libapparmor\""; } >&5
3453 ($PKG_CONFIG --exists --print-errors "libapparmor") 2>&5
3454 ac_status=$?
3455 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3456 test $ac_status = 0; }; then
3457 pkg_cv_AA_LIBS=`$PKG_CONFIG --libs "libapparmor" 2>/dev/null`
3458 test "x$?" != "x0" && pkg_failed=yes
3459else
3460 pkg_failed=yes
3461fi
3462 else
3463 pkg_failed=untried
3464fi
3465
3466
3467
3468if test $pkg_failed = yes; then
3469 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3470$as_echo "no" >&6; }
3471
3472if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
3473 _pkg_short_errors_supported=yes
3474else
3475 _pkg_short_errors_supported=no
3476fi
3477 if test $_pkg_short_errors_supported = yes; then
3478 AA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libapparmor" 2>&1`
3479 else
3480 AA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libapparmor" 2>&1`
3481 fi
3482 # Put the nasty error message in config.log where it belongs
3483 echo "$AA_PKG_ERRORS" >&5
3484
3485 as_fn_error $? "Package requirements (libapparmor) were not met:
3486
3487$AA_PKG_ERRORS
3488
3489Consider adjusting the PKG_CONFIG_PATH environment variable if you
3490installed software in a non-standard prefix.
3491
3492Alternatively, you may set the environment variables AA_CFLAGS
3493and AA_LIBS to avoid the need to call pkg-config.
3494See the pkg-config man page for more details." "$LINENO" 5
3495elif test $pkg_failed = untried; then
3496 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3497$as_echo "no" >&6; }
3498 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3499$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3500as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
3501is in your PATH or set the PKG_CONFIG environment variable to the full
3502path to pkg-config.
3503
3504Alternatively, you may set the environment variables AA_CFLAGS
3505and AA_LIBS to avoid the need to call pkg-config.
3506See the pkg-config man page for more details.
3507
3508To get pkg-config, see <http://pkg-config.freedesktop.org/>.
3509See \`config.log' for more details" "$LINENO" 5; }
3510else
3511 AA_CFLAGS=$pkg_cv_AA_CFLAGS
3512 AA_LIBS=$pkg_cv_AA_LIBS
3513 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3514$as_echo "yes" >&6; }
3515 EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" && EXTRA_LDFLAGS="$EXTRA_LDFLAGS $AA_LIBS"
3516fi
3517
3518
3519fi
3520
3521HAVE_SELINUX=""
3522# Check whether --enable-selinux was given.
3523if test "${enable_selinux+set}" = set; then :
3524 enableval=$enable_selinux;
3525fi
3526
3527if test "x$enable_selinux" = "xyes"; then :
3528
3529 HAVE_SELINUX="-DHAVE_SELINUX"
3530 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lselinux "
3531
3532
3533fi
3534
3535
3536
3537
3538
3539HAVE_DBUSPROXY=""
3540# Check whether --enable-dbusproxy was given.
3541if test "${enable_dbusproxy+set}" = set; then :
3542 enableval=$enable_dbusproxy;
3543fi
3544
3545if test "x$enable_dbusproxy" != "xno"; then :
3546
3547 HAVE_DBUSPROXY="-DHAVE_DBUSPROXY"
3548
3549
3550fi
3551
3552# overlayfs features temporarily disabled pending fixes
3553HAVE_OVERLAYFS=""
3554
3555#
3556#AC_ARG_ENABLE([overlayfs],
3557# AS_HELP_STRING([--disable-overlayfs], [disable overlayfs]))
3558#AS_IF([test "x$enable_overlayfs" != "xno"], [
3559# HAVE_OVERLAYFS="-DHAVE_OVERLAYFS"
3560# AC_SUBST(HAVE_OVERLAYFS)
3561#])
3562
3563HAVE_OUTPUT=""
3564# Check whether --enable-output was given.
3565if test "${enable_output+set}" = set; then :
3566 enableval=$enable_output;
3567fi
3568
3569if test "x$enable_output" != "xno"; then :
3570
3571 HAVE_OUTPUT="-DHAVE_OUTPUT"
3572
3573
3574fi
3575
3576HAVE_USERTMPFS=""
3577# Check whether --enable-usertmpfs was given.
3578if test "${enable_usertmpfs+set}" = set; then :
3579 enableval=$enable_usertmpfs;
3580fi
3581
3582if test "x$enable_usertmpfs" != "xno"; then :
3583
3584 HAVE_USERTMPFS="-DHAVE_USERTMPFS"
3585
3586
3587fi
3588
3589HAVE_MAN="no"
3590# Check whether --enable-man was given.
3591if test "${enable_man+set}" = set; then :
3592 enableval=$enable_man;
3593fi
3594
3595if test "x$enable_man" != "xno"; then :
3596
3597 HAVE_MAN="-DHAVE_MAN"
3598
3599 # Extract the first word of "gawk", so it can be a program name with args.
3600set dummy gawk; ac_word=$2
3601{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3602$as_echo_n "checking for $ac_word... " >&6; }
3603if ${ac_cv_prog_HAVE_GAWK+:} false; then :
3604 $as_echo_n "(cached) " >&6
3605else
3606 if test -n "$HAVE_GAWK"; then
3607 ac_cv_prog_HAVE_GAWK="$HAVE_GAWK" # Let the user override the test.
3608else
3609as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3610for as_dir in $PATH
3611do
3612 IFS=$as_save_IFS
3613 test -z "$as_dir" && as_dir=.
3614 for ac_exec_ext in '' $ac_executable_extensions; do
3615 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3616 ac_cv_prog_HAVE_GAWK="yes"
3617 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3618 break 2
3619 fi
3620done
3621 done
3622IFS=$as_save_IFS
3623
3624 test -z "$ac_cv_prog_HAVE_GAWK" && ac_cv_prog_HAVE_GAWK="no"
3625fi
3626fi
3627HAVE_GAWK=$ac_cv_prog_HAVE_GAWK
3628if test -n "$HAVE_GAWK"; then
3629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_GAWK" >&5
3630$as_echo "$HAVE_GAWK" >&6; }
3631else
3632 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3633$as_echo "no" >&6; }
3634fi
3635
3636
3637 if test "x$HAVE_GAWK" != "xyes"; then :
3638 as_fn_error $? "\"*** gawk not found ***\"" "$LINENO" 5
3639fi
3640
3641fi
3642
3643HAVE_FIRETUNNEL=""
3644# Check whether --enable-firetunnel was given.
3645if test "${enable_firetunnel+set}" = set; then :
3646 enableval=$enable_firetunnel;
3647fi
3648
3649if test "x$enable_firetunnel" != "xno"; then :
3650
3651 HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL"
3652
3653
3654fi
3655
3656HAVE_PRIVATEHOME=""
3657# Check whether --enable-private-home was given.
3658if test "${enable_private_home+set}" = set; then :
3659 enableval=$enable_private_home;
3660fi
3661
3662if test "x$enable_private_home" != "xno"; then :
3663
3664 HAVE_PRIVATE_HOME="-DHAVE_PRIVATE_HOME"
3665
3666
3667fi
3668
3669HAVE_CHROOT=""
3670# Check whether --enable-chroot was given.
3671if test "${enable_chroot+set}" = set; then :
3672 enableval=$enable_chroot;
3673fi
3674
3675if test "x$enable_chroot" != "xno"; then :
3676
3677 HAVE_CHROOT="-DHAVE_CHROOT"
3678
3679
3680fi
3681
3682HAVE_GLOBALCFG=""
3683# Check whether --enable-globalcfg was given.
3684if test "${enable_globalcfg+set}" = set; then :
3685 enableval=$enable_globalcfg;
3686fi
3687
3688if test "x$enable_globalcfg" != "xno"; then :
3689
3690 HAVE_GLOBALCFG="-DHAVE_GLOBALCFG"
3691
3692
3693fi
3694
3695HAVE_NETWORK=""
3696# Check whether --enable-network was given.
3697if test "${enable_network+set}" = set; then :
3698 enableval=$enable_network;
3699fi
3700
3701if test "x$enable_network" != "xno"; then :
3702
3703 HAVE_NETWORK="-DHAVE_NETWORK"
3704
3705
3706fi
3707
3708HAVE_USERNS=""
3709# Check whether --enable-userns was given.
3710if test "${enable_userns+set}" = set; then :
3711 enableval=$enable_userns;
3712fi
3713
3714if test "x$enable_userns" != "xno"; then :
3715
3716 HAVE_USERNS="-DHAVE_USERNS"
3717
3718
3719fi
3720
3721HAVE_X11=""
3722# Check whether --enable-x11 was given.
3723if test "${enable_x11+set}" = set; then :
3724 enableval=$enable_x11;
3725fi
3726
3727if test "x$enable_x11" != "xno"; then :
3728
3729 HAVE_X11="-DHAVE_X11"
3730
3731
3732fi
3733
3734HAVE_FILE_TRANSFER=""
3735# Check whether --enable-file-transfer was given.
3736if test "${enable_file_transfer+set}" = set; then :
3737 enableval=$enable_file_transfer;
3738fi
3739
3740if test "x$enable_file_transfer" != "xno"; then :
3741
3742 HAVE_FILE_TRANSFER="-DHAVE_FILE_TRANSFER"
3743
3744
3745fi
3118 3746
3747HAVE_SUID=""
3748# Check whether --enable-suid was given.
3749if test "${enable_suid+set}" = set; then :
3750 enableval=$enable_suid;
3119fi 3751fi
3120 3752
3753if test "x$enable_suid" = "xno"; then :
3754 HAVE_SUID="no"
3755else
3756 HAVE_SUID="yes"
3757
3758fi
3759
3760
3761HAVE_FATAL_WARNINGS=""
3762# Check whether --enable-fatal_warnings was given.
3763if test "${enable_fatal_warnings+set}" = set; then :
3764 enableval=$enable_fatal_warnings;
3765fi
3766
3767if test "x$enable_fatal_warnings" = "xyes"; then :
3768
3769 HAVE_FATAL_WARNINGS="-W -Wall -Werror"
3770
3771
3772fi
3773
3774BUSYBOX_WORKAROUND="no"
3775# Check whether --enable-busybox-workaround was given.
3776if test "${enable_busybox_workaround+set}" = set; then :
3777 enableval=$enable_busybox_workaround;
3778fi
3779
3780if test "x$enable_busybox_workaround" = "xyes"; then :
3781
3782 BUSYBOX_WORKAROUND="yes"
3783
3784
3785fi
3786
3787
3788HAVE_GCOV=""
3789# Check whether --enable-gcov was given.
3790if test "${enable_gcov+set}" = set; then :
3791 enableval=$enable_gcov;
3792fi
3793
3794if test "x$enable_gcov" = "xyes"; then :
3795
3796 HAVE_GCOV="--coverage -DHAVE_GCOV "
3797 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcov --coverage "
3798
3799
3800fi
3801
3802HAVE_CONTRIB_INSTALL="yes"
3803# Check whether --enable-contrib-install was given.
3804if test "${enable_contrib_install+set}" = set; then :
3805 enableval=$enable_contrib_install;
3806fi
3807
3808if test "x$enable_contrib_install" = "xno"; then :
3809 HAVE_CONTRIB_INSTALL="no"
3810else
3811 HAVE_CONTRIB_INSTALL="yes"
3812
3813fi
3814
3815
3816HAVE_FORCE_NONEWPRIVS=""
3817# Check whether --enable-force-nonewprivs was given.
3818if test "${enable_force_nonewprivs+set}" = set; then :
3819 enableval=$enable_force_nonewprivs;
3820fi
3821
3822if test "x$enable_force_nonewprivs" = "xyes"; then :
3823
3824 HAVE_FORCE_NONEWPRIVS="-DHAVE_FORCE_NONEWPRIVS"
3825
3826
3827fi
3828
3829HAVE_LTS=""
3830# Check whether --enable-lts was given.
3831if test "${enable_lts+set}" = set; then :
3832 enableval=$enable_lts;
3833fi
3834
3835if test "x$enable_lts" = "xyes"; then :
3836
3837 HAVE_LTS="-DHAVE_LTS"
3121 3838
3122 3839
3840 HAVE_DBUSPROXY=""
3841
3842
3843 HAVE_OVERLAYFS=""
3844
3845
3846 HAVE_OUTPUT=""
3847
3848
3849 HAVE_USERTMPFS=""
3850
3851
3852 HAVE_MAN="-DHAVE_MAN"
3853
3854
3855 HAVE_FIRETUNNEL=""
3856
3857
3858 HAVE_PRIVATEHOME=""
3859
3860
3861 HAVE_CHROOT=""
3862
3863
3864 HAVE_GLOBALCFG=""
3865
3866
3867 HAVE_USERNS=""
3868
3869
3870 HAVE_X11=""
3871
3872
3873 HAVE_FILE_TRANSFER=""
3874
3875
3876 HAVE_SUID="yes"
3877
3878
3879 BUSYBOX_WORKAROUND="no"
3880
3881
3882 HAVE_CONTRIB_INSTALL="no",
3883
3884
3885fi
3886
3887
3888
3889
3890# checking pthread library
3891{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
3892$as_echo_n "checking for main in -lpthread... " >&6; }
3893if ${ac_cv_lib_pthread_main+:} false; then :
3894 $as_echo_n "(cached) " >&6
3895else
3896 ac_check_lib_save_LIBS=$LIBS
3897LIBS="-lpthread $LIBS"
3898cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3899/* end confdefs.h. */
3900
3901
3902int
3903main ()
3904{
3905return main ();
3906 ;
3907 return 0;
3908}
3909_ACEOF
3910if ac_fn_c_try_link "$LINENO"; then :
3911 ac_cv_lib_pthread_main=yes
3912else
3913 ac_cv_lib_pthread_main=no
3914fi
3915rm -f core conftest.err conftest.$ac_objext \
3916 conftest$ac_exeext conftest.$ac_ext
3917LIBS=$ac_check_lib_save_LIBS
3918fi
3919{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
3920$as_echo "$ac_cv_lib_pthread_main" >&6; }
3921if test "x$ac_cv_lib_pthread_main" = xyes; then :
3922 cat >>confdefs.h <<_ACEOF
3923#define HAVE_LIBPTHREAD 1
3924_ACEOF
3925
3926 LIBS="-lpthread $LIBS"
3927
3928else
3929 as_fn_error $? "*** POSIX thread support not installed ***" "$LINENO" 5
3930fi
3931
3123ac_ext=c 3932ac_ext=c
3124ac_cpp='$CPP $CPPFLAGS' 3933ac_cpp='$CPP $CPPFLAGS'
3125ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 3934ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3517,289 +4326,6 @@ fi
3517done 4326done
3518 4327
3519 4328
3520if test "x$enable_apparmor" = "xyes"; then :
3521
3522 ac_fn_c_check_header_mongrel "$LINENO" "sys/apparmor.h" "ac_cv_header_sys_apparmor_h" "$ac_includes_default"
3523if test "x$ac_cv_header_sys_apparmor_h" = xyes; then :
3524
3525else
3526 as_fn_error $? "Couldn't find sys/apparmor.h... please install apparmor user space library and development files " "$LINENO" 5
3527fi
3528
3529
3530
3531fi
3532if test "x$enable_apparmor" = "xyes"; then :
3533
3534 EXTRA_LDFLAGS+="-lapparmor "
3535
3536fi
3537
3538
3539HAVE_OVERLAYFS=""
3540# Check whether --enable-overlayfs was given.
3541if test "${enable_overlayfs+set}" = set; then :
3542 enableval=$enable_overlayfs;
3543fi
3544
3545if test "x$enable_overlayfs" != "xno"; then :
3546
3547 HAVE_OVERLAYFS="-DHAVE_OVERLAYFS"
3548
3549
3550fi
3551
3552HAVE_PRIVATEHOME=""
3553# Check whether --enable-private-home was given.
3554if test "${enable_private_home+set}" = set; then :
3555 enableval=$enable_private_home;
3556fi
3557
3558if test "x$enable_private_home" != "xno"; then :
3559
3560 HAVE_PRIVATE_HOME="-DHAVE_PRIVATE_HOME"
3561
3562
3563fi
3564
3565HAVE_SECCOMP=""
3566# Check whether --enable-seccomp was given.
3567if test "${enable_seccomp+set}" = set; then :
3568 enableval=$enable_seccomp;
3569fi
3570
3571if test "x$enable_seccomp" != "xno"; then :
3572
3573 HAVE_SECCOMP="-DHAVE_SECCOMP"
3574
3575
3576fi
3577
3578HAVE_CHROOT=""
3579# Check whether --enable-chroot was given.
3580if test "${enable_chroot+set}" = set; then :
3581 enableval=$enable_chroot;
3582fi
3583
3584if test "x$enable_chroot" != "xno"; then :
3585
3586 HAVE_CHROOT="-DHAVE_CHROOT"
3587
3588
3589fi
3590
3591HAVE_BIND=""
3592# Check whether --enable-bind was given.
3593if test "${enable_bind+set}" = set; then :
3594 enableval=$enable_bind;
3595fi
3596
3597if test "x$enable_bind" != "xno"; then :
3598
3599 HAVE_BIND="-DHAVE_BIND"
3600
3601
3602fi
3603
3604HAVE_GLOBALCFG=""
3605# Check whether --enable-globalcfg was given.
3606if test "${enable_globalcfg+set}" = set; then :
3607 enableval=$enable_globalcfg;
3608fi
3609
3610if test "x$enable_globalcfg" != "xno"; then :
3611
3612 HAVE_GLOBALCFG="-DHAVE_GLOBALCFG"
3613
3614
3615fi
3616
3617HAVE_NETWORK=""
3618# Check whether --enable-network was given.
3619if test "${enable_network+set}" = set; then :
3620 enableval=$enable_network;
3621fi
3622
3623# Check whether --enable-network was given.
3624if test "${enable_network+set}" = set; then :
3625 enableval=$enable_network;
3626fi
3627
3628if test "x$enable_network" != "xno"; then :
3629
3630 HAVE_NETWORK="-DHAVE_NETWORK"
3631 if test "x$enable_network" = "xrestricted"; then :
3632
3633 HAVE_NETWORK="$HAVE_NETWORK -DHAVE_NETWORK_RESTRICTED"
3634
3635fi
3636
3637
3638fi
3639
3640HAVE_USERNS=""
3641# Check whether --enable-userns was given.
3642if test "${enable_userns+set}" = set; then :
3643 enableval=$enable_userns;
3644fi
3645
3646if test "x$enable_userns" != "xno"; then :
3647
3648 HAVE_USERNS="-DHAVE_USERNS"
3649
3650
3651fi
3652
3653HAVE_X11=""
3654# Check whether --enable-x11 was given.
3655if test "${enable_x11+set}" = set; then :
3656 enableval=$enable_x11;
3657fi
3658
3659if test "x$enable_x11" != "xno"; then :
3660
3661 HAVE_X11="-DHAVE_X11"
3662
3663
3664fi
3665
3666HAVE_FILE_TRANSFER=""
3667# Check whether --enable-file-transfer was given.
3668if test "${enable_file_transfer+set}" = set; then :
3669 enableval=$enable_file_transfer;
3670fi
3671
3672if test "x$enable_file_transfer" != "xno"; then :
3673
3674 HAVE_FILE_TRANSFER="-DHAVE_FILE_TRANSFER"
3675
3676
3677fi
3678
3679HAVE_WHITELIST=""
3680# Check whether --enable-whitelist was given.
3681if test "${enable_whitelist+set}" = set; then :
3682 enableval=$enable_whitelist;
3683fi
3684
3685if test "x$enable_whitelist" != "xno"; then :
3686
3687 HAVE_WHITELIST="-DHAVE_WHITELIST"
3688
3689
3690fi
3691
3692HAVE_FATAL_WARNINGS=""
3693# Check whether --enable-fatal_warnings was given.
3694if test "${enable_fatal_warnings+set}" = set; then :
3695 enableval=$enable_fatal_warnings;
3696fi
3697
3698if test "x$enable_fatal_warnings" = "xyes"; then :
3699
3700 HAVE_FATAL_WARNINGS="-W -Wall -Werror"
3701
3702
3703fi
3704
3705BUSYBOX_WORKAROUND="no"
3706# Check whether --enable-busybox-workaround was given.
3707if test "${enable_busybox_workaround+set}" = set; then :
3708 enableval=$enable_busybox_workaround;
3709fi
3710
3711if test "x$enable_busybox_workaround" = "xyes"; then :
3712
3713 BUSYBOX_WORKAROUND="yes"
3714
3715
3716fi
3717
3718
3719HAVE_GCOV=""
3720# Check whether --enable-gcov was given.
3721if test "${enable_gcov+set}" = set; then :
3722 enableval=$enable_gcov;
3723fi
3724
3725if test "x$enable_gcov" = "xyes"; then :
3726
3727 HAVE_GCOV="--coverage -DHAVE_GCOV "
3728 EXTRA_LDFLAGS+="-lgcov --coverage "
3729
3730
3731fi
3732
3733
3734HAVE_GIT_INSTALL=""
3735# Check whether --enable-git-install was given.
3736if test "${enable_git_install+set}" = set; then :
3737 enableval=$enable_git_install;
3738fi
3739
3740if test "x$enable_git_install" = "xyes"; then :
3741
3742 HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL"
3743
3744
3745fi
3746
3747HAVE_CONTRIB_INSTALL="yes"
3748# Check whether --enable-contrib-install was given.
3749if test "${enable_contrib_install+set}" = set; then :
3750 enableval=$enable_contrib_install;
3751fi
3752
3753if test "x$enable_contrib_install" = "xno"; then :
3754 HAVE_CONTRIB_INSTALL="no"
3755else
3756 HAVE_CONTRIB_INSTALL="yes"
3757
3758fi
3759
3760
3761# checking pthread library
3762{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
3763$as_echo_n "checking for main in -lpthread... " >&6; }
3764if ${ac_cv_lib_pthread_main+:} false; then :
3765 $as_echo_n "(cached) " >&6
3766else
3767 ac_check_lib_save_LIBS=$LIBS
3768LIBS="-lpthread $LIBS"
3769cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3770/* end confdefs.h. */
3771
3772
3773int
3774main ()
3775{
3776return main ();
3777 ;
3778 return 0;
3779}
3780_ACEOF
3781if ac_fn_c_try_link "$LINENO"; then :
3782 ac_cv_lib_pthread_main=yes
3783else
3784 ac_cv_lib_pthread_main=no
3785fi
3786rm -f core conftest.err conftest.$ac_objext \
3787 conftest$ac_exeext conftest.$ac_ext
3788LIBS=$ac_check_lib_save_LIBS
3789fi
3790{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
3791$as_echo "$ac_cv_lib_pthread_main" >&6; }
3792if test "x$ac_cv_lib_pthread_main" = xyes; then :
3793 cat >>confdefs.h <<_ACEOF
3794#define HAVE_LIBPTHREAD 1
3795_ACEOF
3796
3797 LIBS="-lpthread $LIBS"
3798
3799else
3800 as_fn_error $? "*** POSIX thread support not installed ***" "$LINENO" 5
3801fi
3802
3803ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" 4329ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
3804if test "x$ac_cv_header_pthread_h" = xyes; then : 4330if test "x$ac_cv_header_pthread_h" = xyes; then :
3805 4331
@@ -3810,20 +4336,21 @@ fi
3810 4336
3811ac_fn_c_check_header_mongrel "$LINENO" "linux/seccomp.h" "ac_cv_header_linux_seccomp_h" "$ac_includes_default" 4337ac_fn_c_check_header_mongrel "$LINENO" "linux/seccomp.h" "ac_cv_header_linux_seccomp_h" "$ac_includes_default"
3812if test "x$ac_cv_header_linux_seccomp_h" = xyes; then : 4338if test "x$ac_cv_header_linux_seccomp_h" = xyes; then :
3813 HAVE_SECCOMP_H="-DHAVE_SECCOMP_H" 4339
3814else 4340else
3815 HAVE_SECCOMP_H="" 4341 as_fn_error $? "*** SECCOMP support is not installed (/usr/include/linux/seccomp.h missing) ***" "$LINENO" 5
3816fi 4342fi
3817 4343
3818 4344
3819 4345
3820
3821# set sysconfdir 4346# set sysconfdir
3822if test "$prefix" = /usr; then 4347if test "$prefix" = /usr; then
3823 sysconfdir="/etc" 4348 test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc"
3824fi 4349fi
3825 4350
3826ac_config_files="$ac_config_files Makefile src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile" 4351ac_config_files="$ac_config_files mkdeb.sh"
4352
4353ac_config_files="$ac_config_files Makefile src/common.mk src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/fnetfilter/Makefile src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/fsec-print/Makefile src/ftee/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile src/fsec-optimize/Makefile src/profstats/Makefile src/man/Makefile src/zsh_completion/Makefile src/bash_completion/Makefile test/Makefile src/jailcheck/Makefile src/fids/Makefile"
3827 4354
3828cat >confcache <<\_ACEOF 4355cat >confcache <<\_ACEOF
3829# This file is a shell script that caches the results of configure 4356# This file is a shell script that caches the results of configure
@@ -4367,7 +4894,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4367# report actual input values of CONFIG_FILES etc. instead of their 4894# report actual input values of CONFIG_FILES etc. instead of their
4368# values after options handling. 4895# values after options handling.
4369ac_log=" 4896ac_log="
4370This file was extended by firejail $as_me 0.9.51, which was 4897This file was extended by firejail $as_me 0.9.67, which was
4371generated by GNU Autoconf 2.69. Invocation command line was 4898generated by GNU Autoconf 2.69. Invocation command line was
4372 4899
4373 CONFIG_FILES = $CONFIG_FILES 4900 CONFIG_FILES = $CONFIG_FILES
@@ -4414,14 +4941,14 @@ Usage: $0 [OPTION]... [TAG]...
4414Configuration files: 4941Configuration files:
4415$config_files 4942$config_files
4416 4943
4417Report bugs to <netblue30@yahoo.com>. 4944Report bugs to <netblue30@protonmail.com>.
4418firejail home page: <http://firejail.wordpress.com>." 4945firejail home page: <https://firejail.wordpress.com>."
4419 4946
4420_ACEOF 4947_ACEOF
4421cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 4948cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4422ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 4949ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
4423ac_cs_version="\\ 4950ac_cs_version="\\
4424firejail config.status 0.9.51 4951firejail config.status 0.9.67
4425configured by $0, generated by GNU Autoconf 2.69, 4952configured by $0, generated by GNU Autoconf 2.69,
4426 with options \\"\$ac_cs_config\\" 4953 with options \\"\$ac_cs_config\\"
4427 4954
@@ -4532,21 +5059,32 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4532for ac_config_target in $ac_config_targets 5059for ac_config_target in $ac_config_targets
4533do 5060do
4534 case $ac_config_target in 5061 case $ac_config_target in
5062 "mkdeb.sh") CONFIG_FILES="$CONFIG_FILES mkdeb.sh" ;;
4535 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; 5063 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
5064 "src/common.mk") CONFIG_FILES="$CONFIG_FILES src/common.mk" ;;
4536 "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; 5065 "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
4537 "src/fcopy/Makefile") CONFIG_FILES="$CONFIG_FILES src/fcopy/Makefile" ;; 5066 "src/fcopy/Makefile") CONFIG_FILES="$CONFIG_FILES src/fcopy/Makefile" ;;
4538 "src/fnet/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnet/Makefile" ;; 5067 "src/fnet/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnet/Makefile" ;;
4539 "src/firejail/Makefile") CONFIG_FILES="$CONFIG_FILES src/firejail/Makefile" ;; 5068 "src/firejail/Makefile") CONFIG_FILES="$CONFIG_FILES src/firejail/Makefile" ;;
5069 "src/fnetfilter/Makefile") CONFIG_FILES="$CONFIG_FILES src/fnetfilter/Makefile" ;;
4540 "src/firemon/Makefile") CONFIG_FILES="$CONFIG_FILES src/firemon/Makefile" ;; 5070 "src/firemon/Makefile") CONFIG_FILES="$CONFIG_FILES src/firemon/Makefile" ;;
4541 "src/libtrace/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtrace/Makefile" ;; 5071 "src/libtrace/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtrace/Makefile" ;;
4542 "src/libtracelog/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtracelog/Makefile" ;; 5072 "src/libtracelog/Makefile") CONFIG_FILES="$CONFIG_FILES src/libtracelog/Makefile" ;;
4543 "src/firecfg/Makefile") CONFIG_FILES="$CONFIG_FILES src/firecfg/Makefile" ;; 5073 "src/firecfg/Makefile") CONFIG_FILES="$CONFIG_FILES src/firecfg/Makefile" ;;
4544 "src/fbuilder/Makefile") CONFIG_FILES="$CONFIG_FILES src/fbuilder/Makefile" ;; 5074 "src/fbuilder/Makefile") CONFIG_FILES="$CONFIG_FILES src/fbuilder/Makefile" ;;
5075 "src/fsec-print/Makefile") CONFIG_FILES="$CONFIG_FILES src/fsec-print/Makefile" ;;
4545 "src/ftee/Makefile") CONFIG_FILES="$CONFIG_FILES src/ftee/Makefile" ;; 5076 "src/ftee/Makefile") CONFIG_FILES="$CONFIG_FILES src/ftee/Makefile" ;;
4546 "src/faudit/Makefile") CONFIG_FILES="$CONFIG_FILES src/faudit/Makefile" ;;
4547 "src/fseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/fseccomp/Makefile" ;; 5077 "src/fseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/fseccomp/Makefile" ;;
4548 "src/fldd/Makefile") CONFIG_FILES="$CONFIG_FILES src/fldd/Makefile" ;; 5078 "src/fldd/Makefile") CONFIG_FILES="$CONFIG_FILES src/fldd/Makefile" ;;
4549 "src/libpostexecseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/libpostexecseccomp/Makefile" ;; 5079 "src/libpostexecseccomp/Makefile") CONFIG_FILES="$CONFIG_FILES src/libpostexecseccomp/Makefile" ;;
5080 "src/fsec-optimize/Makefile") CONFIG_FILES="$CONFIG_FILES src/fsec-optimize/Makefile" ;;
5081 "src/profstats/Makefile") CONFIG_FILES="$CONFIG_FILES src/profstats/Makefile" ;;
5082 "src/man/Makefile") CONFIG_FILES="$CONFIG_FILES src/man/Makefile" ;;
5083 "src/zsh_completion/Makefile") CONFIG_FILES="$CONFIG_FILES src/zsh_completion/Makefile" ;;
5084 "src/bash_completion/Makefile") CONFIG_FILES="$CONFIG_FILES src/bash_completion/Makefile" ;;
5085 "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
5086 "src/jailcheck/Makefile") CONFIG_FILES="$CONFIG_FILES src/jailcheck/Makefile" ;;
5087 "src/fids/Makefile") CONFIG_FILES="$CONFIG_FILES src/fids/Makefile" ;;
4550 5088
4551 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 5089 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
4552 esac 5090 esac
@@ -4965,6 +5503,11 @@ which seems to be undefined. Please make sure it is defined" >&2;}
4965 5503
4966 esac 5504 esac
4967 5505
5506
5507 case $ac_file$ac_mode in
5508 "mkdeb.sh":F) chmod +x mkdeb.sh ;;
5509
5510 esac
4968done # for ac_tag 5511done # for ac_tag
4969 5512
4970 5513
@@ -5002,27 +5545,48 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
5002fi 5545fi
5003 5546
5004 5547
5005echo 5548cat <<EOF
5006echo "Configuration options:" 5549
5007echo " prefix: $prefix" 5550Configuration options:
5008echo " sysconfdir: $sysconfdir" 5551 prefix: $prefix
5009echo " seccomp: $HAVE_SECCOMP" 5552 sysconfdir: $sysconfdir
5010echo " <linux/seccomp.h>: $HAVE_SECCOMP_H" 5553 apparmor: $HAVE_APPARMOR
5011echo " apparmor: $HAVE_APPARMOR" 5554 SELinux labeling support: $HAVE_SELINUX
5012echo " global config: $HAVE_GLOBALCFG" 5555 global config: $HAVE_GLOBALCFG
5013echo " chroot: $HAVE_CHROOT" 5556 chroot: $HAVE_CHROOT
5014echo " bind: $HAVE_BIND" 5557 network: $HAVE_NETWORK
5015echo " network: $HAVE_NETWORK" 5558 user namespace: $HAVE_USERNS
5016echo " user namespace: $HAVE_USERNS" 5559 X11 sandboxing support: $HAVE_X11
5017echo " X11 sandboxing support: $HAVE_X11" 5560 private home support: $HAVE_PRIVATE_HOME
5018echo " whitelisting: $HAVE_WHITELIST" 5561 file transfer support: $HAVE_FILE_TRANSFER
5019echo " private home support: $HAVE_PRIVATE_HOME" 5562 overlayfs support: $HAVE_OVERLAYFS
5020echo " file transfer support: $HAVE_FILE_TRANSFER" 5563 DBUS proxy support: $HAVE_DBUSPROXY
5021echo " overlayfs support: $HAVE_OVERLAYFS" 5564 allow tmpfs as regular user: $HAVE_USERTMPFS
5022echo " git install support: $HAVE_GIT_INSTALL" 5565 enable --ouput logging: $HAVE_OUTPUT
5023echo " busybox workaround: $BUSYBOX_WORKAROUND" 5566 Manpage support: $HAVE_MAN
5024echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS" 5567 firetunnel support: $HAVE_FIRETUNNEL
5025echo " fatal warnings: $HAVE_FATAL_WARNINGS" 5568 busybox workaround: $BUSYBOX_WORKAROUND
5026echo " Gcov instrumentation: $HAVE_GCOV" 5569 Spectre compiler patch: $HAVE_SPECTRE
5027echo " Install contrib scripts: $HAVE_CONTRIB_INSTALL" 5570 EXTRA_LDFLAGS: $EXTRA_LDFLAGS
5028echo 5571 EXTRA_CFLAGS: $EXTRA_CFLAGS
5572 fatal warnings: $HAVE_FATAL_WARNINGS
5573 Gcov instrumentation: $HAVE_GCOV
5574 Install contrib scripts: $HAVE_CONTRIB_INSTALL
5575 Install as a SUID executable: $HAVE_SUID
5576 LTS: $HAVE_LTS
5577 Always enforce filters: $HAVE_FORCE_NONEWPRIVS
5578
5579EOF
5580
5581if test "$HAVE_LTS" = -DHAVE_LTS; then
5582 cat <<\EOF
5583
5584
5585*********************************************************
5586* Warning: Long-term support (LTS) was enabled! *
5587* Most compile-time options have bean rewritten! *
5588*********************************************************
5589
5590
5591EOF
5592fi
diff --git a/configure.ac b/configure.ac
index 900c8b959..5fde6d402 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,38 +1,124 @@
1#
2# Note:
3#
4# If for any reason autoconf fails, run "autoreconf -i --install " and try again.
5# This is how the error looks like on Arch Linux:
6# ./configure: line 3064: syntax error near unexpected token `newline'
7# ./configure: line 3064: `AX_CHECK_COMPILE_FLAG('
8#
9# We rely solely on autoconf, without automake. Apparently, in this case
10# the macros from m4 directory are not picked up by default by automake.
11# "autoreconf -i --install" seems to fix the problem.
12#
13
1AC_PREREQ([2.68]) 14AC_PREREQ([2.68])
2AC_INIT(firejail, 0.9.51, netblue30@yahoo.com, , http://firejail.wordpress.com) 15AC_INIT([firejail],[0.9.67],[netblue30@protonmail.com],[],[https://firejail.wordpress.com])
3AC_CONFIG_SRCDIR([src/firejail/main.c]) 16AC_CONFIG_SRCDIR([src/firejail/main.c])
4#AC_CONFIG_HEADERS([config.h])
5 17
18AC_CONFIG_MACRO_DIR([m4])
6 19
7AC_PROG_CC 20AC_PROG_CC
8#AC_PROG_CXX
9AC_PROG_INSTALL 21AC_PROG_INSTALL
10AC_PROG_RANLIB 22AC_PROG_RANLIB
11 23
24HAVE_SPECTRE="no"
25AX_CHECK_COMPILE_FLAG(
26 [-mindirect-branch=thunk],
27 [HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -mindirect-branch=thunk"]
28)
29AX_CHECK_COMPILE_FLAG(
30 [-mretpoline],
31 [HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -mretpoline"]
32)
33AX_CHECK_COMPILE_FLAG(
34 [-fstack-clash-protection],
35 [HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -fstack-clash-protection"]
36)
37AX_CHECK_COMPILE_FLAG(
38 [-fstack-protector-strong],
39 [HAVE_SPECTRE="yes" && EXTRA_CFLAGS="$EXTRA_CFLAGS -fstack-protector-strong"]
40)
41
42AC_ARG_ENABLE([analyzer],
43 AS_HELP_STRING([--enable-analyzer], [enable GCC static analyzer]))
44AS_IF([test "x$enable_analyzer" = "xyes"], [
45 EXTRA_CFLAGS="$EXTRA_CFLAGS -fanalyzer -Wno-analyzer-malloc-leak"
46])
47
12HAVE_APPARMOR="" 48HAVE_APPARMOR=""
13AC_ARG_ENABLE([apparmor], 49AC_ARG_ENABLE([apparmor],
14 AS_HELP_STRING([--enable-apparmor], [enable apparmor])) 50 AS_HELP_STRING([--enable-apparmor], [enable apparmor]))
15AS_IF([test "x$enable_apparmor" = "xyes"], [ 51AS_IF([test "x$enable_apparmor" = "xyes"], [
16 HAVE_APPARMOR="-DHAVE_APPARMOR" 52 HAVE_APPARMOR="-DHAVE_APPARMOR"
53 PKG_CHECK_MODULES([AA], libapparmor,
54 [EXTRA_CFLAGS="$EXTRA_CFLAGS $AA_CFLAGS" && EXTRA_LDFLAGS="$EXTRA_LDFLAGS $AA_LIBS"])
17 AC_SUBST(HAVE_APPARMOR) 55 AC_SUBST(HAVE_APPARMOR)
18]) 56])
19 57
20 58HAVE_SELINUX=""
21AS_IF([test "x$enable_apparmor" = "xyes"], [ 59AC_ARG_ENABLE([selinux],
22 AC_CHECK_HEADER(sys/apparmor.h, , [AC_MSG_ERROR( 60 AS_HELP_STRING([--enable-selinux], [SELinux labeling support]))
23 [Couldn't find sys/apparmor.h... please install apparmor user space library and development files] )]) 61AS_IF([test "x$enable_selinux" = "xyes"], [
24]) 62 HAVE_SELINUX="-DHAVE_SELINUX"
25AS_IF([test "x$enable_apparmor" = "xyes"], [ 63 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lselinux "
26 EXTRA_LDFLAGS+="-lapparmor " 64 AC_SUBST(HAVE_SELINUX)
27]) 65])
66
67AC_SUBST([EXTRA_CFLAGS])
28AC_SUBST([EXTRA_LDFLAGS]) 68AC_SUBST([EXTRA_LDFLAGS])
29 69
70
71HAVE_DBUSPROXY=""
72AC_ARG_ENABLE([dbusproxy],
73 AS_HELP_STRING([--disable-dbusproxy], [disable dbus proxy]))
74AS_IF([test "x$enable_dbusproxy" != "xno"], [
75 HAVE_DBUSPROXY="-DHAVE_DBUSPROXY"
76 AC_SUBST(HAVE_DBUSPROXY)
77])
78
79# overlayfs features temporarily disabled pending fixes
30HAVE_OVERLAYFS="" 80HAVE_OVERLAYFS=""
31AC_ARG_ENABLE([overlayfs], 81AC_SUBST(HAVE_OVERLAYFS)
32 AS_HELP_STRING([--disable-overlayfs], [disable overlayfs])) 82#
33AS_IF([test "x$enable_overlayfs" != "xno"], [ 83#AC_ARG_ENABLE([overlayfs],
34 HAVE_OVERLAYFS="-DHAVE_OVERLAYFS" 84# AS_HELP_STRING([--disable-overlayfs], [disable overlayfs]))
35 AC_SUBST(HAVE_OVERLAYFS) 85#AS_IF([test "x$enable_overlayfs" != "xno"], [
86# HAVE_OVERLAYFS="-DHAVE_OVERLAYFS"
87# AC_SUBST(HAVE_OVERLAYFS)
88#])
89
90HAVE_OUTPUT=""
91AC_ARG_ENABLE([output],
92 AS_HELP_STRING([--disable-output], [disable --output logging]))
93AS_IF([test "x$enable_output" != "xno"], [
94 HAVE_OUTPUT="-DHAVE_OUTPUT"
95 AC_SUBST(HAVE_OUTPUT)
96])
97
98HAVE_USERTMPFS=""
99AC_ARG_ENABLE([usertmpfs],
100 AS_HELP_STRING([--disable-usertmpfs], [disable tmpfs as regular user]))
101AS_IF([test "x$enable_usertmpfs" != "xno"], [
102 HAVE_USERTMPFS="-DHAVE_USERTMPFS"
103 AC_SUBST(HAVE_USERTMPFS)
104])
105
106HAVE_MAN="no"
107AC_ARG_ENABLE([man],
108 AS_HELP_STRING([--disable-man], [disable man pages]))
109AS_IF([test "x$enable_man" != "xno"], [
110 HAVE_MAN="-DHAVE_MAN"
111 AC_SUBST(HAVE_MAN)
112 AC_CHECK_PROG([HAVE_GAWK], [gawk], [yes], [no])
113 AS_IF([test "x$HAVE_GAWK" != "xyes"], [AC_MSG_ERROR("*** gawk not found ***")])
114])
115
116HAVE_FIRETUNNEL=""
117AC_ARG_ENABLE([firetunnel],
118 AS_HELP_STRING([--disable-firetunnel], [disable firetunnel]))
119AS_IF([test "x$enable_firetunnel" != "xno"], [
120 HAVE_FIRETUNNEL="-DHAVE_FIRETUNNEL"
121 AC_SUBST(HAVE_FIRETUNNEL)
36]) 122])
37 123
38HAVE_PRIVATEHOME="" 124HAVE_PRIVATEHOME=""
@@ -43,14 +129,6 @@ AS_IF([test "x$enable_private_home" != "xno"], [
43 AC_SUBST(HAVE_PRIVATE_HOME) 129 AC_SUBST(HAVE_PRIVATE_HOME)
44]) 130])
45 131
46HAVE_SECCOMP=""
47AC_ARG_ENABLE([seccomp],
48 AS_HELP_STRING([--disable-seccomp], [disable seccomp]))
49AS_IF([test "x$enable_seccomp" != "xno"], [
50 HAVE_SECCOMP="-DHAVE_SECCOMP"
51 AC_SUBST(HAVE_SECCOMP)
52])
53
54HAVE_CHROOT="" 132HAVE_CHROOT=""
55AC_ARG_ENABLE([chroot], 133AC_ARG_ENABLE([chroot],
56 AS_HELP_STRING([--disable-chroot], [disable chroot])) 134 AS_HELP_STRING([--disable-chroot], [disable chroot]))
@@ -59,14 +137,6 @@ AS_IF([test "x$enable_chroot" != "xno"], [
59 AC_SUBST(HAVE_CHROOT) 137 AC_SUBST(HAVE_CHROOT)
60]) 138])
61 139
62HAVE_BIND=""
63AC_ARG_ENABLE([bind],
64 AS_HELP_STRING([--disable-bind], [disable bind]))
65AS_IF([test "x$enable_bind" != "xno"], [
66 HAVE_BIND="-DHAVE_BIND"
67 AC_SUBST(HAVE_BIND)
68])
69
70HAVE_GLOBALCFG="" 140HAVE_GLOBALCFG=""
71AC_ARG_ENABLE([globalcfg], 141AC_ARG_ENABLE([globalcfg],
72 AS_HELP_STRING([--disable-globalcfg], [if the global config file firejail.cfg is not present, continue the program using defaults])) 142 AS_HELP_STRING([--disable-globalcfg], [if the global config file firejail.cfg is not present, continue the program using defaults]))
@@ -78,13 +148,8 @@ AS_IF([test "x$enable_globalcfg" != "xno"], [
78HAVE_NETWORK="" 148HAVE_NETWORK=""
79AC_ARG_ENABLE([network], 149AC_ARG_ENABLE([network],
80 AS_HELP_STRING([--disable-network], [disable network])) 150 AS_HELP_STRING([--disable-network], [disable network]))
81AC_ARG_ENABLE([network],
82 AS_HELP_STRING([--enable-network=restricted], [ restrict --net= to root only]))
83AS_IF([test "x$enable_network" != "xno"], [ 151AS_IF([test "x$enable_network" != "xno"], [
84 HAVE_NETWORK="-DHAVE_NETWORK" 152 HAVE_NETWORK="-DHAVE_NETWORK"
85 AS_IF([test "x$enable_network" = "xrestricted"], [
86 HAVE_NETWORK="$HAVE_NETWORK -DHAVE_NETWORK_RESTRICTED"
87 ])
88 AC_SUBST(HAVE_NETWORK) 153 AC_SUBST(HAVE_NETWORK)
89]) 154])
90 155
@@ -112,13 +177,14 @@ AS_IF([test "x$enable_file_transfer" != "xno"], [
112 AC_SUBST(HAVE_FILE_TRANSFER) 177 AC_SUBST(HAVE_FILE_TRANSFER)
113]) 178])
114 179
115HAVE_WHITELIST="" 180HAVE_SUID=""
116AC_ARG_ENABLE([whitelist], 181AC_ARG_ENABLE([suid],
117 AS_HELP_STRING([--disable-whitelist], [disable whitelist])) 182 AS_HELP_STRING([--disable-suid], [install as a non-SUID executable]))
118AS_IF([test "x$enable_whitelist" != "xno"], [ 183AS_IF([test "x$enable_suid" = "xno"],
119 HAVE_WHITELIST="-DHAVE_WHITELIST" 184 [HAVE_SUID="no"],
120 AC_SUBST(HAVE_WHITELIST) 185 [HAVE_SUID="yes"]
121]) 186)
187AC_SUBST(HAVE_SUID)
122 188
123HAVE_FATAL_WARNINGS="" 189HAVE_FATAL_WARNINGS=""
124AC_ARG_ENABLE([fatal_warnings], 190AC_ARG_ENABLE([fatal_warnings],
@@ -142,19 +208,10 @@ AC_ARG_ENABLE([gcov],
142 AS_HELP_STRING([--enable-gcov], [Gcov instrumentation])) 208 AS_HELP_STRING([--enable-gcov], [Gcov instrumentation]))
143AS_IF([test "x$enable_gcov" = "xyes"], [ 209AS_IF([test "x$enable_gcov" = "xyes"], [
144 HAVE_GCOV="--coverage -DHAVE_GCOV " 210 HAVE_GCOV="--coverage -DHAVE_GCOV "
145 EXTRA_LDFLAGS+="-lgcov --coverage " 211 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lgcov --coverage "
146 AC_SUBST(HAVE_GCOV) 212 AC_SUBST(HAVE_GCOV)
147]) 213])
148 214
149
150HAVE_GIT_INSTALL=""
151AC_ARG_ENABLE([git-install],
152 AS_HELP_STRING([--enable-git-install], [enable git install feature]))
153AS_IF([test "x$enable_git_install" = "xyes"], [
154 HAVE_GIT_INSTALL="-DHAVE_GIT_INSTALL"
155 AC_SUBST(HAVE_GIT_INSTALL)
156])
157
158HAVE_CONTRIB_INSTALL="yes" 215HAVE_CONTRIB_INSTALL="yes"
159AC_ARG_ENABLE([contrib-install], 216AC_ARG_ENABLE([contrib-install],
160 AS_HELP_STRING([--enable-contrib-install], [install contrib scripts])) 217 AS_HELP_STRING([--enable-contrib-install], [install contrib scripts]))
@@ -164,42 +221,130 @@ AS_IF([test "x$enable_contrib_install" = "xno"],
164) 221)
165AC_SUBST(HAVE_CONTRIB_INSTALL) 222AC_SUBST(HAVE_CONTRIB_INSTALL)
166 223
224HAVE_FORCE_NONEWPRIVS=""
225AC_ARG_ENABLE([force-nonewprivs],
226 AS_HELP_STRING([--enable-force-nonewprivs], [enable force nonewprivs]))
227AS_IF([test "x$enable_force_nonewprivs" = "xyes"], [
228 HAVE_FORCE_NONEWPRIVS="-DHAVE_FORCE_NONEWPRIVS"
229 AC_SUBST(HAVE_FORCE_NONEWPRIVS)
230])
231
232HAVE_LTS=""
233AC_ARG_ENABLE([lts],
234 AS_HELP_STRING([--enable-lts], [enable long-term support software version (LTS)]))
235AS_IF([test "x$enable_lts" = "xyes"], [
236 HAVE_LTS="-DHAVE_LTS"
237 AC_SUBST(HAVE_LTS)
238
239 HAVE_DBUSPROXY=""
240 AC_SUBST(HAVE_DBUSPROXY)
241
242 HAVE_OVERLAYFS=""
243 AC_SUBST(HAVE_OVERLAYFS)
244
245 HAVE_OUTPUT=""
246 AC_SUBST(HAVE_OUTPUT)
247
248 HAVE_USERTMPFS=""
249 AC_SUBST(HAVE_USERTMPFS)
250
251 HAVE_MAN="-DHAVE_MAN"
252 AC_SUBST(HAVE_MAN)
253
254 HAVE_FIRETUNNEL=""
255 AC_SUBST(HAVE_FIRETUNNEL)
256
257 HAVE_PRIVATEHOME=""
258 AC_SUBST(HAVE_PRIVATE_HOME)
259
260 HAVE_CHROOT=""
261 AC_SUBST(HAVE_CHROOT)
262
263 HAVE_GLOBALCFG=""
264 AC_SUBST(HAVE_GLOBALCFG)
265
266 HAVE_USERNS=""
267 AC_SUBST(HAVE_USERNS)
268
269 HAVE_X11=""
270 AC_SUBST(HAVE_X11)
271
272 HAVE_FILE_TRANSFER=""
273 AC_SUBST(HAVE_FILE_TRANSFER)
274
275 HAVE_SUID="yes"
276 AC_SUBST(HAVE_SUID)
277
278 BUSYBOX_WORKAROUND="no"
279 AC_SUBST(BUSYBOX_WORKAROUND)
280
281 HAVE_CONTRIB_INSTALL="no",
282 AC_SUBST(HAVE_CONTRIB_INSTALL)
283])
284
285
286
287
167# checking pthread library 288# checking pthread library
168AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***])) 289AC_CHECK_LIB([pthread], [main], [], AC_MSG_ERROR([*** POSIX thread support not installed ***]))
169AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***])) 290AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([*** POSIX thread support not installed ***]))
170AC_CHECK_HEADER([linux/seccomp.h], HAVE_SECCOMP_H="-DHAVE_SECCOMP_H", HAVE_SECCOMP_H="") 291AC_CHECK_HEADER([linux/seccomp.h],,AC_MSG_ERROR([*** SECCOMP support is not installed (/usr/include/linux/seccomp.h missing) ***]))
171AC_SUBST(HAVE_SECCOMP_H)
172 292
173# set sysconfdir 293# set sysconfdir
174if test "$prefix" = /usr; then 294if test "$prefix" = /usr; then
175 sysconfdir="/etc" 295 test "$sysconfdir" = '${prefix}/etc' && sysconfdir="/etc"
176fi 296fi
177 297
178AC_OUTPUT(Makefile src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile \ 298AC_CONFIG_FILES([mkdeb.sh], [chmod +x mkdeb.sh])
179src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile \ 299AC_CONFIG_FILES([Makefile src/common.mk src/lib/Makefile src/fcopy/Makefile src/fnet/Makefile src/firejail/Makefile src/fnetfilter/Makefile \
180src/ftee/Makefile src/faudit/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile) 300src/firemon/Makefile src/libtrace/Makefile src/libtracelog/Makefile src/firecfg/Makefile src/fbuilder/Makefile src/fsec-print/Makefile \
181 301src/ftee/Makefile src/fseccomp/Makefile src/fldd/Makefile src/libpostexecseccomp/Makefile src/fsec-optimize/Makefile \
182echo 302src/profstats/Makefile src/man/Makefile src/zsh_completion/Makefile src/bash_completion/Makefile test/Makefile \
183echo "Configuration options:" 303src/jailcheck/Makefile src/fids/Makefile])
184echo " prefix: $prefix" 304AC_OUTPUT
185echo " sysconfdir: $sysconfdir" 305
186echo " seccomp: $HAVE_SECCOMP" 306cat <<EOF
187echo " <linux/seccomp.h>: $HAVE_SECCOMP_H" 307
188echo " apparmor: $HAVE_APPARMOR" 308Configuration options:
189echo " global config: $HAVE_GLOBALCFG" 309 prefix: $prefix
190echo " chroot: $HAVE_CHROOT" 310 sysconfdir: $sysconfdir
191echo " bind: $HAVE_BIND" 311 apparmor: $HAVE_APPARMOR
192echo " network: $HAVE_NETWORK" 312 SELinux labeling support: $HAVE_SELINUX
193echo " user namespace: $HAVE_USERNS" 313 global config: $HAVE_GLOBALCFG
194echo " X11 sandboxing support: $HAVE_X11" 314 chroot: $HAVE_CHROOT
195echo " whitelisting: $HAVE_WHITELIST" 315 network: $HAVE_NETWORK
196echo " private home support: $HAVE_PRIVATE_HOME" 316 user namespace: $HAVE_USERNS
197echo " file transfer support: $HAVE_FILE_TRANSFER" 317 X11 sandboxing support: $HAVE_X11
198echo " overlayfs support: $HAVE_OVERLAYFS" 318 private home support: $HAVE_PRIVATE_HOME
199echo " git install support: $HAVE_GIT_INSTALL" 319 file transfer support: $HAVE_FILE_TRANSFER
200echo " busybox workaround: $BUSYBOX_WORKAROUND" 320 overlayfs support: $HAVE_OVERLAYFS
201echo " EXTRA_LDFLAGS: $EXTRA_LDFLAGS" 321 DBUS proxy support: $HAVE_DBUSPROXY
202echo " fatal warnings: $HAVE_FATAL_WARNINGS" 322 allow tmpfs as regular user: $HAVE_USERTMPFS
203echo " Gcov instrumentation: $HAVE_GCOV" 323 enable --ouput logging: $HAVE_OUTPUT
204echo " Install contrib scripts: $HAVE_CONTRIB_INSTALL" 324 Manpage support: $HAVE_MAN
205echo 325 firetunnel support: $HAVE_FIRETUNNEL
326 busybox workaround: $BUSYBOX_WORKAROUND
327 Spectre compiler patch: $HAVE_SPECTRE
328 EXTRA_LDFLAGS: $EXTRA_LDFLAGS
329 EXTRA_CFLAGS: $EXTRA_CFLAGS
330 fatal warnings: $HAVE_FATAL_WARNINGS
331 Gcov instrumentation: $HAVE_GCOV
332 Install contrib scripts: $HAVE_CONTRIB_INSTALL
333 Install as a SUID executable: $HAVE_SUID
334 LTS: $HAVE_LTS
335 Always enforce filters: $HAVE_FORCE_NONEWPRIVS
336
337EOF
338
339if test "$HAVE_LTS" = -DHAVE_LTS; then
340 cat <<\EOF
341
342
343*********************************************************
344* Warning: Long-term support (LTS) was enabled! *
345* Most compile-time options have bean rewritten! *
346*********************************************************
347
348
349EOF
350fi
diff --git a/contrib/firejail-welcome.sh b/contrib/firejail-welcome.sh
new file mode 100755
index 000000000..6eebc67c5
--- /dev/null
+++ b/contrib/firejail-welcome.sh
@@ -0,0 +1,128 @@
1#!/bin/bash
2
3# This file is part of Firejail project
4# Copyright (C) 2020-2021 Firejail Authors
5# License GPL v2
6
7if ! command -v zenity >/dev/null; then
8 echo "Please install zenity."
9 exit 1
10fi
11if ! command -v sudo >/dev/null; then
12 echo "Please install sudo."
13 exit 1
14fi
15
16export LANG=en_US.UTF8
17
18zenity --title=firejail-welcome.sh --text-info --width=750 --height=500 <<EOM
19Welcome to firejail!
20
21This is a quick setup guide for newbies.
22
23Profiles for programs can be found in /etc/firejail. Own customizations should go in a file named
24<profile-name>.local in ~/.config/firejal.
25
26Firejail's own configuration can be found at /etc/firejail/firejail.config.
27
28Please note that running this script a second time can set new options, but does not unset options
29set in a previous run.
30
31Website: https://firejail.wordpress.com
32Bug-Tracker: https://github.com/netblue30/firejail/issues
33Documentation:
34- https://github.com/netblue30/firejail/wiki
35- https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions
36- https://firejail.wordpress.com/documentation-2
37- man:firejail(1) and man:firejail-profile(5)
38
39PS: If you have any improvements for this script, open an issue or pull request.
40EOM
41[[ $? -eq 1 ]] && exit 0
42
43sed_scripts=()
44
45read -r -d $'\0' MSG_Q_BROWSER_DISABLE_U2F <<EOM
46<big><b>Should browsers be allowed to access u2f hardware?</b></big>
47EOM
48
49read -r -d $'\0' MSG_Q_BROWSER_ALLOW_DRM <<EOM
50<big><b>Should browsers be able to play DRM content?</b></big>
51
52\$HOME is noexec,nodev,nosuid by default for the most sandboxes. This means that executing programs which are located in \$HOME,
53is forbidden, the setuid attribute on files is ignored and device files inside \$HOME don't work. Browsers install proprietary
54DRM plug-ins such as Widevine under \$HOME by default. In order to use them, \$HOME must be mounted exec inside the sandbox to
55allow their execution. Clearly, this may help an attacker to start malicious code.
56
57NOTE: Other software written in an interpreter language such as bash, python or java can always be started from \$HOME.
58
59HINT: If <tt>/home</tt> has its own partition, you can mount it <tt>nodev,nosuid</tt> for all programs.
60EOM
61
62read -r -d $'\0' MSG_L_ADVANCED_OPTIONS <<EOM
63You maybe want to set some of these advanced options.
64EOM
65
66read -r -d $'\0' MSG_Q_RUN_FIRECFG <<EOM
67<big><b>Should most programs be started in firejail by default?</b></big>
68EOM
69
70read -r -d $'\0' MSG_I_ROOT_REQUIRED <<EOM
71In order to apply these changes, root privileges are required.
72You will now be asked to enter your password.
73EOM
74
75read -r -d $'\0' MSG_I_FINISH <<EOM
76🥳
77EOM
78
79if zenity --title=firejail-welcome.sh --question --ellipsize --text="$MSG_Q_BROWSER_DISABLE_U2F"; then
80 sed_scripts+=("-e s/# browser-disable-u2f yes/browser-disable-u2f no/")
81fi
82
83if zenity --title=firejail-welcome.sh --question --ellipsize --text="$MSG_Q_BROWSER_ALLOW_DRM"; then
84 sed_scripts+=("-e s/# browser-allow-drm no/browser-allow-drm yes/")
85fi
86
87advanced_options=$(zenity --title=firejail-welcome.sh --list --width=800 --height=200 \
88 --text="$MSG_L_ADVANCED_OPTIONS" --multiple --checklist --separator=" " \
89 --column="" --column=Option --column=Description <<EOM
90
91force-nonewprivs
92Always set nonewprivs, this is a strong mitigation against exploits in firejail. However some programs like chromium or wireshark maybe don't work anymore.
93
94restricted-network
95Restrict all network related commands except 'net none' to root only.
96
97seccomp-error-action=kill
98Kill programs which violate seccomp rules (default: return a error).
99EOM
100)
101
102if [[ $advanced_options == *force-nonewprivs* ]]; then
103 sed_scripts+=("-e s/# force-nonewprivs no/force-nonewprivs yes/")
104fi
105if [[ $advanced_options == *restricted-network* ]]; then
106 sed_scripts+=("-e s/# restricted-network no/restricted-network yes/")
107fi
108if [[ $advanced_options == *seccomp-error-action=kill* ]]; then
109 sed_scripts+=("-e s/# seccomp-error-action EPERM/seccomp-error-action kill/")
110fi
111
112if zenity --title=firejail-welcome.sh --question --ellipsize --text="$MSG_Q_RUN_FIRECFG"; then
113 run_firecfg=true
114fi
115
116zenity --title=firejail-welcome.sh --info --ellipsize --text="$MSG_I_ROOT_REQUIRED"
117
118passwd=$(zenity --title=firejail-welcome.sh --password --cancel-label=OK)
119if [[ -n "${sed_scripts[*]}" ]]; then
120 sudo -S -p "" -- sed -i "${sed_scripts[@]}" /etc/firejail/firejail.config <<<"$passwd" || { zenity --title=firejail-welcome.sh --error; exit 1; };
121fi
122if [[ "$run_firecfg" == "true" ]]; then
123 sudo -S -p "" -- firecfg <<<"$passwd" || { zenity --title=firejail-welcome.sh --error; exit 1; };
124fi
125sudo -k
126unset passwd
127
128zenity --title=firejail-welcome.sh --info --icon-name=security-medium-symbolic --text="$MSG_I_FINISH"
diff --git a/contrib/fix_private-bin.py b/contrib/fix_private-bin.py
index 86fd3d16b..961646aa4 100755
--- a/contrib/fix_private-bin.py
+++ b/contrib/fix_private-bin.py
@@ -1,5 +1,4 @@
1#!/usr/bin/python3 1#!/usr/bin/env python3
2
3__author__ = "KOLANICH" 2__author__ = "KOLANICH"
4__copyright__ = """This is free and unencumbered software released into the public domain. 3__copyright__ = """This is free and unencumbered software released into the public domain.
5 4
@@ -24,134 +23,175 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25OTHER DEALINGS IN THE SOFTWARE. 24OTHER DEALINGS IN THE SOFTWARE.
26 25
27For more information, please refer to <http://unlicense.org/>""" 26For more information, please refer to <https://unlicense.org/>"""
28__license__ = "Unlicense" 27__license__ = "Unlicense"
29 28
30import sys, os, glob, re 29import typing
31 30import sys, os, re
32privRx=re.compile("^(?:#\s*)?private-bin") 31from collections import OrderedDict
33 32from pathlib import Path
34def fixSymlinkedBins(files, replMap): 33from shutil import which
35 """ 34
36 Used to add filenames to private-bin directives of files if the ones present are mentioned in replMap 35privRx = re.compile(r"^(#\s*)?(private-bin)(\s+)(.+)$")
37 replMap is a dict where key is the marker filename and value is the filename to add 36
38 """ 37
39 38def fixSymlinkedBins(files: typing.List[Path], replMap: typing.Dict[str, str]) -> None:
40 rxs=dict() 39 """
41 for (old,new) in replMap.items(): 40 Used to add filenames to private-bin directives of files if the ones present are mentioned in replMap
42 rxs[old]=re.compile("\\b"+old+"\\b") 41 replMap is a dict where key is the marker filename and value is the filename to add
43 rxs[new]=re.compile("\\b"+new+"\\b") 42 """
44 #print(rxs) 43
45 44 for filename in files:
46 for filename in files: 45 lines = filename.read_text(encoding="utf-8").split("\n")
47 lines=None 46
48 with open(filename,"r") as file: 47 shouldUpdate = False
49 lines=file.readlines() 48 for (i, line) in enumerate(lines):
50 49 m = privRx.match(line)
51 shouldUpdate=False 50 if m:
52 for (i,line) in enumerate(lines): 51 lineUpdated = False
53 if privRx.search(line): 52 mBins = OrderedDict((sb, sb) for sb in (b.strip() for b in m.group(4).split(",")))
54 for (old,new) in replMap.items(): 53
55 if rxs[old].search(line) and not rxs[new].search(line): 54 for (old, new) in replMap.items():
56 lines[i]=rxs[old].sub(old+","+new, line) 55 if old in mBins:
57 shouldUpdate=True 56 #print(old, "->", new)
58 print(lines[i]) 57 if new not in mBins:
59 58 mBins[old] = old + "," + new
60 if shouldUpdate: 59 lineUpdated = True
61 with open(filename,"w") as file: 60
62 file.writelines(lines) 61 if lineUpdated:
63 pass 62 comment = m.group(1)
64 63 if comment is None:
65def createSetOfBinaries(files): 64 comment = ""
66 """ 65 lines[i] = comment + m.group(2) + m.group(3) + ",".join(mBins.values())
67 Creates a set of binaries mentioned in private-bin directives of files. 66 shouldUpdate = True
68 """ 67
69 s=set() 68 if shouldUpdate:
70 for filename in files: 69 filename.write_text("\n".join(lines), encoding="utf-8")
71 lines=None 70
72 with open(filename,"r") as file: 71
73 for line in file: 72def createSetOfBinaries(files: typing.List[Path]) -> typing.Set[str]:
74 if privRx.search(line): 73 """
75 bins=line.split(",") 74 Creates a set of binaries mentioned in private-bin directives of files.
76 bins[0]=bins[0].split(" ")[-1] 75 """
77 bins = [n.strip() for n in bins] 76 s = set()
78 s=s|set(bins) 77 for filename in files:
79 return s 78 with open(filename, "r") as file:
80 79 for line in file:
81def createSymlinkTable(binDirs, binariesSet): 80 m = privRx.match(line)
82 """ 81 if m:
83 creates a dict of symlinked binaries in the system where a key is a symlink name and value is a symlinked binary. 82 bins = m.group(4).split(",")
84 binDirs are folders to look into for binaries symlinks 83 bins = [n.strip() for n in bins]
85 binariesSet is a set of binaries to be checked if they are actually a symlinks 84 s = s | set(bins)
86 """ 85 return s
87 m=dict() 86
88 toProcess=binariesSet 87def getExecutableNameFromLink(p: Path) -> str:
89 while len(toProcess)!=0: 88 return os.readlink(str(p)).split(" ")[0]
90 additional=set() 89
91 for sh in toProcess: 90
92 for bD in binDirs: 91forbiddenExecutables= ["firejail"]
93 p=bD+os.path.sep+sh 92
94 if os.path.exists(p): 93def populateForbiddenExecutables():
95 if os.path.islink(p): 94 forbiddenSymlinks = []
96 m[sh]=os.readlink(p) 95 for e in forbiddenExecutables:
97 additional.add(m[sh].split(" ")[0]) 96 r = which(e)
98 else: 97 if r is not None:
99 pass 98 yield r
100 break 99
101 toProcess=additional 100forbiddenSymlinks = set(populateForbiddenExecutables())
102 return m 101
103 102
104def doTheFixes(profilesPath, binDirs): 103def createSymlinkTable(binDirs: typing.Iterable[Path], binariesSet: typing.Set[str]) -> typing.Mapping[str, str]:
105 """ 104 """
106 Fixes private-bin in .profiles for firejail. The pipeline is as follows: 105 creates a dict of symlinked binaries in the system where a key is a symlink name and value is a symlinked binary.
107 discover files -> discover mentioned binaries -> 106 binDirs are folders to look into for binaries symlinks
108 discover the ones which are symlinks -> 107 binariesSet is a set of binaries to be checked if they are actually a symlinks
109 make a look-up table for fix -> 108 """
110 filter the ones can be fixed (we cannot fix the ones which are not in directories for binaries) -> 109 m = dict()
111 apply fix 110 toProcess = binariesSet
112 """ 111 while len(toProcess) != 0:
113 files=glob.glob(profilesPath+os.path.sep+"*.profile") 112 additional = set()
114 bins=createSetOfBinaries(files) 113 for binName in toProcess:
115 #print("The binaries used are:") 114 for binaryDir in binDirs:
116 #print(bins) 115 p = binaryDir / binName
117 stbl=createSymlinkTable(binDirs,bins) 116 if p.is_symlink():
118 print("The replacement table is:") 117 res = []
119 print(stbl) 118 nm = getExecutableNameFromLink(p)
120 stbl={a[0]:a[1] for a in stbl.items() if a[0].find(os.path.sep) < 0 and a[1].find(os.path.sep)<0} 119 if nm in forbiddenSymlinks:
121 print("Filtered replacement table is:") 120 continue
122 print(stbl) 121 m[binName] = nm
123 fixSymlinkedBins(files,stbl) 122 additional.add(nm)
123 break
124
125 toProcess = additional
126 return m
127
128
129def doTheFixes(profilesPath: Path, binDirs: typing.Iterable[Path]) -> None:
130 """
131 Fixes private-bin in .profiles for firejail. The pipeline is as follows:
132 discover files -> discover mentioned binaries ->
133 discover the ones which are symlinks ->
134 make a look-up table for fix ->
135 filter the ones can be fixed (we cannot fix the ones which are not in directories for binaries) ->
136 apply fix
137 """
138 files = list(profilesPath.glob("**/*.profile"))
139 bins = createSetOfBinaries(files)
140 #print("The binaries used are:")
141 #print(bins)
142 stbl = createSymlinkTable(binDirs, bins)
143 print("The replacement table is:")
144 print(stbl)
145 for k, v in tuple(stbl.items()):
146 if k.find(os.path.sep) < 0 and v.find(os.path.sep) < 0:
147 pass
148 else:
149 del stbl[k]
150
151 print("Filtered replacement table is:")
152 print(stbl)
153 fixSymlinkedBins(files, stbl)
154
155
156thisDir = Path(__file__).absolute().parent
157defaultProfilesPath = (thisDir.parent / "etc")
158
124 159
125def printHelp(): 160def printHelp():
126 print("python3 "+os.path.basename(__file__)+" <dir with .profile files>\nThe default dir is "+defaultProfilesPath+"\n"+doTheFixes.__doc__) 161 print("python3 " + str(thisDir) +
127 162 " <dir with .profile files>\nThe default dir is " +
128def main(): 163 str(defaultProfilesPath) + "\n" + doTheFixes.__doc__)
129 """The main function. Parses the commandline args, shows messages and calles the function actually doing the work.""" 164
130 print(repr(sys.argv)) 165
131 defaultProfilesPath="../etc" 166def main() -> None:
132 if len(sys.argv)>2 or (len(sys.argv)==2 and (sys.argv[1] == '-h' or sys.argv[1] == '--help') ): 167 """The main function. Parses the commandline args, shows messages and calls the function actually doing the work."""
133 printHelp() 168 if len(sys.argv) > 2 or (len(sys.argv) == 2 and
134 exit(1) 169 (sys.argv[1] == "-h" or sys.argv[1] == "--help")):
135 170 printHelp()
136 profilesPath=None 171 sys.exit(1)
137 if len(sys.argv)==2: 172
138 if os.path.isdir(sys.argv[1]): 173 profilesPath = None
139 profilesPath=os.path.abspath(sys.argv[1]) 174 if len(sys.argv) == 2:
140 else: 175 if os.path.isdir(sys.argv[1]):
141 if os.path.exists(sys.argv[1]): 176 profilesPath = os.path.abspath(sys.argv[1])
142 print(sys.argv[1]+" is not a dir") 177 else:
143 else: 178 if os.path.exists(sys.argv[1]):
144 print(sys.argv[1]+" does not exist") 179 print(sys.argv[1] + " is not a dir")
145 printHelp() 180 else:
146 exit(1) 181 print(sys.argv[1] + " does not exist")
147 else: 182 printHelp()
148 print("Using default profiles dir: " + defaultProfilesPath) 183 sys.exit(1)
149 profilesPath=defaultProfilesPath 184 else:
150 185 print("Using default profiles dir: ", defaultProfilesPath)
151 binDirs=["/bin","/usr/bin","/usr/sbin","/usr/local/bin","/usr/local/sbin"] 186 profilesPath = defaultProfilesPath
152 print("Binaries dirs are:") 187
153 print(binDirs) 188 binDirs = ("/bin", "/usr/bin", "/usr/bin", "/usr/sbin", "/usr/local/bin", "/usr/local/sbin")
154 doTheFixes(profilesPath, binDirs) 189 binDirs = type(binDirs)(Path(p) for p in binDirs)
190
191 print("Binaries dirs are:")
192 print(binDirs)
193 doTheFixes(profilesPath, binDirs)
194
155 195
156if __name__ == "__main__": 196if __name__ == "__main__":
157 main() 197 main()
diff --git a/contrib/fj-mkdeb.py b/contrib/fj-mkdeb.py
index 3cc13b758..b4a947535 100755
--- a/contrib/fj-mkdeb.py
+++ b/contrib/fj-mkdeb.py
@@ -1,45 +1,54 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3# This script is automate the workaround for https://github.com/netblue30/firejail/issues/772 6# This script automates the workaround for https://github.com/netblue30/firejail/issues/772
7
8import os, shlex, subprocess, sys
4 9
5import os, re, shlex, subprocess, sys
6 10
7def run(srcdir, args): 11def run(srcdir, args):
8 if srcdir: os.chdir(srcdir) 12 if srcdir: os.chdir(srcdir)
9 13
10 dry_run=False 14 if not (os.path.isfile('./mkdeb.sh.in')):
11 escaped_args=[] 15 print('Error: Not a firejail source tree? Exiting.')
12 # We need to modify the list as we go. So be sure to copy the list to be iterated! 16 return 1
13 for a in args[:]: 17
14 if a.startswith('--prefix'): 18 dry_run = False
15 # prefix should ALWAYS be /usr here. Discard user-set values 19 escaped_args = []
16 args.remove(a) 20 # We need to modify the list as we go. So be sure to copy the list to be iterated!
17 elif a == '--only-fix-mkdeb': 21 for a in args[:]:
18 # for us, not configure 22 if a.startswith('--prefix'):
19 dry_run=True 23 # prefix should ALWAYS be /usr here. Discard user-set values
20 args.remove(a) 24 args.remove(a)
21 else: 25 elif a == '--only-fix-mkdeb':
22 escaped_args.append(shlex.quote(a)) 26 # for us, not configure
27 dry_run = True
28 args.remove(a)
29 else:
30 escaped_args.append(shlex.quote(a))
23 31
24 # Fix up mkdeb.sh to include custom configure options. 32 # Run configure to generate mkdeb.sh.
25 with open('mkdeb.sh', 'rb') as f: 33 first_config = subprocess.call(['./configure', '--prefix=/usr'] + args)
26 sh=str(f.read(), 'utf_8') 34 if first_config != 0:
27 rx=re.compile(r'^\./configure\s.*$', re.M) 35 return first_config
28 with open('mkdeb.sh', 'wb') as f:
29 f.write(bytes(rx.sub('./configure --prefix=/usr '+(' '.join(escaped_args)), sh), 'utf_8'))
30 36
31 if dry_run: return 0 37 # Fix up dynamically-generated mkdeb.sh to include custom configure options.
38 with open('mkdeb.sh', 'rb') as f:
39 sh = str(f.read(), 'utf_8')
40 with open('mkdeb.sh', 'wb') as f:
41 f.write(bytes(sh.replace('./configure $CONFIG_ARGS',
42 './configure $CONFIG_ARGS ' + (' '.join(escaped_args))), 'utf_8'))
32 43
33 # now run configure && make 44 if dry_run: return 0
34 if subprocess.call(['./configure', '--prefix=/usr']+args) == 0:
35 subprocess.call(['make', 'deb'])
36 45
37 return 0 46 return subprocess.call(['make', 'deb'])
38 47
39 48
40if __name__ == '__main__': 49if __name__ == '__main__':
41 if len(sys.argv) == 2 and sys.argv[1] == '--help': 50 if len(sys.argv) == 2 and sys.argv[1] == '--help':
42 print('''Build a .deb of firejail with custom configure options 51 print('''Build a .deb of firejail with custom configure options
43 52
44usage: 53usage:
45{script} [--fj-src=SRCDIR] [--only-fix-mkdeb] [CONFIGURE_OPTIONS [...]] 54{script} [--fj-src=SRCDIR] [--only-fix-mkdeb] [CONFIGURE_OPTIONS [...]]
@@ -51,24 +60,26 @@ usage:
51 --only-fix-mkdeb: don't run configure or make after modifying mkdeb.sh 60 --only-fix-mkdeb: don't run configure or make after modifying mkdeb.sh
52 CONFIGURE_OPTIONS: arguments for configure 61 CONFIGURE_OPTIONS: arguments for configure
53'''.format(script=sys.argv[0])) 62'''.format(script=sys.argv[0]))
54 sys.exit(0) 63 sys.exit(0)
55 else: 64 else:
56 # Find the source directory 65 # Find the source directory
57 srcdir=None 66 srcdir = None
58 args=sys.argv[1:] 67 args = sys.argv[1:]
59 for a in args: 68 for a in args:
60 if a.startswith('--fj-src='): 69 if a.startswith('--fj-src='):
61 args.remove(a) 70 args.remove(a)
62 srcdir=a[9:] 71 srcdir = a[9:]
63 break 72 break
64 if not(srcdir): 73 if not (srcdir):
65 # srcdir not manually specified, try to auto-detect 74 # srcdir not manually specified, try to auto-detect
66 srcdir=os.path.dirname(os.path.abspath(sys.argv[0]+'/..')) 75 srcdir = os.path.dirname(os.path.abspath(sys.argv[0] + '/..'))
67 if not(os.path.isfile(srcdir+'/mkdeb.sh')): 76 if not (os.path.isfile(srcdir + '/mkdeb.sh.in')):
68 # Script is probably installed. Check the cwd. 77 # Script is probably installed. Check the cwd.
69 if os.path.isfile('./mkdeb.sh'): 78 if os.path.isfile('./mkdeb.sh.in'):
70 srcdir=None 79 srcdir = None
71 else: 80 else:
72 print('Error: Could not find the firejail source tree. Exiting.') 81 print(
73 sys.exit(1) 82 'Error: Could not find the firejail source tree. Exiting.'
74 sys.exit(run(srcdir, args)) 83 )
84 sys.exit(1)
85 sys.exit(run(srcdir, args))
diff --git a/contrib/fjclip.py b/contrib/fjclip.py
index b45959841..3e99d71e9 100755
--- a/contrib/fjclip.py
+++ b/contrib/fjclip.py
@@ -1,6 +1,8 @@
1#!/usr/bin/env python 1#!/usr/bin/env python3
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3import re
4import sys 6import sys
5import subprocess 7import subprocess
6import fjdisplay 8import fjdisplay
@@ -23,7 +25,7 @@ if sys.argv[1] == '-':
23 clipin_raw = sys.stdin.read() 25 clipin_raw = sys.stdin.read()
24else: 26else:
25 display = fjdisplay.getdisplay(sys.argv[1]) 27 display = fjdisplay.getdisplay(sys.argv[1])
26 clipin_raw = subprocess.check_output(['xsel','-b','--display',display]) 28 clipin_raw = subprocess.check_output(['xsel', '-b', '--display', display])
27 29
28clipin = clipin_raw.strip() 30clipin = clipin_raw.strip()
29 31
@@ -31,5 +33,6 @@ if sys.argv[2] == '-':
31 print(clipin) 33 print(clipin)
32else: 34else:
33 display = fjdisplay.getdisplay(sys.argv[2]) 35 display = fjdisplay.getdisplay(sys.argv[2])
34 clipout = subprocess.Popen(['xsel','-b','-i','--display',display],stdin=subprocess.PIPE) 36 clipout = subprocess.Popen(['xsel', '-b', '-i', '--display', display],
37 stdin=subprocess.PIPE)
35 clipout.communicate(clipin) 38 clipout.communicate(clipin)
diff --git a/contrib/fjdisplay.py b/contrib/fjdisplay.py
index 3f409545f..294bde997 100755
--- a/contrib/fjdisplay.py
+++ b/contrib/fjdisplay.py
@@ -1,4 +1,7 @@
1#!/usr/bin/env python 1#!/usr/bin/env python3
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3import re 6import re
4import sys 7import sys
@@ -8,23 +11,25 @@ usage = """fjdisplay.py name-of-firejail
8returns the display in the form of ':NNN' 11returns the display in the form of ':NNN'
9""" 12"""
10 13
14
11def getfirejails(): 15def getfirejails():
12 output = subprocess.check_output(['firemon','--x11']) 16 output = subprocess.check_output(['firemon', '--x11'])
13 firejails = {} 17 firejails = {}
14 name = '' 18 name = ''
15 for line in output.split('\n'): 19 for line in output.split('\n'):
16 namematch = re.search('--name=(\w+\S*)',line) 20 namematch = re.search('--name=(\w+\S*)', line)
17 if namematch: 21 if namematch:
18 name = namematch.group(1) 22 name = namematch.group(1)
19 displaymatch = re.search('DISPLAY (:\d+)',line) 23 displaymatch = re.search('DISPLAY (:\d+)', line)
20 if displaymatch: 24 if displaymatch:
21 firejails[name] = displaymatch.group(1) 25 firejails[name] = displaymatch.group(1)
22 return firejails 26 return firejails
23 27
28
24def getdisplay(name): 29def getdisplay(name):
25 firejails = getfirejails() 30 firejails = getfirejails()
26 fjlist = '\n'.join(firejails.keys()) 31 fjlist = '\n'.join(firejails.keys())
27 namere = re.compile('^'+name+'.*', re.MULTILINE) 32 namere = re.compile('^' + name + '.*', re.MULTILINE)
28 matchingjails = namere.findall(fjlist) 33 matchingjails = namere.findall(fjlist)
29 if len(matchingjails) == 1: 34 if len(matchingjails) == 1:
30 return firejails[matchingjails[0]] 35 return firejails[matchingjails[0]]
@@ -33,6 +38,7 @@ def getdisplay(name):
33 else: 38 else:
34 raise NameError("ambiguous firejail name") 39 raise NameError("ambiguous firejail name")
35 40
41
36if __name__ == '__main__': 42if __name__ == '__main__':
37 if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) > 2: 43 if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) > 2:
38 print(usage) 44 print(usage)
@@ -40,4 +46,4 @@ if __name__ == '__main__':
40 if len(sys.argv) == 1: 46 if len(sys.argv) == 1:
41 print(getfirejails()) 47 print(getfirejails())
42 if len(sys.argv) == 2: 48 if len(sys.argv) == 2:
43 print (getdisplay(sys.argv[1])) 49 print(getdisplay(sys.argv[1]))
diff --git a/contrib/fjresize.py b/contrib/fjresize.py
index 3997cf280..d656f5c91 100755
--- a/contrib/fjresize.py
+++ b/contrib/fjresize.py
@@ -1,4 +1,7 @@
1#!/usr/bin/env python 1#!/usr/bin/env python3
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3import sys 6import sys
4import fjdisplay 7import fjdisplay
@@ -6,20 +9,26 @@ import subprocess
6 9
7usage = """usage: fjresize.py firejail-name displaysize 10usage = """usage: fjresize.py firejail-name displaysize
8resize firejail xephyr windows. 11resize firejail xephyr windows.
9fjdisplay.py with no other arguments will list running named firejails with displays. 12fjdisplay.py with no other arguments will list running named firejails with
13displays.
10fjresize.py with only a firejail name will list valid resolutions. 14fjresize.py with only a firejail name will list valid resolutions.
11names can be shortend as long its unambiguous. 15names can be shortened as long as it's unambiguous.
12note: you may need to move the xephyr window for the resize to take effect 16note: you may need to move the xephyr window for the resize to take effect
13example: 17example:
14 fjresize.py browser 1280x800 18 fjresize.py browser 1280x800
15""" 19"""
16 20
17
18if len(sys.argv) == 2: 21if len(sys.argv) == 2:
19 out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1])]) 22 out = subprocess.check_output(
23 ['xrandr', '--display',
24 fjdisplay.getdisplay(sys.argv[1])])
20 print(out) 25 print(out)
21elif len(sys.argv) == 3: 26elif len(sys.argv) == 3:
22 out = subprocess.check_output(['xrandr','--display',fjdisplay.getdisplay(sys.argv[1]),'--output','default','--mode',sys.argv[2]]) 27 out = subprocess.check_output([
28 'xrandr', '--display',
29 fjdisplay.getdisplay(sys.argv[1]), '--output', 'default', '--mode',
30 sys.argv[2]
31 ])
23 print(out) 32 print(out)
24else: 33else:
25 print(usage) 34 print(usage)
diff --git a/contrib/gdb-firejail.sh b/contrib/gdb-firejail.sh
new file mode 100755
index 000000000..941fc45ef
--- /dev/null
+++ b/contrib/gdb-firejail.sh
@@ -0,0 +1,24 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5set -x
6
7# gdb setuid helper script.
8# This script forks a background process as the current user which will
9# immediately send itself a `STOP` signal. Then gdb running as root will
10# attach to that process, which will send it the `CONT` signal to continue
11# execution. Then the backgrounded process will exec the program with the
12# given arguments. This will allow the root gdb to trace the unprivileged
13# setuid firejail process from the absolute beginning.
14
15if [ -z "${1##*/firejail}" ]; then
16 FIREJAIL=$1
17else
18 # First argument is not named firejail, then add default unless environment
19 # variable already set.
20 set -- ${FIREJAIL:=$(which firejail)} "$@"
21fi
22
23bash -c "kill -STOP \$\$; exec \"\$0\" \"\$@\"" "$@" &
24sudo gdb -e "$FIREJAIL" -p "$!"
diff --git a/contrib/jail_prober.py b/contrib/jail_prober.py
new file mode 100755
index 000000000..f89f97ac4
--- /dev/null
+++ b/contrib/jail_prober.py
@@ -0,0 +1,206 @@
1#!/usr/bin/env python3
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5"""
6Figure out which profile options may be causing a particular program to break
7when run in firejail.
8
9Instead of having to comment out each line in a profile by hand, and then
10enable each line individually until the bad line or lines are found, this
11largely automates the process. Users only have to provide the path to the
12profile, program name, and answer 'y' for yes or 'n' for no when prompted.
13
14After completion, you'll be provided with some information to copy and then
15paste into a GitHub issue in the Firejail project repository:
16https://github.com/netblue30/firejail/issues
17
18Paths to the profile should be absolute. If the program is in your path, then
19you only have to type the profile name. Else, you'll need to provide the
20absolute path to the profile.
21
22Examples:
23python jail_prober.py /etc/firejail/spotify.profile spotify
24python jail_prober.py /usr/local/etc/firejail/firefox.profile /usr/bin/firefox
25"""
26
27import sys
28import os
29import subprocess
30
31
32def check_params(profile_path):
33 """
34 Ensure the path to the profile is valid and that an actual profile has been
35 passed (as opposed to a config or .local file).
36
37 Args:
38 profile_path: The absolute path to the problematic profile
39
40 Raises:
41 FileNotFoundError: If the provided path isn't real
42
43 ValueError: If the provided path is real but doesn't point to
44 a Firejail profile
45 """
46 if not os.path.isfile(profile_path):
47 raise FileNotFoundError('The path %s is not a valid system path.' %
48 profile_path)
49 if not profile_path.endswith('.profile'):
50 raise ValueError('%s is not a valid Firejail profile.' % profile_path)
51
52
53def get_args(profile_path):
54 """
55 Read the profile, stripping out comments and newlines
56
57 Args:
58 profile_path: The absolute path to the problematic profile.
59
60 Returns:
61 A list containing all active profile arguments
62 """
63 with open(profile_path, 'r') as f:
64 profile = f.readlines()
65 profile = [
66 arg.strip() for arg in profile
67 if not arg.startswith('#') and arg.strip() != ''
68 ]
69
70 return profile
71
72
73def absolute_include(word):
74 home = os.environ['HOME']
75 path = home + '/.config/firejail/'
76
77 option, filename = word.split('=')
78 absolute_filename = path + filename
79
80 if not os.path.isfile(absolute_filename):
81 absolute_filename = '${CFG}/' + filename
82
83 return option + '=' + absolute_filename
84
85
86def arg_converter(arg_list, style):
87 """
88 Convert between firejail command-line arguments (--example=something) and
89 profile arguments (example something)
90
91 Args:
92 arg_list: A list of firejail arguments
93
94 style: String, one of {'to_profile', 'to_commandline'}. Whether to
95 convert arguments to command-line form or profile form
96 """
97 if style == 'to_profile':
98 old_sep = '='
99 new_sep = ' '
100 prefix = ''
101 elif style == 'to_commandline':
102 old_sep = ' '
103 new_sep = '='
104 prefix = '--'
105 new_args = [prefix + word.replace(old_sep, new_sep) for word in arg_list]
106 # Additional strip of '--' if converting to profile form
107 if style == 'to_profile':
108 new_args = [word[2:] for word in new_args]
109
110 elif style == 'to_commandline':
111 new_args = [
112 absolute_include(word) if word.startswith('--include')
113 else word
114 for word in new_args
115 ]
116
117 return new_args
118
119
120def run_firejail(program, all_args):
121 """
122 Attempt to run the program in firejail, incrementally adding to the number
123 of firejail arguments. Initial run has no additional params besides
124 noprofile.
125
126 Args:
127 program: String, the program name. If it doesn't exist in $PATH then
128 the full path to the program should be provided
129
130 all_args: List, all Firejail arguments to try, in command-line format
131 (i.e. prefixed by '--')
132
133 Returns:
134 good_args: List, all Firejail arguments that the user has reported to
135 not adversely affect the program
136
137 bad_args: List, all Firejail arguments that the user has reported to
138 break the program
139 """
140 good_args = ['firejail', '--noprofile', program]
141 bad_args = []
142 all_args.insert(0, "")
143 print('Attempting to run %s in Firejail' % program)
144 for arg in all_args:
145 if arg:
146 print('Running with', arg)
147 else:
148 print('Running without profile')
149 #We are adding the argument in a copy of the actual list to avoid modify it now.
150 myargs = good_args.copy()
151 if arg:
152 myargs.insert(-1, arg)
153 subprocess.call(myargs)
154 ans = input('Did %s run correctly? [y]/n ' % program)
155 if ans in ['n', 'N']:
156 bad_args.append(arg)
157 elif arg:
158 good_args.insert(-1, arg)
159 print('\n')
160 # Don't include 'firejail', '--noprofile', or program name in arguments
161 good_args = good_args[2:-1]
162
163 return good_args, bad_args
164
165
166def main():
167 try:
168 profile_path = sys.argv[1]
169 program = sys.argv[2]
170 except IndexError:
171 print('USAGE: jail_prober.py <PROFILE-PATH> <PROGRAM>')
172 sys.exit()
173 # Quick error check and extract arguments
174 check_params(profile_path)
175 profile = get_args(profile_path)
176 all_args = arg_converter(profile, 'to_commandline')
177 # Find out which profile options break the program when running in firejail
178 good_args, bad_args = run_firejail(program, all_args)
179
180 good_args = arg_converter(good_args, 'to_profile')
181 bad_args = arg_converter(bad_args, 'to_profile')
182
183 print('\n###########################')
184 print('Debugging completed.')
185 print(
186 'Please copy the following and report it to the Firejail development',
187 'team on GitHub at %s \n\n' %
188 'https://github.com/netblue30/firejail/issues')
189
190 subprocess.call(['firejail', '--version'])
191
192 print('These profile options break the program.')
193 print('```')
194 for item in bad_args:
195 print(item)
196 print('```\n\n\n')
197
198 print('This is a minimal working profile:')
199 print('```')
200 for item in good_args:
201 print(item)
202 print('```')
203
204
205if __name__ == '__main__':
206 main()
diff --git a/contrib/sort.py b/contrib/sort.py
new file mode 100755
index 000000000..4af9c674c
--- /dev/null
+++ b/contrib/sort.py
@@ -0,0 +1,108 @@
1#!/usr/bin/env python3
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5"""
6Sort the items of multi-item options in profiles, the following options are supported:
7 private-bin, private-etc, private-lib, caps.drop, caps.keep, seccomp.drop, seccomp.drop, protocol
8
9Usage:
10 $ ./sort.py /path/to/profile [ /path/to/profile2 /path/to/profile3 ... ]
11Keep in mind that this will overwrite your profile(s).
12
13Examples:
14 $ ./sort.py MyAwesomeProfile.profile
15 $ ./sort.py new_profile.profile second_new_profile.profile
16 $ ./sort.py ~/.config/firejail/*.{profile,inc,local}
17 $ sudo ./sort.py /etc/firejail/*.{profile,inc,local}
18
19Exit-Codes:
20 0: No Error; No Profile Fixed.
21 1: Error, one or more profiles were not processed correctly.
22 101: No Error; One or more profile were fixed.
23"""
24
25# Requirements:
26# python >= 3.6
27from sys import argv, exit as sys_exit
28
29
30def sort_alphabetical(raw_items):
31 items = raw_items.split(",")
32 items.sort(key=lambda s: s.casefold())
33 return ",".join(items)
34
35
36def sort_protocol(protocols):
37 """sort the given protocols into this scheme: unix,inet,inet6,netlink,packet,bluetooth"""
38
39 # shortcut for common protocol lines
40 if protocols in ("unix", "unix,inet,inet6"):
41 return protocols
42
43 fixed_protocols = ""
44 for protocol in ("unix", "inet", "inet6", "netlink", "packet", "bluetooth"):
45 for prefix in ("", "-", "+", "="):
46 if f",{prefix}{protocol}," in f",{protocols},":
47 fixed_protocols += f"{prefix}{protocol},"
48 return fixed_protocols[:-1]
49
50
51def fix_profile(filename):
52 with open(filename, "r+") as profile:
53 lines = profile.read().split("\n")
54 was_fixed = False
55 fixed_profile = []
56 for lineno, line in enumerate(lines):
57 if line[:12] in ("private-bin ", "private-etc ", "private-lib "):
58 fixed_line = f"{line[:12]}{sort_alphabetical(line[12:])}"
59 elif line[:13] in ("seccomp.drop ", "seccomp.keep "):
60 fixed_line = f"{line[:13]}{sort_alphabetical(line[13:])}"
61 elif line[:10] in ("caps.drop ", "caps.keep "):
62 fixed_line = f"{line[:10]}{sort_alphabetical(line[10:])}"
63 elif line[:8] == "protocol":
64 fixed_line = f"protocol {sort_protocol(line[9:])}"
65 elif line[:8] == "seccomp ":
66 fixed_line = f"{line[:8]}{sort_alphabetical(line[8:])}"
67 else:
68 fixed_line = line
69 if fixed_line != line:
70 was_fixed = True
71 print(
72 f"{filename}:{lineno + 1}:-{line}\n"
73 f"{filename}:{lineno + 1}:+{fixed_line}"
74 )
75 fixed_profile.append(fixed_line)
76 if was_fixed:
77 profile.seek(0)
78 profile.truncate()
79 profile.write("\n".join(fixed_profile))
80 profile.flush()
81 print(f"[ Fixed ] {filename}")
82 return 101
83 return 0
84
85
86def main(args):
87 exit_code = 0
88 print(f"sort.py: checking {len(args)} {'profiles' if len(args) != 1 else 'profile'}...")
89 for filename in args:
90 try:
91 if exit_code not in (1, 101):
92 exit_code = fix_profile(filename)
93 else:
94 fix_profile(filename)
95 except FileNotFoundError:
96 print(f"[ Error ] Can't find `{filename}'")
97 exit_code = 1
98 except PermissionError:
99 print(f"[ Error ] Can't read/write `{filename}'")
100 exit_code = 1
101 except Exception as err:
102 print(f"[ Error ] An error occurred while processing `{filename}': {err}")
103 exit_code = 1
104 return exit_code
105
106
107if __name__ == "__main__":
108 sys_exit(main(argv[1:]))
diff --git a/contrib/syscalls.sh b/contrib/syscalls.sh
new file mode 100755
index 000000000..728ff5a78
--- /dev/null
+++ b/contrib/syscalls.sh
@@ -0,0 +1,29 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6STRACE_OUTPUT_FILE="$(pwd)/strace_output.txt"
7SYSCALLS_OUTPUT_FILE="$(pwd)/syscalls.txt"
8
9if [ $# -eq 0 ]
10then
11 echo
12 echo " *** No program specified!!! ***"
13 echo
14 echo -e "Make this file executable and execute it as:\\n"
15 echo -e "\\e[96m syscalls.sh /full/path/to/program\\n"
16 echo -e "\\e[39mif you saved this script in a directory in your PATH (e.g., in ${HOME}/bin), otherwise as:\\n"
17 echo -e "\\e[96m ./syscalls.sh /full/path/to/program\\n"
18 echo -e "\\e[39mUse the full path to the respective program to avoid executing it sandboxed with Firejail\\n(if a Firejail profile for it already exits and 'sudo firecfg' was executed earlier)\\nin order to determine the necessary system calls."
19 echo
20 exit 0
21else
22 strace -cfo "$STRACE_OUTPUT_FILE" "$@" && awk '{print $NF}' "$STRACE_OUTPUT_FILE" | sed '/syscall\|-\|total/d' | sort -u | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/' > "$SYSCALLS_OUTPUT_FILE"
23 echo
24 echo -e "\e[39mThese are the sorted syscalls:\n\e[93m"
25 cat "$SYSCALLS_OUTPUT_FILE"
26 echo
27 echo -e "\e[39mThe sorted syscalls were saved to:\n\e[96m$SYSCALLS_OUTPUT_FILE\n\e[39m"
28 exit 0
29fi
diff --git a/contrib/update_deb.sh b/contrib/update_deb.sh
index 9d1567c0e..4c715aaf7 100755
--- a/contrib/update_deb.sh
+++ b/contrib/update_deb.sh
@@ -1,12 +1,24 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
2# Purpose: Fetch, compile, and install firejail from GitHub source. For 6# Purpose: Fetch, compile, and install firejail from GitHub source. For
3# Debian-based distros only (Ubuntu, Mint, etc). 7# Debian-based distros only (Ubuntu, Mint, etc).
4set -e 8set -e
5git clone --depth=1 https://www.github.com/netblue30/firejail.git 9
10git clone --depth=1 https://github.com/netblue30/firejail.git
6cd firejail 11cd firejail
7./configure --prefix=/usr 12./configure --enable-apparmor --prefix=/usr
13
14# Fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916920
15sed -i \
16 -e "s/# cgroup .*/cgroup no/" \
17 -e "s/# restricted-network .*/restricted-network yes/" \
18 etc/firejail.config
19
8make deb 20make deb
9sudo dpkg -i firejail*.deb 21sudo dpkg -i firejail*.deb
10echo "Firejail was updated!" 22echo "Firejail updated."
11cd .. 23cd ..
12rm -rf firejail 24rm -rf firejail
diff --git a/contrib/vim/ftdetect/firejail.vim b/contrib/vim/ftdetect/firejail.vim
new file mode 100644
index 000000000..2edc741da
--- /dev/null
+++ b/contrib/vim/ftdetect/firejail.vim
@@ -0,0 +1,6 @@
1autocmd BufNewFile,BufRead /etc/firejail/*.profile setfiletype firejail
2autocmd BufNewFile,BufRead /etc/firejail/*.local setfiletype firejail
3autocmd BufNewFile,BufRead /etc/firejail/*.inc setfiletype firejail
4autocmd BufNewFile,BufRead ~/.config/firejail/*.profile setfiletype firejail
5autocmd BufNewFile,BufRead ~/.config/firejail/*.local setfiletype firejail
6autocmd BufNewFile,BufRead ~/.config/firejail/*.inc setfiletype firejail
diff --git a/contrib/vim/syntax/firejail.vim b/contrib/vim/syntax/firejail.vim
new file mode 100644
index 000000000..d07690ee2
--- /dev/null
+++ b/contrib/vim/syntax/firejail.vim
@@ -0,0 +1,100 @@
1" Vim syntax file
2" Language: Firejail security sandbox profile
3" URL: https://github.com/netblue30/firejail
4
5if exists("b:current_syntax")
6 finish
7endif
8
9
10syn iskeyword @,48-57,_,.,-
11
12
13syn keyword fjTodo TODO FIXME XXX NOTE contained
14syn match fjComment "#.*$" contains=fjTodo
15
16"TODO: highlight "dangerous" capabilities differently, as is done in apparmor.vim?
17syn keyword fjCapability audit_control audit_read audit_write block_suspend chown dac_override dac_read_search fowner fsetid ipc_lock ipc_owner kill lease linux_immutable mac_admin mac_override mknod net_admin net_bind_service net_broadcast net_raw setgid setfcap setpcap setuid sys_admin sys_boot sys_chroot sys_module sys_nice sys_pacct sys_ptrace sys_rawio sys_resource sys_time sys_tty_config syslog wake_alarm nextgroup=fjCapabilityList contained
18syn match fjCapabilityList /,/ nextgroup=fjCapability contained
19
20syn keyword fjProtocol unix inet inet6 netlink packet nextgroup=fjProtocolList contained
21syn match fjProtocolList /,/ nextgroup=fjProtocol contained
22
23" Syscalls grabbed from: src/include/syscall*.h
24" Generate list with: sed -ne 's/{\s\+"\([^"]\+\)",.*},/\1/p' src/include/syscall*.h | sort -u | tr $'\n' ' '
25syn keyword fjSyscall _llseek _newselect _sysctl accept accept4 access acct add_key adjtimex afs_syscall alarm arch_prctl arm_fadvise64_64 arm_sync_file_range bdflush bind bpf break brk capget capset chdir chmod chown chown32 chroot clock_adjtime clock_adjtime64 clock_getres clock_getres_time64 clock_gettime clock_gettime64 clock_nanosleep clock_nanosleep_time64 clock_settime clock_settime64 clone clone3 close connect copy_file_range creat create_module delete_module dup dup2 dup3 epoll_create epoll_create1 epoll_ctl epoll_ctl_old epoll_pwait epoll_wait epoll_wait_old eventfd eventfd2 execve execveat exit exit_group faccessat faccessat2 fadvise64 fadvise64_64 fallocate fanotify_init fanotify_mark fchdir fchmod fchmodat fchown fchown32 fchownat fcntl fcntl64 fdatasync fgetxattr finit_module flistxattr flock fork fremovexattr fsconfig fsetxattr fsmount fsopen fspick fstat fstat64 fstatat64 fstatfs fstatfs64 fsync ftime ftruncate ftruncate64 futex futex_time64 futimesat getcpu getcwd getdents getdents64 getegid getegid32 geteuid geteuid32 getgid getgid32 getgroups getgroups32 getitimer get_kernel_syms get_mempolicy getpeername getpgid getpgrp getpid getpmsg getppid getpriority getrandom getresgid getresgid32 getresuid getresuid32 getrlimit get_robust_list getrusage getsid getsockname getsockopt get_thread_area gettid gettimeofday getuid getuid32 getxattr gtty idle init_module inotify_add_watch inotify_init inotify_init1 inotify_rm_watch io_cancel ioctl io_destroy io_getevents ioperm io_pgetevents io_pgetevents_time64 iopl ioprio_get ioprio_set io_setup io_submit io_uring_enter io_uring_register io_uring_setup ipc kcmp kexec_file_load kexec_load keyctl kill lchown lchown32 lgetxattr link linkat listen listxattr llistxattr lock lookup_dcookie lremovexattr lseek lsetxattr lstat lstat64 madvise mbind membarrier memfd_create migrate_pages mincore mkdir mkdirat mknod mknodat mlock mlock2 mlockall mmap mmap2 modify_ldt mount move_mount move_pages mprotect mpx mq_getsetattr mq_notify mq_open mq_timedreceive mq_timedreceive_time64 mq_timedsend mq_timedsend_time64 mq_unlink mremap msgctl msgget msgrcv msgsnd msync munlock munlockall munmap name_to_handle_at nanosleep newfstatat nfsservctl nice oldfstat oldlstat oldolduname oldstat olduname open openat open_by_handle_at open_tree pause pciconfig_iobase pciconfig_read pciconfig_write perf_event_open personality pidfd_open pidfd_send_signal pipe pipe2 pivot_root pkey_alloc pkey_free pkey_mprotect poll ppoll ppoll_time64 prctl pread64 preadv preadv2 prlimit64 process_vm_readv process_vm_writev prof profil pselect6 pselect6_time64 ptrace putpmsg pwrite64 pwritev pwritev2 query_module quotactl read readahead readdir readlink readlinkat readv reboot recv recvfrom recvmmsg recvmmsg_time64 recvmsg remap_file_pages removexattr rename renameat renameat2 request_key restart_syscall rmdir rseq rt_sigaction rt_sigpending rt_sigprocmask rt_sigqueueinfo rt_sigreturn rt_sigsuspend rt_sigtimedwait rt_sigtimedwait_time64 rt_tgsigqueueinfo sched_getaffinity sched_getattr sched_getparam sched_get_priority_max sched_get_priority_min sched_getscheduler sched_rr_get_interval sched_rr_get_interval_time64 sched_setaffinity sched_setattr sched_setparam sched_setscheduler sched_yield seccomp security select semctl semget semop semtimedop semtimedop_time64 send sendfile sendfile64 sendmmsg sendmsg sendto setdomainname setfsgid setfsgid32 setfsuid setfsuid32 setgid setgid32 setgroups setgroups32 sethostname setitimer set_mempolicy setns setpgid setpriority setregid setregid32 setresgid setresgid32 setresuid setresuid32 setreuid setreuid32 setrlimit set_robust_list setsid setsockopt set_thread_area set_tid_address settimeofday setuid setuid32 setxattr sgetmask shmat shmctl shmdt shmget shutdown sigaction sigaltstack signal signalfd signalfd4 sigpending sigprocmask sigreturn sigsuspend socket socketcall socketpair splice ssetmask stat stat64 statfs statfs64 statx stime stty swapoff swapon symlink symlinkat sync sync_file_range sync_file_range2 syncfs syscall sysfs sysinfo syslog tee tgkill time timer_create timer_delete timerfd_create timerfd_gettime timerfd_gettime64 timerfd_settime timerfd_settime64 timer_getoverrun timer_gettime timer_gettime64 timer_settime timer_settime64 times tkill truncate truncate64 tuxcall ugetrlimit ulimit umask umount umount2 uname unlink unlinkat unshare uselib userfaultfd ustat utime utimensat utimensat_time64 utimes vfork vhangup vm86 vm86old vmsplice vserver wait4 waitid waitpid write writev nextgroup=fjSyscallErrno contained
26" Syscall groups grabbed from: src/fseccomp/syscall.c
27" Generate list with: rg -o '"@([^",]+)' -r '$1' src/lib/syscall.c | sort -u | tr $'\n' '|'
28syn match fjSyscall /\v\@(aio|basic-io|chown|clock|cpu-emulation|debug|default|default-keep|default-nodebuggers|file-system|io-event|ipc|keyring|memlock|module|mount|network-io|obsolete|privileged|process|raw-io|reboot|resources|setuid|signal|swap|sync|system-service|timer)>/ nextgroup=fjSyscallErrno contained
29syn match fjSyscall /\$[0-9]\+/ nextgroup=fjSyscallErrno contained
30" Errnos grabbed from: src/fseccomp/errno.c
31" Generate list with: rg -o '"(E[^"]+)' -r '$1' src/lib/errno.c | sort -u | tr $'\n' '|'
32syn match fjSyscallErrno /\v(:(E2BIG|EACCES|EADDRINUSE|EADDRNOTAVAIL|EADV|EAFNOSUPPORT|EAGAIN|EALREADY|EBADE|EBADF|EBADFD|EBADMSG|EBADR|EBADRQC|EBADSLT|EBFONT|EBUSY|ECANCELED|ECHILD|ECHRNG|ECOMM|ECONNABORTED|ECONNREFUSED|ECONNRESET|EDEADLK|EDEADLOCK|EDESTADDRREQ|EDOM|EDOTDOT|EDQUOT|EEXIST|EFAULT|EFBIG|EHOSTDOWN|EHOSTUNREACH|EHWPOISON|EIDRM|EILSEQ|EINPROGRESS|EINTR|EINVAL|EIO|EISCONN|EISDIR|EISNAM|EKEYEXPIRED|EKEYREJECTED|EKEYREVOKED|EL2HLT|EL2NSYNC|EL3HLT|EL3RST|ELIBACC|ELIBBAD|ELIBEXEC|ELIBMAX|ELIBSCN|ELNRNG|ELOOP|EMEDIUMTYPE|EMFILE|EMLINK|EMSGSIZE|EMULTIHOP|ENAMETOOLONG|ENAVAIL|ENETDOWN|ENETRESET|ENETUNREACH|ENFILE|ENOANO|ENOATTR|ENOBUFS|ENOCSI|ENODATA|ENODEV|ENOENT|ENOEXEC|ENOKEY|ENOLCK|ENOLINK|ENOMEDIUM|ENOMEM|ENOMSG|ENONET|ENOPKG|ENOPROTOOPT|ENOSPC|ENOSR|ENOSTR|ENOSYS|ENOTBLK|ENOTCONN|ENOTDIR|ENOTEMPTY|ENOTNAM|ENOTRECOVERABLE|ENOTSOCK|ENOTSUP|ENOTTY|ENOTUNIQ|ENXIO|EOPNOTSUPP|EOVERFLOW|EOWNERDEAD|EPERM|EPFNOSUPPORT|EPIPE|EPROTO|EPROTONOSUPPORT|EPROTOTYPE|ERANGE|EREMCHG|EREMOTE|EREMOTEIO|ERESTART|ERFKILL|EROFS|ESHUTDOWN|ESOCKTNOSUPPORT|ESPIPE|ESRCH|ESRMNT|ESTALE|ESTRPIPE|ETIME|ETIMEDOUT|ETOOMANYREFS|ETXTBSY|EUCLEAN|EUNATCH|EUSERS|EWOULDBLOCK|EXDEV|EXFULL)>)?/ nextgroup=fjSyscallList contained
33syn match fjSyscallList /,/ nextgroup=fjSyscall contained
34
35syn keyword fjX11Sandbox none xephyr xorg xpra xvfb contained
36syn keyword fjSeccompAction kill log ERRNO contained
37
38syn match fjEnvVar "[A-Za-z0-9_]\+=" contained
39syn match fjRmenvVar "[A-Za-z0-9_]\+" contained
40
41syn keyword fjAll all contained
42syn keyword fjNone none contained
43syn keyword fjLo lo contained
44syn keyword fjFilter filter contained
45
46" Variable names grabbed from: src/firejail/macros.c
47" Generate list with: rg -o '\$\{([^}]+)\}' -r '$1' src/firejail/macros.c | sort -u | tr $'\n' '|'
48syn match fjVar /\v\$\{(CFG|DESKTOP|DOCUMENTS|DOWNLOADS|HOME|MUSIC|PATH|PICTURES|RUNUSER|VIDEOS)}/
49
50" Commands grabbed from: src/firejail/profile.c
51" Generate list with: { rg -o 'strn?cmp\(ptr, "([^"]+) "' -r '$1' src/firejail/profile.c; echo private-lib; } | grep -vEx '(include|ignore|caps\.drop|caps\.keep|protocol|seccomp|seccomp\.drop|seccomp\.keep|env|rmenv|net|ip)' | sort -u | tr $'\n' '|' # private-lib is special-cased in the code and doesn't match the regex; grep-ed patterns are handled later with 'syn match nextgroup=' directives (except for include which is special-cased as a fjCommandNoCond keyword)
52syn match fjCommand /\v(bind|blacklist|blacklist-nolog|cgroup|cpu|defaultgw|dns|hostname|hosts-file|ip6|iprange|join-or-start|mac|mkdir|mkfile|mtu|name|netfilter|netfilter6|netmask|nice|noblacklist|noexec|nowhitelist|overlay-named|private|private-bin|private-cwd|private-etc|private-home|private-lib|private-opt|private-srv|read-only|read-write|rlimit-as|rlimit-cpu|rlimit-fsize|rlimit-nofile|rlimit-nproc|rlimit-sigpending|timeout|tmpfs|veth-name|whitelist|xephyr-screen) / skipwhite contained
53" Generate list with: rg -o 'strn?cmp\(ptr, "([^ "]*[^ ])"' -r '$1' src/firejail/profile.c | grep -vEx '(include|rlimit|quiet)' | sed -e 's/\./\\./' | sort -u | tr $'\n' '|' # include/rlimit are false positives, quiet is special-cased below
54syn match fjCommand /\v(allow-debuggers|allusers|apparmor|caps|disable-mnt|ipc-namespace|keep-config-pulse|keep-dev-shm|keep-var-tmp|machine-id|memory-deny-write-execute|netfilter|no3d|noautopulse|nodbus|nodvd|nogroups|noinput|nonewprivs|noroot|nosound|notv|nou2f|novideo|overlay|overlay-tmpfs|private|private-cache|private-cwd|private-dev|private-lib|private-tmp|seccomp|seccomp\.32|seccomp\.block-secondary|tracelog|writable-etc|writable-run-user|writable-var|writable-var-log|x11)$/ contained
55syn match fjCommand /ignore / nextgroup=fjCommand,fjCommandNoCond skipwhite contained
56syn match fjCommand /caps\.drop / nextgroup=fjCapability,fjAll skipwhite contained
57syn match fjCommand /caps\.keep / nextgroup=fjCapability skipwhite contained
58syn match fjCommand /protocol / nextgroup=fjProtocol skipwhite contained
59syn match fjCommand /\vseccomp(\.32)?(\.drop|\.keep)? / nextgroup=fjSyscall skipwhite contained
60syn match fjCommand /x11 / nextgroup=fjX11Sandbox skipwhite contained
61syn match fjCommand /env / nextgroup=fjEnvVar skipwhite contained
62syn match fjCommand /rmenv / nextgroup=fjRmenvVar skipwhite contained
63syn match fjCommand /shell / nextgroup=fjNone skipwhite contained
64syn match fjCommand /net / nextgroup=fjNone,fjLo skipwhite contained
65syn match fjCommand /ip / nextgroup=fjNone skipwhite contained
66syn match fjCommand /seccomp-error-action / nextgroup=fjSeccompAction skipwhite contained
67syn match fjCommand /\vdbus-(user|system) / nextgroup=fjFilter,fjNone skipwhite contained
68syn match fjCommand /\vdbus-(user|system)\.(broadcast|call|own|see|talk) / skipwhite contained
69" Commands that can't be inside a ?CONDITIONAL: statement
70syn match fjCommandNoCond /include / skipwhite contained
71syn match fjCommandNoCond /quiet$/ contained
72
73" Conditionals grabbed from: src/firejail/profile.c
74" Generate list with: awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$/ {process=1;} /\t*\{"[^"]+".*/ { if (process) {print gensub(/^\t*\{"([^"]+)".*$/, "\\1", 1);} } /^\t\{ NULL, NULL \}$/ {process=0;}' src/firejail/profile.c | sort -u | tr $'\n' '|'
75syn match fjConditional /\v\?(BROWSER_ALLOW_DRM|BROWSER_DISABLE_U2F|HAS_APPIMAGE|HAS_NET|HAS_NODBUS|HAS_NOSOUND|HAS_X11) ?:/ nextgroup=fjCommand skipwhite contained
76
77" A line is either a command, a conditional or a comment
78syn match fjStatement /^/ nextgroup=fjCommand,fjCommandNoCond,fjConditional,fjComment
79
80hi def link fjTodo Todo
81hi def link fjComment Comment
82hi def link fjCommand Statement
83hi def link fjCommandNoCond Statement
84hi def link fjConditional Macro
85hi def link fjVar Identifier
86hi def link fjCapability Type
87hi def link fjProtocol Type
88hi def link fjSyscall Type
89hi def link fjSyscallErrno Constant
90hi def link fjX11Sandbox Type
91hi def link fjEnvVar Type
92hi def link fjRmenvVar Type
93hi def link fjAll Type
94hi def link fjNone Type
95hi def link fjLo Type
96hi def link fjFilter Type
97hi def link fjSeccompAction Type
98
99
100let b:current_syntax = "firejail"
diff --git a/etc-fixes/0.9.38/firefox.profile b/etc-fixes/0.9.38/firefox.profile
new file mode 100644
index 000000000..00244aaa4
--- /dev/null
+++ b/etc-fixes/0.9.38/firefox.profile
@@ -0,0 +1,32 @@
1# Firejail profile for Mozilla Firefox (Iceweasel in Debian)
2noblacklist ${HOME}/.mozilla
3include /etc/firejail/disable-mgmt.inc
4include /etc/firejail/disable-secret.inc
5include /etc/firejail/disable-common.inc
6include /etc/firejail/disable-devel.inc
7caps.drop all
8
9#seccomp.drop @clock,@cpu-emulation,@debug,@module,@obsolete,@raw-io,@reboot,@resources,@swap,acct,add_key,bpf,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice
10seccomp.drop adjtimex,clock_adjtime,clock_settime,settimeofday,stime,modify_ldt,subpage_prot,switch_endian,vm86,vm86old,lookup_dcookie,perf_event_open,process_vm_writev,rtas,s390_runtime_instr,sys_debug_setcontext,delete_module,finit_module,init_module,_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,ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_mmio_read,s390_mmio_write,kexec_load,kexec_file_load,reboot,set_mempolicy,migrate_pages,move_pages,mbind,swapon,swapoff,acct,add_key,bpf,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice
11
12protocol unix,inet,inet6,netlink
13netfilter
14# tracelog
15noroot
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.mozilla
18whitelist ${HOME}/.cache/mozilla/firefox
19whitelist ${HOME}/dwhelper
20whitelist ${HOME}/.zotero
21whitelist ${HOME}/.lastpass
22whitelist ${HOME}/.vimperatorrc
23whitelist ${HOME}/.vimperator
24whitelist ${HOME}/.pentadactylrc
25whitelist ${HOME}/.pentadactyl
26whitelist ${HOME}/.keysnail.js
27whitelist ${HOME}/.config/gnome-mplayer
28whitelist ${HOME}/.cache/gnome-mplayer/plugin
29include /etc/firejail/whitelist-common.inc
30
31# experimental features
32#private-etc alternatives,passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
diff --git a/etc/atom.profile b/etc-fixes/0.9.52/atom.profile
index db3cbc687..87ffdced9 100644
--- a/etc/atom.profile
+++ b/etc-fixes/0.9.52/atom.profile
@@ -5,25 +5,23 @@ include /etc/firejail/atom.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include /etc/firejail/globals.local
7 7
8noblacklist ~/.atom 8# blacklist /run/user/*/bus
9noblacklist ~/.config/Atom 9
10noblacklist ${HOME}/.atom
11noblacklist ${HOME}/.config/Atom
10 12
11include /etc/firejail/disable-common.inc 13include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-passwdmgr.inc 14include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc 15include /etc/firejail/disable-programs.inc
14 16
15caps.drop all 17caps.keep sys_admin,sys_chroot
18# net none
16netfilter 19netfilter
17nodvd 20nodvd
18nogroups 21nogroups
19nonewprivs
20noroot
21nosound 22nosound
22notv 23notv
23novideo 24novideo
24protocol unix,inet,inet6,netlink
25seccomp
26# net none
27shell none 25shell none
28 26
29private-dev 27private-dev
diff --git a/etc-fixes/0.9.52/firefox.profile b/etc-fixes/0.9.52/firefox.profile
new file mode 100644
index 000000000..6a9ff977e
--- /dev/null
+++ b/etc-fixes/0.9.52/firefox.profile
@@ -0,0 +1,99 @@
1# Firejail profile for firefox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/firefox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/mozilla
9noblacklist ${HOME}/.config/okularpartrc
10noblacklist ${HOME}/.config/okularrc
11noblacklist ${HOME}/.config/qpdfview
12noblacklist ${HOME}/.kde/share/apps/kget
13noblacklist ${HOME}/.kde/share/apps/okular
14noblacklist ${HOME}/.kde/share/config/kgetrc
15noblacklist ${HOME}/.kde/share/config/okularpartrc
16noblacklist ${HOME}/.kde/share/config/okularrc
17noblacklist ${HOME}/.kde4/share/apps/kget
18noblacklist ${HOME}/.kde4/share/apps/okular
19noblacklist ${HOME}/.kde4/share/config/kgetrc
20noblacklist ${HOME}/.kde4/share/config/okularpartrc
21noblacklist ${HOME}/.kde4/share/config/okularrc
22# noblacklist ${HOME}/.local/share/gnome-shell/extensions
23noblacklist ${HOME}/.local/share/okular
24noblacklist ${HOME}/.local/share/qpdfview
25noblacklist ${HOME}/.mozilla
26noblacklist ${HOME}/.pki
27noblacklist ${HOME}/.local/share/pki
28
29include /etc/firejail/disable-common.inc
30include /etc/firejail/disable-devel.inc
31include /etc/firejail/disable-programs.inc
32
33mkdir ${HOME}/.cache/mozilla/firefox
34mkdir ${HOME}/.mozilla
35mkdir ${HOME}/.pki
36mkdir ${HOME}/.local/share/pki
37whitelist ${DOWNLOADS}
38whitelist ${HOME}/.cache/gnome-mplayer/plugin
39whitelist ${HOME}/.cache/mozilla/firefox
40whitelist ${HOME}/.config/gnome-mplayer
41whitelist ${HOME}/.config/okularpartrc
42whitelist ${HOME}/.config/okularrc
43whitelist ${HOME}/.config/pipelight-silverlight5.1
44whitelist ${HOME}/.config/pipelight-widevine
45whitelist ${HOME}/.config/qpdfview
46whitelist ${HOME}/.kde/share/apps/kget
47whitelist ${HOME}/.kde/share/apps/okular
48whitelist ${HOME}/.kde/share/config/kgetrc
49whitelist ${HOME}/.kde/share/config/okularpartrc
50whitelist ${HOME}/.kde/share/config/okularrc
51whitelist ${HOME}/.kde4/share/apps/kget
52whitelist ${HOME}/.kde4/share/apps/okular
53whitelist ${HOME}/.kde4/share/config/kgetrc
54whitelist ${HOME}/.kde4/share/config/okularpartrc
55whitelist ${HOME}/.kde4/share/config/okularrc
56whitelist ${HOME}/.keysnail.js
57whitelist ${HOME}/.lastpass
58whitelist ${HOME}/.local/share/gnome-shell/extensions
59whitelist ${HOME}/.local/share/okular
60whitelist ${HOME}/.local/share/qpdfview
61whitelist ${HOME}/.mozilla
62whitelist ${HOME}/.pentadactyl
63whitelist ${HOME}/.pentadactylrc
64whitelist ${HOME}/.pki
65whitelist ${HOME}/.local/share/pki
66whitelist ${HOME}/.vimperator
67whitelist ${HOME}/.vimperatorrc
68whitelist ${HOME}/.wine-pipelight
69whitelist ${HOME}/.wine-pipelight64
70whitelist ${HOME}/.zotero
71whitelist ${HOME}/dwhelper
72include /etc/firejail/whitelist-common.inc
73include /etc/firejail/whitelist-var-common.inc
74
75caps.drop all
76# machine-id breaks pulse audio; it should work fine in setups where sound is not required
77#machine-id
78netfilter
79nodvd
80nogroups
81nonewprivs
82noroot
83notv
84protocol unix,inet,inet6,netlink
85#seccomp - replaced with seccomp.drop for Firefox 60
86seccomp.drop @clock,@cpu-emulation,@debug,@module,@obsolete,@raw-io,@reboot,@resources,@swap,acct,add_key,bpf,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice
87shell none
88#tracelog - disabled for Firefox 60
89
90disable-mnt
91# firefox requires a shell to launch on Arch.
92# private-bin firefox,which,sh,dbus-launch,dbus-send,env,bash
93private-dev
94# private-etc below works fine on most distributions. There are some problems on CentOS.
95# private-etc alternatives,iceweasel,ca-certificates,ssl,machine-id,dconf,selinux,passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,xdg,gtk-2.0,gtk-3.0,X11,pango,fonts,firefox,mime.types,mailcap,asound.conf,pulse
96private-tmp
97
98noexec ${HOME}
99noexec /tmp
diff --git a/etc/gedit.profile b/etc-fixes/0.9.52/gedit.profile
index dc903bc2e..8dd71a196 100644
--- a/etc/gedit.profile
+++ b/etc-fixes/0.9.52/gedit.profile
@@ -5,6 +5,7 @@ include /etc/firejail/gedit.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include /etc/firejail/globals.local
7 7
8# blacklist /run/user/*/bus - makes settings immutable
8 9
9noblacklist ${HOME}/.config/enchant 10noblacklist ${HOME}/.config/enchant
10noblacklist ${HOME}/.config/gedit 11noblacklist ${HOME}/.config/gedit
@@ -35,7 +36,8 @@ tracelog
35 36
36# private-bin gedit 37# private-bin gedit
37private-dev 38private-dev
38# private-etc fonts 39# private-etc alternatives,fonts
40#private-lib gedit - disabled; problems when running "firejail gedit"; "firejail /usr/bin/gedit" works fine
39private-tmp 41private-tmp
40 42
41noexec ${HOME} 43noexec ${HOME}
diff --git a/etc/libreoffice.profile b/etc-fixes/0.9.52/libreoffice.profile
index 214b49c65..bbc52ff5e 100644
--- a/etc/libreoffice.profile
+++ b/etc-fixes/0.9.52/libreoffice.profile
@@ -7,7 +7,7 @@ include /etc/firejail/globals.local
7 7
8noblacklist ${HOME}/.java 8noblacklist ${HOME}/.java
9noblacklist /usr/local/sbin 9noblacklist /usr/local/sbin
10noblacklist ~/.config/libreoffice 10noblacklist ${HOME}/.config/libreoffice
11 11
12include /etc/firejail/disable-common.inc 12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc 13include /etc/firejail/disable-devel.inc
@@ -21,13 +21,13 @@ machine-id
21netfilter 21netfilter
22nodvd 22nodvd
23nogroups 23nogroups
24nonewprivs 24#nonewprivs
25noroot 25noroot
26notv 26notv
27protocol unix,inet,inet6 27#protocol unix,inet,inet6
28seccomp 28#seccomp
29shell none 29shell none
30tracelog 30#tracelog
31 31
32private-dev 32private-dev
33private-tmp 33private-tmp
diff --git a/etc-fixes/0.9.56/brave-browser.profile b/etc-fixes/0.9.56/brave-browser.profile
new file mode 100644
index 000000000..6e3a5df28
--- /dev/null
+++ b/etc-fixes/0.9.56/brave-browser.profile
@@ -0,0 +1,6 @@
1# Firejail profile alias for brave
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/brave.profile
diff --git a/etc-fixes/0.9.56/brave.profile b/etc-fixes/0.9.56/brave.profile
new file mode 100644
index 000000000..4c59c103f
--- /dev/null
+++ b/etc-fixes/0.9.56/brave.profile
@@ -0,0 +1,24 @@
1# Firejail profile for brave
2# This file is overwritten after every install/update
3# Description: Web browser that blocks ads and trackers by default.
4# Persistent local customizations
5include brave.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/brave
10noblacklist ${HOME}/.config/BraveSoftware
11# brave uses gpg for built-in password manager
12noblacklist ${HOME}/.gnupg
13
14mkdir ${HOME}/.config/brave
15mkdir ${HOME}/.config/BraveSoftware
16whitelist ${HOME}/.config/brave
17whitelist ${HOME}/.config/BraveSoftware
18whitelist ${HOME}/.gnupg
19
20# noexec /tmp is included in chromium-common.profile and breaks Brave
21ignore noexec /tmp
22
23# Redirect
24include /etc/firejail/chromium-common.profile
diff --git a/etc-fixes/0.9.58/atom.profile b/etc-fixes/0.9.58/atom.profile
new file mode 100644
index 000000000..9bc35da5a
--- /dev/null
+++ b/etc-fixes/0.9.58/atom.profile
@@ -0,0 +1,36 @@
1
2# Firejail profile for atom
3# Description: A hackable text editor for the 21st Century
4# This file is overwritten after every install/update
5# Persistent local customizations
6include atom.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.atom
11noblacklist ${HOME}/.config/Atom
12noblacklist ${HOME}/.cargo/config
13noblacklist ${HOME}/.cargo/registry
14
15include disable-common.inc
16include disable-passwdmgr.inc
17include disable-programs.inc
18
19caps.keep sys_admin,sys_chroot
20# net none
21netfilter
22nodbus
23nodvd
24nogroups
25nosound
26notv
27nou2f
28novideo
29shell none
30
31private-cache
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc-fixes/0.9.60/atom.profile b/etc-fixes/0.9.60/atom.profile
new file mode 100644
index 000000000..c8929127b
--- /dev/null
+++ b/etc-fixes/0.9.60/atom.profile
@@ -0,0 +1,37 @@
1# Firejail profile for atom
2# Description: A hackable text editor for the 21st Century
3# This file is overwritten after every install/update
4# Persistent local customizations
5include atom.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.atom
10noblacklist ${HOME}/.config/Atom
11noblacklist ${HOME}/.config/git
12noblacklist ${HOME}/.cargo/config
13noblacklist ${HOME}/.cargo/registry
14noblacklist ${HOME}/.gitconfig
15noblacklist ${HOME}/.git-credentials
16noblacklist ${HOME}/.pythonrc.py
17
18include disable-common.inc
19include disable-exec.inc
20include disable-passwdmgr.inc
21include disable-programs.inc
22
23caps.keep sys_admin,sys_chroot
24# net none
25netfilter
26nodbus
27nodvd
28nogroups
29nosound
30notv
31nou2f
32novideo
33shell none
34
35private-cache
36private-dev
37private-tmp
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/0ad.profile b/etc/0ad.profile
deleted file mode 100644
index 9ca9834a8..000000000
--- a/etc/0ad.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for 0ad
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/0ad.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/0ad
9noblacklist ~/.config/0ad
10noblacklist ~/.local/share/0ad
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ~/.cache/0ad
18mkdir ~/.config/0ad
19mkdir ~/.local/share/0ad
20whitelist ~/.cache/0ad
21whitelist ~/.config/0ad
22whitelist ~/.local/share/0ad
23include /etc/firejail/whitelist-common.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36tracelog
37
38disable-mnt
39private-dev
40private-tmp
41
42noexec ${HOME}
43noexec /tmp
diff --git a/etc/2048-qt.profile b/etc/2048-qt.profile
deleted file mode 100644
index 964a9e5fa..000000000
--- a/etc/2048-qt.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for 2048-qt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/2048-qt.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/2048-qt
9noblacklist ~/.config/xiaoyong
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19netfilter
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30
31disable-mnt
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/7z.profile b/etc/7z.profile
deleted file mode 100644
index ea67bbe19..000000000
--- a/etc/7z.profile
+++ /dev/null
@@ -1,23 +0,0 @@
1# Firejail profile for 7z
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/7z.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11ignore noroot
12net none
13no3d
14nodvd
15nosound
16notv
17novideo
18shell none
19tracelog
20
21private-dev
22
23include /etc/firejail/default.profile
diff --git a/etc/Cyberfox.profile b/etc/Cyberfox.profile
deleted file mode 100644
index 202bc26f4..000000000
--- a/etc/Cyberfox.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for cyberfox
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/cyberfox.profile
diff --git a/etc/FossaMail.profile b/etc/FossaMail.profile
deleted file mode 100644
index 01e338ef2..000000000
--- a/etc/FossaMail.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for fossamail
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/fossamail.profile
diff --git a/etc/Gitter.profile b/etc/Gitter.profile
deleted file mode 100644
index b12dbd450..000000000
--- a/etc/Gitter.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for Gitter
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/gitter.profile
diff --git a/etc/Mathematica.profile b/etc/Mathematica.profile
deleted file mode 100644
index 924f74389..000000000
--- a/etc/Mathematica.profile
+++ /dev/null
@@ -1,28 +0,0 @@
1# Firejail profile for Mathematica
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/Mathematica.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.Mathematica
9noblacklist ${HOME}/.Wolfram Research
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.Mathematica
17mkdir ~/.Wolfram Research
18whitelist ~/.Mathematica
19whitelist ~/.Wolfram Research
20whitelist ~/Documents/Wolfram Mathematica
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24nodvd
25nonewprivs
26noroot
27notv
28seccomp
diff --git a/etc/Natron.profile b/etc/Natron.profile
deleted file mode 100644
index b21790fe4..000000000
--- a/etc/Natron.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for natron
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/natron.profile
diff --git a/etc/Telegram.profile b/etc/Telegram.profile
deleted file mode 100644
index df6557a90..000000000
--- a/etc/Telegram.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for telegram
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/telegram.profile
diff --git a/etc/Thunar.profile b/etc/Thunar.profile
deleted file mode 100644
index f4a5c9f54..000000000
--- a/etc/Thunar.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for Thunar
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/Thunar.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/Trash
9noblacklist ~/.config/Thunar
10noblacklist ~/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15# include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30tracelog
diff --git a/etc/Viber.profile b/etc/Viber.profile
deleted file mode 100644
index 03e5f1086..000000000
--- a/etc/Viber.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for Viber
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/Viber.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.ViberPC
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.ViberPC
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21ipc-namespace
22netfilter
23nodvd
24nogroups
25nonewprivs
26noroot
27notv
28protocol unix,inet,inet6
29seccomp
30shell none
31
32disable-mnt
33private-bin sh,bash,dash,dig,awk,Viber
34private-etc hosts,fonts,mailcap,resolv.conf,X11,pulse,alternatives,localtime,nsswitch.conf,ssl,proxychains.conf
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/VirtualBox.profile b/etc/VirtualBox.profile
deleted file mode 100644
index dedf448ae..000000000
--- a/etc/VirtualBox.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for virtualbox
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/virtualbox.profile
diff --git a/etc/Wire.profile b/etc/Wire.profile
deleted file mode 100644
index 26b683f84..000000000
--- a/etc/Wire.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for wire
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/wire.profile
diff --git a/etc/abrowser.profile b/etc/abrowser.profile
deleted file mode 100644
index 3251ef8aa..000000000
--- a/etc/abrowser.profile
+++ /dev/null
@@ -1,48 +0,0 @@
1# Firejail profile for abrowser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/abrowser.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/mozilla
9noblacklist ~/.mozilla
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/mozilla/abrowser
17mkdir ~/.mozilla
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/gnome-mplayer/plugin
20whitelist ~/.cache/mozilla/abrowser
21whitelist ~/.config/gnome-mplayer
22whitelist ~/.config/pipelight-silverlight5.1
23whitelist ~/.config/pipelight-widevine
24whitelist ~/.keysnail.js
25whitelist ~/.lastpass
26whitelist ~/.mozilla
27whitelist ~/.pentadactyl
28whitelist ~/.pentadactylrc
29whitelist ~/.pki
30whitelist ~/.vimperator
31whitelist ~/.vimperatorrc
32whitelist ~/.wine-pipelight
33whitelist ~/.wine-pipelight64
34whitelist ~/.zotero
35whitelist ~/dwhelper
36include /etc/firejail/whitelist-common.inc
37
38caps.drop all
39netfilter
40nodvd
41nonewprivs
42noroot
43notv
44protocol unix,inet,inet6,netlink
45seccomp
46tracelog
47
48# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
diff --git a/etc/akregator.profile b/etc/akregator.profile
deleted file mode 100644
index f2e5ea341..000000000
--- a/etc/akregator.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for akregator
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/akregator.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/akregatorrc
9noblacklist ${HOME}/.local/share/akregator
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkfile ${HOME}/.config/akregatorrc
17mkdir ${HOME}/.local/share/akregator
18whitelist ${HOME}/.config/akregatorrc
19whitelist ${HOME}/.local/share/akregator
20include /etc/firejail/whitelist-common.inc
21
22include /etc/firejail/whitelist-var-common.inc
23
24caps.drop all
25netfilter
26no3d
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32novideo
33protocol unix,inet,inet6,netlink
34seccomp
35shell none
36
37disable-mnt
38private-bin akregator,akregatorstorageexporter,dbus-launch,kdeinit5,kshell5,kdeinit5_shutdown,kdeinit5_wrapper,kdeinit4,kshell4,kdeinit4_shutdown,kdeinit4_wrapper
39private-dev
40private-tmp
41
42noexec ${HOME}
43noexec /tmp
diff --git a/etc/amarok.profile b/etc/amarok.profile
deleted file mode 100644
index 79343fcdf..000000000
--- a/etc/amarok.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for amarok
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/amarok.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18nogroups
19nonewprivs
20noroot
21notv
22novideo
23protocol unix,inet,inet6
24# seccomp
25shell none
26
27# private-bin amarok
28private-dev
29# private-etc none
30private-tmp
diff --git a/etc/apktool.profile b/etc/apktool.profile
deleted file mode 100644
index 650c20de7..000000000
--- a/etc/apktool.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for apktool
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/apktool.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-bin apktool,bash,dash,java,dirname,basename,expr,sh
29private-dev
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/apparmor/firejail-default b/etc/apparmor/firejail-default
new file mode 100644
index 000000000..ca32f5b0d
--- /dev/null
+++ b/etc/apparmor/firejail-default
@@ -0,0 +1,141 @@
1#########################################
2# Generic Firejail AppArmor profile
3#########################################
4
5# AppArmor 3.0 uses the @{run} variable in <abstractions/dbus-strict>
6# and <abstractions/dbus-session-strict>.
7#include <tunables/global>
8
9##########
10# A simple PID declaration based on Ubuntu's @{pid}
11# Ubuntu keeps it under tunables/kernelvars and include it via tunables/global.
12# We don't know if this definition is available outside Debian and Ubuntu, so
13# we declare our own here.
14##########
15@{PID}={[1-9],[1-9][0-9],[1-9][0-9][0-9],[1-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9],[1-4][0-9][0-9][0-9][0-9][0-9][0-9]}
16
17profile firejail-default flags=(attach_disconnected,mediate_deleted) {
18
19##########
20# Allow D-Bus access. It may negatively affect security. Comment those lines or
21# use 'nodbus' option in profile if you don't need D-Bus functionality.
22##########
23#include <abstractions/dbus-strict>
24#include <abstractions/dbus-session-strict>
25dbus,
26# Add rule in order to avoid dbus-*=filter breakage (#3432)
27owner /{,var/}run/firejail/dbus/[0-9]*/[0-9]*-user w,
28
29##########
30# With ptrace it is possible to inspect and hijack running programs.
31##########
32# Uncomment this line to allow all ptrace access
33#ptrace,
34# Allow obtaining some process information, but not ptrace(2)
35ptrace (read,readby) peer=@{profile_name},
36
37##########
38# Allow read access to whole filesystem and control it from firejail.
39##########
40/{,**} rklm,
41
42##########
43# Allow write access to paths writable in firejail which aren't used for
44# executing programs. /run, /proc and /sys are handled separately.
45# Line starting with /run/firejail/mnt/oroot deal with --overlay sandboxes.
46##########
47/{,run/firejail/mnt/oroot/}{dev,etc,home,media,mnt,root,srv,tmp,var}/** w,
48
49##########
50# Whitelist writable paths under /run, /proc and /sys.
51##########
52owner /{,run/firejail/mnt/oroot/}{,var/}run/firejail/mnt/trace w,
53owner /{,run/firejail/mnt/oroot/}{,var/}run/user/[0-9]*/** w,
54owner /{,run/firejail/mnt/oroot/}{run,dev}/shm/** w,
55
56# Allow writing to /var/mail and /var/spool/mail (for mail clients)
57# Uncomment to enable
58#owner /var/{mail,spool/mail}/** w,
59
60# Allow writing to removable media
61owner /{,var/}run/media/** w,
62
63# Allow logging Firejail blacklist violations to journal
64/{,var/}run/systemd/journal/socket w,
65/{,var/}run/systemd/journal/dev-log w,
66
67# Allow access to cups printing socket.
68/{,var/}run/cups/cups.sock w,
69
70# Allow access to pcscd socket (smartcards)
71/{,var/}run/pcscd/pcscd.comm w,
72
73# Needed for browser self-sandboxing
74owner /proc/@{PID}/{uid_map,gid_map,setgroups} w,
75
76# Needed for electron apps
77/proc/@{PID}/comm w,
78# Needed for nslookup, dig, host
79/proc/@{PID}/task/@{PID}/comm w,
80
81# Used by chromium
82owner /proc/@{PID}/oom_score_adj w,
83owner /proc/@{PID}/clear_refs w,
84
85##########
86# Allow running programs only from well-known system directories. If you need
87# to run programs from your home directory, add "/{,run/firejail/mnt/oroot/}home/** ix,"
88# or similar to /etc/apparmor.d/local/firejail-default (without the quotes).
89##########
90/{,run/firejail/mnt/oroot/}{,usr/,usr/local/}bin/** ix,
91/{,run/firejail/mnt/oroot/}{,usr/,usr/local/}sbin/** ix,
92/{,run/firejail/mnt/oroot/}{,usr/,usr/local/}games/** ix,
93/{,run/firejail/mnt/oroot/}{,usr/,usr/local/}lib{,32,64,exec}/** ix,
94/{,run/firejail/mnt/oroot/}{,usr/,usr/local/}opt/** ix,
95#/{,run/firejail/mnt/oroot/}home/** ix,
96
97# Appimage support
98/{,run/firejail/mnt/oroot/}{,var/}run/firejail/appimage/** ix,
99
100##########
101# Blacklist specific sensitive paths.
102##########
103deny /**/.fscrypt/ rw,
104deny /**/.fscrypt/** rwklmx,
105deny /**/.snapshots/ rw,
106deny /**/.snapshots/** rwklmx,
107
108##########
109# Allow all networking functionality, and control it from Firejail.
110##########
111network inet,
112network inet6,
113network unix,
114network netlink,
115network raw,
116# needed for wireshark, tcpdump etc
117network bluetooth,
118network packet,
119
120##########
121# There is no equivalent in Firejail for filtering signals.
122##########
123signal (send) peer=@{profile_name},
124signal (receive),
125
126##########
127# We let Firejail deal with capabilities, but ensure that
128# some AppArmor related capabilities will not be available.
129##########
130# The list of recognized capabilities varies from one apparmor version to another.
131# For example on Debian 10 (apparmor 2.13.2) checkpoint_restore, perfmon, bpf are not available
132# We allow all caps by default and remove the ones we don't like:
133capability,
134deny capability audit_write,
135deny capability audit_control,
136deny capability mac_override,
137deny capability mac_admin,
138
139# Site-specific additions and overrides. See local/README for details.
140#include <local/firejail-default>
141}
diff --git a/etc/apparmor/firejail-local b/etc/apparmor/firejail-local
new file mode 100644
index 000000000..3dfd3d0ea
--- /dev/null
+++ b/etc/apparmor/firejail-local
@@ -0,0 +1,15 @@
1# Site-specific additions and overrides for 'firejail-default'.
2# For more details, please see /etc/apparmor.d/local/README.
3
4# Here are some examples to allow running programs from home directory.
5# Don't enable all of these, just pick a specific one or write a custom rule
6# instead as done below for torbrowser-launcher.
7#owner @HOME/** ix,
8#owner @HOME/bin/** ix
9#owner @HOME/.local/bin/** ix
10
11# Uncomment to opt-in to apparmor for brave + tor
12#owner @{HOME}/.config/BraveSoftware/Brave-Browser/biahpgbdmdkfgndcmfiipgcebobojjkp/*/** ix,
13
14# Uncomment to opt-in to apparmor for torbrowser-launcher
15#owner @{HOME}/.local/share/torbrowser/tbb/{i686,x86_64}/tor-browser_*/Browser/** ix,
diff --git a/etc/arch-audit.profile b/etc/arch-audit.profile
deleted file mode 100644
index d8ed64811..000000000
--- a/etc/arch-audit.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for arch-audit
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/arch-audit.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10noblacklist /var/lib/pacman
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18ipc-namespace
19netfilter
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31
32disable-mnt
33private
34private-bin arch-audit
35private-dev
36private-tmp
37
38memory-deny-write-execute
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/ardour4.profile b/etc/ardour4.profile
deleted file mode 100644
index 7d1163174..000000000
--- a/etc/ardour4.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for ardour5
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/ardour5.profile
diff --git a/etc/ardour5.profile b/etc/ardour5.profile
deleted file mode 100644
index 69b3dde46..000000000
--- a/etc/ardour5.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for ardour5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ardour5.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/ardour4
10noblacklist ${HOME}/.config/ardour5
11noblacklist ${HOME}/.lv2
12noblacklist ${HOME}/.vst
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19caps.drop all
20ipc-namespace
21net none
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27protocol unix
28seccomp
29shell none
30
31#private-bin sh,ardour4,ardour5,ardour5-copy-mixer,ardour5-export,ardour5-fix_bbtppq,grep,sed,ldd,nm
32private-dev
33#private-etc pulse,X11,alternatives,ardour4,ardour5,fonts
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/arduino.profile b/etc/arduino.profile
deleted file mode 100644
index b529ec266..000000000
--- a/etc/arduino.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for arduino
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/arduino.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.arduino15
9noblacklist ${HOME}/.java
10noblacklist ${HOME}/Arduino
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/ark.profile b/etc/ark.profile
deleted file mode 100644
index ba9cb1134..000000000
--- a/etc/ark.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for ark
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ark.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/arkrc
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30# private-bin
31private-dev
32# private-etc
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/arm.profile b/etc/arm.profile
deleted file mode 100644
index afb6d465a..000000000
--- a/etc/arm.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for arm
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/arm.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.arm
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.arm
16whitelist ${HOME}/.arm
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20ipc-namespace
21netfilter
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix,inet,inet6
31seccomp
32shell none
33tracelog
34
35disable-mnt
36# private-bin arm,tor,sh,bash,dash,python2,python2.7,ps,lsof,ldconfig
37private-dev
38private-etc tor,passwd
39private-tmp
40
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/atom-beta.profile b/etc/atom-beta.profile
deleted file mode 100644
index 4869ef4ea..000000000
--- a/etc/atom-beta.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for atom-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/atom-beta.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.atom
9noblacklist ~/.config/Atom
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix,inet,inet6,netlink
25seccomp
26shell none
27
28private-dev
29private-tmp
diff --git a/etc/atool.profile b/etc/atool.profile
deleted file mode 100644
index c2e772f9d..000000000
--- a/etc/atool.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for atool
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/atool.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10include /etc/firejail/disable-common.inc
11# include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29
30# private-bin atool
31private-dev
32private-etc none
33private-tmp
diff --git a/etc/atril.profile b/etc/atril.profile
deleted file mode 100644
index 052b41655..000000000
--- a/etc/atril.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for atril
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/atril.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/atril
9noblacklist ~/.local/share
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30tracelog
31
32private-bin atril, atril-previewer, atril-thumbnailer
33private-dev
34private-etc fonts,ld.so.cache
35# atril needs access to /tmp/mozilla* to work in firefox
36# private-tmp
37
38memory-deny-write-execute
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/audacious.profile b/etc/audacious.profile
deleted file mode 100644
index 7e2b91773..000000000
--- a/etc/audacious.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for audacious
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/audacious.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Audaciousrc
9noblacklist ~/.config/audacious
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19netfilter
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28tracelog
29
30# private-bin audacious
31private-dev
32private-tmp
33
34memory-deny-write-execute
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/audacity.profile b/etc/audacity.profile
deleted file mode 100644
index 88aea243e..000000000
--- a/etc/audacity.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for audacity
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/audacity.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.audacity-data
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18net none
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
30
31private-bin audacity
32private-dev
33private-tmp
34
35memory-deny-write-execute
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/aweather.profile b/etc/aweather.profile
deleted file mode 100644
index ef811b330..000000000
--- a/etc/aweather.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for aweather
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/aweather.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/aweather
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.config/aweather
16whitelist ~/.config/aweather
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31tracelog
32
33private-bin aweather
34private-dev
35private-tmp
diff --git a/etc/baloo_file.profile b/etc/baloo_file.profile
deleted file mode 100644
index 2c2d70c00..000000000
--- a/etc/baloo_file.profile
+++ /dev/null
@@ -1,48 +0,0 @@
1# Firejail profile for baloo_file
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/baloo_file.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/baloofilerc
9noblacklist ${HOME}/.kde/share/config/baloofilerc
10noblacklist ${HOME}/.kde/share/config/baloorc
11noblacklist ${HOME}/.kde4/share/config/baloofilerc
12noblacklist ${HOME}/.kde4/share/config/baloorc
13noblacklist ${HOME}/.local/share/baloo
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20include /etc/firejail/whitelist-var-common.inc
21
22caps.drop all
23no3d
24nodvd
25nogroups
26nonewprivs
27noroot
28nosound
29notv
30novideo
31protocol unix
32# Baloo makes ioprio_set system calls, which are blacklisted by default.
33seccomp.drop @cpu-emulation,@debug,@obsolete,@privileged,@resources,add_key,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,kcmp,keyctl,name_to_handle_at,ni_syscall,open_by_handle_at,personality,process_vm_readv,ptrace,remap_file_pages,request_key,syslog,umount,userfaultfd,vmsplice
34shell none
35x11 xorg
36
37private-bin baloo_file,baloo_file_extractor,kbuildsycoca4
38private-dev
39private-tmp
40
41noexec ${HOME}
42noexec /tmp
43
44# Make home directory read-only and allow writing only to ~/.local/share
45# Note: Baloo will not be able to update the "first run" key in its configuration files.
46# read-only ${HOME}
47# read-write ${HOME}/.local/share
48# noexec ${HOME}/.local/share
diff --git a/etc/baobab.profile b/etc/baobab.profile
deleted file mode 100644
index ef733632d..000000000
--- a/etc/baobab.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for baobab
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/baobab.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12# include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-bin baobab
29private-dev
30private-tmp
31
32memory-deny-write-execute
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/bibletime.profile b/etc/bibletime.profile
deleted file mode 100644
index 73d31c205..000000000
--- a/etc/bibletime.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for bibletime
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/bibletime.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist ~/.Xauthority
9blacklist ~/.bashrc
10
11noblacklist ~/.bibletime
12noblacklist ~/.config/qt5ct
13noblacklist ~/.sword
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20whitelist ${HOME}/.bibletime
21whitelist ${HOME}/.config/qt5ct
22whitelist ${HOME}/.sword
23include /etc/firejail/whitelist-common.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31nosound
32notv
33novideo
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37tracelog
38
39# private-bin bibletime,qt5ct
40private-dev
41private-etc fonts,resolv.conf,sword,sword.conf,passwd
42private-tmp
diff --git a/etc/bleachbit.profile b/etc/bleachbit.profile
deleted file mode 100644
index f3498e9b9..000000000
--- a/etc/bleachbit.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for bleachbit
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/bleachbit.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12# include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28# private-bin
29# private-dev
30# private-etc
31# private-tmp
32
33memory-deny-write-execute
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/blender.profile b/etc/blender.profile
deleted file mode 100644
index f7ecbce55..000000000
--- a/etc/blender.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for blender
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/blender.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/blender
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix,inet,inet6,netlink
23seccomp
24shell none
25
26private-dev
27private-tmp
28
29noexec ${HOME}
30noexec /tmp
diff --git a/etc/bless.profile b/etc/bless.profile
deleted file mode 100644
index 27557d9af..000000000
--- a/etc/bless.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for bless
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/bless.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/bless
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29# private-bin bless,dash,sh,bash,mono
30private-dev
31private-etc fonts,mono
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/bluefish.profile b/etc/bluefish.profile
deleted file mode 100644
index f7e322838..000000000
--- a/etc/bluefish.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for bluefish
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/bluefish.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27tracelog
28
29private-bin bluefish
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/brackets.profile b/etc/brackets.profile
deleted file mode 100644
index 0a8c592a7..000000000
--- a/etc/brackets.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for brackets
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/brackets.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Brackets
9noblacklist /opt/brackets/
10noblacklist /opt/google/
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29private-dev
diff --git a/etc/brasero.profile b/etc/brasero.profile
deleted file mode 100644
index eff4cba43..000000000
--- a/etc/brasero.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for brasero
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/brasero.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/brasero
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16nogroups
17nonewprivs
18noroot
19nosound
20notv
21novideo
22protocol unix
23seccomp
24shell none
25tracelog
26
27# private-bin brasero
28# private-dev
29# private-etc fonts
30# private-tmp
31
32memory-deny-write-execute
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/brave.profile b/etc/brave.profile
deleted file mode 100644
index 4a908c884..000000000
--- a/etc/brave.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for brave
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/brave.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/brave
9# brave uses gpg for built-in password manager
10noblacklist ~/.gnupg
11noblacklist ~/.pki
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ~/.config/brave
18mkdir ~/.pki
19whitelist ${DOWNLOADS}
20whitelist ~/.config/KeePass
21whitelist ~/.config/brave
22whitelist ~/.config/keepass
23whitelist ~/.config/lastpass
24whitelist ~/.keepass
25whitelist ~/.lastpass
26whitelist ~/.pki
27include /etc/firejail/whitelist-common.inc
28
29# caps.drop all
30netfilter
31# nonewprivs
32# noroot
33nodvd
34notv
35# protocol unix,inet,inet6,netlink
36# seccomp
37
38# disable-mnt
diff --git a/etc/caja.profile b/etc/caja.profile
deleted file mode 100644
index 97663fddb..000000000
--- a/etc/caja.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for caja
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/caja.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Caja is started by systemd on most systems. Therefore it is not firejailed by default. Since there
9# is already a caja process running on MATE desktops firejail will have no effect.
10
11noblacklist ~/.config/caja
12noblacklist ~/.local/share/Trash
13noblacklist ~/.local/share/caja-python
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18# include /etc/firejail/disable-programs.inc
19
20caps.drop all
21netfilter
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27novideo
28protocol unix
29seccomp
30shell none
31tracelog
32
33# caja needs to be able to start arbitrary applications so we cannot blacklist their files
34# private-bin caja
35# private-dev
36# private-etc fonts
37# private-tmp
diff --git a/etc/calibre.profile b/etc/calibre.profile
deleted file mode 100644
index 844231032..000000000
--- a/etc/calibre.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for calibre
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/calibre.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/calibre
9noblacklist ~/.config/calibre
10
11include /etc/firejail/disable-common.inc
12# include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19netfilter
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31tracelog
32
33# private-bin
34private-dev
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/calligra.profile b/etc/calligra.profile
deleted file mode 100644
index d2b76d22c..000000000
--- a/etc/calligra.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/calligra.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8include /etc/firejail/disable-common.inc
9include /etc/firejail/disable-devel.inc
10include /etc/firejail/disable-passwdmgr.inc
11include /etc/firejail/disable-programs.inc
12
13caps.drop all
14ipc-namespace
15net none
16nodvd
17nogroups
18nonewprivs
19noroot
20notv
21novideo
22protocol unix
23seccomp
24shell none
25
26private-bin calligra,calligraauthor,calligraconverter,calligraflow,calligraplan,calligraplanwork,calligrasheets,calligrastage,calligrawords,dbus-launch
27private-dev
28
29#noexec ${HOME}
30noexec /tmp
diff --git a/etc/calligraauthor.profile b/etc/calligraauthor.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligraauthor.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraconverter.profile b/etc/calligraconverter.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligraconverter.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraflow.profile b/etc/calligraflow.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligraflow.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraplan.profile b/etc/calligraplan.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligraplan.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligraplanwork.profile b/etc/calligraplanwork.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligraplanwork.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligrasheets.profile b/etc/calligrasheets.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligrasheets.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligrastage.profile b/etc/calligrastage.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligrastage.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/calligrawords.profile b/etc/calligrawords.profile
deleted file mode 100644
index 629ab46c1..000000000
--- a/etc/calligrawords.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/calligra.profile
diff --git a/etc/cherrytree.profile b/etc/cherrytree.profile
deleted file mode 100644
index 88be562c8..000000000
--- a/etc/cherrytree.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for cherrytree
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/cherrytree.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/cherrytree
9noblacklist /usr/bin/python2*
10noblacklist /usr/lib/python3*
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6,netlink
28seccomp
29shell none
30tracelog
31
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/chromium-browser.profile b/etc/chromium-browser.profile
deleted file mode 100644
index 472841e92..000000000
--- a/etc/chromium-browser.profile
+++ /dev/null
@@ -1,5 +0,0 @@
1# Firejail profile alias for chromium
2# This file is overwritten after every install/update
3
4# Redirect
5include /etc/firejail/chromium.profile
diff --git a/etc/chromium.profile b/etc/chromium.profile
deleted file mode 100644
index 0c7058a11..000000000
--- a/etc/chromium.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for chromium
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/chromium.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/chromium
9noblacklist ~/.config/chromium
10noblacklist ~/.config/chromium-flags.conf
11noblacklist ~/.pki
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ~/.cache/chromium
18mkdir ~/.config/chromium
19mkdir ~/.pki
20whitelist ${DOWNLOADS}
21whitelist ~/.cache/chromium
22whitelist ~/.config/chromium
23whitelist ~/.config/chromium-flags.conf
24whitelist ~/.pki
25include /etc/firejail/whitelist-common.inc
26include /etc/firejail/whitelist-var-common.inc
27
28caps.keep sys_chroot,sys_admin
29netfilter
30nodvd
31nogroups
32notv
33shell none
34
35# private-bin chromium,chromium-browser,chromedriver
36private-dev
37# private-tmp - problems with multiple browser sessions
38
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/cin.profile b/etc/cin.profile
deleted file mode 100644
index 6b3e3888b..000000000
--- a/etc/cin.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for cin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/cin.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.bcast5
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16ipc-namespace
17net none
18nodvd
19nogroups
20nonewprivs
21notv
22noroot
23protocol unix
24seccomp
25shell none
26
27private-bin cin,ffmpeg
28private-dev
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/cinelerra.profile b/etc/cinelerra.profile
deleted file mode 100644
index e6a1941b5..000000000
--- a/etc/cinelerra.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for cin
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/cin.profile
diff --git a/etc/clamdscan.profile b/etc/clamdscan.profile
deleted file mode 100644
index f6861dfa1..000000000
--- a/etc/clamdscan.profile
+++ /dev/null
@@ -1,7 +0,0 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3quiet
4
5
6# Redirect
7include /etc/firejail/clamav.profile
diff --git a/etc/clamdtop.profile b/etc/clamdtop.profile
deleted file mode 100644
index f6861dfa1..000000000
--- a/etc/clamdtop.profile
+++ /dev/null
@@ -1,7 +0,0 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3quiet
4
5
6# Redirect
7include /etc/firejail/clamav.profile
diff --git a/etc/clamscan.profile b/etc/clamscan.profile
deleted file mode 100644
index f6861dfa1..000000000
--- a/etc/clamscan.profile
+++ /dev/null
@@ -1,7 +0,0 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3quiet
4
5
6# Redirect
7include /etc/firejail/clamav.profile
diff --git a/etc/claws-mail.profile b/etc/claws-mail.profile
deleted file mode 100644
index 4ab49163b..000000000
--- a/etc/claws-mail.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for claws-mail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/claws-mail.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.claws-mail
9noblacklist ~/.gnupg
10noblacklist ~/.signature
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix,inet,inet6
27seccomp
28shell none
29
30private-dev
31private-tmp
diff --git a/etc/clementine.profile b/etc/clementine.profile
deleted file mode 100644
index 1d93e5f2c..000000000
--- a/etc/clementine.profile
+++ /dev/null
@@ -1,22 +0,0 @@
1# Firejail profile for clementine
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/clementine.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Clementine
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16nonewprivs
17noroot
18notv
19novideo
20protocol unix,inet,inet6
21# Clementine makes ioprio_set system calls, which are blacklisted by default.
22seccomp.drop @cpu-emulation,@debug,@obsolete,@privileged,@resources,add_key,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,kcmp,keyctl,name_to_handle_at,ni_syscall,open_by_handle_at,personality,process_vm_readv,ptrace,remap_file_pages,request_key,syslog,umount,userfaultfd,vmsplice
diff --git a/etc/clipit.profile b/etc/clipit.profile
deleted file mode 100644
index e6ee7b636..000000000
--- a/etc/clipit.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for clipit
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/clipit.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/clipit
9noblacklist ${HOME}/.local/share/clipit
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30disable-mnt
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/cliqz.profile b/etc/cliqz.profile
deleted file mode 100644
index a7c791a02..000000000
--- a/etc/cliqz.profile
+++ /dev/null
@@ -1,83 +0,0 @@
1# Firejail profile for cliqz
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/cliqz.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/cliqz
9noblacklist ~/.config/cliqz
10noblacklist ~/.config/okularpartrc
11noblacklist ~/.config/okularrc
12noblacklist ~/.config/qpdfview
13noblacklist ~/.kde/share/apps/okular
14noblacklist ~/.kde/share/config/okularpartrc
15noblacklist ~/.kde/share/config/okularrc
16noblacklist ~/.kde4/share/apps/okular
17noblacklist ~/.kde4/share/config/okularpartrc
18noblacklist ~/.kde4/share/config/okularrc
19noblacklist ~/.local/share/gnome-shell/extensions
20noblacklist ~/.local/share/okular
21noblacklist ~/.local/share/qpdfview
22
23noblacklist ~/.pki
24
25include /etc/firejail/disable-common.inc
26include /etc/firejail/disable-devel.inc
27include /etc/firejail/disable-programs.inc
28
29mkdir ~/.cache/mozilla/firefox
30mkdir ~/.mozilla
31mkdir ~/.pki
32whitelist ${DOWNLOADS}
33whitelist ~/.cache/gnome-mplayer/plugin
34whitelist ~/.cache/mozilla/firefox
35whitelist ~/.config/gnome-mplayer
36whitelist ~/.config/okularpartrc
37whitelist ~/.config/okularrc
38whitelist ~/.config/pipelight-silverlight5.1
39whitelist ~/.config/pipelight-widevine
40whitelist ~/.config/qpdfview
41whitelist ~/.kde/share/apps/okular
42whitelist ~/.kde/share/config/okularpartrc
43whitelist ~/.kde/share/config/okularrc
44whitelist ~/.kde4/share/apps/okular
45whitelist ~/.kde4/share/config/okularpartrc
46whitelist ~/.kde4/share/config/okularrc
47whitelist ~/.keysnail.js
48whitelist ~/.lastpass
49whitelist ~/.local/share/gnome-shell/extensions
50whitelist ~/.local/share/okular
51whitelist ~/.local/share/qpdfview
52whitelist ~/.mozilla
53whitelist ~/.pentadactyl
54whitelist ~/.pentadactylrc
55whitelist ~/.pki
56whitelist ~/.vimperator
57whitelist ~/.vimperatorrc
58whitelist ~/.wine-pipelight
59whitelist ~/.wine-pipelight64
60whitelist ~/.zotero
61whitelist ~/dwhelper
62include /etc/firejail/whitelist-common.inc
63include /etc/firejail/whitelist-var-common.inc
64
65caps.drop all
66netfilter
67nodvd
68nogroups
69nonewprivs
70noroot
71notv
72protocol unix,inet,inet6,netlink
73seccomp
74shell none
75tracelog
76
77# private-bin firefox,which,sh,dbus-launch,dbus-send,env
78private-dev
79# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,xdg,gtk-2.0,gtk-3.0,X11,pango,fonts,firefox,mime.types,mailcap,asound.conf,pulse
80private-tmp
81
82noexec ${HOME}
83noexec /tmp
diff --git a/etc/cmus.profile b/etc/cmus.profile
deleted file mode 100644
index 2d6f2454b..000000000
--- a/etc/cmus.profile
+++ /dev/null
@@ -1,26 +0,0 @@
1# Firejail profile for cmus
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/cmus.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/cmus
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nonewprivs
18noroot
19notv
20novideo
21protocol unix,inet,inet6
22seccomp
23shell none
24
25private-bin cmus
26private-etc group
diff --git a/etc/conkeror.profile b/etc/conkeror.profile
deleted file mode 100644
index f6a9eefb6..000000000
--- a/etc/conkeror.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for conkeror
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/conkeror.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.conkeror.mozdev.org
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-programs.inc
12
13whitelist ~/.conkeror.mozdev.org
14whitelist ~/.conkerorrc
15whitelist ~/.gtkrc-2.0
16whitelist ~/.lastpass
17whitelist ~/.pentadactyl
18whitelist ~/.pentadactylrc
19whitelist ~/.vimperator
20whitelist ~/.vimperatorrc
21whitelist ~/.zotero
22whitelist ~/Downloads
23whitelist ~/dwhelper
24include /etc/firejail/whitelist-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nonewprivs
30noroot
31notv
32protocol unix,inet,inet6
33seccomp
diff --git a/etc/conky.profile b/etc/conky.profile
deleted file mode 100644
index 4ee25f099..000000000
--- a/etc/conky.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for conky
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/conky.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15ipc-namespace
16netfilter
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29disable-mnt
30private-dev
31private-tmp
32
33memory-deny-write-execute
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/corebird.profile b/etc/corebird.profile
deleted file mode 100644
index 99a3335ef..000000000
--- a/etc/corebird.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for corebird
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/corebird.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/corebird
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29private-bin corebird
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/cpio.profile b/etc/cpio.profile
deleted file mode 100644
index 7f4bc4a84..000000000
--- a/etc/cpio.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for cpio
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/cpio.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11noblacklist /sbin
12noblacklist /usr/sbin
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18caps.drop all
19net none
20no3d
21nodvd
22nonewprivs
23nosound
24notv
25novideo
26seccomp
27shell none
28tracelog
29
30private-dev
diff --git a/etc/cryptocat.profile b/etc/cryptocat.profile
deleted file mode 100644
index 04301ffbd..000000000
--- a/etc/cryptocat.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for Cryptocat
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/Cryptocat.profile
diff --git a/etc/curl.profile b/etc/curl.profile
deleted file mode 100644
index 972bbe9cc..000000000
--- a/etc/curl.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for curl
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/curl.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11noblacklist ~/.curlrc
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31# private-bin curl
32private-dev
33# private-etc resolv.conf
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/cyberfox.profile b/etc/cyberfox.profile
deleted file mode 100644
index 63f6ea845..000000000
--- a/etc/cyberfox.profile
+++ /dev/null
@@ -1,72 +0,0 @@
1# Firejail profile for cyberfox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/cyberfox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.8pecxstudios
9noblacklist ~/.cache/8pecxstudios
10noblacklist ~/.config/okularpartrc
11noblacklist ~/.config/okularrc
12noblacklist ~/.config/qpdfview
13noblacklist ~/.kde/share/apps/okular
14noblacklist ~/.kde4/share/apps/okular
15noblacklist ~/.local/share/okular
16noblacklist ~/.local/share/qpdfview
17noblacklist ~/.pki
18
19include /etc/firejail/disable-common.inc
20include /etc/firejail/disable-devel.inc
21include /etc/firejail/disable-programs.inc
22
23mkdir ~/.8pecxstudios
24mkdir ~/.cache/8pecxstudios
25mkdir ~/.pki
26whitelist ${DOWNLOADS}
27whitelist ~/.8pecxstudios
28whitelist ~/.cache/8pecxstudios
29whitelist ~/.cache/gnome-mplayer/plugin
30whitelist ~/.config/gnome-mplayer
31whitelist ~/.config/okularpartrc
32whitelist ~/.config/okularrc
33whitelist ~/.config/pipelight-silverlight5.1
34whitelist ~/.config/pipelight-widevine
35whitelist ~/.config/qpdfview
36whitelist ~/.kde/share/apps/okular
37whitelist ~/.kde4/share/apps/okular
38whitelist ~/.keysnail.js
39whitelist ~/.lastpass
40whitelist ~/.local/share/okular
41whitelist ~/.local/share/qpdfview
42whitelist ~/.pentadactyl
43whitelist ~/.pentadactylrc
44whitelist ~/.pki
45whitelist ~/.vimperator
46whitelist ~/.vimperatorrc
47whitelist ~/.wine-pipelight
48whitelist ~/.wine-pipelight64
49whitelist ~/.zotero
50whitelist ~/dwhelper
51include /etc/firejail/whitelist-common.inc
52
53caps.drop all
54netfilter
55nodvd
56nogroups
57nonewprivs
58noroot
59notv
60protocol unix,inet,inet6,netlink
61seccomp
62shell none
63tracelog
64
65# private-bin cyberfox,which,sh,dbus-launch,dbus-send,env
66private-dev
67# private-dev might prevent video calls going out
68# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,xdg,gtk-2.0,gtk-3.0,X11,pango,fonts,cyberfox,mime.types,mailcap,asound.conf,pulse
69private-tmp
70
71noexec ${HOME}
72noexec /tmp
diff --git a/etc/darktable.profile b/etc/darktable.profile
deleted file mode 100644
index c2dc0b42c..000000000
--- a/etc/darktable.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for darktable
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/darktable.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/darktable
9noblacklist ~/.config/darktable
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29#private-bin darktable
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/default.profile b/etc/default.profile
deleted file mode 100644
index 82eded802..000000000
--- a/etc/default.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for default
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/default.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# generic gui profile
9# depending on your usage, you can enable some of the commands below:
10
11include /etc/firejail/disable-common.inc
12# include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17# ipc-namespace
18netfilter
19# no3d
20# nodvd
21# nogroups
22nonewprivs
23noroot
24# nosound
25# notv
26# novideo
27protocol unix,inet,inet6
28seccomp
29# shell none
30
31# disable-mnt
32# private
33# private-bin program
34# private-dev
35# private-etc none
36# private-lib
37# private-tmp
38
39# memory-deny-write-execute
40# noexec ${HOME}
41# noexec /tmp
diff --git a/etc/deluge.profile b/etc/deluge.profile
deleted file mode 100644
index c311d2fa7..000000000
--- a/etc/deluge.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for deluge
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/deluge.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/deluge
9
10include /etc/firejail/disable-common.inc
11# include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.config/deluge
16whitelist ${DOWNLOADS}
17whitelist ${HOME}/.config/deluge
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21netfilter
22nodvd
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31
32# deluge is using python on Debian
33# private-bin deluge,sh,python,uname
34private-dev
35private-tmp
diff --git a/etc/dex2jar.profile b/etc/dex2jar.profile
deleted file mode 100644
index bdbb10b12..000000000
--- a/etc/dex2jar.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for dex2jar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/dex2jar.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29private-bin dex2jar,dash,java,sh,bash,expr,dirname,ls,uname,grep
30private-dev
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/dia.profile b/etc/dia.profile
deleted file mode 100644
index 800c3bbf1..000000000
--- a/etc/dia.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for dia
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dia.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.dia
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29disable-mnt
30#private-bin dia
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/digikam.profile b/etc/digikam.profile
deleted file mode 100644
index ef518470e..000000000
--- a/etc/digikam.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for digikam
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/digikam.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/digikamrc
9noblacklist ${HOME}/.kde/share/apps/digikam
10noblacklist ${HOME}/.kde4/share/apps/digikam
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26protocol unix,inet,inet6,netlink
27seccomp
28# seccomp.keep fallocate,getrusage,openat,access,arch_prctl,bind,brk,chdir,chmod,clock_getres,clone,close,connect,dup2,dup3,eventfd2,execve,fadvise64,fcntl,fdatasync,flock,fstat,fstatfs,ftruncate,futex,getcwd,getdents,getegid,geteuid,getgid,getpeername,getpgrp,getpid,getppid,getrandom,getresgid,getresuid,getrlimit,getsockname,getsockopt,gettid,getuid,inotify_add_watch,inotify_init,inotify_init1,inotify_rm_watch,ioctl,lseek,lstat,madvise,mbind,memfd_create,mkdir,mmap,mprotect,msync,munmap,nanosleep,open,pipe,pipe2,poll,ppoll,prctl,pread64,pwrite64,read,readlink,readlinkat,recvfrom,recvmsg,rename,rt_sigaction,rt_sigprocmask,rt_sigreturn,sched_getaffinity,sched_getparam,sched_get_priority_max,sched_get_priority_min,sched_getscheduler,sched_setscheduler,sched_yield,sendmsg,sendto,setgid,setresgid,setresuid,set_robust_list,setsid,setsockopt,set_tid_address,setuid,shmat,shmctl,shmdt,shmget,shutdown,socket,stat,statfs,sysinfo,timerfd_create,umask,uname,unlink,wait4,waitid,write,writev,fchmod,fchown,unshare,exit,exit_group
29shell none
30
31# private-bin program
32# private-dev - prevents libdc1394 loading; this lib is used to connect to a camera device
33# private-etc none
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/dillo.profile b/etc/dillo.profile
deleted file mode 100644
index aa8a395e1..000000000
--- a/etc/dillo.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for dillo
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dillo.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.dillo
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.dillo
16mkdir ~/.fltk
17whitelist ${DOWNLOADS}
18whitelist ~/.dillo
19whitelist ~/.fltk
20include /etc/firejail/whitelist-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nonewprivs
26noroot
27notv
28protocol unix,inet,inet6
29seccomp
30tracelog
diff --git a/etc/dino.profile b/etc/dino.profile
deleted file mode 100644
index 72f4f40b2..000000000
--- a/etc/dino.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for dino
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dino.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/dino
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.local/share/dino
16whitelist ${HOME}/.local/share/dino
17whitelist ${HOME}/Downloads
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21netfilter
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix,inet,inet6
31seccomp
32shell none
33
34disable-mnt
35private-bin dino
36private-dev
37# private-etc fonts # breaks server connection
38private-tmp
39
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/disable-common.inc b/etc/disable-common.inc
deleted file mode 100644
index 021e6349e..000000000
--- a/etc/disable-common.inc
+++ /dev/null
@@ -1,316 +0,0 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include /etc/firejail/disable-common.local
4
5# History files in $HOME and clipboard managers
6blacklist-nolog ${HOME}/.*_history
7blacklist-nolog ${HOME}/.adobe
8blacklist-nolog ${HOME}/.cache/greenclip*
9blacklist-nolog ${HOME}/.history
10blacklist-nolog ${HOME}/.local/share/fish/fish_history
11blacklist-nolog ${HOME}/.macromedia
12blacklist-nolog /tmp/clipmenu*
13
14# X11 session autostart
15# blacklist ${HOME}/.xpra - this will kill --x11=xpra cmdline option for all programs
16blacklist ${HOME}/.Xsession
17blacklist ${HOME}/.config/autostart
18blacklist ${HOME}/.config/autostart-scripts
19blacklist ${HOME}/.config/lxsession/LXDE/autostart
20blacklist ${HOME}/.config/openbox/autostart
21blacklist ${HOME}/.config/openbox/environment
22blacklist ${HOME}/.config/plasma-workspace/env
23blacklist ${HOME}/.config/plasma-workspace/shutdown
24blacklist ${HOME}/.config/startupconfig
25blacklist ${HOME}/.fluxbox/startup
26blacklist ${HOME}/.gnomerc
27blacklist ${HOME}/.kde/Autostart
28blacklist ${HOME}/.kde/env
29blacklist ${HOME}/.kde/share/autostart
30blacklist ${HOME}/.kde/share/config/startupconfig
31blacklist ${HOME}/.kde/shutdown
32blacklist ${HOME}/.kde4/env
33blacklist ${HOME}/.kde4/Autostart
34blacklist ${HOME}/.kde4/share/autostart
35blacklist ${HOME}/.kde4/shutdown
36blacklist ${HOME}/.kde4/share/config/startupconfig
37blacklist ${HOME}/.local/share/autostart
38blacklist ${HOME}/.xinitrc
39blacklist ${HOME}/.xprofile
40blacklist ${HOME}/.xserverrc
41blacklist ${HOME}/.xsession
42blacklist ${HOME}/.xsessionrc
43blacklist /etc/X11/Xsession.d
44blacklist /etc/xdg/autostart
45
46# KDE config
47blacklist ${HOME}/.config/*.notifyrc
48blacklist ${HOME}/.config/khotkeysrc
49blacklist ${HOME}/.config/krunnerrc
50blacklist ${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc
51blacklist ${HOME}/.kde/share/apps/konsole
52blacklist ${HOME}/.kde/share/apps/kwin
53blacklist ${HOME}/.kde/share/apps/plasma
54blacklist ${HOME}/.kde/share/apps/solid
55blacklist ${HOME}/.kde/share/config/*.notifyrc
56blacklist ${HOME}/.kde/share/config/khotkeysrc
57blacklist ${HOME}/.kde/share/config/krunnerrc
58blacklist ${HOME}/.kde/share/config/plasma-desktop-appletsrc
59blacklist ${HOME}/.kde4/share/apps/plasma
60blacklist ${HOME}/.kde4/share/apps/konsole
61blacklist ${HOME}/.kde4/share/apps/kwin
62blacklist ${HOME}/.kde4/share/config/krunnerrc
63blacklist ${HOME}/.kde4/share/config/plasma-desktop-appletsrc
64blacklist ${HOME}/.kde4/share/config/khotkeysrc
65blacklist ${HOME}/.kde4/share/apps/solid
66blacklist ${HOME}/.kde4/share/config/*.notifyrc
67blacklist ${HOME}/.local/share/kglobalaccel
68blacklist ${HOME}/.local/share/konsole
69blacklist ${HOME}/.local/share/kwin
70blacklist ${HOME}/.local/share/plasma
71blacklist ${HOME}/.local/share/solid
72read-only ${HOME}/.config/kdeglobals
73read-only ${HOME}/.kde/share/config/kdeglobals
74read-only ${HOME}/.kde/share/kde4/services
75read-only ${HOME}/.kde4/share/kde4/services
76read-only ${HOME}/.kde4/share/config/kdeglobals
77read-only ${HOME}/.local/share/kservices5
78
79# systemd
80blacklist ${HOME}/.config/systemd
81blacklist ${HOME}/.local/share/systemd
82blacklist /var/lib/systemd
83# blacklist /var/run/systemd
84# - creates problems on Arch where /etc/resolv.conf is a symlink to /var/run/systemd/resolve/resolv.conf
85
86# VirtualBox
87blacklist ${HOME}/.VirtualBox
88blacklist ${HOME}/.config/VirtualBox
89blacklist ${HOME}/VirtualBox VMs
90
91# VeraCrypt
92blacklist ${HOME}/.VeraCrypt
93blacklist ${PATH}/veracrypt
94blacklist ${PATH}/veracrypt-uninstall.sh
95blacklist /usr/share/applications/veracrypt.*
96blacklist /usr/share/pixmaps/veracrypt.*
97blacklist /usr/share/veracrypt
98
99# TrueCrypt
100blacklist ${HOME}/.TrueCrypt
101blacklist ${PATH}/truecrypt
102blacklist ${PATH}/truecrypt-uninstall.sh
103blacklist /usr/share/applications/truecrypt.*
104blacklist /usr/share/pixmaps/truecrypt.*
105blacklist /usr/share/truecrypt
106
107# zuluCrypt
108blacklist ${HOME}/.zuluCrypt
109blacklist ${HOME}/.zuluCrypt-socket
110blacklist ${PATH}/zuluCrypt-cli
111blacklist ${PATH}/zuluMount-cli
112
113# var
114blacklist /var/cache/apt
115blacklist /var/cache/pacman
116blacklist /var/lib/apt
117blacklist /var/lib/clamav
118blacklist /var/lib/dkms
119blacklist /var/lib/mysql/mysql.sock
120blacklist /var/lib/mysqld/mysql.sock
121blacklist /var/lib/pacman
122blacklist /var/lib/upower
123# blacklist /var/log - a virtual /var/log directory (mostly empty) is buid up by default for
124# every sandbox, unless --writeble-var-log switch is activated
125blacklist /var/mail
126blacklist /var/opt
127blacklist /var/run/acpid.socket
128blacklist /var/run/docker.sock
129blacklist /var/run/minissdpd.sock
130blacklist /var/run/mysql/mysqld.sock
131blacklist /var/run/mysqld/mysqld.sock
132blacklist /var/run/rpcbind.sock
133blacklist /var/run/screens
134blacklist /var/spool/anacron
135blacklist /var/spool/cron
136blacklist /var/spool/mail
137
138# etc
139blacklist /etc/anacrontab
140blacklist /etc/cron*
141blacklist /etc/profile.d
142blacklist /etc/rc.local
143
144# Startup files
145read-only ${HOME}/.antigen
146read-only ${HOME}/.bash_aliases
147read-only ${HOME}/.bash_login
148read-only ${HOME}/.bash_logout
149read-only ${HOME}/.bash_profile
150read-only ${HOME}/.bashrc
151read-only ${HOME}/.config/fish
152read-only ${HOME}/.csh_files
153read-only ${HOME}/.cshrc
154read-only ${HOME}/.forward
155read-only ${HOME}/.local/share/fish
156read-only ${HOME}/.login
157read-only ${HOME}/.logout
158read-only ${HOME}/.pam_environment
159read-only ${HOME}/.pgpkey
160read-only ${HOME}/.plan
161read-only ${HOME}/.profile
162read-only ${HOME}/.project
163read-only ${HOME}/.tcshrc
164read-only ${HOME}/.zlogin
165read-only ${HOME}/.zlogout
166read-only ${HOME}/.zprofile
167read-only ${HOME}/.zsh.d
168read-only ${HOME}/.zsh_files
169read-only ${HOME}/.zshenv
170read-only ${HOME}/.zshrc
171read-only ${HOME}/.zshrc.local
172
173# Initialization files that allow arbitrary command execution
174read-only ${HOME}/.caffrc
175read-only ${HOME}/.dotfiles
176read-only ${HOME}/.emacs
177read-only ${HOME}/.emacs.d
178read-only ${HOME}/.exrc
179read-only ${HOME}/.gvimrc
180read-only ${HOME}/.iscreenrc
181read-only ${HOME}/.mailcap
182read-only ${HOME}/.msmtprc
183read-only ${HOME}/.mutt/muttrc
184read-only ${HOME}/.muttrc
185read-only ${HOME}/.nano
186read-only ${HOME}/.reportbugrc
187read-only ${HOME}/.tmux.conf
188read-only ${HOME}/.vim
189read-only ${HOME}/.vimrc
190read-only ${HOME}/.xmonad
191read-only ${HOME}/.xscreensaver
192read-only ${HOME}/_exrc
193read-only ${HOME}/_gvimrc
194read-only ${HOME}/_vimrc
195read-only ${HOME}/dotfiles
196
197# Make directories commonly found in $PATH read-only
198read-only ${HOME}/.gem
199read-only ${HOME}/.luarocks
200read-only ${HOME}/.npm-packages
201read-only ${HOME}/bin
202
203# The following block breaks trash functionality in file managers
204#read-only ${HOME}/.local
205#read-write ${HOME}/.local/share
206#noexec ${HOME}/.local/share
207blacklist ${HOME}/.local/share/Trash
208
209# Write-protection for desktop entries
210read-only ${HOME}/.local/share/applications
211
212# top secret
213blacklist ${HOME}/*.kdb
214blacklist ${HOME}/*.kdbx
215blacklist ${HOME}/*.key
216blacklist ${HOME}/.Private
217blacklist ${HOME}/.caff
218blacklist ${HOME}/.cert
219blacklist ${HOME}/.config/keybase
220blacklist ${HOME}/.ecryptfs
221blacklist ${HOME}/.gnome2/keyrings
222blacklist ${HOME}/.gnupg
223blacklist ${HOME}/.kde/share/apps/kwallet
224blacklist ${HOME}/.kde4/share/apps/kwallet
225blacklist ${HOME}/.local/share/keyrings
226blacklist ${HOME}/.local/share/kwalletd
227blacklist ${HOME}/.msmtprc
228blacklist ${HOME}/.mutt/muttrc
229blacklist ${HOME}/.muttrc
230blacklist ${HOME}/.netrc
231blacklist ${HOME}/.pki
232blacklist ${HOME}/.smbcredentials
233blacklist ${HOME}/.ssh
234blacklist /etc/group+
235blacklist /etc/group-
236blacklist /etc/gshadow
237blacklist /etc/gshadow+
238blacklist /etc/gshadow-
239blacklist /etc/passwd+
240blacklist /etc/passwd-
241blacklist /etc/shadow
242blacklist /etc/shadow+
243blacklist /etc/shadow-
244blacklist /etc/ssh
245blacklist /home/.ecryptfs
246blacklist /var/backup
247
248# system directories
249blacklist /sbin
250blacklist /usr/local/sbin
251blacklist /usr/sbin
252
253# system management
254blacklist ${PATH}/at
255blacklist ${PATH}/chage
256blacklist ${PATH}/chfn
257blacklist ${PATH}/chsh
258blacklist ${PATH}/crontab
259blacklist ${PATH}/evtest
260blacklist ${PATH}/expiry
261blacklist ${PATH}/fusermount
262blacklist ${PATH}/gpasswd
263blacklist ${PATH}/ksu
264blacklist ${PATH}/mount
265blacklist ${PATH}/mount.ecryptfs_private
266blacklist ${PATH}/nc
267blacklist ${PATH}/ncat
268blacklist ${PATH}/newgidmap
269blacklist ${PATH}/newgrp
270blacklist ${PATH}/newuidmap
271blacklist ${PATH}/ntfs-3g
272blacklist ${PATH}/pkexec
273blacklist ${PATH}/procmail
274blacklist ${PATH}/sg
275blacklist ${PATH}/strace
276blacklist ${PATH}/su
277blacklist ${PATH}/sudo
278blacklist ${PATH}/umount
279blacklist ${PATH}/unix_chkpwd
280blacklist ${PATH}/xev
281blacklist ${PATH}/xinput
282
283# other SUID binaries
284blacklist /usr/lib/virtualbox
285blacklist /usr/lib64/virtualbox
286
287# prevent lxterminal connecting to an existing lxterminal session
288blacklist /tmp/.lxterminal-socket*
289# prevent tmux connecting to an existing session
290blacklist /tmp/tmux-*
291
292# disable terminals running as server resulting in sandbox escape
293blacklist ${PATH}/lxterminal
294blacklist ${PATH}/gnome-terminal
295blacklist ${PATH}/gnome-terminal.wrapper
296blacklist ${PATH}/lilyterm
297blacklist ${PATH}/mate-terminal
298blacklist ${PATH}/mate-terminal.wrapper
299blacklist ${PATH}/pantheon-terminal
300blacklist ${PATH}/roxterm
301blacklist ${PATH}/roxterm-config
302blacklist ${PATH}/terminix
303blacklist ${PATH}/tilix
304blacklist ${PATH}/urxvtc
305blacklist ${PATH}/urxvtcd
306blacklist ${PATH}/xfce4-terminal
307blacklist ${PATH}/xfce4-terminal.wrapper
308# blacklist ${PATH}/konsole
309# konsole doesn't seem to have this problem - last tested on Ubuntu 16.04
310
311# kernel files
312blacklist /initrd*
313blacklist /vmlinuz*
314
315# complement noexec ${HOME} and noexec /tmp
316noexec /tmp/.X11-unix
diff --git a/etc/disable-devel.inc b/etc/disable-devel.inc
deleted file mode 100644
index 9ff58ae2a..000000000
--- a/etc/disable-devel.inc
+++ /dev/null
@@ -1,81 +0,0 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include /etc/firejail/disable-devel.local
4
5# development tools
6
7# GCC
8#blacklist /usr/lib/gcc - seems to create problems on Gentoo
9blacklist /usr/bin/as
10blacklist /usr/bin/c++*
11blacklist /usr/bin/c8*
12blacklist /usr/bin/c9*
13blacklist /usr/bin/cpp*
14blacklist /usr/bin/g++*
15blacklist /usr/bin/gcc*
16blacklist /usr/bin/gdb
17blacklist /usr/bin/ld
18blacklist /usr/bin/x86_64-unknown-linux-gnu-gcc*
19blacklist /usr/bin/x86_64-linux-gnu-g++*
20blacklist /usr/bin/x86_64-linux-gnu-gcc*
21blacklist /usr/bin/x86_64-unknown-linux-gnu-g++*
22blacklist /usr/include
23
24# clang/llvm
25blacklist /usr/bin/clang*
26blacklist /usr/bin/lldb*
27blacklist /usr/bin/llvm*
28blacklist /usr/lib/llvm*
29
30# tcc - Tiny C Compiler
31blacklist /usr/bin/tcc
32blacklist /usr/bin/x86_64-tcc
33blacklist /usr/lib/tcc
34
35# Valgrind
36blacklist /usr/bin/valgrind*
37blacklist /usr/lib/valgrind
38
39# Perl
40blacklist /usr/bin/cpan*
41blacklist /usr/bin/perl
42blacklist /usr/lib/perl*
43blacklist /usr/share/perl*
44
45# PHP
46blacklist /usr/bin/php*
47blacklist /usr/lib/php*
48blacklist /usr/share/php*
49
50# Ruby
51blacklist /usr/bin/ruby
52blacklist /usr/lib/ruby
53
54# Programs using python: deluge, firefox addons, filezilla, cherrytree, xchat, hexchat, libreoffice, scribus
55# Python 2
56#blacklist /usr/bin/python2*
57#blacklist /usr/include/python2*
58#blacklist /usr/lib/python2*
59#blacklist /usr/local/lib/python2*
60#blacklist /usr/share/python2*
61#
62# Python 3
63#blacklist /usr/bin/python3*
64#blacklist /usr/include/python3*
65#blacklist /usr/lib/python3*
66#blacklist /usr/local/lib/python3*
67#blacklist /usr/share/python3*
68
69#Go
70blacklist /usr/bin/gccgo
71blacklist /usr/bin/go
72blacklist /usr/bin/gofmt
73
74#Rust
75blacklist /usr/bin/rust-gdb
76blacklist /usr/bin/rust-lldb
77blacklist /usr/bin/rustc
78
79#OpenSSL
80blacklist /usr/bin/openssl
81blacklist /usr/bin/openssl-1.0
diff --git a/etc/disable-passwdmgr.inc b/etc/disable-passwdmgr.inc
deleted file mode 100644
index 9507d3feb..000000000
--- a/etc/disable-passwdmgr.inc
+++ /dev/null
@@ -1,15 +0,0 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include /etc/firejail/disable-passwdmgr.local
4
5blacklist ${HOME}/.config/KeePass
6blacklist ${HOME}/.config/keepass
7blacklist ${HOME}/.config/keepassx
8blacklist ${HOME}/.config/keepassxc
9blacklist ${HOME}/.keepass
10blacklist ${HOME}/.keepassx
11blacklist ${HOME}/.keepassxc
12blacklist ${HOME}/.lastpass
13blacklist ${HOME}/.local/share/KeePass
14blacklist ${HOME}/.local/share/keepass
15blacklist ${HOME}/.password-store
diff --git a/etc/disable-programs.inc b/etc/disable-programs.inc
deleted file mode 100644
index 064e60294..000000000
--- a/etc/disable-programs.inc
+++ /dev/null
@@ -1,456 +0,0 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include /etc/firejail/disable-programs.local
4
5blacklist ${HOME}/.*coin
6blacklist ${HOME}/.8pecxstudios
7blacklist ${HOME}/.AndroidStudio*
8blacklist ${HOME}/.Atom
9blacklist ${HOME}/.FBReader
10blacklist ${HOME}/.FontForge
11blacklist ${HOME}/.IdeaIC*
12blacklist ${HOME}/.LuminanceHDR
13blacklist ${HOME}/.Mathematica
14blacklist ${HOME}/.Natron
15blacklist ${HOME}/.Skype
16blacklist ${HOME}/.Steam
17blacklist ${HOME}/.Steampath
18blacklist ${HOME}/.Steampid
19blacklist ${HOME}/.TelegramDesktop
20blacklist ${HOME}/.ViberPC
21blacklist ${HOME}/.VirtualBox
22blacklist ${HOME}/.Wolfram Research
23blacklist ${HOME}/.aMule
24blacklist ${HOME}/.android
25blacklist ${HOME}/.arduino15
26blacklist ${HOME}/.atom
27blacklist ${HOME}/.attic
28blacklist ${HOME}/.audacity-data
29blacklist ${HOME}/.bcast5
30blacklist ${HOME}/.bibletime
31blacklist ${HOME}/.claws-mail
32blacklist ${HOME}/.config/0ad
33blacklist ${HOME}/.config/2048-qt
34blacklist ${HOME}/.config/Atom
35blacklist ${HOME}/.config/Audaciousrc
36blacklist ${HOME}/.config/Brackets
37blacklist ${HOME}/.config/Clementine
38blacklist ${HOME}/.config/Cryptocat
39blacklist ${HOME}/.config/Franz
40blacklist ${HOME}/.config/FreeCAD
41blacklist ${HOME}/.config/Gitter
42blacklist ${HOME}/.config/Google
43blacklist ${HOME}/.config/Gpredict
44blacklist ${HOME}/.config/INRIA
45blacklist ${HOME}/.config/InSilmaril
46blacklist ${HOME}/.config/Luminance
47blacklist ${HOME}/.config/Meltytech
48blacklist ${HOME}/.config/Mousepad
49blacklist ${HOME}/.config/Mumble
50blacklist ${HOME}/.config/MusE
51blacklist ${HOME}/.config/MuseScore
52blacklist ${HOME}/.config/Nylas Mail
53blacklist ${HOME}/.config/Qlipper
54blacklist ${HOME}/.config/QuiteRss
55blacklist ${HOME}/.config/QuiteRssrc
56blacklist ${HOME}/.config/Riot
57blacklist ${HOME}/.config/Rocket.Chat
58blacklist ${HOME}/.config/Slack
59blacklist ${HOME}/.config/Thunar
60blacklist ${HOME}/.config/VirtualBox
61blacklist ${HOME}/.config/Wire
62blacklist ${HOME}/.config/akregatorrc
63blacklist ${HOME}/.config/ardour4
64blacklist ${HOME}/.config/ardour5
65blacklist ${HOME}/.config/arkrc
66blacklist ${HOME}/.config/atril
67blacklist ${HOME}/.config/audacious
68blacklist ${HOME}/.config/aweather
69blacklist ${HOME}/.config/baloofilerc
70blacklist ${HOME}/.config/baloorc
71blacklist ${HOME}/.config/blender
72blacklist ${HOME}/.config/bless
73blacklist ${HOME}/.config/borg
74blacklist ${HOME}/.config/brasero
75blacklist ${HOME}/.config/brave
76blacklist ${HOME}/.config/caja
77blacklist ${HOME}/.config/calibre
78blacklist ${HOME}/.config/catfish
79blacklist ${HOME}/.config/cherrytree
80blacklist ${HOME}/.config/chromium
81blacklist ${HOME}/.config/chromium-dev
82blacklist ${HOME}/.config/chromium-flags.conf
83blacklist ${HOME}/.config/clipit
84blacklist ${HOME}/.config/cliqz
85blacklist ${HOME}/.config/cmus
86blacklist ${HOME}/.config/corebird
87blacklist ${HOME}/.config/darktable
88blacklist ${HOME}/.config/deadbeef
89blacklist ${HOME}/.config/deluge
90blacklist ${HOME}/.config/digikam
91blacklist ${HOME}/.config/dolphinrc
92blacklist ${HOME}/.config/dragonplayerrc
93blacklist ${HOME}/.config/enchant
94blacklist ${HOME}/.config/eog
95blacklist ${HOME}/.config/epiphany
96blacklist ${HOME}/.config/evince
97blacklist ${HOME}/.config/evolution
98blacklist ${HOME}/.config/filezilla
99blacklist ${HOME}/.config/flowblade
100blacklist ${HOME}/.config/gajim
101blacklist ${HOME}/.config/galculator
102blacklist ${HOME}/.config/geany
103blacklist ${HOME}/.config/gedit
104blacklist ${HOME}/.config/geeqie
105blacklist ${HOME}/.config/ghb
106blacklist ${HOME}/.config/globaltime
107blacklist ${HOME}/.config/google-chrome
108blacklist ${HOME}/.config/google-chrome-beta
109blacklist ${HOME}/.config/google-chrome-unstable
110blacklist ${HOME}/.config/gpicview
111blacklist ${HOME}/.config/gthumb
112blacklist ${HOME}/.config/gwenviewrc
113blacklist ${HOME}/.config/hexchat
114blacklist ${HOME}/.config/inox
115blacklist ${HOME}/.config/itch
116blacklist ${HOME}/.config/jd-gui.cfg
117blacklist ${HOME}/.config/k3brc
118blacklist ${HOME}/.config/katepartrc
119blacklist ${HOME}/.config/katerc
120blacklist ${HOME}/.config/kateschemarc
121blacklist ${HOME}/.config/katesyntaxhighlightingrc
122blacklist ${HOME}/.config/katevirc
123blacklist ${HOME}/.config/kdeconnect
124blacklist ${HOME}/.config/knotesrc
125blacklist ${HOME}/.config/ktorrentrc
126blacklist ${HOME}/.config/leafpad
127blacklist ${HOME}/.config/libreoffice
128blacklist ${HOME}/.config/lximage-qt
129blacklist ${HOME}/.config/mate-calc
130blacklist ${HOME}/.config/mate/eom
131blacklist ${HOME}/.config/mate/mate-dictionary
132blacklist ${HOME}/.config/mfusion
133blacklist ${HOME}/.config/midori
134blacklist ${HOME}/.config/mpv
135blacklist ${HOME}/.config/mupen64plus
136blacklist ${HOME}/.config/nautilus
137blacklist ${HOME}/.config/nemo
138blacklist ${HOME}/.config/netsurf
139blacklist ${HOME}/.config/okularpartrc
140blacklist ${HOME}/.config/okularrc
141blacklist ${HOME}/.config/opera
142blacklist ${HOME}/.config/opera-beta
143blacklist ${HOME}/.config/orage
144blacklist ${HOME}/.config/org.kde.gwenviewrc
145blacklist ${HOME}/.config/pcmanfm
146blacklist ${HOME}/.config/pdfmod
147blacklist ${HOME}/.config/Pinta
148blacklist ${HOME}/.config/pix
149blacklist ${HOME}/.config/pluma
150blacklist ${HOME}/.config/psi+
151blacklist ${HOME}/.config/qBittorrent
152blacklist ${HOME}/.config/qBittorrentrc
153blacklist ${HOME}/.config/qpdfview
154blacklist ${HOME}/.config/qt5ct
155blacklist ${HOME}/.config/qupzilla
156blacklist ${HOME}/.config/qutebrowser
157blacklist ${HOME}/.config/ranger
158blacklist ${HOME}/.config/redshift.conf
159blacklist ${HOME}/.config/ristretto
160blacklist ${HOME}/.config/scribus
161blacklist ${HOME}/.config/skypeforlinux
162blacklist ${HOME}/.config/slimjet
163blacklist ${HOME}/.config/smplayer
164blacklist ${HOME}/.config/spotify
165blacklist ${HOME}/.config/stellarium
166blacklist ${HOME}/.config/synfig
167blacklist ${HOME}/.config/telepathy-account-widgets
168blacklist ${HOME}/.config/torbrowser
169blacklist ${HOME}/.config/totem
170blacklist ${HOME}/.config/tox
171blacklist ${HOME}/.config/transmission
172blacklist ${HOME}/.config/uGet
173blacklist ${HOME}/.config/viewnior
174blacklist ${HOME}/.config/vivaldi
175blacklist ${HOME}/.config/vlc
176blacklist ${HOME}/.config/wesnoth
177blacklist ${HOME}/.config/wire
178blacklist ${HOME}/.config/wireshark
179blacklist ${HOME}/.config/xchat
180blacklist ${HOME}/.config/xed
181blacklist ${HOME}/.config/xfburn
182blacklist ${HOME}/.config/xfce4/xfce4-notes.gtkrc
183blacklist ${HOME}/.config/xfce4/xfce4-notes.rc
184blacklist ${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
185blacklist ${HOME}/.config/xfce4-dict
186blacklist ${HOME}/.config/xiaoyong
187blacklist ${HOME}/.config/xmms2
188blacklist ${HOME}/.config/xplayer
189blacklist ${HOME}/.config/xreader
190blacklist ${HOME}/.config/xviewer
191blacklist ${HOME}/.config/yandex-browser
192blacklist ${HOME}/.config/yandex-browser-beta
193blacklist ${HOME}/.config/zathura
194blacklist ${HOME}/.config/zoomus.conf
195blacklist ${HOME}/.conkeror.mozdev.org
196blacklist ${HOME}/.curlrc
197blacklist ${HOME}/.dia
198blacklist ${HOME}/.dillo
199blacklist ${HOME}/.dooble
200blacklist ${HOME}/.dosbox
201blacklist ${HOME}/.dropbox-dist
202blacklist ${HOME}/.electrum*
203blacklist ${HOME}/.elinks
204blacklist ${HOME}/.emacs
205blacklist ${HOME}/.emacs
206blacklist ${HOME}/.emacs.d
207blacklist ${HOME}/.etr
208blacklist ${HOME}/.filezilla
209blacklist ${HOME}/.flowblade
210blacklist ${HOME}/.fltk
211blacklist ${HOME}/.frozen-bubble
212blacklist ${HOME}/.gimp*
213blacklist ${HOME}/.git-credential-cache
214blacklist ${HOME}/.gitconfig
215blacklist ${HOME}/.googleearth/Cache/
216blacklist ${HOME}/.googleearth/Temp/
217blacklist ${HOME}/.googleearth/myplaces.backup.kml
218blacklist ${HOME}/.googleearth/myplaces.kml
219blacklist ${HOME}/.gradle
220blacklist ${HOME}/.guayadeque
221blacklist ${HOME}/.hedgewars
222blacklist ${HOME}/.hugin
223blacklist ${HOME}/.icedove
224blacklist ${HOME}/.imagej
225blacklist ${HOME}/.inkscape
226blacklist ${HOME}/.jack-server
227blacklist ${HOME}/.jack-settings
228blacklist ${HOME}/.java
229blacklist ${HOME}/.jitsi
230blacklist ${HOME}/.kde/share/apps/gwenview
231blacklist ${HOME}/.kde/share/apps/kcookiejar
232blacklist ${HOME}/.kde/share/apps/khtml
233blacklist ${HOME}/.kde/share/apps/konqsidebartng
234blacklist ${HOME}/.kde/share/apps/konqueror
235blacklist ${HOME}/.kde/share/apps/okular
236blacklist ${HOME}/.kde/share/config/baloofilerc
237blacklist ${HOME}/.kde/share/config/baloorc
238blacklist ${HOME}/.kde/share/config/digikam
239blacklist ${HOME}/.kde/share/config/gwenviewrc
240blacklist ${HOME}/.kde/share/config/k3brc
241blacklist ${HOME}/.kde/share/config/kcookiejarrc
242blacklist ${HOME}/.kde/share/config/khtmlrc
243blacklist ${HOME}/.kde/share/config/konq_history
244blacklist ${HOME}/.kde/share/config/konqsidebartngrc
245blacklist ${HOME}/.kde/share/config/konquerorrc
246blacklist ${HOME}/.kde/share/config/ktorrentrc
247blacklist ${HOME}/.kde/share/config/okularpartrc
248blacklist ${HOME}/.kde/share/config/okularrc
249blacklist ${HOME}/.kde4/share/config/baloorc
250blacklist ${HOME}/.kde4/share/config/baloofilerc
251blacklist ${HOME}/.kde4/share/apps/okular
252blacklist ${HOME}/.kde4/share/apps/konqueror
253blacklist ${HOME}/.kde4/share/apps/konqsidebartng
254blacklist ${HOME}/.kde4/share/apps/khtml
255blacklist ${HOME}/.kde4/share/apps/kcookiejar
256blacklist ${HOME}/.kde4/share/config/digikam
257blacklist ${HOME}/.kde4/share/apps/gwenview
258blacklist ${HOME}/.kde4/share/config/kcookiejarrc
259blacklist ${HOME}/.kde4/share/config/khtmlrc
260blacklist ${HOME}/.kde4/share/config/konq_history
261blacklist ${HOME}/.kde4/share/config/konqsidebartngrc
262blacklist ${HOME}/.kde4/share/config/konquerorrc
263blacklist ${HOME}/.kde4/share/config/okularpartrc
264blacklist ${HOME}/.kde4/share/config/okularrc
265blacklist ${HOME}/.kde4/share/config/ktorrentrc
266blacklist ${HOME}/.kde4/share/config/gwenviewrc
267blacklist ${HOME}/.kde4/share/config/k3brc
268blacklist ${HOME}/.killingfloor
269blacklist ${HOME}/.kino-history
270blacklist ${HOME}/.kinorc
271blacklist ${HOME}/.kodi
272blacklist ${HOME}/.linphone-history.db
273blacklist ${HOME}/.linphonerc
274blacklist ${HOME}/.lmmsrc.xml
275blacklist ${HOME}/.local/.share/maps-places.json
276blacklist ${HOME}/.local/lib/python2.7/site-packages
277blacklist ${HOME}/.local/share/0ad
278blacklist ${HOME}/.local/share/3909/PapersPlease
279blacklist ${HOME}/.local/share/Empathy
280blacklist ${HOME}/.local/share/JetBrains
281blacklist ${HOME}/.local/share/Mumble
282blacklist ${HOME}/.local/share/QuiteRss
283blacklist ${HOME}/.local/share/Ricochet
284blacklist ${HOME}/.local/share/Steam
285blacklist ${HOME}/.local/share/SuperHexagon
286blacklist ${HOME}/.local/share/Terraria
287blacklist ${HOME}/.local/share/TpLogger
288blacklist ${HOME}/.local/share/akregator
289blacklist ${HOME}/.local/share/aspyr-media
290blacklist ${HOME}/.local/share/baloo
291blacklist ${HOME}/.local/share/caja-python
292blacklist ${HOME}/.local/share/cdprojektred
293blacklist ${HOME}/.local/share/clipit
294blacklist ${HOME}/.local/share/data/Mumble
295blacklist ${HOME}/.local/share/data/MusE
296blacklist ${HOME}/.local/share/data/MuseScore
297blacklist ${HOME}/.local/share/dino
298blacklist ${HOME}/.local/share/dolphin
299blacklist ${HOME}/.local/share/epiphany
300blacklist ${HOME}/.local/share/evolution
301blacklist ${HOME}/.local/share/feral-interactive
302blacklist ${HOME}/.local/share/gajim
303blacklist ${HOME}/.local/share/geary
304blacklist ${HOME}/.local/share/geeqie
305blacklist ${HOME}/.local/share/gnome-2048
306blacklist ${HOME}/.local/share/gnome-chess
307blacklist ${HOME}/.local/share/gnome-music
308blacklist ${HOME}/.local/share/gnome-photos
309blacklist ${HOME}/.local/share/gwenview
310blacklist ${HOME}/.local/share/kate
311blacklist ${HOME}/.local/share/ktorrentrc
312blacklist ${HOME}/.local/share/kwrite
313blacklist ${HOME}/.local/share/lollypop
314blacklist ${HOME}/.local/share/meld
315blacklist ${HOME}/.local/share/multimc
316blacklist ${HOME}/.local/share/multimc5
317blacklist ${HOME}/.local/share/mupen64plus
318blacklist ${HOME}/.local/share/nautilus
319blacklist ${HOME}/.local/share/nautilus-python
320blacklist ${HOME}/.local/share/nemo
321blacklist ${HOME}/.local/share/nemo-python
322blacklist ${HOME}/.local/share/notes
323blacklist ${HOME}/.local/share/okular
324blacklist ${HOME}/.local/share/orage
325blacklist ${HOME}/.local/share/org.kde.gwenview
326blacklist ${HOME}/.local/share/pix
327blacklist ${HOME}/.local/share/psi+
328blacklist ${HOME}/.local/share/qpdfview
329blacklist ${HOME}/.local/share/scribus
330blacklist ${HOME}/.local/share/spotify
331blacklist ${HOME}/.local/share/steam
332blacklist ${HOME}/.local/share/supertux2
333blacklist ${HOME}/.local/share/telepathy
334blacklist ${HOME}/.local/share/terasology
335blacklist ${HOME}/.local/share/torbrowser
336blacklist ${HOME}/.local/share/totem
337blacklist ${HOME}/.local/share/vpltd
338blacklist ${HOME}/.local/share/vulkan
339blacklist ${HOME}/.local/share/wesnoth
340blacklist ${HOME}/.local/share/xplayer
341blacklist ${HOME}/.local/share/xreader
342blacklist ${HOME}/.local/share/zathura
343blacklist ${HOME}/.lv2
344blacklist ${HOME}/.mcabber
345blacklist ${HOME}/.mcabberrc
346blacklist ${HOME}/.mediathek3
347blacklist ${HOME}/.minetest
348blacklist ${HOME}/.mozilla
349blacklist ${HOME}/.mpdconf
350blacklist ${HOME}/.mplayer
351blacklist ${HOME}/.msmtprc
352blacklist ${HOME}/.multimc5
353blacklist ${HOME}/.mutt
354blacklist ${HOME}/.mutt/muttrc
355blacklist ${HOME}/.muttrc
356blacklist ${HOME}/.neverball
357blacklist ${HOME}/.nv
358blacklist ${HOME}/.nylas-mail
359blacklist ${HOME}/.openinvaders
360blacklist ${HOME}/.openshot
361blacklist ${HOME}/.openshot_qt
362blacklist ${HOME}/.opera
363blacklist ${HOME}/.opera-beta
364blacklist ${HOME}/.pingus
365blacklist ${HOME}/.purple
366blacklist ${HOME}/.qemu-launcher
367blacklist ${HOME}/.remmina
368blacklist ${HOME}/.repo_.gitconfig.json
369blacklist ${HOME}/.repoconfig
370blacklist ${HOME}/.retroshare
371blacklist ${HOME}/.scribus
372blacklist ${HOME}/.scribusrc
373blacklist ${HOME}/.simutrans
374blacklist ${HOME}/.steam
375blacklist ${HOME}/.steampath
376blacklist ${HOME}/.steampid
377blacklist ${HOME}/.stellarium
378blacklist ${HOME}/.subversion
379blacklist ${HOME}/.surf
380blacklist ${HOME}/.sword
381blacklist ${HOME}/.sylpheed-2.0
382blacklist ${HOME}/.synfig
383blacklist ${HOME}/.tconn
384blacklist ${HOME}/.thunderbird
385blacklist ${HOME}/.tooling
386blacklist ${HOME}/.tor-browser-en
387blacklist ${HOME}/.ts3client
388blacklist ${HOME}/.tuxguitar*
389blacklist ${HOME}/.unknow-horizons
390blacklist ${HOME}/.viking
391blacklist ${HOME}/.viking-maps
392blacklist ${HOME}/.vst
393blacklist ${HOME}/.w3m
394blacklist ${HOME}/.warzone2100-3.*
395blacklist ${HOME}/.weechat
396blacklist ${HOME}/.wgetrc
397blacklist ${HOME}/.wine
398blacklist ${HOME}/.wine64
399blacklist ${HOME}/.xiphos
400blacklist ${HOME}/.xmms
401blacklist ${HOME}/.xonotic
402blacklist ${HOME}/.xpdfrc
403blacklist ${HOME}/.zoom
404blacklist ${HOME}/wallet.dat
405blacklist /tmp/ssh-*
406
407# ~/.cache directory
408blacklist ${HOME}/.cache/0ad
409blacklist ${HOME}/.cache/8pecxstudios
410blacklist ${HOME}/.cache/Franz
411blacklist ${HOME}/.cache/INRIA
412blacklist ${HOME}/.cache/QuiteRss
413blacklist ${HOME}/.cache/attic
414blacklist ${HOME}/.cache/borg
415blacklist ${HOME}/.cache/calibre
416blacklist ${HOME}/.cache/champlain
417blacklist ${HOME}/.cache/chromium
418blacklist ${HOME}/.cache/chromium-dev
419blacklist ${HOME}/.cache/cliqz
420blacklist ${HOME}/.cache/darktable
421blacklist ${HOME}/.cache/epiphany
422blacklist ${HOME}/.cache/evolution
423blacklist ${HOME}/.cache/gajim
424blacklist ${HOME}/.cache/geeqie
425blacklist ${HOME}/.cache/google-chrome
426blacklist ${HOME}/.cache/google-chrome-beta
427blacklist ${HOME}/.cache/google-chrome-unstable
428blacklist ${HOME}/.cache/icedove
429blacklist ${HOME}/.cache/INRIA/Natron
430blacklist ${HOME}/.cache/inox
431blacklist ${HOME}/.cache/libgweather
432blacklist ${HOME}/.cache/midori
433blacklist ${HOME}/.cache/mozilla
434blacklist ${HOME}/.cache/mutt
435blacklist ${HOME}/.cache/netsurf
436blacklist ${HOME}/.cache/opera
437blacklist ${HOME}/.cache/opera-beta
438blacklist ${HOME}/.cache/org.gnome.Books
439blacklist ${HOME}/.cache/pdfmod
440blacklist ${HOME}/.cache/peek
441blacklist ${HOME}/.cache/qBittorrent
442blacklist ${HOME}/.cache/qupzilla
443blacklist ${HOME}/.cache/qutebrowser
444blacklist ${HOME}/.cache/simple-scan
445blacklist ${HOME}/.cache/slimjet
446blacklist ${HOME}/.cache/spotify
447blacklist ${HOME}/.cache/telepathy
448blacklist ${HOME}/.cache/thunderbird
449blacklist ${HOME}/.cache/torbrowser
450blacklist ${HOME}/.cache/transmission
451blacklist ${HOME}/.cache/vivaldi
452blacklist ${HOME}/.cache/wesnoth
453blacklist ${HOME}/.cache/xmms2
454blacklist ${HOME}/.cache/xreader
455blacklist ${HOME}/.cache/yandex-browser
456blacklist ${HOME}/.cache/yandex-browser-beta
diff --git a/etc/display.profile b/etc/display.profile
deleted file mode 100644
index eca749cec..000000000
--- a/etc/display.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for display
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/display.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17net none
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24protocol unix
25seccomp
26shell none
27# x11 xorg - problems on kubuntu 17.04
28
29# private-bin display - requires python
30private-dev
31# private-etc none - on Debian-based systems display is a symlink in /etc/alternatives
32private-tmp
diff --git a/etc/dnscrypt-proxy.profile b/etc/dnscrypt-proxy.profile
deleted file mode 100644
index 6d4f6349a..000000000
--- a/etc/dnscrypt-proxy.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for dnscrypt-proxy
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dnscrypt-proxy.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist /sbin
11noblacklist /usr/sbin
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18caps
19# caps.keep ipc_lock,net_bind_service,setgid,setuid,sys_chroot
20no3d
21nodvd
22nonewprivs
23nosound
24notv
25novideo
26seccomp.drop mount,umount2,ptrace,kexec_load,kexec_file_load,open_by_handle_at,init_module,finit_module,delete_module,iopl,ioperm,swapon,swapoff,syslog,process_vm_readv,process_vm_writev,sysfs,_sysctl,adjtimex,clock_adjtime,lookup_dcookie,perf_event_open,fanotify_init,kcmp,add_key,request_key,keyctl,uselib,acct,modify_ldt,pivot_root,io_setup,io_destroy,io_getevents,io_submit,io_cancel,remap_file_pages,mbind,get_mempolicy,set_mempolicy,migrate_pages,move_pages,vmsplice,perf_event_open
27
28disable-mnt
29private
30private-dev
31
32# mdwe can break modules/plugins
33memory-deny-write-execute
diff --git a/etc/dnsmasq.profile b/etc/dnsmasq.profile
deleted file mode 100644
index 2a1302adb..000000000
--- a/etc/dnsmasq.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for dnsmasq
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dnsmasq.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist /sbin
11noblacklist /usr/sbin
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18caps
19# caps.keep net_admin,net_bind_service,net_raw,setgid,setuid
20no3d
21nodvd
22nonewprivs
23nosound
24notv
25novideo
26protocol unix,inet,inet6,netlink
27seccomp
28
29disable-mnt
30private
31private-dev
diff --git a/etc/dolphin.profile b/etc/dolphin.profile
deleted file mode 100644
index 7566e927b..000000000
--- a/etc/dolphin.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for dolphin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dolphin.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# warning: firejail is currently not effectively constraining dolphin since used services are started by kdeinit5
9
10noblacklist ${HOME}/.local/share/Trash
11noblacklist ~/.config/dolphinrc
12noblacklist ~/.local/share/dolphin
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17# dolphin needs to be able to start arbitrary applications so we cannot blacklist their files
18# include /etc/firejail/disable-programs.inc
19
20caps.drop all
21netfilter
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27novideo
28protocol unix
29seccomp
30shell none
31
32# private-bin
33# private-dev
34# private-etc
35# private-tmp
diff --git a/etc/dooble-qt4.profile b/etc/dooble-qt4.profile
deleted file mode 100644
index 4e1227a0f..000000000
--- a/etc/dooble-qt4.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for dooble
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/dooble.profile
diff --git a/etc/dosbox.profile b/etc/dosbox.profile
deleted file mode 100644
index a64578e5c..000000000
--- a/etc/dosbox.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for dosbox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dosbox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.dosbox
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28tracelog
29
30private-bin dosbox
31private-dev
32private-tmp
diff --git a/etc/dragon.profile b/etc/dragon.profile
deleted file mode 100644
index c37f81ac9..000000000
--- a/etc/dragon.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for dragon
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dragon.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/dragonplayerrc
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29private-bin dragon
30private-dev
31# private-etc
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/dropbox.profile b/etc/dropbox.profile
deleted file mode 100644
index c8670357c..000000000
--- a/etc/dropbox.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for dropbox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/dropbox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/autostart
9noblacklist ~/.dropbox-dist
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.dropbox
17mkdir ~/.dropbox-dist
18mkdir ~/Dropbox
19mkfile ~/.config/autostart/dropbox.desktop
20whitelist ~/.config/autostart/dropbox.desktop
21whitelist ~/.dropbox
22whitelist ~/.dropbox-dist
23whitelist ~/Dropbox
24include /etc/firejail/whitelist-common.inc
25
26caps.drop all
27netfilter
28no3d
29nodvd
30nogroups
31nonewprivs
32noroot
33nosound
34notv
35novideo
36protocol unix,inet,inet6
37seccomp
38shell none
39
40private-dev
41private-tmp
42
43noexec /tmp
diff --git a/etc/ebook-viewer.profile b/etc/ebook-viewer.profile
deleted file mode 100644
index 11499aba0..000000000
--- a/etc/ebook-viewer.profile
+++ /dev/null
@@ -1,8 +0,0 @@
1# Firejail profile alias for calibre
2# This file is overwritten after every install/update
3
4
5net none
6
7# Redirect
8include /etc/firejail/calibre.profile
diff --git a/etc/electron.profile b/etc/electron.profile
deleted file mode 100644
index 91e5cd3df..000000000
--- a/etc/electron.profile
+++ /dev/null
@@ -1,22 +0,0 @@
1# Firejail profile for electron
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/electron.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8include /etc/firejail/disable-common.inc
9include /etc/firejail/disable-passwdmgr.inc
10include /etc/firejail/disable-programs.inc
11
12whitelist ${DOWNLOADS}
13
14caps.drop all
15netfilter
16nodvd
17nogroups
18nonewprivs
19noroot
20notv
21protocol unix,inet,inet6,netlink
22seccomp
diff --git a/etc/elinks.profile b/etc/elinks.profile
deleted file mode 100644
index 10fd19f71..000000000
--- a/etc/elinks.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for elinks
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/elinks.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist ~/.elinks
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32# private-bin elinks
33private-dev
34# private-etc none
35private-tmp
diff --git a/etc/emacs.profile b/etc/emacs.profile
deleted file mode 100644
index 8351d6c42..000000000
--- a/etc/emacs.profile
+++ /dev/null
@@ -1,23 +0,0 @@
1# Firejail profile for emacs
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/emacs.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.emacs
9noblacklist ~/.emacs.d
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix,inet,inet6
23seccomp
diff --git a/etc/enchant.profile b/etc/enchant.profile
deleted file mode 100644
index b7034b937..000000000
--- a/etc/enchant.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for enchant
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/enchant.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/enchant
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27tracelog
28
29# private-bin enchant
30# private-dev
31# private-etc fonts
32# private-tmp
diff --git a/etc/engrampa.profile b/etc/engrampa.profile
deleted file mode 100644
index c198adba9..000000000
--- a/etc/engrampa.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for engrampa
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/engrampa.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17# net none - makes settings immutable
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
30
31# private-bin engrampa
32private-dev
33# private-etc fonts
34# private-tmp
35
36memory-deny-write-execute
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/eog.profile b/etc/eog.profile
deleted file mode 100644
index 5ff926371..000000000
--- a/etc/eog.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for eog
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/eog.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.Steam
9noblacklist ~/.config/eog
10noblacklist ~/.local/share/Trash
11noblacklist ~/.steam
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18include /etc/firejail/whitelist-var-common.inc
19
20caps.drop all
21# net none - makes settings immutable
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33
34private-bin eog
35private-dev
36private-etc fonts
37private-tmp
38
39memory-deny-write-execute
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/eom.profile b/etc/eom.profile
deleted file mode 100644
index 802578959..000000000
--- a/etc/eom.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for eom
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/eom.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.Steam
9noblacklist ~/.config/mate/eom
10noblacklist ~/.local/share/Trash
11noblacklist ~/.steam
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18include /etc/firejail/whitelist-var-common.inc
19
20caps.drop all
21# net none - makes settings immutable
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35private-bin eom
36private-dev
37private-etc fonts
38private-tmp
39
40memory-deny-write-execute
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/etr.profile b/etc/etr.profile
deleted file mode 100644
index 96e8b46d9..000000000
--- a/etc/etr.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for etr
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/etr.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.etr
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.etr
15whitelist ~/.etr
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19net none
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix,netlink
26seccomp
27shell none
28
29# private-bin etr
30private-dev
31# private-etc none
32private-tmp
diff --git a/etc/evince.profile b/etc/evince.profile
deleted file mode 100644
index 466260c49..000000000
--- a/etc/evince.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for evince
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/evince.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/evince
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18# net none breaks AppArmor on Ubuntu systems
19netfilter
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix
29seccomp
30shell none
31tracelog
32
33private-bin evince,evince-previewer,evince-thumbnailer
34private-dev
35private-etc fonts
36# evince needs access to /tmp/mozilla* to work in firefox
37# private-tmp
38
39memory-deny-write-execute
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/evolution.profile b/etc/evolution.profile
deleted file mode 100644
index 9f29b229b..000000000
--- a/etc/evolution.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for evolution
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/evolution.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist /var/mail
9noblacklist /var/spool/mail
10noblacklist ~/.bogofilter
11noblacklist ~/.cache/evolution
12noblacklist ~/.config/evolution
13noblacklist ~/.gnupg
14noblacklist ~/.local/share/evolution
15noblacklist ~/.pki
16noblacklist ~/.pki/nssdb
17
18include /etc/firejail/disable-common.inc
19include /etc/firejail/disable-devel.inc
20include /etc/firejail/disable-passwdmgr.inc
21include /etc/firejail/disable-programs.inc
22
23caps.drop all
24netfilter
25no3d
26nodvd
27nogroups
28nonewprivs
29noroot
30nosound
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37private-dev
38private-tmp
39
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/exiftool.profile b/etc/exiftool.profile
deleted file mode 100644
index 75e5be1b9..000000000
--- a/etc/exiftool.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for exiftool
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/exiftool.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11noblacklist /usr/bin/perl
12noblacklist /usr/lib/perl*
13noblacklist /usr/share/perl*
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20caps.drop all
21net none
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35# private-bin exiftool,perl
36private-dev
37private-etc none
38private-tmp
diff --git a/etc/fbreader.profile b/etc/fbreader.profile
deleted file mode 100644
index 01da2cafe..000000000
--- a/etc/fbreader.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for fbreader
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/fbreader.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.FBReader
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nonewprivs
19noroot
20nosound
21notv
22novideo
23protocol unix,inet,inet6
24seccomp
25shell none
26
27private-bin fbreader,FBReader
28private-dev
29private-tmp
diff --git a/etc/feh.profile b/etc/feh.profile
deleted file mode 100644
index 7935b1354..000000000
--- a/etc/feh.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for feh
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/feh.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-bin feh,jpegexiforient,jpegtran
29private-dev
30private-etc feh
31private-tmp
diff --git a/etc/fetchmail.profile b/etc/fetchmail.profile
deleted file mode 100644
index 3fd7f3d75..000000000
--- a/etc/fetchmail.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for fetchmail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/fetchmail.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27
28#private-bin fetchmail,procmail,bash,chmod
29private-dev
diff --git a/etc/ffmpeg.profile b/etc/ffmpeg.profile
deleted file mode 100644
index 5db39cf61..000000000
--- a/etc/ffmpeg.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for ffmpeg
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/ffmpeg.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17net none
18no3d
19nodvd
20nosound
21notv
22novideo
23nonewprivs
24noroot
25# protocol none - needs to be implemented!
26seccomp
27# seccomp.keep futex,write,read,munmap,fstat,mprotect,mmap,open,close,stat,lseek,brk,rt_sigaction,rt_sigprocmask,ioctl,access,select,madvise,getpid,clone,execve,fcntl,getdents,readlink,getrlimit,getrusage,statfs,getpriority,setpriority,arch_prctl,sched_getaffinity,set_tid_address,set_robust_list,getrandom
28shell none
29tracelog
30
31private-bin ffmpeg
32private-dev
33private-tmp
34
35# memory-deny-write-execute - it breaks old versions of ffmpeg
diff --git a/etc/file-roller.profile b/etc/file-roller.profile
deleted file mode 100644
index 01e689b9d..000000000
--- a/etc/file-roller.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for file-roller
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/file-roller.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17# net none - makes settings immutable
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
30
31# private-bin file-roller
32private-dev
33# private-etc fonts
34# private-tmp
35
36memory-deny-write-execute
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/file.profile b/etc/file.profile
deleted file mode 100644
index a83b2cf7d..000000000
--- a/etc/file.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for file
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/file.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16hostname file
17net none
18no3d
19nodvd
20nogroups
21nonewprivs
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29x11 none
30
31private-bin file
32private-dev
33private-etc magic.mgc,magic,localtime
34
35memory-deny-write-execute
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/filezilla.profile b/etc/filezilla.profile
deleted file mode 100644
index 866aaabca..000000000
--- a/etc/filezilla.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for filezilla
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/filezilla.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/filezilla
9noblacklist ${HOME}/.filezilla
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nonewprivs
19noroot
20nosound
21notv
22novideo
23protocol unix,inet,inet6
24seccomp
25shell none
26
27private-bin filezilla,uname,sh,bash,dash,python,lsb_release,fzputtygen,fzsftp
28private-dev
29private-tmp
diff --git a/etc/firefox.profile b/etc/firefox.profile
deleted file mode 100644
index 1f4a8e3f6..000000000
--- a/etc/firefox.profile
+++ /dev/null
@@ -1,83 +0,0 @@
1# Firejail profile for firefox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/firefox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/mozilla
9noblacklist ~/.config/okularpartrc
10noblacklist ~/.config/okularrc
11noblacklist ~/.config/qpdfview
12noblacklist ~/.kde/share/apps/okular
13noblacklist ~/.kde/share/config/okularpartrc
14noblacklist ~/.kde/share/config/okularrc
15noblacklist ~/.kde4/share/apps/okular
16noblacklist ~/.kde4/share/config/okularpartrc
17noblacklist ~/.kde4/share/config/okularrc
18noblacklist ~/.local/share/gnome-shell/extensions
19noblacklist ~/.local/share/okular
20noblacklist ~/.local/share/qpdfview
21noblacklist ~/.mozilla
22noblacklist ~/.pki
23
24include /etc/firejail/disable-common.inc
25include /etc/firejail/disable-devel.inc
26include /etc/firejail/disable-programs.inc
27
28mkdir ~/.cache/mozilla/firefox
29mkdir ~/.mozilla
30mkdir ~/.pki
31whitelist ${DOWNLOADS}
32whitelist ~/.cache/gnome-mplayer/plugin
33whitelist ~/.cache/mozilla/firefox
34whitelist ~/.config/gnome-mplayer
35whitelist ~/.config/okularpartrc
36whitelist ~/.config/okularrc
37whitelist ~/.config/pipelight-silverlight5.1
38whitelist ~/.config/pipelight-widevine
39whitelist ~/.config/qpdfview
40whitelist ~/.kde/share/apps/okular
41whitelist ~/.kde/share/config/okularpartrc
42whitelist ~/.kde/share/config/okularrc
43whitelist ~/.kde4/share/apps/okular
44whitelist ~/.kde4/share/config/okularpartrc
45whitelist ~/.kde4/share/config/okularrc
46whitelist ~/.keysnail.js
47whitelist ~/.lastpass
48whitelist ~/.local/share/gnome-shell/extensions
49whitelist ~/.local/share/okular
50whitelist ~/.local/share/qpdfview
51whitelist ~/.mozilla
52whitelist ~/.pentadactyl
53whitelist ~/.pentadactylrc
54whitelist ~/.pki
55whitelist ~/.vimperator
56whitelist ~/.vimperatorrc
57whitelist ~/.wine-pipelight
58whitelist ~/.wine-pipelight64
59whitelist ~/.zotero
60whitelist ~/dwhelper
61include /etc/firejail/whitelist-common.inc
62include /etc/firejail/whitelist-var-common.inc
63
64caps.drop all
65netfilter
66nodvd
67nogroups
68nonewprivs
69noroot
70notv
71protocol unix,inet,inet6,netlink
72seccomp
73shell none
74tracelog
75
76# firefox requires a shell to launch on Arch. We can possibly remove sh though.
77# private-bin firefox,which,sh,dbus-launch,dbus-send,env,sh,bash
78private-dev
79# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,xdg,gtk-2.0,gtk-3.0,X11,pango,fonts,firefox,mime.types,mailcap,asound.conf,pulse
80private-tmp
81
82noexec ${HOME}
83noexec /tmp
diff --git a/etc/firejail-default b/etc/firejail-default
deleted file mode 100644
index 5e1f2975c..000000000
--- a/etc/firejail-default
+++ /dev/null
@@ -1,161 +0,0 @@
1#########################################
2# Generic Firejail AppArmor profile
3#########################################
4
5##########
6# A simple PID declaration based on Ubuntu's @{pid}
7# Ubuntu keeps it under tunables/kernelvars and include it via tunables/global.
8# We don't know if this definition is available outside Debian and Ubuntu, so
9# we declare our own here.
10##########
11@{PID}={[1-9],[1-9][0-9],[1-9][0-9][0-9],[1-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9],[1-9][0-9][0-9][0-9][0-9][0-9]}
12
13profile firejail-default flags=(attach_disconnected,mediate_deleted) {
14
15##########
16# D-Bus is a huge security hole. Uncomment this line if you need D-Bus
17# functionality.
18##########
19#dbus,
20
21##########
22# Mask /proc and /sys information leakage. The configuration here is barely
23# enough to run "top" or "ps aux".
24##########
25/ r,
26/{usr,bin,dev,etc,home,lib,media,mnt,opt,srv,tmp,var}** mrwlk,
27/{,var/}run/ r,
28/{,var/}run/** r,
29/{,var/}run/user/**/dconf/ rw,
30/{,var/}run/user/**/dconf/user rw,
31/{,var/}run/user/**/pulse/ rw,
32/{,var/}run/user/**/pulse/** rw,
33/{,var/}run/user/**/*.slave-socket rw,
34/{,var/}run/user/**/orcexec.* rwkm,
35/{,var/}run/firejail/mnt/fslogger r,
36/{,var/}run/firejail/appimage r,
37/{,var/}run/firejail/appimage/** r,
38/{,var/}run/firejail/appimage/** ix,
39/{run,dev}/shm/ r,
40/{run,dev}/shm/** rmwk,
41
42/proc/ r,
43/proc/meminfo r,
44/proc/cpuinfo r,
45/proc/filesystems r,
46/proc/uptime r,
47/proc/loadavg r,
48/proc/stat r,
49/proc/sys/kernel/pid_max r,
50/proc/sys/kernel/shmmax r,
51/proc/sys/vm/overcommit_memory r,
52/proc/sys/vm/overcommit_ratio r,
53/proc/sys/kernel/random/uuid r,
54
55/sys/ r,
56/sys/bus/ r,
57/sys/bus/** r,
58/sys/class/ r,
59/sys/class/** r,
60/sys/devices/ r,
61/sys/devices/** r,
62
63/proc/@{PID}/ r,
64/proc/@{PID}/fd/ r,
65/proc/@{PID}/task/ r,
66/proc/@{PID}/cmdline r,
67/proc/@{PID}/comm r,
68/proc/@{PID}/stat r,
69/proc/@{PID}/statm r,
70/proc/@{PID}/status r,
71/proc/@{PID}/task/@{PID}/stat r,
72/proc/@{PID}/maps r,
73/proc/@{PID}/mounts r,
74/proc/@{PID}/mountinfo r,
75/proc/@{PID}/oom_score_adj r,
76/proc/@{PID}/auxv r,
77/proc/@{PID}/net/dev r,
78/proc/@{PID}/loginuid r,
79/proc/@{PID}/environ r,
80
81##########
82# Allow running programs only from well-known system directories. If you need
83# to run programs from your home directory, uncomment /home line.
84##########
85/lib/** ix,
86/lib64/** ix,
87/bin/** ix,
88/sbin/** ix,
89/usr/bin/** ix,
90/usr/sbin/** ix,
91/usr/local/** ix,
92/usr/lib/** ix,
93/usr/games/** ix,
94/opt/ r,
95/opt/** r,
96/opt/** ix,
97#/home/** ix,
98
99##########
100# Allow all networking functionality, and control it from Firejail.
101##########
102network inet,
103network inet6,
104network unix,
105network netlink,
106network raw,
107
108##########
109# There is no equivalent in Firejail for filtering signals.
110##########
111signal,
112
113##########
114# We let Firejail deal with capabilities.
115##########
116capability chown,
117capability dac_override,
118capability dac_read_search,
119capability fowner,
120capability fsetid,
121capability kill,
122capability setgid,
123capability setuid,
124capability setpcap,
125capability linux_immutable,
126capability net_bind_service,
127capability net_broadcast,
128capability net_admin,
129capability net_raw,
130capability ipc_lock,
131capability ipc_owner,
132capability sys_module,
133capability sys_rawio,
134capability sys_chroot,
135capability sys_ptrace,
136capability sys_pacct,
137capability sys_admin,
138capability sys_boot,
139capability sys_nice,
140capability sys_resource,
141capability sys_time,
142capability sys_tty_config,
143capability mknod,
144capability lease,
145capability audit_write,
146capability audit_control,
147capability setfcap,
148capability mac_override,
149capability mac_admin,
150
151##########
152# We let Firejail deal with mount/umount functionality.
153##########
154mount,
155remount,
156umount,
157pivot_root,
158
159# Site-specific additions and overrides. See local/README for details.
160#include <local/firejail-local>
161}
diff --git a/etc/firejail-local b/etc/firejail-local
deleted file mode 100644
index cddf44f13..000000000
--- a/etc/firejail-local
+++ /dev/null
@@ -1 +0,0 @@
1# Site-specific additions and overrides for 'firejail-default'
diff --git a/etc/firejail.config b/etc/firejail.config
index b597ed603..aec152b85 100644
--- a/etc/firejail.config
+++ b/etc/firejail.config
@@ -1,7 +1,9 @@
1# This is Firejail system-wide configuration file. The file contains 1# This is Firejail system-wide configuration file. The file contains
2# keyword-argument pairs, one per line. Most features are enabled by default. 2# keyword-argument pairs, one per line. Most features are enabled by default.
3# Use 'yes' or 'no' as configuration values. 3# Use 'yes' or 'no' as configuration values.
4 4
5# Enable AppArmor functionality, default enabled.
6# apparmor yes
5 7
6# Number of ARP probes sent when assigning an IP address for --net option, 8# Number of ARP probes sent when assigning an IP address for --net option,
7# default 2. This is a partial implementation of RFC 5227. A 0.5 seconds 9# default 2. This is a partial implementation of RFC 5227. A 0.5 seconds
@@ -13,16 +15,24 @@
13# Enable or disable bind support, default enabled. 15# Enable or disable bind support, default enabled.
14# bind yes 16# bind yes
15 17
18# Allow (DRM) execution in browsers, default disabled.
19# browser-allow-drm no
20
21# Disable U2F in browsers, default enabled.
22# browser-disable-u2f yes
23
24# Enable or disable cgroup support, default enabled.
25# cgroup yes
26
16# Enable or disable chroot support, default enabled. 27# Enable or disable chroot support, default enabled.
17# chroot yes 28# chroot yes
18 29
19# Use chroot for desktop programs, default enabled. The sandbox will have full 30# Enable or disable dbus handling, default enabled.
20# access to system's /dev directory in order to allow video acceleration, 31# dbus yes
21# and it will harden the rest of the chroot tree.
22# chroot-desktop yes
23 32
24# 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
25# to these directories is enabled. 34# to these directories is enabled. Unlike --disable-mnt profile option this
35# cannot be overridden by --noblacklist or --ignore.
26# disable-mnt no 36# disable-mnt no
27 37
28# Enable or disable file transfer support, default enabled. 38# Enable or disable file transfer support, default enabled.
@@ -31,16 +41,6 @@
31# Enable Firejail green prompt in terminal, default disabled 41# Enable Firejail green prompt in terminal, default disabled
32# firejail-prompt no 42# firejail-prompt no
33 43
34# Follow symlink as user. While using --whitelist feature,
35# symlinks pointing outside home directory are followed only
36# if both the link and the real file are owned by the user.
37# Enabled by default
38# follow-symlink-as-user yes
39
40# Follow symlink for private-bin command.
41# Disabled by default
42# follow-symlink-private-bin no
43
44# Force use of nonewprivs. This mitigates the possibility of 44# Force use of nonewprivs. This mitigates the possibility of
45# a user abusing firejail's features to trick a privileged (suid 45# a user abusing firejail's features to trick a privileged (suid
46# or file capabilities) process into loading code or configuration 46# or file capabilities) process into loading code or configuration
@@ -51,52 +51,89 @@
51# root user can always join sandboxes. 51# root user can always join sandboxes.
52# join yes 52# join yes
53 53
54# Timeout when joining a sandbox, default five seconds. It is not
55# possible to join a sandbox while it is still starting up. Wait up
56# to the specified period of time to allow sandbox setup to finish.
57# join-timeout 5
58
59# Enable or disable sandbox name change, default enabled.
60# name-change yes
61
62# Change default netfilter configuration. When using --netfilter option without
63# a file argument, the default filter is hardcoded (see man 1 firejail). This
64# configuration entry allows the user to change the default by specifying
65# a file containing the filter configuration. The filter file format is the
66# format of iptables-save and iptables-restore commands. Example:
67# netfilter-default /etc/iptables.iptables.rules
68
54# Enable or disable networking features, default enabled. 69# Enable or disable networking features, default enabled.
55# network yes 70# network yes
56 71
57# Enable or disable overlayfs features, default enabled. 72# Enable or disable overlayfs features, default enabled.
58# overlayfs yes 73# overlayfs yes
59 74
75# Set the limit for file copy in several --private-* options. The size is set
76# in megabytes. By default we allow up to 500MB.
77# Note: the files are copied in RAM.
78# file-copy-limit 500
79
80# Enable or disable private-bin feature, default enabled.
81# private-bin yes
82
60# Remove /usr/local directories from private-bin list, default disabled. 83# Remove /usr/local directories from private-bin list, default disabled.
61# private-bin-no-local no 84# private-bin-no-local no
62 85
86# Enable or disable private-cache feature, default enabled
87# private-cache yes
88
89# Enable or disable private-etc feature, default enabled.
90# private-etc yes
91
63# Enable or disable private-home feature, default enabled 92# Enable or disable private-home feature, default enabled
64# private-home yes 93# private-home yes
65 94
66# Enable or disable private-lib feature, default enabled 95# Enable or disable private-lib feature, default enabled
67# private-lib yes 96# private-lib yes
68 97
98# Enable or disable private-opt feature, default enabled.
99# private-opt yes
100
101# Enable or disable private-srv feature, default enabled.
102# private-srv yes
103
69# Enable --quiet as default every time the sandbox is started. Default disabled. 104# Enable --quiet as default every time the sandbox is started. Default disabled.
70# quiet-by-default no 105# quiet-by-default no
71 106
72# Remount /proc and /sys inside the sandbox, default enabled.
73# remount-proc-sys yes
74
75# Enable or disable restricted network support, default disabled. If enabled, 107# Enable or disable restricted network support, default disabled. If enabled,
76# networking features should also be enabled (network yes). 108# networking features should also be enabled (network yes).
77# Restricted networking grants access to --interface, --net=ethXXX and 109# Restricted networking grants access to --interface, --net=ethXXX and
78# --netfilter only to root user. Regular users are only allowed --net=none. 110# --netfilter only to root user. Regular users are only allowed --net=none.
79# restricted-network no 111# restricted-network no
80 112
81# Change default netfilter configuration. When using --netfilter option without
82# a file argument, the default filter is hardcoded (see man 1 firejail). This
83# configuration entry allows the user to change the default by specifying
84# a file containing the filter configuration. The filter file format is the
85# format of iptables-save and iptable-restore commands. Example:
86# netfilter-default /etc/iptables.iptables.rules
87
88# Enable or disable seccomp support, default enabled. 113# Enable or disable seccomp support, default enabled.
89# seccomp yes 114# seccomp yes
90 115
116# Add rules to the default seccomp filter. Same syntax as for --seccomp=
117# None by default; this is an example.
118# seccomp-filter-add !chroot,kcmp,mincore
119
120# Seccomp error action, kill, log or errno (EPERM, ENOSYS etc)
121# seccomp-error-action EPERM
122
91# Enable or disable user namespace support, default enabled. 123# Enable or disable user namespace support, default enabled.
92# userns yes 124# userns yes
93 125
94# Enable or disable whitelisting support, default enabled. 126# Disable whitelist top level directories, in addition to those
95# whitelist yes 127# that are disabled out of the box. None by default; this is an example.
128# whitelist-disable-topdir /etc,/usr/etc
96 129
97# Enable or disable X11 sandboxing support, default enabled. 130# Enable or disable X11 sandboxing support, default enabled.
98# x11 yes 131# x11 yes
99 132
133# Xephyr command extra parameters. None by default; these are examples.
134# xephyr-extra-params -keybd ephyr,,,xkbmodel=evdev
135# xephyr-extra-params -grayscale
136
100# Screen size for --x11=xephyr, default 800x600. Run /usr/bin/xrandr for 137# Screen size for --x11=xephyr, default 800x600. Run /usr/bin/xrandr for
101# a full list of resolutions available on your specific setup. 138# a full list of resolutions available on your specific setup.
102# xephyr-screen 640x480 139# xephyr-screen 640x480
@@ -107,17 +144,13 @@
107# Firejail window title in Xephyr, default enabled. 144# Firejail window title in Xephyr, default enabled.
108# xephyr-window-title yes 145# xephyr-window-title yes
109 146
110# Xephyr command extra parameters. None by default; these are examples.
111# xephyr-extra-params -keybd ephyr,,,xkbmodel=evdev
112# xephyr-extra-params -grayscale
113
114# Xpra server command extra parameters. None by default; this is an example.
115# xpra-extra-params --dpi 96
116
117# Enable this option if you have a version of Xpra that supports --attach switch 147# Enable this option if you have a version of Xpra that supports --attach switch
118# for start command, default disabled. 148# for start command, default disabled.
119# xpra-attach no 149# xpra-attach no
120 150
151# Xpra server command extra parameters. None by default; this is an example.
152# xpra-extra-params --dpi 96
153
121# Screen size for --x11=xvfb, default 800x600x24. The third dimension is 154# Screen size for --x11=xvfb, default 800x600x24. The third dimension is
122# color depth; use 24 unless you know exactly what you're doing. 155# color depth; use 24 unless you know exactly what you're doing.
123# xvfb-screen 640x480x24 156# xvfb-screen 640x480x24
diff --git a/etc/flashpeak-slimjet.profile b/etc/flashpeak-slimjet.profile
deleted file mode 100644
index 18db4c597..000000000
--- a/etc/flashpeak-slimjet.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for flashpeak-slimjet
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/flashpeak-slimjet.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# This is a whitelisted profile, the internal browser sandbox
9# is disabled because it requires sudo password. The command
10# to run it is as follows:
11# firejail flashpeak-slimjet --no-sandbox
12
13noblacklist ~/.cache/slimjet
14noblacklist ~/.config/slimjet
15noblacklist ~/.pki
16
17include /etc/firejail/disable-common.inc
18include /etc/firejail/disable-devel.inc
19include /etc/firejail/disable-programs.inc
20
21mkdir ~/.cache/slimjet
22mkdir ~/.config/slimjet
23mkdir ~/.pki
24whitelist ${DOWNLOADS}
25whitelist ~/.cache/slimjet
26whitelist ~/.config/slimjet
27whitelist ~/.pki
28include /etc/firejail/whitelist-common.inc
29
30caps.drop all
31netfilter
32nodvd
33nonewprivs
34noroot
35notv
36protocol unix,inet,inet6,netlink
37seccomp
diff --git a/etc/fontforge.profile b/etc/fontforge.profile
deleted file mode 100644
index 29295f8a0..000000000
--- a/etc/fontforge.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for fontforge
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/fontforge.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.FontForge
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/fossamail.profile b/etc/fossamail.profile
deleted file mode 100644
index cef522c53..000000000
--- a/etc/fossamail.profile
+++ /dev/null
@@ -1,22 +0,0 @@
1# Firejail profile for fossamail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/fossamail.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/fossamail
9noblacklist ~/.fossamail
10noblacklist ~/.gnupg
11
12mkdir ~/.cache/fossamail
13mkdir ~/.fossamail
14mkdir ~/.gnupg
15whitelist ~/.cache/fossamail
16whitelist ~/.fossamail
17whitelist ~/.gnupg
18include /etc/firejail/whitelist-common.inc
19
20# allow browsers
21# Redirect
22include /etc/firejail/firefox.profile
diff --git a/etc/franz.profile b/etc/franz.profile
deleted file mode 100644
index f83b5018c..000000000
--- a/etc/franz.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for franz
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/franz.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/Franz
9noblacklist ~/.config/Franz
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/Franz
17mkdir ~/.config/Franz
18mkdir ~/.pki
19whitelist ${DOWNLOADS}
20whitelist ~/.cache/Franz
21whitelist ~/.config/Franz
22whitelist ~/.pki
23include /etc/firejail/whitelist-common.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32protocol unix,inet,inet6,netlink
33seccomp
34shell none
35
36disable-mnt
37private-dev
38private-tmp
39
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/freecad.profile b/etc/freecad.profile
deleted file mode 100644
index 4fde66839..000000000
--- a/etc/freecad.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for freecad
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/freecad.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/FreeCAD
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-bin freecad,freecadcmd
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/freecadcmd.profile b/etc/freecadcmd.profile
deleted file mode 100644
index f8bbff593..000000000
--- a/etc/freecadcmd.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for freecad
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/freecad.profile
diff --git a/etc/frozen-bubble.profile b/etc/frozen-bubble.profile
deleted file mode 100644
index 40aa6d58d..000000000
--- a/etc/frozen-bubble.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for frozen-bubble
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/frozen-bubble.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.frozen-bubble
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.frozen-bubble
15whitelist ~/.frozen-bubble
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19net none
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix,netlink
26seccomp
27shell none
28
29# private-bin frozen-bubble
30private-dev
31# private-etc none
32private-tmp
diff --git a/etc/gajim.profile b/etc/gajim.profile
deleted file mode 100644
index f1929c015..000000000
--- a/etc/gajim.profile
+++ /dev/null
@@ -1,46 +0,0 @@
1# Firejail profile for gajim
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gajim.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/gajim
9noblacklist ${HOME}/.config/gajim
10noblacklist ${HOME}/.local/share/gajim
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ${HOME}/.cache/gajim
18mkdir ${HOME}/.config/gajim
19mkdir ${HOME}/.local/lib/python2.7/site-packages/
20mkdir ${HOME}/.local/share/gajim
21mkdir ${HOME}/Downloads
22whitelist ${HOME}/.cache/gajim
23whitelist ${HOME}/.config/gajim
24whitelist ${HOME}/.local/lib/python2.7/site-packages/
25whitelist ${HOME}/.local/share/gajim
26whitelist ${HOME}/Downloads
27include /etc/firejail/whitelist-common.inc
28
29caps.drop all
30netfilter
31nodvd
32nogroups
33nonewprivs
34noroot
35notv
36protocol unix,inet,inet6
37seccomp
38shell none
39
40disable-mnt
41# private-bin python2.7 gajim
42private-dev
43# private-etc fonts
44# private-tmp
45# Allow the local python 2.7 site packages, in case any plugins are using these
46read-only ${HOME}/.local/lib/python2.7/site-packages/
diff --git a/etc/galculator.profile b/etc/galculator.profile
deleted file mode 100644
index dbc22a889..000000000
--- a/etc/galculator.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for galculator
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/galculator.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/galculator
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.config/galculator
16whitelist ~/.config/galculator
17include /etc/firejail/whitelist-common.inc
18include /etc/firejail/whitelist-var-common.inc
19
20caps.drop all
21net none
22nodvd
23nogroups
24nonewprivs
25noroot
26nosound
27notv
28novideo
29protocol unix
30seccomp
31shell none
32tracelog
33
34private-bin galculator
35private-dev
36private-etc fonts
37private-tmp
diff --git a/etc/geary.profile b/etc/geary.profile
deleted file mode 100644
index 3ab4a21d8..000000000
--- a/etc/geary.profile
+++ /dev/null
@@ -1,26 +0,0 @@
1# Firejail profile for geary
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/geary.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Users have Geary set to open a browser by clicking a link in an email
9# We are not allowed to blacklist browser-specific directories
10
11noblacklist ~/.gnupg
12noblacklist ~/.local/share/geary
13
14mkdir ~/.gnupg
15mkdir ~/.local/share/geary
16whitelist ~/.gnupg
17whitelist ~/.local/share/geary
18include /etc/firejail/whitelist-common.inc
19
20ignore private-tmp
21
22read-only ~/.config/mimeapps.list
23
24# allow browsers
25# Redirect
26include /etc/firejail/firefox.profile
diff --git a/etc/geeqie.profile b/etc/geeqie.profile
deleted file mode 100644
index a50fd4370..000000000
--- a/etc/geeqie.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for geeqie
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/geeqie.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/geeqie
9noblacklist ~/.config/geeqie
10noblacklist ~/.local/share/geeqie
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29# private-bin geeqie
30private-dev
31# private-etc X11
diff --git a/etc/ghb.profile b/etc/ghb.profile
deleted file mode 100644
index de6244a32..000000000
--- a/etc/ghb.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for handbrake
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/handbrake.profile
diff --git a/etc/gimp-2.8.profile b/etc/gimp-2.8.profile
deleted file mode 100644
index a4e04af20..000000000
--- a/etc/gimp-2.8.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for gimp
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/gimp.profile
diff --git a/etc/gimp.profile b/etc/gimp.profile
deleted file mode 100644
index 292c2aac9..000000000
--- a/etc/gimp.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for gimp
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gimp.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.gimp*
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17net none
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24protocol unix
25seccomp
26shell none
27
28private-dev
29private-tmp
30
31# gimp plugins are installed by the user in ~/.gimp-2.8/plug-ins/ directory
32# if you are not using external plugins, you can enable noexec statement below
33# noexec ${HOME}
34noexec /tmp
diff --git a/etc/git.profile b/etc/git.profile
deleted file mode 100644
index 14fb55118..000000000
--- a/etc/git.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for git
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/git.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11noblacklist ~/.emacs
12noblacklist ~/.emacs.d
13noblacklist ~/.gitconfig
14noblacklist ~/.gnupg
15noblacklist ~/.ssh
16noblacklist ~/.vim
17noblacklist ~/.viminfo
18
19include /etc/firejail/disable-common.inc
20include /etc/firejail/disable-passwdmgr.inc
21include /etc/firejail/disable-programs.inc
22
23caps.drop all
24netfilter
25no3d
26nodvd
27nogroups
28nonewprivs
29noroot
30nosound
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37private-dev
diff --git a/etc/gitg.profile b/etc/gitg.profile
deleted file mode 100644
index 0c8495866..000000000
--- a/etc/gitg.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for gitg
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gitg.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.gitconfig
9noblacklist ${HOME}/.local/share/gitg
10noblacklist ${HOME}/.ssh
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix,inet,inet6
27seccomp
28shell none
29
30private-bin gitg,git,ssh
31private-dev
32private-tmp
33
34# mdwe breaks diff in older versions
35#memory-deny-write-execute
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/gitter.profile b/etc/gitter.profile
deleted file mode 100644
index 3e84455f1..000000000
--- a/etc/gitter.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for gitter
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gitter.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/autostart
9noblacklist ~/.config/Gitter
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ~/.config/autostart
18whitelist ~/.config/Gitter
19include /etc/firejail/whitelist-var-common.inc
20
21caps.drop all
22machine-id
23netfilter
24nodvd
25nogroups
26nonewprivs
27noroot
28nosound
29notv
30protocol unix,inet,inet6,netlink
31seccomp
32shell none
33
34disable-mnt
35private-bin bash,env,gitter
36private-etc fonts,pulse,resolv.conf
37private-opt Gitter
38private-dev
39private-tmp
40
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/gjs.profile b/etc/gjs.profile
deleted file mode 100644
index a856d35b5..000000000
--- a/etc/gjs.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for gjs
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gjs.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ~/.cache/libgweather
11noblacklist ~/.cache/org.gnome.Books
12noblacklist ~/.config/libreoffice
13noblacklist ~/.local/share/gnome-photos
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20caps.drop all
21netfilter
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32# private-bin gjs,gnome-books,gnome-documents,gnome-photos,gnome-maps,gnome-weather
33private-dev
34# private-etc fonts
35private-tmp
diff --git a/etc/gnome-2048.profile b/etc/gnome-2048.profile
deleted file mode 100644
index a292633c3..000000000
--- a/etc/gnome-2048.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for gnome-2048
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-2048.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/gnome-2048
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17mkdir ${HOME}/.local/share/gnome-2048
18whitelist ${HOME}/.local/share/gnome-2048
19include /etc/firejail/whitelist-common.inc
20
21caps.drop all
22netfilter
23nodvd
24nonewprivs
25noroot
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30
31disable-mnt
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/gnome-books.profile b/etc/gnome-books.profile
deleted file mode 100644
index 6998a3a42..000000000
--- a/etc/gnome-books.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for gnome-books
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-books.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ~/.cache/org.gnome.Books
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20netfilter
21no3d
22nodvd
23nogroups
24nonewprivs
25noroot
26nosound
27notv
28novideo
29protocol unix
30seccomp
31shell none
32tracelog
33
34# private-bin gjs gnome-books
35private-dev
36# private-etc fonts
37private-tmp
38
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/gnome-calculator.profile b/etc/gnome-calculator.profile
deleted file mode 100644
index 9e70a563a..000000000
--- a/etc/gnome-calculator.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for gnome-calculator
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-calculator.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13include /etc/firejail/whitelist-common.inc
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix,inet,inet6
27seccomp
28shell none
29
30disable-mnt
31private-bin gnome-calculator
32private-dev
33private-tmp
34
35memory-deny-write-execute
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/gnome-chess.profile b/etc/gnome-chess.profile
deleted file mode 100644
index 4caf971dd..000000000
--- a/etc/gnome-chess.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for gnome-chess
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-chess.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.local/share/gnome-chess
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
30
31disable-mnt
32private-bin fairymax,gnome-chess,hoichess
33private-dev
34private-etc fonts,gnome-chess
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/gnome-clocks.profile b/etc/gnome-clocks.profile
deleted file mode 100644
index be294ae9a..000000000
--- a/etc/gnome-clocks.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for gnome-clocks
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-clocks.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28tracelog
29
30disable-mnt
31# private-bin gnome-clocks
32private-dev
33# private-etc fonts
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/gnome-contacts.profile b/etc/gnome-contacts.profile
deleted file mode 100644
index 3a3808e56..000000000
--- a/etc/gnome-contacts.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for gnome-contacts
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-contacts.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13include /etc/firejail/whitelist-common.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix,inet,inet6,netlink
27seccomp
28
29disable-mnt
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/gnome-documents.profile b/etc/gnome-documents.profile
deleted file mode 100644
index 3254f3fbc..000000000
--- a/etc/gnome-documents.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for gnome-documents
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-documents.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ~/.config/libreoffice
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30tracelog
31
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/gnome-font-viewer.profile b/etc/gnome-font-viewer.profile
deleted file mode 100644
index cca0313cc..000000000
--- a/etc/gnome-font-viewer.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for gnome-font-viewer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-font-viewer.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27
28disable-mnt
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/gnome-maps.profile b/etc/gnome-maps.profile
deleted file mode 100644
index b1030597c..000000000
--- a/etc/gnome-maps.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for gnome-maps
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-maps.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ${HOME}/.cache/champlain
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31tracelog
32
33disable-mnt
34# private-bin gjs gnome-maps
35private-dev
36# private-etc fonts
37private-tmp
38
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/gnome-mplayer.profile b/etc/gnome-mplayer.profile
deleted file mode 100644
index d63cc4500..000000000
--- a/etc/gnome-mplayer.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for gnome-mplayer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-mplayer.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15nogroups
16nonewprivs
17noroot
18protocol unix,inet,inet6
19seccomp
20shell none
21
22# private-bin gnome-mplayer,mplayer
23private-dev
24private-tmp
25
26noexec ${HOME}
27noexec /tmp
diff --git a/etc/gnome-music.profile b/etc/gnome-music.profile
deleted file mode 100644
index d1ef20e6b..000000000
--- a/etc/gnome-music.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for gnome-music
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-music.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.local/share/gnome-music
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19no3d
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29
30# private-bin gnome-music,python3
31private-dev
32# private-etc fonts
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/gnome-photos.profile b/etc/gnome-photos.profile
deleted file mode 100644
index f9be4c4de..000000000
--- a/etc/gnome-photos.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for gnome-photos
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-photos.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ~/.local/share/gnome-photos
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27protocol unix
28seccomp
29shell none
30tracelog
31
32# private-bin gjs gnome-photos
33private-dev
34# private-etc fonts
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/gnome-ring.profile b/etc/gnome-ring.profile
deleted file mode 100644
index 3e6e82dac..000000000
--- a/etc/gnome-ring.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for gnome-ring
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-ring.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/gnome-ring
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18ipc-namespace
19netfilter
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix,inet,inet6
26seccomp
27shell none
28
29disable-mnt
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/gnome-weather.profile b/etc/gnome-weather.profile
deleted file mode 100644
index e5804687c..000000000
--- a/etc/gnome-weather.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for gnome-weather
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gnome-weather.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ~/.cache/libgweather
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20netfilter
21no3d
22nodvd
23nogroups
24nonewprivs
25noroot
26nosound
27notv
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32tracelog
33
34disable-mnt
35# private-bin gjs gnome-weather
36private-dev
37# private-etc fonts
38private-tmp
39
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/goobox.profile b/etc/goobox.profile
deleted file mode 100644
index 98514ce8d..000000000
--- a/etc/goobox.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for goobox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/goobox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16no3d
17nogroups
18nonewprivs
19noroot
20notv
21novideo
22protocol unix,inet,inet6
23seccomp
24shell none
25tracelog
26
27# private-bin goobox
28private-dev
29# private-etc fonts
30# private-tmp
diff --git a/etc/google-chrome-beta.profile b/etc/google-chrome-beta.profile
deleted file mode 100644
index ac457b92f..000000000
--- a/etc/google-chrome-beta.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for google-chrome-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/google-chrome-beta.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/google-chrome-beta
9noblacklist ~/.config/google-chrome-beta
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/google-chrome-beta
17mkdir ~/.config/google-chrome-beta
18mkdir ~/.pki
19whitelist ${DOWNLOADS}
20whitelist ~/.cache/google-chrome-beta
21whitelist ~/.config/google-chrome-beta
22whitelist ~/.pki
23include /etc/firejail/whitelist-common.inc
24
25caps.keep sys_chroot,sys_admin
26netfilter
27nodvd
28nogroups
29notv
30shell none
31
32private-dev
33# private-tmp - problems with multiple browser sessions
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/google-chrome-stable.profile b/etc/google-chrome-stable.profile
deleted file mode 100644
index 6ade19021..000000000
--- a/etc/google-chrome-stable.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for google-chrome
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/google-chrome.profile
diff --git a/etc/google-chrome-unstable.profile b/etc/google-chrome-unstable.profile
deleted file mode 100644
index 3d7a9a715..000000000
--- a/etc/google-chrome-unstable.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for google-chrome-unstable
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/google-chrome-unstable.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/google-chrome-unstable
9noblacklist ~/.config/google-chrome-unstable
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/google-chrome-unstable
17mkdir ~/.config/google-chrome-unstable
18mkdir ~/.pki
19whitelist ${DOWNLOADS}
20whitelist ~/.cache/google-chrome-unstable
21whitelist ~/.config/google-chrome-unstable
22whitelist ~/.pki
23include /etc/firejail/whitelist-common.inc
24
25caps.keep sys_chroot,sys_admin
26netfilter
27nodvd
28nogroups
29notv
30shell none
31
32private-dev
33# private-tmp - problems with multiple browser sessions
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/google-chrome.profile b/etc/google-chrome.profile
deleted file mode 100644
index 6e5175989..000000000
--- a/etc/google-chrome.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for google-chrome
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/google-chrome.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/google-chrome
9noblacklist ~/.config/google-chrome
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/google-chrome
17mkdir ~/.config/google-chrome
18mkdir ~/.pki
19whitelist ${DOWNLOADS}
20whitelist ~/.cache/google-chrome
21whitelist ~/.config/google-chrome
22whitelist ~/.pki
23include /etc/firejail/whitelist-common.inc
24include /etc/firejail/whitelist-var-common.inc
25
26caps.keep sys_chroot,sys_admin
27netfilter
28nodvd
29nogroups
30notv
31shell none
32
33private-dev
34# private-tmp - problems with multiple browser sessions
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/google-earth.profile b/etc/google-earth.profile
deleted file mode 100644
index b60f5b3a5..000000000
--- a/etc/google-earth.profile
+++ /dev/null
@@ -1,48 +0,0 @@
1# Firejail profile for google-earth
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/google-earth.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Google
9noblacklist ${HOME}/.googleearth/Cache/
10noblacklist ${HOME}/.googleearth/Temp/
11noblacklist ${HOME}/.googleearth/myplaces.backup.kml
12noblacklist ${HOME}/.googleearth/myplaces.kml
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19mkdir ${HOME}/.config/Google
20mkdir ${HOME}/.googleearth/Cache/
21mkdir ${HOME}/.googleearth/Temp/
22mkfile ${HOME}/.googleearth/myplaces.backup.kml
23mkfile ${HOME}/.googleearth/myplaces.kml
24whitelist ${HOME}/.config/Google
25whitelist ${HOME}/.googleearth/Cache/
26whitelist ${HOME}/.googleearth/Temp/
27whitelist ${HOME}/.googleearth/myplaces.backup.kml
28whitelist ${HOME}/.googleearth/myplaces.kml
29include /etc/firejail/whitelist-common.inc
30
31caps.drop all
32ipc-namespace
33netfilter
34nodvd
35nogroups
36nonewprivs
37noroot
38notv
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43
44private-bin google-earth,sh,bash,dash,grep,sed,ls,dirname
45private-dev
46
47noexec ${HOME}
48noexec /tmp
diff --git a/etc/google-play-music-desktop-player.profile b/etc/google-play-music-desktop-player.profile
deleted file mode 100644
index 704de6e40..000000000
--- a/etc/google-play-music-desktop-player.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for google-play-music-desktop-player
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/google-play-music-desktop-player.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Google Play Music Desktop Player
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15# whitelist ~/.config/pulse
16# whitelist ~/.pulse
17whitelist ~/.config/Google Play Music Desktop Player
18include /etc/firejail/whitelist-common.inc
19
20caps.drop all
21netfilter
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27notv
28novideo
29protocol unix,inet,inet6,netlink
30seccomp
31shell none
32
33disable-mnt
34private-dev
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/gpg-agent.profile b/etc/gpg-agent.profile
deleted file mode 100644
index 8fd2ce232..000000000
--- a/etc/gpg-agent.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for gpg-agent
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gpg-agent.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist ~/.gnupg
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32# private-bin gpg-agent,gpg
33private-dev
diff --git a/etc/gpg.profile b/etc/gpg.profile
deleted file mode 100644
index 8c39f85e3..000000000
--- a/etc/gpg.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for gpg
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gpg.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist ~/.gnupg
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32# private-bin gpg,gpg-agent
33private-dev
diff --git a/etc/gpicview.profile b/etc/gpicview.profile
deleted file mode 100644
index 1842c9cb1..000000000
--- a/etc/gpicview.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for gpicview
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gpicview.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/gpicview
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
30
31private-bin gpicview
32private-dev
33private-etc fonts
34private-tmp
diff --git a/etc/gpredict.profile b/etc/gpredict.profile
deleted file mode 100644
index f204366c5..000000000
--- a/etc/gpredict.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for gpredict
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gpredict.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Gpredict
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15whitelist ~/.config/Gpredict
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19netfilter
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26protocol unix,inet,inet6
27seccomp
28shell none
29tracelog
30
31private-bin gpredict
32private-dev
33private-etc fonts,resolv.conf
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/gtar.profile b/etc/gtar.profile
deleted file mode 100644
index d4bf18f95..000000000
--- a/etc/gtar.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for tar
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/tar.profile
diff --git a/etc/gucharmap.profile b/etc/gucharmap.profile
deleted file mode 100644
index b6be37439..000000000
--- a/etc/gucharmap.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for gucharmap
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gucharmap.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28disable-mnt
29private
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/gwenview.profile b/etc/gwenview.profile
deleted file mode 100644
index 2b025e56c..000000000
--- a/etc/gwenview.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for gwenview
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/gwenview.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/gwenviewrc
9noblacklist ~/.config/org.kde.gwenviewrc
10noblacklist ~/.kde/share/apps/gwenview
11noblacklist ~/.kde/share/config/gwenviewrc
12noblacklist ~/.kde4/share/apps/gwenview
13noblacklist ~/.kde4/share/config/gwenviewrc
14noblacklist ~/.local/share/gwenview
15noblacklist ~/.local/share/org.kde.gwenview
16
17include /etc/firejail/disable-common.inc
18include /etc/firejail/disable-devel.inc
19include /etc/firejail/disable-passwdmgr.inc
20include /etc/firejail/disable-programs.inc
21
22include /etc/firejail/whitelist-var-common.inc
23
24caps.drop all
25nodvd
26nogroups
27nonewprivs
28noroot
29notv
30novideo
31protocol unix
32seccomp
33shell none
34tracelog
35
36private-bin gwenview,kbuildsycoca4,gimp,gimp-2.8
37private-dev
38# private-etc X11
39
40# memory-deny-write-execute
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/gzip.profile b/etc/gzip.profile
deleted file mode 100644
index 0f04953d8..000000000
--- a/etc/gzip.profile
+++ /dev/null
@@ -1,23 +0,0 @@
1# Firejail profile for gzip
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/gzip.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11ignore noroot
12net none
13no3d
14nodvd
15nosound
16notv
17novideo
18shell none
19tracelog
20
21private-dev
22
23include /etc/firejail/default.profile
diff --git a/etc/handbrake-gtk.profile b/etc/handbrake-gtk.profile
deleted file mode 100644
index de6244a32..000000000
--- a/etc/handbrake-gtk.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for handbrake
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/handbrake.profile
diff --git a/etc/handbrake.profile b/etc/handbrake.profile
deleted file mode 100644
index 5235e91f2..000000000
--- a/etc/handbrake.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for handbrake
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/handbrake.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/ghb
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nogroups
20nonewprivs
21noroot
22novideo
23protocol unix,inet,inet6,netlink
24seccomp
25shell none
26
27private-dev
28private-tmp
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/hashcat.profile b/etc/hashcat.profile
deleted file mode 100644
index 5f08d7cb8..000000000
--- a/etc/hashcat.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for hashcat
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/hashcat.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9noblacklist ${HOME}/.hashcat
10noblacklist /usr/include
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30disable-mnt
31private-bin hashcat
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/hedgewars.profile b/etc/hedgewars.profile
deleted file mode 100644
index e2775ffce..000000000
--- a/etc/hedgewars.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for hedgewars
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/hedgewars.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.hedgewars
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.hedgewars
16whitelist ~/.hedgewars
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26seccomp
27tracelog
28
29disable-mnt
30private-dev
31private-tmp
diff --git a/etc/hexchat.profile b/etc/hexchat.profile
deleted file mode 100644
index 47d39e8c4..000000000
--- a/etc/hexchat.profile
+++ /dev/null
@@ -1,45 +0,0 @@
1# Firejail profile for hexchat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/hexchat.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/hexchat
9# noblacklist /usr/lib/python2*
10# noblacklist /usr/lib/python3*
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.config/hexchat
17whitelist ~/.config/hexchat
18include /etc/firejail/whitelist-common.inc
19include /etc/firejail/whitelist-var-common.inc
20
21caps.drop all
22machine-id
23netfilter
24no3d
25nodvd
26nogroups
27nonewprivs
28noroot
29nosound
30notv
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37disable-mnt
38# debug note: private-bin requires perl, python, etc on some systems
39private-bin hexchat
40private-dev
41private-tmp
42
43memory-deny-write-execute
44noexec ${HOME}
45noexec /tmp
diff --git a/etc/highlight.profile b/etc/highlight.profile
deleted file mode 100644
index d3cacc581..000000000
--- a/etc/highlight.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for highlight
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/highlight.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29
30private-bin highlight
31private-dev
32# private-etc none
33private-tmp
diff --git a/etc/hugin.profile b/etc/hugin.profile
deleted file mode 100644
index 64b6e0c69..000000000
--- a/etc/hugin.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for hugin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/hugin.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.hugin
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-bin PTBatcherGUI,calibrate_lens_gui,hugin,hugin_stitch_project,align_image_stack,autooptimiser,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,fulla,geocpset,hugin_executor,hugin_hdrmerge,hugin_lensdb,icpfind,linefind,nona,pano_modify,pano_trafo,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,tca_correct,verdandi,vig_optimize,enblend
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/icecat.profile b/etc/icecat.profile
deleted file mode 100644
index ab7e62180..000000000
--- a/etc/icecat.profile
+++ /dev/null
@@ -1,51 +0,0 @@
1# Firejail profile for icecat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/icecat.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/mozilla
9noblacklist ~/.mozilla
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/mozilla/icecat
17mkdir ~/.mozilla
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/gnome-mplayer/plugin
20whitelist ~/.cache/mozilla/icecat
21whitelist ~/.config/gnome-mplayer
22whitelist ~/.config/pipelight-silverlight5.1
23whitelist ~/.config/pipelight-widevine
24whitelist ~/.keysnail.js
25whitelist ~/.lastpass
26whitelist ~/.mozilla
27whitelist ~/.pentadactyl
28whitelist ~/.pentadactylrc
29whitelist ~/.pki
30whitelist ~/.vimperator
31whitelist ~/.vimperatorrc
32whitelist ~/.wine-pipelight
33whitelist ~/.wine-pipelight64
34whitelist ~/.zotero
35whitelist ~/dwhelper
36include /etc/firejail/whitelist-common.inc
37
38caps.drop all
39netfilter
40nodvd
41nonewprivs
42noroot
43notv
44protocol unix,inet,inet6,netlink
45seccomp
46tracelog
47
48# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
49
50noexec ${HOME}
51noexec /tmp
diff --git a/etc/icedove.profile b/etc/icedove.profile
deleted file mode 100644
index 46861d9f2..000000000
--- a/etc/icedove.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for icedove
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/icedove.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Users have icedove set to open a browser by clicking a link in an email
9# We are not allowed to blacklist browser-specific directories
10
11noblacklist ~/.cache/icedove
12noblacklist ~/.gnupg
13noblacklist ~/.icedove
14
15mkdir ~/.cache/icedove
16mkdir ~/.gnupg
17mkdir ~/.icedove
18whitelist ~/.cache/icedove
19whitelist ~/.gnupg
20whitelist ~/.icedove
21include /etc/firejail/whitelist-common.inc
22
23ignore private-tmp
24
25# allow browsers
26# Redirect
27include /etc/firejail/firefox.profile
diff --git a/etc/iceweasel.profile b/etc/iceweasel.profile
deleted file mode 100644
index f6b57dde0..000000000
--- a/etc/iceweasel.profile
+++ /dev/null
@@ -1,10 +0,0 @@
1# Firejail profile for iceweasel
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/iceweasel.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9# Redirect
10include /etc/firejail/firefox.profile
diff --git a/etc/ids.config b/etc/ids.config
new file mode 100644
index 000000000..09b0ae912
--- /dev/null
+++ b/etc/ids.config
@@ -0,0 +1,142 @@
1# /etc/firejail/ids.config - configuration file for Firejail's Intrusion Detection System
2# This config file is overwritten when a new version of Firejail is installed.
3# For global customization use /etc/firejail/ids.config.local.
4include ids.config.local
5#
6# Each line is a file or directory name such as
7# /usr/bin
8# or
9# ${HOME}/Desktop/*.desktop
10#
11# ${HOME} is expanded to the user's home directory, and * is the regular
12# globbing match for zero or more characters.
13#
14# File or directory names starting with ! are not scanned. For example
15# !${HOME}/.ssh/known_hosts
16# ${HOME}/.ssh
17# will scan all files in ~/.ssh directory with the exception of known_hosts
18
19### system executables ###
20/bin
21/sbin
22/usr/bin
23/usr/games
24/usr/libexec
25/usr/sbin
26
27### user executables ###
28#/opt
29#/usr/local
30
31### system libraries ###
32#/lib
33#/usr/lib
34#/usr/lib32
35#/usr/lib64
36#/usr/libx32
37
38### shells local ###
39# bash
40${HOME}/.bash_login
41${HOME}/.bash_logout
42${HOME}/.bash_profile
43${HOME}/.bashrc
44# fish
45${HOME}/.config/fish/config.fish
46# others
47${HOME}/.cshrc
48${HOME}/.kshrc
49${HOME}/.login
50${HOME}/.logout
51${HOME}/.profile
52${HOME}/.tcshrc
53# zsh
54${HOME}/.zlogin
55${HOME}/.zlogout
56${HOME}/.zshenv
57${HOME}/.zshprofile
58${HOME}/.zshrc
59
60### shells global ###
61# all
62/etc/dircolors
63/etc/environment
64/etc/profile
65/etc/profile.d
66/etc/shells
67/etc/skel
68# bash
69/etc/bash_completion*
70/etc/bash.bashrc
71/etc/bashrc
72# fish
73/etc/fish
74# ksh
75/etc/ksh.kshrc
76# tcsh
77/etc/complete.tcsh
78/etc/csh.cshrc
79/etc/csh.login
80/etc/csh.logout
81# zsh
82/etc/zlogin
83/etc/zlogout
84/etc/zprofile
85/etc/zshenv
86/etc/zshrc
87
88### X11 ###
89/etc/X11
90${HOME}/.xinitrc
91${HOME}/.xmodmaprc
92${HOME}/.xprofile
93${HOME}/.Xresources
94${HOME}/.xserverrc
95${HOME}/.Xsession
96${HOME}/.xsession
97${HOME}/.xsessionrc
98
99### window/desktop manager ###
100${HOME}/Desktop/*.desktop
101${HOME}/.config/autostart
102${HOME}/.config/lxsession/LXDE/autostart
103${HOME}/.gnomerc
104${HOME}/.gtkrc
105${HOME}/.kderc
106
107### security ###
108/etc/aide
109/etc/apparmor*
110/etc/chkrootkit.conf
111/etc/cracklib
112/etc/libaudit.conf
113/etc/group*
114/etc/gshadow*
115/etc/pam.*
116/etc/passwd*
117/etc/rkhunter*
118/etc/securetty
119/etc/security
120/etc/selinux
121/etc/shadow*
122/etc/sudoers*
123/etc/tripwire
124${HOME}/.config/firejail
125${HOME}/.gnupg
126
127### network security ###
128/etc/ca-certificates*
129/etc/hosts.*
130/etc/services
131/etc/snort
132/etc/ssh
133/etc/ssl
134/etc/wireshark
135!${HOME}/.ssh/known_hosts # excluding
136${HOME}/.ssh
137/usr/share/ca-certificates
138
139### system config ###
140/etc/cron.*
141/etc/crontab
142/etc/default
diff --git a/etc/imagej.profile b/etc/imagej.profile
deleted file mode 100644
index 88a56c706..000000000
--- a/etc/imagej.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for imagej
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/imagej.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.imagej
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-bin imagej,bash,grep,sort,tail,tr,cut,whoami,hostname,uname,mkdir,ls,touch,free,awk,update-java-alternatives,basename,xprop,rm,ln
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/img2txt.profile b/etc/img2txt.profile
deleted file mode 100644
index 943350484..000000000
--- a/etc/img2txt.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for img2txt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/img2txt.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16nodvd
17nogroups
18nonewprivs
19noroot
20nosound
21notv
22novideo
23protocol unix
24seccomp
25shell none
26tracelog
27
28# private-bin img2txt
29private-dev
30# private-etc none
31private-tmp
diff --git a/etc/inc/allow-bin-sh.inc b/etc/inc/allow-bin-sh.inc
new file mode 100644
index 000000000..d6c295414
--- /dev/null
+++ b/etc/inc/allow-bin-sh.inc
@@ -0,0 +1,7 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-bin-sh.local
4
5noblacklist ${PATH}/bash
6noblacklist ${PATH}/dash
7noblacklist ${PATH}/sh
diff --git a/etc/inc/allow-common-devel.inc b/etc/inc/allow-common-devel.inc
new file mode 100644
index 000000000..011bbe226
--- /dev/null
+++ b/etc/inc/allow-common-devel.inc
@@ -0,0 +1,31 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-common-devel.local
4
5# Git
6noblacklist ${HOME}/.config/git
7noblacklist ${HOME}/.gitconfig
8noblacklist ${HOME}/.git-credentials
9
10# Java
11noblacklist ${HOME}/.gradle
12noblacklist ${HOME}/.java
13
14# Node.js
15noblacklist ${HOME}/.node-gyp
16noblacklist ${HOME}/.npm
17noblacklist ${HOME}/.npmrc
18noblacklist ${HOME}/.nvm
19noblacklist ${HOME}/.yarn
20noblacklist ${HOME}/.yarn-config
21noblacklist ${HOME}/.yarncache
22noblacklist ${HOME}/.yarnrc
23
24# Python
25noblacklist ${HOME}/.pylint.d
26noblacklist ${HOME}/.python-history
27noblacklist ${HOME}/.python_history
28noblacklist ${HOME}/.pythonhist
29
30# Rust
31noblacklist ${HOME}/.cargo/*
diff --git a/etc/inc/allow-gjs.inc b/etc/inc/allow-gjs.inc
new file mode 100644
index 000000000..c1366e093
--- /dev/null
+++ b/etc/inc/allow-gjs.inc
@@ -0,0 +1,12 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-gjs.local
4
5noblacklist ${PATH}/gjs
6noblacklist ${PATH}/gjs-console
7noblacklist /usr/lib/gjs
8noblacklist /usr/lib/libgjs*
9noblacklist /usr/lib/libmozjs-*
10noblacklist /usr/lib64/gjs
11noblacklist /usr/lib64/libgjs*
12noblacklist /usr/lib64/libmozjs-*
diff --git a/etc/inc/allow-java.inc b/etc/inc/allow-java.inc
new file mode 100644
index 000000000..24d18fb77
--- /dev/null
+++ b/etc/inc/allow-java.inc
@@ -0,0 +1,9 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-java.local
4
5noblacklist ${HOME}/.java
6noblacklist ${PATH}/java
7noblacklist /etc/java
8noblacklist /usr/lib/java
9noblacklist /usr/share/java
diff --git a/etc/inc/allow-lua.inc b/etc/inc/allow-lua.inc
new file mode 100644
index 000000000..9c47e7a3b
--- /dev/null
+++ b/etc/inc/allow-lua.inc
@@ -0,0 +1,12 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-lua.local
4
5noblacklist ${PATH}/lua*
6noblacklist /usr/include
7noblacklist /usr/lib/liblua*
8noblacklist /usr/lib/lua
9noblacklist /usr/lib64/liblua*
10noblacklist /usr/lib64/lua
11noblacklist /usr/share/lua
12noblacklist /usr/share/lua*
diff --git a/etc/inc/allow-nodejs.inc b/etc/inc/allow-nodejs.inc
new file mode 100644
index 000000000..351c94ab8
--- /dev/null
+++ b/etc/inc/allow-nodejs.inc
@@ -0,0 +1,10 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-nodejs.local
4
5noblacklist ${PATH}/node
6noblacklist /usr/include/node
7
8# Allow python for node-gyp (blacklisted by disable-interpreters.inc)
9include allow-python2.inc
10include allow-python3.inc
diff --git a/etc/inc/allow-opengl-game.inc b/etc/inc/allow-opengl-game.inc
new file mode 100644
index 000000000..5d2d6c5c1
--- /dev/null
+++ b/etc/inc/allow-opengl-game.inc
@@ -0,0 +1,7 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-opengl-game.local
4
5noblacklist ${PATH}/bash
6whitelist /usr/share/opengl-games-utils/opengl-game-functions.sh
7private-bin basename,bash,cut,glxinfo,grep,head,sed,zenity
diff --git a/etc/inc/allow-perl.inc b/etc/inc/allow-perl.inc
new file mode 100644
index 000000000..5a1952c94
--- /dev/null
+++ b/etc/inc/allow-perl.inc
@@ -0,0 +1,12 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-perl.local
4
5noblacklist ${PATH}/core_perl
6noblacklist ${PATH}/cpan*
7noblacklist ${PATH}/perl
8noblacklist ${PATH}/site_perl
9noblacklist ${PATH}/vendor_perl
10noblacklist /usr/lib/perl*
11noblacklist /usr/lib64/perl*
12noblacklist /usr/share/perl*
diff --git a/etc/inc/allow-php.inc b/etc/inc/allow-php.inc
new file mode 100644
index 000000000..a0950dc26
--- /dev/null
+++ b/etc/inc/allow-php.inc
@@ -0,0 +1,7 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-php.local
4
5noblacklist ${PATH}/php*
6noblacklist /usr/lib/php*
7noblacklist /usr/share/php*
diff --git a/etc/inc/allow-python2.inc b/etc/inc/allow-python2.inc
new file mode 100644
index 000000000..b0525e2e1
--- /dev/null
+++ b/etc/inc/allow-python2.inc
@@ -0,0 +1,9 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-python2.local
4
5noblacklist ${PATH}/python2*
6noblacklist /usr/include/python2*
7noblacklist /usr/lib/python2*
8noblacklist /usr/local/lib/python2*
9noblacklist /usr/share/python2*
diff --git a/etc/inc/allow-python3.inc b/etc/inc/allow-python3.inc
new file mode 100644
index 000000000..d968886b0
--- /dev/null
+++ b/etc/inc/allow-python3.inc
@@ -0,0 +1,10 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-python3.local
4
5noblacklist ${PATH}/python3*
6noblacklist /usr/include/python3*
7noblacklist /usr/lib/python3*
8noblacklist /usr/lib64/python3*
9noblacklist /usr/local/lib/python3*
10noblacklist /usr/share/python3*
diff --git a/etc/inc/allow-ruby.inc b/etc/inc/allow-ruby.inc
new file mode 100644
index 000000000..a8c701219
--- /dev/null
+++ b/etc/inc/allow-ruby.inc
@@ -0,0 +1,6 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-ruby.local
4
5noblacklist ${PATH}/ruby
6noblacklist /usr/lib/ruby
diff --git a/etc/inc/allow-ssh.inc b/etc/inc/allow-ssh.inc
new file mode 100644
index 000000000..67c78a483
--- /dev/null
+++ b/etc/inc/allow-ssh.inc
@@ -0,0 +1,8 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include allow-ssh.local
4
5noblacklist ${HOME}/.ssh
6noblacklist /etc/ssh
7noblacklist /etc/ssh/ssh_config
8noblacklist /tmp/ssh-*
diff --git a/etc/inc/disable-X11.inc b/etc/inc/disable-X11.inc
new file mode 100644
index 000000000..d227c7a0b
--- /dev/null
+++ b/etc/inc/disable-X11.inc
@@ -0,0 +1,15 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-X11.local
4
5blacklist /tmp/.X11-unix
6blacklist ${HOME}/.Xauthority
7blacklist ${RUNUSER}/gdm/Xauthority
8blacklist ${RUNUSER}/.mutter-Xwaylandauth*
9blacklist ${RUNUSER}/xauth_*
10#blacklist ${RUNUSER}/[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]
11blacklist /tmp/xauth*
12blacklist /tmp/.ICE-unix
13blacklist ${RUNUSER}/ICEauthority
14rmenv DISPLAY
15rmenv XAUTHORITY
diff --git a/etc/inc/disable-common.inc b/etc/inc/disable-common.inc
new file mode 100644
index 000000000..ae84ee38a
--- /dev/null
+++ b/etc/inc/disable-common.inc
@@ -0,0 +1,589 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-common.local
4
5# The following block breaks trash functionality in file managers
6#read-only ${HOME}/.local
7#read-write ${HOME}/.local/share
8blacklist ${HOME}/.local/share/Trash
9
10# History files in $HOME and clipboard managers
11blacklist-nolog ${HOME}/.*_history
12blacklist-nolog ${HOME}/.adobe
13blacklist-nolog ${HOME}/.cache/greenclip*
14blacklist-nolog ${HOME}/.histfile
15blacklist-nolog ${HOME}/.history
16blacklist-nolog ${HOME}/.kde/share/apps/klipper
17blacklist-nolog ${HOME}/.kde4/share/apps/klipper
18blacklist-nolog ${HOME}/.local/share/fish/fish_history
19blacklist-nolog ${HOME}/.local/share/klipper
20blacklist-nolog ${HOME}/.macromedia
21blacklist-nolog ${HOME}/.mupdf.history
22blacklist-nolog ${HOME}/.python-history
23blacklist-nolog ${HOME}/.python_history
24blacklist-nolog ${HOME}/.pythonhist
25blacklist-nolog ${HOME}/.lesshst
26blacklist-nolog ${HOME}/.viminfo
27blacklist-nolog /tmp/clipmenu*
28
29# X11 session autostart
30# blacklist ${HOME}/.xpra - this will kill --x11=xpra cmdline option for all programs
31blacklist ${HOME}/.Xsession
32blacklist ${HOME}/.blackbox
33blacklist ${HOME}/.config/autostart
34blacklist ${HOME}/.config/autostart-scripts
35blacklist ${HOME}/.config/awesome
36blacklist ${HOME}/.config/i3
37blacklist ${HOME}/.config/sway
38blacklist ${HOME}/.config/lxsession/LXDE/autostart
39blacklist ${HOME}/.config/openbox
40blacklist ${HOME}/.config/plasma-workspace
41blacklist ${HOME}/.config/startupconfig
42blacklist ${HOME}/.config/startupconfigkeys
43blacklist ${HOME}/.fluxbox
44blacklist ${HOME}/.gnomerc
45blacklist ${HOME}/.kde/Autostart
46blacklist ${HOME}/.kde/env
47blacklist ${HOME}/.kde/share/autostart
48blacklist ${HOME}/.kde/share/config/startupconfig
49blacklist ${HOME}/.kde/share/config/startupconfigkeys
50blacklist ${HOME}/.kde/shutdown
51blacklist ${HOME}/.kde4/env
52blacklist ${HOME}/.kde4/Autostart
53blacklist ${HOME}/.kde4/share/autostart
54blacklist ${HOME}/.kde4/shutdown
55blacklist ${HOME}/.kde4/share/config/startupconfig
56blacklist ${HOME}/.kde4/share/config/startupconfigkeys
57blacklist ${HOME}/.local/share/autostart
58blacklist ${HOME}/.xinitrc
59blacklist ${HOME}/.xprofile
60blacklist ${HOME}/.xserverrc
61blacklist ${HOME}/.xsession
62blacklist ${HOME}/.xsessionrc
63blacklist /etc/X11/Xsession.d
64blacklist /etc/xdg/autostart
65read-only ${HOME}/.Xauthority
66
67# Session manager
68# see #3358
69#?HAS_X11: blacklist ${HOME}/.ICEauthority
70#?HAS_X11: blacklist /tmp/.ICE-unix
71
72# KDE config
73blacklist ${HOME}/.cache/konsole
74blacklist ${HOME}/.config/khotkeysrc
75blacklist ${HOME}/.config/krunnerrc
76blacklist ${HOME}/.config/kscreenlockerrc
77blacklist ${HOME}/.config/ksslcertificatemanager
78blacklist ${HOME}/.config/kwalletrc
79blacklist ${HOME}/.config/kwinrc
80blacklist ${HOME}/.config/kwinrulesrc
81blacklist ${HOME}/.config/plasma-locale-settings.sh
82blacklist ${HOME}/.config/plasma-org.kde.plasma.desktop-appletsrc
83blacklist ${HOME}/.config/plasmashellrc
84blacklist ${HOME}/.config/plasmavaultrc
85blacklist ${HOME}/.kde/share/apps/kwin
86blacklist ${HOME}/.kde/share/apps/plasma
87blacklist ${HOME}/.kde/share/apps/solid
88blacklist ${HOME}/.kde/share/config/khotkeysrc
89blacklist ${HOME}/.kde/share/config/krunnerrc
90blacklist ${HOME}/.kde/share/config/kscreensaverrc
91blacklist ${HOME}/.kde/share/config/ksslcertificatemanager
92blacklist ${HOME}/.kde/share/config/kwalletrc
93blacklist ${HOME}/.kde/share/config/kwinrc
94blacklist ${HOME}/.kde/share/config/kwinrulesrc
95blacklist ${HOME}/.kde/share/config/plasma-desktop-appletsrc
96blacklist ${HOME}/.kde4/share/apps/kwin
97blacklist ${HOME}/.kde4/share/apps/plasma
98blacklist ${HOME}/.kde4/share/apps/solid
99blacklist ${HOME}/.kde4/share/config/khotkeysrc
100blacklist ${HOME}/.kde4/share/config/krunnerrc
101blacklist ${HOME}/.kde4/share/config/kscreensaverrc
102blacklist ${HOME}/.kde4/share/config/ksslcertificatemanager
103blacklist ${HOME}/.kde4/share/config/kwalletrc
104blacklist ${HOME}/.kde4/share/config/kwinrc
105blacklist ${HOME}/.kde4/share/config/kwinrulesrc
106blacklist ${HOME}/.kde4/share/config/plasma-desktop-appletsrc
107blacklist ${HOME}/.local/share/kglobalaccel
108blacklist ${HOME}/.local/share/kwin
109blacklist ${HOME}/.local/share/plasma
110blacklist ${HOME}/.local/share/plasmashell
111blacklist ${HOME}/.local/share/solid
112blacklist /tmp/konsole-*.history
113read-only ${HOME}/.cache/ksycoca5_*
114read-only ${HOME}/.config/*notifyrc
115read-only ${HOME}/.config/kdeglobals
116read-only ${HOME}/.config/kio_httprc
117read-only ${HOME}/.config/kiorc
118read-only ${HOME}/.config/kioslaverc
119read-only ${HOME}/.config/ksslcablacklist
120read-only ${HOME}/.kde/share/apps/konsole
121read-only ${HOME}/.kde/share/apps/kssl
122read-only ${HOME}/.kde/share/config/*notifyrc
123read-only ${HOME}/.kde/share/config/kdeglobals
124read-only ${HOME}/.kde/share/config/kio_httprc
125read-only ${HOME}/.kde/share/config/kioslaverc
126read-only ${HOME}/.kde/share/config/ksslcablacklist
127read-only ${HOME}/.kde/share/kde4/services
128read-only ${HOME}/.kde4/share/apps/konsole
129read-only ${HOME}/.kde4/share/apps/kssl
130read-only ${HOME}/.kde4/share/config/*notifyrc
131read-only ${HOME}/.kde4/share/config/kdeglobals
132read-only ${HOME}/.kde4/share/config/kio_httprc
133read-only ${HOME}/.kde4/share/config/kioslaverc
134read-only ${HOME}/.kde4/share/config/ksslcablacklist
135read-only ${HOME}/.kde4/share/kde4/services
136read-only ${HOME}/.local/share/konsole
137read-only ${HOME}/.local/share/kservices5
138read-only ${HOME}/.local/share/kssl
139
140# KDE sockets
141blacklist ${RUNUSER}/*.slave-socket
142blacklist ${RUNUSER}/kdeinit5__*
143blacklist ${RUNUSER}/kdesud_*
144# see #3358
145#?HAS_NODBUS: blacklist ${RUNUSER}/ksocket-*
146#?HAS_NODBUS: blacklist /tmp/ksocket-*
147
148# gnome
149# contains extensions, last used times of applications, and notifications
150blacklist ${HOME}/.local/share/gnome-shell
151# contains recently used files and serials of static/removable storage
152blacklist ${HOME}/.local/share/gvfs-metadata
153# no direct modification of dconf database
154read-only ${HOME}/.config/dconf
155blacklist ${RUNUSER}/gnome-session-leader-fifo
156blacklist ${RUNUSER}/gnome-shell
157blacklist ${RUNUSER}/gsconnect
158
159# systemd
160blacklist ${HOME}/.config/systemd
161blacklist ${HOME}/.local/share/systemd
162blacklist ${PATH}/systemctl
163blacklist ${PATH}/systemd-run
164blacklist ${RUNUSER}/systemd
165blacklist /etc/systemd/network
166blacklist /etc/systemd/system
167blacklist /var/lib/systemd
168# creates problems on Arch where /etc/resolv.conf is a symlink to /var/run/systemd/resolve/resolv.conf
169#blacklist /var/run/systemd
170
171# openrc
172blacklist /etc/init.d
173blacklist /etc/rc.conf
174blacklist /etc/runlevels
175
176# VirtualBox
177blacklist ${HOME}/.config/VirtualBox
178blacklist ${HOME}/.VirtualBox
179blacklist ${HOME}/VirtualBox VMs
180
181# GNOME Boxes
182blacklist ${HOME}/.config/gnome-boxes
183blacklist ${HOME}/.local/share/gnome-boxes
184
185# libvirt
186blacklist ${HOME}/.cache/libvirt
187blacklist ${HOME}/.config/libvirt
188blacklist ${RUNUSER}/libvirt
189blacklist /var/cache/libvirt
190blacklist /var/lib/libvirt
191blacklist /var/log/libvirt
192
193# OCI-Containers / Podman
194blacklist ${RUNUSER}/containers
195blacklist ${RUNUSER}/crun
196blacklist ${RUNUSER}/libpod
197blacklist ${RUNUSER}/runc
198blacklist ${RUNUSER}/toolbox
199
200# VeraCrypt
201blacklist ${HOME}/.VeraCrypt
202blacklist ${PATH}/veracrypt
203blacklist ${PATH}/veracrypt-uninstall.sh
204blacklist /usr/share/applications/veracrypt.*
205blacklist /usr/share/pixmaps/veracrypt.*
206blacklist /usr/share/veracrypt
207
208# TrueCrypt
209blacklist ${HOME}/.TrueCrypt
210blacklist ${PATH}/truecrypt
211blacklist ${PATH}/truecrypt-uninstall.sh
212blacklist /usr/share/applications/truecrypt.*
213blacklist /usr/share/pixmaps/truecrypt.*
214blacklist /usr/share/truecrypt
215
216# zuluCrypt
217blacklist ${HOME}/.zuluCrypt
218blacklist ${HOME}/.zuluCrypt-socket
219blacklist ${PATH}/zuluCrypt-cli
220blacklist ${PATH}/zuluMount-cli
221
222# var
223blacklist /var/cache/apt
224blacklist /var/cache/pacman
225blacklist /var/lib/apt
226blacklist /var/lib/clamav
227blacklist /var/lib/dkms
228blacklist /var/lib/mysql/mysql.sock
229blacklist /var/lib/mysqld/mysql.sock
230blacklist /var/lib/pacman
231blacklist /var/lib/upower
232# blacklist /var/log - a virtual /var/log directory (mostly empty) is build up by default for
233# every sandbox, unless --writable-var-log switch is activated
234blacklist /var/mail
235blacklist /var/opt
236blacklist /var/run/acpid.socket
237blacklist /var/run/docker.sock
238blacklist /var/run/minissdpd.sock
239blacklist /var/run/mysql/mysqld.sock
240blacklist /var/run/mysqld/mysqld.sock
241blacklist /var/run/rpcbind.sock
242blacklist /var/run/screens
243blacklist /var/spool/anacron
244blacklist /var/spool/cron
245blacklist /var/spool/mail
246
247# etc
248blacklist /etc/adduser.conf
249blacklist /etc/anacrontab
250blacklist /etc/apparmor*
251blacklist /etc/cron*
252blacklist /etc/default
253blacklist /etc/dkms
254blacklist /etc/grub*
255blacklist /etc/kernel*
256blacklist /etc/logrotate*
257blacklist /etc/modules*
258blacklist /etc/profile.d
259blacklist /etc/rc.local
260# rc1.d, rc2.d, ...
261blacklist /etc/rc?.d
262blacklist /etc/sysconfig
263
264# hide config for various intrusion detection systems
265blacklist /etc/aide
266blacklist /etc/aide.conf
267blacklist /etc/chkrootkit.conf
268blacklist /etc/fail2ban.conf
269blacklist /etc/logcheck
270blacklist /etc/lynis
271blacklist /etc/rkhunter.*
272blacklist /etc/snort
273blacklist /etc/suricata
274blacklist /etc/tripwire
275blacklist /var/lib/rkhunter
276
277# Startup files
278read-only ${HOME}/.antigen
279read-only ${HOME}/.bash_aliases
280read-only ${HOME}/.bash_login
281read-only ${HOME}/.bash_logout
282read-only ${HOME}/.bash_profile
283read-only ${HOME}/.bashrc
284read-only ${HOME}/.config/environment.d
285read-only ${HOME}/.config/fish
286read-only ${HOME}/.csh_files
287read-only ${HOME}/.cshrc
288read-only ${HOME}/.forward
289read-only ${HOME}/.kshrc
290read-only ${HOME}/.local/share/fish
291read-only ${HOME}/.login
292read-only ${HOME}/.logout
293read-only ${HOME}/.mkshrc
294read-only ${HOME}/.oh-my-zsh
295read-only ${HOME}/.pam_environment
296read-only ${HOME}/.pgpkey
297read-only ${HOME}/.plan
298read-only ${HOME}/.profile
299read-only ${HOME}/.project
300read-only ${HOME}/.tcshrc
301read-only ${HOME}/.zfunc
302read-only ${HOME}/.zlogin
303read-only ${HOME}/.zlogout
304read-only ${HOME}/.zprofile
305read-only ${HOME}/.zsh.d
306read-only ${HOME}/.zsh_files
307read-only ${HOME}/.zshenv
308read-only ${HOME}/.zshrc
309read-only ${HOME}/.zshrc.local
310
311# Remote access
312blacklist ${HOME}/.rhosts
313blacklist ${HOME}/.shosts
314blacklist ${HOME}/.ssh/authorized_keys
315blacklist ${HOME}/.ssh/authorized_keys2
316blacklist ${HOME}/.ssh/environment
317blacklist ${HOME}/.ssh/rc
318blacklist /etc/hosts.equiv
319read-only ${HOME}/.ssh/config
320read-only ${HOME}/.ssh/config.d
321
322# Initialization files that allow arbitrary command execution
323read-only ${HOME}/.caffrc
324read-only ${HOME}/.cargo/env
325read-only ${HOME}/.dotfiles
326read-only ${HOME}/.emacs
327read-only ${HOME}/.emacs.d
328read-only ${HOME}/.exrc
329read-only ${HOME}/.gvimrc
330read-only ${HOME}/.homesick
331read-only ${HOME}/.iscreenrc
332read-only ${HOME}/.local/lib
333read-only ${HOME}/.local/share/cool-retro-term
334read-only ${HOME}/.mailcap
335read-only ${HOME}/.msmtprc
336read-only ${HOME}/.mutt/muttrc
337read-only ${HOME}/.muttrc
338read-only ${HOME}/.nano
339read-only ${HOME}/.npmrc
340read-only ${HOME}/.pythonrc.py
341read-only ${HOME}/.reportbugrc
342read-only ${HOME}/.tmux.conf
343read-only ${HOME}/.vim
344read-only ${HOME}/.viminfo
345read-only ${HOME}/.vimrc
346read-only ${HOME}/.xmonad
347read-only ${HOME}/.xscreensaver
348read-only ${HOME}/.yarnrc
349read-only ${HOME}/_exrc
350read-only ${HOME}/_gvimrc
351read-only ${HOME}/_vimrc
352read-only ${HOME}/dotfiles
353
354# Make directories commonly found in $PATH read-only
355read-only ${HOME}/.bin
356read-only ${HOME}/.cargo/bin
357read-only ${HOME}/.gem
358read-only ${HOME}/.local/bin
359read-only ${HOME}/.luarocks
360read-only ${HOME}/.npm-packages
361read-only ${HOME}/.nvm
362read-only ${HOME}/.rustup
363read-only ${HOME}/bin
364
365# Write-protection for desktop entries
366read-only ${HOME}/.config/menus
367read-only ${HOME}/.gnome/apps
368read-only ${HOME}/.local/share/applications
369
370read-only ${HOME}/.config/mimeapps.list
371read-only ${HOME}/.config/user-dirs.dirs
372read-only ${HOME}/.config/user-dirs.locale
373read-only ${HOME}/.local/share/mime
374
375# Write-protection for thumbnailer dir
376read-only ${HOME}/.local/share/thumbnailers
377
378# prevent access to ssh-agent
379blacklist /tmp/ssh-*
380
381# top secret
382blacklist /.fscrypt
383blacklist /etc/davfs2/secrets
384blacklist /etc/group+
385blacklist /etc/group-
386blacklist /etc/gshadow
387blacklist /etc/gshadow+
388blacklist /etc/gshadow-
389blacklist /etc/passwd+
390blacklist /etc/passwd-
391blacklist /etc/shadow
392blacklist /etc/shadow+
393blacklist /etc/shadow-
394blacklist /etc/ssh
395blacklist /etc/ssh/*
396blacklist /home/.ecryptfs
397blacklist /home/.fscrypt
398blacklist ${HOME}/*.kdb
399blacklist ${HOME}/*.kdbx
400blacklist ${HOME}/*.key
401blacklist ${HOME}/Private
402blacklist ${HOME}/.Private
403blacklist ${HOME}/.caff
404blacklist ${HOME}/.cargo/credentials
405blacklist ${HOME}/.cargo/credentials.toml
406blacklist ${HOME}/.cert
407blacklist ${HOME}/.config/hub
408blacklist ${HOME}/.config/keybase
409blacklist ${HOME}/.davfs2/secrets
410blacklist ${HOME}/.ecryptfs
411blacklist ${HOME}/.fetchmailrc
412blacklist ${HOME}/.fscrypt
413blacklist ${HOME}/.git-credential-cache
414blacklist ${HOME}/.git-credentials
415blacklist ${HOME}/.gnome2/keyrings
416blacklist ${HOME}/.gnupg
417blacklist ${HOME}/.kde/share/apps/kwallet
418blacklist ${HOME}/.kde4/share/apps/kwallet
419blacklist ${HOME}/.local/share/keyrings
420blacklist ${HOME}/.local/share/kwalletd
421blacklist ${HOME}/.local/share/pki
422blacklist ${HOME}/.local/share/plasma-vault
423blacklist ${HOME}/.minisign
424blacklist ${HOME}/.msmtprc
425blacklist ${HOME}/.mutt
426blacklist ${HOME}/.muttrc
427blacklist ${HOME}/.netrc
428blacklist ${HOME}/.nyx
429blacklist ${HOME}/.pki
430blacklist ${HOME}/.smbcredentials
431blacklist ${HOME}/.ssh
432blacklist ${HOME}/.vaults
433blacklist /var/backup
434
435# Remove environment variables with auth tokens.
436# Note however that the sandbox might still have access to the
437# files where these variables are set.
438rmenv GH_TOKEN
439rmenv GITHUB_TOKEN
440rmenv GH_ENTERPRISE_TOKEN
441rmenv GITHUB_ENTERPRISE_TOKEN
442rmenv CARGO_REGISTRY_TOKEN
443rmenv RESTIC_KEY_HINT
444rmenv RESTIC_PASSWORD_COMMAND
445rmenv RESTIC_PASSWORD_FILE
446
447# cloud provider configuration
448blacklist ${HOME}/.aws
449blacklist ${HOME}/.boto
450blacklist ${HOME}/.config/gcloud
451blacklist ${HOME}/.kube
452blacklist ${HOME}/.passwd-s3fs
453blacklist ${HOME}/.s3cmd
454blacklist /etc/boto.cfg
455
456# system directories
457blacklist /sbin
458blacklist /usr/local/sbin
459blacklist /usr/sbin
460
461# system management
462blacklist ${PATH}/at
463blacklist ${PATH}/busybox
464blacklist ${PATH}/chage
465blacklist ${PATH}/chfn
466blacklist ${PATH}/chsh
467blacklist ${PATH}/crontab
468blacklist ${PATH}/evtest
469blacklist ${PATH}/expiry
470blacklist ${PATH}/fusermount
471blacklist ${PATH}/gksu
472blacklist ${PATH}/gksudo
473blacklist ${PATH}/gpasswd
474blacklist ${PATH}/kdesudo
475blacklist ${PATH}/ksu
476blacklist ${PATH}/mount
477blacklist ${PATH}/mount.ecryptfs_private
478blacklist ${PATH}/nc
479blacklist ${PATH}/ncat
480blacklist ${PATH}/nmap
481blacklist ${PATH}/newgidmap
482blacklist ${PATH}/newgrp
483blacklist ${PATH}/newuidmap
484blacklist ${PATH}/ntfs-3g
485blacklist ${PATH}/pkexec
486blacklist ${PATH}/procmail
487blacklist ${PATH}/sg
488blacklist ${PATH}/strace
489blacklist ${PATH}/su
490blacklist ${PATH}/sudo
491blacklist ${PATH}/tcpdump
492blacklist ${PATH}/umount
493blacklist ${PATH}/unix_chkpwd
494blacklist ${PATH}/xev
495blacklist ${PATH}/xinput
496
497# other SUID binaries
498blacklist /usr/lib/virtualbox
499blacklist /usr/lib64/virtualbox
500
501# prevent lxterminal connecting to an existing lxterminal session
502blacklist /tmp/.lxterminal-socket*
503# prevent tmux connecting to an existing session
504blacklist /tmp/tmux-*
505
506# disable terminals running as server resulting in sandbox escape
507blacklist ${PATH}/gnome-terminal
508blacklist ${PATH}/gnome-terminal.wrapper
509# blacklist ${PATH}/konsole
510# konsole doesn't seem to have this problem - last tested on Ubuntu 16.04
511blacklist ${PATH}/lilyterm
512blacklist ${PATH}/lxterminal
513blacklist ${PATH}/mate-terminal
514blacklist ${PATH}/mate-terminal.wrapper
515blacklist ${PATH}/pantheon-terminal
516blacklist ${PATH}/roxterm
517blacklist ${PATH}/roxterm-config
518blacklist ${PATH}/terminix
519blacklist ${PATH}/tilix
520blacklist ${PATH}/urxvtc
521blacklist ${PATH}/urxvtcd
522blacklist ${PATH}/xfce4-terminal
523blacklist ${PATH}/xfce4-terminal.wrapper
524
525# kernel files
526blacklist /initrd*
527blacklist /vmlinuz*
528
529# snapshot files
530blacklist /.snapshots
531
532# flatpak
533blacklist ${HOME}/.cache/flatpak
534blacklist ${HOME}/.config/flatpak
535noblacklist ${HOME}/.local/share/flatpak/exports
536read-only ${HOME}/.local/share/flatpak/exports
537blacklist ${HOME}/.local/share/flatpak/*
538blacklist ${HOME}/.var
539# most of the time bwrap is SUID binary
540blacklist ${PATH}/bwrap
541blacklist ${RUNUSER}/.dbus-proxy
542blacklist ${RUNUSER}/.flatpak
543blacklist ${RUNUSER}/.flatpak-cache
544blacklist ${RUNUSER}/.flatpak-helper
545blacklist ${RUNUSER}/app
546blacklist ${RUNUSER}/doc
547blacklist /usr/share/flatpak
548noblacklist /var/lib/flatpak/exports
549blacklist /var/lib/flatpak/*
550
551# snap
552blacklist ${RUNUSER}/snapd-session-agent.socket
553
554# mail directories used by mutt
555blacklist ${HOME}/.Mail
556blacklist ${HOME}/.mail
557blacklist ${HOME}/.signature
558blacklist ${HOME}/Mail
559blacklist ${HOME}/mail
560blacklist ${HOME}/postponed
561blacklist ${HOME}/sent
562
563# kernel configuration
564blacklist /proc/config.gz
565
566# prevent DNS malware attempting to communicate with the server
567# using regular DNS tools
568blacklist ${PATH}/dig
569blacklist ${PATH}/dlint
570blacklist ${PATH}/dns2tcp
571blacklist ${PATH}/dnssec-*
572blacklist ${PATH}/dnswalk
573blacklist ${PATH}/drill
574blacklist ${PATH}/host
575blacklist ${PATH}/iodine
576blacklist ${PATH}/kdig
577blacklist ${PATH}/khost
578blacklist ${PATH}/knsupdate
579blacklist ${PATH}/ldns-*
580blacklist ${PATH}/ldnsd
581blacklist ${PATH}/nslookup
582blacklist ${PATH}/resolvectl
583blacklist ${PATH}/unbound-host
584
585# rest of ${RUNUSER}
586blacklist ${RUNUSER}/*.lock
587blacklist ${RUNUSER}/inaccessible
588blacklist ${RUNUSER}/pk-debconf-socket
589blacklist ${RUNUSER}/update-notifier.pid
diff --git a/etc/inc/disable-devel.inc b/etc/inc/disable-devel.inc
new file mode 100644
index 000000000..e74b1b40b
--- /dev/null
+++ b/etc/inc/disable-devel.inc
@@ -0,0 +1,69 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-devel.local
4
5# development tools
6
7# clang/llvm
8blacklist ${PATH}/clang*
9blacklist ${PATH}/lldb*
10blacklist ${PATH}/llvm*
11# see issue #2106 - it disables hardware acceleration in Firefox on Radeon GPU
12# blacklist /usr/lib/llvm*
13
14# GCC
15blacklist ${PATH}/as
16blacklist ${PATH}/cc
17blacklist ${PATH}/c++*
18blacklist ${PATH}/c8*
19blacklist ${PATH}/c9*
20blacklist ${PATH}/cpp*
21blacklist ${PATH}/g++*
22blacklist ${PATH}/gcc*
23blacklist ${PATH}/gdb
24blacklist ${PATH}/ld
25blacklist ${PATH}/*-gcc*
26blacklist ${PATH}/*-g++*
27blacklist ${PATH}/*-gcc*
28blacklist ${PATH}/*-g++*
29# seems to create problems on Gentoo
30#blacklist /usr/lib/gcc
31
32#Go
33blacklist ${PATH}/gccgo
34blacklist ${PATH}/go
35blacklist ${PATH}/gofmt
36
37# Java
38blacklist ${PATH}/java
39blacklist ${PATH}/javac
40blacklist /etc/java
41blacklist /usr/lib/java
42blacklist /usr/share/java
43
44#OpenSSL
45blacklist ${PATH}/openssl
46blacklist ${PATH}/openssl-1.0
47
48#Rust
49blacklist ${PATH}/rust-gdb
50blacklist ${PATH}/rust-lldb
51blacklist ${PATH}/rustc
52blacklist ${HOME}/.rustup
53
54# tcc - Tiny C Compiler
55blacklist ${PATH}/tcc
56blacklist ${PATH}/x86_64-tcc
57blacklist /usr/lib/tcc
58
59# Valgrind
60blacklist ${PATH}/valgrind*
61blacklist /usr/lib/valgrind
62
63
64# Source-Code
65
66blacklist /usr/src
67blacklist /usr/local/src
68blacklist /usr/include
69blacklist /usr/local/include
diff --git a/etc/inc/disable-exec.inc b/etc/inc/disable-exec.inc
new file mode 100644
index 000000000..9b5c40a2b
--- /dev/null
+++ b/etc/inc/disable-exec.inc
@@ -0,0 +1,12 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-exec.local
4
5noexec ${HOME}
6noexec ${RUNUSER}
7noexec /dev/mqueue
8noexec /dev/shm
9noexec /tmp
10# /var is noexec by default for unprivileged users
11# except there is a writable-var option, so just in case:
12noexec /var
diff --git a/etc/inc/disable-interpreters.inc b/etc/inc/disable-interpreters.inc
new file mode 100644
index 000000000..5d8a236fb
--- /dev/null
+++ b/etc/inc/disable-interpreters.inc
@@ -0,0 +1,68 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-interpreters.local
4
5# gjs
6blacklist ${PATH}/gjs
7blacklist ${PATH}/gjs-console
8blacklist /usr/lib/gjs
9blacklist /usr/lib/libgjs*
10blacklist /usr/lib64/gjs
11blacklist /usr/lib64/libgjs*
12
13# Lua
14blacklist ${PATH}/lua*
15blacklist /usr/include/lua*
16blacklist /usr/lib/liblua*
17blacklist /usr/lib/lua
18blacklist /usr/lib64/liblua*
19blacklist /usr/lib64/lua
20blacklist /usr/share/lua*
21
22# mozjs
23blacklist /usr/lib/libmozjs-*
24blacklist /usr/lib64/libmozjs-*
25
26# Node.js
27blacklist ${PATH}/node
28blacklist /usr/include/node
29
30# nvm
31blacklist ${HOME}/.nvm
32
33# Perl
34blacklist ${PATH}/core_perl
35blacklist ${PATH}/cpan*
36blacklist ${PATH}/perl
37blacklist ${PATH}/site_perl
38blacklist ${PATH}/vendor_perl
39blacklist /usr/lib/perl*
40blacklist /usr/lib64/perl*
41blacklist /usr/share/perl*
42
43# PHP
44blacklist ${PATH}/php*
45blacklist /usr/lib/php*
46blacklist /usr/share/php*
47
48# Ruby
49blacklist ${PATH}/ruby
50blacklist /usr/lib/ruby
51
52# Programs using python: deluge, firefox addons, filezilla, cherrytree, xchat, hexchat, libreoffice, scribus
53# Python 2
54blacklist ${PATH}/python2*
55blacklist /usr/include/python2*
56blacklist /usr/lib/python2*
57blacklist /usr/local/lib/python2*
58blacklist /usr/share/python2*
59
60# You will want to add noblacklist for python3 stuff in the firefox and/or chromium profiles if you use the Gnome connector (see Issue #2026)
61
62# Python 3
63blacklist ${PATH}/python3*
64blacklist /usr/include/python3*
65blacklist /usr/lib/python3*
66blacklist /usr/lib64/python3*
67blacklist /usr/local/lib/python3*
68blacklist /usr/share/python3*
diff --git a/etc/inc/disable-programs.inc b/etc/inc/disable-programs.inc
new file mode 100644
index 000000000..4941630a2
--- /dev/null
+++ b/etc/inc/disable-programs.inc
@@ -0,0 +1,1129 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-programs.local
4
5blacklist ${HOME}/.*coin
6blacklist ${HOME}/.8pecxstudios
7blacklist ${HOME}/.AndroidStudio*
8blacklist ${HOME}/.Atom
9blacklist ${HOME}/.CLion*
10blacklist ${HOME}/.FBReader
11blacklist ${HOME}/.FontForge
12blacklist ${HOME}/.IdeaIC*
13blacklist ${HOME}/.LuminanceHDR
14blacklist ${HOME}/.Mathematica
15blacklist ${HOME}/.Natron
16blacklist ${HOME}/.PlayOnLinux
17blacklist ${HOME}/.PyCharm*
18blacklist ${HOME}/.Sayonara
19blacklist ${HOME}/.Steam
20blacklist ${HOME}/.Steampath
21blacklist ${HOME}/.Steampid
22blacklist ${HOME}/.TelegramDesktop
23blacklist ${HOME}/.VSCodium
24blacklist ${HOME}/.ViberPC
25blacklist ${HOME}/.VirtualBox
26blacklist ${HOME}/.WebStorm*
27blacklist ${HOME}/.Wolfram Research
28blacklist ${HOME}/.ZAP
29blacklist ${HOME}/.aMule
30blacklist ${HOME}/.abook
31blacklist ${HOME}/.addressbook
32blacklist ${HOME}/.alpine-smime
33blacklist ${HOME}/.android
34blacklist ${HOME}/.anydesk
35blacklist ${HOME}/.arduino15
36blacklist ${HOME}/.aria2
37blacklist ${HOME}/.arm
38blacklist ${HOME}/.asunder_album_artist
39blacklist ${HOME}/.asunder_album_genre
40blacklist ${HOME}/.asunder_album_title
41blacklist ${HOME}/.atom
42blacklist ${HOME}/.attic
43blacklist ${HOME}/.audacity-data
44blacklist ${HOME}/.avidemux6
45blacklist ${HOME}/.ballbuster.hs
46blacklist ${HOME}/.balsa
47blacklist ${HOME}/.bcast5
48blacklist ${HOME}/.bibletime
49blacklist ${HOME}/.bitcoin
50blacklist ${HOME}/.blobby
51blacklist ${HOME}/.bogofilter
52blacklist ${HOME}/.bzf
53blacklist ${HOME}/.cargo/*
54blacklist ${HOME}/.claws-mail
55blacklist ${HOME}/.cliqz
56blacklist ${HOME}/.clion*
57blacklist ${HOME}/.clonk
58blacklist ${HOME}/.config/0ad
59blacklist ${HOME}/.config/2048-qt
60blacklist ${HOME}/.config/Atom
61blacklist ${HOME}/.config/Audaciousrc
62blacklist ${HOME}/.config/Authenticator
63blacklist ${HOME}/.config/Beaker Browser
64blacklist ${HOME}/.config/Bitcoin
65blacklist ${HOME}/.config/Bitwarden
66blacklist ${HOME}/.config/Brackets
67blacklist ${HOME}/.config/BraveSoftware
68blacklist ${HOME}/.config/Clementine
69blacklist ${HOME}/.config/Code
70blacklist ${HOME}/.config/Code - OSS
71blacklist ${HOME}/.config/Code Industry
72blacklist ${HOME}/.config/Cryptocat
73blacklist ${HOME}/.config/Debauchee/Barrier.conf
74blacklist ${HOME}/.config/Dharkael
75blacklist ${HOME}/.config/ENCOM
76blacklist ${HOME}/.config/Element
77blacklist ${HOME}/.config/Element (Riot)
78blacklist ${HOME}/.config/Enox
79blacklist ${HOME}/.config/Epic
80blacklist ${HOME}/.config/Exodus
81blacklist ${HOME}/.config/Ferdi
82blacklist ${HOME}/.config/Flavio Tordini
83blacklist ${HOME}/.config/Franz
84blacklist ${HOME}/.config/FreeCAD
85blacklist ${HOME}/.config/FreeTube
86blacklist ${HOME}/.config/Fritzing
87blacklist ${HOME}/.config/GIMP
88blacklist ${HOME}/.config/GitHub Desktop
89blacklist ${HOME}/.config/Gitter
90blacklist ${HOME}/.config/Google
91blacklist ${HOME}/.config/Google Play Music Desktop Player
92blacklist ${HOME}/.config/Gpredict
93blacklist ${HOME}/.config/INRIA
94blacklist ${HOME}/.config/InSilmaril
95blacklist ${HOME}/.config/Jitsi Meet
96blacklist ${HOME}/.config/JetBrains/CLion*
97blacklist ${HOME}/.config/KDE/neochat
98blacklist ${HOME}/.config/KeePass
99blacklist ${HOME}/.config/KeePassXCrc
100blacklist ${HOME}/.config/Kid3
101blacklist ${HOME}/.config/Kingsoft
102blacklist ${HOME}/.config/LibreCAD
103blacklist ${HOME}/.config/Loop_Hero
104blacklist ${HOME}/.config/Luminance
105blacklist ${HOME}/.config/LyX
106blacklist ${HOME}/.config/Mattermost
107blacklist ${HOME}/.config/Meltytech
108blacklist ${HOME}/.config/Mendeley Ltd.
109blacklist ${HOME}/.config/Microsoft
110blacklist ${HOME}/.config/Min
111blacklist ${HOME}/.config/ModTheSpire
112blacklist ${HOME}/.config/Mousepad
113blacklist ${HOME}/.config/Mumble
114blacklist ${HOME}/.config/MusE
115blacklist ${HOME}/.config/MuseScore
116blacklist ${HOME}/.config/MusicBrainz
117blacklist ${HOME}/.config/Nathan Osman
118blacklist ${HOME}/.config/Nextcloud
119blacklist ${HOME}/.config/NitroShare
120blacklist ${HOME}/.config/Nylas Mail
121blacklist ${HOME}/.config/PBE
122blacklist ${HOME}/.config/PacmanLogViewer
123blacklist ${HOME}/.config/PawelStolowski
124blacklist ${HOME}/.config/Philipp Schmieder
125blacklist ${HOME}/.config/Pinta
126blacklist ${HOME}/.config/QGIS
127blacklist ${HOME}/.config/QMediathekView
128blacklist ${HOME}/.config/Qlipper
129blacklist ${HOME}/.config/QuiteRss
130blacklist ${HOME}/.config/QuiteRssrc
131blacklist ${HOME}/.config/Quotient
132blacklist ${HOME}/.config/Rambox
133blacklist ${HOME}/.config/Riot
134blacklist ${HOME}/.config/Rocket.Chat
135blacklist ${HOME}/.config/RogueLegacy
136blacklist ${HOME}/.config/RogueLegacyStorageContainer
137blacklist ${HOME}/.config/Signal
138blacklist ${HOME}/.config/Sinew Software Systems
139blacklist ${HOME}/.config/Slack
140blacklist ${HOME}/.config/Standard Notes
141blacklist ${HOME}/.config/SubDownloader
142blacklist ${HOME}/.config/Thunar
143blacklist ${HOME}/.config/Twitch
144blacklist ${HOME}/.config/Unknown Organization
145blacklist ${HOME}/.config/VirtualBox
146blacklist ${HOME}/.config/Whalebird
147blacklist ${HOME}/.config/Wire
148blacklist ${HOME}/.config/Youtube
149blacklist ${HOME}/.config/ZeGrapher Project
150blacklist ${HOME}/.config/Zeal
151blacklist ${HOME}/.config/Zulip
152blacklist ${HOME}/.config/aacs
153blacklist ${HOME}/.config/abiword
154blacklist ${HOME}/.config/agenda
155blacklist ${HOME}/.config/akonadi*
156blacklist ${HOME}/.config/akregatorrc
157blacklist ${HOME}/.config/alacritty
158blacklist ${HOME}/.config/ardour4
159blacklist ${HOME}/.config/ardour5
160blacklist ${HOME}/.config/aria2
161blacklist ${HOME}/.config/arkrc
162blacklist ${HOME}/.config/artha.conf
163blacklist ${HOME}/.config/artha.log
164blacklist ${HOME}/.config/asunder
165blacklist ${HOME}/.config/atril
166blacklist ${HOME}/.config/audacious
167blacklist ${HOME}/.config/autokey
168blacklist ${HOME}/.config/avidemux3_qt5rc
169blacklist ${HOME}/.config/aweather
170blacklist ${HOME}/.config/backintime
171blacklist ${HOME}/.config/baloofilerc
172blacklist ${HOME}/.config/baloorc
173blacklist ${HOME}/.config/bcompare
174blacklist ${HOME}/.config/blender
175blacklist ${HOME}/.config/bless
176blacklist ${HOME}/.config/bnox
177blacklist ${HOME}/.config/borg
178blacklist ${HOME}/.config/brasero
179blacklist ${HOME}/.config/brave
180blacklist ${HOME}/.config/brave-flags.conf
181blacklist ${HOME}/.config/caja
182blacklist ${HOME}/.config/calibre
183blacklist ${HOME}/.config/cantata
184blacklist ${HOME}/.config/catfish
185blacklist ${HOME}/.config/cawbird
186blacklist ${HOME}/.config/celluloid
187blacklist ${HOME}/.config/cherrytree
188blacklist ${HOME}/.config/chrome-beta-flags.conf
189blacklist ${HOME}/.config/chrome-beta-flags.config
190blacklist ${HOME}/.config/chrome-flags.conf
191blacklist ${HOME}/.config/chrome-flags.config
192blacklist ${HOME}/.config/chrome-unstable-flags.conf
193blacklist ${HOME}/.config/chrome-unstable-flags.config
194blacklist ${HOME}/.config/chromium
195blacklist ${HOME}/.config/chromium-dev
196blacklist ${HOME}/.config/chromium-flags.conf
197blacklist ${HOME}/.config/clipit
198blacklist ${HOME}/.config/cliqz
199blacklist ${HOME}/.config/cmus
200blacklist ${HOME}/.config/com.github.bleakgrey.tootle
201blacklist ${HOME}/.config/corebird
202blacklist ${HOME}/.config/cower
203blacklist ${HOME}/.config/coyim
204blacklist ${HOME}/.config/d-feet
205blacklist ${HOME}/.config/darktable
206blacklist ${HOME}/.config/deadbeef
207blacklist ${HOME}/.config/deluge
208blacklist ${HOME}/.config/devilspie2
209blacklist ${HOME}/.config/digikam
210blacklist ${HOME}/.config/digikamrc
211blacklist ${HOME}/.config/discord
212blacklist ${HOME}/.config/discordcanary
213blacklist ${HOME}/.config/dkl
214blacklist ${HOME}/.config/dnox
215blacklist ${HOME}/.config/dolphin-emu
216blacklist ${HOME}/.config/dolphinrc
217blacklist ${HOME}/.config/dragonplayerrc
218blacklist ${HOME}/.config/draw.io
219blacklist ${HOME}/.config/electron-mail
220blacklist ${HOME}/.config/emaildefaults
221blacklist ${HOME}/.config/emailidentities
222blacklist ${HOME}/.config/emilia
223blacklist ${HOME}/.config/enchant
224blacklist ${HOME}/.config/eog
225blacklist ${HOME}/.config/epiphany
226blacklist ${HOME}/.config/equalx
227blacklist ${HOME}/.config/evince
228blacklist ${HOME}/.config/evolution
229blacklist ${HOME}/.config/falkon
230blacklist ${HOME}/.config/filezilla
231blacklist ${HOME}/.config/flameshot
232blacklist ${HOME}/.config/flaska.net
233blacklist ${HOME}/.config/flowblade
234blacklist ${HOME}/.config/font-manager
235blacklist ${HOME}/.config/freecol
236blacklist ${HOME}/.config/gajim
237blacklist ${HOME}/.config/galculator
238blacklist ${HOME}/.config/gallery-dl
239blacklist ${HOME}/.config/gconf
240blacklist ${HOME}/.config/geany
241blacklist ${HOME}/.config/geary
242blacklist ${HOME}/.config/gedit
243blacklist ${HOME}/.config/geeqie
244blacklist ${HOME}/.config/ghb
245blacklist ${HOME}/.config/ghostwriter
246blacklist ${HOME}/.config/git
247blacklist ${HOME}/.config/git-cola
248blacklist ${HOME}/.config/glade.conf
249blacklist ${HOME}/.config/globaltime
250blacklist ${HOME}/.config/gmpc
251blacklist ${HOME}/.config/gnome-builder
252blacklist ${HOME}/.config/gnome-chess
253blacklist ${HOME}/.config/gnome-control-center
254blacklist ${HOME}/.config/gnome-initial-setup-done
255blacklist ${HOME}/.config/gnome-latex
256blacklist ${HOME}/.config/gnome-mplayer
257blacklist ${HOME}/.config/gnome-mpv
258blacklist ${HOME}/.config/gnome-pie
259blacklist ${HOME}/.config/gnome-session
260blacklist ${HOME}/.config/gnote
261blacklist ${HOME}/.config/godot
262blacklist ${HOME}/.config/google-chrome
263blacklist ${HOME}/.config/google-chrome-beta
264blacklist ${HOME}/.config/google-chrome-unstable
265blacklist ${HOME}/.config/gpicview
266blacklist ${HOME}/.config/gthumb
267blacklist ${HOME}/.config/gummi
268blacklist ${HOME}/.config/guvcview2
269blacklist ${HOME}/.config/gwenviewrc
270blacklist ${HOME}/.config/hexchat
271blacklist ${HOME}/.config/homebank
272blacklist ${HOME}/.config/i2p
273blacklist ${HOME}/.config/inkscape
274blacklist ${HOME}/.config/inox
275blacklist ${HOME}/.config/iridium
276blacklist ${HOME}/.config/itch
277blacklist ${HOME}/.config/jami
278blacklist ${HOME}/.config/jd-gui.cfg
279blacklist ${HOME}/.config/k3brc
280blacklist ${HOME}/.config/kaffeinerc
281blacklist ${HOME}/.config/kalgebrarc
282blacklist ${HOME}/.config/katemetainfos
283blacklist ${HOME}/.config/katepartrc
284blacklist ${HOME}/.config/katerc
285blacklist ${HOME}/.config/kateschemarc
286blacklist ${HOME}/.config/katesyntaxhighlightingrc
287blacklist ${HOME}/.config/katevirc
288blacklist ${HOME}/.config/kazam
289blacklist ${HOME}/.config/kdeconnect
290blacklist ${HOME}/.config/kdenliverc
291blacklist ${HOME}/.config/kdiff3fileitemactionrc
292blacklist ${HOME}/.config/kdiff3rc
293blacklist ${HOME}/.config/keepass
294blacklist ${HOME}/.config/keepassx
295blacklist ${HOME}/.config/keepassxc
296blacklist ${HOME}/.config/kfindrc
297blacklist ${HOME}/.config/kgetrc
298blacklist ${HOME}/.config/kid3rc
299blacklist ${HOME}/.config/klavaro
300blacklist ${HOME}/.config/klipperrc
301blacklist ${HOME}/.config/kmail2rc
302blacklist ${HOME}/.config/kmailsearchindexingrc
303blacklist ${HOME}/.config/kmplayerrc
304blacklist ${HOME}/.config/knotesrc
305blacklist ${HOME}/.config/konversation.notifyrc
306blacklist ${HOME}/.config/konversationrc
307blacklist ${HOME}/.config/kritarc
308blacklist ${HOME}/.config/ktorrentrc
309blacklist ${HOME}/.config/ktouch2rc
310blacklist ${HOME}/.config/kube
311blacklist ${HOME}/.config/kwriterc
312blacklist ${HOME}/.config/leafpad
313blacklist ${HOME}/.config/libreoffice
314blacklist ${HOME}/.config/liferea
315blacklist ${HOME}/.config/linphone
316blacklist ${HOME}/.config/lugaru
317blacklist ${HOME}/.config/lutris
318blacklist ${HOME}/.config/lximage-qt
319blacklist ${HOME}/.config/mailtransports
320blacklist ${HOME}/.config/mana
321blacklist ${HOME}/.config/mate-calc
322blacklist ${HOME}/.config/mate/eom
323blacklist ${HOME}/.config/mate/mate-dictionary
324blacklist ${HOME}/.config/matrix-mirage
325blacklist ${HOME}/.config/mcomix
326blacklist ${HOME}/.config/meld
327blacklist ${HOME}/.config/menulibre.cfg
328blacklist ${HOME}/.config/meteo-qt
329blacklist ${HOME}/.config/mfusion
330blacklist ${HOME}/.config/microsoft-edge-beta
331blacklist ${HOME}/.config/microsoft-edge-dev
332blacklist ${HOME}/.config/midori
333blacklist ${HOME}/.config/mirage
334blacklist ${HOME}/.config/mono
335blacklist ${HOME}/.config/mpDris2
336blacklist ${HOME}/.config/mpd
337blacklist ${HOME}/.config/mps-youtube
338blacklist ${HOME}/.config/mpv
339blacklist ${HOME}/.config/mupen64plus
340blacklist ${HOME}/.config/mutt
341blacklist ${HOME}/.config/mutter
342blacklist ${HOME}/.config/mypaint
343blacklist ${HOME}/.config/nano
344blacklist ${HOME}/.config/nautilus
345blacklist ${HOME}/.config/nemo
346blacklist ${HOME}/.config/neochat.notifyrc
347blacklist ${HOME}/.config/neochatrc
348blacklist ${HOME}/.config/neomutt
349blacklist ${HOME}/.config/netsurf
350blacklist ${HOME}/.config/newsbeuter
351blacklist ${HOME}/.config/newsboat
352blacklist ${HOME}/.config/newsflash
353blacklist ${HOME}/.config/nheko
354blacklist ${HOME}/.config/nomacs
355blacklist ${HOME}/.config/nuclear
356blacklist ${HOME}/.config/obs-studio
357blacklist ${HOME}/.config/okularpartrc
358blacklist ${HOME}/.config/okularrc
359blacklist ${HOME}/.config/onboard
360blacklist ${HOME}/.config/onionshare
361blacklist ${HOME}/.config/onlyoffice
362blacklist ${HOME}/.config/openmw
363blacklist ${HOME}/.config/opera
364blacklist ${HOME}/.config/opera-beta
365blacklist ${HOME}/.config/orage
366blacklist ${HOME}/.config/org.gabmus.gfeeds.json
367blacklist ${HOME}/.config/org.gabmus.gfeeds.saved_articles
368blacklist ${HOME}/.config/org.kde.gwenviewrc
369blacklist ${HOME}/.config/otter
370blacklist ${HOME}/.config/pavucontrol-qt
371blacklist ${HOME}/.config/pavucontrol.ini
372blacklist ${HOME}/.config/pcmanfm
373blacklist ${HOME}/.config/pdfmod
374blacklist ${HOME}/.config/pipe-viewer
375blacklist ${HOME}/.config/pitivi
376blacklist ${HOME}/.config/pix
377blacklist ${HOME}/.config/pluma
378blacklist ${HOME}/.config/ppsspp
379blacklist ${HOME}/.config/pragha
380blacklist ${HOME}/.config/profanity
381blacklist ${HOME}/.config/psi
382blacklist ${HOME}/.config/psi+
383blacklist ${HOME}/.config/qBittorrent
384blacklist ${HOME}/.config/qBittorrentrc
385blacklist ${HOME}/.config/qnapi.ini
386blacklist ${HOME}/.config/qpdfview
387blacklist ${HOME}/.config/quodlibet
388blacklist ${HOME}/.config/qupzilla
389blacklist ${HOME}/.config/qutebrowser
390blacklist ${HOME}/.config/ranger
391blacklist ${HOME}/.config/redshift
392blacklist ${HOME}/.config/redshift.conf
393blacklist ${HOME}/.config/remmina
394blacklist ${HOME}/.config/ristretto
395blacklist ${HOME}/.config/rtv
396blacklist ${HOME}/.config/scribus
397blacklist ${HOME}/.config/scribusrc
398blacklist ${HOME}/.config/sinew.in
399blacklist ${HOME}/.config/sink
400blacklist ${HOME}/.config/skypeforlinux
401blacklist ${HOME}/.config/slimjet
402blacklist ${HOME}/.config/smplayer
403blacklist ${HOME}/.config/smtube
404blacklist ${HOME}/.config/smuxi
405blacklist ${HOME}/.config/snox
406blacklist ${HOME}/.config/sound-juicer
407blacklist ${HOME}/.config/specialmailcollectionsrc
408blacklist ${HOME}/.config/spectaclerc
409blacklist ${HOME}/.config/spotify
410blacklist ${HOME}/.config/sqlitebrowser
411blacklist ${HOME}/.config/stellarium
412blacklist ${HOME}/.config/straw-viewer
413blacklist ${HOME}/.config/strawberry
414blacklist ${HOME}/.config/supertuxkart
415blacklist ${HOME}/.config/synfig
416blacklist ${HOME}/.config/teams
417blacklist ${HOME}/.config/teams-for-linux
418blacklist ${HOME}/.config/telepathy-account-widgets
419blacklist ${HOME}/.config/torbrowser
420blacklist ${HOME}/.config/totem
421blacklist ${HOME}/.config/tox
422blacklist ${HOME}/.config/transgui
423blacklist ${HOME}/.config/transmission
424blacklist ${HOME}/.config/truecraft
425blacklist ${HOME}/.config/tuta_integration
426blacklist ${HOME}/.config/tutanota-desktop
427blacklist ${HOME}/.config/tvbrowser
428blacklist ${HOME}/.config/uGet
429blacklist ${HOME}/.config/ungoogled-chromium
430blacklist ${HOME}/.config/uzbl
431blacklist ${HOME}/.config/viewnior
432blacklist ${HOME}/.config/vivaldi
433blacklist ${HOME}/.config/vivaldi-snapshot
434blacklist ${HOME}/.config/vlc
435blacklist ${HOME}/.config/wesnoth
436blacklist ${HOME}/.config/wireshark
437blacklist ${HOME}/.config/wormux
438blacklist ${HOME}/.config/xchat
439blacklist ${HOME}/.config/xed
440blacklist ${HOME}/.config/xfburn
441blacklist ${HOME}/.config/xfce4-dict
442blacklist ${HOME}/.config/xfce4/xfce4-notes.gtkrc
443blacklist ${HOME}/.config/xfce4/xfce4-notes.rc
444blacklist ${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
445blacklist ${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-mixer.xml
446blacklist ${HOME}/.config/xiaoyong
447blacklist ${HOME}/.config/xmms2
448blacklist ${HOME}/.config/xournalpp
449blacklist ${HOME}/.config/xplayer
450blacklist ${HOME}/.config/xreader
451blacklist ${HOME}/.config/xviewer
452blacklist ${HOME}/.config/yandex-browser
453blacklist ${HOME}/.config/yandex-browser-beta
454blacklist ${HOME}/.config/yelp
455blacklist ${HOME}/.config/youtube-dl
456blacklist ${HOME}/.config/youtube-dlg
457blacklist ${HOME}/.config/youtube-music-desktop-app
458blacklist ${HOME}/.config/youtube-viewer
459blacklist ${HOME}/.config/youtubemusic-nativefier-040164
460blacklist ${HOME}/.config/yt-dlp
461blacklist ${HOME}/.config/zathura
462blacklist ${HOME}/.config/zim
463blacklist ${HOME}/.config/zoomus.conf
464blacklist ${HOME}/.conkeror.mozdev.org
465blacklist ${HOME}/.crawl
466blacklist ${HOME}/.cups
467blacklist ${HOME}/.curl-hsts
468blacklist ${HOME}/.curlrc
469blacklist ${HOME}/.dashcore
470blacklist ${HOME}/.devilspie
471blacklist ${HOME}/.dia
472blacklist ${HOME}/.digrc
473blacklist ${HOME}/.dillo
474blacklist ${HOME}/.dooble
475blacklist ${HOME}/.dosbox
476blacklist ${HOME}/.dropbox*
477blacklist ${HOME}/.easystroke
478blacklist ${HOME}/.electron-cache
479blacklist ${HOME}/.electrum*
480blacklist ${HOME}/.elinks
481blacklist ${HOME}/.emacs
482blacklist ${HOME}/.emacs.d
483blacklist ${HOME}/.equalx
484blacklist ${HOME}/.ethereum
485blacklist ${HOME}/.etr
486blacklist ${HOME}/.filezilla
487blacklist ${HOME}/.firedragon
488blacklist ${HOME}/.flowblade
489blacklist ${HOME}/.fltk
490blacklist ${HOME}/.fossamail
491blacklist ${HOME}/.fpm
492blacklist ${HOME}/.freeciv
493blacklist ${HOME}/.freecol
494blacklist ${HOME}/.freemind
495blacklist ${HOME}/.frogatto
496blacklist ${HOME}/.frozen-bubble
497blacklist ${HOME}/.funnyboat
498blacklist ${HOME}/.gallery-dl.conf
499blacklist ${HOME}/.gimp*
500blacklist ${HOME}/.gist
501blacklist ${HOME}/.gitconfig
502blacklist ${HOME}/.gl-117
503blacklist ${HOME}/.glaxiumrc
504blacklist ${HOME}/.gnome/gnome-schedule
505blacklist ${HOME}/.googleearth
506blacklist ${HOME}/.gradle
507blacklist ${HOME}/.gramps
508blacklist ${HOME}/.guayadeque
509blacklist ${HOME}/.hashcat
510blacklist ${HOME}/.hedgewars
511blacklist ${HOME}/.hex-a-hop
512blacklist ${HOME}/.hugin
513blacklist ${HOME}/.i2p
514blacklist ${HOME}/.icedove
515blacklist ${HOME}/.imagej
516blacklist ${HOME}/.inkscape
517blacklist ${HOME}/.itch
518blacklist ${HOME}/.jack-server
519blacklist ${HOME}/.jack-settings
520blacklist ${HOME}/.jak
521blacklist ${HOME}/.java
522blacklist ${HOME}/.jd
523blacklist ${HOME}/.jitsi
524blacklist ${HOME}/.jumpnbump
525blacklist ${HOME}/.kde/share/apps/digikam
526blacklist ${HOME}/.kde/share/apps/gwenview
527blacklist ${HOME}/.kde/share/apps/kaffeine
528blacklist ${HOME}/.kde/share/apps/kcookiejar
529blacklist ${HOME}/.kde/share/apps/kget
530blacklist ${HOME}/.kde/share/apps/khtml
531blacklist ${HOME}/.kde/share/apps/klatexformula
532blacklist ${HOME}/.kde/share/apps/konqsidebartng
533blacklist ${HOME}/.kde/share/apps/konqueror
534blacklist ${HOME}/.kde/share/apps/kopete
535blacklist ${HOME}/.kde/share/apps/ktorrent
536blacklist ${HOME}/.kde/share/apps/okular
537blacklist ${HOME}/.kde/share/config/baloofilerc
538blacklist ${HOME}/.kde/share/config/baloorc
539blacklist ${HOME}/.kde/share/config/digikam
540blacklist ${HOME}/.kde/share/config/gwenviewrc
541blacklist ${HOME}/.kde/share/config/k3brc
542blacklist ${HOME}/.kde/share/config/kaffeinerc
543blacklist ${HOME}/.kde/share/config/kcookiejarrc
544blacklist ${HOME}/.kde/share/config/kfindrc
545blacklist ${HOME}/.kde/share/config/kgetrc
546blacklist ${HOME}/.kde/share/config/khtmlrc
547blacklist ${HOME}/.kde/share/config/klipperrc
548blacklist ${HOME}/.kde/share/config/kmplayerrc
549blacklist ${HOME}/.kde/share/config/konq_history
550blacklist ${HOME}/.kde/share/config/konqsidebartngrc
551blacklist ${HOME}/.kde/share/config/konquerorrc
552blacklist ${HOME}/.kde/share/config/konversationrc
553blacklist ${HOME}/.kde/share/config/kopeterc
554blacklist ${HOME}/.kde/share/config/ktorrentrc
555blacklist ${HOME}/.kde/share/config/okularpartrc
556blacklist ${HOME}/.kde/share/config/okularrc
557blacklist ${HOME}/.kde4/share/apps/digikam
558blacklist ${HOME}/.kde4/share/apps/gwenview
559blacklist ${HOME}/.kde4/share/apps/kaffeine
560blacklist ${HOME}/.kde4/share/apps/kcookiejar
561blacklist ${HOME}/.kde4/share/apps/kget
562blacklist ${HOME}/.kde4/share/apps/khtml
563blacklist ${HOME}/.kde4/share/apps/konqsidebartng
564blacklist ${HOME}/.kde4/share/apps/konqueror
565blacklist ${HOME}/.kde4/share/apps/kopete
566blacklist ${HOME}/.kde4/share/apps/ktorrent
567blacklist ${HOME}/.kde4/share/apps/okular
568blacklist ${HOME}/.kde4/share/config/baloofilerc
569blacklist ${HOME}/.kde4/share/config/baloorc
570blacklist ${HOME}/.kde4/share/config/digikam
571blacklist ${HOME}/.kde4/share/config/gwenviewrc
572blacklist ${HOME}/.kde4/share/config/k3brc
573blacklist ${HOME}/.kde4/share/config/kaffeinerc
574blacklist ${HOME}/.kde4/share/config/kcookiejarrc
575blacklist ${HOME}/.kde4/share/config/kfindrc
576blacklist ${HOME}/.kde4/share/config/kgetrc
577blacklist ${HOME}/.kde4/share/config/khtmlrc
578blacklist ${HOME}/.kde4/share/config/klipperrc
579blacklist ${HOME}/.kde4/share/config/konq_history
580blacklist ${HOME}/.kde4/share/config/konqsidebartngrc
581blacklist ${HOME}/.kde4/share/config/konquerorrc
582blacklist ${HOME}/.kde4/share/config/konversationrc
583blacklist ${HOME}/.kde4/share/config/kopeterc
584blacklist ${HOME}/.kde4/share/config/ktorrentrc
585blacklist ${HOME}/.kde4/share/config/okularpartrc
586blacklist ${HOME}/.kde4/share/config/okularrc
587blacklist ${HOME}/.keepass
588blacklist ${HOME}/.keepassx
589blacklist ${HOME}/.keepassxc
590blacklist ${HOME}/.killingfloor
591blacklist ${HOME}/.kingsoft
592blacklist ${HOME}/.kino-history
593blacklist ${HOME}/.kinorc
594blacklist ${HOME}/.klatexformula
595blacklist ${HOME}/.klei
596blacklist ${HOME}/.kodi
597blacklist ${HOME}/.lastpass
598blacklist ${HOME}/.librewolf
599blacklist ${HOME}/.lincity-ng
600blacklist ${HOME}/.links
601blacklist ${HOME}/.links2
602blacklist ${HOME}/.linphone-history.db
603blacklist ${HOME}/.linphonerc
604blacklist ${HOME}/.lmmsrc.xml
605blacklist ${HOME}/.local/lib/vivaldi
606blacklist ${HOME}/.local/share/0ad
607blacklist ${HOME}/.local/share/3909/PapersPlease
608blacklist ${HOME}/.local/share/Anki2
609blacklist ${HOME}/.local/share/Dredmor
610blacklist ${HOME}/.local/share/Empathy
611blacklist ${HOME}/.local/share/Enpass
612blacklist ${HOME}/.local/share/FasterThanLight
613blacklist ${HOME}/.local/share/Flavio Tordini
614blacklist ${HOME}/.local/share/IntoTheBreach
615blacklist ${HOME}/.local/share/JetBrains
616blacklist ${HOME}/.local/share/KDE/neochat
617blacklist ${HOME}/.local/share/KeePass
618blacklist ${HOME}/.local/share/Kingsoft
619blacklist ${HOME}/.local/share/LibreCAD
620blacklist ${HOME}/.local/share/Mendeley Ltd.
621blacklist ${HOME}/.local/share/Mumble
622blacklist ${HOME}/.local/share/Nextcloud
623blacklist ${HOME}/.local/share/PBE
624blacklist ${HOME}/.local/share/Paradox Interactive
625blacklist ${HOME}/.local/share/PawelStolowski
626blacklist ${HOME}/.local/share/PillarsOfEternity
627blacklist ${HOME}/.local/share/Psi
628blacklist ${HOME}/.local/share/QGIS
629blacklist ${HOME}/.local/share/QMediathekView
630blacklist ${HOME}/.local/share/QuiteRss
631blacklist ${HOME}/.local/share/Ricochet
632blacklist ${HOME}/.local/share/RogueLegacy
633blacklist ${HOME}/.local/share/RogueLegacyStorageContainer
634blacklist ${HOME}/.local/share/Shortwave
635blacklist ${HOME}/.local/share/Steam
636blacklist ${HOME}/.local/share/SteamWorld Dig 2
637blacklist ${HOME}/.local/share/SteamWorldDig
638blacklist ${HOME}/.local/share/SuperHexagon
639blacklist ${HOME}/.local/share/TelegramDesktop
640blacklist ${HOME}/.local/share/Terraria
641blacklist ${HOME}/.local/share/TpLogger
642blacklist ${HOME}/.local/share/Zeal
643blacklist ${HOME}/.local/share/agenda
644blacklist ${HOME}/.local/share/akonadi*
645blacklist ${HOME}/.local/share/akregator
646blacklist ${HOME}/.local/share/apps/korganizer
647blacklist ${HOME}/.local/share/aspyr-media
648blacklist ${HOME}/.local/share/authenticator-rs
649blacklist ${HOME}/.local/share/autokey
650blacklist ${HOME}/.local/share/backintime
651blacklist ${HOME}/.local/share/baloo
652blacklist ${HOME}/.local/share/barrier
653blacklist ${HOME}/.local/share/bibletime
654blacklist ${HOME}/.local/share/bijiben
655blacklist ${HOME}/.local/share/bohemiainteractive
656blacklist ${HOME}/.local/share/caja-python
657blacklist ${HOME}/.local/share/calligragemini
658blacklist ${HOME}/.local/share/cantata
659blacklist ${HOME}/.local/share/cdprojektred
660blacklist ${HOME}/.local/share/clipit
661blacklist ${HOME}/.local/share/com.github.johnfactotum.Foliate
662blacklist ${HOME}/.local/share/contacts
663blacklist ${HOME}/.local/share/cor-games
664blacklist ${HOME}/.local/share/data/Mendeley Ltd.
665blacklist ${HOME}/.local/share/data/Mumble
666blacklist ${HOME}/.local/share/data/MusE
667blacklist ${HOME}/.local/share/data/MuseScore
668blacklist ${HOME}/.local/share/data/nomacs
669blacklist ${HOME}/.local/share/data/qBittorrent
670blacklist ${HOME}/.local/share/dino
671blacklist ${HOME}/.local/share/dolphin
672blacklist ${HOME}/.local/share/dolphin-emu
673blacklist ${HOME}/.local/share/emailidentities
674blacklist ${HOME}/.local/share/epiphany
675blacklist ${HOME}/.local/share/evolution
676blacklist ${HOME}/.local/share/feedreader
677blacklist ${HOME}/.local/share/feral-interactive
678blacklist ${HOME}/.local/share/five-or-more
679blacklist ${HOME}/.local/share/freecol
680blacklist ${HOME}/.local/share/gajim
681blacklist ${HOME}/.local/share/geary
682blacklist ${HOME}/.local/share/geeqie
683blacklist ${HOME}/.local/share/ghostwriter
684blacklist ${HOME}/.local/share/gitg
685blacklist ${HOME}/.local/share/gnome-2048
686blacklist ${HOME}/.local/share/gnome-boxes
687blacklist ${HOME}/.local/share/gnome-builder
688blacklist ${HOME}/.local/share/gnome-chess
689blacklist ${HOME}/.local/share/gnome-klotski
690blacklist ${HOME}/.local/share/gnome-latex
691blacklist ${HOME}/.local/share/gnome-mines
692blacklist ${HOME}/.local/share/gnome-music
693blacklist ${HOME}/.local/share/gnome-nibbles
694blacklist ${HOME}/.local/share/gnome-photos
695blacklist ${HOME}/.local/share/gnome-pomodoro
696blacklist ${HOME}/.local/share/gnome-recipes
697blacklist ${HOME}/.local/share/gnome-ring
698blacklist ${HOME}/.local/share/gnome-sudoku
699blacklist ${HOME}/.local/share/gnome-twitch
700blacklist ${HOME}/.local/share/gnote
701blacklist ${HOME}/.local/share/godot
702blacklist ${HOME}/.local/share/gradio
703blacklist ${HOME}/.local/share/gwenview
704blacklist ${HOME}/.local/share/i2p
705blacklist ${HOME}/.local/share/io.github.lainsce.Notejot
706blacklist ${HOME}/.local/share/jami
707blacklist ${HOME}/.local/share/kaffeine
708blacklist ${HOME}/.local/share/kalgebra
709blacklist ${HOME}/.local/share/kate
710blacklist ${HOME}/.local/share/kdenlive
711blacklist ${HOME}/.local/share/keepass
712blacklist ${HOME}/.local/share/kget
713blacklist ${HOME}/.local/share/kiwix
714blacklist ${HOME}/.local/share/kiwix-desktop
715blacklist ${HOME}/.local/share/klavaro
716blacklist ${HOME}/.local/share/kmail2
717blacklist ${HOME}/.local/share/kmplayer
718blacklist ${HOME}/.local/share/knotes
719blacklist ${HOME}/.local/share/krita
720blacklist ${HOME}/.local/share/ktorrent
721blacklist ${HOME}/.local/share/ktorrentrc
722blacklist ${HOME}/.local/share/ktouch
723blacklist ${HOME}/.local/share/kube
724blacklist ${HOME}/.local/share/kwrite
725blacklist ${HOME}/.local/share/kxmlgui5/*
726blacklist ${HOME}/.local/share/liferea
727blacklist ${HOME}/.local/share/linphone
728blacklist ${HOME}/.local/share/local-mail
729blacklist ${HOME}/.local/share/lollypop
730blacklist ${HOME}/.local/share/love
731blacklist ${HOME}/.local/share/lugaru
732blacklist ${HOME}/.local/share/lutris
733blacklist ${HOME}/.local/share/man
734blacklist ${HOME}/.local/share/mana
735blacklist ${HOME}/.local/share/maps-places.json
736blacklist ${HOME}/.local/share/matrix-mirage
737blacklist ${HOME}/.local/share/mcomix
738blacklist ${HOME}/.local/share/meld
739blacklist ${HOME}/.local/share/midori
740blacklist ${HOME}/.local/share/minder
741blacklist ${HOME}/.local/share/mirage
742blacklist ${HOME}/.local/share/multimc
743blacklist ${HOME}/.local/share/multimc5
744blacklist ${HOME}/.local/share/mupen64plus
745blacklist ${HOME}/.local/share/mypaint
746blacklist ${HOME}/.local/share/nautilus
747blacklist ${HOME}/.local/share/nautilus-python
748blacklist ${HOME}/.local/share/nemo
749blacklist ${HOME}/.local/share/nemo-python
750blacklist ${HOME}/.local/share/news-flash
751blacklist ${HOME}/.local/share/newsbeuter
752blacklist ${HOME}/.local/share/newsboat
753blacklist ${HOME}/.local/share/nheko
754blacklist ${HOME}/.local/share/nomacs
755blacklist ${HOME}/.local/share/notes
756blacklist ${HOME}/.local/share/ocenaudio
757blacklist ${HOME}/.local/share/okular
758blacklist ${HOME}/.local/share/onlyoffice
759blacklist ${HOME}/.local/share/openmw
760blacklist ${HOME}/.local/share/orage
761blacklist ${HOME}/.local/share/org.kde.gwenview
762blacklist ${HOME}/.local/share/pix
763blacklist ${HOME}/.local/share/plasma_notes
764blacklist ${HOME}/.local/share/profanity
765blacklist ${HOME}/.local/share/psi
766blacklist ${HOME}/.local/share/psi+
767blacklist ${HOME}/.local/share/qpdfview
768blacklist ${HOME}/.local/share/quadrapassel
769blacklist ${HOME}/.local/share/qutebrowser
770blacklist ${HOME}/.local/share/remmina
771blacklist ${HOME}/.local/share/rhythmbox
772blacklist ${HOME}/.local/share/rtv
773blacklist ${HOME}/.local/share/scribus
774blacklist ${HOME}/.local/share/shotwell
775blacklist ${HOME}/.local/share/signal-cli
776blacklist ${HOME}/.local/share/sink
777blacklist ${HOME}/.local/share/smuxi
778blacklist ${HOME}/.local/share/spotify
779blacklist ${HOME}/.local/share/steam
780blacklist ${HOME}/.local/share/strawberry
781blacklist ${HOME}/.local/share/supertux2
782blacklist ${HOME}/.local/share/supertuxkart
783blacklist ${HOME}/.local/share/swell-foop
784blacklist ${HOME}/.local/share/telepathy
785blacklist ${HOME}/.local/share/terasology
786blacklist ${HOME}/.local/share/torbrowser
787blacklist ${HOME}/.local/share/totem
788blacklist ${HOME}/.local/share/uzbl
789blacklist ${HOME}/.local/share/vlc
790blacklist ${HOME}/.local/share/vpltd
791blacklist ${HOME}/.local/share/vulkan
792blacklist ${HOME}/.local/share/warsow-2.1
793blacklist ${HOME}/.local/share/wesnoth
794blacklist ${HOME}/.local/share/wormux
795blacklist ${HOME}/.local/share/xplayer
796blacklist ${HOME}/.local/share/xreader
797blacklist ${HOME}/.local/share/zathura
798blacklist ${HOME}/.local/state/pipewire
799blacklist ${HOME}/.lv2
800blacklist ${HOME}/.lyx
801blacklist ${HOME}/.magicor
802blacklist ${HOME}/.masterpdfeditor
803blacklist ${HOME}/.mbwarband
804blacklist ${HOME}/.mcabber
805blacklist ${HOME}/.mcabberrc
806blacklist ${HOME}/.mediathek3
807blacklist ${HOME}/.megaglest
808blacklist ${HOME}/.minecraft
809blacklist ${HOME}/.minetest
810blacklist ${HOME}/.mirrormagic
811blacklist ${HOME}/.moc
812blacklist ${HOME}/.moonchild productions/basilisk
813blacklist ${HOME}/.moonchild productions/pale moon
814blacklist ${HOME}/.mozilla
815blacklist ${HOME}/.mp3splt-gtk
816blacklist ${HOME}/.mpd
817blacklist ${HOME}/.mpdconf
818blacklist ${HOME}/.mplayer
819blacklist ${HOME}/.msmtprc
820blacklist ${HOME}/.multimc5
821blacklist ${HOME}/.nanorc
822blacklist ${HOME}/.netactview
823blacklist ${HOME}/.neverball
824blacklist ${HOME}/.newsbeuter
825blacklist ${HOME}/.newsboat
826blacklist ${HOME}/.newsrc
827blacklist ${HOME}/.nicotine
828blacklist ${HOME}/.node-gyp
829blacklist ${HOME}/.npm
830blacklist ${HOME}/.npmrc
831blacklist ${HOME}/.nv
832blacklist ${HOME}/.nvm
833blacklist ${HOME}/.nylas-mail
834blacklist ${HOME}/.openarena
835blacklist ${HOME}/.opencity
836blacklist ${HOME}/.openinvaders
837blacklist ${HOME}/.openshot
838blacklist ${HOME}/.openshot_qt
839blacklist ${HOME}/.openttd
840blacklist ${HOME}/.opera
841blacklist ${HOME}/.opera-beta
842blacklist ${HOME}/.ostrichriders
843blacklist ${HOME}/.paradoxinteractive
844blacklist ${HOME}/.parallelrealities/blobwars
845blacklist ${HOME}/.password-store
846blacklist ${HOME}/.pcsxr
847blacklist ${HOME}/.penguin-command
848blacklist ${HOME}/.pine-crash
849blacklist ${HOME}/.pine-debug1
850blacklist ${HOME}/.pine-debug2
851blacklist ${HOME}/.pine-debug3
852blacklist ${HOME}/.pine-debug4
853blacklist ${HOME}/.pine-interrupted-mail
854blacklist ${HOME}/.pinerc
855blacklist ${HOME}/.pinercex
856blacklist ${HOME}/.pingus
857blacklist ${HOME}/.pioneer
858blacklist ${HOME}/.purple
859blacklist ${HOME}/.pylint.d
860blacklist ${HOME}/.qemu-launcher
861blacklist ${HOME}/.qgis2
862blacklist ${HOME}/.qmmp
863blacklist ${HOME}/.quodlibet
864blacklist ${HOME}/.redeclipse
865blacklist ${HOME}/.rednotebook
866blacklist ${HOME}/.remmina
867blacklist ${HOME}/.repo_.gitconfig.json
868blacklist ${HOME}/.repoconfig
869blacklist ${HOME}/.retroshare
870blacklist ${HOME}/.ripperXrc
871blacklist ${HOME}/.scorched3d
872blacklist ${HOME}/.scribus
873blacklist ${HOME}/.scribusrc
874blacklist ${HOME}/.simutrans
875blacklist ${HOME}/.smartgit/*/passwords
876blacklist ${HOME}/.ssr
877blacklist ${HOME}/.steam
878blacklist ${HOME}/.steampath
879blacklist ${HOME}/.steampid
880blacklist ${HOME}/.stellarium
881blacklist ${HOME}/.subversion
882blacklist ${HOME}/.surf
883blacklist ${HOME}/.suve/colorful
884blacklist ${HOME}/.swb.ini
885blacklist ${HOME}/.sword
886blacklist ${HOME}/.sylpheed-2.0
887blacklist ${HOME}/.synfig
888blacklist ${HOME}/.tb
889blacklist ${HOME}/.tconn
890blacklist ${HOME}/.teeworlds
891blacklist ${HOME}/.texlive20*
892blacklist ${HOME}/.thunderbird
893blacklist ${HOME}/.tilp
894blacklist ${HOME}/.tin
895blacklist ${HOME}/.tooling
896blacklist ${HOME}/.tor-browser*
897blacklist ${HOME}/.torcs
898blacklist ${HOME}/.tremulous
899blacklist ${HOME}/.ts3client
900blacklist ${HOME}/.tuxguitar*
901blacklist ${HOME}/.tvbrowser
902blacklist ${HOME}/.unknown-horizons
903blacklist ${HOME}/.viking
904blacklist ${HOME}/.viking-maps
905blacklist ${HOME}/.vim
906blacklist ${HOME}/.vimrc
907blacklist ${HOME}/.vmware
908blacklist ${HOME}/.vscode
909blacklist ${HOME}/.vscode-oss
910blacklist ${HOME}/.vst
911blacklist ${HOME}/.vultures
912blacklist ${HOME}/.w3m
913blacklist ${HOME}/.warzone2100-3.*
914blacklist ${HOME}/.waterfox
915blacklist ${HOME}/.weechat
916blacklist ${HOME}/.wget-hsts
917blacklist ${HOME}/.wgetrc
918blacklist ${HOME}/.widelands
919blacklist ${HOME}/.wine
920blacklist ${HOME}/.wine64
921blacklist ${HOME}/.wireshark
922blacklist ${HOME}/.wordwarvi
923blacklist ${HOME}/.wormux
924blacklist ${HOME}/.xiphos
925blacklist ${HOME}/.xmind
926blacklist ${HOME}/.xmms
927blacklist ${HOME}/.xmr-stak
928blacklist ${HOME}/.xonotic
929blacklist ${HOME}/.xournalpp
930blacklist ${HOME}/.xpdfrc
931blacklist ${HOME}/.yarn
932blacklist ${HOME}/.yarn-config
933blacklist ${HOME}/.yarncache
934blacklist ${HOME}/.yarnrc
935blacklist ${HOME}/.zoom
936blacklist ${HOME}/Arduino
937blacklist ${HOME}/Monero/wallets
938blacklist ${HOME}/Nextcloud
939blacklist ${HOME}/Nextcloud/Notes
940blacklist ${HOME}/SoftMaker
941blacklist ${HOME}/Standard Notes Backups
942blacklist ${HOME}/TeamSpeak3-Client-linux_amd64
943blacklist ${HOME}/TeamSpeak3-Client-linux_x86
944blacklist ${HOME}/hyperrogue.ini
945blacklist ${HOME}/i2p
946blacklist ${HOME}/mps
947blacklist ${HOME}/wallet.dat
948blacklist ${HOME}/yt-dlp.conf
949blacklist ${RUNUSER}/*firefox*
950blacklist /tmp/.wine-*
951blacklist /tmp/akonadi-*
952blacklist /var/games/nethack
953blacklist /var/games/slashem
954blacklist /var/games/vulturesclaw
955blacklist /var/games/vultureseye
956blacklist /var/lib/games/Maelstrom-Scores
957
958# ${HOME}/.cache directory
959blacklist ${HOME}/.cache/0ad
960blacklist ${HOME}/.cache/8pecxstudios
961blacklist ${HOME}/.cache/Authenticator
962blacklist ${HOME}/.cache/BraveSoftware
963blacklist ${HOME}/.cache/Clementine
964blacklist ${HOME}/.cache/ENCOM/Spectral
965blacklist ${HOME}/.cache/Enox
966blacklist ${HOME}/.cache/Enpass
967blacklist ${HOME}/.cache/Ferdi
968blacklist ${HOME}/.cache/Flavio Tordini
969blacklist ${HOME}/.cache/Franz
970blacklist ${HOME}/.cache/INRIA
971blacklist ${HOME}/.cache/INRIA/Natron
972blacklist ${HOME}/.cache/KDE/neochat
973blacklist ${HOME}/.cache/Mendeley Ltd.
974blacklist ${HOME}/.cache/MusicBrainz
975blacklist ${HOME}/.cache/NewsFlashGTK
976blacklist ${HOME}/.cache/Otter
977blacklist ${HOME}/.cache/PawelStolowski
978blacklist ${HOME}/.cache/Psi
979blacklist ${HOME}/.cache/QuiteRss
980blacklist ${HOME}/.cache/Quotient/quaternion
981blacklist ${HOME}/.cache/Shortwave
982blacklist ${HOME}/.cache/Tox
983blacklist ${HOME}/.cache/Zeal
984blacklist ${HOME}/.cache/agenda
985blacklist ${HOME}/.cache/akonadi*
986blacklist ${HOME}/.cache/atril
987blacklist ${HOME}/.cache/attic
988blacklist ${HOME}/.cache/babl
989blacklist ${HOME}/.cache/bnox
990blacklist ${HOME}/.cache/borg
991blacklist ${HOME}/.cache/calibre
992blacklist ${HOME}/.cache/cantata
993blacklist ${HOME}/.cache/champlain
994blacklist ${HOME}/.cache/chromium
995blacklist ${HOME}/.cache/chromium-dev
996blacklist ${HOME}/.cache/cliqz
997blacklist ${HOME}/.cache/com.github.johnfactotum.Foliate
998blacklist ${HOME}/.cache/darktable
999blacklist ${HOME}/.cache/deja-dup
1000blacklist ${HOME}/.cache/discover
1001blacklist ${HOME}/.cache/dnox
1002blacklist ${HOME}/.cache/dolphin
1003blacklist ${HOME}/.cache/dolphin-emu
1004blacklist ${HOME}/.cache/ephemeral
1005blacklist ${HOME}/.cache/epiphany
1006blacklist ${HOME}/.cache/evolution
1007blacklist ${HOME}/.cache/falkon
1008blacklist ${HOME}/.cache/feedreader
1009blacklist ${HOME}/.cache/firedragon
1010blacklist ${HOME}/.cache/flaska.net/trojita
1011blacklist ${HOME}/.cache/folks
1012blacklist ${HOME}/.cache/font-manager
1013blacklist ${HOME}/.cache/fossamail
1014blacklist ${HOME}/.cache/fractal
1015blacklist ${HOME}/.cache/freecol
1016blacklist ${HOME}/.cache/gajim
1017blacklist ${HOME}/.cache/geary
1018blacklist ${HOME}/.cache/geeqie
1019blacklist ${HOME}/.cache/gegl-0.4
1020blacklist ${HOME}/.cache/gfeeds
1021blacklist ${HOME}/.cache/gimp
1022blacklist ${HOME}/.cache/gnome-boxes
1023blacklist ${HOME}/.cache/gnome-builder
1024blacklist ${HOME}/.cache/gnome-control-center
1025blacklist ${HOME}/.cache/gnome-recipes
1026blacklist ${HOME}/.cache/gnome-screenshot
1027blacklist ${HOME}/.cache/gnome-software
1028blacklist ${HOME}/.cache/gnome-twitch
1029blacklist ${HOME}/.cache/godot
1030blacklist ${HOME}/.cache/google-chrome
1031blacklist ${HOME}/.cache/google-chrome-beta
1032blacklist ${HOME}/.cache/google-chrome-unstable
1033blacklist ${HOME}/.cache/gradio
1034blacklist ${HOME}/.cache/gummi
1035blacklist ${HOME}/.cache/icedove
1036blacklist ${HOME}/.cache/inkscape
1037blacklist ${HOME}/.cache/inox
1038blacklist ${HOME}/.cache/io.github.lainsce.Notejot
1039blacklist ${HOME}/.cache/iridium
1040blacklist ${HOME}/.cache/JetBrains/CLion*
1041blacklist ${HOME}/.cache/kcmshell5
1042blacklist ${HOME}/.cache/kdenlive
1043blacklist ${HOME}/.cache/keepassxc
1044blacklist ${HOME}/.cache/kfind
1045blacklist ${HOME}/.cache/kinfocenter
1046blacklist ${HOME}/.cache/kmail2
1047blacklist ${HOME}/.cache/krunner
1048blacklist ${HOME}/.cache/krunnerbookmarkrunnerfirefoxdbfile.sqlite*
1049blacklist ${HOME}/.cache/kscreenlocker_greet
1050blacklist ${HOME}/.cache/ksmserver-logout-greeter
1051blacklist ${HOME}/.cache/ksplashqml
1052blacklist ${HOME}/.cache/kube
1053blacklist ${HOME}/.cache/kwin
1054blacklist ${HOME}/.cache/libgweather
1055blacklist ${HOME}/.cache/librewolf
1056blacklist ${HOME}/.cache/liferea
1057blacklist ${HOME}/.cache/lutris
1058blacklist ${HOME}/.cache/marker
1059blacklist ${HOME}/.cache/matrix-mirage
1060blacklist ${HOME}/.cache/microsoft-edge-beta
1061blacklist ${HOME}/.cache/microsoft-edge-dev
1062blacklist ${HOME}/.cache/midori
1063blacklist ${HOME}/.cache/minetest
1064blacklist ${HOME}/.cache/mirage
1065blacklist ${HOME}/.cache/moonchild productions/basilisk
1066blacklist ${HOME}/.cache/moonchild productions/pale moon
1067blacklist ${HOME}/.cache/mozilla
1068blacklist ${HOME}/.cache/ms-excel-online
1069blacklist ${HOME}/.cache/ms-office-online
1070blacklist ${HOME}/.cache/ms-onenote-online
1071blacklist ${HOME}/.cache/ms-outlook-online
1072blacklist ${HOME}/.cache/ms-powerpoint-online
1073blacklist ${HOME}/.cache/ms-skype-online
1074blacklist ${HOME}/.cache/ms-word-online
1075blacklist ${HOME}/.cache/mutt
1076blacklist ${HOME}/.cache/mypaint
1077blacklist ${HOME}/.cache/netsurf
1078blacklist ${HOME}/.cache/nheko
1079blacklist ${HOME}/.cache/okular
1080blacklist ${HOME}/.cache/opera
1081blacklist ${HOME}/.cache/opera-beta
1082blacklist ${HOME}/.cache/org.gabmus.gfeeds
1083blacklist ${HOME}/.cache/org.gnome.Books
1084blacklist ${HOME}/.cache/org.gnome.Maps
1085blacklist ${HOME}/.cache/pdfmod
1086blacklist ${HOME}/.cache/peek
1087blacklist ${HOME}/.cache/pip
1088blacklist ${HOME}/.cache/pipe-viewer
1089blacklist ${HOME}/.cache/plasmashell
1090blacklist ${HOME}/.cache/plasmashellbookmarkrunnerfirefoxdbfile.sqlite*
1091blacklist ${HOME}/.cache/psi
1092blacklist ${HOME}/.cache/qBittorrent
1093blacklist ${HOME}/.cache/quodlibet
1094blacklist ${HOME}/.cache/qupzilla
1095blacklist ${HOME}/.cache/qutebrowser
1096blacklist ${HOME}/.cache/rednotebook
1097blacklist ${HOME}/.cache/rhythmbox
1098blacklist ${HOME}/.cache/shotwell
1099blacklist ${HOME}/.cache/simple-scan
1100blacklist ${HOME}/.cache/slimjet
1101blacklist ${HOME}/.cache/smuxi
1102blacklist ${HOME}/.cache/snox
1103blacklist ${HOME}/.cache/spotify
1104blacklist ${HOME}/.cache/straw-viewer
1105blacklist ${HOME}/.cache/strawberry
1106blacklist ${HOME}/.cache/supertuxkart
1107blacklist ${HOME}/.cache/systemsettings
1108blacklist ${HOME}/.cache/telepathy
1109blacklist ${HOME}/.cache/thunderbird
1110blacklist ${HOME}/.cache/torbrowser
1111blacklist ${HOME}/.cache/transmission
1112blacklist ${HOME}/.cache/ungoogled-chromium
1113blacklist ${HOME}/.cache/vivaldi
1114blacklist ${HOME}/.cache/vivaldi-snapshot
1115blacklist ${HOME}/.cache/vlc
1116blacklist ${HOME}/.cache/vmware
1117blacklist ${HOME}/.cache/warsow-2.1
1118blacklist ${HOME}/.cache/waterfox
1119blacklist ${HOME}/.cache/wesnoth
1120blacklist ${HOME}/.cache/winetricks
1121blacklist ${HOME}/.cache/xmms2
1122blacklist ${HOME}/.cache/xournalpp
1123blacklist ${HOME}/.cache/xreader
1124blacklist ${HOME}/.cache/yandex-browser
1125blacklist ${HOME}/.cache/yandex-browser-beta
1126blacklist ${HOME}/.cache/youtube-dl
1127blacklist ${HOME}/.cache/youtube-viewer
1128blacklist ${HOME}/.cache/yt-dlp
1129blacklist ${HOME}/.cache/zim
diff --git a/etc/inc/disable-shell.inc b/etc/inc/disable-shell.inc
new file mode 100644
index 000000000..8274b0215
--- /dev/null
+++ b/etc/inc/disable-shell.inc
@@ -0,0 +1,15 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-shell.local
4
5blacklist ${PATH}/bash
6blacklist ${PATH}/csh
7blacklist ${PATH}/dash
8blacklist ${PATH}/fish
9blacklist ${PATH}/ksh
10blacklist ${PATH}/mksh
11blacklist ${PATH}/oksh
12blacklist ${PATH}/sh
13blacklist ${PATH}/tclsh
14blacklist ${PATH}/tcsh
15blacklist ${PATH}/zsh
diff --git a/etc/inc/disable-write-mnt.inc b/etc/inc/disable-write-mnt.inc
new file mode 100644
index 000000000..01f57cb0f
--- /dev/null
+++ b/etc/inc/disable-write-mnt.inc
@@ -0,0 +1,8 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-write-mnt.local
4
5read-only /media
6read-only /mnt
7read-only /run/media
8read-only /run/mount
diff --git a/etc/inc/disable-xdg.inc b/etc/inc/disable-xdg.inc
new file mode 100644
index 000000000..22acf272d
--- /dev/null
+++ b/etc/inc/disable-xdg.inc
@@ -0,0 +1,12 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include disable-xdg.local
4
5blacklist ${DOCUMENTS}
6blacklist ${MUSIC}
7blacklist ${PICTURES}
8blacklist ${VIDEOS}
9
10# The following should be considered catch-all directories
11#blacklist ${DESKTOP}
12#blacklist ${DOWNLOADS}
diff --git a/etc/inc/whitelist-1793-workaround.inc b/etc/inc/whitelist-1793-workaround.inc
new file mode 100644
index 000000000..862837f12
--- /dev/null
+++ b/etc/inc/whitelist-1793-workaround.inc
@@ -0,0 +1,29 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-1793-workaround.local
4# This works around bug 1793, and allows whitelisting to be used for some KDE applications.
5
6noblacklist ${HOME}/.config/ibus
7noblacklist ${HOME}/.config/mimeapps.list
8noblacklist ${HOME}/.config/pkcs11
9noblacklist ${HOME}/.config/user-dirs.dirs
10noblacklist ${HOME}/.config/user-dirs.locale
11noblacklist ${HOME}/.config/dconf
12noblacklist ${HOME}/.config/fontconfig
13noblacklist ${HOME}/.config/gtk-2.0
14noblacklist ${HOME}/.config/gtk-3.0
15noblacklist ${HOME}/.config/gtk-4.0
16noblacklist ${HOME}/.config/gtkrc
17noblacklist ${HOME}/.config/gtkrc-2.0
18noblacklist ${HOME}/.config/Kvantum
19noblacklist ${HOME}/.config/Trolltech.conf
20noblacklist ${HOME}/.config/QtProject.conf
21noblacklist ${HOME}/.config/kdeglobals
22noblacklist ${HOME}/.config/kio_httprc
23noblacklist ${HOME}/.config/kioslaverc
24noblacklist ${HOME}/.config/ksslcablacklist
25noblacklist ${HOME}/.config/qt5ct
26noblacklist ${HOME}/.config/qtcurve
27
28blacklist ${HOME}/.config/*
29whitelist ${HOME}/.config
diff --git a/etc/inc/whitelist-common.inc b/etc/inc/whitelist-common.inc
new file mode 100644
index 000000000..fedfb2bc2
--- /dev/null
+++ b/etc/inc/whitelist-common.inc
@@ -0,0 +1,85 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-common.local
4
5# common whitelist for all profiles
6
7whitelist ${HOME}/.XCompose
8whitelist ${HOME}/.alsaequal.bin
9whitelist ${HOME}/.asoundrc
10whitelist ${HOME}/.config/ibus
11whitelist ${HOME}/.config/mimeapps.list
12whitelist ${HOME}/.config/pkcs11
13read-only ${HOME}/.config/pkcs11
14whitelist ${HOME}/.config/user-dirs.dirs
15read-only ${HOME}/.config/user-dirs.dirs
16whitelist ${HOME}/.config/user-dirs.locale
17read-only ${HOME}/.config/user-dirs.locale
18whitelist ${HOME}/.drirc
19whitelist ${HOME}/.icons
20?HAS_APPIMAGE: whitelist ${HOME}/.local/share/appimagekit
21whitelist ${HOME}/.local/share/applications
22read-only ${HOME}/.local/share/applications
23whitelist ${HOME}/.local/share/icons
24whitelist ${HOME}/.local/share/mime
25whitelist ${HOME}/.mime.types
26whitelist ${HOME}/.sndio/cookie
27whitelist ${HOME}/.uim.d
28
29# dconf
30mkdir ${HOME}/.config/dconf
31whitelist ${HOME}/.config/dconf
32
33# fonts
34whitelist ${HOME}/.cache/fontconfig
35whitelist ${HOME}/.config/fontconfig
36whitelist ${HOME}/.fontconfig
37whitelist ${HOME}/.fonts
38whitelist ${HOME}/.fonts.conf
39whitelist ${HOME}/.fonts.conf.d
40whitelist ${HOME}/.fonts.d
41whitelist ${HOME}/.local/share/fonts
42whitelist ${HOME}/.pangorc
43
44# gtk
45whitelist ${HOME}/.config/gtk-2.0
46whitelist ${HOME}/.config/gtk-3.0
47whitelist ${HOME}/.config/gtk-4.0
48whitelist ${HOME}/.config/gtkrc
49whitelist ${HOME}/.config/gtkrc-2.0
50whitelist ${HOME}/.gnome2
51whitelist ${HOME}/.gnome2-private
52whitelist ${HOME}/.gtk-2.0
53whitelist ${HOME}/.gtkrc
54whitelist ${HOME}/.gtkrc-2.0
55whitelist ${HOME}/.kde/share/config/gtkrc
56whitelist ${HOME}/.kde/share/config/gtkrc-2.0
57whitelist ${HOME}/.kde4/share/config/gtkrc
58whitelist ${HOME}/.kde4/share/config/gtkrc-2.0
59whitelist ${HOME}/.local/share/themes
60whitelist ${HOME}/.themes
61
62# qt/kde
63whitelist ${HOME}/.cache/kioexec/krun
64whitelist ${HOME}/.config/Kvantum
65whitelist ${HOME}/.config/Trolltech.conf
66whitelist ${HOME}/.config/QtProject.conf
67whitelist ${HOME}/.config/kdeglobals
68whitelist ${HOME}/.config/kio_httprc
69whitelist ${HOME}/.config/kioslaverc
70whitelist ${HOME}/.config/ksslcablacklist
71whitelist ${HOME}/.config/qt5ct
72whitelist ${HOME}/.config/qtcurve
73whitelist ${HOME}/.kde/share/config/kdeglobals
74whitelist ${HOME}/.kde/share/config/kio_httprc
75whitelist ${HOME}/.kde/share/config/kioslaverc
76whitelist ${HOME}/.kde/share/config/ksslcablacklist
77whitelist ${HOME}/.kde/share/config/oxygenrc
78whitelist ${HOME}/.kde/share/icons
79whitelist ${HOME}/.kde4/share/config/kdeglobals
80whitelist ${HOME}/.kde4/share/config/kio_httprc
81whitelist ${HOME}/.kde4/share/config/kioslaverc
82whitelist ${HOME}/.kde4/share/config/ksslcablacklist
83whitelist ${HOME}/.kde4/share/config/oxygenrc
84whitelist ${HOME}/.kde4/share/icons
85whitelist ${HOME}/.local/share/qt5ct
diff --git a/etc/inc/whitelist-player-common.inc b/etc/inc/whitelist-player-common.inc
new file mode 100644
index 000000000..e5bf36804
--- /dev/null
+++ b/etc/inc/whitelist-player-common.inc
@@ -0,0 +1,11 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-player-common.local
4
5# common whitelist for all media players
6
7whitelist ${DESKTOP}
8whitelist ${DOWNLOADS}
9whitelist ${MUSIC}
10whitelist ${PICTURES}
11whitelist ${VIDEOS}
diff --git a/etc/inc/whitelist-run-common.inc b/etc/inc/whitelist-run-common.inc
new file mode 100644
index 000000000..224d21064
--- /dev/null
+++ b/etc/inc/whitelist-run-common.inc
@@ -0,0 +1,11 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-run-common.local
4
5whitelist /run/NetworkManager/resolv.conf
6whitelist /run/cups/cups.sock
7whitelist /run/dbus/system_bus_socket
8whitelist /run/media
9whitelist /run/resolvconf/resolv.conf
10whitelist /run/systemd/resolve/resolv.conf
11whitelist /run/systemd/resolve/stub-resolv.conf
diff --git a/etc/inc/whitelist-runuser-common.inc b/etc/inc/whitelist-runuser-common.inc
new file mode 100644
index 000000000..a8cab8d07
--- /dev/null
+++ b/etc/inc/whitelist-runuser-common.inc
@@ -0,0 +1,16 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-runuser-common.local
4
5# common ${RUNUSER} (=/run/user/$UID) whitelist for all profiles
6
7whitelist ${RUNUSER}/bus
8whitelist ${RUNUSER}/dconf
9whitelist ${RUNUSER}/gdm/Xauthority
10whitelist ${RUNUSER}/ICEauthority
11whitelist ${RUNUSER}/.mutter-Xwaylandauth.*
12whitelist ${RUNUSER}/pulse/native
13whitelist ${RUNUSER}/pipewire-?
14whitelist ${RUNUSER}/wayland-?
15whitelist ${RUNUSER}/xauth_*
16whitelist ${RUNUSER}/[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]-[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]
diff --git a/etc/inc/whitelist-usr-share-common.inc b/etc/inc/whitelist-usr-share-common.inc
new file mode 100644
index 000000000..0049ce804
--- /dev/null
+++ b/etc/inc/whitelist-usr-share-common.inc
@@ -0,0 +1,70 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-usr-share-common.local
4
5# common /usr/share whitelist for all profiles
6
7whitelist /usr/share/alsa
8whitelist /usr/share/applications
9whitelist /usr/share/ca-certificates
10whitelist /usr/share/crypto-policies
11whitelist /usr/share/cursors
12whitelist /usr/share/dconf
13whitelist /usr/share/distro-info
14whitelist /usr/share/drirc.d
15whitelist /usr/share/enchant
16whitelist /usr/share/enchant-2
17whitelist /usr/share/file
18whitelist /usr/share/fontconfig
19whitelist /usr/share/fonts
20whitelist /usr/share/fonts-config
21whitelist /usr/share/gir-1.0
22whitelist /usr/share/gjs-1.0
23whitelist /usr/share/glib-2.0
24whitelist /usr/share/glvnd
25whitelist /usr/share/gtk-2.0
26whitelist /usr/share/gtk-3.0
27whitelist /usr/share/gtk-engines
28whitelist /usr/share/gtksourceview-3.0
29whitelist /usr/share/gtksourceview-4
30whitelist /usr/share/hunspell
31whitelist /usr/share/hwdata
32whitelist /usr/share/icons
33whitelist /usr/share/icu
34whitelist /usr/share/knotifications5
35whitelist /usr/share/kservices5
36whitelist /usr/share/Kvantum
37whitelist /usr/share/kxmlgui5
38whitelist /usr/share/libdrm
39whitelist /usr/share/libthai
40whitelist /usr/share/locale
41whitelist /usr/share/mime
42whitelist /usr/share/misc
43whitelist /usr/share/Modules
44whitelist /usr/share/myspell
45whitelist /usr/share/p11-kit
46whitelist /usr/share/perl
47whitelist /usr/share/perl5
48whitelist /usr/share/pipewire
49whitelist /usr/share/pixmaps
50whitelist /usr/share/pki
51whitelist /usr/share/plasma
52whitelist /usr/share/publicsuffix
53whitelist /usr/share/qt
54whitelist /usr/share/qt4
55whitelist /usr/share/qt5
56whitelist /usr/share/qt5ct
57whitelist /usr/share/sounds
58whitelist /usr/share/tcl8.6
59whitelist /usr/share/tcltk
60whitelist /usr/share/terminfo
61whitelist /usr/share/texlive
62whitelist /usr/share/texmf
63whitelist /usr/share/themes
64whitelist /usr/share/thumbnail.so
65whitelist /usr/share/uim
66whitelist /usr/share/vulkan
67whitelist /usr/share/X11
68whitelist /usr/share/xml
69whitelist /usr/share/zenity
70whitelist /usr/share/zoneinfo
diff --git a/etc/inc/whitelist-var-common.inc b/etc/inc/whitelist-var-common.inc
new file mode 100644
index 000000000..d8ba84ad0
--- /dev/null
+++ b/etc/inc/whitelist-var-common.inc
@@ -0,0 +1,15 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include whitelist-var-common.local
4
5# common /var whitelist for all profiles
6
7whitelist /var/lib/aspell
8whitelist /var/lib/ca-certificates
9whitelist /var/lib/dbus
10whitelist /var/lib/menu-xdg
11whitelist /var/lib/uim
12whitelist /var/cache/fontconfig
13whitelist /var/tmp
14whitelist /var/run
15whitelist /var/lock
diff --git a/etc/inkscape.profile b/etc/inkscape.profile
deleted file mode 100644
index b190e4326..000000000
--- a/etc/inkscape.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for inkscape
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/inkscape.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.inkscape
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30# private-bin inkscape,potrace - problems on Debian stretch
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/inox.profile b/etc/inox.profile
deleted file mode 100644
index de4d6205b..000000000
--- a/etc/inox.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for inox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/inox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/inox
9noblacklist ~/.config/inox
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.cache/inox
16mkdir ~/.config/inox
17mkdir ~/.pki
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/inox
20whitelist ~/.config/inox
21whitelist ~/.pki
22include /etc/firejail/whitelist-common.inc
23
24caps.keep sys_chroot,sys_admin
25netfilter
26nodvd
27nogroups
28noroot
29notv
30shell none
diff --git a/etc/iridium-browser.profile b/etc/iridium-browser.profile
deleted file mode 100644
index 1baa07cb7..000000000
--- a/etc/iridium-browser.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for iridium
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/iridium.profile
diff --git a/etc/iridium.profile b/etc/iridium.profile
deleted file mode 100644
index db9c5c7cf..000000000
--- a/etc/iridium.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for iridium
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/iridium.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/iridium
9noblacklist ~/.config/iridium
10
11include /etc/firejail/disable-common.inc
12# chromium/iridium is distributed with a perl script on Arch
13# include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/iridium
17mkdir ~/.config/iridium
18mkdir ~/.pki
19whitelist ${DOWNLOADS}
20whitelist ~/.cache/iridium
21whitelist ~/.config/iridium
22whitelist ~/.pki
23include /etc/firejail/whitelist-common.inc
24
25netfilter
26nodvd
27notv
diff --git a/etc/jd-gui.profile b/etc/jd-gui.profile
deleted file mode 100644
index 0f59b5721..000000000
--- a/etc/jd-gui.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for jd-gui
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/jd-gui.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/jd-gui.cfg
9noblacklist ${HOME}/.java
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17net none
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-bin jd-gui,dash,sh,bash
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/k3b.profile b/etc/k3b.profile
deleted file mode 100644
index 58623d823..000000000
--- a/etc/k3b.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for k3b
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/k3b.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/k3brc
9noblacklist ~/.kde/share/config/k3brc
10noblacklist ~/.kde4/share/config/k3brc
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20no3d
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
30
31# private-bin
32# private-etc
33# private-tmp
diff --git a/etc/karbon.profile b/etc/karbon.profile
deleted file mode 100644
index 3525a3e06..000000000
--- a/etc/karbon.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for krita
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/krita.profile
diff --git a/etc/kate.profile b/etc/kate.profile
deleted file mode 100644
index 69100d49d..000000000
--- a/etc/kate.profile
+++ /dev/null
@@ -1,39 +0,0 @@
1# Firejail profile for kate
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kate.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/katepartrc
9noblacklist ~/.config/katerc
10noblacklist ~/.config/kateschemarc
11noblacklist ~/.config/katesyntaxhighlightingrc
12noblacklist ~/.config/katevirc
13noblacklist ~/.local/share/kate
14
15include /etc/firejail/disable-common.inc
16# include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20include /etc/firejail/whitelist-var-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26nonewprivs
27noroot
28nosound
29notv
30novideo
31protocol unix
32seccomp
33shell none
34tracelog
35
36# private-bin kate
37private-dev
38# private-etc fonts
39private-tmp
diff --git a/etc/kcalc.profile b/etc/kcalc.profile
deleted file mode 100644
index 0de23f106..000000000
--- a/etc/kcalc.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for kcalc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kcalc.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30disable-mnt
31private
32private-dev
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/kdenlive.profile b/etc/kdenlive.profile
deleted file mode 100644
index 10c2909a0..000000000
--- a/etc/kdenlive.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for kdenlive
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kdenlive.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16nodvd
17nogroups
18nonewprivs
19noroot
20notv
21protocol unix,inet,inet6
22seccomp
23shell none
24
25private-bin kdenlive,kdenlive_render,dbus-launch,melt,ffmpeg,ffplay,ffprobe,dvdauthor,genisoimage,vlc,xine,kdeinit5,kshell5,kdeinit5_shutdown,kdeinit5_wrapper,kdeinit4,kshell4,kdeinit4_shutdown,kdeinit4_wrapper
26private-dev
27#private-etc fonts,alternatives,X11,pulse,passwd
28
29#noexec ${HOME}
30noexec /tmp
diff --git a/etc/keepass2.profile b/etc/keepass2.profile
deleted file mode 100644
index d29fc6abc..000000000
--- a/etc/keepass2.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for keepass
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/keepass.profile
diff --git a/etc/keepassx2.profile b/etc/keepassx2.profile
deleted file mode 100644
index ba98df19d..000000000
--- a/etc/keepassx2.profile
+++ /dev/null
@@ -1,5 +0,0 @@
1# Firejail profile for keepassx2
2# This file is overwritten after every install/update
3
4# Redirects
5include /etc/firejail/keepassx.profile
diff --git a/etc/keepassxc.profile b/etc/keepassxc.profile
deleted file mode 100644
index a8c6d65f5..000000000
--- a/etc/keepassxc.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for keepassxc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/keepassxc.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/*.kdb
9noblacklist ${HOME}/*.kdbx
10noblacklist ${HOME}/.config/keepassxc
11noblacklist ${HOME}/.keepassxc
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18include /etc/firejail/whitelist-var-common.inc
19
20caps.drop all
21net none
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33
34private-bin keepassxc
35private-dev
36private-etc fonts,ld.so.cache
37private-tmp
38
39memory-deny-write-execute
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/kino.profile b/etc/kino.profile
deleted file mode 100644
index 240dab8ef..000000000
--- a/etc/kino.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for kino
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kino.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.kino-history
9noblacklist ~/.kinorc
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nogroups
19nonewprivs
20noroot
21notv
22novideo
23protocol unix
24seccomp
25shell none
26
27private-dev
28private-tmp
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/kmail.profile b/etc/kmail.profile
deleted file mode 100644
index fdc96c97f..000000000
--- a/etc/kmail.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for kmail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kmail.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.gnupg
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix,inet,inet6,netlink
23seccomp
24tracelog
25
26private-dev
27# private-tmp
diff --git a/etc/knotes.profile b/etc/knotes.profile
deleted file mode 100644
index 039f1b057..000000000
--- a/etc/knotes.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for knotes
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/knotes.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/knotesrc
9
10include /etc/firejail/disable-common.inc
11# include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25protocol unix
26seccomp
27shell none
28tracelog
29
30private-dev
31#private-tmp - problems on kubuntu 17.04
diff --git a/etc/kodi.profile b/etc/kodi.profile
deleted file mode 100644
index 06db44132..000000000
--- a/etc/kodi.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for kodi
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kodi.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.kodi
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nogroups
18nonewprivs
19noroot
20protocol unix,inet,inet6,netlink
21seccomp
22shell none
23tracelog
24
25private-dev
26private-tmp
27
28noexec ${HOME}
29noexec /tmp
diff --git a/etc/konversation.profile b/etc/konversation.profile
deleted file mode 100644
index 7d09857ba..000000000
--- a/etc/konversation.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for konversation
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/konversation.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26tracelog
27
28private-dev
29private-tmp
30
31# memory-deny-write-execute
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/krita.profile b/etc/krita.profile
deleted file mode 100644
index e91f5b242..000000000
--- a/etc/krita.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for krita
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/krita.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15ipc-namespace
16net none
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/ktorrent.profile b/etc/ktorrent.profile
deleted file mode 100644
index e95bc23ca..000000000
--- a/etc/ktorrent.profile
+++ /dev/null
@@ -1,55 +0,0 @@
1# Firejail profile for ktorrent
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ktorrent.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/ktorrentrc
9noblacklist ~/.kde/share/apps/ktorrent
10noblacklist ~/.kde/share/config/ktorrentrc
11noblacklist ~/.kde4/share/apps/ktorrent
12noblacklist ~/.kde4/share/config/ktorrentrc
13noblacklist ~/.local/share/ktorrent
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20mkdir ~/.kde/share/apps/ktorrent
21mkdir ~/.kde4/share/apps/ktorrent
22mkdir ~/.local/share/ktorrent
23mkfile ~/.config/ktorrentrc
24mkfile ~/.kde/share/config/ktorrentrc
25mkfile ~/.kde4/share/config/ktorrentrc
26whitelist ${DOWNLOADS}
27whitelist ~/.config/ktorrentrc
28whitelist ~/.kde/share/apps/ktorrent
29whitelist ~/.kde/share/config/ktorrentrc
30whitelist ~/.kde4/share/apps/ktorrent
31whitelist ~/.kde4/share/config/ktorrentrc
32whitelist ~/.local/share/ktorrent
33include /etc/firejail/whitelist-common.inc
34include /etc/firejail/whitelist-var-common.inc
35
36caps.drop all
37netfilter
38no3d
39nodvd
40nogroups
41nonewprivs
42noroot
43nosound
44notv
45novideo
46protocol unix,inet,inet6
47seccomp
48shell none
49
50private-dev
51private-tmp
52
53# memory-deny-write-execute
54noexec ${HOME}
55noexec /tmp
diff --git a/etc/kwrite.profile b/etc/kwrite.profile
deleted file mode 100644
index 6b458ede3..000000000
--- a/etc/kwrite.profile
+++ /dev/null
@@ -1,39 +0,0 @@
1# Firejail profile for kwrite
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/kwrite.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/katepartrc
9noblacklist ~/.config/katerc
10noblacklist ~/.config/kateschemarc
11noblacklist ~/.config/katesyntaxhighlightingrc
12noblacklist ~/.config/katevirc
13noblacklist ~/.local/share/kwrite
14
15include /etc/firejail/disable-common.inc
16# include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20include /etc/firejail/whitelist-var-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26nonewprivs
27noroot
28# nosound - KWrite is using ALSA!
29notv
30novideo
31protocol unix
32seccomp
33shell none
34tracelog
35
36# private-bin kwrite
37private-dev
38# private-etc fonts
39private-tmp
diff --git a/etc/leafpad.profile b/etc/leafpad.profile
deleted file mode 100644
index c9addba21..000000000
--- a/etc/leafpad.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for leafpad
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/leafpad.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/leafpad
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30
31private-dev
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/less.profile b/etc/less.profile
deleted file mode 100644
index e1c42ed76..000000000
--- a/etc/less.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for less
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/less.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11ignore noroot
12net none
13no3d
14nodvd
15nosound
16notv
17novideo
18shell none
19tracelog
20writable-var-log
21
22# The user can have a custom coloring scritps configured in ~/.lessfilter.
23# Enable private-bin if you are not using any filter.
24# private-bin less
25private-dev
26
27memory-deny-write-execute
28noexec ${HOME}
29noexec /tmp
30
31include /etc/firejail/default.profile
diff --git a/etc/liferea.profile b/etc/liferea.profile
deleted file mode 100644
index afd5fed6b..000000000
--- a/etc/liferea.profile
+++ /dev/null
@@ -1,44 +0,0 @@
1# Firejail profile for liferea
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/liferea.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/liferea
9noblacklist ~/.config/liferea
10noblacklist ~/.local/share/liferea
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ~/.cache/liferea
18mkdir ~/.config/liferea
19mkdir ~/.local/share/liferea
20whitelist ~/.cache/liferea
21whitelist ~/.config/liferea
22whitelist ~/.local/share/liferea
23include /etc/firejail/whitelist-common.inc
24
25caps.drop all
26netfilter
27# no3d
28nodvd
29nogroups
30nonewprivs
31noroot
32# nosound
33notv
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39disable-mnt
40private-dev
41private-tmp
42
43noexec ${HOME}
44noexec /tmp
diff --git a/etc/linphone.profile b/etc/linphone.profile
deleted file mode 100644
index 41f9245a2..000000000
--- a/etc/linphone.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for linphone
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/linphone.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.linphone-history.db
9noblacklist ${HOME}/.linphonerc
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkfile ${HOME}/.linphone-history.db
17mkfile ${HOME}/.linphonerc
18whitelist ${HOME}/.linphone-history.db
19whitelist ${HOME}/.linphonerc
20whitelist ${HOME}/Downloads
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24netfilter
25no3d
26nodvd
27nogroups
28nonewprivs
29noroot
30notv
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35
36disable-mnt
37private-dev
38private-tmp
39
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/lmms.profile b/etc/lmms.profile
deleted file mode 100644
index 29ed235c6..000000000
--- a/etc/lmms.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for lmms
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/lmms.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.lmmsrc.xml
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/localc.profile b/etc/localc.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/localc.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/lodraw.profile b/etc/lodraw.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/lodraw.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/loffice.profile b/etc/loffice.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/loffice.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/lofromtemplate.profile b/etc/lofromtemplate.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/lofromtemplate.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/loimpress.profile b/etc/loimpress.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/loimpress.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/lollypop.profile b/etc/lollypop.profile
deleted file mode 100644
index c0c762c02..000000000
--- a/etc/lollypop.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for lollypop
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/lollypop.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/lollypop
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17no3d
18nogroups
19nonewprivs
20noroot
21notv
22novideo
23protocol unix,inet,inet6
24seccomp
25shell none
26
27private-dev
28private-etc asound.conf,ca-certificates,fonts,host.conf,hostname,hosts,pulse,resolv.conf,ssl
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/lomath.profile b/etc/lomath.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/lomath.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/loweb.profile b/etc/loweb.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/loweb.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/lowriter.profile b/etc/lowriter.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/lowriter.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/lximage-qt.profile b/etc/lximage-qt.profile
deleted file mode 100644
index 734f16e92..000000000
--- a/etc/lximage-qt.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for lximage-qt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/lximage-qt.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist .config/lximage-qt
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/lxmusic.profile b/etc/lxmusic.profile
deleted file mode 100644
index 901bdb408..000000000
--- a/etc/lxmusic.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for lxmusic
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/lxmusic.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/xmms2
9noblacklist ~/.config/xmms2
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/lynx.profile b/etc/lynx.profile
deleted file mode 100644
index d54bed564..000000000
--- a/etc/lynx.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for lynx
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/lynx.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28tracelog
29
30# private-bin lynx
31private-dev
32# private-etc none
33private-tmp
diff --git a/etc/macrofusion.profile b/etc/macrofusion.profile
deleted file mode 100644
index be66cf6ee..000000000
--- a/etc/macrofusion.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for macrofusion
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/macrofusion.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/mfusion
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30#private-bin python3,macrofusion,env,enfuse,exiftool,align_image_stack
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/mate-calc.profile b/etc/mate-calc.profile
deleted file mode 100644
index c59b2dcc7..000000000
--- a/etc/mate-calc.profile
+++ /dev/null
@@ -1,45 +0,0 @@
1# Firejail profile for mate-calc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mate-calc.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/mate-calc
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15whitelist ${HOME}/.cache/mate-calc
16whitelist ${HOME}/.config/caja
17whitelist ${HOME}/.config/gtk-3.0
18whitelist ${HOME}/.config/dconf
19whitelist ${HOME}./config/mate-menu
20whitelist ${HOME}/.themes
21
22caps.drop all
23net none
24no3d
25nodvd
26nogroups
27nonewprivs
28noroot
29nosound
30notv
31novideo
32protocol unix
33seccomp
34shell none
35
36disable-mnt
37private-bin mate-calc,mate-calculator
38private-etc fonts
39private-dev
40private-opt none
41private-tmp
42
43memory-deny-write-execute
44noexec ${HOME}
45noexec /tmp
diff --git a/etc/mate-calculator.profile b/etc/mate-calculator.profile
deleted file mode 100644
index 43bb3ebb4..000000000
--- a/etc/mate-calculator.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for mate-calc
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/mate-calc.profile
diff --git a/etc/mate-color-select.profile b/etc/mate-color-select.profile
deleted file mode 100644
index 7df7d7faa..000000000
--- a/etc/mate-color-select.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for mate-color-select
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mate-color-select.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14whitelist ${HOME}/.config/gtk-3.0
15whitelist ${HOME}/.fonts
16whitelist ${HOME}/.icons
17whitelist ${HOME}/.themes
18
19caps.drop all
20netfilter
21no3d
22nodvd
23nogroups
24nonewprivs
25noroot
26nosound
27notv
28novideo
29protocol unix
30seccomp
31shell none
32
33disable-mnt
34private-bin mate-color-select
35private-etc fonts
36private-dev
37private-tmp
38
39memory-deny-write-execute
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/mathematica.profile b/etc/mathematica.profile
deleted file mode 100644
index 984ea9e97..000000000
--- a/etc/mathematica.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for Mathematica
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/Mathematica.profile
diff --git a/etc/mediainfo.profile b/etc/mediainfo.profile
deleted file mode 100644
index e502269f7..000000000
--- a/etc/mediainfo.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for mediainfo
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mediainfo.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29
30private-bin mediainfo
31private-dev
32private-etc none
33private-tmp
diff --git a/etc/mediathekview.profile b/etc/mediathekview.profile
deleted file mode 100644
index dc9946794..000000000
--- a/etc/mediathekview.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for mediathekview
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mediathekview.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/mpv
9noblacklist ~/.config/smplayer
10noblacklist ~/.config/totem
11noblacklist ~/.config/vlc
12noblacklist ~/.config/xplayer
13noblacklist ~/.java
14noblacklist ~/.local/share/totem
15noblacklist ~/.local/share/xplayer
16noblacklist ~/.mediathek3
17noblacklist ~/.mplayer
18
19include /etc/firejail/disable-common.inc
20include /etc/firejail/disable-devel.inc
21include /etc/firejail/disable-passwdmgr.inc
22include /etc/firejail/disable-programs.inc
23
24include /etc/firejail/whitelist-var-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nogroups
30nonewprivs
31noroot
32notv
33novideo
34protocol unix,inet,inet6
35seccomp
36tracelog
37
38private-dev
39private-tmp
40
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/meld.profile b/etc/meld.profile
deleted file mode 100644
index f1910d0f4..000000000
--- a/etc/meld.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for meld
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/meld.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/meld
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29# private-bin meld,python2,python2.7
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/midori.profile b/etc/midori.profile
deleted file mode 100644
index 8ddb37776..000000000
--- a/etc/midori.profile
+++ /dev/null
@@ -1,44 +0,0 @@
1# Firejail profile for midori
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/midori.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/midori
9noblacklist ~/.local/share/midori
10noblacklist ~/.local/share/webkit
11noblacklist ~/.local/share/webkitgtk
12noblacklist ~/.pki
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-programs.inc
17
18mkdir ~/.cache/midori
19mkdir ~/.config/midori
20mkdir ~/.local/share/midori
21mkdir ~/.local/share/webkit
22mkdir ~/.local/share/webkitgtk
23mkdir ~/.pki
24whitelist ${DOWNLOADS}
25whitelist ~/.cache/gnome-mplayer/plugin
26whitelist ~/.cache/midori
27whitelist ~/.config/gnome-mplayer
28whitelist ~/.config/midori
29whitelist ~/.lastpass
30whitelist ~/.local/share/midori
31whitelist ~/.local/share/webkit
32whitelist ~/.local/share/webkitgtk
33whitelist ~/.pki
34include /etc/firejail/whitelist-common.inc
35
36caps.drop all
37netfilter
38nodvd
39nonewprivs
40# noroot - problems on Ubuntu 14.04
41notv
42protocol unix,inet,inet6,netlink
43seccomp
44tracelog
diff --git a/etc/minetest.profile b/etc/minetest.profile
deleted file mode 100644
index 147328616..000000000
--- a/etc/minetest.profile
+++ /dev/null
@@ -1,39 +0,0 @@
1# Firejail profile for minetest
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/minetest.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.minetest
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.minetest
16whitelist ${HOME}/.minetest
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20ipc-namespace
21netfilter
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31
32disable-mnt
33private-bin minetest
34private-dev
35private-etc asound.conf,ca-certificates,drirc,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,nsswitch.conf,passwd,pulse,resolv.conf,ssl
36private-tmp
37
38noexec ${HOME}
39noexec /tmp
diff --git a/etc/mousepad.profile b/etc/mousepad.profile
deleted file mode 100644
index 60205ffda..000000000
--- a/etc/mousepad.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for mousepad
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mousepad.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Mousepad
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25protocol unix
26seccomp
27shell none
28tracelog
29
30private-bin mousepad
31private-dev
32private-tmp
diff --git a/etc/mpd.profile b/etc/mpd.profile
deleted file mode 100644
index 7bfa47d77..000000000
--- a/etc/mpd.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for mpd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mpd.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.mpdconf
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18no3d
19nodvd
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27
28#private-bin mpd,bash
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/mplayer.profile b/etc/mplayer.profile
deleted file mode 100644
index b431e4695..000000000
--- a/etc/mplayer.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for mplayer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mplayer.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.mplayer
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17# nogroups
18nonewprivs
19noroot
20protocol unix,inet,inet6,netlink
21seccomp
22shell none
23
24private-bin mplayer
25private-dev
26private-tmp
27
28noexec ${HOME}
29noexec /tmp
diff --git a/etc/mpv.profile b/etc/mpv.profile
deleted file mode 100644
index eb8a88a4b..000000000
--- a/etc/mpv.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for mpv
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mpv.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/mpv
9noblacklist ${HOME}/.netrc
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19netfilter
20nogroups
21nonewprivs
22noroot
23protocol unix,inet,inet6
24seccomp
25shell none
26tracelog
27
28private-bin mpv,youtube-dl,python,python2.7,python3,python3.5,python3.6,env
29private-dev
diff --git a/etc/multimc5.profile b/etc/multimc5.profile
deleted file mode 100644
index 3423c2a88..000000000
--- a/etc/multimc5.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for multimc5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/multimc5.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.java
9noblacklist ${HOME}/.local/share/multimc
10noblacklist ${HOME}/.local/share/multimc5
11noblacklist ${HOME}/.multimc5
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18mkdir ${HOME}/.local/share/multimc
19whitelist ${HOME}/.local/share/multimc
20whitelist ${HOME}/.local/share/multimc5
21whitelist ${HOME}/.multimc5
22include /etc/firejail/whitelist-common.inc
23
24caps.drop all
25netfilter
26nodvd
27nogroups
28nonewprivs
29noroot
30notv
31novideo
32protocol unix,inet,inet6
33# seccomp
34shell none
35
36disable-mnt
37# private-bin works, but causes weirdness
38# private-bin multimc5,dash,bash,mkdir,which,zenity,kdialog,ldd,chmod,valgrind,apt-file,pkgfile,dnf,yum,zypper,pfl,java,grep,sort,awk,readlink,dirname
39private-dev
40private-tmp
41
42noexec ${HOME}
43noexec /tmp
diff --git a/etc/mumble.profile b/etc/mumble.profile
deleted file mode 100644
index e58dc93f4..000000000
--- a/etc/mumble.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for mumble
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mumble.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Mumble
9noblacklist ${HOME}/.local/share/data/Mumble
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ${HOME}/.config/Mumble
17mkdir ${HOME}/.local/share/data/Mumble
18whitelist ${HOME}/.config/Mumble
19whitelist ${HOME}/.local/share/data/Mumble
20include /etc/firejail/whitelist-common.inc
21
22caps.drop all
23netfilter
24no3d
25nodvd
26nogroups
27nonewprivs
28noroot
29notv
30protocol unix,inet,inet6
31seccomp
32shell none
33tracelog
34
35disable-mnt
36private-bin mumble
37private-tmp
38
39memory-deny-write-execute
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/mupdf.profile b/etc/mupdf.profile
deleted file mode 100644
index 62527c17d..000000000
--- a/etc/mupdf.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for mupdf
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mupdf.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16nodvd
17nogroups
18nonewprivs
19noroot
20nosound
21notv
22novideo
23protocol unix
24seccomp
25# seccomp.keep access,arch_prctl,brk,clone,close,connect,execve,exit_group,fchmod,fchown,fcntl,fstat,futex,getcwd,getpeername,getrlimit,getsockname,getsockopt,lseek,lstat,mlock,mmap,mprotect,mremap,munmap,nanosleep,open,poll,prctl,read,recvfrom,recvmsg,restart_syscall,rt_sigaction,rt_sigprocmask,select,sendmsg,set_robust_list,set_tid_address,setresgid,setresuid,shmat,shmctl,shmget,shutdown,socket,stat,sysinfo,uname,unshare,wait4,write,writev
26shell none
27tracelog
28
29# private-bin mupdf,sh,tempfile,rm
30private-dev
31private-etc fonts
32private-tmp
33
34# mupdf will never write anything
35read-only ${HOME}
diff --git a/etc/musescore.profile b/etc/musescore.profile
deleted file mode 100644
index b3d04c08f..000000000
--- a/etc/musescore.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for musescore
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/musescore.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/MusE
9noblacklist ~/.config/MuseScore
10noblacklist ~/.local/share/data/MusE
11noblacklist ~/.local/share/data/MuseScore
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18include /etc/firejail/whitelist-var-common.inc
19
20caps.drop all
21netfilter
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27notv
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32tracelog
33
34# private-bin musescore,mscore
35private-tmp
36
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/mutt.profile b/etc/mutt.profile
deleted file mode 100644
index bdd629773..000000000
--- a/etc/mutt.profile
+++ /dev/null
@@ -1,55 +0,0 @@
1# Firejail profile for mutt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/mutt.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist /var/mail
11noblacklist /var/spool/mail
12noblacklist ~/.Mail
13noblacklist ~/.bogofilter
14noblacklist ~/.cache/mutt
15noblacklist ~/.elinks
16noblacklist ~/.emacs
17noblacklist ~/.emacs.d
18noblacklist ~/.gnupg
19noblacklist ~/.mail
20noblacklist ~/.mailcap
21noblacklist ~/.msmtprc
22noblacklist ~/.mutt
23noblacklist ~/.mutt/muttrc
24noblacklist ~/.muttrc
25noblacklist ~/.signature
26noblacklist ~/.vim
27noblacklist ~/.viminfo
28noblacklist ~/.vimrc
29noblacklist ~/.w3m
30noblacklist ~/Mail
31noblacklist ~/mail
32noblacklist ~/postponed
33noblacklist ~/sent
34
35include /etc/firejail/disable-common.inc
36include /etc/firejail/disable-devel.inc
37include /etc/firejail/disable-passwdmgr.inc
38include /etc/firejail/disable-programs.inc
39
40caps.drop all
41netfilter
42no3d
43nodvd
44nogroups
45nonewprivs
46noroot
47nosound
48notv
49novideo
50protocol unix,inet,inet6
51seccomp
52shell none
53writable-run-user
54
55private-dev
diff --git a/etc/nautilus.profile b/etc/nautilus.profile
deleted file mode 100644
index 45d23cae6..000000000
--- a/etc/nautilus.profile
+++ /dev/null
@@ -1,38 +0,0 @@
1# Firejail profile for nautilus
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/nautilus.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Nautilus is started by systemd on most systems. Therefore it is not firejailed by default. Since there
9# is already a nautilus process running on gnome desktops firejail will have no effect.
10
11noblacklist ~/.config/nautilus
12noblacklist ~/.local/share/Trash
13noblacklist ~/.local/share/nautilus
14noblacklist ~/.local/share/nautilus-python
15
16include /etc/firejail/disable-common.inc
17include /etc/firejail/disable-devel.inc
18include /etc/firejail/disable-passwdmgr.inc
19# include /etc/firejail/disable-programs.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25nonewprivs
26noroot
27notv
28novideo
29protocol unix
30seccomp
31shell none
32tracelog
33
34# nautilus needs to be able to start arbitrary applications so we cannot blacklist their files
35# private-bin nautilus
36# private-dev
37# private-etc fonts
38# private-tmp
diff --git a/etc/nemo.profile b/etc/nemo.profile
deleted file mode 100644
index b11ad645a..000000000
--- a/etc/nemo.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for nemo
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/nemo.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/nemo
9noblacklist ${HOME}/.local/share/Trash
10noblacklist ${HOME}/.local/share/nemo
11noblacklist ${HOME}/.local/share/nemo-python
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/nolocal.net b/etc/net/nolocal.net
index 9fa785450..0eb9f9784 100644
--- a/etc/nolocal.net
+++ b/etc/net/nolocal.net
@@ -12,15 +12,25 @@
12# 12#
13################################################################### 13###################################################################
14 14
15 15#allow all loopback traffic
16-A INPUT -i lo -j ACCEPT 16-A INPUT -i lo -j ACCEPT
17
18# no incoming connections
17-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 19-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
20
21# allow ping etc.
18-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT 22-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
19-A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT 23-A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
20-A INPUT -p icmp --icmp-type echo-request -j ACCEPT 24-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
21 25
26# accept dns requests going out to a server on the local network
22-A OUTPUT -p udp --dport 53 -j ACCEPT 27-A OUTPUT -p udp --dport 53 -j ACCEPT
28
29# drop all local network traffic
23-A OUTPUT -d 192.168.0.0/16 -j DROP 30-A OUTPUT -d 192.168.0.0/16 -j DROP
24-A OUTPUT -d 10.0.0.0/8 -j DROP 31-A OUTPUT -d 10.0.0.0/8 -j DROP
25-A OUTPUT -d 172.16.0.0/12 -j DROP 32-A OUTPUT -d 172.16.0.0/12 -j DROP
33
34# drop multicast traffic
35-A OUTPUT -d 224.0.0.0/4 -j DROP
26COMMIT 36COMMIT
diff --git a/etc/net/nolocal6.net b/etc/net/nolocal6.net
new file mode 100644
index 000000000..5a6678d03
--- /dev/null
+++ b/etc/net/nolocal6.net
@@ -0,0 +1,41 @@
1*filter
2:INPUT DROP [0:0]
3:FORWARD DROP [0:0]
4:OUTPUT ACCEPT [0:0]
5
6###################################################################
7# Client filter rejecting local network traffic, with the exception of
8# DNS traffic
9#
10# Usage:
11# firejail --net=eth0 --netfilter6=/etc/firejail/nolocal6.net firefox
12#
13###################################################################
14
15#allow all loopback traffic
16-A INPUT -i lo -j ACCEPT
17
18# no incoming connections
19-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
20
21# allow ping etc.
22-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type destination-unreachable -j ACCEPT
23-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type time-exceeded -j ACCEPT
24-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type echo-request -j ACCEPT
25# required for ipv6
26-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type router-solicitation -j ACCEPT
27-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type neighbour-solicitation -j ACCEPT
28-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type router-advertisement -j ACCEPT
29-A INPUT -p ipv6-icmp -m icmp6 --icmpv6-type neighbour-advertisement -j ACCEPT
30
31# accept dns requests going out to a server on the local network
32-A OUTPUT -p udp --dport 53 -j ACCEPT
33
34# drop all local network traffic
35-A OUTPUT -d FC00::/7 -j DROP
36
37# drop multicast traffic
38# required for ipv6
39-A OUTPUT -d ff02::2 -j ACCEPT
40-A OUTPUT -d ff00::/8 -j DROP
41COMMIT
diff --git a/etc/net/tcpserver.net b/etc/net/tcpserver.net
new file mode 100644
index 000000000..9c39ee5fb
--- /dev/null
+++ b/etc/net/tcpserver.net
@@ -0,0 +1,27 @@
1*filter
2:INPUT DROP [0:0]
3:FORWARD DROP [0:0]
4:OUTPUT DROP [0:0]
5
6###################################################################
7# Simple tcp filter template. $ARG1 is the port number.
8#
9# Usage: $ARG1 in this template is replaced by 5001 from command line below
10#
11# firejail --net=eth0 --ip=192.168.1.105 --netfilter=/etc/firejail/tcpserver.net,5001 server-program
12#
13###################################################################
14
15# allow server traffic
16-A INPUT -p tcp --dport $ARG1 -m state --state NEW,ESTABLISHED -j ACCEPT
17-A OUTPUT -p tcp --sport $ARG1 -m state --state ESTABLISHED -j ACCEPT
18
19# allow incoming ping
20-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
21-A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
22
23# allow outgoing DNS
24-A OUTPUT -p udp --dport 53 -j ACCEPT
25-A INPUT -p udp --sport 53 -j ACCEPT
26
27COMMIT
diff --git a/etc/webserver.net b/etc/net/webserver.net
index 83db76825..83db76825 100644
--- a/etc/webserver.net
+++ b/etc/net/webserver.net
diff --git a/etc/netsurf.profile b/etc/netsurf.profile
deleted file mode 100644
index 64aa068b1..000000000
--- a/etc/netsurf.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for netsurf
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/netsurf.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/netsurf
9noblacklist ~/.config/netsurf
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.cache/netsurf
16mkdir ~/.config/netsurf
17whitelist ${DOWNLOADS}
18whitelist ~/.cache/netsurf
19whitelist ~/.config/netsurf
20include /etc/firejail/whitelist-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nonewprivs
26noroot
27notv
28protocol unix,inet,inet6,netlink
29seccomp
30tracelog
diff --git a/etc/neverball.profile b/etc/neverball.profile
deleted file mode 100644
index 6a9a3a577..000000000
--- a/etc/neverball.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for neverball
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/neverball.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.neverball
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.neverball
16whitelist ${HOME}/.neverball
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26novideo
27protocol unix,netlink
28seccomp
29shell none
30
31disable-mnt
32private-bin neverball
33private-dev
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/nylas.profile b/etc/nylas.profile
deleted file mode 100644
index d96c6b0d4..000000000
--- a/etc/nylas.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for nylas
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/nylas.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Nylas Mail
9noblacklist ~/.nylas-mail
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ~/.config/Nylas Mail
18whitelist ~/.nylas-mail
19include /etc/firejail/whitelist-common.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix,inet,inet6,netlink
31seccomp
32shell none
33
34private-dev
diff --git a/etc/obs.profile b/etc/obs.profile
deleted file mode 100644
index 187862752..000000000
--- a/etc/obs.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for obs
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/obs.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/obs-studio
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16nodvd
17nogroups
18nonewprivs
19noroot
20notv
21protocol unix,inet,inet6
22seccomp
23shell none
24tracelog
25
26private-bin obs
27private-dev
28private-tmp
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/odt2txt.profile b/etc/odt2txt.profile
deleted file mode 100644
index e8c2d54c7..000000000
--- a/etc/odt2txt.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for odt2txt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/odt2txt.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29
30private-bin odt2txt
31private-dev
32private-etc none
33private-tmp
34read-only ${HOME}
diff --git a/etc/okular.profile b/etc/okular.profile
deleted file mode 100644
index 60390e4d8..000000000
--- a/etc/okular.profile
+++ /dev/null
@@ -1,46 +0,0 @@
1# Firejail profile for okular
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/okular.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/okularpartrc
9noblacklist ~/.config/okularrc
10noblacklist ~/.kde/share/apps/okular
11noblacklist ~/.kde/share/config/okularpartrc
12noblacklist ~/.kde/share/config/okularrc
13noblacklist ~/.kde4/share/apps/okular
14noblacklist ~/.kde4/share/config/okularpartrc
15noblacklist ~/.kde4/share/config/okularrc
16noblacklist ~/.local/share/okular
17
18include /etc/firejail/disable-common.inc
19include /etc/firejail/disable-devel.inc
20include /etc/firejail/disable-passwdmgr.inc
21include /etc/firejail/disable-programs.inc
22
23include /etc/firejail/whitelist-var-common.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31nosound
32notv
33novideo
34protocol unix
35seccomp
36shell none
37tracelog
38
39# private-bin okular,kbuildsycoca4,kdeinit4,lpr
40private-dev
41# private-etc fonts,X11
42private-tmp
43
44# memory-deny-write-execute
45noexec ${HOME}
46noexec /tmp
diff --git a/etc/open-invaders.profile b/etc/open-invaders.profile
deleted file mode 100644
index 998d57f62..000000000
--- a/etc/open-invaders.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for open-invaders
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/open-invaders.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.openinvaders
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.openinvaders
15whitelist ~/.openinvaders
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19net none
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix,netlink
26seccomp
27shell none
28
29# private-bin open-invaders
30private-dev
31# private-etc none
32private-tmp
diff --git a/etc/openbox.profile b/etc/openbox.profile
deleted file mode 100644
index 99c579c37..000000000
--- a/etc/openbox.profile
+++ /dev/null
@@ -1,16 +0,0 @@
1# Firejail profile for openbox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/openbox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# all applications started in OpenBox will run in this profile
9
10include /etc/firejail/disable-common.inc
11
12caps.drop all
13netfilter
14noroot
15protocol unix,inet,inet6
16seccomp
diff --git a/etc/openshot-qt.profile b/etc/openshot-qt.profile
deleted file mode 100644
index cbd1f8fe8..000000000
--- a/etc/openshot-qt.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for openshot
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/openshot.profile
diff --git a/etc/openshot.profile b/etc/openshot.profile
deleted file mode 100644
index 02f4665d6..000000000
--- a/etc/openshot.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for openshot
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/openshot.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.openshot
9noblacklist ${HOME}/.openshot_qt
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23protocol unix,inet,inet6,netlink
24seccomp
25shell none
26
27private-dev
28private-tmp
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/opera-beta.profile b/etc/opera-beta.profile
deleted file mode 100644
index c295a2082..000000000
--- a/etc/opera-beta.profile
+++ /dev/null
@@ -1,26 +0,0 @@
1# Firejail profile for opera-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/opera-beta.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/opera-beta
9noblacklist ~/.pki
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.cache/opera
16mkdir ~/.config/opera-beta
17mkdir ~/.pki
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/opera
20whitelist ~/.config/opera-beta
21whitelist ~/.pki
22include /etc/firejail/whitelist-common.inc
23
24netfilter
25nodvd
26notv
diff --git a/etc/opera.profile b/etc/opera.profile
deleted file mode 100644
index 553ea6790..000000000
--- a/etc/opera.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for opera
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/opera.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/opera
9noblacklist ~/.config/opera
10noblacklist ~/.opera
11noblacklist ~/.pki
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ~/.cache/opera
18mkdir ~/.config/opera
19mkdir ~/.opera
20mkdir ~/.pki
21whitelist ${DOWNLOADS}
22whitelist ~/.cache/opera
23whitelist ~/.config/opera
24whitelist ~/.opera
25whitelist ~/.pki
26include /etc/firejail/whitelist-common.inc
27
28netfilter
29nodvd
30notv
diff --git a/etc/palemoon.profile b/etc/palemoon.profile
deleted file mode 100644
index 054e876c5..000000000
--- a/etc/palemoon.profile
+++ /dev/null
@@ -1,58 +0,0 @@
1# Firejail profile for palemoon
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/palemoon.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/moonchild productions/pale moon
9noblacklist ~/.moonchild productions/pale moon
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15# These are uncommented in the Firefox profile. If you run into trouble you may
16# want to uncomment (some of) them.
17#whitelist ~/dwhelper
18#whitelist ~/.zotero
19#whitelist ~/.vimperatorrc
20#whitelist ~/.vimperator
21#whitelist ~/.pentadactylrc
22#whitelist ~/.pentadactyl
23#whitelist ~/.keysnail.js
24#whitelist ~/.config/gnome-mplayer
25#whitelist ~/.cache/gnome-mplayer/plugin
26#whitelist ~/.pki
27#whitelist ~/.lastpass
28
29# For silverlight
30#whitelist ~/.wine-pipelight
31#whitelist ~/.wine-pipelight64
32#whitelist ~/.config/pipelight-widevine
33#whitelist ~/.config/pipelight-silverlight5.1
34
35mkdir ~/.cache/moonchild productions/pale moon
36mkdir ~/.moonchild productions
37whitelist ${DOWNLOADS}
38whitelist ~/.cache/moonchild productions/pale moon
39whitelist ~/.moonchild productions
40include /etc/firejail/whitelist-common.inc
41
42caps.drop all
43netfilter
44nodvd
45nogroups
46nonewprivs
47noroot
48notv
49protocol unix,inet,inet6,netlink
50seccomp
51shell none
52tracelog
53
54# private-bin palemoon
55# private-dev (disabled for now as it will interfere with webcam use in palemoon)
56# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
57# private-opt palemoon
58private-tmp
diff --git a/etc/parole.profile b/etc/parole.profile
deleted file mode 100644
index a8ce63e73..000000000
--- a/etc/parole.profile
+++ /dev/null
@@ -1,24 +0,0 @@
1# Firejail profile for parole
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/parole.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16nonewprivs
17noroot
18notv
19protocol unix,inet,inet6
20seccomp
21shell none
22
23private-bin parole,dbus-launch
24private-etc passwd,group,fonts
diff --git a/etc/pcmanfm.profile b/etc/pcmanfm.profile
deleted file mode 100644
index 6c8dd4319..000000000
--- a/etc/pcmanfm.profile
+++ /dev/null
@@ -1,29 +0,0 @@
1# Firejail profile for pcmanfm
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pcmanfm.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.local/share/Trash
9noblacklist ~/.config/libfm
10noblacklist ~/.config/pcmanfm
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15# include /etc/firejail/disable-programs.inc
16
17caps.drop all
18# net none - see issue #1467, computer:/// location broken
19no3d
20nodvd
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29tracelog
diff --git a/etc/pdfsam.profile b/etc/pdfsam.profile
deleted file mode 100644
index f1c3377d9..000000000
--- a/etc/pdfsam.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for pdfsam
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pdfsam.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.java
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29private-bin pdfsam,dash,sh,bash,java,archlinux-java,grep,awk,dirname,uname,which,sort,find,readlink,expr,ls,java-config
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/pdftotext.profile b/etc/pdftotext.profile
deleted file mode 100644
index 0c6bf9cde..000000000
--- a/etc/pdftotext.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for pdftotext
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pdftotext.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18net none
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30tracelog
31
32private-bin pdftotext
33private-dev
34private-etc none
35private-tmp
diff --git a/etc/peek.profile b/etc/peek.profile
deleted file mode 100644
index 13c0c72e0..000000000
--- a/etc/peek.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for peek
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/peek.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/peek
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29# private-bin breaks gif mode, mp4 and webm mode work fine however
30# private-bin peek,convert,ffmpeg
31private-dev
32private-tmp
33
34memory-deny-write-execute
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/picard.profile b/etc/picard.profile
deleted file mode 100644
index 8dc79b4ad..000000000
--- a/etc/picard.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for picard
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/picard.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/MusicBrainz
9noblacklist ${HOME}/.config/MusicBrainz
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/pidgin.profile b/etc/pidgin.profile
deleted file mode 100644
index d195cf586..000000000
--- a/etc/pidgin.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for pidgin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pidgin.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.purple
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix,inet,inet6
23seccomp
24shell none
25tracelog
26
27private-bin pidgin
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/pingus.profile b/etc/pingus.profile
deleted file mode 100644
index 68d5a98ad..000000000
--- a/etc/pingus.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for pingus
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pingus.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.pingus
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.pingus
15whitelist ~/.pingus
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19net none
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix,netlink
26seccomp
27shell none
28
29# private-bin pingus
30private-dev
31# private-etc none
32private-tmp
diff --git a/etc/pinta.profile b/etc/pinta.profile
deleted file mode 100644
index cb6e05d35..000000000
--- a/etc/pinta.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for pinta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pinta.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/Pinta
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25novideo
26protocol unix
27seccomp
28shell none
29
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/pithos.profile b/etc/pithos.profile
deleted file mode 100644
index b81e0b634..000000000
--- a/etc/pithos.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for pithos
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pithos.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13include /etc/firejail/whitelist-common.inc
14
15caps.drop all
16netfilter
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27
28disable-mnt
29# private-bin pithos,python,python3,python3.6
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/pluma.profile b/etc/pluma.profile
deleted file mode 100644
index 56786fda7..000000000
--- a/etc/pluma.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for pluma
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/pluma.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/pluma
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18# net none - makes settings immutable
19machine-id
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix
29seccomp
30shell none
31tracelog
32
33private-bin pluma
34private-dev
35# private-etc fonts
36private-tmp
37
38memory-deny-write-execute
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/profile-a-l/0ad.profile b/etc/profile-a-l/0ad.profile
new file mode 100644
index 000000000..ddc7ecad5
--- /dev/null
+++ b/etc/profile-a-l/0ad.profile
@@ -0,0 +1,57 @@
1# Firejail profile for 0ad
2# Description: Real-time strategy game of ancient warfare
3# This file is overwritten after every install/update
4# Persistent local customizations
5include 0ad.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/0ad
10noblacklist ${HOME}/.config/0ad
11noblacklist ${HOME}/.local/share/0ad
12
13blacklist /usr/libexec
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.cache/0ad
23mkdir ${HOME}/.config/0ad
24mkdir ${HOME}/.local/share/0ad
25whitelist ${HOME}/.cache/0ad
26whitelist ${HOME}/.config/0ad
27whitelist ${HOME}/.local/share/0ad
28whitelist /usr/share/0ad
29whitelist /usr/share/games
30include whitelist-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34caps.drop all
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41notv
42nou2f
43novideo
44protocol unix,inet,inet6
45seccomp
46seccomp.block-secondary
47shell none
48tracelog
49
50disable-mnt
51private-bin 0ad,pyrogenesis,sh,which
52private-cache
53private-dev
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/profile-a-l/2048-qt.profile b/etc/profile-a-l/2048-qt.profile
new file mode 100644
index 000000000..80b032aee
--- /dev/null
+++ b/etc/profile-a-l/2048-qt.profile
@@ -0,0 +1,43 @@
1# Firejail profile for 2048-qt
2# Description: Mathematics based puzzle game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include 2048-qt.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/2048-qt
10noblacklist ${HOME}/.config/xiaoyong
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18mkdir ${HOME}/.config/2048-qt
19mkdir ${HOME}/.config/xiaoyong
20whitelist ${HOME}/.config/2048-qt
21whitelist ${HOME}/.config/xiaoyong
22include whitelist-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27net none
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40
41disable-mnt
42private-dev
43private-tmp
diff --git a/etc/profile-a-l/7z.profile b/etc/profile-a-l/7z.profile
new file mode 100644
index 000000000..0d31255ad
--- /dev/null
+++ b/etc/profile-a-l/7z.profile
@@ -0,0 +1,14 @@
1# Firejail profile for 7z
2# Description: File archiver with high compression ratio
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include 7z.local
7# Persistent global definitions
8include globals.local
9
10# Included in archiver-common.profile
11ignore include disable-shell.inc
12
13# Redirect
14include archiver-common.profile
diff --git a/etc/profile-a-l/7za.profile b/etc/profile-a-l/7za.profile
new file mode 100644
index 000000000..9cd04cad1
--- /dev/null
+++ b/etc/profile-a-l/7za.profile
@@ -0,0 +1,12 @@
1# Firejail profile for 7za
2# Description: File archiver with high compression ratio
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include 7za.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include 7z.profile
diff --git a/etc/profile-a-l/7zr.profile b/etc/profile-a-l/7zr.profile
new file mode 100644
index 000000000..bd3842900
--- /dev/null
+++ b/etc/profile-a-l/7zr.profile
@@ -0,0 +1,12 @@
1# Firejail profile for 7zr
2# Description: File archiver with high compression ratio
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include 7zr.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include 7z.profile
diff --git a/etc/profile-a-l/Books.profile b/etc/profile-a-l/Books.profile
new file mode 100644
index 000000000..76fd21d32
--- /dev/null
+++ b/etc/profile-a-l/Books.profile
@@ -0,0 +1,7 @@
1# Firejail profile for gnome-books
2# This file is overwritten after every install/update
3
4
5# Temporary fix for https://github.com/netblue30/firejail/issues/2624
6# Redirect
7include gnome-books.profile
diff --git a/etc/profile-a-l/Builder.profile b/etc/profile-a-l/Builder.profile
new file mode 100644
index 000000000..e97267bbc
--- /dev/null
+++ b/etc/profile-a-l/Builder.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-builder
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Builder.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include gnome-builder.profile
diff --git a/etc/profile-a-l/Cheese.profile b/etc/profile-a-l/Cheese.profile
new file mode 100644
index 000000000..32aeb4f69
--- /dev/null
+++ b/etc/profile-a-l/Cheese.profile
@@ -0,0 +1,11 @@
1# Firejail profile for cheese
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Cheese.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include cheese.profile
diff --git a/etc/Cryptocat.profile b/etc/profile-a-l/Cryptocat.profile
index add122a5e..39b39667c 100644
--- a/etc/Cryptocat.profile
+++ b/etc/profile-a-l/Cryptocat.profile
@@ -1,28 +1,31 @@
1# Firejail profile for Cryptocat 1# Firejail profile for Cryptocat
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/Cryptocat.local 4include Cryptocat.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/Cryptocat 8noblacklist ${HOME}/.config/Cryptocat
9 9
10include /etc/firejail/disable-common.inc 10include disable-common.inc
11include /etc/firejail/disable-devel.inc 11include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include disable-interpreters.inc
13include /etc/firejail/disable-programs.inc 13include disable-programs.inc
14 14
15caps.drop all 15caps.drop all
16netfilter 16netfilter
17nodvd 17nodvd
18nogroups 18nogroups
19noinput
19nonewprivs 20nonewprivs
20noroot 21noroot
21nosound 22nosound
22notv 23notv
24nou2f
23protocol unix,inet,inet6,netlink 25protocol unix,inet,inet6,netlink
24seccomp 26seccomp
25shell none 27shell none
26 28
29private-cache
27private-dev 30private-dev
28private-tmp 31private-tmp
diff --git a/etc/profile-a-l/Cyberfox.profile b/etc/profile-a-l/Cyberfox.profile
new file mode 100644
index 000000000..5564207fc
--- /dev/null
+++ b/etc/profile-a-l/Cyberfox.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for cyberfox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Cyberfox.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include cyberfox.profile
diff --git a/etc/profile-a-l/Discord.profile b/etc/profile-a-l/Discord.profile
new file mode 100644
index 000000000..3f274b21c
--- /dev/null
+++ b/etc/profile-a-l/Discord.profile
@@ -0,0 +1,17 @@
1# Firejail profile for Discord
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Discord.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/discord
9
10mkdir ${HOME}/.config/discord
11whitelist ${HOME}/.config/discord
12
13private-bin Discord
14private-opt Discord
15
16# Redirect
17include discord-common.profile
diff --git a/etc/profile-a-l/DiscordCanary.profile b/etc/profile-a-l/DiscordCanary.profile
new file mode 100644
index 000000000..d24e73ed8
--- /dev/null
+++ b/etc/profile-a-l/DiscordCanary.profile
@@ -0,0 +1,17 @@
1# Firejail profile for DiscordCanary
2# This file is overwritten after every install/update
3# Persistent local customizations
4include DiscordCanary.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/discordcanary
9
10mkdir ${HOME}/.config/discordcanary
11whitelist ${HOME}/.config/discordcanary
12
13private-bin DiscordCanary
14private-opt DiscordCanary
15
16# Redirect
17include discord-common.profile
diff --git a/etc/profile-a-l/Documents.profile b/etc/profile-a-l/Documents.profile
new file mode 100644
index 000000000..780416d7f
--- /dev/null
+++ b/etc/profile-a-l/Documents.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-documents
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Documents.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include gnome-documents.profile
diff --git a/etc/profile-a-l/FossaMail.profile b/etc/profile-a-l/FossaMail.profile
new file mode 100644
index 000000000..3a584ed4e
--- /dev/null
+++ b/etc/profile-a-l/FossaMail.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for fossamail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include FossaMail.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include fossamail.profile
diff --git a/etc/profile-a-l/Fritzing.profile b/etc/profile-a-l/Fritzing.profile
new file mode 100644
index 000000000..3fe2ddcd5
--- /dev/null
+++ b/etc/profile-a-l/Fritzing.profile
@@ -0,0 +1,39 @@
1# Firejail profile for fritzing
2# Description: Easy-to-use electronic design software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include Fritzing.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Fritzing
10noblacklist ${DOCUMENTS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21caps.drop all
22ipc-namespace
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37private-dev
38private-tmp
39
diff --git a/etc/profile-a-l/Gitter.profile b/etc/profile-a-l/Gitter.profile
new file mode 100644
index 000000000..96b91430c
--- /dev/null
+++ b/etc/profile-a-l/Gitter.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for Gitter
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Gitter.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include gitter.profile
diff --git a/etc/profile-a-l/JDownloader.profile b/etc/profile-a-l/JDownloader.profile
new file mode 100644
index 000000000..92f8e5c85
--- /dev/null
+++ b/etc/profile-a-l/JDownloader.profile
@@ -0,0 +1,48 @@
1# Firejail profile for JDownloader
2# This file is overwritten after every install/update
3# Persistent local customizations
4include JDownloader.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.jd
9
10# Allow java (blacklisted by disable-devel.inc)
11include allow-java.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.jd
21whitelist ${HOME}/.jd
22whitelist ${DOWNLOADS}
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27ipc-namespace
28netfilter
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-a-l/Logs.profile b/etc/profile-a-l/Logs.profile
new file mode 100644
index 000000000..1a78b86c9
--- /dev/null
+++ b/etc/profile-a-l/Logs.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-logs
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Logs.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include gnome-logs.profile
diff --git a/etc/profile-a-l/abiword.profile b/etc/profile-a-l/abiword.profile
new file mode 100644
index 000000000..005a502c4
--- /dev/null
+++ b/etc/profile-a-l/abiword.profile
@@ -0,0 +1,49 @@
1# Firejail profile for abiword
2# Description: flexible cross-platform word processor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include abiword.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/abiword
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18whitelist /usr/share/abiword-3.0
19include whitelist-usr-share-common.inc
20include whitelist-runuser-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42private-bin abiword
43private-cache
44private-dev
45private-etc fonts,gtk-3.0,passwd
46private-tmp
47
48# dbus-user none
49# dbus-system none
diff --git a/etc/profile-a-l/abrowser.profile b/etc/profile-a-l/abrowser.profile
new file mode 100644
index 000000000..2e6e8f1af
--- /dev/null
+++ b/etc/profile-a-l/abrowser.profile
@@ -0,0 +1,20 @@
1# Firejail profile for abrowser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include abrowser.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/mozilla
9noblacklist ${HOME}/.mozilla
10
11mkdir ${HOME}/.cache/mozilla/abrowser
12mkdir ${HOME}/.mozilla
13whitelist ${HOME}/.cache/mozilla/abrowser
14whitelist ${HOME}/.mozilla
15
16# private-etc must first be enabled in firefox-common.profile
17#private-etc abrowser
18
19# Redirect
20include firefox-common.profile
diff --git a/etc/profile-a-l/acat.profile b/etc/profile-a-l/acat.profile
new file mode 100644
index 000000000..522d8db4e
--- /dev/null
+++ b/etc/profile-a-l/acat.profile
@@ -0,0 +1,11 @@
1# Firejail profile for acat
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include acat.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include atool.profile
diff --git a/etc/profile-a-l/adiff.profile b/etc/profile-a-l/adiff.profile
new file mode 100644
index 000000000..a80886d56
--- /dev/null
+++ b/etc/profile-a-l/adiff.profile
@@ -0,0 +1,11 @@
1# Firejail profile for adiff
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include adiff.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include atool.profile
diff --git a/etc/profile-a-l/agetpkg.profile b/etc/profile-a-l/agetpkg.profile
new file mode 100644
index 000000000..fea25fd58
--- /dev/null
+++ b/etc/profile-a-l/agetpkg.profile
@@ -0,0 +1,59 @@
1# Firejail profile for agetpkg
2# Description: CLI tool to list/get/install packages from the Arch Linux Archive
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include agetpkg.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}/wayland-*
12
13# Allow python (blacklisted by disable-interpreters.inc)
14#include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25whitelist ${DOWNLOADS}
26include whitelist-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30caps.drop all
31hostname agetpkg
32ipc-namespace
33machine-id
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol inet,inet6
46seccomp
47shell none
48tracelog
49
50private-bin agetpkg,python3
51private-cache
52private-dev
53private-etc ca-certificates,crypto-policies,pki,resolv.conf,ssl
54private-tmp
55
56dbus-user none
57dbus-system none
58
59memory-deny-write-execute
diff --git a/etc/profile-a-l/akonadi_control.profile b/etc/profile-a-l/akonadi_control.profile
new file mode 100644
index 000000000..168e81985
--- /dev/null
+++ b/etc/profile-a-l/akonadi_control.profile
@@ -0,0 +1,55 @@
1# Firejail profile for akonadi_control
2# Persistent local customizations
3include akonadi_control.local
4# Persistent global definitions
5include globals.local
6
7noblacklist ${HOME}/.cache/akonadi*
8noblacklist ${HOME}/.config/akonadi*
9noblacklist ${HOME}/.config/baloorc
10noblacklist ${HOME}/.config/emaildefaults
11noblacklist ${HOME}/.config/emailidentities
12noblacklist ${HOME}/.config/kmail2rc
13noblacklist ${HOME}/.config/mailtransports
14noblacklist ${HOME}/.config/specialmailcollectionsrc
15noblacklist ${HOME}/.local/share/akonadi*
16noblacklist ${HOME}/.local/share/apps/korganizer
17noblacklist ${HOME}/.local/share/contacts
18noblacklist ${HOME}/.local/share/local-mail
19noblacklist ${HOME}/.local/share/notes
20noblacklist /sbin
21noblacklist /tmp/akonadi-*
22noblacklist /usr/sbin
23
24include disable-common.inc
25include disable-devel.inc
26include disable-exec.inc
27include disable-interpreters.inc
28include disable-programs.inc
29
30include whitelist-var-common.inc
31
32# disabled options below are not compatible with the apparmor profile for mysqld-akonadi.
33# this affects ubuntu and debian currently
34
35# apparmor
36caps.drop all
37ipc-namespace
38netfilter
39no3d
40nodvd
41nogroups
42noinput
43# nonewprivs
44noroot
45nosound
46notv
47nou2f
48novideo
49# protocol unix,inet,inet6,netlink
50# seccomp !io_destroy,!io_getevents,!io_setup,!io_submit,!ioprio_set
51tracelog
52
53private-dev
54# private-tmp - breaks programs that depend on akonadi
55
diff --git a/etc/profile-a-l/akregator.profile b/etc/profile-a-l/akregator.profile
new file mode 100644
index 000000000..d1e7df37b
--- /dev/null
+++ b/etc/profile-a-l/akregator.profile
@@ -0,0 +1,50 @@
1# Firejail profile for akregator
2# Description: RSS/Atom feed aggregator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include akregator.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/akregatorrc
10noblacklist ${HOME}/.local/share/akregator
11noblacklist ${HOME}/.local/share/kxmlgui5/akregator
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19
20mkfile ${HOME}/.config/akregatorrc
21mkdir ${HOME}/.local/share/akregator
22mkdir ${HOME}/.local/share/kxmlgui5/akregator
23whitelist ${HOME}/.config/akregatorrc
24whitelist ${HOME}/.local/share/akregator
25whitelist ${HOME}/.local/share/kssl
26whitelist ${HOME}/.local/share/kxmlgui5/akregator
27include whitelist-common.inc
28include whitelist-var-common.inc
29
30caps.drop all
31netfilter
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40novideo
41protocol unix,inet,inet6,netlink
42# chroot syscalls are needed for setting up the built-in sandbox
43seccomp !chroot
44shell none
45
46disable-mnt
47private-bin akregator,akregatorstorageexporter,dbus-launch,kdeinit4,kdeinit4_shutdown,kdeinit4_wrapper,kdeinit5,kdeinit5_shutdown,kdeinit5_wrapper,kshell4,kshell5
48private-dev
49private-tmp
50
diff --git a/etc/profile-a-l/alacarte.profile b/etc/profile-a-l/alacarte.profile
new file mode 100644
index 000000000..69b499c74
--- /dev/null
+++ b/etc/profile-a-l/alacarte.profile
@@ -0,0 +1,65 @@
1# Firejail profile for alacarte
2# Description: Create desktop and menu launchers easily
3# This file is overwritten after every install/update
4# Persistent local customizations
5include alacarte.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20# Whitelist your system icon directory,varies by distro
21whitelist /usr/share/alacarte
22whitelist /usr/share/app-info
23whitelist /usr/share/desktop-directories
24whitelist /usr/share/icons
25whitelist /var/lib/app-info/icons
26whitelist /var/lib/flatpak/exports/share/applications
27whitelist /var/lib/flatpak/exports/share/icons
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35net none
36nodvd
37no3d
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46protocol unix
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53# private-bin alacarte,bash,python*,sh
54private-cache
55private-dev
56private-etc alternatives,dconf,fonts,gtk-3.0,locale.alias,locale.conf,login.defs,mime.types,nsswitch.conf,passwd,pki,X11,xdg
57private-tmp
58
59dbus-user none
60dbus-system none
61
62read-write ${HOME}/.config/menus
63read-write ${HOME}/.gnome/apps
64read-write ${HOME}/.local/share/applications
65read-write ${HOME}/.local/share/flatpak/exports
diff --git a/etc/profile-a-l/alienarena-wrapper.profile b/etc/profile-a-l/alienarena-wrapper.profile
new file mode 100644
index 000000000..b31996cd2
--- /dev/null
+++ b/etc/profile-a-l/alienarena-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for alienarena-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include alienarena-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin alienarena-wrapper
12
13# Redirect
14include alienarena.profile
diff --git a/etc/profile-a-l/alienarena.profile b/etc/profile-a-l/alienarena.profile
new file mode 100644
index 000000000..62857a3e2
--- /dev/null
+++ b/etc/profile-a-l/alienarena.profile
@@ -0,0 +1,52 @@
1# Firejail profile for alienarena
2# Description: Multiplayer retro sci-fi deathmatch game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include alienarena.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/cor-games
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/cor-games
20whitelist ${HOME}/.local/share/cor-games
21whitelist /usr/share/alienarena
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin alienarena
46private-cache
47private-dev
48private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,drirc,fonts,glvnd,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,nsswitch.conf,nvidia,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-a-l/alpine.profile b/etc/profile-a-l/alpine.profile
new file mode 100644
index 000000000..61c3ad21d
--- /dev/null
+++ b/etc/profile-a-l/alpine.profile
@@ -0,0 +1,103 @@
1# Firejail profile for alpine
2# Description: Text-based email and newsgroups reader
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include alpine.local
7# Persistent global definitions
8include globals.local
9
10# Workaround for bug https://github.com/netblue30/firejail/issues/2747
11# firejail --private-bin=sh --include='${CFG}/allow-bin-sh.inc' --profile=alpine sh -c '(alpine)'
12
13noblacklist /var/mail
14noblacklist /var/spool/mail
15noblacklist ${DOCUMENTS}
16noblacklist ${HOME}/.addressbook
17noblacklist ${HOME}/.alpine-smime
18noblacklist ${HOME}/.mailcap
19noblacklist ${HOME}/.mh_profile
20noblacklist ${HOME}/.mime.types
21noblacklist ${HOME}/.newsrc
22noblacklist ${HOME}/.pine-crash
23noblacklist ${HOME}/.pine-debug1
24noblacklist ${HOME}/.pine-debug2
25noblacklist ${HOME}/.pine-debug3
26noblacklist ${HOME}/.pine-debug4
27noblacklist ${HOME}/.pine-interrupted-mail
28noblacklist ${HOME}/.pinerc
29noblacklist ${HOME}/.pinercex
30noblacklist ${HOME}/.signature
31noblacklist ${HOME}/mail
32
33blacklist /tmp/.X11-unix
34blacklist ${RUNUSER}/wayland-*
35
36include disable-common.inc
37include disable-devel.inc
38include disable-exec.inc
39include disable-interpreters.inc
40include disable-programs.inc
41include disable-shell.inc
42include disable-xdg.inc
43
44#whitelist ${DOCUMENTS}
45#whitelist ${DOWNLOADS}
46#whitelist ${HOME}/.addressbook
47#whitelist ${HOME}/.alpine-smime
48#whitelist ${HOME}/.mailcap
49#whitelist ${HOME}/.mh_profile
50#whitelist ${HOME}/.mime.types
51#whitelist ${HOME}/.newsrc
52#whitelist ${HOME}/.pine-crash
53#whitelist ${HOME}/.pine-interrupted-mail
54#whitelist ${HOME}/.pinerc
55#whitelist ${HOME}/.pinercex
56#whitelist ${HOME}/.pine-debug1
57#whitelist ${HOME}/.pine-debug2
58#whitelist ${HOME}/.pine-debug3
59#whitelist ${HOME}/.pine-debug4
60#whitelist ${HOME}/.signature
61#whitelist ${HOME}/mail
62whitelist /var/mail
63whitelist /var/spool/mail
64#include whitelist-common.inc
65include whitelist-runuser-common.inc
66include whitelist-usr-share-common.inc
67include whitelist-var-common.inc
68
69apparmor
70caps.drop all
71ipc-namespace
72machine-id
73netfilter
74no3d
75nodvd
76nogroups
77noinput
78nonewprivs
79noroot
80nosound
81notv
82nou2f
83novideo
84protocol unix,inet,inet6
85seccomp
86seccomp.block-secondary
87shell none
88tracelog
89
90disable-mnt
91private-bin alpine
92private-cache
93private-dev
94private-etc alternatives,c-client.cf,ca-certificates,crypto-policies,host.conf,hostname,hosts,krb5.keytab,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mailcap,mime.types,nsswitch.conf,passwd,pine.conf,pinerc.fixed,pki,protocols,resolv.conf,rpc,services,ssl,terminfo,xdg
95private-tmp
96writable-run-user
97writable-var
98
99dbus-user none
100dbus-system none
101
102memory-deny-write-execute
103read-only ${HOME}/.signature
diff --git a/etc/profile-a-l/alpinef.profile b/etc/profile-a-l/alpinef.profile
new file mode 100644
index 000000000..97b97fe5f
--- /dev/null
+++ b/etc/profile-a-l/alpinef.profile
@@ -0,0 +1,14 @@
1# Firejail profile for alpinef
2# Description: Text-based email and newsgroups reader using function keys
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include alpinef.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11private-bin alpinef
12
13# Redirect
14include alpine.profile
diff --git a/etc/profile-a-l/als.profile b/etc/profile-a-l/als.profile
new file mode 100644
index 000000000..5eae228b6
--- /dev/null
+++ b/etc/profile-a-l/als.profile
@@ -0,0 +1,11 @@
1# Firejail profile for als
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include als.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include atool.profile
diff --git a/etc/profile-a-l/amarok.profile b/etc/profile-a-l/amarok.profile
new file mode 100644
index 000000000..e7b78f7d0
--- /dev/null
+++ b/etc/profile-a-l/amarok.profile
@@ -0,0 +1,47 @@
1# Firejail profile for amarok
2# Description: Easy to use media player based on the KDE Platform
3# This file is overwritten after every install/update
4# Persistent local customizations
5include amarok.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${MUSIC}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
16
17include whitelist-var-common.inc
18
19caps.drop all
20netfilter
21nogroups
22noinput
23nonewprivs
24noroot
25notv
26nou2f
27novideo
28protocol unix,inet,inet6
29# seccomp
30shell none
31
32# private-bin amarok
33private-dev
34# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,machine-id,pki,pulse,ssl
35private-tmp
36
37dbus-user filter
38dbus-user.own org.kde.amarok
39dbus-user.own org.mpris.amarok
40dbus-user.own org.mpris.MediaPlayer2.amarok
41dbus-user.talk org.freedesktop.Notifications
42dbus-user.talk org.kde.StatusNotifierWatcher
43# If you're not on kde-plasma add the next lines to your amarok.local.
44#dbus-user.own org.kde.kded
45#dbus-user.own org.kde.klauncher
46#dbus-user.talk org.kde.knotify
47dbus-system none
diff --git a/etc/amule.profile b/etc/profile-a-l/amule.profile
index 98ec52015..3ce05c5bc 100644
--- a/etc/amule.profile
+++ b/etc/profile-a-l/amule.profile
@@ -1,21 +1,23 @@
1# Firejail profile for amule 1# Firejail profile for amule
2# Description: Client for the eD2k and Kad networks, like eMule
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/amule.local 5include amule.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7
8 8
9noblacklist ${HOME}/.aMule 9noblacklist ${HOME}/.aMule
10 10
11include /etc/firejail/disable-common.inc 11include disable-common.inc
12include /etc/firejail/disable-devel.inc 12include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 13include disable-exec.inc
14include /etc/firejail/disable-programs.inc 14include disable-interpreters.inc
15include disable-programs.inc
15 16
17mkdir ${HOME}/.aMule
16whitelist ${DOWNLOADS} 18whitelist ${DOWNLOADS}
17whitelist ${HOME}/.aMule 19whitelist ${HOME}/.aMule
18include /etc/firejail/whitelist-common.inc 20include whitelist-common.inc
19 21
20caps.drop all 22caps.drop all
21ipc-namespace 23ipc-namespace
@@ -23,10 +25,12 @@ netfilter
23no3d 25no3d
24nodvd 26nodvd
25nogroups 27nogroups
28noinput
26nonewprivs 29nonewprivs
27noroot 30noroot
28nosound 31nosound
29notv 32notv
33nou2f
30novideo 34novideo
31protocol unix,inet,inet6 35protocol unix,inet,inet6
32seccomp 36seccomp
@@ -36,5 +40,3 @@ private-bin amule
36private-dev 40private-dev
37private-tmp 41private-tmp
38 42
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/profile-a-l/amuled.profile b/etc/profile-a-l/amuled.profile
new file mode 100644
index 000000000..58b796875
--- /dev/null
+++ b/etc/profile-a-l/amuled.profile
@@ -0,0 +1,13 @@
1# Firejail profile for amuled
2# Description: Daemon for amule
3# This file is overwritten after every install/update
4# Persistent local customizations
5include amule.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10private-bin amuled
11
12# Redirect
13include amule.profile
diff --git a/etc/android-studio.profile b/etc/profile-a-l/android-studio.profile
index 6be92e1c0..ad44d5f1d 100644
--- a/etc/android-studio.profile
+++ b/etc/profile-a-l/android-studio.profile
@@ -1,24 +1,28 @@
1# Firejail profile for android-studio 1# Firejail profile for android-studio
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/android-studio.local 4include android-studio.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/Google
8noblacklist ${HOME}/.AndroidStudio* 9noblacklist ${HOME}/.AndroidStudio*
9noblacklist ${HOME}/.android 10noblacklist ${HOME}/.android
10noblacklist ${HOME}/.gitconfig
11noblacklist ${HOME}/.gradle
12noblacklist ${HOME}/.jack-server 11noblacklist ${HOME}/.jack-server
13noblacklist ${HOME}/.jack-settings 12noblacklist ${HOME}/.jack-settings
14noblacklist ${HOME}/.java
15noblacklist ${HOME}/.local/share/JetBrains 13noblacklist ${HOME}/.local/share/JetBrains
16noblacklist ${HOME}/.ssh
17noblacklist ${HOME}/.tooling 14noblacklist ${HOME}/.tooling
18 15
19include /etc/firejail/disable-common.inc 16# Allows files commonly used by IDEs
20include /etc/firejail/disable-passwdmgr.inc 17include allow-common-devel.inc
21include /etc/firejail/disable-programs.inc 18
19# Allow ssh (blacklisted by disable-common.inc)
20include allow-ssh.inc
21
22include disable-common.inc
23include disable-programs.inc
24
25include whitelist-var-common.inc
22 26
23caps.drop all 27caps.drop all
24netfilter 28netfilter
@@ -32,7 +36,8 @@ protocol unix,inet,inet6
32seccomp 36seccomp
33shell none 37shell none
34 38
35private-dev 39private-cache
36# private-tmp 40# private-tmp
37 41
38noexec /tmp 42# noexec /tmp breaks 'Android Profiler'
43#noexec /tmp
diff --git a/etc/profile-a-l/anki.profile b/etc/profile-a-l/anki.profile
new file mode 100644
index 000000000..fa4dfbb6f
--- /dev/null
+++ b/etc/profile-a-l/anki.profile
@@ -0,0 +1,57 @@
1# Firejail profile for anki
2# Description: flexible, intelligent flashcard program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include anki.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${HOME}/.local/share/Anki2
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.local/share/Anki2
25whitelist ${DOCUMENTS}
26whitelist ${HOME}/.local/share/Anki2
27include whitelist-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32machine-id
33netfilter
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix,inet,inet6
45# QtWebengine needs chroot to set up its own sandbox
46seccomp !chroot
47shell none
48
49disable-mnt
50private-bin anki,python*
51private-cache
52private-dev
53private-etc alternatives,ca-certificates,fonts,gtk-2.0,hostname,hosts,machine-id,pki,resolv.conf,ssl,Trolltech.conf
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/profile-a-l/anydesk.profile b/etc/profile-a-l/anydesk.profile
new file mode 100644
index 000000000..5001b20cb
--- /dev/null
+++ b/etc/profile-a-l/anydesk.profile
@@ -0,0 +1,36 @@
1# Firejail profile for AnyDesk
2# This file is overwritten after every install/update
3# Persistent local customizations
4include anydesk.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.anydesk
9
10include disable-common.inc
11include disable-devel.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15
16mkdir ${HOME}/.anydesk
17whitelist ${HOME}/.anydesk
18include whitelist-common.inc
19
20caps.drop all
21netfilter
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27notv
28nou2f
29protocol unix,inet,inet6
30seccomp
31shell none
32
33disable-mnt
34private-bin anydesk
35private-dev
36private-tmp
diff --git a/etc/aosp.profile b/etc/profile-a-l/aosp.profile
index 5ceef9348..9668ba00a 100644
--- a/etc/aosp.profile
+++ b/etc/profile-a-l/aosp.profile
@@ -1,28 +1,29 @@
1# Firejail profile for aosp 1# Firejail profile for aosp
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/aosp.local 4include aosp.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7
8 7
9noblacklist ${HOME}/.android 8noblacklist ${HOME}/.android
10noblacklist ${HOME}/.bash_history 9noblacklist ${HOME}/.bash_history
11noblacklist ${HOME}/.gitconfig
12noblacklist ${HOME}/.gradle
13noblacklist ${HOME}/.jack-server 10noblacklist ${HOME}/.jack-server
14noblacklist ${HOME}/.jack-settings 11noblacklist ${HOME}/.jack-settings
15noblacklist ${HOME}/.java
16noblacklist ${HOME}/.repo_.gitconfig.json 12noblacklist ${HOME}/.repo_.gitconfig.json
17noblacklist ${HOME}/.repoconfig 13noblacklist ${HOME}/.repoconfig
18noblacklist ${HOME}/.ssh
19noblacklist ${HOME}/.tooling 14noblacklist ${HOME}/.tooling
20 15
21include /etc/firejail/disable-common.inc 16# Allows files commonly used by IDEs
22include /etc/firejail/disable-passwdmgr.inc 17include allow-common-devel.inc
23include /etc/firejail/disable-programs.inc 18
19# Allow ssh (blacklisted by disable-common.inc)
20include allow-ssh.inc
21
22include disable-common.inc
23include disable-programs.inc
24include disable-xdg.inc
24 25
25include /etc/firejail/whitelist-var-common.inc 26include whitelist-var-common.inc
26 27
27caps.drop all 28caps.drop all
28ipc-namespace 29ipc-namespace
diff --git a/etc/profile-a-l/apack.profile b/etc/profile-a-l/apack.profile
new file mode 100644
index 000000000..9fef911af
--- /dev/null
+++ b/etc/profile-a-l/apack.profile
@@ -0,0 +1,11 @@
1# Firejail profile for apack
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include apack.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include atool.profile
diff --git a/etc/profile-a-l/apktool.profile b/etc/profile-a-l/apktool.profile
new file mode 100644
index 000000000..1951748d4
--- /dev/null
+++ b/etc/profile-a-l/apktool.profile
@@ -0,0 +1,38 @@
1# Firejail profile for apktool
2# Description: Tool for reverse engineering Android apk files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include apktool.local
7# Persistent global definitions
8include globals.local
9
10include disable-common.inc
11include disable-exec.inc
12include disable-programs.inc
13include disable-xdg.inc
14
15include whitelist-var-common.inc
16
17caps.drop all
18net none
19no3d
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25nosound
26notv
27nou2f
28novideo
29protocol unix
30seccomp
31shell none
32
33private-bin apktool,basename,bash,dirname,expr,java,sh
34private-cache
35private-dev
36
37dbus-user none
38dbus-system none
diff --git a/etc/profile-a-l/apostrophe.profile b/etc/profile-a-l/apostrophe.profile
new file mode 100644
index 000000000..5d45a0804
--- /dev/null
+++ b/etc/profile-a-l/apostrophe.profile
@@ -0,0 +1,72 @@
1# Firejail profile for apostrophe
2# Description: Distraction free Markdown editor for GNU/Linux made with GTK+
3# This file is overwritten after every install/update
4# Persistent local customizations
5include apostrophe.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.texlive20*
10noblacklist ${DOCUMENTS}
11noblacklist ${PICTURES}
12
13# Allow lua (blacklisted by disable-interpreters.inc)
14include allow-lua.inc
15
16# Allow perl (blacklisted by disable-interpreters.inc)
17include allow-perl.inc
18
19# Allow python (blacklisted by disable-interpreters.inc)
20include allow-python3.inc
21
22# Allow /bin/sh (blacklisted by disable-shell.inc)
23include allow-bin-sh.inc
24
25include disable-common.inc
26include disable-devel.inc
27include disable-exec.inc
28include disable-interpreters.inc
29include disable-programs.inc
30include disable-shell.inc
31include disable-xdg.inc
32
33whitelist /usr/libexec/webkit2gtk-4.0
34whitelist /usr/share/apostrophe
35whitelist /usr/share/texlive
36whitelist /usr/share/texmf
37whitelist /usr/share/pandoc-*
38whitelist /usr/share/perl5
39include whitelist-runuser-common.inc
40include whitelist-usr-share-common.inc
41include whitelist-var-common.inc
42
43apparmor
44caps.drop all
45machine-id
46net none
47no3d
48nodvd
49nogroups
50noinput
51nonewprivs
52noroot
53nosound
54notv
55nou2f
56novideo
57protocol unix
58seccomp
59shell none
60tracelog
61
62disable-mnt
63private-bin apostrophe,fmtutil,kpsewhich,mktexfmt,pandoc,pdftex,perl,python3*,sh,xdvipdfmx,xelatex,xetex
64private-cache
65private-dev
66private-etc alternatives,dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,pango,texlive,X11
67private-tmp
68
69dbus-user filter
70dbus-user.own org.gnome.gitlab.somas.Apostrophe
71dbus-user.talk ca.desrt.dconf
72dbus-system none
diff --git a/etc/profile-a-l/ar.profile b/etc/profile-a-l/ar.profile
new file mode 100644
index 000000000..5a20a8181
--- /dev/null
+++ b/etc/profile-a-l/ar.profile
@@ -0,0 +1,11 @@
1# Firejail profile for ar
2# Description: Create, modify, and extract from archives
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ar.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include archiver-common.profile
diff --git a/etc/profile-a-l/arch-audit.profile b/etc/profile-a-l/arch-audit.profile
new file mode 100644
index 000000000..c164073c5
--- /dev/null
+++ b/etc/profile-a-l/arch-audit.profile
@@ -0,0 +1,52 @@
1# Firejail profile for arch-audit
2# Description: A utility like pkg-audit based on Arch CVE Monitoring Team data
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include arch-audit.local
7# Persistent global definitions
8include globals.local
9
10noblacklist /var/lib/pacman
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20whitelist /usr/share/arch-audit
21include whitelist-usr-share-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol inet,inet6
39seccomp
40shell none
41
42disable-mnt
43private
44private-bin arch-audit
45private-cache
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
51
52memory-deny-write-execute
diff --git a/etc/profile-a-l/archaudit-report.profile b/etc/profile-a-l/archaudit-report.profile
new file mode 100644
index 000000000..3aebd685d
--- /dev/null
+++ b/etc/profile-a-l/archaudit-report.profile
@@ -0,0 +1,39 @@
1# Firejail profile for archaudit-report
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include archaudit-report.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /var/lib/pacman
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18caps.drop all
19ipc-namespace
20netfilter
21no3d
22nodvd
23nogroups
24nonewprivs
25noroot
26nosound
27notv
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32
33disable-mnt
34private
35private-bin arch-audit,archaudit-report,bash,cat,comm,cut,date,fold,grep,pacman,pactree,rm,sed,sort,whoneeds
36#private-dev
37private-tmp
38
39memory-deny-write-execute
diff --git a/etc/profile-a-l/archiver-common.profile b/etc/profile-a-l/archiver-common.profile
new file mode 100644
index 000000000..81733220f
--- /dev/null
+++ b/etc/profile-a-l/archiver-common.profile
@@ -0,0 +1,52 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include archiver-common.local
4
5# common profile for archiver/compression tools
6
7blacklist ${RUNUSER}
8
9# Comment/uncomment the relevant include file(s) in your archiver-common.local
10# to (un)restrict file access for **all** archivers. Another option is to do this **per archiver**
11# in the relevant <archiver>.local. Beware that things tend to break when overtightening
12# profiles. For example, because you only need to (un)compress files in ${DOWNLOADS},
13# other applications may need access to ${HOME}/.local/share.
14
15# Add the next line to your archiver-common.local if you don't need to compress files in disable-common.inc.
16#include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20# Add the next line to your archiver-common.local if you don't need to compress files in disable-programs.inc.
21#include disable-programs.inc
22include disable-shell.inc
23
24apparmor
25caps.drop all
26hostname archiver
27ipc-namespace
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35#noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42shell none
43tracelog
44x11 none
45
46private-cache
47private-dev
48
49dbus-user none
50dbus-system none
51
52memory-deny-write-execute
diff --git a/etc/profile-a-l/ardour4.profile b/etc/profile-a-l/ardour4.profile
new file mode 100644
index 000000000..5c62c94be
--- /dev/null
+++ b/etc/profile-a-l/ardour4.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for ardour5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ardur4.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include ardour5.profile
diff --git a/etc/profile-a-l/ardour5.profile b/etc/profile-a-l/ardour5.profile
new file mode 100644
index 000000000..78dea1cd0
--- /dev/null
+++ b/etc/profile-a-l/ardour5.profile
@@ -0,0 +1,43 @@
1# Firejail profile for ardour5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ardour5.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/ardour4
9noblacklist ${HOME}/.config/ardour5
10noblacklist ${HOME}/.lv2
11noblacklist ${HOME}/.vst
12noblacklist ${DOCUMENTS}
13noblacklist ${MUSIC}
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22caps.drop all
23ipc-namespace
24net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32protocol unix
33seccomp
34shell none
35
36#private-bin ardour4,ardour5,ardour5-copy-mixer,ardour5-export,ardour5-fix_bbtppq,grep,ldd,nm,sed,sh
37private-cache
38private-dev
39#private-etc alternatives,ardour4,ardour5,asound.conf,fonts,machine-id,pulse,X11
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/profile-a-l/arduino.profile b/etc/profile-a-l/arduino.profile
new file mode 100644
index 000000000..01da63e8e
--- /dev/null
+++ b/etc/profile-a-l/arduino.profile
@@ -0,0 +1,39 @@
1# Firejail profile for arduino
2# Description: AVR development board IDE and built-in libraries
3# This file is overwritten after every install/update
4# Persistent local customizations
5include arduino.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.arduino15
10noblacklist ${HOME}/Arduino
11noblacklist ${DOCUMENTS}
12
13# Allow java (blacklisted by disable-devel.inc)
14include allow-java.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23caps.drop all
24netfilter
25no3d
26nodvd
27# nogroups
28nonewprivs
29noroot
30nosound
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37private-cache
38private-tmp
39
diff --git a/etc/profile-a-l/arepack.profile b/etc/profile-a-l/arepack.profile
new file mode 100644
index 000000000..012f2f049
--- /dev/null
+++ b/etc/profile-a-l/arepack.profile
@@ -0,0 +1,11 @@
1# Firejail profile for arepack
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include arepack.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include atool.profile
diff --git a/etc/profile-a-l/aria2c.profile b/etc/profile-a-l/aria2c.profile
new file mode 100644
index 000000000..737cf3095
--- /dev/null
+++ b/etc/profile-a-l/aria2c.profile
@@ -0,0 +1,55 @@
1# Firejail profile for aria2c
2# Description: Download utility that supports HTTP(S), FTP, BitTorrent and Metalink
3# This file is overwritten after every install/update
4# Persistent local customizations
5include aria2c.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.aria2
10noblacklist ${HOME}/.config/aria2
11noblacklist ${HOME}/.netrc
12
13blacklist /tmp/.X11-unix
14blacklist ${RUNUSER}/wayland-*
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25caps.drop all
26ipc-namespace
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6,netlink
39seccomp
40shell none
41
42# disable-mnt
43# Add your custom event hook commands to 'private-bin' in your aria2c.local.
44private-bin aria2c,gzip
45# Add 'private-cache' to your aria2c.local if you don't use Lutris/winetricks (see issue #2772).
46#private-cache
47private-dev
48private-etc alternatives,ca-certificates,crypto-policies,groups,login.defs,machine-id,nsswitch.conf,passwd,pki,resolv.conf,ssl
49private-lib libreadline.so.*
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-a-l/ark.profile b/etc/profile-a-l/ark.profile
new file mode 100644
index 000000000..45071dc62
--- /dev/null
+++ b/etc/profile-a-l/ark.profile
@@ -0,0 +1,46 @@
1# Firejail profile for ark
2# Description: Archive utility
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ark.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/arkrc
10noblacklist ${HOME}/.local/share/kxmlgui5/ark
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18whitelist /usr/share/ark
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24# net none
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38
39private-bin 7z,ark,bash,lrzip,lsar,lz4,lzop,p7zip,rar,sh,tclsh,unar,unrar,unzip,zip,zipinfo
40#private-etc alternatives,drirc,fonts,group,kde5rc,mtab,passwd,samba,smb.conf,xdg
41
42private-dev
43private-tmp
44
45# dbus-user none
46# dbus-system none
diff --git a/etc/profile-a-l/arm.profile b/etc/profile-a-l/arm.profile
new file mode 100644
index 000000000..3253fb586
--- /dev/null
+++ b/etc/profile-a-l/arm.profile
@@ -0,0 +1,48 @@
1# Firejail profile for arm
2# Description: Terminal status monitor for Tor relays
3# This file is overwritten after every install/update
4# Persistent local customizations
5include arm.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.arm
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.arm
22whitelist ${HOME}/.arm
23include whitelist-common.inc
24
25caps.drop all
26ipc-namespace
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin arm,bash,ldconfig,lsof,ps,python*,sh,tor
45private-dev
46private-etc alternatives,ca-certificates,crypto-policies,passwd,pki,ssl,tor
47private-tmp
48
diff --git a/etc/profile-a-l/artha.profile b/etc/profile-a-l/artha.profile
new file mode 100644
index 000000000..8d74b6ba4
--- /dev/null
+++ b/etc/profile-a-l/artha.profile
@@ -0,0 +1,66 @@
1# Firejail profile for artha
2# Description: A free cross-platform English thesaurus based on WordNet
3# This file is overwritten after every install/update
4# Persistent local customizations
5include artha.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/artha.conf
10noblacklist ${HOME}/.config/artha.log
11noblacklist ${HOME}/.config/enchant
12
13blacklist /tmp/.X11-unix
14blacklist ${RUNUSER}/wayland-*
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24# whitelisting in ${HOME} makes settings immutable, see #3112
25#mkfile ${HOME}/.config/artha.conf
26#mkdir ${HOME}/.config/enchant
27#whitelist ${HOME}/.config/artha.conf
28#whitelist ${HOME}/.config/artha.log
29#whitelist ${HOME}/.config/enchant
30whitelist /usr/share/artha
31whitelist /usr/share/wordnet
32#include whitelist-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38ipc-namespace
39# net none - breaks on Ubuntu
40no3d
41nodvd
42nogroups
43noinput
44nonewprivs
45noroot
46nosound
47notv
48nou2f
49novideo
50protocol unix
51seccomp
52shell none
53tracelog
54
55disable-mnt
56private-bin artha,enchant,notify-send
57private-cache
58private-dev
59private-etc alternatives,fonts,machine-id
60private-lib libnotify.so.*
61private-tmp
62
63# dbus-user none
64# dbus-system none
65
66memory-deny-write-execute
diff --git a/etc/profile-a-l/assogiate.profile b/etc/profile-a-l/assogiate.profile
new file mode 100644
index 000000000..788a94302
--- /dev/null
+++ b/etc/profile-a-l/assogiate.profile
@@ -0,0 +1,54 @@
1# Firejail profile for assogiate
2# Description: An editor of the MIME file types database for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include assogiate.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PICTURES}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19whitelist ${PICTURES}
20include whitelist-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26machine-id
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin assogiate,gtk-update-icon-cache,update-mime-database
45private-cache
46private-dev
47private-lib gnome-vfs-2.0,libacl.so.*,libattr.so.*,libfam.so.*
48private-tmp
49
50dbus-user none
51dbus-system none
52
53memory-deny-write-execute
54read-write ${HOME}/.local/share/mime
diff --git a/etc/profile-a-l/asunder.profile b/etc/profile-a-l/asunder.profile
new file mode 100644
index 000000000..fbc65ffc7
--- /dev/null
+++ b/etc/profile-a-l/asunder.profile
@@ -0,0 +1,48 @@
1# Firejail profile for asounder
2# Description: Graphical audio CD ripper and encoder
3# This file is overwritten after every install/update
4# Persistent local customizations
5include asunder.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/asunder
10noblacklist ${HOME}/.asunder_album_genre
11noblacklist ${HOME}/.asunder_album_title
12noblacklist ${HOME}/.asunder_album_artist
13noblacklist ${MUSIC}
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27netfilter
28no3d
29# nogroups
30noinput
31nonewprivs
32noroot
33nou2f
34notv
35novideo
36protocol unix,inet,inet6
37seccomp
38shell none
39
40private-cache
41private-dev
42private-tmp
43
44dbus-user none
45dbus-system none
46
47# mdwe is disabled due to breaking hardware accelerated decoding
48# memory-deny-write-execute
diff --git a/etc/profile-a-l/atom-beta.profile b/etc/profile-a-l/atom-beta.profile
new file mode 100644
index 000000000..c0ee2c492
--- /dev/null
+++ b/etc/profile-a-l/atom-beta.profile
@@ -0,0 +1,10 @@
1# Firejail profile for atom-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include atom-beta.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include atom.profile
diff --git a/etc/profile-a-l/atom.profile b/etc/profile-a-l/atom.profile
new file mode 100644
index 000000000..5f237ac59
--- /dev/null
+++ b/etc/profile-a-l/atom.profile
@@ -0,0 +1,31 @@
1# Firejail profile for atom
2# Description: A hackable text editor for the 21st Century
3# This file is overwritten after every install/update
4# Persistent local customizations
5include atom.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore include disable-devel.inc
11ignore include disable-interpreters.inc
12ignore include disable-xdg.inc
13ignore whitelist ${DOWNLOADS}
14ignore include whitelist-common.inc
15ignore include whitelist-runuser-common.inc
16ignore include whitelist-usr-share-common.inc
17ignore include whitelist-var-common.inc
18ignore apparmor
19ignore disable-mnt
20
21noblacklist ${HOME}/.atom
22noblacklist ${HOME}/.config/Atom
23
24# Allows files commonly used by IDEs
25include allow-common-devel.inc
26
27# net none
28nosound
29
30# Redirect
31include electron.profile
diff --git a/etc/profile-a-l/atool.profile b/etc/profile-a-l/atool.profile
new file mode 100644
index 000000000..e377de2c8
--- /dev/null
+++ b/etc/profile-a-l/atool.profile
@@ -0,0 +1,20 @@
1# Firejail profile for atool
2# Description: Tool for managing file archives of various types
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include atool.local
7# Persistent global definitions
8include globals.local
9
10# Allow perl (blacklisted by disable-interpreters.inc)
11include allow-perl.inc
12
13noroot
14
15# without login.defs atool complains and uses UID/GID 1000 by default
16private-etc alternatives,group,login.defs,passwd
17private-tmp
18
19# Redirect
20include archiver-common.profile
diff --git a/etc/profile-a-l/atril-previewer.profile b/etc/profile-a-l/atril-previewer.profile
new file mode 100644
index 000000000..7f4697357
--- /dev/null
+++ b/etc/profile-a-l/atril-previewer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for atril-previewer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include atril-previewer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include atril.profile
diff --git a/etc/profile-a-l/atril-thumbnailer.profile b/etc/profile-a-l/atril-thumbnailer.profile
new file mode 100644
index 000000000..8f6129ea6
--- /dev/null
+++ b/etc/profile-a-l/atril-thumbnailer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for atril-thumbnailer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include atril-thumbnailer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include atril.profile
diff --git a/etc/profile-a-l/atril.profile b/etc/profile-a-l/atril.profile
new file mode 100644
index 000000000..f7c62926f
--- /dev/null
+++ b/etc/profile-a-l/atril.profile
@@ -0,0 +1,52 @@
1# Firejail profile for atril
2# Description: MATE document viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include atril.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/atril
10noblacklist ${HOME}/.config/atril
11noblacklist ${DOCUMENTS}
12
13#noblacklist ${HOME}/.local/share
14# it seems to use only ${HOME}/.local/share/webkitgtk
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-var-common.inc
24
25# apparmor
26caps.drop all
27machine-id
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43private-bin 7z,7za,7zr,atril,atril-previewer,atril-thumbnailer,sh,tar,unrar,unzip,zipnote
44private-dev
45private-etc alternatives,fonts,ld.so.cache
46# atril uses webkit gtk to display epub files
47# waiting for globbing support in private-lib; for now hardcoding it to webkit2gtk-4.0
48#private-lib webkit2gtk-4.0 - problems on Arch with the new version of WebKit
49private-tmp
50
51# webkit gtk killed by memory-deny-write-execute
52#memory-deny-write-execute
diff --git a/etc/profile-a-l/audacious.profile b/etc/profile-a-l/audacious.profile
new file mode 100644
index 000000000..d71370b7e
--- /dev/null
+++ b/etc/profile-a-l/audacious.profile
@@ -0,0 +1,44 @@
1# Firejail profile for audacious
2# Description: Small and fast audio player which supports lots of formats
3# This file is overwritten after every install/update
4# Persistent local customizations
5include audacious.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Audaciousrc
10noblacklist ${HOME}/.config/audacious
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24netfilter
25nogroups
26noinput
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37# private-bin audacious
38private-cache
39private-dev
40private-tmp
41
42# dbus needed for MPRIS
43# dbus-user none
44# dbus-system none
diff --git a/etc/profile-a-l/audacity.profile b/etc/profile-a-l/audacity.profile
new file mode 100644
index 000000000..264bfb9ab
--- /dev/null
+++ b/etc/profile-a-l/audacity.profile
@@ -0,0 +1,46 @@
1# Firejail profile for audacity
2# Description: Fast, cross-platform audio editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include audacity.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.audacity-data
10noblacklist ${DOCUMENTS}
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25net none
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40private-bin audacity
41private-dev
42private-tmp
43
44# problems on Fedora 27
45# dbus-user none
46# dbus-system none
diff --git a/etc/profile-a-l/audio-recorder.profile b/etc/profile-a-l/audio-recorder.profile
new file mode 100644
index 000000000..58b2efde6
--- /dev/null
+++ b/etc/profile-a-l/audio-recorder.profile
@@ -0,0 +1,54 @@
1# Firejail profile for audio-recorder
2# Description: Audio Recorder Application
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include audio-recorder.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19whitelist ${MUSIC}
20whitelist ${DOWNLOADS}
21whitelist /usr/share/audio-recorder
22whitelist /usr/share/gstreamer-1.0
23include whitelist-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30net none
31no3d
32nodvd
33nogroups
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43
44disable-mnt
45# private-bin audio-recorder
46private-cache
47private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload
48private-tmp
49
50dbus-user filter
51dbus-user.talk ca.desrt.dconf
52dbus-system none
53
54# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-a-l/aunpack.profile b/etc/profile-a-l/aunpack.profile
new file mode 100644
index 000000000..6ce4aa491
--- /dev/null
+++ b/etc/profile-a-l/aunpack.profile
@@ -0,0 +1,11 @@
1# Firejail profile for aunpack
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include aunpack.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include atool.profile
diff --git a/etc/profile-a-l/authenticator-rs.profile b/etc/profile-a-l/authenticator-rs.profile
new file mode 100644
index 000000000..411c5f4d3
--- /dev/null
+++ b/etc/profile-a-l/authenticator-rs.profile
@@ -0,0 +1,55 @@
1# Firejail profile for authenticator-rs
2# Description: Rust based 2FA authentication program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include authenticator-rs.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/authenticator-rs
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/authenticator-rs
20whitelist ${HOME}/.local/share/authenticator-rs
21whitelist ${DOWNLOADS}
22whitelist /usr/share/uk.co.grumlimited.authenticator-rs
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private-bin authenticator-rs
48private-cache
49private-dev
50private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gtk-2.0,gtk-3.0,pki,resolv.conf,ssl,xdg
51private-tmp
52
53dbus-user filter
54dbus-user.talk ca.desrt.dconf
55dbus-system none
diff --git a/etc/profile-a-l/authenticator.profile b/etc/profile-a-l/authenticator.profile
new file mode 100644
index 000000000..0f0fb7ceb
--- /dev/null
+++ b/etc/profile-a-l/authenticator.profile
@@ -0,0 +1,49 @@
1# Firejail profile for authenticator
2# Description: 2FA code generator for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include authenticator.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Authenticator
10noblacklist ${HOME}/.config/Authenticator
11
12# Allow python (blacklisted by disable-interpreters.inc)
13#include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22# apparmor
23caps.drop all
24netfilter
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34# novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39disable-mnt
40# private-bin authenticator,python*
41private-dev
42private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,pki,resolv.conf,ssl
43private-tmp
44
45# makes settings immutable
46# dbus-user none
47# dbus-system none
48
49#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/autokey-common.profile b/etc/profile-a-l/autokey-common.profile
new file mode 100644
index 000000000..abd535afe
--- /dev/null
+++ b/etc/profile-a-l/autokey-common.profile
@@ -0,0 +1,42 @@
1# Firejail profile for autokey
2# Description: Desktop automation utility
3# This file is overwritten after every install/update
4# Persistent local customizations
5include autokey-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10noblacklist ${HOME}/.config/autokey
11noblacklist ${HOME}/.local/share/autokey
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19# disable-exec.inc might break scripting functionality
20#include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include whitelist-var-common.inc
24
25caps.drop all
26netfilter
27no3d
28nogroups
29noinput
30nonewprivs
31noroot
32nou2f
33protocol unix,inet,inet6
34seccomp
35shell none
36tracelog
37
38private-cache
39private-dev
40private-tmp
41
42#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/autokey-gtk.profile b/etc/profile-a-l/autokey-gtk.profile
new file mode 100644
index 000000000..e16449064
--- /dev/null
+++ b/etc/profile-a-l/autokey-gtk.profile
@@ -0,0 +1,10 @@
1# Firejail profile for autokey-gtk
2# Description: Desktop automation utility (GTK version)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include autokey-gtk.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include autokey-common.profile
diff --git a/etc/profile-a-l/autokey-qt.profile b/etc/profile-a-l/autokey-qt.profile
new file mode 100644
index 000000000..b6f1210dd
--- /dev/null
+++ b/etc/profile-a-l/autokey-qt.profile
@@ -0,0 +1,10 @@
1# Firejail profile for autokey-qt
2# Description: Desktop automation utility (Qt version)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include autokey-qt.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include autokey-common.profile
diff --git a/etc/profile-a-l/autokey-run.profile b/etc/profile-a-l/autokey-run.profile
new file mode 100644
index 000000000..05669351a
--- /dev/null
+++ b/etc/profile-a-l/autokey-run.profile
@@ -0,0 +1,10 @@
1# Firejail profile for autokey-run
2# Description: Desktop automation utility (CLI version)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include autokey-run.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include autokey-common.profile
diff --git a/etc/profile-a-l/autokey-shell.profile b/etc/profile-a-l/autokey-shell.profile
new file mode 100644
index 000000000..dfbd8759f
--- /dev/null
+++ b/etc/profile-a-l/autokey-shell.profile
@@ -0,0 +1,10 @@
1# Firejail profile for autokey-shell
2# Description: Desktop automation utility (CLI shell)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include autokey-shell.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include autokey-common.profile
diff --git a/etc/profile-a-l/avidemux.profile b/etc/profile-a-l/avidemux.profile
new file mode 100644
index 000000000..468a3fe9f
--- /dev/null
+++ b/etc/profile-a-l/avidemux.profile
@@ -0,0 +1,54 @@
1# Firejail profile for Avidemux
2# Description: Avidemux is a free video editor designed for simple cutting, filtering and encoding tasks.
3# Persistent local customizations
4include avidemux.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.avidemux6
9noblacklist ${HOME}/.config/avidemux3_qt5rc
10noblacklist ${VIDEOS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.avidemux6
21mkdir ${HOME}/.config/avidemux3_qt5rc
22whitelist ${HOME}/.avidemux6
23whitelist ${HOME}/.config/avidemux3_qt5rc
24whitelist ${VIDEOS}
25
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33net none
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48private-bin avidemux3_cli,avidemux3_jobs_qt5,avidemux3_qt5
49private-cache
50private-dev
51private-tmp
52
53dbus-user none
54dbus-system none
diff --git a/etc/profile-a-l/aweather.profile b/etc/profile-a-l/aweather.profile
new file mode 100644
index 000000000..e01ea5b5d
--- /dev/null
+++ b/etc/profile-a-l/aweather.profile
@@ -0,0 +1,40 @@
1# Firejail profile for aweather
2# Description: Advanced Weather Monitoring Program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include aweather.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/aweather
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16
17mkdir ${HOME}/.config/aweather
18whitelist ${HOME}/.config/aweather
19include whitelist-common.inc
20include whitelist-var-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36tracelog
37
38private-bin aweather
39private-dev
40private-tmp
diff --git a/etc/profile-a-l/awesome.profile b/etc/profile-a-l/awesome.profile
new file mode 100644
index 000000000..5d1bf5071
--- /dev/null
+++ b/etc/profile-a-l/awesome.profile
@@ -0,0 +1,19 @@
1# Firejail profile for awesome
2# Description: Standards-compliant, fast, light-weight and extensible window manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include awesome.local
6# Persistent global definitions
7include globals.local
8
9# all applications started in awesome will run in this profile
10noblacklist ${HOME}/.config/awesome
11include disable-common.inc
12
13caps.drop all
14netfilter
15noroot
16protocol unix,inet,inet6
17seccomp
18
19read-only ${HOME}/.config/awesome/autorun.sh
diff --git a/etc/profile-a-l/b2sum.profile b/etc/profile-a-l/b2sum.profile
new file mode 100644
index 000000000..48cb9619b
--- /dev/null
+++ b/etc/profile-a-l/b2sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for b2sum
2# Description: compute and check BLAKE2 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include b2sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin b2sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-a-l/ballbuster-wrapper.profile b/etc/profile-a-l/ballbuster-wrapper.profile
new file mode 100644
index 000000000..419dcaab5
--- /dev/null
+++ b/etc/profile-a-l/ballbuster-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for ballbuster-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ballbuster-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin ballbuster-wrapper
12
13# Redirect
14include ballbuster.profile
diff --git a/etc/profile-a-l/ballbuster.profile b/etc/profile-a-l/ballbuster.profile
new file mode 100644
index 000000000..daa13a7ed
--- /dev/null
+++ b/etc/profile-a-l/ballbuster.profile
@@ -0,0 +1,52 @@
1# Firejail profile for ballbuster
2# Description: Move the paddle to bounce the ball and break all the bricks
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ballbuster.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.ballbuster.hs
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkfile ${HOME}/.ballbuster.hs
20whitelist ${HOME}/.ballbuster.hs
21whitelist /usr/share/ballbuster
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin ballbuster
46private-cache
47private-dev
48private-etc alsa,alternatives,asound.conf,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,pulse
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-a-l/baloo_file.profile b/etc/profile-a-l/baloo_file.profile
new file mode 100644
index 000000000..252016bec
--- /dev/null
+++ b/etc/profile-a-l/baloo_file.profile
@@ -0,0 +1,54 @@
1# Firejail profile for baloo_file
2# This file is overwritten after every install/update
3# Persistent local customizations
4include baloo_file.local
5# Persistent global definitions
6include globals.local
7
8# Make home directory read-only and allow writing only to ${HOME}/.local/share/baloo
9# Note: Baloo will not be able to update the "first run" key in its configuration files.
10# mkdir ${HOME}/.local/share/baloo
11# read-only ${HOME}
12# read-write ${HOME}/.local/share/baloo
13# ignore read-write
14
15noblacklist ${HOME}/.config/baloofilerc
16noblacklist ${HOME}/.kde/share/config/baloofilerc
17noblacklist ${HOME}/.kde/share/config/baloorc
18noblacklist ${HOME}/.kde4/share/config/baloofilerc
19noblacklist ${HOME}/.kde4/share/config/baloorc
20noblacklist ${HOME}/.local/share/baloo
21
22include disable-common.inc
23include disable-devel.inc
24include disable-exec.inc
25include disable-interpreters.inc
26include disable-programs.inc
27
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32machine-id
33# net none
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix
46# blacklisting of ioprio_set system calls breaks baloo_file
47seccomp !ioprio_set
48shell none
49# x11 xorg
50
51private-bin baloo_file,baloo_file_extractor,baloo_filemetadata_temp_extractor,kbuildsycoca4
52private-cache
53private-dev
54private-tmp
diff --git a/etc/profile-a-l/baloo_filemetadata_temp_extractor.profile b/etc/profile-a-l/baloo_filemetadata_temp_extractor.profile
new file mode 100644
index 000000000..ff10e9965
--- /dev/null
+++ b/etc/profile-a-l/baloo_filemetadata_temp_extractor.profile
@@ -0,0 +1,14 @@
1# Firejail profile for baloo_filemetadata_temp_extractor
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include baloo_filemetadata_temp_extractor.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10ignore read-write
11read-only ${HOME}
12
13# Redirect
14include baloo_file.profile
diff --git a/etc/profile-a-l/balsa.profile b/etc/profile-a-l/balsa.profile
new file mode 100644
index 000000000..197f787ca
--- /dev/null
+++ b/etc/profile-a-l/balsa.profile
@@ -0,0 +1,82 @@
1# Firejail profile for balsa
2# Description: GNOME mail client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include balsa.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.balsa
10noblacklist ${HOME}/.gnupg
11noblacklist ${HOME}/.mozilla
12noblacklist ${HOME}/.signature
13noblacklist ${HOME}/mail
14noblacklist /var/mail
15noblacklist /var/spool/mail
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25mkdir ${HOME}/.balsa
26mkdir ${HOME}/.gnupg
27mkfile ${HOME}/.signature
28mkdir ${HOME}/mail
29whitelist ${HOME}/.balsa
30whitelist ${HOME}/.gnupg
31whitelist ${HOME}/.mozilla/firefox/profiles.ini
32whitelist ${HOME}/.signature
33whitelist ${HOME}/mail
34whitelist ${RUNUSER}/gnupg
35whitelist /usr/share/balsa
36whitelist /usr/share/gnupg
37whitelist /usr/share/gnupg2
38whitelist /var/mail
39whitelist /var/spool/mail
40include whitelist-common.inc
41include whitelist-runuser-common.inc
42include whitelist-usr-share-common.inc
43include whitelist-var-common.inc
44
45apparmor
46caps.drop all
47netfilter
48no3d
49nodvd
50nogroups
51noinput
52nonewprivs
53noroot
54nosound
55notv
56nou2f
57novideo
58protocol unix,inet,inet6
59seccomp
60shell none
61tracelog
62
63# disable-mnt
64# Add "pinentry-curses,pinentry-emacs,pinentry-fltk,pinentry-gnome3,pinentry-gtk,pinentry-gtk2,pinentry-gtk-2,pinentry-qt,pinentry-qt4,pinentry-tty,pinentry-x2go,pinentry-kwallet" for gpg
65# Add "ignore private-bin" for hyperlinks or have a look at the private-bins in firefox.profile and firefox-common.profile.
66private-bin balsa,balsa-ab,gpg,gpg-agent,gpg2,gpgsm
67private-cache
68private-dev
69private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gcrypt,groups,gtk-2.0,gtk-3.0,hostname,hosts,mailname,passwd,pki,resolv.conf,selinux,ssl,xdg
70private-tmp
71writable-run-user
72writable-var
73
74dbus-user filter
75dbus-user.own org.desktop.Balsa
76dbus-user.talk ca.desrt.dconf
77dbus-user.talk org.freedesktop.Notifications
78dbus-user.talk org.freedesktop.secrets
79dbus-user.talk org.gnome.keyring.SystemPrompter
80dbus-system none
81
82read-only ${HOME}/.mozilla/firefox/profiles.ini \ No newline at end of file
diff --git a/etc/profile-a-l/baobab.profile b/etc/profile-a-l/baobab.profile
new file mode 100644
index 000000000..c8dbcad4e
--- /dev/null
+++ b/etc/profile-a-l/baobab.profile
@@ -0,0 +1,44 @@
1# Firejail profile for baobab
2# Description: GNOME disk usage analyzer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include baobab.local
6# Persistent global definitions
7include globals.local
8
9# include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13# include disable-programs.inc
14include disable-shell.inc
15# include disable-xdg.inc
16
17include whitelist-runuser-common.inc
18
19caps.drop all
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33seccomp.block-secondary
34shell none
35tracelog
36
37private-bin baobab
38private-dev
39private-tmp
40
41# dbus-user none
42# dbus-system none
43
44read-only ${HOME}
diff --git a/etc/profile-a-l/barrier.profile b/etc/profile-a-l/barrier.profile
new file mode 100644
index 000000000..f6775ee01
--- /dev/null
+++ b/etc/profile-a-l/barrier.profile
@@ -0,0 +1,45 @@
1# Firejail profile for barrier
2# Description: Keyboard and mouse sharing application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include barrier.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Debauchee/Barrier.conf
10noblacklist ${HOME}/.local/share/barrier
11noblacklist ${PATH}/openssl
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22caps.drop all
23machine-id
24netfilter
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix,inet,inet6,netlink
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private-dev
42private-cache
43private-tmp
44
45memory-deny-write-execute
diff --git a/etc/profile-a-l/basilisk.profile b/etc/profile-a-l/basilisk.profile
new file mode 100644
index 000000000..8dc3847a0
--- /dev/null
+++ b/etc/profile-a-l/basilisk.profile
@@ -0,0 +1,26 @@
1# Firejail profile for basilisk
2# This file is overwritten after every install/update
3# Persistent local customizations
4include basilisk.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/moonchild productions/basilisk
9noblacklist ${HOME}/.moonchild productions/basilisk
10
11mkdir ${HOME}/.cache/moonchild productions/basilisk
12mkdir ${HOME}/.moonchild productions
13whitelist ${HOME}/.cache/moonchild productions/basilisk
14whitelist ${HOME}/.moonchild productions
15
16# Basilisk can use the full firejail seccomp filter (unlike firefox >= 60)
17seccomp
18ignore seccomp
19
20#private-bin basilisk
21# private-etc must first be enabled in firefox-common.profile
22#private-etc basilisk
23#private-opt basilisk
24
25# Redirect
26include firefox-common.profile
diff --git a/etc/profile-a-l/bcompare.profile b/etc/profile-a-l/bcompare.profile
new file mode 100644
index 000000000..87bcf9a19
--- /dev/null
+++ b/etc/profile-a-l/bcompare.profile
@@ -0,0 +1,47 @@
1# Firejail profile for Beyond Compare by Scooter Software
2# Description: directory and file compare utility
3# Disables the network, which only impacts checking for updates.
4# This file is overwritten after every install/update
5# Persistent local customizations
6include bcompare.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.config/bcompare
11# In case the user decides to include disable-programs.inc, still allow
12# KDE's Gwenview to view images via right click -> Open With -> Associated Application
13noblacklist ${HOME}/.config/gwenviewrc
14
15# Add the next line to your bcompare.local if you don't need to compare files in disable-common.inc.
16#include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20# Add the next line to your bcompare.local if you don't need to compare files in disable-programs.inc.
21#include disable-programs.inc
22#include disable-shell.inc - breaks launch
23include disable-write-mnt.inc
24
25apparmor
26caps.drop all
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42private-cache
43private-dev
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-a-l/beaker.profile b/etc/profile-a-l/beaker.profile
new file mode 100644
index 000000000..f3a9568bd
--- /dev/null
+++ b/etc/profile-a-l/beaker.profile
@@ -0,0 +1,28 @@
1# Firejail profile for beaker
2# This file is overwritten after every install/update
3# Persistent local customizations
4include beaker.local
5# Persistent global definitions
6include globals.local
7
8# Disabled until someone reported positive feedback
9ignore include disable-exec.inc
10ignore include disable-xdg.inc
11ignore include whitelist-runuser-common.inc
12ignore include whitelist-usr-share-common.inc
13ignore include whitelist-var-common.inc
14ignore nou2f
15ignore novideo
16ignore shell none
17ignore disable-mnt
18ignore private-cache
19ignore private-dev
20ignore private-tmp
21
22noblacklist ${HOME}/.config/Beaker Browser
23
24mkdir ${HOME}/.config/Beaker Browser
25whitelist ${HOME}/.config/Beaker Browser
26
27# Redirect
28include electron.profile
diff --git a/etc/profile-a-l/bibletime.profile b/etc/profile-a-l/bibletime.profile
new file mode 100644
index 000000000..0104dc181
--- /dev/null
+++ b/etc/profile-a-l/bibletime.profile
@@ -0,0 +1,59 @@
1# Firejail profile for bibletime
2# Description: Bible study tool
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bibletime.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.bibletime
10noblacklist ${HOME}/.sword
11noblacklist ${HOME}/.local/share/bibletime
12
13blacklist ${HOME}/.bashrc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.bibletime
22mkdir ${HOME}/.sword
23mkdir ${HOME}/.local/share/bibletime
24whitelist ${HOME}/.bibletime
25whitelist ${HOME}/.sword
26whitelist ${HOME}/.local/share/bibletime
27whitelist /usr/share/bibletime
28whitelist /usr/share/doc/bibletime
29whitelist /usr/share/sword
30include whitelist-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36machine-id
37netfilter
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix,inet,inet6,netlink
48seccomp !chroot
49shell none
50
51disable-mnt
52# private-bin bibletime,qt5ct
53private-cache
54private-dev
55private-etc alternatives,ca-certificates,crypto-policies,fonts,login.defs,machine-id,passwd,pki,resolv.conf,ssl,sword,sword.conf
56private-tmp
57
58dbus-user none
59dbus-system none
diff --git a/etc/profile-a-l/bibtex.profile b/etc/profile-a-l/bibtex.profile
new file mode 100644
index 000000000..e868dcbab
--- /dev/null
+++ b/etc/profile-a-l/bibtex.profile
@@ -0,0 +1,12 @@
1# Firejail profile for bibtex
2# This file is overwritten after every install/update
3# Persistent local customizations
4include bibtex.local
5# Persistent global definitions
6include globals.local
7
8private-bin bibtex
9
10# Redirect
11include latex-common.profile
12
diff --git a/etc/profile-a-l/bijiben.profile b/etc/profile-a-l/bijiben.profile
new file mode 100644
index 000000000..61cd792b1
--- /dev/null
+++ b/etc/profile-a-l/bijiben.profile
@@ -0,0 +1,63 @@
1# Firejail profile for bijiben
2# Description: Simple Note Viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bijiben.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/bijiben
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/bijiben
20whitelist ${HOME}/.local/share/bijiben
21whitelist ${HOME}/.cache/tracker
22whitelist /usr/libexec/webkit2gtk-4.0
23whitelist /usr/share/bijiben
24whitelist /usr/share/tracker
25whitelist /usr/share/tracker3
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33machine-id
34net none
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46seccomp.block-secondary
47shell none
48tracelog
49
50disable-mnt
51private-bin bijiben
52# private-cache -- access to .cache/tracker is required
53private-dev
54private-etc dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload
55private-tmp
56
57dbus-user filter
58dbus-user.own org.gnome.Notes
59dbus-user.talk ca.desrt.dconf
60dbus-user.talk org.freedesktop.Tracker1
61dbus-system none
62
63env WEBKIT_FORCE_SANDBOX=0
diff --git a/etc/profile-a-l/bitcoin-qt.profile b/etc/profile-a-l/bitcoin-qt.profile
new file mode 100644
index 000000000..ef6ef7a75
--- /dev/null
+++ b/etc/profile-a-l/bitcoin-qt.profile
@@ -0,0 +1,50 @@
1# Firejail profile for bitcoin-qt
2# Description: Bitcoin is a peer-to-peer network based digital currency
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bitcoin-qt.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.bitcoin
10noblacklist ${HOME}/.config/Bitcoin
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18
19mkdir ${HOME}/.bitcoin
20mkdir ${HOME}/.config/Bitcoin
21whitelist ${HOME}/.bitcoin
22whitelist ${HOME}/.config/Bitcoin
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27machine-id
28netfilter
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42tracelog
43
44private-bin bitcoin-qt
45private-dev
46# Causes problem with loading of libGL.so
47#private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl
48private-tmp
49
50memory-deny-write-execute
diff --git a/etc/bitlbee.profile b/etc/profile-a-l/bitlbee.profile
index 1b7b2c258..773fa7500 100644
--- a/etc/bitlbee.profile
+++ b/etc/profile-a-l/bitlbee.profile
@@ -1,34 +1,40 @@
1# Firejail profile for bitlbee 1# Firejail profile for bitlbee
2# Description: IRC to other chat networks gateway
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/bitlbee.local 5include bitlbee.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
8
9ignore noexec ${HOME}
7 10
8noblacklist /sbin 11noblacklist /sbin
9noblacklist /usr/sbin 12noblacklist /usr/sbin
10noblacklist /var/log 13# noblacklist /var/log
11 14
12include /etc/firejail/disable-common.inc 15include disable-common.inc
13include /etc/firejail/disable-devel.inc 16include disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 17include disable-exec.inc
15include /etc/firejail/disable-programs.inc 18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
16 21
17netfilter 22netfilter
18no3d 23no3d
19nodvd 24nodvd
25noinput
20nonewprivs 26nonewprivs
21nosound 27nosound
22notv 28notv
29nou2f
23novideo 30novideo
24protocol unix,inet,inet6 31protocol unix,inet,inet6
25seccomp 32seccomp
26 33
27disable-mnt 34disable-mnt
28private 35private
29private-dev 36private-cache
30private-dev 37private-dev
31private-tmp 38private-tmp
32read-write /var/lib/bitlbee
33 39
34noexec /tmp 40read-write /var/lib/bitlbee
diff --git a/etc/profile-a-l/bitwarden.profile b/etc/profile-a-l/bitwarden.profile
new file mode 100644
index 000000000..ba2eb2ea7
--- /dev/null
+++ b/etc/profile-a-l/bitwarden.profile
@@ -0,0 +1,30 @@
1# Firejail profile for bitwarden
2# Description: A secure and free password manager for all of your devices
3# This file is overwritten after every install/update.
4# Persistent local customisations
5include bitwarden.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore include whitelist-usr-share-common.inc
11
12ignore noexec /tmp
13
14noblacklist ${HOME}/.config/Bitwarden
15
16include disable-shell.inc
17
18mkdir ${HOME}/.config/Bitwarden
19whitelist ${HOME}/.config/Bitwarden
20
21machine-id
22no3d
23nosound
24
25?HAS_APPIMAGE: ignore private-dev
26private-etc alternatives,ca-certificates,crypto-policies,fonts,hosts,nsswitch.conf,pki,resolv.conf,ssl
27private-opt Bitwarden
28
29# Redirect
30include electron.profile
diff --git a/etc/profile-a-l/blackbox.profile b/etc/profile-a-l/blackbox.profile
new file mode 100644
index 000000000..233f9a96f
--- /dev/null
+++ b/etc/profile-a-l/blackbox.profile
@@ -0,0 +1,18 @@
1# Firejail profile for blackbox
2# Description: Standards-compliant, fast, light-weight and extensible window manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include blackbox.local
6# Persistent global definitions
7include globals.local
8
9# all applications started in blackbox will run in this profile
10noblacklist ${HOME}/.blackbox
11include disable-common.inc
12
13caps.drop all
14netfilter
15noroot
16protocol unix,inet,inet6
17seccomp
18
diff --git a/etc/profile-a-l/bleachbit.profile b/etc/profile-a-l/bleachbit.profile
new file mode 100644
index 000000000..28ce8fbea
--- /dev/null
+++ b/etc/profile-a-l/bleachbit.profile
@@ -0,0 +1,42 @@
1# Firejail profile for bleachbit
2# Description: Delete unnecessary files from the system
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bleachbit.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17# include disable-programs.inc
18
19caps.drop all
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34
35private-dev
36# private-tmp
37
38dbus-user none
39dbus-system none
40
41# memory-deny-write-execute breaks some systems, see issue #1850
42# memory-deny-write-execute
diff --git a/etc/profile-a-l/blender-2.8.profile b/etc/profile-a-l/blender-2.8.profile
new file mode 100644
index 000000000..55d8fdcf2
--- /dev/null
+++ b/etc/profile-a-l/blender-2.8.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for blender
2# This file is overwritten after every install/update
3# Persistent local customizations
4include blender-2.8.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include blender.profile
diff --git a/etc/profile-a-l/blender.profile b/etc/profile-a-l/blender.profile
new file mode 100644
index 000000000..225fd7cdc
--- /dev/null
+++ b/etc/profile-a-l/blender.profile
@@ -0,0 +1,40 @@
1# Firejail profile for blender
2# Description: Very fast and versatile 3D modeller/renderer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include blender.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/blender
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21# Allow usage of AMD GPU by OpenCL
22noblacklist /sys/module
23whitelist /sys/module/amdgpu
24read-only /sys/module/amdgpu
25
26caps.drop all
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35protocol unix,inet,inet6,netlink
36# numpy, used by many add-ons, requires the mbind syscall
37seccomp !mbind
38shell none
39
40private-dev
diff --git a/etc/profile-a-l/bless.profile b/etc/profile-a-l/bless.profile
new file mode 100644
index 000000000..61d1c3a1e
--- /dev/null
+++ b/etc/profile-a-l/bless.profile
@@ -0,0 +1,42 @@
1# Firejail profile for bless
2# Description: A full featured hexadecimal editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bless.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/bless
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17include whitelist-var-common.inc
18
19caps.drop all
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34
35# private-bin bash,bless,mono,sh
36private-cache
37private-dev
38private-etc alternatives,fonts,mono
39private-tmp
40
41dbus-user none
42dbus-system none
diff --git a/etc/profile-a-l/blobby.profile b/etc/profile-a-l/blobby.profile
new file mode 100644
index 000000000..11d705c5b
--- /dev/null
+++ b/etc/profile-a-l/blobby.profile
@@ -0,0 +1,51 @@
1# Firejail profile for blobby
2# Persistent local customizations
3include blobby.local
4# Persistent global definitions
5include globals.local
6
7noblacklist ${HOME}/.blobby
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17mkdir ${HOME}/.blobby
18whitelist ${HOME}/.blobby
19include whitelist-common.inc
20whitelist /usr/share/blobby
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin blobby
43private-dev
44private-etc alsa,alternatives,asound.conf,drirc,group,hosts,login.defs,machine-id,passwd,pulse
45private-lib
46private-tmp
47
48dbus-user none
49dbus-system none
50
51memory-deny-write-execute
diff --git a/etc/profile-a-l/blobwars.profile b/etc/profile-a-l/blobwars.profile
new file mode 100644
index 000000000..6e3d4256c
--- /dev/null
+++ b/etc/profile-a-l/blobwars.profile
@@ -0,0 +1,50 @@
1# Firejail profile for blobwars
2# Description: Mission and Objective based 2D Platform Game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include blobwars.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.parallelrealities/blobwars
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.parallelrealities/blobwars
20whitelist ${HOME}/.parallelrealities/blobwars
21whitelist /usr/share/blobwars
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix,netlink
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin blobwars
44private-cache
45private-dev
46private-etc machine-id
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-a-l/bluefish.profile b/etc/profile-a-l/bluefish.profile
new file mode 100644
index 000000000..bc5219e29
--- /dev/null
+++ b/etc/profile-a-l/bluefish.profile
@@ -0,0 +1,40 @@
1# Firejail profile for bluefish
2# Description: Advanced Gtk+ text editor for web and software development
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bluefish.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14
15include whitelist-var-common.inc
16
17apparmor
18caps.drop all
19net none
20no3d
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26nosound
27notv
28nou2f
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35private-bin bluefish
36private-dev
37private-tmp
38
39dbus-user none
40dbus-system none
diff --git a/etc/profile-a-l/bnox.profile b/etc/profile-a-l/bnox.profile
new file mode 100644
index 000000000..6e8f0d7d1
--- /dev/null
+++ b/etc/profile-a-l/bnox.profile
@@ -0,0 +1,22 @@
1# Firejail profile for bnox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include bnox.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/bnox
14noblacklist ${HOME}/.config/bnox
15
16mkdir ${HOME}/.cache/bnox
17mkdir ${HOME}/.config/bnox
18whitelist ${HOME}/.cache/bnox
19whitelist ${HOME}/.config/bnox
20
21# Redirect
22include chromium-common.profile
diff --git a/etc/profile-a-l/brackets.profile b/etc/profile-a-l/brackets.profile
new file mode 100644
index 000000000..94afc9e0b
--- /dev/null
+++ b/etc/profile-a-l/brackets.profile
@@ -0,0 +1,34 @@
1# Firejail profile for brackets
2# This file is overwritten after every install/update
3# Persistent local customizations
4include brackets.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/Brackets
9#noblacklist /opt/brackets
10#noblacklist /opt/google
11
12# Allows files commonly used by IDEs
13include allow-common-devel.inc
14
15include disable-common.inc
16include disable-programs.inc
17
18caps.drop all
19netfilter
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25nosound
26notv
27nou2f
28novideo
29protocol unix,inet,inet6,netlink
30seccomp !chroot,!ioperm
31shell none
32
33private-cache
34private-dev
diff --git a/etc/profile-a-l/brasero.profile b/etc/profile-a-l/brasero.profile
new file mode 100644
index 000000000..656701909
--- /dev/null
+++ b/etc/profile-a-l/brasero.profile
@@ -0,0 +1,36 @@
1# Firejail profile for brasero
2# Description: CD/DVD burning application for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include brasero.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/brasero
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17include whitelist-var-common.inc
18
19apparmor
20caps.drop all
21net none
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix
29seccomp
30shell none
31tracelog
32
33# private-bin brasero
34private-cache
35# private-dev
36# private-tmp
diff --git a/etc/profile-a-l/brave-browser-beta.profile b/etc/profile-a-l/brave-browser-beta.profile
new file mode 100644
index 000000000..bbe23056f
--- /dev/null
+++ b/etc/profile-a-l/brave-browser-beta.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for brave (beta channel)
2# This file is overwritten after every install/update
3# Persistent local customizations
4include brave-browser-beta.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include brave.profile
diff --git a/etc/profile-a-l/brave-browser-dev.profile b/etc/profile-a-l/brave-browser-dev.profile
new file mode 100644
index 000000000..b3fcc22ee
--- /dev/null
+++ b/etc/profile-a-l/brave-browser-dev.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for brave (development channel)
2# This file is overwritten after every install/update
3# Persistent local customizations
4include brave-browser-dev.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include brave.profile
diff --git a/etc/profile-a-l/brave-browser-nightly.profile b/etc/profile-a-l/brave-browser-nightly.profile
new file mode 100644
index 000000000..796c90deb
--- /dev/null
+++ b/etc/profile-a-l/brave-browser-nightly.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for brave (nightly channel)
2# This file is overwritten after every install/update
3# Persistent local customizations
4include brave-browser-nightly.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include brave.profile
diff --git a/etc/profile-a-l/brave-browser-stable.profile b/etc/profile-a-l/brave-browser-stable.profile
new file mode 100644
index 000000000..fab7f5f14
--- /dev/null
+++ b/etc/profile-a-l/brave-browser-stable.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for brave (release channel)
2# This file is overwritten after every install/update
3# Persistent local customizations
4include brave-browser-stable.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include brave.profile
diff --git a/etc/profile-a-l/brave-browser.profile b/etc/profile-a-l/brave-browser.profile
new file mode 100644
index 000000000..fda337725
--- /dev/null
+++ b/etc/profile-a-l/brave-browser.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for brave
2# This file is overwritten after every install/update
3# Persistent local customizations
4include brave-browser.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include brave.profile
diff --git a/etc/profile-a-l/brave.profile b/etc/profile-a-l/brave.profile
new file mode 100644
index 000000000..09548c761
--- /dev/null
+++ b/etc/profile-a-l/brave.profile
@@ -0,0 +1,37 @@
1# Firejail profile for brave
2# Description: Web browser that blocks ads and trackers by default.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include brave.local
6# Persistent global definitions
7include globals.local
8
9# noexec /tmp is included in chromium-common.profile and breaks Brave
10ignore noexec /tmp
11# TOR is installed in ${HOME}.
12# NOTE: chromium-common.profile enables apparmor. To keep that intact
13# you will need to uncomment the 'brave + tor' rule in /etc/apparmor.d/local/firejail-default.
14# Alternatively you can add 'ignore apparmor' to your brave.local.
15ignore noexec ${HOME}
16
17noblacklist ${HOME}/.cache/BraveSoftware
18noblacklist ${HOME}/.config/BraveSoftware
19noblacklist ${HOME}/.config/brave
20noblacklist ${HOME}/.config/brave-flags.conf
21# brave uses gpg for built-in password manager
22noblacklist ${HOME}/.gnupg
23
24mkdir ${HOME}/.cache/BraveSoftware
25mkdir ${HOME}/.config/BraveSoftware
26mkdir ${HOME}/.config/brave
27whitelist ${HOME}/.cache/BraveSoftware
28whitelist ${HOME}/.config/BraveSoftware
29whitelist ${HOME}/.config/brave
30whitelist ${HOME}/.config/brave-flags.conf
31whitelist ${HOME}/.gnupg
32
33# Brave sandbox needs read access to /proc/config.gz
34noblacklist /proc/config.gz
35
36# Redirect
37include chromium-common.profile
diff --git a/etc/profile-a-l/bsdcat.profile b/etc/profile-a-l/bsdcat.profile
new file mode 100644
index 000000000..ff7d83dad
--- /dev/null
+++ b/etc/profile-a-l/bsdcat.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for bsdtar
2# This file is overwritten after every install/update
3# Persistent local customizations
4include bsdcat.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include bsdtar.profile
diff --git a/etc/profile-a-l/bsdcpio.profile b/etc/profile-a-l/bsdcpio.profile
new file mode 100644
index 000000000..eb35ef79f
--- /dev/null
+++ b/etc/profile-a-l/bsdcpio.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for bsdtar
2# This file is overwritten after every install/update
3# Persistent local customizations
4include bsdcpio.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include bsdtar.profile
diff --git a/etc/profile-a-l/bsdtar.profile b/etc/profile-a-l/bsdtar.profile
new file mode 100644
index 000000000..d731a6a6e
--- /dev/null
+++ b/etc/profile-a-l/bsdtar.profile
@@ -0,0 +1,12 @@
1# Firejail profile for bsdtar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include bsdtar.local
6# Persistent global definitions
7include globals.local
8
9private-etc alternatives,group,localtime,passwd
10
11# Redirect
12include archiver-common.profile
diff --git a/etc/profile-a-l/bunzip2.profile b/etc/profile-a-l/bunzip2.profile
new file mode 100644
index 000000000..37b47c2ce
--- /dev/null
+++ b/etc/profile-a-l/bunzip2.profile
@@ -0,0 +1,12 @@
1# Firejail profile for bunzip2
2# Description: A high-quality data compression program
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include bunzip2.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include gzip.profile
diff --git a/etc/profile-a-l/bzcat.profile b/etc/profile-a-l/bzcat.profile
new file mode 100644
index 000000000..edefb6bb8
--- /dev/null
+++ b/etc/profile-a-l/bzcat.profile
@@ -0,0 +1,15 @@
1# Firejail profile for bzcat
2# Description: A high-quality data compression program
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include bzcat.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11ignore read-write
12read-only ${HOME}
13
14# Redirect
15include gzip.profile
diff --git a/etc/profile-a-l/bzflag.profile b/etc/profile-a-l/bzflag.profile
new file mode 100644
index 000000000..53cfde352
--- /dev/null
+++ b/etc/profile-a-l/bzflag.profile
@@ -0,0 +1,47 @@
1# Firejail profile for bzflag
2# Description: 3D multi-player tank battle game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include bzflag.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.bzf
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.bzf
20whitelist ${HOME}/.bzf
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private-bin bzadmin,bzflag,bzflag-wrapper,bzfs
42private-cache
43private-dev
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-a-l/bzip2.profile b/etc/profile-a-l/bzip2.profile
new file mode 100644
index 000000000..0756e0537
--- /dev/null
+++ b/etc/profile-a-l/bzip2.profile
@@ -0,0 +1,12 @@
1# Firejail profile for bzip2
2# Description: A high-quality data compression program
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include bzip2.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include gzip.profile
diff --git a/etc/profile-a-l/caja.profile b/etc/profile-a-l/caja.profile
new file mode 100644
index 000000000..1af102ca8
--- /dev/null
+++ b/etc/profile-a-l/caja.profile
@@ -0,0 +1,15 @@
1# Firejail profile for caja
2# Description: File manager for the MATE desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include caja.local
6# Persistent global definitions
7include globals.local
8
9# Caja is started by systemd on most systems. Therefore it is not firejailed by default. Since there
10# is already a caja process running on MATE desktops firejail will have no effect.
11
12# Put 'ignore noroot' in your caja.local if you use MPV+Vulkan (see issue #3012)
13
14# Redirect
15include file-manager-common.profile
diff --git a/etc/profile-a-l/calibre.profile b/etc/profile-a-l/calibre.profile
new file mode 100644
index 000000000..cdc168384
--- /dev/null
+++ b/etc/profile-a-l/calibre.profile
@@ -0,0 +1,38 @@
1# Firejail profile for calibre
2# Description: Powerful and easy to use e-book manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include calibre.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/calibre
10noblacklist ${HOME}/.config/calibre
11noblacklist ${DOCUMENTS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21apparmor
22caps.drop all
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6,netlink
34seccomp !chroot
35shell none
36
37private-dev
38private-tmp
diff --git a/etc/profile-a-l/calligra.profile b/etc/profile-a-l/calligra.profile
new file mode 100644
index 000000000..280a61401
--- /dev/null
+++ b/etc/profile-a-l/calligra.profile
@@ -0,0 +1,40 @@
1# Firejail profile for calligra
2# Description: Extensive productivity and creative suite
3# This file is overwritten after every install/update
4# Persistent local customizations
5include calligra.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/calligra
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16caps.drop all
17ipc-namespace
18# net none
19netfilter
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25notv
26nou2f
27novideo
28protocol unix
29seccomp
30seccomp.block-secondary
31shell none
32
33private-bin calligra,calligraauthor,calligraconverter,calligraflow,calligragemini,calligraplan,calligraplanwork,calligrasheets,calligrastage,calligrawords,dbus-launch,kbuildsycoca4,kdeinit4
34private-dev
35
36# dbus-user none
37# dbus-system none
38
39# noexec ${HOME}
40noexec /tmp
diff --git a/etc/profile-a-l/calligraauthor.profile b/etc/profile-a-l/calligraauthor.profile
new file mode 100644
index 000000000..ace6c05f8
--- /dev/null
+++ b/etc/profile-a-l/calligraauthor.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligraauthor.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include calligra.profile
diff --git a/etc/profile-a-l/calligraconverter.profile b/etc/profile-a-l/calligraconverter.profile
new file mode 100644
index 000000000..b2c23a57b
--- /dev/null
+++ b/etc/profile-a-l/calligraconverter.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligraconverter.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include calligra.profile
diff --git a/etc/profile-a-l/calligraflow.profile b/etc/profile-a-l/calligraflow.profile
new file mode 100644
index 000000000..ca654b3f3
--- /dev/null
+++ b/etc/profile-a-l/calligraflow.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligraflow.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include calligra.profile
diff --git a/etc/profile-a-l/calligragemini.profile b/etc/profile-a-l/calligragemini.profile
new file mode 100644
index 000000000..006c307ab
--- /dev/null
+++ b/etc/profile-a-l/calligragemini.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligragemini.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/calligragemini
10
11# Redirect
12include calligra.profile
diff --git a/etc/profile-a-l/calligraplan.profile b/etc/profile-a-l/calligraplan.profile
new file mode 100644
index 000000000..81dbd4dcd
--- /dev/null
+++ b/etc/profile-a-l/calligraplan.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligraplan.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/calligraplan
10
11# Redirect
12include calligra.profile
diff --git a/etc/profile-a-l/calligraplanwork.profile b/etc/profile-a-l/calligraplanwork.profile
new file mode 100644
index 000000000..bba91b66b
--- /dev/null
+++ b/etc/profile-a-l/calligraplanwork.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligraplanwork.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/calligraplanwork
10
11# Redirect
12include calligra.profile
diff --git a/etc/profile-a-l/calligrasheets.profile b/etc/profile-a-l/calligrasheets.profile
new file mode 100644
index 000000000..7bc296047
--- /dev/null
+++ b/etc/profile-a-l/calligrasheets.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligrasheets.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/calligrasheets
10
11# Redirect
12include calligra.profile
diff --git a/etc/profile-a-l/calligrastage.profile b/etc/profile-a-l/calligrastage.profile
new file mode 100644
index 000000000..7694abbe4
--- /dev/null
+++ b/etc/profile-a-l/calligrastage.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligrastage.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/calligrastage
10
11# Redirect
12include calligra.profile
diff --git a/etc/profile-a-l/calligrawords.profile b/etc/profile-a-l/calligrawords.profile
new file mode 100644
index 000000000..d69d56a95
--- /dev/null
+++ b/etc/profile-a-l/calligrawords.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for calligra
2# This file is overwritten after every install/update
3# Persistent local customizations
4include calligrawords.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/calligrawords
10
11# Redirect
12include calligra.profile
diff --git a/etc/profile-a-l/cameramonitor.profile b/etc/profile-a-l/cameramonitor.profile
new file mode 100644
index 000000000..ae9e0f1d2
--- /dev/null
+++ b/etc/profile-a-l/cameramonitor.profile
@@ -0,0 +1,55 @@
1# Firejail profile for cameramonitor
2# Description: A little monitor to check your webcam status
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include cameramonitor.local
7# Persistent global definitions
8include globals.local
9
10# Allow python (blacklisted by disable-interpreters.inc)
11include allow-python2.inc
12include allow-python3.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22whitelist /usr/share/cameramonitor
23include whitelist-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31net none
32no3d
33nodvd
34nogroups
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private-bin cameramonitor,python*
48private-cache
49private-etc alternatives,fonts
50private-tmp
51
52# dbus-user none
53# dbus-system none
54
55# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-a-l/cantata.profile b/etc/profile-a-l/cantata.profile
new file mode 100644
index 000000000..69cf912ef
--- /dev/null
+++ b/etc/profile-a-l/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
14# Allow perl (blacklisted by disable-interpreters.inc)
15include allow-perl.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25# apparmor
26caps.drop all
27ipc-namespace
28netfilter
29noinput
30nonewprivs
31noroot
32nou2f
33novideo
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37
38# private-etc drirc,fonts,gcrypt,hosts,kde5rc,mpd.conf,passwd,samba,ssl,xdg
39private-bin cantata,mpd,perl
40private-dev
diff --git a/etc/profile-a-l/cargo.profile b/etc/profile-a-l/cargo.profile
new file mode 100644
index 000000000..ff46cd429
--- /dev/null
+++ b/etc/profile-a-l/cargo.profile
@@ -0,0 +1,72 @@
1# Firejail profile for cargo
2# Description: The Rust package manager
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include cargo.local
7# Persistent global definitions
8include globals.local
9
10ignore noexec ${HOME}
11ignore noexec /tmp
12
13blacklist /tmp/.X11-unix
14blacklist ${RUNUSER}
15
16noblacklist ${HOME}/.cargo/credentials
17noblacklist ${HOME}/.cargo/credentials.toml
18
19# Allows files commonly used by IDEs
20include allow-common-devel.inc
21
22# Allow ssh (blacklisted by disable-common.inc)
23#include allow-ssh.inc
24
25include disable-common.inc
26include disable-exec.inc
27include disable-interpreters.inc
28include disable-programs.inc
29include disable-xdg.inc
30
31#mkdir ${HOME}/.cargo
32#whitelist ${HOME}/YOUR_CARGO_PROJECTS
33#whitelist ${HOME}/.cargo
34#whitelist ${HOME}/.rustup
35#include whitelist-common.inc
36whitelist /usr/share/pkgconfig
37include whitelist-runuser-common.inc
38include whitelist-usr-share-common.inc
39include whitelist-var-common.inc
40
41caps.drop all
42ipc-namespace
43machine-id
44netfilter
45no3d
46nodvd
47nogroups
48noinput
49nonewprivs
50noroot
51nosound
52notv
53nou2f
54novideo
55protocol unix,inet,inet6
56seccomp
57seccomp.block-secondary
58shell none
59tracelog
60
61disable-mnt
62#private-bin cargo,rustc
63private-cache
64private-dev
65private-etc alternatives,ca-certificates,crypto-policies,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,magic,magic.mgc,nsswitch.conf,passwd,pki,protocols,resolv.conf,rpc,services,ssl
66private-tmp
67
68dbus-user none
69dbus-system none
70
71memory-deny-write-execute
72read-write ${HOME}/.cargo/bin
diff --git a/etc/catfish.profile b/etc/profile-a-l/catfish.profile
index 5fc585d90..38a670fdc 100644
--- a/etc/catfish.profile
+++ b/etc/profile-a-l/catfish.profile
@@ -1,21 +1,29 @@
1# Firejail profile for catfish 1# Firejail profile for catfish
2# Description: File searching tool
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/catfish.local 5include catfish.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8# We can't blacklist much since catfish 9# We can't blacklist much since catfish
9# is for finding files/content 10# is for finding files/content
10noblacklist ~/.config/catfish 11
11include /etc/firejail/disable-common.inc 12noblacklist ${HOME}/.config/catfish
12# include /etc/firejail/disable-devel.inc 13
13include /etc/firejail/disable-passwdmgr.inc 14# Allow python (blacklisted by disable-interpreters.inc)
14include /etc/firejail/disable-programs.inc 15include allow-python2.inc
16include allow-python3.inc
17
18# include disable-common.inc
19# include disable-devel.inc
20include disable-interpreters.inc
21# include disable-programs.inc
15 22
16whitelist /var/lib/mlocate 23whitelist /var/lib/mlocate
17include /etc/firejail/whitelist-var-common.inc 24include whitelist-var-common.inc
18 25
26apparmor
19caps.drop all 27caps.drop all
20net none 28net none
21no3d 29no3d
@@ -33,6 +41,9 @@ tracelog
33 41
34# These options work but are disabled in case 42# These options work but are disabled in case
35# a users wants to search in these directories. 43# a users wants to search in these directories.
36# private-bin bash,catfish,env,locate,ls,mlocate,python,python2,python2.7,python3,python3.5,python3.5m,python3m 44# private-bin bash,catfish,env,locate,ls,mlocate,python*
37# private-dev 45# private-dev
38# private-tmp 46# private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-a-l/cawbird.profile b/etc/profile-a-l/cawbird.profile
new file mode 100644
index 000000000..78df5af83
--- /dev/null
+++ b/etc/profile-a-l/cawbird.profile
@@ -0,0 +1,46 @@
1# Firejail profile for cawbird
2# Description: Open-source Twitter client for Linux
3# This file is overwritten after every install/update
4# Persistent local customizations
5include cawbird.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/cawbird
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19apparmor
20caps.drop all
21machine-id
22netfilter
23no3d
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36tracelog
37
38disable-mnt
39private-bin cawbird
40private-cache
41private-dev
42private-etc alternatives,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,pki,resolv.conf,ssl,X11,xdg
43private-tmp
44
45# dbus-user none
46dbus-system none
diff --git a/etc/profile-a-l/celluloid.profile b/etc/profile-a-l/celluloid.profile
new file mode 100644
index 000000000..0beeaafdd
--- /dev/null
+++ b/etc/profile-a-l/celluloid.profile
@@ -0,0 +1,67 @@
1# Firejail profile for celluloid
2# Description: Simple GTK+ frontend for mpv
3# This file is overwritten after every install/update
4# Persistent local customizations
5include celluloid.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/celluloid
10noblacklist ${HOME}/.config/gnome-mpv
11noblacklist ${HOME}/.config/youtube-dl
12
13# Allow lua (blacklisted by disable-interpreters.inc)
14include allow-lua.inc
15
16# Allow python (blacklisted by disable-interpreters.inc)
17include allow-python2.inc
18include allow-python3.inc
19
20blacklist /usr/libexec
21
22include disable-common.inc
23include disable-devel.inc
24include disable-exec.inc
25include disable-interpreters.inc
26include disable-programs.inc
27
28mkdir ${HOME}/.config/celluloid
29mkdir ${HOME}/.config/gnome-mpv
30mkdir ${HOME}/.config/youtube-dl
31whitelist ${HOME}/.config/celluloid
32whitelist ${HOME}/.config/gnome-mpv
33whitelist ${HOME}/.config/youtube-dl
34include whitelist-common.inc
35include whitelist-player-common.inc
36include whitelist-runuser-common.inc
37include whitelist-usr-share-common.inc
38include whitelist-var-common.inc
39
40apparmor
41caps.drop all
42netfilter
43nogroups
44noinput
45nonewprivs
46noroot
47nou2f
48protocol unix,inet,inet6
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54private-bin celluloid,env,gnome-mpv,python*,youtube-dl
55private-cache
56private-etc alternatives,ca-certificates,crypto-policies,dconf,drirc,fonts,gtk-3.0,hosts,ld.so.cache,libva.conf,localtime,machine-id,pkcs11,pki,resolv.conf,selinux,ssl,xdg
57private-dev
58private-tmp
59
60dbus-user filter
61dbus-user.own io.github.celluloid_player.Celluloid
62dbus-user.talk ca.desrt.dconf
63dbus-user.talk org.gnome.SettingsDaemon.MediaKeys
64dbus-system none
65
66read-only ${HOME}
67read-write ${HOME}/.config/celluloid
diff --git a/etc/profile-a-l/checkbashisms.profile b/etc/profile-a-l/checkbashisms.profile
new file mode 100644
index 000000000..e89f488ea
--- /dev/null
+++ b/etc/profile-a-l/checkbashisms.profile
@@ -0,0 +1,55 @@
1# Firejail profile for checkbashisms
2# Description: Lint tool for shell scripts
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include checkbashisms.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12noblacklist ${DOCUMENTS}
13
14# Allow perl (blacklisted by disable-interpreters.inc)
15include allow-perl.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44shell none
45x11 none
46
47private-cache
48private-dev
49private-lib libfreebl3.so,perl*
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-a-l/cheese.profile b/etc/profile-a-l/cheese.profile
new file mode 100644
index 000000000..c2fc064f3
--- /dev/null
+++ b/etc/profile-a-l/cheese.profile
@@ -0,0 +1,50 @@
1# Firejail profile for cheese
2# Description: taking pictures and movies from a webcam
3# This file is overwritten after every install/update
4# Persistent local customizations
5include cheese.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${VIDEOS}
10noblacklist ${PICTURES}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19whitelist ${VIDEOS}
20whitelist ${PICTURES}
21whitelist /usr/share/gnome-video-effects
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29machine-id
30net none
31nodvd
32nogroups
33nonewprivs
34noroot
35notv
36nou2f
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin cheese
44private-cache
45private-etc alternatives,clutter-1.0,dconf,drirc,fonts,gtk-3.0
46private-tmp
47
48dbus-user filter
49dbus-user.talk ca.desrt.dconf
50dbus-system none
diff --git a/etc/profile-a-l/cherrytree.profile b/etc/profile-a-l/cherrytree.profile
new file mode 100644
index 000000000..e68182b27
--- /dev/null
+++ b/etc/profile-a-l/cherrytree.profile
@@ -0,0 +1,43 @@
1# Firejail profile for cherrytree
2# Description: Hierarchical note taking application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include cherrytree.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/cherrytree
10noblacklist ${DOCUMENTS}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23caps.drop all
24net none
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40private-cache
41private-dev
42private-tmp
43
diff --git a/etc/profile-a-l/chromium-browser-privacy.profile b/etc/profile-a-l/chromium-browser-privacy.profile
new file mode 100644
index 000000000..8803a4d9d
--- /dev/null
+++ b/etc/profile-a-l/chromium-browser-privacy.profile
@@ -0,0 +1,19 @@
1# Firejail profile for chromium-browser-privacy
2# This file is overwritten after every install/update
3# Persistent local customizations
4include chromium-browser-privacy.local
5
6noblacklist ${HOME}/.cache/ungoogled-chromium
7noblacklist ${HOME}/.config/ungoogled-chromium
8
9blacklist /usr/libexec
10
11mkdir ${HOME}/.cache/ungoogled-chromium
12mkdir ${HOME}/.config/ungoogled-chromium
13whitelist ${HOME}/.cache/ungoogled-chromium
14whitelist ${HOME}/.config/ungoogled-chromium
15
16# private-bin basename,bash,cat,chromium-browser-privacy,dirname,mkdir,readlink,sed,touch,which,xdg-settings
17
18# Redirect
19include chromium.profile
diff --git a/etc/profile-a-l/chromium-browser.profile b/etc/profile-a-l/chromium-browser.profile
new file mode 100644
index 000000000..7ad806f5b
--- /dev/null
+++ b/etc/profile-a-l/chromium-browser.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for chromium
2# This file is overwritten after every install/update
3# Persistent local customizations
4include chromium-browser.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include chromium.profile
diff --git a/etc/profile-a-l/chromium-common-hardened.inc.profile b/etc/profile-a-l/chromium-common-hardened.inc.profile
new file mode 100644
index 000000000..19addd285
--- /dev/null
+++ b/etc/profile-a-l/chromium-common-hardened.inc.profile
@@ -0,0 +1,9 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include chromium-common-hardened.inc.local
4
5caps.drop all
6nonewprivs
7noroot
8protocol unix,inet,inet6,netlink
9seccomp !chroot
diff --git a/etc/profile-a-l/chromium-common.profile b/etc/profile-a-l/chromium-common.profile
new file mode 100644
index 000000000..c42243e02
--- /dev/null
+++ b/etc/profile-a-l/chromium-common.profile
@@ -0,0 +1,59 @@
1# Firejail profile for chromium-common
2# This file is overwritten after every install/update
3# Persistent local customizations
4include chromium-common.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9# noexec ${HOME} breaks DRM binaries.
10?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
11
12noblacklist ${HOME}/.pki
13noblacklist ${HOME}/.local/share/pki
14
15# Add the next line to your chromium-common.local if you want Google Chrome/Chromium browser
16# to have access to Gnome extensions (extensions.gnome.org) via browser connector
17#include allow-python3.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/.pki
27mkdir ${HOME}/.local/share/pki
28whitelist ${DOWNLOADS}
29whitelist ${HOME}/.pki
30whitelist ${HOME}/.local/share/pki
31include whitelist-common.inc
32include whitelist-run-common.inc
33include whitelist-runuser-common.inc
34include whitelist-usr-share-common.inc
35include whitelist-var-common.inc
36
37# Add the next line to your chromium-common.local if your kernel allows unprivileged userns clone.
38#include chromium-common-hardened.inc.profile
39
40apparmor
41caps.keep sys_admin,sys_chroot
42netfilter
43nodvd
44nogroups
45noinput
46notv
47?BROWSER_DISABLE_U2F: nou2f
48shell none
49
50disable-mnt
51private-cache
52?BROWSER_DISABLE_U2F: private-dev
53#private-tmp - issues when using multiple browser sessions
54
55#dbus-user none - prevents access to passwords saved in GNOME Keyring and KWallet, also breaks Gnome connector.
56dbus-system none
57
58# The file dialog needs to work without d-bus.
59?HAS_NODBUS: env NO_CHROME_KDE_FILE_DIALOG=1
diff --git a/etc/profile-a-l/chromium-freeworld.profile b/etc/profile-a-l/chromium-freeworld.profile
new file mode 100644
index 000000000..dadedfbcf
--- /dev/null
+++ b/etc/profile-a-l/chromium-freeworld.profile
@@ -0,0 +1,10 @@
1# Firejail profile for chromium-freeworld
2# This file is overwritten after every install/update
3# Persistent local customizations
4include chromium-freeworld.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include chromium.profile
diff --git a/etc/profile-a-l/chromium.profile b/etc/profile-a-l/chromium.profile
new file mode 100644
index 000000000..9ac33aa1c
--- /dev/null
+++ b/etc/profile-a-l/chromium.profile
@@ -0,0 +1,24 @@
1# Firejail profile for chromium
2# Description: A web browser built for speed, simplicity, and security
3# This file is overwritten after every install/update
4# Persistent local customizations
5include chromium.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/chromium
10noblacklist ${HOME}/.config/chromium
11noblacklist ${HOME}/.config/chromium-flags.conf
12
13mkdir ${HOME}/.cache/chromium
14mkdir ${HOME}/.config/chromium
15whitelist ${HOME}/.cache/chromium
16whitelist ${HOME}/.config/chromium
17whitelist ${HOME}/.config/chromium-flags.conf
18whitelist /usr/share/chromium
19whitelist /usr/share/mozilla/extensions
20
21# private-bin chromium,chromium-browser,chromedriver
22
23# Redirect
24include chromium-common.profile
diff --git a/etc/profile-a-l/cin.profile b/etc/profile-a-l/cin.profile
new file mode 100644
index 000000000..7d3e0c100
--- /dev/null
+++ b/etc/profile-a-l/cin.profile
@@ -0,0 +1,37 @@
1# Firejail profile for cin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include cin.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.bcast5
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16caps.drop all
17ipc-namespace
18net none
19nodvd
20#nogroups
21noinput
22nonewprivs
23notv
24nou2f
25noroot
26protocol unix
27
28# If a 1-1.2% gap per thread hurts you, add 'ignore seccomp' to your cin.local.
29seccomp
30shell none
31
32#private-bin cin,ffmpeg
33private-cache
34private-dev
35
36dbus-user none
37dbus-system none
diff --git a/etc/profile-a-l/cinelerra.profile b/etc/profile-a-l/cinelerra.profile
new file mode 100644
index 000000000..38297bbae
--- /dev/null
+++ b/etc/profile-a-l/cinelerra.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for cin
2# This file is overwritten after every install/update
3# Persistent local customizations
4include cinelerra.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include cin.profile
diff --git a/etc/profile-a-l/cksum.profile b/etc/profile-a-l/cksum.profile
new file mode 100644
index 000000000..2baeed2ed
--- /dev/null
+++ b/etc/profile-a-l/cksum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for cksum
2# Description: checksum and count the bytes in a file
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include cksum.local
7# Persistent global definitions
8include globals.local
9
10private-bin cksum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/clamav.profile b/etc/profile-a-l/clamav.profile
index a5aacc1d5..e403c2c41 100644
--- a/etc/clamav.profile
+++ b/etc/profile-a-l/clamav.profile
@@ -1,11 +1,15 @@
1# Firejail profile for clamav 1# Firejail profile for clamav
2# Description: Anti-virus utility for Unix
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3quiet 4quiet
4# Persistent local customizations 5# Persistent local customizations
5include /etc/firejail/clamav.local 6include clamav.local
6# Persistent global definitions 7# Persistent global definitions
7include /etc/firejail/globals.local 8include globals.local
8 9
10blacklist ${RUNUSER}/wayland-*
11
12include disable-exec.inc
9 13
10caps.drop all 14caps.drop all
11ipc-namespace 15ipc-namespace
@@ -13,10 +17,12 @@ net none
13no3d 17no3d
14nodvd 18nodvd
15nogroups 19nogroups
20noinput
16nonewprivs 21nonewprivs
17noroot 22noroot
18nosound 23nosound
19notv 24notv
25nou2f
20novideo 26novideo
21protocol unix 27protocol unix
22seccomp 28seccomp
@@ -25,8 +31,10 @@ tracelog
25x11 none 31x11 none
26 32
27private-dev 33private-dev
34
35dbus-user none
36dbus-system none
37
28read-only ${HOME} 38read-only ${HOME}
29 39
30memory-deny-write-execute 40memory-deny-write-execute
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/profile-a-l/clamdscan.profile b/etc/profile-a-l/clamdscan.profile
new file mode 100644
index 000000000..b25b46a27
--- /dev/null
+++ b/etc/profile-a-l/clamdscan.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clamdscan.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include clamav.profile
diff --git a/etc/profile-a-l/clamdtop.profile b/etc/profile-a-l/clamdtop.profile
new file mode 100644
index 000000000..8c8cb3880
--- /dev/null
+++ b/etc/profile-a-l/clamdtop.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clamdtop.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include clamav.profile
diff --git a/etc/profile-a-l/clamscan.profile b/etc/profile-a-l/clamscan.profile
new file mode 100644
index 000000000..0bc95e515
--- /dev/null
+++ b/etc/profile-a-l/clamscan.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for clamav
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clamscan.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include clamav.profile
diff --git a/etc/profile-a-l/clamtk.profile b/etc/profile-a-l/clamtk.profile
new file mode 100644
index 000000000..2a06178a5
--- /dev/null
+++ b/etc/profile-a-l/clamtk.profile
@@ -0,0 +1,30 @@
1# Firejail profile for clamtk
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clamtk.local
5# Persistent global definitions
6include globals.local
7
8include disable-exec.inc
9
10caps.drop all
11ipc-namespace
12net none
13no3d
14nodvd
15nogroups
16noinput
17nonewprivs
18noroot
19nosound
20notv
21nou2f
22novideo
23protocol unix
24seccomp
25shell none
26
27private-dev
28
29dbus-user none
30dbus-system none
diff --git a/etc/profile-a-l/claws-mail.profile b/etc/profile-a-l/claws-mail.profile
new file mode 100644
index 000000000..691657fa0
--- /dev/null
+++ b/etc/profile-a-l/claws-mail.profile
@@ -0,0 +1,30 @@
1# Firejail profile for claws-mail
2# Description: Fast, lightweight and user-friendly GTK+2 based email client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include claws-mail.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.claws-mail
10
11mkdir ${HOME}/.claws-mail
12whitelist ${HOME}/.claws-mail
13
14# Add the below lines to your claws-mail.local if you use python-based plugins.
15# Allow python (blacklisted by disable-interpreters.inc)
16#include allow-python2.inc
17#include allow-python3.inc
18
19whitelist /usr/share/doc/claws-mail
20
21# private-bin claws-mail,curl,gpg,gpg2,gpg-agent,gpgsm,gpgme-config,pinentry,pinentry-gtk-2
22
23dbus-user filter
24dbus-user.talk ca.desrt.dconf
25dbus-user.talk org.gnome.keyring.SystemPrompter
26# Add the next line to your claws-mail.local if you use the notification plugin.
27# dbus-user.talk org.freedesktop.Notifications
28
29# Redirect
30include email-common.profile
diff --git a/etc/profile-a-l/clawsker.profile b/etc/profile-a-l/clawsker.profile
new file mode 100644
index 000000000..8ccf67ba1
--- /dev/null
+++ b/etc/profile-a-l/clawsker.profile
@@ -0,0 +1,54 @@
1# Firejail profile for clawsker
2# Description: An applet to edit Claws Mail's hidden preferences
3# This file is overwritten after every install/update
4# Persistent local customizations
5include clawsker.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.claws-mail
10
11# Allow perl (blacklisted by disable-interpreters.inc)
12include allow-perl.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20mkdir ${HOME}/.claws-mail
21whitelist ${HOME}/.claws-mail
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42
43disable-mnt
44private-bin bash,clawsker,perl,sh,which
45private-cache
46private-dev
47private-etc alternatives,fonts
48private-lib girepository-1.*,libdbus-glib-1.so.*,libetpan.so.*,libgirepository-1.*,libgtk-3.so.*,libgtk-x11-2.0.so.*,libstartup-notification-1.so.*,perl*
49private-tmp
50
51dbus-user none
52dbus-system none
53
54#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/clementine.profile b/etc/profile-a-l/clementine.profile
new file mode 100644
index 000000000..b1509f391
--- /dev/null
+++ b/etc/profile-a-l/clementine.profile
@@ -0,0 +1,40 @@
1# Firejail profile for clementine
2# Description: Modern music player and library organizer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include clementine.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Clementine
10noblacklist ${HOME}/.config/Clementine
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-runuser-common.inc
23
24apparmor
25caps.drop all
26noinput
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32protocol unix,inet,inet6,netlink
33# blacklisting of ioprio_set system calls breaks clementine
34seccomp !ioprio_set
35
36private-dev
37private-tmp
38
39dbus-system none
40# dbus-user none
diff --git a/etc/profile-a-l/clion-eap.profile b/etc/profile-a-l/clion-eap.profile
new file mode 100644
index 000000000..3602c3e7b
--- /dev/null
+++ b/etc/profile-a-l/clion-eap.profile
@@ -0,0 +1,10 @@
1# Firejail profile for CLion EAP
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clion-eap.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include clion.profile
diff --git a/etc/profile-a-l/clion.profile b/etc/profile-a-l/clion.profile
new file mode 100644
index 000000000..15071d731
--- /dev/null
+++ b/etc/profile-a-l/clion.profile
@@ -0,0 +1,43 @@
1# Firejail profile for CLion
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clion.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/JetBrains/CLion*
9noblacklist ${HOME}/.cache/JetBrains/CLion*
10noblacklist ${HOME}/.clion*
11noblacklist ${HOME}/.CLion*
12noblacklist ${HOME}/.config/git
13noblacklist ${HOME}/.gitconfig
14noblacklist ${HOME}/.git-credentials
15noblacklist ${HOME}/.java
16noblacklist ${HOME}/.local/share/JetBrains
17noblacklist ${HOME}/.tooling
18
19# Allow ssh (blacklisted by disable-common.inc)
20include allow-ssh.inc
21
22include disable-common.inc
23include disable-programs.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39private-cache
40private-dev
41# private-tmp
42
43noexec /tmp
diff --git a/etc/profile-a-l/clipgrab.profile b/etc/profile-a-l/clipgrab.profile
new file mode 100644
index 000000000..f3c77fa77
--- /dev/null
+++ b/etc/profile-a-l/clipgrab.profile
@@ -0,0 +1,47 @@
1# Firejail profile for clipgrab
2# Description: A free video downloader and converter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include clipgrab.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Philipp Schmieder
10noblacklist ${HOME}/.pki
11noblacklist ${VIDEOS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37seccomp !chroot
38shell none
39
40disable-mnt
41private-cache
42private-dev
43private-tmp
44
45# 'dbus-user none' breaks tray menu - add 'dbus-user none' to your clipgrab.local if you don't need it.
46# dbus-user none
47# dbus-system none
diff --git a/etc/profile-a-l/clipit.profile b/etc/profile-a-l/clipit.profile
new file mode 100644
index 000000000..4c7cb86bf
--- /dev/null
+++ b/etc/profile-a-l/clipit.profile
@@ -0,0 +1,50 @@
1# Firejail profile for clipit
2# Description: Lightweight GTK+ clipboard manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include clipit.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/clipit
10noblacklist ${HOME}/.local/share/clipit
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/clipit
20mkdir ${HOME}/.local/share/clipit
21whitelist ${HOME}/.config/clipit
22whitelist ${HOME}/.local/share/clipit
23include whitelist-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44shell none
45
46disable-mnt
47private-cache
48private-dev
49private-tmp
50
diff --git a/etc/profile-a-l/cliqz.profile b/etc/profile-a-l/cliqz.profile
new file mode 100644
index 000000000..d0b8cc0ef
--- /dev/null
+++ b/etc/profile-a-l/cliqz.profile
@@ -0,0 +1,23 @@
1# Firejail profile for cliqz
2# This file is overwritten after every install/update
3# Persistent local customizations
4include cliqz.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/cliqz
9noblacklist ${HOME}/.cliqz
10noblacklist ${HOME}/.config/cliqz
11
12mkdir ${HOME}/.cache/cliqz
13mkdir ${HOME}/.cliqz
14mkdir ${HOME}/.config/cliqz
15whitelist ${HOME}/.cache/cliqz
16whitelist ${HOME}/.cliqz
17whitelist ${HOME}/.config/cliqz
18
19# private-etc must first be enabled in firefox-common.profile
20#private-etc cliqz
21
22# Redirect
23include firefox-common.profile
diff --git a/etc/profile-a-l/clocks.profile b/etc/profile-a-l/clocks.profile
new file mode 100644
index 000000000..3b3efb9f3
--- /dev/null
+++ b/etc/profile-a-l/clocks.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-clocks
2# This file is overwritten after every install/update
3# Persistent local customizations
4include clocks.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include gnome-clocks.profile
diff --git a/etc/profile-a-l/cmus.profile b/etc/profile-a-l/cmus.profile
new file mode 100644
index 000000000..19a30e694
--- /dev/null
+++ b/etc/profile-a-l/cmus.profile
@@ -0,0 +1,30 @@
1# Firejail profile for cmus
2# Description: Lightweight ncurses audio player
3# This file is overwritten after every install/update
4# Persistent local customizations
5include cmus.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/cmus
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19caps.drop all
20netfilter
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29private-bin cmus
30private-etc alternatives,asound.conf,ca-certificates,crypto-policies,group,machine-id,pki,pulse,resolv.conf,ssl
diff --git a/etc/profile-a-l/code-oss.profile b/etc/profile-a-l/code-oss.profile
new file mode 100644
index 000000000..6d45d5994
--- /dev/null
+++ b/etc/profile-a-l/code-oss.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for Visual Studio Code
2# This file is overwritten after every install/update
3# Persistent local customizations
4include code-oss.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include code.profile
diff --git a/etc/profile-a-l/code.profile b/etc/profile-a-l/code.profile
new file mode 100644
index 000000000..fdf94ec41
--- /dev/null
+++ b/etc/profile-a-l/code.profile
@@ -0,0 +1,40 @@
1# Firejail profile for Visual Studio Code
2# This file is overwritten after every install/update
3# Persistent local customizations
4include code.local
5# Persistent global definitions
6include globals.local
7
8# Disabled until someone reported positive feedback
9ignore include disable-devel.inc
10ignore include disable-exec.inc
11ignore include disable-interpreters.inc
12ignore include disable-xdg.inc
13ignore whitelist ${DOWNLOADS}
14ignore include whitelist-common.inc
15ignore include whitelist-runuser-common.inc
16ignore include whitelist-usr-share-common.inc
17ignore include whitelist-var-common.inc
18ignore apparmor
19ignore disable-mnt
20ignore dbus-user none
21ignore dbus-system none
22
23noblacklist ${HOME}/.config/Code
24noblacklist ${HOME}/.config/Code - OSS
25noblacklist ${HOME}/.vscode
26noblacklist ${HOME}/.vscode-oss
27
28# Allows files commonly used by IDEs
29include allow-common-devel.inc
30
31nosound
32
33# Disabling noexec ${HOME} for now since it will
34# probably interfere with running some programmes
35# in VS Code
36# noexec ${HOME}
37noexec /tmp
38
39# Redirect
40include electron.profile
diff --git a/etc/profile-a-l/cola.profile b/etc/profile-a-l/cola.profile
new file mode 100644
index 000000000..e5debfd82
--- /dev/null
+++ b/etc/profile-a-l/cola.profile
@@ -0,0 +1,10 @@
1# Firejail profile for cola
2# Description: Linux native frontend for Git,alternative call for git-cola
3# This file is overwritten after every install/update
4# Persistent local customizations
5include cola.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include git-cola.profile \ No newline at end of file
diff --git a/etc/profile-a-l/colorful-wrapper.profile b/etc/profile-a-l/colorful-wrapper.profile
new file mode 100644
index 000000000..4b762047d
--- /dev/null
+++ b/etc/profile-a-l/colorful-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for colorful-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include colorful-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin colorful-wrapper
12
13# Redirect
14include colorful.profile
diff --git a/etc/profile-a-l/colorful.profile b/etc/profile-a-l/colorful.profile
new file mode 100644
index 000000000..33ee0d0ee
--- /dev/null
+++ b/etc/profile-a-l/colorful.profile
@@ -0,0 +1,52 @@
1# Firejail profile for colorful
2# Description: simple 2D sideview shooter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include colorful.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.suve/colorful
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.suve/colorful
20whitelist ${HOME}/.suve/colorful
21whitelist /usr/share/suve
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin colorful
46private-cache
47private-dev
48private-etc alsa,alternatives,asound.conf,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,pulse
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-a-l/com.github.bleakgrey.tootle.profile b/etc/profile-a-l/com.github.bleakgrey.tootle.profile
new file mode 100644
index 000000000..8d9de93bb
--- /dev/null
+++ b/etc/profile-a-l/com.github.bleakgrey.tootle.profile
@@ -0,0 +1,55 @@
1# Firejail profile for com.github.bleakgrey.tootle
2# Description: Gtk Mastodon client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include com.github.bleakgrey.tootle.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/com.github.bleakgrey.tootle
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/com.github.bleakgrey.tootle
20whitelist ${DOWNLOADS}
21whitelist ${HOME}/.config/com.github.bleakgrey.tootle
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29machine-id
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin com.github.bleakgrey.tootle
46private-cache
47private-dev
48private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,machine-id mime.types,nsswitch.conf,pki,pulse,resolv.conf,ssl,X11,xdg
49private-tmp
50
51# Settings are immutable
52# dbus-user filter
53# dbus-user.own com.github.bleakgrey.tootle
54# dbus-user.talk ca.desrt.dconf
55dbus-system none
diff --git a/etc/profile-a-l/com.github.dahenson.agenda.profile b/etc/profile-a-l/com.github.dahenson.agenda.profile
new file mode 100644
index 000000000..e7aa32be9
--- /dev/null
+++ b/etc/profile-a-l/com.github.dahenson.agenda.profile
@@ -0,0 +1,66 @@
1# Firejail profile for com.github.dahenson.agenda
2# Description: Simple, fast, no-nonsense to-do (task) list
3# This file is overwritten after every install/update
4# Persistent local customizations
5include com.github.dahenson.agenda.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/agenda
10noblacklist ${HOME}/.config/agenda
11noblacklist ${HOME}/.local/share/agenda
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.cache/agenda
22mkdir ${HOME}/.config/agenda
23mkdir ${HOME}/.local/share/agenda
24whitelist ${HOME}/.cache/agenda
25whitelist ${HOME}/.config/agenda
26whitelist ${HOME}/.local/share/agenda
27include whitelist-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-runuser-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35net none
36no3d
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46protocol unix
47seccomp
48shell none
49tracelog
50
51disable-mnt
52private-bin com.github.dahenson.agenda
53private-cache
54private-dev
55private-etc dconf,fonts,gtk-3.0
56private-tmp
57
58dbus-user filter
59dbus-user.own com.github.dahenson.agenda
60dbus-user.talk ca.desrt.dconf
61dbus-system none
62
63read-only ${HOME}
64read-write ${HOME}/.cache/agenda
65read-write ${HOME}/.config/agenda
66read-write ${HOME}/.local/share/agenda
diff --git a/etc/profile-a-l/com.github.johnfactotum.Foliate.profile b/etc/profile-a-l/com.github.johnfactotum.Foliate.profile
new file mode 100644
index 000000000..aa9a19fcb
--- /dev/null
+++ b/etc/profile-a-l/com.github.johnfactotum.Foliate.profile
@@ -0,0 +1,63 @@
1# Firejail profile for foliate
2# Description: Simple and modern GTK eBook reader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include foliate.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${HOME}/.cache/com.github.johnfactotum.Foliate
11noblacklist ${HOME}/.local/share/com.github.johnfactotum.Foliate
12
13# Allow gjs (blacklisted by disable-interpreters.inc)
14include allow-gjs.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.cache/com.github.johnfactotum.Foliate
25mkdir ${HOME}/.local/share/com.github.johnfactotum.Foliate
26whitelist ${HOME}/.cache/com.github.johnfactotum.Foliate
27whitelist ${HOME}/.local/share/com.github.johnfactotum.Foliate
28whitelist ${DOCUMENTS}
29whitelist ${DOWNLOADS}
30whitelist /usr/share/com.github.johnfactotum.Foliate
31whitelist /usr/share/hyphen
32include whitelist-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38machine-id
39net none
40nodvd
41nogroups
42noinput
43nonewprivs
44noroot
45nosound
46notv
47nou2f
48novideo
49protocol unix
50seccomp
51shell none
52tracelog
53
54disable-mnt
55private-bin com.github.johnfactotum.Foliate,gjs
56private-cache
57private-dev
58private-etc dconf,fonts,gconf,gtk-3.0
59private-tmp
60
61read-only ${HOME}
62read-write ${HOME}/.cache/com.github.johnfactotum.Foliate
63read-write ${HOME}/.local/share/com.github.johnfactotum.Foliate
diff --git a/etc/profile-a-l/com.github.phase1geo.minder.profile b/etc/profile-a-l/com.github.phase1geo.minder.profile
new file mode 100644
index 000000000..b10d1b5b0
--- /dev/null
+++ b/etc/profile-a-l/com.github.phase1geo.minder.profile
@@ -0,0 +1,61 @@
1# Firejail profile for com.github.phase1geo.minder
2# Description: Mind-mapping application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include com.github.phase1geo.minder.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/minder
10noblacklist ${DOCUMENTS}
11noblacklist ${PICTURES}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.local/share/minder
22whitelist ${HOME}/.local/share/minder
23whitelist ${DOCUMENTS}
24whitelist ${DOWNLOADS}
25whitelist ${PICTURES}
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33machine-id
34net none
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix
46seccomp
47seccomp.block-secondary
48shell none
49tracelog
50
51disable-mnt
52private-bin com.github.phase1geo.minder
53private-cache
54private-dev
55private-etc alternatives,dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mime.types,pango,passwd,X11,xdg
56private-tmp
57
58dbus-user filter
59dbus-user.own com.github.phase1geo.minder
60dbus-user.talk ca.desrt.dconf
61dbus-system none
diff --git a/etc/profile-a-l/com.gitlab.newsflash.profile b/etc/profile-a-l/com.gitlab.newsflash.profile
new file mode 100644
index 000000000..1e37da602
--- /dev/null
+++ b/etc/profile-a-l/com.gitlab.newsflash.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for newsflash
2# This file is overwritten after every install/update
3# Persistent local customizations
4include com.gitlab.newsflash.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include newsflash.profile
diff --git a/etc/profile-a-l/conkeror.profile b/etc/profile-a-l/conkeror.profile
new file mode 100644
index 000000000..38edf0d21
--- /dev/null
+++ b/etc/profile-a-l/conkeror.profile
@@ -0,0 +1,36 @@
1# Firejail profile for conkeror
2# This file is overwritten after every install/update
3# Persistent local customizations
4include conkeror.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.conkeror.mozdev.org
9
10include disable-common.inc
11include disable-programs.inc
12
13mkdir ${HOME}/.conkeror.mozdev.org
14mkfile ${HOME}/.conkerorrc
15whitelist ${HOME}/.conkeror.mozdev.org
16whitelist ${HOME}/.conkerorrc
17whitelist ${HOME}/.lastpass
18whitelist ${HOME}/.pentadactyl
19whitelist ${HOME}/.pentadactylrc
20whitelist ${HOME}/.vimperator
21whitelist ${HOME}/.vimperatorrc
22whitelist ${HOME}/.zotero
23whitelist ${HOME}/dwhelper
24whitelist ${DOWNLOADS}
25include whitelist-common.inc
26
27caps.drop all
28netfilter
29nodvd
30nonewprivs
31noroot
32notv
33protocol unix,inet,inet6
34seccomp
35
36disable-mnt
diff --git a/etc/profile-a-l/conky.profile b/etc/profile-a-l/conky.profile
new file mode 100644
index 000000000..7ccc101bf
--- /dev/null
+++ b/etc/profile-a-l/conky.profile
@@ -0,0 +1,46 @@
1# Firejail profile for conky
2# Description: Highly configurable system monitor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include conky.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PICTURES}
10
11# Allow lua (blacklisted by disable-interpreters.inc)
12include allow-lua.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6
38seccomp
39shell none
40
41disable-mnt
42private-cache
43private-dev
44private-tmp
45
46memory-deny-write-execute
diff --git a/etc/profile-a-l/conplay.profile b/etc/profile-a-l/conplay.profile
new file mode 100644
index 000000000..d0ad7c753
--- /dev/null
+++ b/etc/profile-a-l/conplay.profile
@@ -0,0 +1,16 @@
1# Firejail profile for conplay
2# Description: MPEG audio player/decoder
3# This file is overwritten after every install/update
4# Persistent local customizations
5include conplay.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10## system-wide profile
11#+ overrides
12# Allow perl (blacklisted by disable-interpreters.inc)
13include allow-perl.inc
14
15# Redirect
16include mpg123.profile
diff --git a/etc/profile-a-l/corebird.profile b/etc/profile-a-l/corebird.profile
new file mode 100644
index 000000000..537381f64
--- /dev/null
+++ b/etc/profile-a-l/corebird.profile
@@ -0,0 +1,38 @@
1# Firejail profile for corebird
2# Description: Native Gtk+ Twitter client for the Linux desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include corebird.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/corebird
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28notv
29nou2f
30novideo
31protocol unix,inet,inet6
32seccomp
33shell none
34
35private-bin corebird
36private-dev
37private-tmp
38
diff --git a/etc/profile-a-l/cower.profile b/etc/profile-a-l/cower.profile
new file mode 100644
index 000000000..351ca0dab
--- /dev/null
+++ b/etc/profile-a-l/cower.profile
@@ -0,0 +1,49 @@
1# Firejail profile for cower
2# Description: a simple AUR agent with a pretentious name
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include cower.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.config/cower
11noblacklist /var/lib/pacman
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21# This profile could be significantly strengthened by adding the following to cower.local
22# whitelist ${HOME}/<Your Build Folder>
23# whitelist ${HOME}/.config/cower
24
25caps.drop all
26ipc-namespace
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41
42disable-mnt
43private-bin cower
44private-cache
45private-dev
46private-tmp
47
48memory-deny-write-execute
49read-only ${HOME}/.config/cower/config
diff --git a/etc/profile-a-l/coyim.profile b/etc/profile-a-l/coyim.profile
new file mode 100644
index 000000000..03218d85a
--- /dev/null
+++ b/etc/profile-a-l/coyim.profile
@@ -0,0 +1,49 @@
1# Firejail profile for coyim
2# Description: GTK Jabber client written in Go
3# This file is overwritten after every install/update
4# Persistent local customizations
5include coyim.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/coyim
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/coyim
20whitelist ${HOME}/.config/coyim
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35protocol unix,inet,inet6
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private-cache
42private-dev
43private-etc alternatives,ca-certificates,crypto-policies,fonts,machine-id,pki,ssl
44private-tmp
45
46dbus-user none
47dbus-system none
48
49#memory-deny-write-execute
diff --git a/etc/profile-a-l/cpio.profile b/etc/profile-a-l/cpio.profile
new file mode 100644
index 000000000..bdc4f21a6
--- /dev/null
+++ b/etc/profile-a-l/cpio.profile
@@ -0,0 +1,14 @@
1# Firejail profile for cpio
2# Description: A program to manage archives of files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include cpio.local
7# Persistent global definitions
8include globals.local
9
10noblacklist /sbin
11noblacklist /usr/sbin
12
13# Redirect
14include archiver-common.profile
diff --git a/etc/profile-a-l/crawl-tiles.profile b/etc/profile-a-l/crawl-tiles.profile
new file mode 100644
index 000000000..2e24429fd
--- /dev/null
+++ b/etc/profile-a-l/crawl-tiles.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for crawl
2# This file is overwritten after every install/update
3# Persistent local customizations
4include crawl-titles.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9ignore no3d
10
11# Redirect
12include crawl.profile
diff --git a/etc/profile-a-l/crawl.profile b/etc/profile-a-l/crawl.profile
new file mode 100644
index 000000000..7cbbcd8d3
--- /dev/null
+++ b/etc/profile-a-l/crawl.profile
@@ -0,0 +1,47 @@
1# Firejail profile for crawl-tiles
2# Description: Roguelike dungeon exploration game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include crawl-tiles.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.crawl
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.crawl
19whitelist ${HOME}/.crawl
20include whitelist-common.inc
21include whitelist-var-common.inc
22
23caps.drop all
24ipc-namespace
25net none
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39
40disable-mnt
41private-bin crawl,crawl-tiles
42private-cache
43private-dev
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-a-l/crow.profile b/etc/profile-a-l/crow.profile
new file mode 100644
index 000000000..177abf829
--- /dev/null
+++ b/etc/profile-a-l/crow.profile
@@ -0,0 +1,46 @@
1# Firejail profile for crow
2# Description: A translator that allows to translate and say selected text using Google, Yandex and Bing translate API
3# This file is overwritten after every install/update
4# Persistent local customizations
5include crow.local
6# Persistent global definitions
7include globals.local
8
9mkdir ${HOME}/.config/crow
10mkdir ${HOME}/.cache/gstreamer-1.0
11whitelist ${HOME}/.config/crow
12whitelist ${HOME}/.cache/gstreamer-1.0
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22include whitelist-common.inc
23
24caps.drop all
25netfilter
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6,netlink
36seccomp
37shell none
38
39disable-mnt
40private-bin crow
41private-dev
42private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,machine-id,nsswitch.conf,pki,pulse,resolv.conf,ssl
43private-opt none
44private-tmp
45private-srv none
46
diff --git a/etc/profile-a-l/cryptocat.profile b/etc/profile-a-l/cryptocat.profile
new file mode 100644
index 000000000..5362e7a6a
--- /dev/null
+++ b/etc/profile-a-l/cryptocat.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for Cryptocat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include cryptocat.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include Cryptocat.profile
diff --git a/etc/profile-a-l/curl.profile b/etc/profile-a-l/curl.profile
new file mode 100644
index 000000000..448d8b655
--- /dev/null
+++ b/etc/profile-a-l/curl.profile
@@ -0,0 +1,57 @@
1# Firejail profile for curl
2# Description: Command line tool for transferring data with URL syntax
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include curl.local
7# Persistent global definitions
8include globals.local
9
10# curl 7.74.0 introduces experimental support for HSTS cache
11# https://daniel.haxx.se/blog/2020/11/03/hsts-your-curl/
12# Technically this file can be anywhere but let's assume users have it in ${HOME}/.curl-hsts.
13# If your setup diverts, add 'blacklist /path/to/curl/hsts/file' to your disable-programs.local
14# and 'noblacklist /path/to/curl/hsts/file' to curl.local to keep the sandbox logic intact.
15noblacklist ${HOME}/.curl-hsts
16noblacklist ${HOME}/.curlrc
17
18blacklist /tmp/.X11-unix
19blacklist ${RUNUSER}
20
21include disable-common.inc
22include disable-exec.inc
23include disable-programs.inc
24# Depending on workflow you can add 'include disable-xdg.inc' to your curl.local.
25#include disable-xdg.inc
26
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32ipc-namespace
33machine-id
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol inet,inet6
46seccomp
47shell none
48tracelog
49
50# private-bin curl
51private-cache
52private-dev
53# private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/cvlc.profile b/etc/profile-a-l/cvlc.profile
index 81ccbc530..56c0d965c 100644
--- a/etc/cvlc.profile
+++ b/etc/profile-a-l/cvlc.profile
@@ -1,12 +1,13 @@
1# Firejail profile for cvlc 1# Firejail profile for cvlc
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/cvlc.local 4include cvlc.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6# added by included profile
7#include globals.local
7 8
8# cvlc doesn't like private-bin 9# cvlc doesn't like private-bin
9ignore private-bin 10ignore private-bin
10 11
11# Redirect 12# Redirect
12include /etc/firejail/vlc.profile 13include vlc.profile
diff --git a/etc/profile-a-l/cyberfox.profile b/etc/profile-a-l/cyberfox.profile
new file mode 100644
index 000000000..d1fff0004
--- /dev/null
+++ b/etc/profile-a-l/cyberfox.profile
@@ -0,0 +1,21 @@
1# Firejail profile for cyberfox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include cyberfox.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.8pecxstudios
9noblacklist ${HOME}/.cache/8pecxstudios
10
11mkdir ${HOME}/.8pecxstudios
12mkdir ${HOME}/.cache/8pecxstudios
13whitelist ${HOME}/.8pecxstudios
14whitelist ${HOME}/.cache/8pecxstudios
15
16# private-bin cyberfox,dbus-launch,dbus-send,env,sh,which
17# private-etc must first be enabled in firefox-common.profile
18#private-etc cyberfox
19
20# Redirect
21include firefox-common.profile
diff --git a/etc/profile-a-l/d-feet.profile b/etc/profile-a-l/d-feet.profile
new file mode 100644
index 000000000..0e4b8d475
--- /dev/null
+++ b/etc/profile-a-l/d-feet.profile
@@ -0,0 +1,56 @@
1# Firejail profile for d-feet
2# Description: D-Bus debugger for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include d-feet.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/d-feet
10
11# Allow python (disabled by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.config/d-feet
24whitelist ${HOME}/.config/d-feet
25whitelist /usr/share/d-feet
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33ipc-namespace
34# net none - breaks on Ubuntu
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix
46seccomp
47shell none
48
49disable-mnt
50private-bin d-feet,python*
51private-cache
52private-dev
53private-etc alternatives,dbus-1,fonts,machine-id
54private-tmp
55
56#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/darktable.profile b/etc/profile-a-l/darktable.profile
new file mode 100644
index 000000000..a3590281c
--- /dev/null
+++ b/etc/profile-a-l/darktable.profile
@@ -0,0 +1,40 @@
1# Firejail profile for darktable
2# Description: Virtual lighttable and darkroom for photographers
3# This file is overwritten after every install/update
4# Persistent local customizations
5include darktable.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/darktable
10noblacklist ${HOME}/.config/darktable
11noblacklist ${PICTURES}
12
13include allow-lua.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37#private-bin darktable
38private-dev
39private-tmp
40
diff --git a/etc/profile-a-l/dbus-send.profile b/etc/profile-a-l/dbus-send.profile
new file mode 100644
index 000000000..768f1ac2c
--- /dev/null
+++ b/etc/profile-a-l/dbus-send.profile
@@ -0,0 +1,59 @@
1# Firejail profile for dbus-send
2# Description: Send a message to a message bus
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include dbus-send.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}/wayland-*
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-write-mnt.inc
20include disable-xdg.inc
21
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31# Breaks abstract sockets
32#net none
33netfilter
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46shell none
47tracelog
48
49disable-mnt
50private
51private-bin dbus-send
52private-cache
53private-dev
54private-etc alternatives,dbus-1
55private-lib libpcre*
56private-tmp
57
58memory-deny-write-execute
59read-only ${HOME}
diff --git a/etc/profile-a-l/dconf-editor.profile b/etc/profile-a-l/dconf-editor.profile
new file mode 100644
index 000000000..f57063ab6
--- /dev/null
+++ b/etc/profile-a-l/dconf-editor.profile
@@ -0,0 +1,53 @@
1# Firejail profile for dconf-editor
2# Description: dconf configuration editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dconf-editor.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist ${HOME}/.local/share/glib-2.0
18include whitelist-common.inc
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25# net none - breaks application on older versions
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38seccomp.block-secondary
39shell none
40tracelog
41
42disable-mnt
43private-bin dconf-editor
44private-cache
45private-dev
46private-etc alternatives,dconf,fonts,gtk-3.0,machine-id
47private-lib
48private-tmp
49
50dbus-user filter
51dbus-user.own ca.desrt.dconf-editor
52dbus-user.talk ca.desrt.dconf
53dbus-system none
diff --git a/etc/profile-a-l/dconf.profile b/etc/profile-a-l/dconf.profile
new file mode 100644
index 000000000..8b7c86789
--- /dev/null
+++ b/etc/profile-a-l/dconf.profile
@@ -0,0 +1,53 @@
1# Firejail profile for dconf
2# Description: Configuration database system
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dconf.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18whitelist ${HOME}/.local/share/glib-2.0
19# dconf paths are whitelisted by the following
20include whitelist-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27machine-id
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43x11 none
44
45disable-mnt
46private-bin dconf,gsettings
47private-cache
48private-dev
49private-etc alternatives,dconf
50private-lib
51private-tmp
52
53memory-deny-write-execute
diff --git a/etc/profile-a-l/ddgr.profile b/etc/profile-a-l/ddgr.profile
new file mode 100644
index 000000000..b1d41ddf7
--- /dev/null
+++ b/etc/profile-a-l/ddgr.profile
@@ -0,0 +1,13 @@
1# Firejail profile for ddgr
2# Description: Search DuckDuckGo from your terminal
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ddgr.local
7# Persistent global definitions
8include globals.local
9
10private-bin ddgr
11
12# Redirect
13include googler-common.profile
diff --git a/etc/profile-a-l/ddgtk.profile b/etc/profile-a-l/ddgtk.profile
new file mode 100644
index 000000000..701755d93
--- /dev/null
+++ b/etc/profile-a-l/ddgtk.profile
@@ -0,0 +1,54 @@
1# Firejail profile for ddgtk
2# Description: A frontend GUI to dd for making bootable USB disks
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ddgtk.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20whitelist ${DOWNLOADS}
21whitelist /usr/share/ddgtk
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin bash,dd,ddgtk,grep,lsblk,python*,sed,sh,tr
47private-cache
48private-etc alternatives,fonts
49private-tmp
50
51dbus-user none
52dbus-system none
53
54# memory-deny-write-execute - breaks on Arch
diff --git a/etc/deadbeef.profile b/etc/profile-a-l/deadbeef.profile
index 3367aa8f4..d9ff941da 100644
--- a/etc/deadbeef.profile
+++ b/etc/profile-a-l/deadbeef.profile
@@ -1,24 +1,30 @@
1# Firejail profile for deadbeef 1# Firejail profile for deadbeef
2# Description: A GTK+ audio player for GNU/Linux
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/deadbeef.local 5include deadbeef.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/deadbeef 9noblacklist ${HOME}/.config/deadbeef
10noblacklist ${MUSIC}
9 11
10include /etc/firejail/disable-common.inc 12include disable-common.inc
11include /etc/firejail/disable-devel.inc 13include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
13include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
14 18
15caps.drop all 19caps.drop all
16netfilter 20netfilter
17no3d 21no3d
18nogroups 22nogroups
23noinput
19nonewprivs 24nonewprivs
20noroot 25noroot
21notv 26notv
27nou2f
22novideo 28novideo
23protocol unix,inet,inet6 29protocol unix,inet,inet6
24seccomp 30seccomp
@@ -27,5 +33,3 @@ shell none
27private-dev 33private-dev
28private-tmp 34private-tmp
29 35
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/profile-a-l/default.profile b/etc/profile-a-l/default.profile
new file mode 100644
index 000000000..0d8c224d7
--- /dev/null
+++ b/etc/profile-a-l/default.profile
@@ -0,0 +1,61 @@
1# Firejail profile for default
2# This file is overwritten after every install/update
3# Persistent local customizations
4include default.local
5# Persistent global definitions
6include globals.local
7
8# generic GUI profile
9# depending on your usage, you can enable some of the commands below:
10
11include disable-common.inc
12# include disable-devel.inc
13# include disable-exec.inc
14# include disable-interpreters.inc
15include disable-programs.inc
16# include disable-shell.inc
17# include disable-write-mnt.inc
18# include disable-xdg.inc
19
20# include whitelist-common.inc
21# include whitelist-runuser-common.inc
22# include whitelist-usr-share-common.inc
23# include whitelist-var-common.inc
24
25# apparmor
26caps.drop all
27# ipc-namespace
28# machine-id
29# net none
30netfilter
31# no3d
32# nodvd
33# nogroups
34noinput
35nonewprivs
36noroot
37# nosound
38notv
39# nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43# shell none
44# tracelog
45
46# disable-mnt
47# private
48# private-bin program
49# private-cache
50# private-dev
51# see /usr/share/doc/firejail/profile.template for more common private-etc paths.
52# private-etc alternatives,fonts,machine-id
53# private-lib
54# private-opt none
55# private-tmp
56
57# dbus-user none
58# dbus-system none
59
60# memory-deny-write-execute
61# read-only ${HOME}
diff --git a/etc/profile-a-l/deluge.profile b/etc/profile-a-l/deluge.profile
new file mode 100644
index 000000000..3697243e0
--- /dev/null
+++ b/etc/profile-a-l/deluge.profile
@@ -0,0 +1,46 @@
1# Firejail profile for deluge
2# Description: BitTorrent client written in Python/PyGTK
3# This file is overwritten after every install/update
4# Persistent local customizations
5include deluge.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/deluge
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16# include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.config/deluge
22whitelist ${DOWNLOADS}
23whitelist ${HOME}/.config/deluge
24include whitelist-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29machine-id
30netfilter
31nodvd
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42
43# deluge is using python on Debian
44private-bin deluge,deluge-console,deluge-gtk,deluge-web,deluged,python*,sh,uname
45private-dev
46private-tmp
diff --git a/etc/profile-a-l/desktopeditors.profile b/etc/profile-a-l/desktopeditors.profile
new file mode 100644
index 000000000..5175146db
--- /dev/null
+++ b/etc/profile-a-l/desktopeditors.profile
@@ -0,0 +1,45 @@
1# Firejail profile for desktopeditors
2# Description: ONLYOFFICE DesktopEditors
3# This file is overwritten after every install/update
4# Persistent local customizations
5include desktopeditors.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/onlyoffice
10noblacklist ${HOME}/.local/share/onlyoffice
11noblacklist ${HOME}/.pki
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37tracelog
38
39private-bin desktopeditors,sh
40private-cache
41private-dev
42private-tmp
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-a-l/devhelp.profile b/etc/profile-a-l/devhelp.profile
new file mode 100644
index 000000000..a416bc27e
--- /dev/null
+++ b/etc/profile-a-l/devhelp.profile
@@ -0,0 +1,53 @@
1# Firejail profile for devhelp
2# Description: API documentation browser for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include devhelp.local
6# Persistent global definitions
7include globals.local
8
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
17
18whitelist /usr/share/devhelp
19whitelist /usr/share/doc
20whitelist /usr/share/gtk-doc/html
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23
24apparmor
25caps.drop all
26# net none - makes settings immutable
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin devhelp
43private-cache
44private-dev
45private-etc alternatives,dconf,fonts,ld.so.cache,machine-id,ssl
46private-tmp
47
48# makes settings immutable
49# dbus-user none
50# dbus-system none
51
52#memory-deny-write-execute - breaks on Arch (see issue #1803)
53read-only ${HOME}
diff --git a/etc/profile-a-l/devilspie.profile b/etc/profile-a-l/devilspie.profile
new file mode 100644
index 000000000..89c8e1ae8
--- /dev/null
+++ b/etc/profile-a-l/devilspie.profile
@@ -0,0 +1,59 @@
1# Firejail profile for devilspie
2# Description: Window matching daemon
3# This file is overwritten after every install/update
4# Persistent local customizations
5include devilspie.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11noblacklist ${HOME}/.devilspie
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.devilspie
21whitelist ${HOME}/.devilspie
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43shell none
44tracelog
45x11 none
46
47disable-mnt
48private-bin devilspie
49private-cache
50private-dev
51private-etc alternatives
52private-lib gconv
53private-tmp
54
55dbus-user none
56dbus-system none
57
58memory-deny-write-execute
59read-only ${HOME}
diff --git a/etc/profile-a-l/devilspie2.profile b/etc/profile-a-l/devilspie2.profile
new file mode 100644
index 000000000..9eab3f536
--- /dev/null
+++ b/etc/profile-a-l/devilspie2.profile
@@ -0,0 +1,24 @@
1# Firejail profile for devilspie2
2# Description: Window matching daemon (Lua)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include devilspie2.local
6# Persistent global definitions
7#include globals.local
8
9blacklist ${HOME}/.devilspie
10
11blacklist ${RUNUSER}/wayland-*
12
13noblacklist ${HOME}/.config/devilspie2
14
15# Allow lua (blacklisted by disable-interpreters.inc)
16include allow-lua.inc
17
18mkdir ${HOME}/.config/devilspie2
19whitelist ${HOME}/.config/devilspie2
20
21private-bin devilspie2
22
23# Redirect
24include devilspie.profile
diff --git a/etc/profile-a-l/dex2jar.profile b/etc/profile-a-l/dex2jar.profile
new file mode 100644
index 000000000..9c1cf72f0
--- /dev/null
+++ b/etc/profile-a-l/dex2jar.profile
@@ -0,0 +1,42 @@
1# Firejail profile for dex2jar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include dex2jar.local
6# Persistent global definitions
7include globals.local
8
9# Allow java (blacklisted by disable-devel.inc)
10include allow-java.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21caps.drop all
22net none
23no3d
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix
34seccomp
35shell none
36
37private-bin bash,dex2jar,dirname,expr,grep,java,ls,sh,uname
38private-cache
39private-dev
40
41dbus-user none
42dbus-system none
diff --git a/etc/profile-a-l/dia.profile b/etc/profile-a-l/dia.profile
new file mode 100644
index 000000000..902148756
--- /dev/null
+++ b/etc/profile-a-l/dia.profile
@@ -0,0 +1,57 @@
1# Firejail profile for dia
2# Description: Diagram editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dia.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.dia
10noblacklist ${DOCUMENTS}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23#mkdir ${HOME}/.dia
24#whitelist ${HOME}/.dia
25#whitelist ${DOCUMENTS}
26#include whitelist-common.inc
27whitelist /usr/share/dia
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34net none
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix
46seccomp
47shell none
48tracelog
49
50disable-mnt
51#private-bin dia
52private-cache
53private-dev
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/profile-a-l/dig.profile b/etc/profile-a-l/dig.profile
new file mode 100644
index 000000000..a925781af
--- /dev/null
+++ b/etc/profile-a-l/dig.profile
@@ -0,0 +1,59 @@
1# Firejail profile for dig
2# Description: DNS lookup utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include dig.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.digrc
11noblacklist ${PATH}/dig
12
13blacklist /tmp/.X11-unix
14blacklist ${RUNUSER}
15
16include disable-common.inc
17# include disable-devel.inc
18include disable-exec.inc
19# include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23#mkfile ${HOME}/.digrc - see #903
24whitelist ${HOME}/.digrc
25include whitelist-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32machine-id
33netfilter
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix,inet,inet6
45seccomp
46shell none
47tracelog
48
49disable-mnt
50private-bin bash,dig,sh
51private-dev
52# Add the next line to your dig.local on non Debian/Ubuntu OS (see issue #3038).
53#private-lib
54private-tmp
55
56dbus-user none
57dbus-system none
58
59memory-deny-write-execute
diff --git a/etc/profile-a-l/digikam.profile b/etc/profile-a-l/digikam.profile
new file mode 100644
index 000000000..41625e12e
--- /dev/null
+++ b/etc/profile-a-l/digikam.profile
@@ -0,0 +1,43 @@
1# Firejail profile for digikam
2# Description: Digital photo management application for KDE
3# This file is overwritten after every install/update
4# Persistent local customizations
5include digikam.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/digikam
10noblacklist ${HOME}/.config/digikamrc
11noblacklist ${HOME}/.kde/share/apps/digikam
12noblacklist ${HOME}/.kde4/share/apps/digikam
13noblacklist ${HOME}/.local/share/kxmlgui5/digikam
14noblacklist ${PICTURES}
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27netfilter
28nodvd
29nogroups
30nonewprivs
31noroot
32notv
33protocol unix,inet,inet6,netlink
34# QtWebengine needs chroot to set up its own sandbox
35seccomp !chroot
36shell none
37
38# private-dev - prevents libdc1394 loading; this lib is used to connect to a camera device
39# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl
40private-tmp
41
42# dbus-user none
43# dbus-system none
diff --git a/etc/profile-a-l/dillo.profile b/etc/profile-a-l/dillo.profile
new file mode 100644
index 000000000..276ee251a
--- /dev/null
+++ b/etc/profile-a-l/dillo.profile
@@ -0,0 +1,37 @@
1# Firejail profile for dillo
2# Description: Small and fast web browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dillo.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.dillo
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16mkdir ${HOME}/.dillo
17mkdir ${HOME}/.fltk
18whitelist ${DOWNLOADS}
19whitelist ${HOME}/.dillo
20whitelist ${HOME}/.fltk
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25netfilter
26nodvd
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32protocol unix,inet,inet6
33seccomp
34tracelog
35
36private-dev
37private-tmp
diff --git a/etc/profile-a-l/dino-im.profile b/etc/profile-a-l/dino-im.profile
new file mode 100644
index 000000000..ae0549d3e
--- /dev/null
+++ b/etc/profile-a-l/dino-im.profile
@@ -0,0 +1,14 @@
1# Firejail profile for dino-im
2# Description: Modern XMPP Chat Client using GTK+/Vala, Ubuntu specific bin name
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dino-im.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Add Ubuntu specific binary name
11private-bin dino-im
12
13# Redirect
14include dino.profile
diff --git a/etc/profile-a-l/dino.profile b/etc/profile-a-l/dino.profile
new file mode 100644
index 000000000..b1a9550f1
--- /dev/null
+++ b/etc/profile-a-l/dino.profile
@@ -0,0 +1,47 @@
1# Firejail profile for dino
2# Description: Modern XMPP Chat Client using GTK+/Vala
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dino.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/dino
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18mkdir ${HOME}/.local/share/dino
19whitelist ${HOME}/.local/share/dino
20whitelist ${DOWNLOADS}
21include whitelist-common.inc
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35protocol unix,inet,inet6
36seccomp
37seccomp.block-secondary
38shell none
39tracelog
40
41disable-mnt
42private-bin dino
43private-dev
44# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl -- breaks server connection
45private-tmp
46
47dbus-system none
diff --git a/etc/profile-a-l/discord-canary.profile b/etc/profile-a-l/discord-canary.profile
new file mode 100644
index 000000000..43db95b8a
--- /dev/null
+++ b/etc/profile-a-l/discord-canary.profile
@@ -0,0 +1,17 @@
1# Firejail profile for discord-canary
2# This file is overwritten after every install/update
3# Persistent local customizations
4include discord-canary.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/discordcanary
9
10mkdir ${HOME}/.config/discordcanary
11whitelist ${HOME}/.config/discordcanary
12
13private-bin discord-canary,electron,electron[0-9],electron[0-9][0-9]
14private-opt discord-canary
15
16# Redirect
17include discord-common.profile
diff --git a/etc/profile-a-l/discord-common.profile b/etc/profile-a-l/discord-common.profile
new file mode 100644
index 000000000..2613027ba
--- /dev/null
+++ b/etc/profile-a-l/discord-common.profile
@@ -0,0 +1,32 @@
1# Firejail profile for discord
2# This file is overwritten after every install/update
3# Persistent local customizations
4include discord-common.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9# Disabled until someone reported positive feedback
10ignore include disable-interpreters.inc
11ignore include disable-xdg.inc
12ignore include whitelist-runuser-common.inc
13ignore include whitelist-usr-share-common.inc
14ignore apparmor
15ignore disable-mnt
16ignore private-cache
17ignore dbus-user none
18ignore dbus-system none
19
20ignore noexec ${HOME}
21ignore novideo
22
23whitelist ${HOME}/.config/BetterDiscord
24whitelist ${HOME}/.local/share/betterdiscordctl
25
26private-bin bash,cut,echo,egrep,electron,electron[0-9],electron[0-9][0-9],fish,grep,head,sed,sh,tclsh,tr,xdg-mime,xdg-open,zsh
27private-etc alternatives,ca-certificates,crypto-policies,fonts,group,ld.so.cache,localtime,login.defs,machine-id,password,pki,pulse,resolv.conf,ssl
28
29join-or-start discord
30
31# Redirect
32include electron.profile
diff --git a/etc/profile-a-l/discord.profile b/etc/profile-a-l/discord.profile
new file mode 100644
index 000000000..8ef02a30f
--- /dev/null
+++ b/etc/profile-a-l/discord.profile
@@ -0,0 +1,17 @@
1# Firejail profile for discord
2# This file is overwritten after every install/update
3# Persistent local customizations
4include discord.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/discord
9
10mkdir ${HOME}/.config/discord
11whitelist ${HOME}/.config/discord
12
13private-bin discord
14private-opt discord
15
16# Redirect
17include discord-common.profile
diff --git a/etc/profile-a-l/display-im6.q16.profile b/etc/profile-a-l/display-im6.q16.profile
new file mode 100644
index 000000000..b80afc3fa
--- /dev/null
+++ b/etc/profile-a-l/display-im6.q16.profile
@@ -0,0 +1,10 @@
1# Firejail profile for display-im6.q16
2# This file is overwritten after every install/update
3# Persistent local customizations
4include display-im6.q16.local
5# Persistent global definitions
6include globals.local
7
8
9# Redirect
10include display.profile
diff --git a/etc/profile-a-l/display.profile b/etc/profile-a-l/display.profile
new file mode 100644
index 000000000..0f134bd87
--- /dev/null
+++ b/etc/profile-a-l/display.profile
@@ -0,0 +1,47 @@
1# Firejail profile for display
2# This file is overwritten after every install/update
3# Persistent local customizations
4include display.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${PICTURES}
9
10# Allow python (blacklisted by disable-interpreters.inc)
11include allow-python2.inc
12include allow-python3.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25caps.drop all
26net none
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35protocol unix
36seccomp
37shell none
38# x11 xorg - problems on kubuntu 17.04
39
40private-bin display,python*
41private-dev
42# On Debian-based systems, display is a symlink in /etc/alternatives
43private-etc alternatives
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-a-l/dnox.profile b/etc/profile-a-l/dnox.profile
new file mode 100644
index 000000000..51ba6f8b7
--- /dev/null
+++ b/etc/profile-a-l/dnox.profile
@@ -0,0 +1,22 @@
1# Firejail profile for dnox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include dnox.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/dnox
14noblacklist ${HOME}/.config/dnox
15
16mkdir ${HOME}/.cache/dnox
17mkdir ${HOME}/.config/dnox
18whitelist ${HOME}/.cache/dnox
19whitelist ${HOME}/.config/dnox
20
21# Redirect
22include chromium-common.profile
diff --git a/etc/profile-a-l/dnscrypt-proxy.profile b/etc/profile-a-l/dnscrypt-proxy.profile
new file mode 100644
index 000000000..906089663
--- /dev/null
+++ b/etc/profile-a-l/dnscrypt-proxy.profile
@@ -0,0 +1,54 @@
1# Firejail profile for dnscrypt-proxy
2# Description: Tool for securing communications between a client and a DNS resolver
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include dnscrypt-proxy.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}/wayland-*
12
13noblacklist /sbin
14noblacklist /usr/sbin
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23whitelist /usr/share/dnscrypt-proxy
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.keep ipc_lock,net_bind_service,setgid,setuid,sys_chroot
29ipc-namespace
30machine-id
31netfilter
32no3d
33nodvd
34noinput
35nonewprivs
36nosound
37notv
38nou2f
39novideo
40protocol inet,inet6
41seccomp.drop _sysctl,acct,add_key,adjtimex,clock_adjtime,delete_module,fanotify_init,finit_module,get_mempolicy,init_module,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioperm,iopl,kcmp,kexec_file_load,kexec_load,keyctl,lookup_dcookie,mbind,migrate_pages,modify_ldt,mount,move_pages,open_by_handle_at,perf_event_open,perf_event_open,pivot_root,process_vm_readv,process_vm_writev,ptrace,remap_file_pages,request_key,set_mempolicy,swapoff,swapon,sysfs,syslog,umount2,uselib,vmsplice
42shell none
43tracelog
44
45disable-mnt
46private
47private-cache
48private-dev
49
50dbus-user none
51dbus-system none
52
53# mdwe can break modules/plugins
54memory-deny-write-execute
diff --git a/etc/profile-a-l/dnsmasq.profile b/etc/profile-a-l/dnsmasq.profile
new file mode 100644
index 000000000..2db1548a4
--- /dev/null
+++ b/etc/profile-a-l/dnsmasq.profile
@@ -0,0 +1,37 @@
1# Firejail profile for dnsmasq
2# Description: Small caching DNS proxy and DHCP/TFTP server
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include dnsmasq.local
7# Persistent global definitions
8include globals.local
9
10noblacklist /sbin
11noblacklist /usr/sbin
12
13blacklist /tmp/.X11-unix
14blacklist ${RUNUSER}/wayland-*
15
16include disable-common.inc
17include disable-devel.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22caps.keep net_admin,net_bind_service,net_raw,setgid,setuid
23no3d
24nodvd
25noinput
26nonewprivs
27nosound
28notv
29nou2f
30novideo
31protocol unix,inet,inet6,netlink
32seccomp
33
34disable-mnt
35private
36private-cache
37private-dev
diff --git a/etc/profile-a-l/dolphin-emu.profile b/etc/profile-a-l/dolphin-emu.profile
new file mode 100644
index 000000000..ac86ef75a
--- /dev/null
+++ b/etc/profile-a-l/dolphin-emu.profile
@@ -0,0 +1,63 @@
1# Firejail profile for dolphin-emu
2# Description: An emulator for Gamecube and Wii games
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dolphin-emu.local
6# Persistent global definitions
7include globals.local
8
9# Note: you must whitelist your games folder in your dolphin-emu.local.
10
11noblacklist ${HOME}/.cache/dolphin-emu
12noblacklist ${HOME}/.config/dolphin-emu
13noblacklist ${HOME}/.local/share/dolphin-emu
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-write-mnt.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.cache/dolphin-emu
24mkdir ${HOME}/.config/dolphin-emu
25mkdir ${HOME}/.local/share/dolphin-emu
26whitelist ${HOME}/.cache/dolphin-emu
27whitelist ${HOME}/.config/dolphin-emu
28whitelist ${HOME}/.local/share/dolphin-emu
29whitelist /usr/share/dolphin-emu
30include whitelist-common.inc
31include whitelist-runuser-common.inc
32include whitelist-usr-share-common.inc
33include whitelist-var-common.inc
34
35apparmor
36caps.drop all
37ipc-namespace
38# Add the next line to your dolphin-emu.local if you do not need NetPlay support.
39# net none
40netfilter
41# Add the next line to your dolphin-emu.local if you do not need disc support.
42#nodvd
43nogroups
44nonewprivs
45noroot
46notv
47nou2f
48novideo
49protocol unix,inet,inet6,netlink,bluetooth
50seccomp
51shell none
52tracelog
53
54private-bin bash,dolphin-emu,dolphin-emu-x11,sh
55private-cache
56# Add the next line to your dolphin-emu.local if you do not need controller support.
57#private-dev
58private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,dconf,drirc,fonts,gconf,glvnd,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,kde4rc,kde5rc,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,nvidia,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,Trolltech.conf,X11,xdg
59private-opt none
60private-tmp
61
62dbus-user none
63dbus-system none
diff --git a/etc/profile-a-l/dolphin.profile b/etc/profile-a-l/dolphin.profile
new file mode 100644
index 000000000..e0300a577
--- /dev/null
+++ b/etc/profile-a-l/dolphin.profile
@@ -0,0 +1,14 @@
1# Firejail profile for dolphin
2# Description: File manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dolphin.local
6# Persistent global definitions
7include globals.local
8
9# Put 'ignore noroot' in your dolphin.local if you use MPV+Vulkan (see issue #3012)
10
11# Redirect
12include file-manager-common.profile
13
14join-or-start dolphin
diff --git a/etc/profile-a-l/dooble-qt4.profile b/etc/profile-a-l/dooble-qt4.profile
new file mode 100644
index 000000000..99cf0f7f8
--- /dev/null
+++ b/etc/profile-a-l/dooble-qt4.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for dooble
2# This file is overwritten after every install/update
3# Persistent local customizations
4include dooble-qt4.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include dooble.profile
diff --git a/etc/dooble.profile b/etc/profile-a-l/dooble.profile
index 2a57b0ef3..f1b630ac8 100644
--- a/etc/dooble.profile
+++ b/etc/profile-a-l/dooble.profile
@@ -1,30 +1,34 @@
1# Firejail profile for dooble 1# Firejail profile for dooble
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/dooble-qt4.local 4include dooble.local
5# Backward compatibility
6include dooble-qt4.local
5# Persistent global definitions 7# Persistent global definitions
6include /etc/firejail/globals.local 8include globals.local
7
8 9
9noblacklist ${HOME}/.dooble 10noblacklist ${HOME}/.dooble
10 11
11include /etc/firejail/disable-common.inc 12include disable-common.inc
12include /etc/firejail/disable-devel.inc 13include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
14include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
15 17
16mkdir ${HOME}/.dooble 18mkdir ${HOME}/.dooble
17whitelist ${DOWNLOADS} 19whitelist ${DOWNLOADS}
18whitelist ${HOME}/.dooble 20whitelist ${HOME}/.dooble
19include /etc/firejail/whitelist-common.inc 21include whitelist-common.inc
20 22
21caps.drop all 23caps.drop all
22netfilter 24netfilter
23nodvd 25nodvd
24nogroups 26nogroups
27noinput
25nonewprivs 28nonewprivs
26noroot 29noroot
27notv 30notv
31nou2f
28novideo 32novideo
29protocol unix,inet,inet6,netlink 33protocol unix,inet,inet6,netlink
30seccomp 34seccomp
@@ -35,5 +39,3 @@ disable-mnt
35private-dev 39private-dev
36private-tmp 40private-tmp
37 41
38noexec ${HOME}
39noexec /tmp
diff --git a/etc/profile-a-l/dosbox.profile b/etc/profile-a-l/dosbox.profile
new file mode 100644
index 000000000..ad7049d3d
--- /dev/null
+++ b/etc/profile-a-l/dosbox.profile
@@ -0,0 +1,44 @@
1# Firejail profile for dosbox
2# Description: x86 emulator with Tandy/Herc/CGA/EGA/VGA/SVGA graphics, sound and DOS
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dosbox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.dosbox
10noblacklist ${DOCUMENTS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37tracelog
38
39private-bin dosbox
40private-dev
41private-tmp
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-a-l/dragon.profile b/etc/profile-a-l/dragon.profile
new file mode 100644
index 000000000..26243ab4e
--- /dev/null
+++ b/etc/profile-a-l/dragon.profile
@@ -0,0 +1,41 @@
1# Firejail profile for dragon
2# Description: A multimedia player where the focus is on simplicity, instead of features
3# This file is overwritten after every install/update
4# Persistent local customizations
5include dragon.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/dragonplayerrc
10noblacklist ${MUSIC}
11noblacklist ${VIDEOS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21whitelist /usr/share/dragonplayer
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25caps.drop all
26netfilter
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37
38private-bin dragon
39private-dev
40private-tmp
41
diff --git a/etc/profile-a-l/drawio.profile b/etc/profile-a-l/drawio.profile
new file mode 100644
index 000000000..6d5e2501f
--- /dev/null
+++ b/etc/profile-a-l/drawio.profile
@@ -0,0 +1,54 @@
1# Firejail profile for drawio
2# Description: Diagram drawing application built on web technology - desktop version
3# This file is overwritten after every install/update
4# Persistent local customizations
5include drawio.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/draw.io
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/draw.io
20whitelist ${HOME}/.config/draw.io
21whitelist ${DOWNLOADS}
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30net none
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp !chroot
42shell none
43# tracelog - breaks on Arch
44
45private-bin drawio
46private-cache
47private-dev
48private-etc alternatives,fonts
49private-tmp
50
51dbus-user none
52dbus-system none
53
54# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-a-l/drill.profile b/etc/profile-a-l/drill.profile
new file mode 100644
index 000000000..2a09270f7
--- /dev/null
+++ b/etc/profile-a-l/drill.profile
@@ -0,0 +1,55 @@
1# Firejail profile for drill
2# Description: DNS lookup utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include drill.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${PATH}/drill
11
12blacklist /tmp/.X11-unix
13blacklist ${RUNUSER}
14
15include disable-common.inc
16# include disable-devel.inc
17include disable-exec.inc
18# include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private
48private-bin bash,drill,sh
49private-dev
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-a-l/dropbox.profile b/etc/profile-a-l/dropbox.profile
new file mode 100644
index 000000000..73d9cfbbc
--- /dev/null
+++ b/etc/profile-a-l/dropbox.profile
@@ -0,0 +1,49 @@
1# Firejail profile for dropbox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include dropbox.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/autostart
9noblacklist ${HOME}/.dropbox
10noblacklist ${HOME}/.dropbox-dist
11
12# Allow python3 (blacklisted by disable-interpreters.inc)
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20mkdir ${HOME}/.dropbox
21mkdir ${HOME}/.dropbox-dist
22mkdir ${HOME}/Dropbox
23mkfile ${HOME}/.config/autostart/dropbox.desktop
24whitelist ${HOME}/.config/autostart/dropbox.desktop
25whitelist ${HOME}/.dropbox
26whitelist ${HOME}/.dropbox-dist
27whitelist ${HOME}/Dropbox
28include whitelist-common.inc
29
30caps.drop all
31netfilter
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44shell none
45
46private-dev
47private-tmp
48
49noexec /tmp
diff --git a/etc/profile-a-l/easystroke.profile b/etc/profile-a-l/easystroke.profile
new file mode 100644
index 000000000..fd7f252b6
--- /dev/null
+++ b/etc/profile-a-l/easystroke.profile
@@ -0,0 +1,56 @@
1# Firejail profile for easystroke
2# Description: Control your desktop using mouse gestures
3# This file is overwritten after every install/update
4# Persistent local customizations
5include easystroke.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.easystroke
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.easystroke
19whitelist ${HOME}/.easystroke
20include whitelist-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26machine-id
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43disable-mnt
44# breaks custom shell command functionality
45#private-bin bash,easystroke,sh
46private-cache
47private-dev
48private-etc alternatives,fonts,group,passwd
49# breaks custom shell command functionality
50#private-lib gdk-pixbuf-2.*,gio,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.*
51private-tmp
52
53# dbus-user none
54# dbus-system none
55
56memory-deny-write-execute
diff --git a/etc/profile-a-l/ebook-convert.profile b/etc/profile-a-l/ebook-convert.profile
new file mode 100644
index 000000000..988ba90fc
--- /dev/null
+++ b/etc/profile-a-l/ebook-convert.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for calibre
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ebook-convert.local
5
6net none
7dbus-user none
8dbus-system none
9
10# Redirect
11include calibre.profile
diff --git a/etc/profile-a-l/ebook-edit.profile b/etc/profile-a-l/ebook-edit.profile
new file mode 100644
index 000000000..3b5fee0a8
--- /dev/null
+++ b/etc/profile-a-l/ebook-edit.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for calibre
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ebook-edit.local
5
6net none
7dbus-user none
8dbus-system none
9
10# Redirect
11include calibre.profile
diff --git a/etc/profile-a-l/ebook-meta.profile b/etc/profile-a-l/ebook-meta.profile
new file mode 100644
index 000000000..594a8e241
--- /dev/null
+++ b/etc/profile-a-l/ebook-meta.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for calibre
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ebook-meta.local
5
6net none
7dbus-user none
8dbus-system none
9
10# Redirect
11include calibre.profile
diff --git a/etc/profile-a-l/ebook-polish.profile b/etc/profile-a-l/ebook-polish.profile
new file mode 100644
index 000000000..ad94e32a2
--- /dev/null
+++ b/etc/profile-a-l/ebook-polish.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for calibre
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ebook-polish.local
5
6net none
7dbus-user none
8dbus-system none
9
10# Redirect
11include calibre.profile
diff --git a/etc/profile-a-l/ebook-viewer.profile b/etc/profile-a-l/ebook-viewer.profile
new file mode 100644
index 000000000..706aec737
--- /dev/null
+++ b/etc/profile-a-l/ebook-viewer.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for calibre
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ebook-viewer.local
5
6net none
7dbus-user none
8dbus-system none
9
10# Redirect
11include calibre.profile
diff --git a/etc/profile-a-l/electron-mail.profile b/etc/profile-a-l/electron-mail.profile
new file mode 100644
index 000000000..9aac3f570
--- /dev/null
+++ b/etc/profile-a-l/electron-mail.profile
@@ -0,0 +1,56 @@
1# Firejail profile for electron-mail
2# Description: Unofficial desktop app for several E2E encrypted email providers
3# This file is overwritten after every install/update
4# Persistent local customizations
5include electron-mail.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/electron-mail
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/electron-mail
20whitelist ${HOME}/.config/electron-mail
21whitelist ${DOWNLOADS}
22
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39novideo
40protocol unix,inet,inet6,netlink
41seccomp !chroot
42shell none
43# tracelog - breaks on Arch
44
45private-bin electron-mail
46private-cache
47private-dev
48private-etc alternatives,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,nsswitch.conf,pki,resolv.conf,selinux,ssl,xdg
49private-opt ElectronMail
50private-tmp
51
52# breaks tray functionality
53# dbus-user none
54dbus-system none
55
56# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-a-l/electron.profile b/etc/profile-a-l/electron.profile
new file mode 100644
index 000000000..05ae7e16d
--- /dev/null
+++ b/etc/profile-a-l/electron.profile
@@ -0,0 +1,40 @@
1# Firejail profile for electron
2# Description: Build cross platform desktop apps with web technologies
3# This file is overwritten after every install/update
4# Persistent local customizations
5include electron.local
6
7include disable-common.inc
8include disable-devel.inc
9include disable-exec.inc
10include disable-interpreters.inc
11include disable-programs.inc
12include disable-xdg.inc
13
14whitelist ${DOWNLOADS}
15include whitelist-common.inc
16include whitelist-runuser-common.inc
17include whitelist-usr-share-common.inc
18include whitelist-var-common.inc
19
20# Add the next line to your chromium-common.local if your kernel allows unprivileged userns clone.
21#include chromium-common-hardened.inc.profile
22
23apparmor
24caps.keep sys_admin,sys_chroot
25netfilter
26nodvd
27nogroups
28noinput
29notv
30nou2f
31novideo
32shell none
33
34disable-mnt
35private-cache
36private-dev
37private-tmp
38
39dbus-user none
40dbus-system none
diff --git a/etc/profile-a-l/electrum.profile b/etc/profile-a-l/electrum.profile
new file mode 100644
index 000000000..1647f2bc4
--- /dev/null
+++ b/etc/profile-a-l/electrum.profile
@@ -0,0 +1,54 @@
1# Firejail profile for electrum
2# Description: Lightweight Bitcoin wallet
3# This file is overwritten after every install/update
4# Persistent local customizations
5include electrum.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.electrum
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.electrum
24whitelist ${HOME}/.electrum
25include whitelist-common.inc
26include whitelist-var-common.inc
27
28caps.drop all
29ipc-namespace
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44
45disable-mnt
46private-bin electrum,python*
47private-cache
48?HAS_APPIMAGE: ignore private-dev
49private-dev
50private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,machine-id,pki,resolv.conf,ssl
51private-tmp
52
53# dbus-user none
54# dbus-system none
diff --git a/etc/profile-a-l/element-desktop.profile b/etc/profile-a-l/element-desktop.profile
new file mode 100644
index 000000000..48a826f2e
--- /dev/null
+++ b/etc/profile-a-l/element-desktop.profile
@@ -0,0 +1,24 @@
1# Firejail profile for element-desktop
2# Description: All-in-one secure chat app for teams, friends and organisations
3# This file is overwritten after every install/update
4# Persistent local customizations
5include element-desktop.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10ignore dbus-user none
11
12noblacklist ${HOME}/.config/Element
13
14mkdir ${HOME}/.config/Element
15whitelist ${HOME}/.config/Element
16whitelist /opt/Element
17
18private-opt Element
19
20dbus-user filter
21dbus-user.talk org.freedesktop.secrets
22
23# Redirect
24include riot-desktop.profile
diff --git a/etc/profile-a-l/elinks.profile b/etc/profile-a-l/elinks.profile
new file mode 100644
index 000000000..5a29eb24b
--- /dev/null
+++ b/etc/profile-a-l/elinks.profile
@@ -0,0 +1,18 @@
1# Firejail profile for elinks
2# Description: Advanced text-mode WWW browser
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include elinks.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.elinks
11
12mkdir ${HOME}/.elinks
13whitelist ${HOME}/.elinks
14
15private-bin elinks
16
17# Redirect
18include links-common.profile
diff --git a/etc/profile-a-l/emacs.profile b/etc/profile-a-l/emacs.profile
new file mode 100644
index 000000000..7e9be653d
--- /dev/null
+++ b/etc/profile-a-l/emacs.profile
@@ -0,0 +1,32 @@
1# Firejail profile for emacs
2# Description: GNU Emacs editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include emacs.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.emacs
10noblacklist ${HOME}/.emacs.d
11# Add the next line to your emacs.local if you need gpg support.
12#noblacklist ${HOME}/.gnupg
13
14# Allows files commonly used by IDEs
15include allow-common-devel.inc
16
17include disable-common.inc
18include disable-programs.inc
19
20caps.drop all
21netfilter
22nodvd
23nogroups
24nonewprivs
25noroot
26notv
27novideo
28protocol unix,inet,inet6
29seccomp
30
31read-write ${HOME}/.emacs
32read-write ${HOME}/.emacs.d
diff --git a/etc/profile-a-l/email-common.profile b/etc/profile-a-l/email-common.profile
new file mode 100644
index 000000000..03fd9033a
--- /dev/null
+++ b/etc/profile-a-l/email-common.profile
@@ -0,0 +1,84 @@
1# Firejail profile for email-common
2# Description: Common profile for claws-mail and sylpheed email clients
3# This file is overwritten after every install/update
4# Persistent local customizations
5include email-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10noblacklist ${HOME}/.bogofilter
11noblacklist ${HOME}/.gnupg
12noblacklist ${HOME}/.mozilla
13noblacklist ${HOME}/.signature
14# when storing mail outside the default ${HOME}/Mail path, 'noblacklist' the custom path in your email-common.local
15# and 'blacklist' it in your disable-common.local too so it is kept hidden from other applications
16noblacklist ${HOME}/Mail
17
18noblacklist ${DOCUMENTS}
19
20include disable-common.inc
21include disable-devel.inc
22include disable-exec.inc
23include disable-interpreters.inc
24include disable-programs.inc
25include disable-xdg.inc
26
27mkdir ${HOME}/.gnupg
28mkfile ${HOME}/.config/mimeapps.list
29mkfile ${HOME}/.signature
30whitelist ${HOME}/.config/mimeapps.list
31whitelist ${HOME}/.mozilla/firefox/profiles.ini
32whitelist ${HOME}/.gnupg
33whitelist ${HOME}/.signature
34whitelist ${DOCUMENTS}
35whitelist ${DOWNLOADS}
36# when storing mail outside the default ${HOME}/Mail path, 'whitelist' the custom path in your email-common.local
37whitelist ${HOME}/Mail
38whitelist ${RUNUSER}/gnupg
39whitelist /usr/share/gnupg
40whitelist /usr/share/gnupg2
41include whitelist-common.inc
42include whitelist-runuser-common.inc
43include whitelist-usr-share-common.inc
44include whitelist-var-common.inc
45
46apparmor
47caps.drop all
48machine-id
49netfilter
50no3d
51nodvd
52nogroups
53noinput
54nonewprivs
55noroot
56nosound
57notv
58nou2f
59novideo
60protocol unix,inet,inet6
61seccomp
62seccomp.block-secondary
63shell none
64tracelog
65
66# disable-mnt
67private-cache
68private-dev
69private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gcrypt,gnupg,groups,gtk-2.0,gtk-3.0,hostname,hosts,hosts.conf,mailname,nsswitch.conf,passwd,pki,resolv.conf,selinux,ssl,xdg
70private-tmp
71# encrypting and signing email
72writable-run-user
73
74dbus-system none
75
76# If you want to read local mail stored in /var/mail, add the following to email-common.local:
77#noblacklist /var/mail
78#noblacklist /var/spool/mail
79#whitelist /var/mail
80#whitelist /var/spool/mail
81#writable-var
82
83read-only ${HOME}/.mozilla/firefox/profiles.ini
84read-only ${HOME}/.signature
diff --git a/etc/empathy.profile b/etc/profile-a-l/empathy.profile
index b2cfa369c..5ca640d30 100644
--- a/etc/empathy.profile
+++ b/etc/profile-a-l/empathy.profile
@@ -1,14 +1,16 @@
1# Firejail profile for empathy 1# Firejail profile for empathy
2# Description: GNOME multi-protocol chat and call client
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/empathy.local 5include empathy.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8 9
9include /etc/firejail/disable-common.inc 10include disable-common.inc
10include /etc/firejail/disable-devel.inc 11include disable-devel.inc
11include /etc/firejail/disable-programs.inc 12include disable-interpreters.inc
13include disable-programs.inc
12 14
13caps.drop all 15caps.drop all
14netfilter 16netfilter
@@ -19,3 +21,6 @@ noroot
19notv 21notv
20protocol unix,inet,inet6 22protocol unix,inet,inet6
21seccomp 23seccomp
24
25private-cache
26private-tmp
diff --git a/etc/profile-a-l/enchant-2.profile b/etc/profile-a-l/enchant-2.profile
new file mode 100644
index 000000000..32cc0e691
--- /dev/null
+++ b/etc/profile-a-l/enchant-2.profile
@@ -0,0 +1,10 @@
1# Firejail profile for enchant-2
2# This file is overwritten after every install/update
3# Persistent local customizations
4include enchant-2.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include enchant.profile
diff --git a/etc/profile-a-l/enchant-lsmod-2.profile b/etc/profile-a-l/enchant-lsmod-2.profile
new file mode 100644
index 000000000..a7199955e
--- /dev/null
+++ b/etc/profile-a-l/enchant-lsmod-2.profile
@@ -0,0 +1,10 @@
1# Firejail profile for enchant-lsmod-2
2# This file is overwritten after every install/update
3# Persistent local customizations
4include enchant-lsmod-2.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include enchant.profile
diff --git a/etc/profile-a-l/enchant-lsmod.profile b/etc/profile-a-l/enchant-lsmod.profile
new file mode 100644
index 000000000..ba4353d15
--- /dev/null
+++ b/etc/profile-a-l/enchant-lsmod.profile
@@ -0,0 +1,10 @@
1# Firejail profile for enchant-lsmod
2# This file is overwritten after every install/update
3# Persistent local customizations
4include enchant-lsmod.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include enchant.profile
diff --git a/etc/profile-a-l/enchant.profile b/etc/profile-a-l/enchant.profile
new file mode 100644
index 000000000..dc383984e
--- /dev/null
+++ b/etc/profile-a-l/enchant.profile
@@ -0,0 +1,58 @@
1# Firejail profile for enchant
2# Description: Wrapper for various spell checker engines
3# This file is overwritten after every install/update
4# Persistent local customizations
5include enchant.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11noblacklist ${HOME}/.config/enchant
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/enchant
21whitelist ${HOME}/.config/enchant
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44shell none
45tracelog
46x11 none
47
48private-bin enchant,enchant-*
49private-cache
50private-dev
51private-etc alternatives
52private-lib
53private-tmp
54
55dbus-user none
56dbus-system none
57
58memory-deny-write-execute
diff --git a/etc/profile-a-l/engrampa.profile b/etc/profile-a-l/engrampa.profile
new file mode 100644
index 000000000..1aca416d8
--- /dev/null
+++ b/etc/profile-a-l/engrampa.profile
@@ -0,0 +1,41 @@
1# Firejail profile for engrampa
2# Description: Archive manager for MATE
3# This file is overwritten after every install/update
4# Persistent local customizations
5include engrampa.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14
15include whitelist-var-common.inc
16
17apparmor
18caps.drop all
19net none
20no3d
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26nosound
27notv
28nou2f
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35# private-bin engrampa
36private-dev
37# private-tmp
38
39dbus-user filter
40dbus-user.talk ca.desrt.dconf
41dbus-system none
diff --git a/etc/profile-a-l/enox.profile b/etc/profile-a-l/enox.profile
new file mode 100644
index 000000000..d982433e2
--- /dev/null
+++ b/etc/profile-a-l/enox.profile
@@ -0,0 +1,24 @@
1# Firejail profile for enox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include enox.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/Enox
14noblacklist ${HOME}/.config/Enox
15
16#mkdir ${HOME}/.cache/dnox
17#mkdir ${HOME}/.config/dnox
18mkdir ${HOME}/.cache/Enox
19mkdir ${HOME}/.config/Enox
20whitelist ${HOME}/.cache/Enox
21whitelist ${HOME}/.config/Enox
22
23# Redirect
24include chromium-common.profile
diff --git a/etc/profile-a-l/enpass.profile b/etc/profile-a-l/enpass.profile
new file mode 100644
index 000000000..0d0d6f083
--- /dev/null
+++ b/etc/profile-a-l/enpass.profile
@@ -0,0 +1,62 @@
1# Firejail profile for enpass
2# Description: A multiplatform password manager
3# This file is overwritten after every install/update.
4# Persistent local customisations
5include enpass.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Enpass
10noblacklist ${HOME}/.config/sinew.in
11noblacklist ${HOME}/.config/Sinew Software Systems
12noblacklist ${HOME}/.local/share/Enpass
13noblacklist ${DOCUMENTS}
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.cache/Enpass
23mkfile ${HOME}/.config/sinew.in
24mkdir ${HOME}/.config/Sinew Software Systems
25mkdir ${HOME}/.local/share/Enpass
26whitelist ${HOME}/.cache/Enpass
27whitelist ${HOME}/.config/sinew.in
28whitelist ${HOME}/.config/Sinew Software Systems
29whitelist ${HOME}/.local/share/Enpass
30whitelist ${DOCUMENTS}
31include whitelist-common.inc
32include whitelist-var-common.inc
33
34# machine-id and nosound break audio notification functionality.
35# Add the next lines to your enpass.local if you need that functionality.
36#ignore machine-id
37#ignore nosound
38caps.drop all
39machine-id
40netfilter
41no3d
42nodvd
43nogroups
44noinput
45nonewprivs
46noroot
47nosound
48notv
49nou2f
50novideo
51protocol unix,inet,inet6,netlink
52seccomp
53shell none
54tracelog
55
56private-bin dirname,Enpass,importer_enpass,readlink,sh
57?HAS_APPIMAGE: ignore private-dev
58private-dev
59private-opt Enpass
60private-tmp
61
62#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/eo-common.profile b/etc/profile-a-l/eo-common.profile
new file mode 100644
index 000000000..02112ef20
--- /dev/null
+++ b/etc/profile-a-l/eo-common.profile
@@ -0,0 +1,52 @@
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# added by caller profile
8#include globals.local
9
10noblacklist ${HOME}/.local/share/Trash
11noblacklist ${HOME}/.Steam
12noblacklist ${HOME}/.steam
13
14blacklist /usr/libexec
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-write-mnt.inc
22
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix,netlink
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48private-cache
49private-dev
50private-etc alternatives,dconf,fonts,gtk-3.0
51private-lib eog,eom,gdk-pixbuf-2.*,gio,girepository-1.*,gvfs,libgconf-2.so.*
52private-tmp
diff --git a/etc/profile-a-l/eog.profile b/etc/profile-a-l/eog.profile
new file mode 100644
index 000000000..65e5c6e69
--- /dev/null
+++ b/etc/profile-a-l/eog.profile
@@ -0,0 +1,29 @@
1# Firejail profile for eog
2# Description: Eye of GNOME graphics viewer program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include eog.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/eog
10
11whitelist /usr/share/eog
12
13# private-bin, private-etc and private-lib break 'Open With' / 'Open in file manager'.
14# Add the next lines to your eog.local if you need that functionality.
15#ignore private-bin
16#ignore private-etc
17#ignore private-lib
18
19private-bin eog
20
21# broken on Debian 10 (buster) running LXDE got the following error:
22# Failed to register: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
23#dbus-user filter
24#dbus-user.own org.gnome.eog
25#dbus-user.talk ca.desrt.dconf
26dbus-system none
27
28# Redirect
29include eo-common.profile
diff --git a/etc/profile-a-l/eom.profile b/etc/profile-a-l/eom.profile
new file mode 100644
index 000000000..7143a8e03
--- /dev/null
+++ b/etc/profile-a-l/eom.profile
@@ -0,0 +1,22 @@
1# Firejail profile for eom
2# Description: Eye of MATE graphics viewer program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include eom.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mate/eom
10
11whitelist /usr/share/eom
12
13# private-bin, private-etc and private-lib break 'Open With' / 'Open in file manager'.
14# Add the next lines to your eom.local if you need that functionality.
15#ignore private-bin
16#ignore private-etc
17#ignore private-lib
18
19private-bin eom
20
21# Redirect
22include eo-common.profile
diff --git a/etc/profile-a-l/ephemeral.profile b/etc/profile-a-l/ephemeral.profile
new file mode 100644
index 000000000..131d68951
--- /dev/null
+++ b/etc/profile-a-l/ephemeral.profile
@@ -0,0 +1,64 @@
1# Firejail profile for ephemeral
2# Description: The always-incognito web browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ephemeral.local
6# Persistent global definitions
7include globals.local
8
9# enforce private-cache
10#noblacklist ${HOME}/.cache/ephemeral
11
12noblacklist ${HOME}/.pki
13noblacklist ${HOME}/.local/share/pki
14
15# noexec ${HOME} breaks DRM binaries.
16?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23
24# enforce private-cache
25#mkdir ${HOME}/.cache/ephemeral
26mkdir ${HOME}/.pki
27mkdir ${HOME}/.local/share/pki
28# enforce private-cache
29#whitelist ${HOME}/.cache/ephemeral
30whitelist ${HOME}/.pki
31whitelist ${HOME}/.local/share/pki
32whitelist ${DOWNLOADS}
33include whitelist-common.inc
34include whitelist-usr-share-common.inc
35include whitelist-var-common.inc
36
37apparmor
38caps.drop all
39# machine-id breaks pulse audio; it should work fine in setups where sound is not required.
40#machine-id
41netfilter
42nodvd
43nogroups
44noinput
45nonewprivs
46# noroot breaks GTK_USE_PORTAL=1 usage, see https://github.com/netblue30/firejail/issues/2506.
47noroot
48notv
49?BROWSER_DISABLE_U2F: nou2f
50protocol unix,inet,inet6,netlink
51seccomp
52shell none
53tracelog
54
55disable-mnt
56private-cache
57?BROWSER_DISABLE_U2F: private-dev
58# private-etc below works fine on most distributions. There are some problems on CentOS.
59#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,group,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,localtime,login.defs,machine-id,mailcap,mime.types,nsswitch.conf,os-release,pango,passwd,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
60private-tmp
61
62# breaks preferences
63# dbus-user none
64# dbus-system none
diff --git a/etc/epiphany.profile b/etc/profile-a-l/epiphany.profile
index 0f9a9cf55..225811226 100644
--- a/etc/epiphany.profile
+++ b/etc/profile-a-l/epiphany.profile
@@ -1,17 +1,22 @@
1# Firejail profile for epiphany 1# Firejail profile for epiphany
2# Description: The GNOME Web browser
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/epiphany.local 5include epiphany.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
8
9# Note: Epiphany use bwrap since 3.34 and can not be firejailed any more.
10# See https://github.com/netblue30/firejail/issues/2995
7 11
8noblacklist ${HOME}/.cache/epiphany 12noblacklist ${HOME}/.cache/epiphany
9noblacklist ${HOME}/.config/epiphany 13noblacklist ${HOME}/.config/epiphany
10noblacklist ${HOME}/.local/share/epiphany 14noblacklist ${HOME}/.local/share/epiphany
11 15
12include /etc/firejail/disable-common.inc 16include disable-common.inc
13include /etc/firejail/disable-devel.inc 17include disable-devel.inc
14include /etc/firejail/disable-programs.inc 18include disable-interpreters.inc
19include disable-programs.inc
15 20
16mkdir ${HOME}/.cache/epiphany 21mkdir ${HOME}/.cache/epiphany
17mkdir ${HOME}/.config/epiphany 22mkdir ${HOME}/.config/epiphany
@@ -20,7 +25,7 @@ whitelist ${DOWNLOADS}
20whitelist ${HOME}/.cache/epiphany 25whitelist ${HOME}/.cache/epiphany
21whitelist ${HOME}/.config/epiphany 26whitelist ${HOME}/.config/epiphany
22whitelist ${HOME}/.local/share/epiphany 27whitelist ${HOME}/.local/share/epiphany
23include /etc/firejail/whitelist-common.inc 28include whitelist-common.inc
24 29
25caps.drop all 30caps.drop all
26netfilter 31netfilter
diff --git a/etc/profile-a-l/equalx.profile b/etc/profile-a-l/equalx.profile
new file mode 100644
index 000000000..7566f7b50
--- /dev/null
+++ b/etc/profile-a-l/equalx.profile
@@ -0,0 +1,63 @@
1# Firejail profile for equalx
2# Description: A graphical editor for writing LaTeX equations
3# This file is overwritten after every install/update
4# Persistent local customizations
5include equalx.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/equalx
10noblacklist ${HOME}/.equalx
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/equalx
21mkdir ${HOME}/.equalx
22whitelist ${HOME}/.config/equalx
23whitelist ${HOME}/.equalx
24whitelist /usr/share/poppler
25whitelist /usr/share/ghostscript
26whitelist /usr/share/texlive
27whitelist /usr/share/equalx
28whitelist /var/lib/texmf
29include whitelist-common.inc
30include whitelist-runuser-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36machine-id
37net none
38no3d
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix
49seccomp
50shell none
51tracelog
52
53disable-mnt
54private-bin equalx,gs,pdflatex,pdftocairo
55private-cache
56private-dev
57private-etc equalx,equalx.conf,fonts,gtk-2.0,latexmk.conf,machine-id,papersize,passwd,texlive,Trolltech.conf
58private-tmp
59
60dbus-user none
61dbus-system none
62
63memory-deny-write-execute
diff --git a/etc/profile-a-l/et.profile b/etc/profile-a-l/et.profile
new file mode 100644
index 000000000..4e70bb114
--- /dev/null
+++ b/etc/profile-a-l/et.profile
@@ -0,0 +1,11 @@
1# Firejail profile for et
2# Description: WPS Office - Spreadsheets
3# This file is overwritten after every install/update
4# Persistent local customizations
5include et.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include wps.profile
diff --git a/etc/profile-a-l/etr-wrapper.profile b/etc/profile-a-l/etr-wrapper.profile
new file mode 100644
index 000000000..98f949918
--- /dev/null
+++ b/etc/profile-a-l/etr-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for etr-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include etr-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin etr-wrapper
12
13# Redirect
14include etr.profile
diff --git a/etc/profile-a-l/etr.profile b/etc/profile-a-l/etr.profile
new file mode 100644
index 000000000..edeed69bf
--- /dev/null
+++ b/etc/profile-a-l/etr.profile
@@ -0,0 +1,56 @@
1# Firejail profile for etr
2# Description: High speed arctic racing game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include etr.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.etr
10
11blacklist /usr/libexec
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.etr
22whitelist ${HOME}/.etr
23whitelist /usr/share/etr
24# Debian version
25whitelist /usr/share/games/etr
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33net none
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix,netlink
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48disable-mnt
49private-bin etr
50private-cache
51private-dev
52# private-etc alternatives,drirc,machine-id,openal,passwd
53private-tmp
54
55dbus-user none
56dbus-system none
diff --git a/etc/profile-a-l/evince-previewer.profile b/etc/profile-a-l/evince-previewer.profile
new file mode 100644
index 000000000..3857d6f7b
--- /dev/null
+++ b/etc/profile-a-l/evince-previewer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for evince-previewer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include evince-previewer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include evince.profile
diff --git a/etc/profile-a-l/evince-thumbnailer.profile b/etc/profile-a-l/evince-thumbnailer.profile
new file mode 100644
index 000000000..080a04a52
--- /dev/null
+++ b/etc/profile-a-l/evince-thumbnailer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for evince-thumbnailer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include evince-thumbnailer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include evince.profile
diff --git a/etc/profile-a-l/evince.profile b/etc/profile-a-l/evince.profile
new file mode 100644
index 000000000..19ad5799c
--- /dev/null
+++ b/etc/profile-a-l/evince.profile
@@ -0,0 +1,67 @@
1# Firejail profile for evince
2# Description: Document (PostScript, PDF) viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include evince.local
6# Persistent global definitions
7include globals.local
8
9# WARNING: using bookmarks possibly exposes information, including file history from other programs.
10# Add the next line to your evince.local if you need bookmarks support. This also needs additional dbus-user filtering (see below).
11#noblacklist ${HOME}/.local/share/gvfs-metadata
12
13noblacklist ${HOME}/.config/evince
14noblacklist ${DOCUMENTS}
15
16blacklist /usr/libexec
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26whitelist /usr/share/doc
27whitelist /usr/share/evince
28whitelist /usr/share/poppler
29whitelist /usr/share/tracker
30include whitelist-runuser-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34caps.drop all
35machine-id
36# net none - breaks AppArmor on Ubuntu systems
37netfilter
38no3d
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54private-bin evince,evince-previewer,evince-thumbnailer
55private-cache
56private-dev
57private-etc alternatives,fonts,group,ld.so.cache,machine-id,passwd
58# private-lib might break two-page-view on some systems
59private-lib evince,gcc/*/*/libgcc_s.so.*,gcc/*/*/libstdc++.so.*,gconv,gdk-pixbuf-2.*,gio,gvfs/libgvfscommon.so,libarchive.so.*,libdjvulibre.so.*,libgconf-2.so.*,libgraphite2.so.*,libpoppler-glib.so.*,librsvg-2.so.*,libspectre.so.*
60private-tmp
61
62# dbus-user filtering might break two-page-view on some systems
63dbus-user filter
64# Add the next two lines to your evince.local if you need bookmarks support.
65#dbus-user.talk org.gtk.vfs.Daemon
66#dbus-user.talk org.gtk.vfs.Metadata
67dbus-system none
diff --git a/etc/profile-a-l/evolution.profile b/etc/profile-a-l/evolution.profile
new file mode 100644
index 000000000..a80327234
--- /dev/null
+++ b/etc/profile-a-l/evolution.profile
@@ -0,0 +1,46 @@
1# Firejail profile for evolution
2# Description: Groupware suite with mail client and organizer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include evolution.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /var/mail
10noblacklist /var/spool/mail
11noblacklist ${HOME}/.bogofilter
12noblacklist ${HOME}/.cache/evolution
13noblacklist ${HOME}/.config/evolution
14noblacklist ${HOME}/.gnupg
15noblacklist ${HOME}/.local/share/evolution
16noblacklist ${HOME}/.pki
17noblacklist ${HOME}/.local/share/pki
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24
25include whitelist-runuser-common.inc
26
27caps.drop all
28netfilter
29# no3d breaks under wayland
30#no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43
44private-dev
45private-tmp
46writable-var
diff --git a/etc/profile-a-l/exfalso.profile b/etc/profile-a-l/exfalso.profile
new file mode 100644
index 000000000..92e4395c5
--- /dev/null
+++ b/etc/profile-a-l/exfalso.profile
@@ -0,0 +1,15 @@
1# Firejail profile for exfalso
2# Description: GTK audio tag editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include exfalso.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10private-lib libatk-1.0.so.*,libgdk-3.so.*,libgdk_pixbuf-2.0.so.*,libgirepository-1.0.so.*,libgstreamer-1.0.so.*,libgtk-3.so.*,libgtksourceview-3.0.so.*,libpango-1.0.so.*,libpython*,libreadline.so.*,libsoup-2.4.so.*,libssl.so.1.*,python2*,python3*
11
12dbus-user none
13
14# Redirect
15include quodlibet.profile
diff --git a/etc/profile-a-l/exiftool.profile b/etc/profile-a-l/exiftool.profile
new file mode 100644
index 000000000..49a16f2f2
--- /dev/null
+++ b/etc/profile-a-l/exiftool.profile
@@ -0,0 +1,57 @@
1# Firejail profile for exiftool
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include exiftool.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11# Allow perl (blacklisted by disable-interpreters.inc)
12include allow-perl.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20whitelist /usr/share/perl-image-exiftool
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27machine-id
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43x11 none
44
45# To support exiftool in private-bin on Arch Linux (and derivatives), symlink /usr/bin/vendor_perl/exiftool
46# to /usr/bin/exiftool and add the below to your exiftool.local.
47# Non-Arch Linux users can safely add the below to their exiftool.local for extra hardening.
48#private-bin exiftool,perl
49private-cache
50private-dev
51private-etc alternatives
52private-tmp
53
54dbus-user none
55dbus-system none
56
57memory-deny-write-execute
diff --git a/etc/profile-a-l/falkon.profile b/etc/profile-a-l/falkon.profile
new file mode 100644
index 000000000..3911a8c75
--- /dev/null
+++ b/etc/profile-a-l/falkon.profile
@@ -0,0 +1,54 @@
1# Firejail profile for falkon
2# Description: Lightweight web browser based on Qt WebEngine
3# This file is overwritten after every install/update
4# Persistent local customizations
5include falkon.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/falkon
10noblacklist ${HOME}/.config/falkon
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.cache/falkon
20mkdir ${HOME}/.config/falkon
21whitelist ${DOWNLOADS}
22whitelist ${HOME}/.cache/falkon
23whitelist ${HOME}/.config/falkon
24whitelist /usr/share/falkon
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40protocol unix,inet,inet6,netlink
41# blacklisting of chroot system calls breaks falkon
42seccomp !chroot
43# tracelog
44
45disable-mnt
46# private-bin falkon
47private-cache
48private-dev
49private-etc adobe,alternatives,asound.conf,ati,ca-certificates,crypto-policies,dconf,drirc,fonts,group,gtk-2.0,gtk-3.0,hostname,hosts,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,selinux,ssl,xdg
50private-tmp
51
52# dbus-user filter
53# dbus-user.own org.kde.Falkon
54dbus-system none
diff --git a/etc/profile-a-l/fbreader.profile b/etc/profile-a-l/fbreader.profile
new file mode 100644
index 000000000..121c5ba26
--- /dev/null
+++ b/etc/profile-a-l/fbreader.profile
@@ -0,0 +1,39 @@
1# Firejail profile for fbreader
2# Description: E-book reader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include fbreader.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.FBReader
10noblacklist ${DOCUMENTS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24net none
25nodvd
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37private-bin fbreader,FBReader
38private-dev
39private-tmp
diff --git a/etc/profile-a-l/fdns.profile b/etc/profile-a-l/fdns.profile
new file mode 100644
index 000000000..25e1082ad
--- /dev/null
+++ b/etc/profile-a-l/fdns.profile
@@ -0,0 +1,49 @@
1# Firejail profile for server
2# This file is overwritten after every install/update
3# Persistent local customizations
4include fdns.local
5# Persistent global definitions
6include globals.local
7
8noblacklist /sbin
9noblacklist /usr/sbin
10
11blacklist /tmp/.X11-unix
12blacklist ${RUNUSER}/wayland-*
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21#include whitelist-usr-share-common.inc
22#include whitelist-var-common.inc
23
24caps.keep kill,net_bind_service,setgid,setuid,sys_admin,sys_chroot
25ipc-namespace
26# netfilter /etc/firejail/webserver.net
27no3d
28nodvd
29nogroups
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37#seccomp
38#shell none
39
40disable-mnt
41private
42private-bin bash,fdns,sh
43private-cache
44#private-dev
45private-etc ca-certificates,crypto-policies,fdns,ld.so.cache,ld.so.preload,localtime,nsswitch.conf,passwd,pki,ssl
46# private-lib
47private-tmp
48
49memory-deny-write-execute
diff --git a/etc/profile-a-l/feedreader.profile b/etc/profile-a-l/feedreader.profile
new file mode 100644
index 000000000..e45df21fc
--- /dev/null
+++ b/etc/profile-a-l/feedreader.profile
@@ -0,0 +1,59 @@
1# Firejail profile for feedreader
2# Description: RSS client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include feedreader.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/feedreader
10noblacklist ${HOME}/.local/share/feedreader
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.cache/feedreader
21mkdir ${HOME}/.local/share/feedreader
22whitelist ${HOME}/.cache/feedreader
23whitelist ${HOME}/.local/share/feedreader
24whitelist /usr/share/feedreader
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30caps.drop all
31netfilter
32# no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38# nosound
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44shell none
45tracelog
46
47disable-mnt
48private-cache
49private-dev
50private-tmp
51
52dbus-user filter
53dbus-user.own org.gnome.FeedReader
54dbus-user.own org.gnome.FeedReader.ArticleView
55dbus-user.talk org.freedesktop.secrets
56# Enable as you need.
57#dbus-user.talk org.freedesktop.Notifications
58#dbus-user.talk org.gnome.OnlineAccounts
59dbus-system none
diff --git a/etc/profile-a-l/feh-network.inc.profile b/etc/profile-a-l/feh-network.inc.profile
new file mode 100644
index 000000000..690b39171
--- /dev/null
+++ b/etc/profile-a-l/feh-network.inc.profile
@@ -0,0 +1,8 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include feh-network.inc.local
4
5ignore net none
6netfilter
7protocol unix,inet,inet6
8private-etc ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl
diff --git a/etc/profile-a-l/feh.profile b/etc/profile-a-l/feh.profile
new file mode 100644
index 000000000..0fdb1d3d3
--- /dev/null
+++ b/etc/profile-a-l/feh.profile
@@ -0,0 +1,43 @@
1# Firejail profile for feh
2# Description: imlib2 based image viewer
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include feh.local
7# Persistent global definitions
8include globals.local
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16
17# Add the next line to your feh.local to enable network access.
18#include feh-network.inc.profile
19
20caps.drop all
21net none
22no3d
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35
36private-bin feh,jpegexiforient,jpegtran
37private-cache
38private-dev
39private-etc alternatives,feh
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/profile-a-l/ferdi.profile b/etc/profile-a-l/ferdi.profile
new file mode 100644
index 000000000..a2372ec8a
--- /dev/null
+++ b/etc/profile-a-l/ferdi.profile
@@ -0,0 +1,47 @@
1# Firejail profile for ferdi
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ferdi.local
5# Persistent global definitions
6include globals.local
7
8ignore noexec /tmp
9
10noblacklist ${HOME}/.cache/Ferdi
11noblacklist ${HOME}/.config/Ferdi
12noblacklist ${HOME}/.pki
13noblacklist ${HOME}/.local/share/pki
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.cache/Ferdi
22mkdir ${HOME}/.config/Ferdi
23mkdir ${HOME}/.pki
24mkdir ${HOME}/.local/share/pki
25whitelist ${DOWNLOADS}
26whitelist ${HOME}/.cache/Ferdi
27whitelist ${HOME}/.config/Ferdi
28whitelist ${HOME}/.pki
29whitelist ${HOME}/.local/share/pki
30include whitelist-common.inc
31
32caps.drop all
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41protocol unix,inet,inet6,netlink
42seccomp !chroot
43shell none
44
45disable-mnt
46private-dev
47private-tmp
diff --git a/etc/profile-a-l/fetchmail.profile b/etc/profile-a-l/fetchmail.profile
new file mode 100644
index 000000000..babfeab61
--- /dev/null
+++ b/etc/profile-a-l/fetchmail.profile
@@ -0,0 +1,34 @@
1# Firejail profile for fetchmail
2# Description: SSL enabled POP3, APOP, IMAP mail gatherer/forwarder
3# This file is overwritten after every install/update
4# Persistent local customizations
5include fetchmail.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.fetchmailrc
10noblacklist ${HOME}/.netrc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25nosound
26notv
27nou2f
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32
33#private-bin bash,chmod,fetchmail,procmail
34private-dev
diff --git a/etc/profile-a-l/ffmpeg.profile b/etc/profile-a-l/ffmpeg.profile
new file mode 100644
index 000000000..637e6fbf5
--- /dev/null
+++ b/etc/profile-a-l/ffmpeg.profile
@@ -0,0 +1,57 @@
1# Firejail profile for ffmpeg
2# Description: Tools for transcoding, streaming and playing of multimedia files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ffmpeg.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${MUSIC}
11noblacklist ${VIDEOS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21whitelist /usr/share/devedeng
22whitelist /usr/share/ffmpeg
23whitelist /usr/share/qtchooser
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31netfilter
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol inet,inet6
42# allow set_mempolicy, which is required to encode using libx265
43seccomp !set_mempolicy
44seccomp.block-secondary
45shell none
46tracelog
47
48private-bin ffmpeg
49private-cache
50private-dev
51private-etc alternatives,ca-certificates,crypto-policies,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,nsswitch.conf,pkcs11,pki,resolv.conf,ssl
52private-tmp
53
54dbus-user none
55dbus-system none
56
57# memory-deny-write-execute - it breaks old versions of ffmpeg
diff --git a/etc/profile-a-l/ffmpegthumbnailer.profile b/etc/profile-a-l/ffmpegthumbnailer.profile
new file mode 100644
index 000000000..6d72c3b99
--- /dev/null
+++ b/etc/profile-a-l/ffmpegthumbnailer.profile
@@ -0,0 +1,18 @@
1# Firejail profile for ffmpegthumbnailer
2# Description: FFmpeg-based video thumbnailer
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ffmpegthumbnailer.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11private-bin ffmpegthumbnailer
12private-lib libffmpegthumbnailer.so.*
13
14# fix for ranger video thumbnails
15ignore private-cache
16
17# Redirect
18include ffmpeg.profile
diff --git a/etc/profile-a-l/ffplay.profile b/etc/profile-a-l/ffplay.profile
new file mode 100644
index 000000000..04134cbf4
--- /dev/null
+++ b/etc/profile-a-l/ffplay.profile
@@ -0,0 +1,20 @@
1# Firejail profile for ffplay
2# Description: FFmpeg-based media player
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ffplay.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11protocol unix,inet,inet6
12ignore ipc-namespace
13ignore nogroups
14ignore nosound
15
16private-bin ffplay
17private-etc alsa,asound.conf,group
18
19# Redirect
20include ffmpeg.profile
diff --git a/etc/profile-a-l/ffprobe.profile b/etc/profile-a-l/ffprobe.profile
new file mode 100644
index 000000000..e7c9f678d
--- /dev/null
+++ b/etc/profile-a-l/ffprobe.profile
@@ -0,0 +1,14 @@
1# Firejail profile for ffprobe
2# Description: FFmpeg-based media prober
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ffprobe.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11ignore private-bin
12
13# Redirect
14include ffmpeg.profile
diff --git a/etc/profile-a-l/file-manager-common.profile b/etc/profile-a-l/file-manager-common.profile
new file mode 100644
index 000000000..dbae06f19
--- /dev/null
+++ b/etc/profile-a-l/file-manager-common.profile
@@ -0,0 +1,52 @@
1# Firejail profile for file managers
2# Description: Common profile for GUI file managers
3# This file is overwritten after every install/update
4# Persistent local customizations
5include file-manager-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10# File managers need to be able to see everything under ${HOME}
11# and be able to start arbitrary applications
12
13ignore noexec ${HOME}
14
15# Allow lua (blacklisted by disable-interpreters.inc)
16include allow-lua.inc
17
18# Allow perl (blacklisted by disable-interpreters.inc)
19include allow-perl.inc
20
21# Allow python (blacklisted by disable-interpreters.inc)
22include allow-python2.inc
23include allow-python3.inc
24
25#include disable-common.inc
26include disable-devel.inc
27include disable-exec.inc
28include disable-interpreters.inc
29#include disable-programs.inc
30
31allusers
32#apparmor
33caps.drop all
34#net none
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41notv
42nou2f
43novideo
44protocol unix,inet,inet6,netlink
45seccomp
46shell none
47tracelog
48
49private-dev
50
51#dbus-user none
52#dbus-system none
diff --git a/etc/profile-a-l/file-roller.profile b/etc/profile-a-l/file-roller.profile
new file mode 100644
index 000000000..434466139
--- /dev/null
+++ b/etc/profile-a-l/file-roller.profile
@@ -0,0 +1,49 @@
1# Firejail profile for file-roller
2# Description: Archive manager for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include file-roller.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14
15whitelist /usr/libexec/file-roller
16whitelist /usr/libexec/p7zip
17whitelist /usr/share/file-roller
18include whitelist-runuser-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24machine-id
25# net none - breaks on older Ubuntu versions
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39seccomp.block-secondary
40shell none
41tracelog
42
43private-bin 7z,7za,7zr,ar,arj,atool,bash,brotli,bsdtar,bzip2,compress,cp,cpio,dpkg-deb,file-roller,gtar,gzip,isoinfo,lha,lrzip,lsar,lz4,lzip,lzma,lzop,mv,p7zip,rar,rm,rzip,sh,tar,unace,unalz,unar,uncompress,unrar,unsquashfs,unstuff,unzip,unzstd,xz,xzdec,zip,zoo,zstd
44private-cache
45private-dev
46private-etc dconf,fonts,gtk-3.0,xdg
47# private-tmp
48
49dbus-system none
diff --git a/etc/profile-a-l/file.profile b/etc/profile-a-l/file.profile
new file mode 100644
index 000000000..397120a0b
--- /dev/null
+++ b/etc/profile-a-l/file.profile
@@ -0,0 +1,47 @@
1# Firejail profile for file
2# Description: Recognize the type of data in a file using "magic" numbers
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include file.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12include disable-common.inc
13include disable-exec.inc
14include disable-programs.inc
15
16apparmor
17caps.drop all
18hostname file
19ipc-namespace
20machine-id
21net none
22no3d
23nodvd
24nogroups
25noinput
26nonewprivs
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34tracelog
35x11 none
36
37#private-bin bzip2,file,gzip,lrzip,lz4,lzip,xz,zstd
38private-cache
39private-dev
40#private-etc alternatives,localtime,magic,magic.mgc
41#private-lib file,libarchive.so.*,libfakeroot,libmagic.so.*,libseccomp.so.*
42
43dbus-user none
44dbus-system none
45
46memory-deny-write-execute
47read-only ${HOME}
diff --git a/etc/profile-a-l/filezilla.profile b/etc/profile-a-l/filezilla.profile
new file mode 100644
index 000000000..dc5def54f
--- /dev/null
+++ b/etc/profile-a-l/filezilla.profile
@@ -0,0 +1,44 @@
1# Firejail profile for filezilla
2# Description: Full-featured graphical FTP/FTPS/SFTP client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include filezilla.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/filezilla
10noblacklist ${HOME}/.filezilla
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16# Allow ssh (blacklisted by disable-common.inc)
17include allow-ssh.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-interpreters.inc
22include disable-programs.inc
23
24include whitelist-runuser-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28netfilter
29nodvd
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6
38seccomp
39shell none
40
41# private-bin breaks --join if the user has zsh set as $SHELL - adding zsh on private-bin
42private-bin bash,filezilla,fzputtygen,fzsftp,lsb_release,python*,sh,uname,zsh
43private-dev
44private-tmp
diff --git a/etc/profile-a-l/firedragon.profile b/etc/profile-a-l/firedragon.profile
new file mode 100644
index 000000000..77487161e
--- /dev/null
+++ b/etc/profile-a-l/firedragon.profile
@@ -0,0 +1,26 @@
1# Firejail profile for FireDragon
2# Description: Librewolf fork with enhanced KDE integration
3# This file is overwritten after every install/update
4# Persistent local customizations
5include firedragon.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/firedragon
10noblacklist ${HOME}/.firedragon
11
12mkdir ${HOME}/.cache/firedragon
13mkdir ${HOME}/.firedragon
14whitelist ${HOME}/.cache/firedragon
15whitelist ${HOME}/.firedragon
16
17# Add the next lines to your firedragon.local if you want to use the migration wizard.
18#noblacklist ${HOME}/.mozilla
19#whitelist ${HOME}/.mozilla
20
21# FireDragon requires a shell to launch on Arch. We can possibly remove sh though.
22# Add the next line to your firedragon.local to enable private-bin.
23#private-bin bash,dbus-launch,dbus-send,env,firedragon,python*,sh,which
24
25# Redirect
26include firefox-common.profile
diff --git a/etc/profile-a-l/firefox-beta.profile b/etc/profile-a-l/firefox-beta.profile
new file mode 100644
index 000000000..fa8bbb1f5
--- /dev/null
+++ b/etc/profile-a-l/firefox-beta.profile
@@ -0,0 +1,10 @@
1# Firejail profile for firefox-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include firefox-beta.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include firefox.profile
diff --git a/etc/profile-a-l/firefox-common-addons.profile b/etc/profile-a-l/firefox-common-addons.profile
new file mode 100644
index 000000000..b2b7c362a
--- /dev/null
+++ b/etc/profile-a-l/firefox-common-addons.profile
@@ -0,0 +1,93 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include firefox-common-addons.local
4
5ignore whitelist ${RUNUSER}/*firefox*
6ignore include whitelist-runuser-common.inc
7ignore private-cache
8
9noblacklist ${HOME}/.cache/youtube-dl
10noblacklist ${HOME}/.config/kgetrc
11noblacklist ${HOME}/.config/mpv
12noblacklist ${HOME}/.config/okularpartrc
13noblacklist ${HOME}/.config/okularrc
14noblacklist ${HOME}/.config/qpdfview
15noblacklist ${HOME}/.config/youtube-dl
16noblacklist ${HOME}/.kde/share/apps/kget
17noblacklist ${HOME}/.kde/share/apps/okular
18noblacklist ${HOME}/.kde/share/config/kgetrc
19noblacklist ${HOME}/.kde/share/config/okularpartrc
20noblacklist ${HOME}/.kde/share/config/okularrc
21noblacklist ${HOME}/.kde4/share/apps/kget
22noblacklist ${HOME}/.kde4/share/apps/okular
23noblacklist ${HOME}/.kde4/share/config/kgetrc
24noblacklist ${HOME}/.kde4/share/config/okularpartrc
25noblacklist ${HOME}/.kde4/share/config/okularrc
26noblacklist ${HOME}/.local/share/kget
27noblacklist ${HOME}/.local/share/kxmlgui5/okular
28noblacklist ${HOME}/.local/share/okular
29noblacklist ${HOME}/.local/share/qpdfview
30noblacklist ${HOME}/.netrc
31
32whitelist ${HOME}/.cache/gnome-mplayer/plugin
33whitelist ${HOME}/.cache/youtube-dl/youtube-sigfuncs
34whitelist ${HOME}/.config/gnome-mplayer
35whitelist ${HOME}/.config/kgetrc
36whitelist ${HOME}/.config/mpv
37whitelist ${HOME}/.config/okularpartrc
38whitelist ${HOME}/.config/okularrc
39whitelist ${HOME}/.config/pipelight-silverlight5.1
40whitelist ${HOME}/.config/pipelight-widevine
41whitelist ${HOME}/.config/qpdfview
42whitelist ${HOME}/.config/youtube-dl
43whitelist ${HOME}/.kde/share/apps/kget
44whitelist ${HOME}/.kde/share/apps/okular
45whitelist ${HOME}/.kde/share/config/kgetrc
46whitelist ${HOME}/.kde/share/config/okularpartrc
47whitelist ${HOME}/.kde/share/config/okularrc
48whitelist ${HOME}/.kde4/share/apps/kget
49whitelist ${HOME}/.kde4/share/apps/okular
50whitelist ${HOME}/.kde4/share/config/kgetrc
51whitelist ${HOME}/.kde4/share/config/okularpartrc
52whitelist ${HOME}/.kde4/share/config/okularrc
53whitelist ${HOME}/.keysnail.js
54whitelist ${HOME}/.lastpass
55whitelist ${HOME}/.local/share/kget
56whitelist ${HOME}/.local/share/kxmlgui5/okular
57whitelist ${HOME}/.local/share/okular
58whitelist ${HOME}/.local/share/qpdfview
59whitelist ${HOME}/.local/share/tridactyl
60whitelist ${HOME}/.netrc
61whitelist ${HOME}/.pentadactyl
62whitelist ${HOME}/.pentadactylrc
63whitelist ${HOME}/.tridactylrc
64whitelist ${HOME}/.vimperator
65whitelist ${HOME}/.vimperatorrc
66whitelist ${HOME}/.wine-pipelight
67whitelist ${HOME}/.wine-pipelight64
68whitelist ${HOME}/.zotero
69whitelist ${HOME}/dwhelper
70whitelist /usr/share/lua
71whitelist /usr/share/lua*
72whitelist /usr/share/vulkan
73
74# GNOME Shell integration (chrome-gnome-shell) needs dbus and python
75noblacklist ${HOME}/.local/share/gnome-shell
76whitelist ${HOME}/.local/share/gnome-shell
77dbus-user.talk ca.desrt.dconf
78dbus-user.talk org.gnome.ChromeGnomeShell
79dbus-user.talk org.gnome.Shell
80# Allow python (blacklisted by disable-interpreters.inc)
81include allow-python3.inc
82
83# KeePassXC Browser Integration
84#private-bin keepassxc-proxy
85
86# Flash plugin
87# private-etc must first be enabled in firefox-common.profile and in profiles including it.
88#private-etc adobe
89
90# ff2mpv
91#ignore noexec ${HOME}
92#include allow-lua.inc
93#private-bin env,mpv,python3*,waf,youtube-dl
diff --git a/etc/profile-a-l/firefox-common.profile b/etc/profile-a-l/firefox-common.profile
new file mode 100644
index 000000000..20ae039aa
--- /dev/null
+++ b/etc/profile-a-l/firefox-common.profile
@@ -0,0 +1,64 @@
1# Firejail profile for firefox-common
2# This file is overwritten after every install/update
3# Persistent local customizations
4include firefox-common.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9# noexec ${HOME} breaks DRM binaries.
10?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
11
12# Add the next line to your firefox-common.local to allow access to common programs/addons/plugins.
13#include firefox-common-addons.profile
14
15noblacklist ${HOME}/.pki
16noblacklist ${HOME}/.local/share/pki
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23
24mkdir ${HOME}/.pki
25mkdir ${HOME}/.local/share/pki
26whitelist ${DOWNLOADS}
27whitelist ${HOME}/.pki
28whitelist ${HOME}/.local/share/pki
29include whitelist-common.inc
30include whitelist-run-common.inc
31include whitelist-runuser-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36# machine-id breaks pulse audio; add it to your firefox-common.local if sound is not required.
37#machine-id
38netfilter
39nodvd
40nogroups
41noinput
42nonewprivs
43# noroot breaks GTK_USE_PORTAL=1 usage, see https://github.com/netblue30/firejail/issues/2506.
44noroot
45notv
46?BROWSER_DISABLE_U2F: nou2f
47protocol unix,inet,inet6,netlink
48# The below seccomp configuration still permits chroot syscall. See https://github.com/netblue30/firejail/issues/2506 for possible workarounds.
49seccomp !chroot
50shell none
51# Disable tracelog, it breaks or causes major issues with many firefox based browsers, see https://github.com/netblue30/firejail/issues/1930.
52#tracelog
53
54disable-mnt
55?BROWSER_DISABLE_U2F: private-dev
56# private-etc below works fine on most distributions. There are some problems on CentOS.
57# Add it to your firefox-common.local if you want to enable it.
58#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,group,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
59private-tmp
60
61# 'dbus-user none' breaks various desktop integration features like global menus, native notifications,
62# Gnome connector, KDE connect and power management on KDE Plasma.
63dbus-user none
64dbus-system none
diff --git a/etc/profile-a-l/firefox-developer-edition.profile b/etc/profile-a-l/firefox-developer-edition.profile
new file mode 100644
index 000000000..8c7ca3887
--- /dev/null
+++ b/etc/profile-a-l/firefox-developer-edition.profile
@@ -0,0 +1,11 @@
1# Firejail profile for firefox-developer-edition
2# Description: Developer Edition of the popular Firefox web browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include firefox-developer-edition.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include firefox.profile
diff --git a/etc/firefox-esr.profile b/etc/profile-a-l/firefox-esr.profile
index 9821c7150..5e69fdb51 100644
--- a/etc/firefox-esr.profile
+++ b/etc/profile-a-l/firefox-esr.profile
@@ -1,10 +1,12 @@
1# Firejail profile for firefox-esr 1# Firejail profile for firefox-esr
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/firefox-esr.local 4include firefox-esr.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6# added by included profile
7#include globals.local
7 8
9whitelist /usr/share/firefox-esr
8 10
9# Redirect 11# Redirect
10include /etc/firejail/firefox.profile 12include firefox.profile
diff --git a/etc/firefox-nightly.profile b/etc/profile-a-l/firefox-nightly.profile
index 302f6eb24..96d2bf898 100644
--- a/etc/firefox-nightly.profile
+++ b/etc/profile-a-l/firefox-nightly.profile
@@ -1,10 +1,10 @@
1# Firejail profile for firefox-nightly 1# Firejail profile for firefox-nightly
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/firefox-nightly.local 4include firefox-nightly.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6# added by included profile
7 7#include globals.local
8 8
9# Redirect 9# Redirect
10include /etc/firejail/firefox.profile 10include firefox.profile
diff --git a/etc/profile-a-l/firefox-wayland.profile b/etc/profile-a-l/firefox-wayland.profile
new file mode 100644
index 000000000..17c9f059e
--- /dev/null
+++ b/etc/profile-a-l/firefox-wayland.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for firefox-wayland
2# This file is overwritten after every install/update
3# Persistent local customizations
4include firefox-wayland.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include firefox.profile
diff --git a/etc/profile-a-l/firefox-x11.profile b/etc/profile-a-l/firefox-x11.profile
new file mode 100644
index 000000000..ffd64aad7
--- /dev/null
+++ b/etc/profile-a-l/firefox-x11.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for firefox-x11
2# This file is overwritten after every install/update
3# Persistent local customizations
4include firefox-x11.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include firefox.profile
diff --git a/etc/profile-a-l/firefox.profile b/etc/profile-a-l/firefox.profile
new file mode 100644
index 000000000..9138fed90
--- /dev/null
+++ b/etc/profile-a-l/firefox.profile
@@ -0,0 +1,69 @@
1# Firejail profile for firefox
2# Description: Safe and easy web browser from Mozilla
3# This file is overwritten after every install/update
4# Persistent local customizations
5include firefox.local
6# Persistent global definitions
7include globals.local
8
9# NOTE: sandboxing web browsers is as important as it is complex. Users might be
10# interested in creating custom profiles depending on use case (e.g. one for
11# general browsing, another for banking, ...). Consult our FAQ/issue tracker for more
12# info. Here are a few links to get you going.
13# https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#firefox-doesnt-open-in-a-new-sandbox-instead-it-opens-a-new-tab-in-an-existing-firefox-instance
14# https://github.com/netblue30/firejail/wiki/Frequently-Asked-Questions#how-do-i-run-two-instances-of-firefox
15# https://github.com/netblue30/firejail/issues/4206#issuecomment-824806968
16
17noblacklist ${HOME}/.cache/mozilla
18noblacklist ${HOME}/.mozilla
19noblacklist ${RUNUSER}/*firefox*
20
21blacklist /usr/libexec
22
23mkdir ${HOME}/.cache/mozilla/firefox
24mkdir ${HOME}/.mozilla
25whitelist ${HOME}/.cache/mozilla/firefox
26whitelist ${HOME}/.mozilla
27
28# Add one of the following whitelist options to your firefox.local to enable KeePassXC Plugin support.
29# NOTE: start KeePassXC before Firefox and keep it open to allow communication between them.
30#whitelist ${RUNUSER}/kpxc_server
31#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer
32
33whitelist /usr/share/doc
34whitelist /usr/share/firefox
35whitelist /usr/share/gnome-shell/search-providers/firefox-search-provider.ini
36whitelist /usr/share/gtk-doc/html
37whitelist /usr/share/mozilla
38whitelist /usr/share/webext
39whitelist ${RUNUSER}/*firefox*
40include whitelist-usr-share-common.inc
41
42# firefox requires a shell to launch on Arch - add the next line to your firefox.local to enable private-bin.
43#private-bin bash,dbus-launch,dbus-send,env,firefox,sh,which
44# Fedora uses shell scripts to launch firefox - add the next line to your firefox.local to enable private-bin.
45#private-bin basename,bash,cat,dirname,expr,false,firefox,firefox-wayland,getenforce,ln,mkdir,pidof,restorecon,rm,rmdir,sed,sh,tclsh,true,uname
46# Add the next line to your firefox.local to enable private-etc support - note that this must be enabled in your firefox-common.local too.
47#private-etc firefox
48
49dbus-user filter
50dbus-user.own org.mozilla.Firefox.*
51dbus-user.own org.mozilla.firefox.*
52dbus-user.own org.mpris.MediaPlayer2.firefox.*
53# Add the next line to your firefox.local to enable native notifications.
54#dbus-user.talk org.freedesktop.Notifications
55# Add the next line to your firefox.local to allow inhibiting screensavers.
56#dbus-user.talk org.freedesktop.ScreenSaver
57# Add the next lines to your firefox.local for plasma browser integration.
58#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration
59#dbus-user.talk org.kde.JobViewServer
60#dbus-user.talk org.kde.kuiserver
61# Add the next line to your firefox.local to allow screen sharing under wayland.
62#dbus-user.talk org.freedesktop.portal.Desktop
63# Add the next line to your firefox.local if screen sharing sharing still does not work
64# with the above lines (might depend on the portal implementation).
65#ignore noroot
66ignore dbus-user none
67
68# Redirect
69include firefox-common.profile
diff --git a/etc/profile-a-l/five-or-more.profile b/etc/profile-a-l/five-or-more.profile
new file mode 100644
index 000000000..2c86d3ac7
--- /dev/null
+++ b/etc/profile-a-l/five-or-more.profile
@@ -0,0 +1,21 @@
1# Firejail profile for five-or-more
2# Description: GNOME port of the once-popular Colour Lines game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include five-or-more.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/five-or-more
10
11mkdir ${HOME}/.local/share/five-or-more
12whitelist ${HOME}/.local/share/five-or-more
13
14whitelist /usr/share/five-or-more
15
16private-bin five-or-more
17
18dbus-user.own org.gnome.five-or-more
19
20# Redirect
21include gnome_games-common.profile
diff --git a/etc/profile-a-l/flacsplt.profile b/etc/profile-a-l/flacsplt.profile
new file mode 100644
index 000000000..2efef0f22
--- /dev/null
+++ b/etc/profile-a-l/flacsplt.profile
@@ -0,0 +1,6 @@
1# Firejail profile for flacsplt
2# This file is overwritten after every install/update
3include flacsplt.local
4
5# Redirect
6include mp3splt.profile
diff --git a/etc/profile-a-l/flameshot.profile b/etc/profile-a-l/flameshot.profile
new file mode 100644
index 000000000..e9241efc3
--- /dev/null
+++ b/etc/profile-a-l/flameshot.profile
@@ -0,0 +1,68 @@
1# Firejail profile for flameshot
2# Description: Powerful yet simple-to-use screenshot software
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include flameshot.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${PICTURES}
11noblacklist ${HOME}/.config/Dharkael
12noblacklist ${HOME}/.config/flameshot
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22#mkdir ${HOME}/.config/Dharkael
23#mkdir ${HOME}/.config/flameshot
24#whitelist ${PICTURES}
25#whitelist ${HOME}/.config/Dharkael
26#whitelist ${HOME}/.config/flameshot
27whitelist /usr/share/flameshot
28#include whitelist-common.inc
29include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33caps.drop all
34ipc-namespace
35netfilter
36no3d
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46protocol unix,inet,inet6
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53private-bin flameshot
54private-cache
55private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.conf,machine-id,pki,resolv.conf,ssl
56private-dev
57#private-tmp
58
59dbus-user filter
60dbus-user.own org.dharkael.Flameshot
61dbus-user.own org.flameshot.Flameshot
62dbus-user.talk org.freedesktop.Notifications
63dbus-user.talk org.freedesktop.portal.Desktop
64dbus-user.talk org.gnome.Shell
65dbus-user.talk org.kde.KWin
66dbus-user.talk org.kde.StatusNotifierWatcher
67dbus-user.own org.kde.*
68dbus-system none
diff --git a/etc/profile-a-l/flashpeak-slimjet.profile b/etc/profile-a-l/flashpeak-slimjet.profile
new file mode 100644
index 000000000..310fb378f
--- /dev/null
+++ b/etc/profile-a-l/flashpeak-slimjet.profile
@@ -0,0 +1,22 @@
1# Firejail profile for flashpeak-slimjet
2# This file is overwritten after every install/update
3# Persistent local customizations
4include flashpeak-slimjet.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/slimjet
14noblacklist ${HOME}/.config/slimjet
15
16mkdir ${HOME}/.cache/slimjet
17mkdir ${HOME}/.config/slimjet
18whitelist ${HOME}/.cache/slimjet
19whitelist ${HOME}/.config/slimjet
20
21# Redirect
22include chromium-common.profile
diff --git a/etc/flowblade.profile b/etc/profile-a-l/flowblade.profile
index 79dab0751..bc173d0f1 100644
--- a/etc/flowblade.profile
+++ b/etc/profile-a-l/flowblade.profile
@@ -1,31 +1,38 @@
1# Firejail profile for flowblade 1# Firejail profile for flowblade
2# Description: Non-linear video editor
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/flowblade.local 5include flowblade.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/flowblade 9noblacklist ${HOME}/.config/flowblade
9noblacklist ${HOME}/.flowblade 10noblacklist ${HOME}/.flowblade
10 11
11include /etc/firejail/disable-common.inc 12# Allow python (blacklisted by disable-interpreters.inc)
12include /etc/firejail/disable-devel.inc 13include allow-python2.inc
13include /etc/firejail/disable-passwdmgr.inc 14include allow-python3.inc
14include /etc/firejail/disable-programs.inc 15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
15 21
16caps.drop all 22caps.drop all
17netfilter 23netfilter
18nodvd 24nodvd
19nogroups 25nogroups
26noinput
20nonewprivs 27nonewprivs
21noroot 28noroot
22notv 29notv
30nou2f
23protocol unix,inet,inet6,netlink 31protocol unix,inet,inet6,netlink
24seccomp 32seccomp
25shell none 33shell none
26 34
35private-cache
27private-dev 36private-dev
28private-tmp 37private-tmp
29 38
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/profile-a-l/fluxbox.profile b/etc/profile-a-l/fluxbox.profile
new file mode 100644
index 000000000..1210f365c
--- /dev/null
+++ b/etc/profile-a-l/fluxbox.profile
@@ -0,0 +1,18 @@
1# Firejail profile for fluxbox
2# Description: Standards-compliant, fast, light-weight and extensible window manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include fluxbox.local
6# Persistent global definitions
7include globals.local
8
9# all applications started in fluxbox will run in this profile
10noblacklist ${HOME}/.fluxbox
11include disable-common.inc
12
13caps.drop all
14netfilter
15noroot
16protocol unix,inet,inet6
17seccomp
18
diff --git a/etc/profile-a-l/font-manager.profile b/etc/profile-a-l/font-manager.profile
new file mode 100644
index 000000000..02db368b7
--- /dev/null
+++ b/etc/profile-a-l/font-manager.profile
@@ -0,0 +1,57 @@
1# Firejail profile for font-manager
2# Description: A simple font management application for GTK desktop environments
3# This file is overwritten after every install/update
4# Persistent local customizations
5include font-manager.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/font-manager
10noblacklist ${HOME}/.config/font-manager
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.cache/font-manager
25mkdir ${HOME}/.config/font-manager
26whitelist ${HOME}/.cache/font-manager
27whitelist ${HOME}/.config/font-manager
28whitelist /usr/share/font-manager
29include whitelist-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33apparmor
34caps.drop all
35machine-id
36# net none - issues on older versions
37no3d
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix
48seccomp
49shell none
50tracelog
51
52disable-mnt
53private-bin font-manager,python*,yelp
54private-dev
55private-tmp
56
57#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/fontforge.profile b/etc/profile-a-l/fontforge.profile
new file mode 100644
index 000000000..6020464b3
--- /dev/null
+++ b/etc/profile-a-l/fontforge.profile
@@ -0,0 +1,41 @@
1# Firejail profile for fontforge
2# Description: Font editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include fontforge.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.FontForge
10noblacklist ${DOCUMENTS}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23caps.drop all
24netfilter
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37
38private-cache
39private-dev
40private-tmp
41
diff --git a/etc/profile-a-l/fossamail.profile b/etc/profile-a-l/fossamail.profile
new file mode 100644
index 000000000..2d700d336
--- /dev/null
+++ b/etc/profile-a-l/fossamail.profile
@@ -0,0 +1,23 @@
1# Firejail profile for fossamail
2# This file is overwritten after every install/update
3# Persistent local customizations
4include fossamail.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/fossamail
10noblacklist ${HOME}/.fossamail
11noblacklist ${HOME}/.gnupg
12
13mkdir ${HOME}/.cache/fossamail
14mkdir ${HOME}/.fossamail
15mkdir ${HOME}/.gnupg
16whitelist ${HOME}/.cache/fossamail
17whitelist ${HOME}/.fossamail
18whitelist ${HOME}/.gnupg
19include whitelist-common.inc
20
21# allow browsers
22# Redirect
23include firefox.profile
diff --git a/etc/profile-a-l/four-in-a-row.profile b/etc/profile-a-l/four-in-a-row.profile
new file mode 100644
index 000000000..eb0c43ca5
--- /dev/null
+++ b/etc/profile-a-l/four-in-a-row.profile
@@ -0,0 +1,19 @@
1# Firejail profile for four-in-a-row
2# Description: four-in-a-row game for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include four-in-a-row.local
6# Persistent global definitions
7include globals.local
8
9ignore machine-id
10ignore nosound
11
12whitelist /usr/share/four-in-a-row
13
14private-bin four-in-a-row
15
16dbus-user.own org.gnome.Four-in-a-row
17
18# Redirect
19include gnome_games-common.profile
diff --git a/etc/profile-a-l/fractal.profile b/etc/profile-a-l/fractal.profile
new file mode 100644
index 000000000..265eec1ca
--- /dev/null
+++ b/etc/profile-a-l/fractal.profile
@@ -0,0 +1,58 @@
1# Firejail profile for fractal
2# Description: Desktop client for Matrix
3# This file is overwritten after every install/update
4# Persistent local customizations
5include fractal.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/fractal
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.cache/fractal
24whitelist ${HOME}/.cache/fractal
25whitelist ${DOWNLOADS}
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41protocol unix,inet,inet6
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private-bin fractal
48private-cache
49private-dev
50private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
51private-tmp
52
53dbus-user filter
54dbus-user.own org.gnome.Fractal
55dbus-user.talk ca.desrt.dconf
56dbus-user.talk org.freedesktop.Notifications
57dbus-user.talk org.freedesktop.secrets
58dbus-system none
diff --git a/etc/profile-a-l/franz.profile b/etc/profile-a-l/franz.profile
new file mode 100644
index 000000000..9b780a572
--- /dev/null
+++ b/etc/profile-a-l/franz.profile
@@ -0,0 +1,47 @@
1# Firejail profile for franz
2# This file is overwritten after every install/update
3# Persistent local customizations
4include franz.local
5# Persistent global definitions
6include globals.local
7
8ignore noexec /tmp
9
10noblacklist ${HOME}/.cache/Franz
11noblacklist ${HOME}/.config/Franz
12noblacklist ${HOME}/.pki
13noblacklist ${HOME}/.local/share/pki
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.cache/Franz
22mkdir ${HOME}/.config/Franz
23mkdir ${HOME}/.pki
24mkdir ${HOME}/.local/share/pki
25whitelist ${DOWNLOADS}
26whitelist ${HOME}/.cache/Franz
27whitelist ${HOME}/.config/Franz
28whitelist ${HOME}/.pki
29whitelist ${HOME}/.local/share/pki
30include whitelist-common.inc
31
32caps.drop all
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41protocol unix,inet,inet6,netlink
42seccomp !chroot
43shell none
44
45disable-mnt
46private-dev
47private-tmp
diff --git a/etc/profile-a-l/freecad.profile b/etc/profile-a-l/freecad.profile
new file mode 100644
index 000000000..827dc8be9
--- /dev/null
+++ b/etc/profile-a-l/freecad.profile
@@ -0,0 +1,45 @@
1# Firejail profile for freecad
2# Description: Extensible Open Source CAx program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freecad.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/FreeCAD
10noblacklist ${DOCUMENTS}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23caps.drop all
24ipc-namespace
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38
39private-bin freecad,freecadcmd,python*
40private-cache
41private-dev
42private-tmp
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-a-l/freecadcmd.profile b/etc/profile-a-l/freecadcmd.profile
new file mode 100644
index 000000000..2b2cdae29
--- /dev/null
+++ b/etc/profile-a-l/freecadcmd.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for freecad
2# This file is overwritten after every install/update
3# Persistent local customizations
4include freecadcms.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include freecad.profile
diff --git a/etc/profile-a-l/freeciv-gtk3.profile b/etc/profile-a-l/freeciv-gtk3.profile
new file mode 100644
index 000000000..bf034a709
--- /dev/null
+++ b/etc/profile-a-l/freeciv-gtk3.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for freeciv
2# This file is overwritten after every install/update
3# Persistent local customizations
4include freeciv-gtk3.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include freeciv.profile
diff --git a/etc/profile-a-l/freeciv-mp-gtk3.profile b/etc/profile-a-l/freeciv-mp-gtk3.profile
new file mode 100644
index 000000000..942058fa6
--- /dev/null
+++ b/etc/profile-a-l/freeciv-mp-gtk3.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for freeciv
2# This file is overwritten after every install/update
3# Persistent local customizations
4include freeciv-mp-gtk3.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include freeciv.profile
diff --git a/etc/profile-a-l/freeciv.profile b/etc/profile-a-l/freeciv.profile
new file mode 100644
index 000000000..5126e2d37
--- /dev/null
+++ b/etc/profile-a-l/freeciv.profile
@@ -0,0 +1,47 @@
1# Firejail profile for freeciv
2# Description: A multi-player strategy game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freeciv.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.freeciv
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.freeciv
19whitelist ${HOME}/.freeciv
20include whitelist-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private-bin freeciv-gtk3,freeciv-manual,freeciv-mp-gtk3,freeciv-server
42private-cache
43private-dev
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-a-l/freecol.profile b/etc/profile-a-l/freecol.profile
new file mode 100644
index 000000000..4467b5869
--- /dev/null
+++ b/etc/profile-a-l/freecol.profile
@@ -0,0 +1,58 @@
1# Firejail profile for freecol
2# Description: Turn-based multi-player strategy game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freecol.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.freecol
10noblacklist ${HOME}/.cache/freecol
11noblacklist ${HOME}/.config/freecol
12noblacklist ${HOME}/.local/share/freecol
13
14# Allow java (blacklisted by disable-devel.inc)
15include allow-java.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.java
25mkdir ${HOME}/.cache/freecol
26mkdir ${HOME}/.config/freecol
27mkdir ${HOME}/.local/share/freecol
28whitelist ${HOME}/.freecol
29whitelist ${HOME}/.java
30whitelist ${HOME}/.cache/freecol
31whitelist ${HOME}/.config/freecol
32whitelist ${HOME}/.local/share/freecol
33include whitelist-common.inc
34include whitelist-var-common.inc
35
36caps.drop all
37ipc-namespace
38netfilter
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44notv
45nou2f
46novideo
47protocol unix,inet,inet6
48seccomp
49shell none
50tracelog
51
52disable-mnt
53private-cache
54private-dev
55private-tmp
56
57dbus-user none
58dbus-system none
diff --git a/etc/profile-a-l/freemind.profile b/etc/profile-a-l/freemind.profile
new file mode 100644
index 000000000..fbe3d45e3
--- /dev/null
+++ b/etc/profile-a-l/freemind.profile
@@ -0,0 +1,53 @@
1# Firejail profile for freemind
2# Description: Free mind mapping software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freemind.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${HOME}/.freemind
11
12# Allow java (blacklisted by disable-devel.inc)
13include allow-java.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26machine-id
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin bash,cp,dirname,dpkg,echo,freemind,grep,java,lsb_release,mkdir,readlink,rpm,sed,sh,uname,which
45private-cache
46private-dev
47#private-etc alternatives,fonts,java
48private-tmp
49private-opt none
50private-srv none
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-a-l/freeoffice-planmaker.profile b/etc/profile-a-l/freeoffice-planmaker.profile
new file mode 100644
index 000000000..b6ca167eb
--- /dev/null
+++ b/etc/profile-a-l/freeoffice-planmaker.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for freeoffice-planmaker
2# Description: SoftMaker FreeOffice - spreadsheet program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freeoffice-planmaker.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
diff --git a/etc/profile-a-l/freeoffice-presentations.profile b/etc/profile-a-l/freeoffice-presentations.profile
new file mode 100644
index 000000000..43661028c
--- /dev/null
+++ b/etc/profile-a-l/freeoffice-presentations.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for freeoffice-presentations
2# Description: SoftMaker FreeOffice - presentations software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freeoffice-presentations.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
diff --git a/etc/profile-a-l/freeoffice-textmaker.profile b/etc/profile-a-l/freeoffice-textmaker.profile
new file mode 100644
index 000000000..f7d30eaed
--- /dev/null
+++ b/etc/profile-a-l/freeoffice-textmaker.profile
@@ -0,0 +1,9 @@
1# Firejail profile alias for freeoffice-textmaker
2# Description: SoftMaker Office - word processor
3# This file is overwritten after every install/update
4include freeoffice-textmaker.local
5# Persistent global definitions
6include globals.local
7
8# Redirect
9include softmaker-common.profile
diff --git a/etc/profile-a-l/freetube.profile b/etc/profile-a-l/freetube.profile
new file mode 100644
index 000000000..7beb2bcba
--- /dev/null
+++ b/etc/profile-a-l/freetube.profile
@@ -0,0 +1,22 @@
1# Firejail profile for freetube
2# Description: Youtube client with local subscription feature
3# This file is overwritten after every install/update
4# Persistent local customizations
5include freetube.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/FreeTube
10
11include allow-bin-sh.inc
12
13include disable-shell.inc
14
15mkdir ${HOME}/.config/FreeTube
16whitelist ${HOME}/.config/FreeTube
17
18private-bin electron,electron[0-9],electron[0-9][0-9],freetube,sh
19private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,pki,pulse,resolv.conf,ssl,X11,xdg
20
21# Redirect
22include electron.profile
diff --git a/etc/freshclam.profile b/etc/profile-a-l/freshclam.profile
index 08eac5595..6382b80af 100644
--- a/etc/freshclam.profile
+++ b/etc/profile-a-l/freshclam.profile
@@ -2,10 +2,11 @@
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3quiet 3quiet
4# Persistent local customizations 4# Persistent local customizations
5include /etc/firejail/clamav.local 5include clamav.local
6# Persistent global definitions 6# Persistent global definitions
7include /etc/firejail/globals.local 7include globals.local
8 8
9include disable-exec.inc
9 10
10caps.keep setgid,setuid 11caps.keep setgid,setuid
11ipc-namespace 12ipc-namespace
@@ -13,9 +14,11 @@ netfilter
13no3d 14no3d
14nodvd 15nodvd
15nogroups 16nogroups
17noinput
16nonewprivs 18nonewprivs
17nosound 19nosound
18notv 20notv
21nou2f
19novideo 22novideo
20protocol unix,inet,inet6 23protocol unix,inet,inet6
21seccomp 24seccomp
@@ -24,11 +27,10 @@ tracelog
24 27
25disable-mnt 28disable-mnt
26private 29private
30private-cache
27private-dev 31private-dev
28private-tmp 32private-tmp
29writable-var 33writable-var
30writable-var-log 34writable-var-log
31 35
32memory-deny-write-execute 36memory-deny-write-execute
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/profile-a-l/frogatto.profile b/etc/profile-a-l/frogatto.profile
new file mode 100644
index 000000000..fa08b4956
--- /dev/null
+++ b/etc/profile-a-l/frogatto.profile
@@ -0,0 +1,52 @@
1# Firejail profile for frogatto
2# Description: 2D platformer game starring a quixotic frog
3# This file is overwritten after every install/update
4# Persistent local customizations
5include frogatto.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.frogatto
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.frogatto
19whitelist ${HOME}/.frogatto
20whitelist /usr/libexec/frogatto
21whitelist /usr/share/frogatto
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin frogatto,sh
46private-cache
47private-dev
48private-etc machine-id
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-a-l/frozen-bubble.profile b/etc/profile-a-l/frozen-bubble.profile
new file mode 100644
index 000000000..bb35c9447
--- /dev/null
+++ b/etc/profile-a-l/frozen-bubble.profile
@@ -0,0 +1,50 @@
1# Firejail profile for frozen-bubble
2# Description: Cool game where you pop out the bubbles
3# This file is overwritten after every install/update
4# Persistent local customizations
5include frozen-bubble.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.frozen-bubble
10
11# Allow perl (blacklisted by disable-interpreters.inc)
12include allow-perl.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.frozen-bubble
22whitelist ${HOME}/.frozen-bubble
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30net none
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,netlink
40seccomp
41shell none
42tracelog
43
44disable-mnt
45# private-bin frozen-bubble
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-a-l/funnyboat.profile b/etc/profile-a-l/funnyboat.profile
new file mode 100644
index 000000000..1009f345b
--- /dev/null
+++ b/etc/profile-a-l/funnyboat.profile
@@ -0,0 +1,56 @@
1# Firejail profile for funnyboat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include funnyboat.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.funnyboat
9
10ignore noexec /dev/shm
11include allow-python2.inc
12include allow-python3.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19# include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.funnyboat
23whitelist ${HOME}/.funnyboat
24include whitelist-common.inc
25include whitelist-runuser-common.inc
26whitelist /usr/share/funnyboat
27# Debian:
28whitelist /usr/share/games/funnyboat
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34ipc-namespace
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41notv
42novideo
43protocol unix,inet,inet6
44seccomp
45shell none
46# tracelog
47
48disable-mnt
49private-cache
50private-dev
51private-tmp
52
53dbus-user none
54dbus-system none
55
56memory-deny-write-execute
diff --git a/etc/profile-a-l/gajim-history-manager.profile b/etc/profile-a-l/gajim-history-manager.profile
new file mode 100644
index 000000000..945dea146
--- /dev/null
+++ b/etc/profile-a-l/gajim-history-manager.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for gajim-history-manager
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gajim-history-manager.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include gajim.profile
diff --git a/etc/profile-a-l/gajim.profile b/etc/profile-a-l/gajim.profile
new file mode 100644
index 000000000..b0d017db9
--- /dev/null
+++ b/etc/profile-a-l/gajim.profile
@@ -0,0 +1,79 @@
1# Firejail profile for gajim
2# Description: GTK+-based Jabber client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gajim.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.gnupg
10noblacklist ${HOME}/.cache/gajim
11noblacklist ${HOME}/.config/gajim
12noblacklist ${HOME}/.local/share/gajim
13
14# Allow python (blacklisted by disable-interpreters.inc)
15#include allow-python2.inc
16include allow-python3.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23# Add 'ignore include disable-xdg.inc' to your gajim.local if you need to whitelist folders other than ~/Downloads.
24include disable-xdg.inc
25
26mkdir ${HOME}/.gnupg
27mkdir ${HOME}/.cache/gajim
28mkdir ${HOME}/.config/gajim
29mkdir ${HOME}/.local/share/gajim
30whitelist ${HOME}/.gnupg
31whitelist ${HOME}/.cache/gajim
32whitelist ${HOME}/.config/gajim
33whitelist ${HOME}/.local/share/gajim
34whitelist ${DOWNLOADS}
35whitelist ${RUNUSER}/gnupg
36whitelist /usr/share/gnupg
37whitelist /usr/share/gnupg2
38include whitelist-common.inc
39include whitelist-runuser-common.inc
40include whitelist-usr-share-common.inc
41include whitelist-var-common.inc
42
43apparmor
44caps.drop all
45netfilter
46nodvd
47nogroups
48noinput
49nonewprivs
50noroot
51notv
52nou2f
53protocol unix,inet,inet6,netlink
54seccomp
55shell none
56tracelog
57
58disable-mnt
59private-bin bash,gajim,gajim-history-manager,gpg,gpg2,paplay,python*,sh,zsh
60private-cache
61private-dev
62private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,group,hostname,hosts,ld.so.cache,ld.so.conf,localtime,machine-id,passwd,pki,pulse,resolv.conf,ssl,xdg
63private-tmp
64writable-run-user
65
66dbus-user filter
67dbus-user.own org.gajim.Gajim
68dbus-user.talk org.gnome.Mutter.IdleMonitor
69dbus-user.talk ca.desrt.dconf
70dbus-user.talk org.freedesktop.Notifications
71dbus-user.talk org.freedesktop.secrets
72dbus-user.talk org.kde.kwalletd5
73dbus-user.talk org.mpris.MediaPlayer2.*
74dbus-system filter
75dbus-system.talk org.freedesktop.login1
76# Add the next line to your gajim.local to enable location plugin support.
77#dbus-system.talk org.freedesktop.GeoClue2
78
79join-or-start gajim
diff --git a/etc/profile-a-l/galculator.profile b/etc/profile-a-l/galculator.profile
new file mode 100644
index 000000000..50b1c319c
--- /dev/null
+++ b/etc/profile-a-l/galculator.profile
@@ -0,0 +1,53 @@
1# Firejail profile for galculator
2# Description: Scientific calculator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include galculator.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/galculator
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/galculator
20whitelist ${HOME}/.config/galculator
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26#hostname galculator - breaks Arch Linux
27#ipc-namespace
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43private-bin galculator
44private-cache
45private-dev
46private-etc alternatives,fonts
47private-lib
48private-tmp
49
50dbus-user none
51dbus-system none
52
53#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-a-l/gallery-dl.profile b/etc/profile-a-l/gallery-dl.profile
new file mode 100644
index 000000000..9c8200dc4
--- /dev/null
+++ b/etc/profile-a-l/gallery-dl.profile
@@ -0,0 +1,18 @@
1# Firejail profile for gallery-dl
2# Description: Downloader of images from various sites
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gallery-dl.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11noblacklist ${HOME}/.config/gallery-dl
12noblacklist ${HOME}/.gallery-dl.conf
13
14private-bin gallery-dl
15private-etc gallery-dl.conf
16
17# Redirect
18include youtube-dl.profile
diff --git a/etc/profile-a-l/gapplication.profile b/etc/profile-a-l/gapplication.profile
new file mode 100644
index 000000000..8263423a0
--- /dev/null
+++ b/etc/profile-a-l/gapplication.profile
@@ -0,0 +1,73 @@
1# Firejail profile for gapplication
2# Description: D-Bus application launcher
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gapplication.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10blacklist /usr/libexec
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20include whitelist-common.inc
21include whitelist-runuser-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27ipc-namespace
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42seccomp.block-secondary
43shell none
44tracelog
45x11 none
46
47disable-mnt
48private
49private-bin gapplication
50private-cache
51private-dev
52private-etc none
53private-tmp
54
55# Add the next line to your gapplication.local to filter D-Bus names.
56# You might need to add additional dbus-user.talk rules (see 'gapplication list-apps').
57#dbus-user filter
58dbus-user.talk org.gnome.Boxes
59dbus-user.talk org.gnome.Builder
60dbus-user.talk org.gnome.Calendar
61dbus-user.talk org.gnome.ChromeGnomeShell
62dbus-user.talk org.gnome.DejaDup
63dbus-user.talk org.gnome.DiskUtility
64dbus-user.talk org.gnome.Extensions
65dbus-user.talk org.gnome.Maps
66dbus-user.talk org.gnome.Nautilus
67dbus-user.talk org.gnome.Shell.PortalHelper
68dbus-user.talk org.gnome.Software
69dbus-user.talk org.gnome.Weather
70dbus-system none
71
72memory-deny-write-execute
73read-only ${HOME}
diff --git a/etc/profile-a-l/gcalccmd.profile b/etc/profile-a-l/gcalccmd.profile
new file mode 100644
index 000000000..691d6b0c4
--- /dev/null
+++ b/etc/profile-a-l/gcalccmd.profile
@@ -0,0 +1,13 @@
1# Firejail profile for gcalccmd
2# Description: GNOME console calculator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gcalccmd.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10private-bin gcalccmd
11
12# Redirect
13include gnome-calculator.profile
diff --git a/etc/profile-a-l/gcloud.profile b/etc/profile-a-l/gcloud.profile
new file mode 100644
index 000000000..388f4c0df
--- /dev/null
+++ b/etc/profile-a-l/gcloud.profile
@@ -0,0 +1,43 @@
1# Firejail profile for gcloud
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gcloud.local
5# Persistent global definitions
6include globals.local
7
8# noexec ${HOME} will break user-local installs of gcloud tooling
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.boto
12noblacklist ${HOME}/.config/gcloud
13noblacklist /var/run/docker.sock
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-programs.inc
19
20apparmor
21caps.drop all
22machine-id
23netfilter
24nodvd
25# required for sudo-free docker
26#nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37disable-mnt
38private-dev
39private-etc alternatives,ca-certificates,crypto-policies,hosts,ld.so.cache,localtime,nsswitch.conf,pki,resolv.conf,ssl
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/profile-a-l/gconf-editor.profile b/etc/profile-a-l/gconf-editor.profile
new file mode 100644
index 000000000..cb39174e5
--- /dev/null
+++ b/etc/profile-a-l/gconf-editor.profile
@@ -0,0 +1,17 @@
1# Firejail profile for gconf-editor
2# Description: Graphical gconf registry editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gconf-editor.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10blacklist /tmp/.X11-unix
11
12whitelist /usr/share/gconf-editor
13
14ignore x11 none
15
16# Redirect
17include gconf.profile
diff --git a/etc/profile-a-l/gconf-merge-schema.profile b/etc/profile-a-l/gconf-merge-schema.profile
new file mode 100644
index 000000000..619f801b0
--- /dev/null
+++ b/etc/profile-a-l/gconf-merge-schema.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gconf-merge-schema
2# Description: An obsolete configuration database system (CLI utility)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gconf-merge-schema.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gconf.profile
diff --git a/etc/profile-a-l/gconf-merge-tree.profile b/etc/profile-a-l/gconf-merge-tree.profile
new file mode 100644
index 000000000..2f6bfe5e5
--- /dev/null
+++ b/etc/profile-a-l/gconf-merge-tree.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gconf-merge-tree
2# Description: An obsolete configuration database system (CLI utility)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gconf-merge-tree.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gconf.profile
diff --git a/etc/profile-a-l/gconf.profile b/etc/profile-a-l/gconf.profile
new file mode 100644
index 000000000..b01d88f80
--- /dev/null
+++ b/etc/profile-a-l/gconf.profile
@@ -0,0 +1,61 @@
1# Firejail profile for gconf
2# Description: An obsolete configuration database system
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gconf.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11noblacklist ${HOME}/.config/gconf
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15#include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.config/gconf
25whitelist ${HOME}/.config/gconf
26whitelist /usr/share/GConf
27whitelist /usr/share/gconf
28include whitelist-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34ipc-namespace
35machine-id
36net none
37no3d
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix
48seccomp
49shell none
50tracelog
51x11 none
52
53disable-mnt
54private-bin gconf-editor,gconf-merge-*,gconfpkg,gconftool-2,gsettings-*-convert,python2*
55private-cache
56private-dev
57private-etc alternatives,fonts,gconf
58private-lib GConf,libpython*,python2*
59private-tmp
60
61memory-deny-write-execute
diff --git a/etc/profile-a-l/gconfpkg.profile b/etc/profile-a-l/gconfpkg.profile
new file mode 100644
index 000000000..5bfc1250a
--- /dev/null
+++ b/etc/profile-a-l/gconfpkg.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gconfpkg
2# Description: An obsolete configuration database system (CLI utility)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gconfpkg.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gconf.profile
diff --git a/etc/profile-a-l/gconftool-2.profile b/etc/profile-a-l/gconftool-2.profile
new file mode 100644
index 000000000..947e4252f
--- /dev/null
+++ b/etc/profile-a-l/gconftool-2.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gconftool-2
2# Description: An obsolete configuration database system (CLI utility)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gconftool-2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gconf.profile
diff --git a/etc/geany.profile b/etc/profile-a-l/geany.profile
index 35e405319..f244cb526 100644
--- a/etc/geany.profile
+++ b/etc/profile-a-l/geany.profile
@@ -1,29 +1,35 @@
1# Firejail profile for geany 1# Firejail profile for geany
2# Description: Fast and lightweight IDE
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/geany.local 5include geany.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/geany 9noblacklist ${HOME}/.config/geany
9 10
10include /etc/firejail/disable-common.inc 11# Allows files commonly used by IDEs
11include /etc/firejail/disable-passwdmgr.inc 12include allow-common-devel.inc
12include /etc/firejail/disable-programs.inc 13
14include disable-common.inc
15include disable-programs.inc
13 16
14caps.drop all 17caps.drop all
15netfilter 18netfilter
16no3d 19no3d
17nodvd 20nodvd
18nogroups 21nogroups
22noinput
19nonewprivs 23nonewprivs
20noroot 24noroot
21nosound 25nosound
22notv 26notv
27nou2f
23novideo 28novideo
24protocol unix,inet,inet6 29protocol unix,inet,inet6
25seccomp 30seccomp
26shell none 31shell none
27 32
33private-cache
28private-dev 34private-dev
29private-tmp 35private-tmp
diff --git a/etc/profile-a-l/geary.profile b/etc/profile-a-l/geary.profile
new file mode 100644
index 000000000..29c620556
--- /dev/null
+++ b/etc/profile-a-l/geary.profile
@@ -0,0 +1,86 @@
1# Firejail profile for geary
2# Description: Lightweight email client designed for the GNOME desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include geary.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/evolution
10noblacklist ${HOME}/.cache/folks
11noblacklist ${HOME}/.cache/geary
12noblacklist ${HOME}/.config/evolution
13noblacklist ${HOME}/.config/geary
14noblacklist ${HOME}/.local/share/evolution
15noblacklist ${HOME}/.local/share/geary
16noblacklist ${HOME}/.mozilla
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/.cache/evolution
27mkdir ${HOME}/.cache/folks
28mkdir ${HOME}/.cache/geary
29mkdir ${HOME}/.config/evolution
30mkdir ${HOME}/.config/geary
31mkdir ${HOME}/.local/share/evolution
32mkdir ${HOME}/.local/share/geary
33whitelist ${DOWNLOADS}
34whitelist ${HOME}/.cache/evolution
35whitelist ${HOME}/.cache/folks
36whitelist ${HOME}/.cache/geary
37whitelist ${HOME}/.config/evolution
38whitelist ${HOME}/.config/geary
39whitelist ${HOME}/.local/share/evolution
40whitelist ${HOME}/.local/share/geary
41whitelist ${HOME}/.mozilla/firefox/profiles.ini
42whitelist /usr/share/geary
43include whitelist-common.inc
44include whitelist-runuser-common.inc
45include whitelist-usr-share-common.inc
46include whitelist-var-common.inc
47
48apparmor
49caps.drop all
50machine-id
51netfilter
52no3d
53nodvd
54nogroups
55noinput
56nonewprivs
57noroot
58nosound
59notv
60nou2f
61novideo
62protocol unix,inet,inet6
63seccomp
64seccomp.block-secondary
65shell none
66tracelog
67
68# disable-mnt
69# Add 'ignore private-bin' to geary.local for hyperlink support
70private-bin geary
71private-cache
72private-dev
73private-etc alternatives,ca-certificates,crypto-policies,fonts,hostname,hosts,pki,resolv.conf,ssl,xdg
74private-tmp
75
76dbus-user filter
77dbus-user.own org.gnome.Geary
78dbus-user.talk ca.desrt.dconf
79dbus-user.talk org.freedesktop.secrets
80dbus-user.talk org.gnome.Contacts
81dbus-user.talk org.gnome.OnlineAccounts
82dbus-user.talk org.gnome.evolution.dataserver.AddressBook10
83dbus-user.talk org.gnome.evolution.dataserver.Sources5
84dbus-system none
85
86read-only ${HOME}/.mozilla/firefox/profiles.ini
diff --git a/etc/profile-a-l/gedit.profile b/etc/profile-a-l/gedit.profile
new file mode 100644
index 000000000..0726d17bd
--- /dev/null
+++ b/etc/profile-a-l/gedit.profile
@@ -0,0 +1,52 @@
1# Firejail profile for gedit
2# Description: Official text editor of the GNOME desktop environment
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gedit.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/enchant
10noblacklist ${HOME}/.config/gedit
11
12# Allows files commonly used by IDEs
13include allow-common-devel.inc
14
15include disable-common.inc
16# include disable-devel.inc
17include disable-exec.inc
18# include disable-interpreters.inc
19include disable-programs.inc
20
21include whitelist-runuser-common.inc
22include whitelist-var-common.inc
23
24# apparmor - makes settings immutable
25caps.drop all
26machine-id
27# net none - makes settings immutable
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44# private-bin gedit
45private-dev
46# private-lib breaks python plugins - add the next line to your gedit.local if you don't use them.
47#private-lib aspell,gconv,gedit,libgspell-1.so.*,libgtksourceview-*,libpeas-gtk-1.0.so.*,libreadline.so.*,libtinfo.so.*
48private-tmp
49
50# makes settings immutable
51# dbus-user none
52# dbus-system none
diff --git a/etc/profile-a-l/geekbench.profile b/etc/profile-a-l/geekbench.profile
new file mode 100644
index 000000000..f0e17963c
--- /dev/null
+++ b/etc/profile-a-l/geekbench.profile
@@ -0,0 +1,54 @@
1# Firejail profile for geekbench
2# Description: A cross-platform benchmark that measures processor and memory performance
3# This file is overwritten after every install/update
4# Persistent local customizations
5include geekbench.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-xdg.inc
15
16include whitelist-common.inc
17include whitelist-usr-share-common.inc
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22hostname geekbench
23ipc-namespace
24machine-id
25netfilter
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,inet,inet6
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin bash,geekbenc*,sh
43private-cache
44private-dev
45private-etc alternatives,group,lsb-release,passwd
46private-lib gcc/*/*/libstdc++.so.*
47private-opt none
48private-tmp
49
50dbus-user none
51dbus-system none
52
53#memory-deny-write-execute - breaks on Arch (see issue #1803)
54read-only ${HOME}
diff --git a/etc/profile-a-l/geeqie.profile b/etc/profile-a-l/geeqie.profile
new file mode 100644
index 000000000..fbb509d89
--- /dev/null
+++ b/etc/profile-a-l/geeqie.profile
@@ -0,0 +1,33 @@
1# Firejail profile for geeqie
2# Description: Image viewer using GTK+
3# This file is overwritten after every install/update
4# Persistent local customizations
5include geeqie.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/geeqie
10noblacklist ${HOME}/.config/geeqie
11noblacklist ${HOME}/.local/share/geeqie
12
13include disable-common.inc
14include disable-devel.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18caps.drop all
19nodvd
20nogroups
21noinput
22nonewprivs
23noroot
24nosound
25notv
26nou2f
27novideo
28protocol unix
29seccomp
30shell none
31
32# private-bin geeqie
33private-dev
diff --git a/etc/profile-a-l/gfeeds.profile b/etc/profile-a-l/gfeeds.profile
new file mode 100644
index 000000000..388f6496d
--- /dev/null
+++ b/etc/profile-a-l/gfeeds.profile
@@ -0,0 +1,70 @@
1# Firejail profile for gfeeds
2# Description: RSS/Atom feed reader for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gfeeds.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/gfeeds
10noblacklist ${HOME}/.cache/org.gabmus.gfeeds
11noblacklist ${HOME}/.config/org.gabmus.gfeeds.json
12noblacklist ${HOME}/.config/org.gabmus.gfeeds.saved_articles
13
14# Allow python (blacklisted by disable-interpreters.inc)
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25mkdir ${HOME}/.cache/gfeeds
26mkdir ${HOME}/.cache/org.gabmus.gfeeds
27mkfile ${HOME}/.config/org.gabmus.gfeeds.json
28mkdir ${HOME}/.config/org.gabmus.gfeeds.saved_articles
29whitelist ${HOME}/.cache/gfeeds
30whitelist ${HOME}/.cache/org.gabmus.gfeeds
31whitelist ${HOME}/.config/org.gabmus.gfeeds.json
32whitelist ${HOME}/.config/org.gabmus.gfeeds.saved_articles
33whitelist /usr/libexec/webkit2gtk-4.0
34whitelist /usr/share/gfeeds
35include whitelist-common.inc
36include whitelist-runuser-common.inc
37include whitelist-usr-share-common.inc
38include whitelist-var-common.inc
39
40apparmor
41caps.drop all
42machine-id
43netfilter
44no3d
45nodvd
46nogroups
47noinput
48nonewprivs
49noroot
50nosound
51notv
52nou2f
53novideo
54protocol unix,inet,inet6
55seccomp
56seccomp.block-secondary
57shell none
58tracelog
59
60disable-mnt
61private-bin gfeeds,python3*
62# private-cache -- feeds are stored in ~/.cache
63private-dev
64private-etc alternatives,ca-certificates,crypto-policies,dbus-1,dconf,fonts,gconf,group,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,passwd,pki,protocols,resolv.conf,rpc,services,ssl,X11,xdg
65private-tmp
66
67dbus-user filter
68dbus-user.own org.gabmus.gfeeds
69dbus-user.talk ca.desrt.dconf
70dbus-system none
diff --git a/etc/profile-a-l/gget.profile b/etc/profile-a-l/gget.profile
new file mode 100644
index 000000000..b2adaa8e4
--- /dev/null
+++ b/etc/profile-a-l/gget.profile
@@ -0,0 +1,59 @@
1# Firejail profile for gget
2# Description: a cli. to get things. from git repos
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gget.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21whitelist ${DOWNLOADS}
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31netfilter
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol inet,inet6
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48disable-mnt
49private-bin gget
50private-cache
51private-dev
52private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl
53private-lib
54private-tmp
55
56dbus-user none
57dbus-system none
58
59memory-deny-write-execute
diff --git a/etc/profile-a-l/ghb.profile b/etc/profile-a-l/ghb.profile
new file mode 100644
index 000000000..c65d7e709
--- /dev/null
+++ b/etc/profile-a-l/ghb.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for handbrake
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ghb.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include handbrake.profile
diff --git a/etc/profile-a-l/ghostwriter.profile b/etc/profile-a-l/ghostwriter.profile
new file mode 100644
index 000000000..3dfdc0184
--- /dev/null
+++ b/etc/profile-a-l/ghostwriter.profile
@@ -0,0 +1,59 @@
1# Firejail profile for ghostwriter
2# Description: Cross-platform, aesthetic, distraction-free Markdown editor.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ghostwriter.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/ghostwriter
10noblacklist ${HOME}/.local/share/ghostwriter
11noblacklist ${DOCUMENTS}
12noblacklist ${PICTURES}
13
14include allow-lua.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24whitelist /usr/share/ghostwriter
25whitelist /usr/share/mozilla-dicts
26whitelist /usr/share/texlive
27whitelist /usr/share/pandoc*
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6,netlink
46seccomp !chroot
47seccomp.block-secondary
48shell none
49#tracelog -- breaks
50
51private-bin context,gettext,ghostwriter,latex,mktexfmt,pandoc,pdflatex,pdfroff,prince,weasyprint,wkhtmltopdf
52private-cache
53private-dev
54# passwd,login.defs,firejail are a temporary workaround for #2877 and can be removed once it is fixed
55private-etc alternatives,ca-certificates,crypto-policies,dbus-1,dconf,firejail,fonts,gconf,groups,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,login.defs,machine-id,mime.types,nsswitch.conf,pango,passwd,pki,protocols,resolv.conf,rpc,services,ssl,texlive,Trolltech.conf,X11,xdg
56private-tmp
57
58dbus-user filter
59dbus-system none
diff --git a/etc/profile-a-l/gimp-2.10.profile b/etc/profile-a-l/gimp-2.10.profile
new file mode 100644
index 000000000..ea099b0a5
--- /dev/null
+++ b/etc/profile-a-l/gimp-2.10.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for gimp
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gimp-2.10.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include gimp.profile
diff --git a/etc/profile-a-l/gimp-2.8.profile b/etc/profile-a-l/gimp-2.8.profile
new file mode 100644
index 000000000..af0793c58
--- /dev/null
+++ b/etc/profile-a-l/gimp-2.8.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for gimp
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gimp-2.8.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include gimp.profile
diff --git a/etc/profile-a-l/gimp.profile b/etc/profile-a-l/gimp.profile
new file mode 100644
index 000000000..df9c2ac7a
--- /dev/null
+++ b/etc/profile-a-l/gimp.profile
@@ -0,0 +1,65 @@
1# Firejail profile for gimp
2# Description: GNU Image Manipulation Program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gimp.local
6# Persistent global definitions
7include globals.local
8
9# Add the next lines to your gimp.local in order to support scanning via xsane (see #3640).
10# TODO: Replace 'ignore seccomp' with a less permissive option.
11#ignore seccomp
12#ignore dbus-system
13#ignore net
14#protocol unix,inet,inet6
15
16# gimp plugins are installed by the user in ${HOME}/.gimp-2.8/plug-ins/ directory
17# If you are not using external plugins, you can add 'noexec ${HOME}' to your gimp.local.
18ignore noexec ${HOME}
19
20noblacklist ${HOME}/.cache/babl
21noblacklist ${HOME}/.cache/gegl-0.4
22noblacklist ${HOME}/.cache/gimp
23noblacklist ${HOME}/.config/GIMP
24noblacklist ${HOME}/.gimp*
25noblacklist ${DOCUMENTS}
26noblacklist ${PICTURES}
27
28# See issue #4367, gimp 2.10.22-3: gegl:introspect broken
29noblacklist /sbin
30noblacklist /usr/sbin
31
32include disable-common.inc
33include disable-exec.inc
34include disable-devel.inc
35include disable-programs.inc
36include disable-xdg.inc
37
38whitelist /usr/share/gegl-0.4
39whitelist /usr/share/gimp
40whitelist /usr/share/mypaint-data
41whitelist /usr/share/lensfun
42include whitelist-usr-share-common.inc
43include whitelist-var-common.inc
44
45apparmor
46caps.drop all
47net none
48nodvd
49nogroups
50noinput
51nonewprivs
52noroot
53nosound
54notv
55nou2f
56protocol unix
57seccomp !mbind
58shell none
59tracelog
60
61private-dev
62private-tmp
63
64dbus-user none
65dbus-system none
diff --git a/etc/profile-a-l/gist-paste.profile b/etc/profile-a-l/gist-paste.profile
new file mode 100644
index 000000000..56b3176ed
--- /dev/null
+++ b/etc/profile-a-l/gist-paste.profile
@@ -0,0 +1,12 @@
1# Firejail profile for gist-paste
2# Description: Potentially the best command line gister
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gist-paste.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include gist.profile
diff --git a/etc/profile-a-l/gist.profile b/etc/profile-a-l/gist.profile
new file mode 100644
index 000000000..80fa18119
--- /dev/null
+++ b/etc/profile-a-l/gist.profile
@@ -0,0 +1,61 @@
1# Firejail profile for gist
2# Description: Potentially the best command line gister
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gist.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}/wayland-*
12
13noblacklist ${HOME}/.gist
14
15# Allow ruby (blacklisted by disable-interpreters.inc)
16include allow-ruby.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-xdg.inc
24
25mkdir ${HOME}/.gist
26whitelist ${HOME}/.gist
27whitelist ${DOWNLOADS}
28include whitelist-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34ipc-namespace
35machine-id
36netfilter
37no3d
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix,inet,inet6
48seccomp
49shell none
50tracelog
51
52disable-mnt
53private-cache
54private-dev
55private-etc alternatives
56private-tmp
57
58dbus-user none
59dbus-system none
60
61memory-deny-write-execute
diff --git a/etc/profile-a-l/git-cola.profile b/etc/profile-a-l/git-cola.profile
new file mode 100644
index 000000000..f77adef63
--- /dev/null
+++ b/etc/profile-a-l/git-cola.profile
@@ -0,0 +1,87 @@
1# Firejail profile for git-cola
2# Description: Linux native frontend for Git
3# This file is overwritten after every install/update
4# Persistent local customizations
5include git-cola.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.gitconfig
12noblacklist ${HOME}/.git-credentials
13noblacklist ${HOME}/.gnupg
14noblacklist ${HOME}/.subversion
15noblacklist ${HOME}/.config/git
16noblacklist ${HOME}/.config/git-cola
17# Add your editor/diff viewer config paths and the next line to your git-cola.local to load settings.
18#noblacklist ${HOME}/
19
20# Allow python (blacklisted by disable-interpreters.inc)
21include allow-python2.inc
22include allow-python3.inc
23
24# Allow ssh (blacklisted by disable-common.inc)
25include allow-ssh.inc
26
27include disable-common.inc
28include disable-devel.inc
29include disable-exec.inc
30include disable-interpreters.inc
31include disable-programs.inc
32include disable-xdg.inc
33
34whitelist ${RUNUSER}/gnupg
35whitelist ${RUNUSER}/keyring
36# Add additional whitelist paths below /usr/share to your git-cola.local to support your editor/diff viewer.
37whitelist /usr/share/git
38whitelist /usr/share/git-cola
39whitelist /usr/share/git-core
40whitelist /usr/share/git-gui
41whitelist /usr/share/gitk
42whitelist /usr/share/gitweb
43whitelist /usr/share/gnupg
44whitelist /usr/share/gnupg2
45include whitelist-runuser-common.inc
46include whitelist-usr-share-common.inc
47include whitelist-var-common.inc
48
49apparmor
50caps.drop all
51machine-id
52netfilter
53no3d
54nodvd
55nogroups
56noinput
57nonewprivs
58noroot
59nosound
60notv
61nou2f
62novideo
63protocol unix,inet,inet6,netlink
64seccomp
65shell none
66tracelog
67
68# Add your own diff viewer,editor,pinentry program to private-bin in your git-cola.local.
69#private-bin pinentry-curses,pinentry-emacs,pinentry-fltk,pinentry-gnome3,pinentry-gtk,pinentry-gtk2,pinentry-gtk-2,pinentry-qt,pinentry-qt4,pinentry-tty,pinentry-x2go,pinentry-kwallet" for gpg
70private-bin basename,bash,cola,envsubst,gettext,git,git-cola,git-dag,git-gui,gitk,gpg,gpg-agent,nano,ps,python*,sh,ssh,ssh-agent,tclsh,tr,wc,which,xed
71private-cache
72private-dev
73private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gcrypt,gitconfig,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,localtime,login.defs,machine-id,mime.types,nsswitch.conf,passwd,pki,resolv.conf,selinux,ssh,ssl,X11,xdg
74private-tmp
75writable-run-user
76
77# dbus-user filtering breaks meld as diff viewer
78# Add the next line to your git-cola.local if you don't use meld.
79#dbus-user filter
80# Add the next line to your git-cola.local if you need keyring access
81#dbus-user.talk org.freedesktop.secrets
82dbus-system none
83
84read-only ${HOME}/.git-credentials
85
86# Add 'ignore read-only ${HOME}/.ssh' to your git-cola.local if you need to allow hosts.
87read-only ${HOME}/.ssh
diff --git a/etc/profile-a-l/git.profile b/etc/profile-a-l/git.profile
new file mode 100644
index 000000000..b0318e4a3
--- /dev/null
+++ b/etc/profile-a-l/git.profile
@@ -0,0 +1,61 @@
1# Firejail profile for git
2# Description: Fast, scalable, distributed revision control system
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include git.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.config/git
11noblacklist ${HOME}/.config/nano
12noblacklist ${HOME}/.emacs
13noblacklist ${HOME}/.emacs.d
14noblacklist ${HOME}/.gitconfig
15noblacklist ${HOME}/.git-credentials
16noblacklist ${HOME}/.gnupg
17noblacklist ${HOME}/.nanorc
18noblacklist ${HOME}/.vim
19noblacklist ${HOME}/.viminfo
20
21# Allow ssh (blacklisted by disable-common.inc)
22include allow-ssh.inc
23
24blacklist /tmp/.X11-unix
25blacklist ${RUNUSER}/wayland-*
26
27include disable-common.inc
28include disable-exec.inc
29include disable-programs.inc
30
31whitelist /usr/share/git
32whitelist /usr/share/git-core
33whitelist /usr/share/gitgui
34whitelist /usr/share/gitweb
35whitelist /usr/share/nano
36include whitelist-usr-share-common.inc
37include whitelist-var-common.inc
38
39apparmor
40caps.drop all
41ipc-namespace
42machine-id
43netfilter
44no3d
45nodvd
46nogroups
47noinput
48nonewprivs
49noroot
50nosound
51notv
52nou2f
53novideo
54protocol unix,inet,inet6
55seccomp
56shell none
57
58private-cache
59private-dev
60
61memory-deny-write-execute
diff --git a/etc/profile-a-l/gitg.profile b/etc/profile-a-l/gitg.profile
new file mode 100644
index 000000000..314b797c0
--- /dev/null
+++ b/etc/profile-a-l/gitg.profile
@@ -0,0 +1,64 @@
1# Firejail profile for gitg
2# Description: Git repository viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gitg.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/git
10noblacklist ${HOME}/.gitconfig
11noblacklist ${HOME}/.git-credentials
12noblacklist ${HOME}/.local/share/gitg
13
14# Allow ssh (blacklisted by disable-common.inc)
15include allow-ssh.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22
23#whitelist ${HOME}/YOUR_GIT_PROJECTS_DIRECTORY
24#whitelist ${HOME}/.config/git
25#whitelist ${HOME}/.gitconfig
26#whitelist ${HOME}/.git-credentials
27#whitelist ${HOME}/.local/share/gitg
28#whitelist ${HOME}/.ssh
29#include whitelist-common.inc
30
31whitelist /usr/share/gitg
32include whitelist-runuser-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36caps.drop all
37netfilter
38no3d
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix,inet,inet6
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54private-bin git,gitg,ssh
55private-cache
56private-dev
57private-tmp
58
59dbus-user filter
60dbus-user.own org.gnome.gitg
61dbus-user.talk ca.desrt.dconf
62# Add the next line to your gitg.local if you need keyring access.
63#dbus-user.talk org.freedesktop.secrets
64dbus-system none
diff --git a/etc/profile-a-l/github-desktop.profile b/etc/profile-a-l/github-desktop.profile
new file mode 100644
index 000000000..325c54ced
--- /dev/null
+++ b/etc/profile-a-l/github-desktop.profile
@@ -0,0 +1,40 @@
1# Firejail profile for github-desktop
2# Description: Extend your GitHub workflow beyond your browser with GitHub Desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include github-desktop.local
6# Persistent global definitions
7include globals.local
8
9# Note: On debian-based distributions the binary might be located in
10# /opt/GitHub Desktop/github-desktop, and therefore not be in PATH.
11# If that's the case you can start GitHub Desktop with firejail via
12# `firejail "/opt/GitHub Desktop/github-desktop"`.
13
14# Disabled until someone reported positive feedback
15ignore include disable-xdg.inc
16ignore whitelist ${DOWNLOADS}
17ignore include whitelist-common.inc
18ignore include whitelist-runuser-common.inc
19ignore include whitelist-usr-share-common.inc
20ignore include whitelist-var-common.inc
21ignore apparmor
22ignore dbus-user none
23ignore dbus-system none
24
25noblacklist ${HOME}/.config/GitHub Desktop
26noblacklist ${HOME}/.config/git
27noblacklist ${HOME}/.gitconfig
28noblacklist ${HOME}/.git-credentials
29
30# no3d
31nosound
32
33# private-bin github-desktop
34?HAS_APPIMAGE: ignore private-dev
35# private-lib
36
37# memory-deny-write-execute
38
39# Redirect
40include electron.profile
diff --git a/etc/profile-a-l/gitter.profile b/etc/profile-a-l/gitter.profile
new file mode 100644
index 000000000..5dfb48189
--- /dev/null
+++ b/etc/profile-a-l/gitter.profile
@@ -0,0 +1,44 @@
1# Firejail profile for gitter
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gitter.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/autostart
9noblacklist ${HOME}/.config/Gitter
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.config/Gitter
18whitelist ${DOWNLOADS}
19whitelist ${HOME}/.config/autostart
20whitelist ${HOME}/.config/Gitter
21include whitelist-var-common.inc
22
23caps.drop all
24machine-id
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37
38disable-mnt
39private-bin bash,env,gitter
40private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,pulse,resolv.conf,ssl
41private-opt Gitter
42private-dev
43private-tmp
44
diff --git a/etc/profile-a-l/gjs.profile b/etc/profile-a-l/gjs.profile
new file mode 100644
index 000000000..a52272852
--- /dev/null
+++ b/etc/profile-a-l/gjs.profile
@@ -0,0 +1,45 @@
1# Firejail profile for gjs
2# Description: Mozilla-based javascript bindings for the GNOME platform
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gjs.local
6# Persistent global definitions
7include globals.local
8
9# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
10
11noblacklist ${HOME}/.cache/libgweather
12noblacklist ${HOME}/.cache/org.gnome.Books
13noblacklist ${HOME}/.config/libreoffice
14noblacklist ${HOME}/.local/share/gnome-photos
15
16# Allow gjs (blacklisted by disable-interpreters.inc)
17include allow-gjs.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-interpreters.inc
22include disable-programs.inc
23
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28caps.drop all
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37protocol unix,inet,inet6
38seccomp
39shell none
40tracelog
41
42# private-bin gjs,gnome-books,gnome-documents,gnome-maps,gnome-photos,gnome-weather
43private-dev
44# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl
45private-tmp
diff --git a/etc/profile-a-l/gl-117-wrapper.profile b/etc/profile-a-l/gl-117-wrapper.profile
new file mode 100644
index 000000000..d783940f3
--- /dev/null
+++ b/etc/profile-a-l/gl-117-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for gl-117-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gl-117-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin gl-117-wrapper
12
13# Redirect
14include gl-117.profile
diff --git a/etc/profile-a-l/gl-117.profile b/etc/profile-a-l/gl-117.profile
new file mode 100644
index 000000000..35d969e6d
--- /dev/null
+++ b/etc/profile-a-l/gl-117.profile
@@ -0,0 +1,52 @@
1# Firejail profile for gl-117
2# Description: Action flight simulator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gl-117.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.gl-117
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.gl-117
20whitelist ${HOME}/.gl-117
21whitelist /usr/share/gl-117
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin gl-117
46private-cache
47private-dev
48private-etc alsa,alternatives,asound.conf,bumblebee,drirc,glvnd,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nvidia,pulse
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-a-l/glaxium-wrapper.profile b/etc/profile-a-l/glaxium-wrapper.profile
new file mode 100644
index 000000000..7dc2cf65e
--- /dev/null
+++ b/etc/profile-a-l/glaxium-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for glaxium-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include glaxium-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin glaxium-wrapper
12
13# Redirect
14include glaxium.profile
diff --git a/etc/profile-a-l/glaxium.profile b/etc/profile-a-l/glaxium.profile
new file mode 100644
index 000000000..dec0daef2
--- /dev/null
+++ b/etc/profile-a-l/glaxium.profile
@@ -0,0 +1,52 @@
1# Firejail profile for glaxium
2# Description: 3d spaceship shoot-em-up
3# This file is overwritten after every install/update
4# Persistent local customizations
5include glaxium.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.glaxiumrc
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkfile ${HOME}/.glaxiumrc
20whitelist ${HOME}/.glaxiumrc
21whitelist /usr/share/glaxium
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin glaxium
46private-cache
47private-dev
48private-etc alsa,alternatives,asound.conf,bumblebee,drirc,glvnd,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nvidia,pulse
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/globaltime.profile b/etc/profile-a-l/globaltime.profile
index 6961a56e9..d07f0ace4 100644
--- a/etc/globaltime.profile
+++ b/etc/profile-a-l/globaltime.profile
@@ -1,34 +1,37 @@
1# Firejail profile for globaltime 1# Firejail profile for globaltime
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/globaltime.local 4include globaltime.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/globaltime 8noblacklist ${HOME}/.config/globaltime
9 9
10include /etc/firejail/disable-common.inc 10include disable-common.inc
11include /etc/firejail/disable-devel.inc 11include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include disable-exec.inc
13include /etc/firejail/disable-programs.inc 13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
14 16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17no3d 19no3d
18nodvd 20nodvd
19nogroups 21nogroups
22noinput
20nonewprivs 23nonewprivs
21noroot 24noroot
22nosound 25nosound
23notv 26notv
27nou2f
24novideo 28novideo
25protocol unix,inet,inet6 29protocol unix,inet,inet6
26seccomp 30seccomp
27shell none 31shell none
28 32
29disable-mnt 33disable-mnt
34private-cache
30private-dev 35private-dev
31private-tmp 36private-tmp
32 37
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/profile-a-l/gmpc.profile b/etc/profile-a-l/gmpc.profile
new file mode 100644
index 000000000..4aa4b6c20
--- /dev/null
+++ b/etc/profile-a-l/gmpc.profile
@@ -0,0 +1,54 @@
1# Firejail profile for gmpc
2# Description: MPD client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gmpc.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gmpc
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/gmpc
20whitelist ${HOME}/.config/gmpc
21whitelist ${MUSIC}
22whitelist /usr/share/gmpc
23include whitelist-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30netfilter
31no3d
32nodvd
33nogroups
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42tracelog
43
44disable-mnt
45#private-bin gmpc
46private-cache
47private-etc alternatives,fonts
48private-tmp
49writable-run-user
50
51# dbus-user none
52# dbus-system none
53
54# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-a-l/gnome-2048.profile b/etc/profile-a-l/gnome-2048.profile
new file mode 100644
index 000000000..777c81dbe
--- /dev/null
+++ b/etc/profile-a-l/gnome-2048.profile
@@ -0,0 +1,19 @@
1# Firejail profile for gnome-2048
2# Description: Sliding tile puzzle game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-2048.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/gnome-2048
10
11mkdir ${HOME}/.local/share/gnome-2048
12whitelist ${HOME}/.local/share/gnome-2048
13
14private-bin gnome-2048
15
16dbus-user.own org.gnome.TwentyFortyEight
17
18# Redirect
19include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-books.profile b/etc/profile-a-l/gnome-books.profile
new file mode 100644
index 000000000..5b7eaa78d
--- /dev/null
+++ b/etc/profile-a-l/gnome-books.profile
@@ -0,0 +1,46 @@
1# Firejail profile for gnome-books
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gnome-books.local
5# Persistent global definitions
6include globals.local
7
8# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
9
10noblacklist ${HOME}/.cache/org.gnome.Books
11noblacklist ${DOCUMENTS}
12
13# Allow gjs (blacklisted by disable-interpreters.inc)
14include allow-gjs.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43# private-bin gjs,gnome-books
44private-dev
45private-tmp
46
diff --git a/etc/profile-a-l/gnome-builder.profile b/etc/profile-a-l/gnome-builder.profile
new file mode 100644
index 000000000..9fe9ed6ba
--- /dev/null
+++ b/etc/profile-a-l/gnome-builder.profile
@@ -0,0 +1,40 @@
1# Firejail profile for gnome-builder
2# Description: IDE for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-builder.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.bash_history
10
11noblacklist ${HOME}/.cache/gnome-builder
12noblacklist ${HOME}/.config/gnome-builder
13noblacklist ${HOME}/.local/share/gnome-builder
14
15# Allows files commonly used by IDEs
16include allow-common-devel.inc
17
18include disable-common.inc
19include disable-programs.inc
20
21include whitelist-runuser-common.inc
22
23caps.drop all
24ipc-namespace
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37
38private-dev
39
40read-write ${HOME}/.bash_history
diff --git a/etc/profile-a-l/gnome-calculator.profile b/etc/profile-a-l/gnome-calculator.profile
new file mode 100644
index 000000000..ac130da21
--- /dev/null
+++ b/etc/profile-a-l/gnome-calculator.profile
@@ -0,0 +1,55 @@
1# Firejail profile for gnome-calculator
2# Description: GNOME desktop calculator
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gnome-calculator.local
7# Persistent global definitions
8include globals.local
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
17
18include whitelist-common.inc
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27#net none -- breaks currency conversion
28netfilter
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41seccomp.block-secondary
42shell none
43tracelog
44
45disable-mnt
46private-bin gnome-calculator
47private-cache
48private-dev
49#private-lib gdk-pixbuf-2.*,gio,girepository-1.*,gvfs,libgconf-2.so.*,libgnutls.so.*,libproxy.so.*,librsvg-2.so.*,libxml2.so.*
50private-tmp
51
52dbus-user filter
53dbus-user.own org.gnome.Calculator
54dbus-user.talk ca.desrt.dconf
55dbus-system none
diff --git a/etc/profile-a-l/gnome-calendar.profile b/etc/profile-a-l/gnome-calendar.profile
new file mode 100644
index 000000000..c8903a991
--- /dev/null
+++ b/etc/profile-a-l/gnome-calendar.profile
@@ -0,0 +1,63 @@
1# Firejail profile for gnome-calendar
2# Description: Calendar for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-calendar.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/libgweather
18include whitelist-common.inc
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6
38seccomp
39seccomp.block-secondary
40shell none
41tracelog
42
43disable-mnt
44private
45private-bin gnome-calendar
46private-cache
47private-dev
48private-etc ca-certificates,crypto-policies,dconf,fonts,gtk-3.0,localtime,nsswitch.conf,pki,resolv.conf,ssl
49private-tmp
50
51dbus-user filter
52dbus-user.own org.gnome.Calendar
53dbus-user.talk ca.desrt.dconf
54dbus-user.talk org.gnome.evolution.dataserver.*
55#dbus-user.talk org.gnome.OnlineAccounts
56#dbus-user.talk org.gnome.ControlCenter
57# NOTE: dbus-system none fails, filter without rules works.
58dbus-system filter
59#dbus-system.talk org.freedesktop.timedate1
60#dbus-system.talk org.freedesktop.login1
61#dbus-system.talk org.freedesktop.GeoClue2
62
63read-only ${HOME}
diff --git a/etc/profile-a-l/gnome-character-map.profile b/etc/profile-a-l/gnome-character-map.profile
new file mode 100644
index 000000000..27804fdd0
--- /dev/null
+++ b/etc/profile-a-l/gnome-character-map.profile
@@ -0,0 +1,10 @@
1# Firejail profile for gnome-character-map
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gnome-character-map.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include gucharmap.profile
diff --git a/etc/profile-a-l/gnome-characters.profile b/etc/profile-a-l/gnome-characters.profile
new file mode 100644
index 000000000..aaa1e3f5a
--- /dev/null
+++ b/etc/profile-a-l/gnome-characters.profile
@@ -0,0 +1,59 @@
1# Firejail profile for gnome-characters
2# Description: Character map application for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-characters.local
6# Persistent global definitions
7include globals.local
8
9# Allow gjs (blacklisted by disable-interpreters.inc)
10include allow-gjs.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20whitelist /usr/share/org.gnome.Characters
21include whitelist-common.inc
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42seccomp.block-secondary
43shell none
44tracelog
45
46disable-mnt
47# Add the next line to your gnome-characters.local if you don't need access to recently used chars.
48#private
49private-bin gjs,gnome-characters
50private-cache
51private-dev
52private-etc alternatives,dconf,fonts,gconf,gtk-2.0,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mime.types,pango,X11,xdg
53private-tmp
54
55# Add the next lines to your gnome-characters.local if you don't need access to recently used chars.
56# dbus-user none
57# dbus-system none
58
59read-only ${HOME}
diff --git a/etc/profile-a-l/gnome-chess.profile b/etc/profile-a-l/gnome-chess.profile
new file mode 100644
index 000000000..d038d775a
--- /dev/null
+++ b/etc/profile-a-l/gnome-chess.profile
@@ -0,0 +1,54 @@
1# Firejail profile for gnome-chess
2# Description: Simple chess game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-chess.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gnome-chess
10noblacklist ${HOME}/.local/share/gnome-chess
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20#mkdir ${HOME}/.local/share/gnome-chess
21#whitelist ${HOME}/.local/share/gnome-chess
22#include whitelist-common.inc
23
24whitelist /usr/share/gnuchess
25whitelist /usr/share/gnome-chess
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32machine-id
33net none
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46shell none
47tracelog
48
49disable-mnt
50private-bin fairymax,gnome-chess,gnuchess,hoichess
51private-cache
52private-dev
53private-etc alternatives,dconf,fonts,gnome-chess,gtk-3.0
54private-tmp
diff --git a/etc/profile-a-l/gnome-clocks.profile b/etc/profile-a-l/gnome-clocks.profile
new file mode 100644
index 000000000..96a39f6ce
--- /dev/null
+++ b/etc/profile-a-l/gnome-clocks.profile
@@ -0,0 +1,47 @@
1# Firejail profile for gnome-clocks
2# Description: Simple GNOME app with stopwatch, timer, and world clock support
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-clocks.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/gnome-clocks
18whitelist /usr/share/libgweather
19include whitelist-common.inc
20include whitelist-runuser-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin gnome-clocks,gsound-play
43private-cache
44private-dev
45private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gtk-3.0,hosts,localtime,machine-id,pkcs11,pki,ssl
46private-tmp
47
diff --git a/etc/profile-a-l/gnome-contacts.profile b/etc/profile-a-l/gnome-contacts.profile
new file mode 100644
index 000000000..f96f750dd
--- /dev/null
+++ b/etc/profile-a-l/gnome-contacts.profile
@@ -0,0 +1,40 @@
1# Firejail profile for gnome-contacts
2# Description: Contacts manager for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-contacts.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18include whitelist-common.inc
19include whitelist-runuser-common.inc
20include whitelist-var-common.inc
21
22caps.drop all
23netfilter
24#no3d - breaks on Arch
25nodvd
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6,netlink
34seccomp
35seccomp.block-secondary
36
37disable-mnt
38private-dev
39private-tmp
40
diff --git a/etc/profile-a-l/gnome-documents.profile b/etc/profile-a-l/gnome-documents.profile
new file mode 100644
index 000000000..0ed3c7541
--- /dev/null
+++ b/etc/profile-a-l/gnome-documents.profile
@@ -0,0 +1,44 @@
1# Firejail profile for gnome-documents
2# Description: Document manager for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-documents.local
6# Persistent global definitions
7include globals.local
8
9# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
10
11noblacklist ${HOME}/.config/libreoffice
12noblacklist ${DOCUMENTS}
13
14# Allow gjs (blacklisted by disable-interpreters.inc)
15include allow-gjs.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24caps.drop all
25netfilter
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40
41private-cache
42private-dev
43private-tmp
44
diff --git a/etc/profile-a-l/gnome-font-viewer.profile b/etc/profile-a-l/gnome-font-viewer.profile
new file mode 100644
index 000000000..294729152
--- /dev/null
+++ b/etc/profile-a-l/gnome-font-viewer.profile
@@ -0,0 +1,37 @@
1# Firejail profile for gnome-font-viewer
2# Description: Font viewer for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-font-viewer.local
6# Persistent global definitions
7include globals.local
8
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
16
17include whitelist-var-common.inc
18
19apparmor
20caps.drop all
21net none
22no3d
23nodvd
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix,inet,inet6
32seccomp
33
34disable-mnt
35private-dev
36private-tmp
37
diff --git a/etc/profile-a-l/gnome-hexgl.profile b/etc/profile-a-l/gnome-hexgl.profile
new file mode 100644
index 000000000..19a4bc5c7
--- /dev/null
+++ b/etc/profile-a-l/gnome-hexgl.profile
@@ -0,0 +1,52 @@
1# Firejail profile for gnome-hexgl
2# Description: Gthree port of HexGL
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-hexgl.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17mkdir ${HOME}/.cache/mesa_shader_cache
18whitelist /usr/share/gnome-hexgl
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36seccomp.block-secondary
37shell none
38tracelog
39
40disable-mnt
41private
42private-bin gnome-hexgl
43private-cache
44private-dev
45private-etc alsa,asound.conf,machine-id,pulse
46private-tmp
47
48dbus-user none
49dbus-system none
50
51read-only ${HOME}
52read-write ${HOME}/.cache/mesa_shader_cache
diff --git a/etc/profile-a-l/gnome-keyring-3.profile b/etc/profile-a-l/gnome-keyring-3.profile
new file mode 100644
index 000000000..e9961e4f0
--- /dev/null
+++ b/etc/profile-a-l/gnome-keyring-3.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-keyring-3
2# Description: Stores passwords and encryption keys
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-keyring-3.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gnome-keyring.profile
diff --git a/etc/profile-a-l/gnome-keyring.profile b/etc/profile-a-l/gnome-keyring.profile
new file mode 100644
index 000000000..b74325102
--- /dev/null
+++ b/etc/profile-a-l/gnome-keyring.profile
@@ -0,0 +1,62 @@
1# Firejail profile for gnome-keyring
2# Description: Stores passwords and encryption keys
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gnome-keyring.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.gnupg
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.gnupg
20whitelist ${HOME}/.gnupg
21whitelist ${DOWNLOADS}
22whitelist ${RUNUSER}/gnupg
23whitelist ${RUNUSER}/keyring
24whitelist /usr/share/gnupg
25whitelist /usr/share/gnupg2
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33ipc-namespace
34machine-id
35netfilter
36no3d
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46protocol unix,inet,inet6
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53#private-bin gnome-keyrin*,secret-tool
54private-cache
55private-dev
56#private-lib alternatives,gnome-keyring,libsecret-1.so.*,pkcs11,security
57private-tmp
58
59# dbus-user none
60dbus-system none
61
62memory-deny-write-execute
diff --git a/etc/profile-a-l/gnome-klotski.profile b/etc/profile-a-l/gnome-klotski.profile
new file mode 100644
index 000000000..c67a5c0da
--- /dev/null
+++ b/etc/profile-a-l/gnome-klotski.profile
@@ -0,0 +1,19 @@
1# Firejail profile for gnome-klotski
2# Description: Sliding block puzzles game for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-klotski.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/gnome-klotski
10
11mkdir ${HOME}/.local/share/gnome-klotski
12whitelist ${HOME}/.local/share/gnome-klotski
13
14private-bin gnome-klotski
15
16dbus-user.own org.gnome.Klotski
17
18# Redirect
19include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-latex.profile b/etc/profile-a-l/gnome-latex.profile
new file mode 100644
index 000000000..26c2c4409
--- /dev/null
+++ b/etc/profile-a-l/gnome-latex.profile
@@ -0,0 +1,53 @@
1# Firejail profile for gnome-latex
2# Description: LaTeX editor for the GNOME desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-latex.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gnome-latex
10noblacklist ${HOME}/.local/share/gnome-latex
11
12# Allow perl (blacklisted by disable-interpreters.inc)
13include allow-perl.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21whitelist /usr/share/gnome-latex
22whitelist /usr/share/texlive
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25# May cause issues.
26#include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48private-cache
49private-dev
50# passwd,login.defs,firejail are a temporary workaround for #2877 and can be removed once it is fixed
51private-etc alternatives,dconf,fonts,gtk-3.0,latexmk.conf,login.defs,passwd,texlive
52
53dbus-system none
diff --git a/etc/profile-a-l/gnome-logs.profile b/etc/profile-a-l/gnome-logs.profile
new file mode 100644
index 000000000..2c15f7592
--- /dev/null
+++ b/etc/profile-a-l/gnome-logs.profile
@@ -0,0 +1,54 @@
1# Firejail profile for gnome-logs
2# Description: Viewer for the systemd journal
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-logs.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /var/log/journal
18include whitelist-runuser-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25net none
26no3d
27nodvd
28noinput
29nonewprivs
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37tracelog
38
39disable-mnt
40private-bin gnome-logs
41private-cache
42private-dev
43private-etc alternatives,fonts,localtime,machine-id
44private-lib gdk-pixbuf-2.*,gio,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.*
45private-tmp
46writable-var-log
47
48dbus-user filter
49dbus-user.own org.gnome.Logs
50dbus-user.talk ca.desrt.dconf
51dbus-system none
52
53# Add 'ignore read-only ${HOME}' to your gnome-logs.local if you export logs to a file under your ${HOME}.
54read-only ${HOME}
diff --git a/etc/profile-a-l/gnome-mahjongg.profile b/etc/profile-a-l/gnome-mahjongg.profile
new file mode 100644
index 000000000..42409dce8
--- /dev/null
+++ b/etc/profile-a-l/gnome-mahjongg.profile
@@ -0,0 +1,16 @@
1# Firejail profile for gnome-mahjongg
2# Description: A matching game played with Mahjongg tiles
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-mahjongg.local
6# Persistent global definitions
7include globals.local
8
9whitelist /usr/share/gnome-mahjongg
10
11private-bin gnome-mahjongg
12
13dbus-user.own org.gnome.Mahjongg
14
15# Redirect
16include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-maps.profile b/etc/profile-a-l/gnome-maps.profile
new file mode 100644
index 000000000..7732117ac
--- /dev/null
+++ b/etc/profile-a-l/gnome-maps.profile
@@ -0,0 +1,76 @@
1# Firejail profile for gnome-maps
2# Description: Map application for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-maps.local
6# Persistent global definitions
7include globals.local
8
9# Some distributions use gapplications to start gnome-maps over D-Bus. As firecfg cannot handle that, you need to run the following command.
10# sed -e "s/Exec=gapplication launch org.gnome.Maps %U/Exec=gnome-maps %U/" -e "s/DBusActivatable=true/DBusActivatable=false/" "/usr/share/applications/org.gnome.Maps.desktop" > "~/.local/share/applications/org.gnome.Maps.desktop"
11
12# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
13
14noblacklist ${HOME}/.cache/champlain
15noblacklist ${HOME}/.cache/org.gnome.Maps
16noblacklist ${HOME}/.local/share/maps-places.json
17
18# Allow gjs (blacklisted by disable-interpreters.inc)
19include allow-gjs.inc
20
21blacklist /usr/libexec
22
23include disable-common.inc
24include disable-devel.inc
25include disable-exec.inc
26include disable-interpreters.inc
27include disable-programs.inc
28include disable-shell.inc
29include disable-xdg.inc
30
31mkdir ${HOME}/.cache/champlain
32mkfile ${HOME}/.local/share/maps-places.json
33whitelist ${HOME}/.cache/champlain
34whitelist ${HOME}/.local/share/maps-places.json
35whitelist ${DOWNLOADS}
36whitelist ${PICTURES}
37whitelist /usr/share/gnome-maps
38whitelist /usr/share/libgweather
39include whitelist-common.inc
40include whitelist-runuser-common.inc
41include whitelist-usr-share-common.inc
42include whitelist-var-common.inc
43
44apparmor
45caps.drop all
46machine-id
47netfilter
48nodvd
49nogroups
50noinput
51nonewprivs
52noroot
53nosound
54notv
55nou2f
56novideo
57protocol unix,inet,inet6
58seccomp
59seccomp.block-secondary
60shell none
61tracelog
62
63disable-mnt
64private-bin gjs,gnome-maps
65# private-cache -- gnome-maps cache all maps/satelite-images
66private-dev
67private-etc alternatives,ca-certificates,clutter-1.0,crypto-policies,dconf,drirc,fonts,gconf,gcrypt,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mime.types,nsswitch.conf,pango,pkcs11,pki,protocols,resolv.conf,rpc,services,ssl,X11,xdg
68private-tmp
69
70dbus-user filter
71dbus-user.own org.gnome.Maps
72#dbus-user.talk org.freedesktop.secrets
73#dbus-user.talk org.gnome.OnlineAccounts
74dbus-system filter
75#dbus-system.talk org.freedesktop.NetworkManager
76dbus-system.talk org.freedesktop.GeoClue2
diff --git a/etc/profile-a-l/gnome-mines.profile b/etc/profile-a-l/gnome-mines.profile
new file mode 100644
index 000000000..4fe8986c2
--- /dev/null
+++ b/etc/profile-a-l/gnome-mines.profile
@@ -0,0 +1,20 @@
1# Firejail profile for gnome-mines
2# Description: The popular logic puzzle minesweeper
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-mines.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/gnome-mines
10
11mkdir ${HOME}/.local/share/gnome-mines
12whitelist ${HOME}/.local/share/gnome-mines
13whitelist /usr/share/gnome-mines
14
15private-bin gnome-mines
16
17dbus-user.own org.gnome.Mines
18
19# Redirect
20include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-mplayer.profile b/etc/profile-a-l/gnome-mplayer.profile
new file mode 100644
index 000000000..f8f40ea54
--- /dev/null
+++ b/etc/profile-a-l/gnome-mplayer.profile
@@ -0,0 +1,34 @@
1# Firejail profile for gnome-mplayer
2# Description: GTK/Gnome interface around MPlayer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-mplayer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gnome-mplayer
10noblacklist ${MUSIC}
11noblacklist ${VIDEOS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20caps.drop all
21nogroups
22noinput
23nonewprivs
24noroot
25nou2f
26protocol unix,inet,inet6
27seccomp
28shell none
29
30# private-bin gnome-mplayer,mplayer
31private-cache
32private-dev
33private-tmp
34
diff --git a/etc/profile-a-l/gnome-mpv.profile b/etc/profile-a-l/gnome-mpv.profile
new file mode 100644
index 000000000..dfb95d27b
--- /dev/null
+++ b/etc/profile-a-l/gnome-mpv.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for celluloid (formerly GNOME MPV)
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gnome-mpv.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include celluloid.profile
diff --git a/etc/profile-a-l/gnome-music.profile b/etc/profile-a-l/gnome-music.profile
new file mode 100644
index 000000000..a00edfa37
--- /dev/null
+++ b/etc/profile-a-l/gnome-music.profile
@@ -0,0 +1,47 @@
1# Firejail profile for gnome-music
2# Description: GNOME music player
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-music.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/gnome-music
10noblacklist ${MUSIC}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28netfilter
29no3d
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42# private-bin calls a file manager - whatever is installed!
43#private-bin env,gio-launch-desktop,gnome-music,python*,yelp
44private-dev
45private-etc alternatives,asound.conf,dconf,fonts,fonts,gtk-3.0,machine-id,pulse,selinux,xdg
46private-tmp
47
diff --git a/etc/profile-a-l/gnome-nettool.profile b/etc/profile-a-l/gnome-nettool.profile
new file mode 100644
index 000000000..abf3dd759
--- /dev/null
+++ b/etc/profile-a-l/gnome-nettool.profile
@@ -0,0 +1,48 @@
1# Firejail profile for gnome-nettool
2# Description: Graphical interface for various networking tools
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-nettool.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-xdg.inc
15
16whitelist /usr/share/gnome-nettool
17#include whitelist-common.inc -- see #903
18include whitelist-runuser-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22caps.keep net_raw
23ipc-namespace
24machine-id
25netfilter
26no3d
27nodvd
28nogroups
29noinput
30# ping needs to elevate privileges, noroot and nonewprivs will kill it
31#nonewprivs
32#noroot
33nosound
34notv
35nou2f
36novideo
37#seccomp
38#shell none
39
40disable-mnt
41private
42private-cache
43private-dev
44private-lib libbind9.so.*,libcrypto.so.*,libdns.so.*,libgtk-3.so.*,libgtop*,libirs.so.*,liblua.so.*,libssh2.so.*,libssl.so.*
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-a-l/gnome-nibbles.profile b/etc/profile-a-l/gnome-nibbles.profile
new file mode 100644
index 000000000..b22810d34
--- /dev/null
+++ b/etc/profile-a-l/gnome-nibbles.profile
@@ -0,0 +1,23 @@
1# Firejail profile for gnome-nibbles
2# Description: A worm game for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-nibbles.local
6# Persistent global definitions
7include globals.local
8
9ignore machine-id
10ignore nosound
11
12noblacklist ${HOME}/.local/share/gnome-nibbles
13
14mkdir ${HOME}/.local/share/gnome-nibbles
15whitelist ${HOME}/.local/share/gnome-nibbles
16whitelist /usr/share/gnome-nibbles
17
18private-bin gnome-nibbles
19
20dbus-user.own org.gnome.Nibbles
21
22# Redirect
23include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-passwordsafe.profile b/etc/profile-a-l/gnome-passwordsafe.profile
new file mode 100644
index 000000000..b69899c70
--- /dev/null
+++ b/etc/profile-a-l/gnome-passwordsafe.profile
@@ -0,0 +1,62 @@
1# Firejail profile for gnome-passwordsafe
2# Description: Password manager for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-passwordsafe.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${HOME}/*.kdb
11noblacklist ${HOME}/*.kdbx
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python3.inc
15
16blacklist /usr/libexec
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26whitelist /usr/share/cracklib
27whitelist /usr/share/passwordsafe
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35net none
36no3d
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46protocol unix
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53private-bin gnome-passwordsafe,python3*
54private-cache
55private-dev
56private-etc dconf,fonts,gtk-3.0,passwd
57private-tmp
58
59dbus-user filter
60dbus-user.own org.gnome.PasswordSafe
61dbus-user.talk ca.desrt.dconf
62dbus-system none
diff --git a/etc/profile-a-l/gnome-photos.profile b/etc/profile-a-l/gnome-photos.profile
new file mode 100644
index 000000000..4fd78eaab
--- /dev/null
+++ b/etc/profile-a-l/gnome-photos.profile
@@ -0,0 +1,43 @@
1# Firejail profile for gnome-photos
2# Description: Access, organize and share your photos with GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-photos.local
6# Persistent global definitions
7include globals.local
8
9# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
10
11noblacklist ${HOME}/.local/share/gnome-photos
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19include whitelist-runuser-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24netfilter
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36seccomp.block-secondary
37shell none
38tracelog
39
40# private-bin gjs,gnome-photos
41private-dev
42private-tmp
43
diff --git a/etc/profile-a-l/gnome-pie.profile b/etc/profile-a-l/gnome-pie.profile
new file mode 100644
index 000000000..3ab2e4aad
--- /dev/null
+++ b/etc/profile-a-l/gnome-pie.profile
@@ -0,0 +1,41 @@
1# Firejail profile for gnome-pie
2# Description: Alternative AppMenu
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-pie.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gnome-pie
10
11#include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14#include disable-interpreters.inc
15#include disable-programs.inc
16
17caps.drop all
18ipc-namespace
19# net none - breaks dbus
20no3d
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26nosound
27notv
28nou2f
29novideo
30protocol unix
31seccomp
32shell none
33
34disable-mnt
35private-cache
36private-dev
37private-etc alternatives,fonts,machine-id
38private-lib gdk-pixbuf-2.*,gio,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.*
39private-tmp
40
41memory-deny-write-execute
diff --git a/etc/profile-a-l/gnome-pomodoro.profile b/etc/profile-a-l/gnome-pomodoro.profile
new file mode 100644
index 000000000..256a0c69f
--- /dev/null
+++ b/etc/profile-a-l/gnome-pomodoro.profile
@@ -0,0 +1,59 @@
1# Firejail profile for gnome-pomodoro
2# Description: time management utility for GNOME based on the pomodoro technique
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-pomodoro.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/gnome-pomodoro
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.local/share/gnome-pomodoro
19whitelist ${HOME}/.local/share/gnome-pomodoro
20whitelist /usr/share/gnome-pomodoro
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin gnome-pomodoro
45private-cache
46private-dev
47private-etc dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,machine-id
48private-tmp
49
50dbus-user filter
51dbus-user.own org.gnome.Pomodoro
52dbus-user.talk ca.desrt.dconf
53dbus-user.talk org.gnome.Mutter.IdleMonitor
54dbus-user.talk org.gnome.Shell
55dbus-user.talk org.freedesktop.Notifications
56dbus-system none
57
58read-only ${HOME}
59read-write ${HOME}/.local/share/gnome-pomodoro
diff --git a/etc/profile-a-l/gnome-recipes.profile b/etc/profile-a-l/gnome-recipes.profile
new file mode 100644
index 000000000..01162b552
--- /dev/null
+++ b/etc/profile-a-l/gnome-recipes.profile
@@ -0,0 +1,53 @@
1# Firejail profile for gnome-recipes
2# Description: Recipe application for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-recipes.local
6# Persistent global definitions
7include globals.local
8
9
10noblacklist ${HOME}/.cache/gnome-recipes
11noblacklist ${HOME}/.local/share/gnome-recipes
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19
20mkdir ${HOME}/.cache/gnome-recipes
21mkdir ${HOME}/.local/share/gnome-recipes
22whitelist ${HOME}/.cache/gnome-recipes
23whitelist ${HOME}/.local/share/gnome-recipes
24whitelist /usr/share/gnome-recipes
25include whitelist-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32machine-id
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39nosound
40notv
41nou2f
42novideo
43protocol unix,inet,inet6
44seccomp
45shell none
46
47disable-mnt
48private-bin gnome-recipes,tar
49private-dev
50private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl
51private-lib gdk-pixbuf-2.0,gio,gvfs/libgvfscommon.so,libgconf-2.so.*,libgnutls.so.*,libjpeg.so.*,libp11-kit.so.*,libproxy.so.*,librsvg-2.so.*
52private-tmp
53
diff --git a/etc/profile-a-l/gnome-ring.profile b/etc/profile-a-l/gnome-ring.profile
new file mode 100644
index 000000000..7ee01dec1
--- /dev/null
+++ b/etc/profile-a-l/gnome-ring.profile
@@ -0,0 +1,33 @@
1# Firejail profile for gnome-ring
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gnome-ring.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.local/share/gnome-ring
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16include whitelist-var-common.inc
17
18caps.drop all
19ipc-namespace
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26protocol unix,inet,inet6,netlink
27seccomp
28shell none
29
30disable-mnt
31# private-dev
32private-tmp
33
diff --git a/etc/profile-a-l/gnome-robots.profile b/etc/profile-a-l/gnome-robots.profile
new file mode 100644
index 000000000..8835f2b93
--- /dev/null
+++ b/etc/profile-a-l/gnome-robots.profile
@@ -0,0 +1,19 @@
1# Firejail profile for gnome-robots
2# Description: Based on classic BSD Robots
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-robots.local
6# Persistent global definitions
7include globals.local
8
9ignore machine-id
10ignore nosound
11
12whitelist /usr/share/gnome-robots
13
14private-bin gnome-robots
15
16dbus-user.own org.gnome.Robots
17
18# Redirect
19include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-schedule.profile b/etc/profile-a-l/gnome-schedule.profile
new file mode 100644
index 000000000..8c3db651f
--- /dev/null
+++ b/etc/profile-a-l/gnome-schedule.profile
@@ -0,0 +1,65 @@
1# Firejail profile for gnome-schedule
2# Description: Graphical interface to crontab and at for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-schedule.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.gnome/gnome-schedule
10
11# Needs at and crontab to read/write user cron
12noblacklist ${PATH}/at
13noblacklist ${PATH}/crontab
14
15# Needs access to these files/dirs
16noblacklist /etc/cron.allow
17noblacklist /etc/cron.deny
18noblacklist /etc/shadow
19noblacklist /var/spool/cron
20
21# cron job testing needs a terminal, resulting in sandbox escape (see disable-common.inc)
22# add 'noblacklist ${PATH}/your-terminal' to gnome-schedule.local if you need that functionality
23
24# Allow python (blacklisted by disable-interpreters.inc)
25include allow-python2.inc
26include allow-python3.inc
27
28include disable-common.inc
29include disable-devel.inc
30include disable-exec.inc
31include disable-interpreters.inc
32include disable-programs.inc
33include disable-xdg.inc
34
35mkfile ${HOME}/.gnome/gnome-schedule
36whitelist ${HOME}/.gnome/gnome-schedule
37whitelist /usr/share/gnome-schedule
38whitelist /var/spool/atd
39whitelist /var/spool/cron
40include whitelist-common.inc
41include whitelist-runuser-common.inc
42include whitelist-usr-share-common.inc
43include whitelist-var-common.inc
44
45apparmor
46caps.keep chown,dac_override,setgid,setuid
47ipc-namespace
48machine-id
49#net none - breaks on Ubuntu
50no3d
51nodvd
52nogroups
53noinput
54nosound
55notv
56nou2f
57novideo
58shell none
59tracelog
60
61disable-mnt
62private-cache
63private-dev
64writable-var
65
diff --git a/etc/profile-a-l/gnome-screenshot.profile b/etc/profile-a-l/gnome-screenshot.profile
new file mode 100644
index 000000000..f5afa9fb3
--- /dev/null
+++ b/etc/profile-a-l/gnome-screenshot.profile
@@ -0,0 +1,51 @@
1# Firejail profile for gnome-screenshot
2# Description: GNOME screenshot tool
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-screenshot.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PICTURES}
10noblacklist ${HOME}/.cache/gnome-screenshot
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20include whitelist-usr-share-common.inc
21include whitelist-runuser-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38seccomp.block-secondary
39shell none
40tracelog
41
42disable-mnt
43private-bin gnome-screenshot
44private-dev
45private-etc dconf,fonts,gtk-3.0,localtime,machine-id
46private-tmp
47
48dbus-user filter
49dbus-user.own org.gnome.Screenshot
50dbus-user.talk org.gnome.Shell.Screenshot
51dbus-system none
diff --git a/etc/profile-a-l/gnome-sound-recorder.profile b/etc/profile-a-l/gnome-sound-recorder.profile
new file mode 100644
index 000000000..159145b1b
--- /dev/null
+++ b/etc/profile-a-l/gnome-sound-recorder.profile
@@ -0,0 +1,44 @@
1# Firejail profile for gnome-sound-recorder
2# Description: simple sound recordings for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-sound-recorder.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${MUSIC}
10noblacklist ${HOME}/.local/share/Trash
11
12# Allow gjs (blacklisted by disable-interpreters.inc)
13include allow-gjs.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22include whitelist-var-common.inc
23
24caps.drop all
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36seccomp.block-secondary
37shell none
38tracelog
39
40disable-mnt
41private-cache
42private-dev
43private-etc alsa,asound.conf,dconf,fonts,gtk-2.0,gtk-3.0,machine-id,openal,pango,pulse,xdg
44private-tmp
diff --git a/etc/profile-a-l/gnome-sudoku.profile b/etc/profile-a-l/gnome-sudoku.profile
new file mode 100644
index 000000000..12fd48a86
--- /dev/null
+++ b/etc/profile-a-l/gnome-sudoku.profile
@@ -0,0 +1,19 @@
1# Firejail profile for gnome-sudoku
2# Description: puzzle game for the popular Japanese sudoku logic puzzle
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-sudoku.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/gnome-sudoku
10
11mkdir ${HOME}/.local/share/gnome-sudoku
12whitelist ${HOME}/.local/share/gnome-sudoku
13
14private-bin gnome-sudoku
15
16dbus-user.own org.gnome.Sudoku
17
18# Redirect
19include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-system-log.profile b/etc/profile-a-l/gnome-system-log.profile
new file mode 100644
index 000000000..3f9497e80
--- /dev/null
+++ b/etc/profile-a-l/gnome-system-log.profile
@@ -0,0 +1,56 @@
1# Firejail profile for gnome-system-log
2# Description: View your system logs
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-system-log.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /var/log
18include whitelist-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25# net none - breaks dbus
26no3d
27nodvd
28# When using 'volatile' storage (https://www.freedesktop.org/software/systemd/man/journald.conf.html),
29# put 'ignore nogroups' and 'ignore noroot' in your gnome-system-log.local.
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41
42disable-mnt
43private-bin gnome-system-log
44private-cache
45private-dev
46private-etc alternatives,fonts,localtime,machine-id
47private-lib
48private-tmp
49writable-var-log
50
51# dbus-user none
52# dbus-system none
53
54memory-deny-write-execute
55# Add 'ignore read-only ${HOME}' to your gnome-system-log.local if you export logs to a file under your ${HOME}.
56read-only ${HOME}
diff --git a/etc/profile-a-l/gnome-taquin.profile b/etc/profile-a-l/gnome-taquin.profile
new file mode 100644
index 000000000..2341334f7
--- /dev/null
+++ b/etc/profile-a-l/gnome-taquin.profile
@@ -0,0 +1,19 @@
1# Firejail profile for gnome-taquin
2# Description: A sliding puzzle game for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-taquin.local
6# Persistent global definitions
7include globals.local
8
9ignore machine-id
10ignore nosound
11
12whitelist /usr/share/gnome-taquin
13
14private-bin gnome-taquin
15
16dbus-user.own org.gnome.Taquin
17
18# Redirect
19include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-tetravex.profile b/etc/profile-a-l/gnome-tetravex.profile
new file mode 100644
index 000000000..6e820dd70
--- /dev/null
+++ b/etc/profile-a-l/gnome-tetravex.profile
@@ -0,0 +1,14 @@
1# Firejail profile for gnome-tetravex
2# Description: A simple puzzle game for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-tetravex.local
6# Persistent global definitions
7include globals.local
8
9private-bin gnome-tetravex
10
11dbus-user.own org.gnome.Tetravex
12
13# Redirect
14include gnome_games-common.profile
diff --git a/etc/profile-a-l/gnome-todo.profile b/etc/profile-a-l/gnome-todo.profile
new file mode 100644
index 000000000..4640f7f43
--- /dev/null
+++ b/etc/profile-a-l/gnome-todo.profile
@@ -0,0 +1,64 @@
1# Firejail profile for gnome-todo
2# Description: Personal task manager for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-todo.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python3.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20whitelist /usr/share/gnome-todo
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28machine-id
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43
44disable-mnt
45#private
46private-bin gnome-todo
47private-cache
48private-dev
49private-etc dconf,fonts,gtk-3.0,localtime,passwd,xdg
50private-tmp
51
52dbus-user filter
53dbus-user.own org.gnome.Todo
54dbus-user.talk ca.desrt.dconf
55#dbus-user.talk org.gnome.evolution.dataserver.AddressBook9
56dbus-user.talk org.gnome.evolution.dataserver.Calendar8
57dbus-user.talk org.gnome.evolution.dataserver.Sources5
58#dbus-user.talk org.gnome.evolution.dataserver.Subprocess.Backend.*
59#dbus-user.talk org.gnome.OnlineAccounts
60dbus-system none
61#dbus-system filter
62#dbus-system.talk org.freedesktop.login1
63
64read-only ${HOME}
diff --git a/etc/gnome-twitch.profile b/etc/profile-a-l/gnome-twitch.profile
index 9c94404d1..aef6b0fdd 100644
--- a/etc/gnome-twitch.profile
+++ b/etc/profile-a-l/gnome-twitch.profile
@@ -1,37 +1,40 @@
1# Firejail profile for gnome-twitch 1# Firejail profile for gnome-twitch
2# Description: GNOME Twitch app for watching Twitch.tv streams without a browser or flash
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/gnome-twitch.local 5include gnome-twitch.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.cache/gnome-twitch 9noblacklist ${HOME}/.cache/gnome-twitch
9noblacklist ${HOME}/.local/share/gnome-twitch 10noblacklist ${HOME}/.local/share/gnome-twitch
10 11
11include /etc/firejail/disable-common.inc 12include disable-common.inc
12include /etc/firejail/disable-devel.inc 13include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
14include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
15 17
16mkdir ${HOME}/.cache/gnome-twitch 18mkdir ${HOME}/.cache/gnome-twitch
17mkdir ${HOME}/.local/share/gnome-twitch 19mkdir ${HOME}/.local/share/gnome-twitch
18whitelist ${HOME}/.cache/gnome-twitch 20whitelist ${HOME}/.cache/gnome-twitch
19whitelist ${HOME}/.local/share/gnome-twitch 21whitelist ${HOME}/.local/share/gnome-twitch
20include /etc/firejail/whitelist-common.inc 22include whitelist-common.inc
21 23
22caps.drop all 24caps.drop all
23nodvd 25nodvd
24nogroups 26nogroups
27noinput
25nonewprivs 28nonewprivs
26noroot 29noroot
27notv 30notv
31nou2f
28novideo 32novideo
29protocol unix,inet,inet6 33protocol unix,inet,inet6
30seccomp 34seccomp
31shell none 35shell none
32 36
37disable-mnt
33private-dev 38private-dev
34private-tmp 39private-tmp
35 40
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/profile-a-l/gnome-weather.profile b/etc/profile-a-l/gnome-weather.profile
new file mode 100644
index 000000000..5592879ec
--- /dev/null
+++ b/etc/profile-a-l/gnome-weather.profile
@@ -0,0 +1,49 @@
1# Firejail profile for gnome-weather
2# Description: Access current conditions and forecasts
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnome-weather.local
6# Persistent global definitions
7include globals.local
8
9# when gjs apps are started via gnome-shell, firejail is not applied because systemd will start them
10
11noblacklist ${HOME}/.cache/libgweather
12
13# Allow gjs (blacklisted by disable-interpreters.inc)
14include allow-gjs.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45# private-bin gjs,gnome-weather
46private-dev
47# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl
48private-tmp
49
diff --git a/etc/profile-a-l/gnome_games-common.profile b/etc/profile-a-l/gnome_games-common.profile
new file mode 100644
index 000000000..4ad39a988
--- /dev/null
+++ b/etc/profile-a-l/gnome_games-common.profile
@@ -0,0 +1,49 @@
1# Firejail profile for gnome_games-common
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gnome_games-common.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17include whitelist-common.inc
18include whitelist-runuser-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24machine-id
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37seccomp.block-secondary
38shell none
39tracelog
40
41disable-mnt
42private-cache
43private-dev
44private-etc dconf,fonts,gconf,gtk-2.0,gtk-3.0,machine-id,pango,passwd,X11
45private-tmp
46
47dbus-user filter
48dbus-user.talk ca.desrt.dconf
49dbus-system none
diff --git a/etc/profile-a-l/gnote.profile b/etc/profile-a-l/gnote.profile
new file mode 100644
index 000000000..2d4ce2437
--- /dev/null
+++ b/etc/profile-a-l/gnote.profile
@@ -0,0 +1,60 @@
1# Firejail profile for gnote
2# Description: A simple note-taking application for Gnome
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnote.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gnote
10noblacklist ${HOME}/.local/share/gnote
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/gnote
21mkdir ${HOME}/.local/share/gnote
22whitelist ${HOME}/.config/gnote
23whitelist ${HOME}/.local/share/gnote
24whitelist /usr/libexec/webkit2gtk-4.0
25whitelist /usr/share/gnote
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33machine-id
34net none
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix
46seccomp
47shell none
48tracelog
49
50disable-mnt
51private-bin gnote
52private-cache
53private-dev
54private-etc dconf,fonts,gtk-3.0,pango,X11
55private-tmp
56
57dbus-user filter
58dbus-user.own org.gnome.Gnote
59dbus-user.talk ca.desrt.dconf
60dbus-system none
diff --git a/etc/profile-a-l/gnubik.profile b/etc/profile-a-l/gnubik.profile
new file mode 100644
index 000000000..902e76416
--- /dev/null
+++ b/etc/profile-a-l/gnubik.profile
@@ -0,0 +1,50 @@
1# Firejail profile for gnubik
2# Description: DESCRIPTION
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gnubik.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/gnubik
18include whitelist-common.inc
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private
43private-bin gnubik
44private-cache
45private-dev
46private-etc drirc,fonts,gtk-2.0
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-a-l/godot.profile b/etc/profile-a-l/godot.profile
new file mode 100644
index 000000000..b3c19e97f
--- /dev/null
+++ b/etc/profile-a-l/godot.profile
@@ -0,0 +1,45 @@
1# Firejail profile for godot
2# Description: multi-platform 2D and 3D game engine with a feature-rich editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include godot.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/godot
10noblacklist ${HOME}/.config/godot
11noblacklist ${HOME}/.local/share/godot
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32protocol unix,inet,inet6,netlink
33seccomp
34shell none
35tracelog
36
37
38# private-bin godot
39private-cache
40private-dev
41private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,machine-id,mono,nsswitch.conf,openal,pki,pulse,resolv.conf,ssl
42private-tmp
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-a-l/goobox.profile b/etc/profile-a-l/goobox.profile
new file mode 100644
index 000000000..2ff3bc8d9
--- /dev/null
+++ b/etc/profile-a-l/goobox.profile
@@ -0,0 +1,35 @@
1# Firejail profile for goobox
2# Description: CD player and ripper with GNOME 3 integration
3# This file is overwritten after every install/update
4# Persistent local customizations
5include goobox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${MUSIC}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
16
17caps.drop all
18netfilter
19no3d
20nogroups
21noinput
22nonewprivs
23noroot
24notv
25nou2f
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32# private-bin goobox
33private-dev
34# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl
35# private-tmp
diff --git a/etc/profile-a-l/google-chrome-beta.profile b/etc/profile-a-l/google-chrome-beta.profile
new file mode 100644
index 000000000..ebe5e870b
--- /dev/null
+++ b/etc/profile-a-l/google-chrome-beta.profile
@@ -0,0 +1,28 @@
1# Firejail profile for google-chrome-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-chrome-beta.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/google-chrome-beta
14noblacklist ${HOME}/.config/google-chrome-beta
15
16noblacklist ${HOME}/.config/chrome-beta-flags.conf
17noblacklist ${HOME}/.config/chrome-beta-flags.config
18
19mkdir ${HOME}/.cache/google-chrome-beta
20mkdir ${HOME}/.config/google-chrome-beta
21whitelist ${HOME}/.cache/google-chrome-beta
22whitelist ${HOME}/.config/google-chrome-beta
23
24whitelist ${HOME}/.config/chrome-beta-flags.conf
25whitelist ${HOME}/.config/chrome-beta-flags.config
26
27# Redirect
28include chromium-common.profile
diff --git a/etc/profile-a-l/google-chrome-stable.profile b/etc/profile-a-l/google-chrome-stable.profile
new file mode 100644
index 000000000..88cd43490
--- /dev/null
+++ b/etc/profile-a-l/google-chrome-stable.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for google-chrome
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-chrome-stable.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include google-chrome.profile
diff --git a/etc/profile-a-l/google-chrome-unstable.profile b/etc/profile-a-l/google-chrome-unstable.profile
new file mode 100644
index 000000000..4d303f71b
--- /dev/null
+++ b/etc/profile-a-l/google-chrome-unstable.profile
@@ -0,0 +1,28 @@
1# Firejail profile for google-chrome-unstable
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-chrome-unstable.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/google-chrome-unstable
14noblacklist ${HOME}/.config/google-chrome-unstable
15
16noblacklist ${HOME}/.config/chrome-unstable-flags.conf
17noblacklist ${HOME}/.config/chrome-unstable-flags.config
18
19mkdir ${HOME}/.cache/google-chrome-unstable
20mkdir ${HOME}/.config/google-chrome-unstable
21whitelist ${HOME}/.cache/google-chrome-unstable
22whitelist ${HOME}/.config/google-chrome-unstable
23
24whitelist ${HOME}/.config/chrome-unstable-flags.conf
25whitelist ${HOME}/.config/chrome-unstable-flags.config
26
27# Redirect
28include chromium-common.profile
diff --git a/etc/profile-a-l/google-chrome.profile b/etc/profile-a-l/google-chrome.profile
new file mode 100644
index 000000000..ed2595f72
--- /dev/null
+++ b/etc/profile-a-l/google-chrome.profile
@@ -0,0 +1,28 @@
1# Firejail profile for google-chrome
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-chrome.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/google-chrome
14noblacklist ${HOME}/.config/google-chrome
15
16noblacklist ${HOME}/.config/chrome-flags.conf
17noblacklist ${HOME}/.config/chrome-flags.config
18
19mkdir ${HOME}/.cache/google-chrome
20mkdir ${HOME}/.config/google-chrome
21whitelist ${HOME}/.cache/google-chrome
22whitelist ${HOME}/.config/google-chrome
23
24whitelist ${HOME}/.config/chrome-flags.conf
25whitelist ${HOME}/.config/chrome-flags.config
26
27# Redirect
28include chromium-common.profile
diff --git a/etc/profile-a-l/google-earth-pro.profile b/etc/profile-a-l/google-earth-pro.profile
new file mode 100644
index 000000000..249ae187d
--- /dev/null
+++ b/etc/profile-a-l/google-earth-pro.profile
@@ -0,0 +1,29 @@
1# Firejail profile for google-earth-pro
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-earth-pro.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Google Earth Pro can show issues that make it unpleasant to use, even when running unsandboxed.
10# See https://wiki.archlinux.org/index.php/Google_Earth#Troubleshooting for details.
11# Firejailing this application will demand extra work, as there are issues only upstream can fix (see #3906).
12# As an alternative one could use the web version: https://earth.google.com/web/.
13# The desktop version from the AUR can be made to work with firejail by appending the below snippet
14# to /usr/bin/googleearth-pro:
15# <--- snippet --->
16# Post-shutdown cleaning
17#_lock_app_running="${HOME}/.googleearth/instance-running-lock"
18#[[ -L "$_lock_app_running" ]] && rm -f "${_lock_app_running:?}"
19#_lock_collada_cache="/tmp/geColladaModelCacheLock"
20#[[ -e "$_lock_collada_cache" ]] && rm -f "${_lock_collada_cache:?}"
21#_lock_icon_cache="/tmp/geIconCacheLock"
22#[[ -e "$_lock_icon_cache" ]] && rm -f "${_lock_icon_cache:?}"
23# <--- end of snippet --->
24
25# If you see errors about missing commands, add 'ignore private-bin' to your google-earth-pro.local.
26private-bin google-earth-pro,googleearth,googleearth-bin,gpsbabel,readlink,repair_tool,rm,which,xdg-mime,xdg-settings
27
28# Redirect
29include google-earth.profile
diff --git a/etc/profile-a-l/google-earth.profile b/etc/profile-a-l/google-earth.profile
new file mode 100644
index 000000000..0153a58d1
--- /dev/null
+++ b/etc/profile-a-l/google-earth.profile
@@ -0,0 +1,42 @@
1# Firejail profile for google-earth
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-earth.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/Google
9noblacklist ${HOME}/.googleearth
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.config/Google
18mkdir ${HOME}/.googleearth
19whitelist ${HOME}/.config/Google
20whitelist ${HOME}/.googleearth
21include whitelist-common.inc
22
23caps.drop all
24ipc-namespace
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37
38disable-mnt
39private-bin bash,dirname,google-earth,grep,ls,sed,sh
40private-dev
41private-opt google
42
diff --git a/etc/profile-a-l/google-play-music-desktop-player.profile b/etc/profile-a-l/google-play-music-desktop-player.profile
new file mode 100644
index 000000000..fe61d727e
--- /dev/null
+++ b/etc/profile-a-l/google-play-music-desktop-player.profile
@@ -0,0 +1,42 @@
1# Firejail profile for google-play-music-desktop-player
2# This file is overwritten after every install/update
3# Persistent local customizations
4include google-play-music-desktop-player.local
5# Persistent global definitions
6include globals.local
7
8# noexec /tmp breaks mpris support
9ignore noexec /tmp
10
11noblacklist ${HOME}/.config/Google Play Music Desktop Player
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19mkdir ${HOME}/.config/Google Play Music Desktop Player
20# whitelist ${HOME}/.config/pulse
21# whitelist ${HOME}/.pulse
22whitelist ${HOME}/.config/Google Play Music Desktop Player
23include whitelist-common.inc
24
25caps.drop all
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37seccomp
38shell none
39
40disable-mnt
41private-dev
42private-tmp
diff --git a/etc/profile-a-l/googler-common.profile b/etc/profile-a-l/googler-common.profile
new file mode 100644
index 000000000..b8e2b04df
--- /dev/null
+++ b/etc/profile-a-l/googler-common.profile
@@ -0,0 +1,61 @@
1# Firejail profile for googler clones
2# Description: common profile for googler clones
3# This file is overwritten after every install/update
4# Persistent local customizations
5include googler-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13noblacklist ${HOME}/.w3m
14
15# Allow /bin/sh (blacklisted by disable-shell.inc)
16include allow-bin-sh.inc
17# Allow python (blacklisted by disable-interpreters.inc)
18include allow-python3.inc
19
20include disable-common.inc
21include disable-devel.inc
22include disable-exec.inc
23include disable-interpreters.inc
24include disable-programs.inc
25include disable-shell.inc
26include disable-xdg.inc
27
28whitelist ${HOME}/.w3m
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34ipc-namespace
35machine-id
36netfilter
37no3d
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix,inet,inet6
48seccomp
49seccomp.block-secondary
50shell none
51tracelog
52
53disable-mnt
54private-bin env,python3*,sh,w3m
55private-cache
56private-dev
57private-etc ca-certificates,crypto-policies,host.conf,hostname,hosts,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl
58private-tmp
59
60dbus-user none
61dbus-system none
diff --git a/etc/profile-a-l/googler.profile b/etc/profile-a-l/googler.profile
new file mode 100644
index 000000000..9d67006f6
--- /dev/null
+++ b/etc/profile-a-l/googler.profile
@@ -0,0 +1,13 @@
1# Firejail profile for googler
2# Description: Search Google from your terminal
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include googler.local
7# Persistent global definitions
8include globals.local
9
10private-bin googler
11
12# Redirect
13include googler-common.profile
diff --git a/etc/gpa.profile b/etc/profile-a-l/gpa.profile
index 8d721e2c0..091851fa8 100644
--- a/etc/gpa.profile
+++ b/etc/profile-a-l/gpa.profile
@@ -1,25 +1,28 @@
1# Firejail profile for gpa 1# Firejail profile for gpa
2# Description: GNU Privacy Assistant (GPA)
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/gpa.local 5include gpa.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ~/.gnupg 9noblacklist ${HOME}/.gnupg
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-interpreters.inc
13include /etc/firejail/disable-programs.inc 14include disable-programs.inc
14 15
15caps.drop all 16caps.drop all
16netfilter 17netfilter
17nodvd 18nodvd
18nogroups 19nogroups
20noinput
19nonewprivs 21nonewprivs
20noroot 22noroot
21nosound 23nosound
22notv 24notv
25nou2f
23novideo 26novideo
24protocol unix,inet,inet6 27protocol unix,inet,inet6
25seccomp 28seccomp
diff --git a/etc/profile-a-l/gpg-agent.profile b/etc/profile-a-l/gpg-agent.profile
new file mode 100644
index 000000000..c6ecef5ec
--- /dev/null
+++ b/etc/profile-a-l/gpg-agent.profile
@@ -0,0 +1,52 @@
1# Firejail profile for gpg-agent
2# Description: GNU privacy guard - cryptographic agent
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gpg-agent.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.gnupg
11
12blacklist /tmp/.X11-unix
13blacklist ${RUNUSER}/wayland-*
14
15include disable-common.inc
16include disable-devel.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.gnupg
22whitelist ${HOME}/.gnupg
23whitelist ${RUNUSER}/gnupg
24whitelist ${RUNUSER}/keyring
25whitelist /usr/share/gnupg
26whitelist /usr/share/gnupg2
27include whitelist-common.inc
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32caps.drop all
33machine-id
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6
46seccomp
47shell none
48tracelog
49
50# private-bin gpg-agent,gpg
51private-cache
52private-dev
diff --git a/etc/profile-a-l/gpg.profile b/etc/profile-a-l/gpg.profile
new file mode 100644
index 000000000..cf58ebdb0
--- /dev/null
+++ b/etc/profile-a-l/gpg.profile
@@ -0,0 +1,54 @@
1# Firejail profile for gpg
2# Description: GNU Privacy Guard -- minimalist public key operations
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gpg.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.gnupg
11
12blacklist /tmp/.X11-unix
13blacklist ${RUNUSER}/wayland-*
14
15include disable-common.inc
16include disable-devel.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20whitelist ${RUNUSER}/gnupg
21whitelist ${RUNUSER}/keyring
22whitelist /usr/share/gnupg
23whitelist /usr/share/gnupg2
24whitelist /usr/share/pacman/keyrings
25include whitelist-runuser-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29caps.drop all
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44tracelog
45
46# private-bin gpg,gpg-agent
47private-cache
48private-dev
49
50# On Arch 'archlinux-keyring' needs read-write access to /etc/pacman.d/gnupg
51# and /usr/share/pacman/keyrings. Although this works, it makes
52# installing/upgrading archlinux-keyring extremely slow.
53read-write /etc/pacman.d/gnupg
54read-write /usr/share/pacman/keyrings
diff --git a/etc/profile-a-l/gpg2.profile b/etc/profile-a-l/gpg2.profile
new file mode 100644
index 000000000..b831b0f62
--- /dev/null
+++ b/etc/profile-a-l/gpg2.profile
@@ -0,0 +1,13 @@
1# Firejail profile for gpg2
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include gpg2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# private-bin gpg2
11
12# Redirect
13include gpg.profile
diff --git a/etc/profile-a-l/gpicview.profile b/etc/profile-a-l/gpicview.profile
new file mode 100644
index 000000000..9a782b238
--- /dev/null
+++ b/etc/profile-a-l/gpicview.profile
@@ -0,0 +1,51 @@
1# Firejail profile for gpicview
2# Description: Lightweight image viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gpicview.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/gpicview
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18whitelist /usr/share/gpicview
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25machine-id
26net none
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40
41private-bin gpicview
42private-cache
43private-dev
44private-etc alternatives,fonts,group,passwd
45private-lib
46private-tmp
47
48dbus-user none
49dbus-system none
50
51memory-deny-write-execute
diff --git a/etc/profile-a-l/gpredict.profile b/etc/profile-a-l/gpredict.profile
new file mode 100644
index 000000000..54e52d695
--- /dev/null
+++ b/etc/profile-a-l/gpredict.profile
@@ -0,0 +1,41 @@
1# Firejail profile for gpredict
2# Description: Satellite tracking program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gpredict.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Gpredict
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18mkdir ${HOME}/.config/Gpredict
19whitelist ${HOME}/.config/Gpredict
20include whitelist-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37private-bin gpredict
38private-dev
39private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,resolv.conf,ssl
40private-tmp
41
diff --git a/etc/profile-a-l/gradio.profile b/etc/profile-a-l/gradio.profile
new file mode 100644
index 000000000..31f95fb80
--- /dev/null
+++ b/etc/profile-a-l/gradio.profile
@@ -0,0 +1,55 @@
1# Firejail profile for gradio
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gradio.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/gradio
9noblacklist ${HOME}/.local/share/gradio
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.cache/gradio
19mkdir ${HOME}/.local/share/gradio
20whitelist ${HOME}/.cache/gradio
21whitelist ${HOME}/.local/share/gradio
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28netfilter
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43
44disable-mnt
45private-bin gradio
46private-cache
47private-dev
48private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-3.0,host.conf,hostname,hosts,machine-id,pki,pulse,resolv.conf,ssl,xdg
49private-tmp
50
51dbus-user filter
52dbus-user.own de.haeckerfelix.gradio
53dbus-user.own org.mpris.MediaPlayer2.gradio
54dbus-user.talk ca.desrt.dconf
55dbus-system none
diff --git a/etc/profile-a-l/gramps.profile b/etc/profile-a-l/gramps.profile
new file mode 100644
index 000000000..4baca353b
--- /dev/null
+++ b/etc/profile-a-l/gramps.profile
@@ -0,0 +1,51 @@
1# Firejail profile for gramps
2# Description: genealogy program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gramps.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.gramps
10
11# Allow python (blacklisted by disable-interpreters.inc)
12#include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.gramps
23whitelist ${HOME}/.gramps
24include whitelist-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44
45disable-mnt
46private-cache
47private-dev
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile b/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile
new file mode 100644
index 000000000..c5bcc85f3
--- /dev/null
+++ b/etc/profile-a-l/gravity-beams-and-evaporating-stars.profile
@@ -0,0 +1,47 @@
1# Firejail profile for gravity-beams-and-evaporating-stars
2# Description: a game about hurling asteroids into the sun
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gravity-beams-and-evaporating-stars.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/gravity-beams-and-evaporating-stars
18include whitelist-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32novideo
33protocol unix
34seccomp
35shell none
36tracelog
37
38disable-mnt
39private
40private-bin gravity-beams-and-evaporating-stars
41private-cache
42private-dev
43private-etc fonts,machine-id
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-a-l/gsettings-data-convert.profile b/etc/profile-a-l/gsettings-data-convert.profile
new file mode 100644
index 000000000..6f1d43939
--- /dev/null
+++ b/etc/profile-a-l/gsettings-data-convert.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gsettings-data-convert
2# Description: An obsolete configuration database system (CLI utility)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gsettings-data-convert.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gconf.profile
diff --git a/etc/profile-a-l/gsettings-schema-convert.profile b/etc/profile-a-l/gsettings-schema-convert.profile
new file mode 100644
index 000000000..5c8b0e2e2
--- /dev/null
+++ b/etc/profile-a-l/gsettings-schema-convert.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gsettings-schema-convert
2# Description: An obsolete configuration database system (CLI utility)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gsettings-schema-convert.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gconf.profile
diff --git a/etc/profile-a-l/gsettings.profile b/etc/profile-a-l/gsettings.profile
new file mode 100644
index 000000000..2203fac15
--- /dev/null
+++ b/etc/profile-a-l/gsettings.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gsettings
2# Description: GSettings configuration tool
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gsettings.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include dconf.profile
diff --git a/etc/profile-a-l/gtar.profile b/etc/profile-a-l/gtar.profile
new file mode 100644
index 000000000..e3a02e7bc
--- /dev/null
+++ b/etc/profile-a-l/gtar.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for tar
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gtar.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include tar.profile
diff --git a/etc/gthumb.profile b/etc/profile-a-l/gthumb.profile
index 287e214e1..4218f8545 100644
--- a/etc/gthumb.profile
+++ b/etc/profile-a-l/gthumb.profile
@@ -1,26 +1,30 @@
1# Firejail profile for gthumb 1# Firejail profile for gthumb
2# Description: Image viewer and browser
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/gthumb.local 5include gthumb.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/gthumb 9noblacklist ${HOME}/.config/gthumb
9noblacklist ~/.Steam 10noblacklist ${HOME}/.Steam
10noblacklist ~/.steam 11noblacklist ${HOME}/.steam
11 12
12include /etc/firejail/disable-common.inc 13include disable-common.inc
13include /etc/firejail/disable-devel.inc 14include disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 15include disable-interpreters.inc
15include /etc/firejail/disable-programs.inc 16include disable-programs.inc
17include disable-shell.inc
16 18
17caps.drop all 19caps.drop all
18nodvd 20nodvd
19nogroups 21nogroups
22noinput
20nonewprivs 23nonewprivs
21noroot 24noroot
22nosound 25nosound
23notv 26notv
27nou2f
24novideo 28novideo
25protocol unix 29protocol unix
26seccomp 30seccomp
@@ -28,5 +32,6 @@ shell none
28tracelog 32tracelog
29 33
30private-bin gthumb 34private-bin gthumb
35private-cache
31private-dev 36private-dev
32private-tmp 37private-tmp
diff --git a/etc/profile-a-l/gtk-pipe-viewer.profile b/etc/profile-a-l/gtk-pipe-viewer.profile
new file mode 100644
index 000000000..9c212ff6e
--- /dev/null
+++ b/etc/profile-a-l/gtk-pipe-viewer.profile
@@ -0,0 +1,12 @@
1# Firejail profile for gtk-pipe-viewer
2# Description: Gtk front-end to pipe-viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gtk-pipe-viewer.local
6# added by included profile
7#include globals.local
8
9ignore quiet
10
11# Redirect
12include pipe-viewer.profile
diff --git a/etc/profile-a-l/gtk-straw-viewer.profile b/etc/profile-a-l/gtk-straw-viewer.profile
new file mode 100644
index 000000000..978b3d896
--- /dev/null
+++ b/etc/profile-a-l/gtk-straw-viewer.profile
@@ -0,0 +1,12 @@
1# Firejail profile for gtk-straw-viewer
2# Description: Gtk front-end to straw-viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gtk-straw-viewer.local
6# added by included profile
7#include globals.local
8
9ignore quiet
10
11# Redirect
12include straw-viewer.profile
diff --git a/etc/profile-a-l/gtk-update-icon-cache.profile b/etc/profile-a-l/gtk-update-icon-cache.profile
new file mode 100644
index 000000000..3231374b7
--- /dev/null
+++ b/etc/profile-a-l/gtk-update-icon-cache.profile
@@ -0,0 +1,56 @@
1# Firejail profile for gtk-update-icon-cache
2# Description: Icon theme caching utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gtk-update-icon-cache.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20include whitelist-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27machine-id
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43x11 none
44
45disable-mnt
46private-bin gtk-update-icon-cache
47private-cache
48private-dev
49private-etc none
50private-lib
51private-tmp
52
53dbus-user none
54dbus-system none
55
56memory-deny-write-execute
diff --git a/etc/profile-a-l/gtk-youtube-viewer.profile b/etc/profile-a-l/gtk-youtube-viewer.profile
new file mode 100644
index 000000000..c814f0fef
--- /dev/null
+++ b/etc/profile-a-l/gtk-youtube-viewer.profile
@@ -0,0 +1,12 @@
1# Firejail profile for gtk-youtube-viewer
2# Description: Gtk front-end to youtube-viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gtk-youtube-viewer.local
6# added by included profile
7#include globals.local
8
9ignore quiet
10
11# Redirect
12include youtube-viewer.profile
diff --git a/etc/profile-a-l/gtk2-youtube-viewer.profile b/etc/profile-a-l/gtk2-youtube-viewer.profile
new file mode 100644
index 000000000..787c7bd90
--- /dev/null
+++ b/etc/profile-a-l/gtk2-youtube-viewer.profile
@@ -0,0 +1,17 @@
1# Firejail profile for gtk2-youtube-viewer
2# Description: Gtk front-end to youtube-viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gtk2-youtube-viewer.local
6# added by included profile
7#include globals.local
8
9ignore quiet
10
11noblacklist /tmp/.X11-unix
12noblacklist ${RUNUSER}
13
14include whitelist-runuser-common.inc
15
16# Redirect
17include youtube-viewer.profile
diff --git a/etc/profile-a-l/gtk3-youtube-viewer.profile b/etc/profile-a-l/gtk3-youtube-viewer.profile
new file mode 100644
index 000000000..988882622
--- /dev/null
+++ b/etc/profile-a-l/gtk3-youtube-viewer.profile
@@ -0,0 +1,17 @@
1# Firejail profile for gtk3-youtube-viewer
2# Description: Gtk front-end to youtube-viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gtk3-youtube-viewer.local
6# added by included profile
7#include globals.local
8
9ignore quiet
10
11noblacklist /tmp/.X11-unix
12noblacklist ${RUNUSER}
13
14include whitelist-runuser-common.inc
15
16# Redirect
17include youtube-viewer.profile
diff --git a/etc/guayadeque.profile b/etc/profile-a-l/guayadeque.profile
index 14662443c..39fb177dd 100644
--- a/etc/guayadeque.profile
+++ b/etc/profile-a-l/guayadeque.profile
@@ -1,23 +1,29 @@
1# Firejail profile for guayadeque 1# Firejail profile for guayadeque
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/guayadeque.local 4include guayadeque.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.guayadeque 8noblacklist ${HOME}/.guayadeque
9noblacklist ${MUSIC}
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-exec.inc
13include /etc/firejail/disable-programs.inc 14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
14 18
15caps.drop all 19caps.drop all
16netfilter 20netfilter
17nogroups 21nogroups
22noinput
18nonewprivs 23nonewprivs
19noroot 24noroot
20notv 25notv
26nou2f
21novideo 27novideo
22protocol unix,inet,inet6,netlink 28protocol unix,inet,inet6,netlink
23seccomp 29seccomp
@@ -27,5 +33,3 @@ private-bin guayadeque
27private-dev 33private-dev
28private-tmp 34private-tmp
29 35
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/profile-a-l/gucharmap.profile b/etc/profile-a-l/gucharmap.profile
new file mode 100644
index 000000000..d47000e89
--- /dev/null
+++ b/etc/profile-a-l/gucharmap.profile
@@ -0,0 +1,54 @@
1# Firejail profile for gucharmap
2# Description: Unicode character picker and font browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gucharmap.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17include whitelist-common.inc
18include whitelist-runuser-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24machine-id
25#net none - breaks dbus
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38seccomp.block-secondary
39shell none
40tracelog
41
42disable-mnt
43private-bin gnome-character-map,gucharmap
44private-cache
45private-dev
46private-etc alternatives,dbus-1,dconf,fonts,gconf,gtk-2.0,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,pango,X11,xdg
47private-lib
48private-tmp
49
50# breaks state saving
51# dbus-user none
52# dbus-system none
53
54read-only ${HOME}
diff --git a/etc/profile-a-l/gummi.profile b/etc/profile-a-l/gummi.profile
new file mode 100644
index 000000000..2223c37a1
--- /dev/null
+++ b/etc/profile-a-l/gummi.profile
@@ -0,0 +1,23 @@
1# Firejail profile for gummi
2# This file is overwritten after every install/update
3# Persistent local customizations
4include gummi.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/gummi
9noblacklist ${HOME}/.config/gummi
10
11# Allow lua (blacklisted by disable-interpreters.inc)
12include allow-lua.inc
13
14# Allow perl (blacklisted by disable-interpreters.inc)
15include allow-perl.inc
16
17# Allow python (blacklisted by disable-interpreters.inc)
18include allow-python3.inc
19
20private-bin dvipdf,dvips,env,gummi,latex,latexmk,lua*,pdflatex,pdftex,perl,ps2pdf,python3*,rubber,synctex,tex,xelatex,xetex
21
22# Redirect
23include latex-common.profile
diff --git a/etc/profile-a-l/gunzip.profile b/etc/profile-a-l/gunzip.profile
new file mode 100644
index 000000000..584d88f85
--- /dev/null
+++ b/etc/profile-a-l/gunzip.profile
@@ -0,0 +1,13 @@
1# Firejail profile for gunzip
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include gunzip.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10include allow-bin-sh.inc
11
12# Redirect
13include gzip.profile
diff --git a/etc/profile-a-l/guvcview.profile b/etc/profile-a-l/guvcview.profile
new file mode 100644
index 000000000..8ddde3c47
--- /dev/null
+++ b/etc/profile-a-l/guvcview.profile
@@ -0,0 +1,55 @@
1# Firejail profile for guvcview
2# Description: GTK+ base UVC Viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include guvcview.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/guvcview2
10
11noblacklist ${PICTURES}
12noblacklist ${VIDEOS}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.config/guvcview2
23whitelist ${HOME}/.config/guvcview2
24whitelist ${PICTURES}
25whitelist ${VIDEOS}
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33net none
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41protocol unix,netlink
42seccomp
43seccomp.block-secondary
44shell none
45tracelog
46
47disable-mnt
48private-bin guvcview
49private-cache
50private-dev
51private-etc alsa,alternatives,asound.conf,bumblebee,dconf,drirc,fonts,glvnd,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nvidia,pango,pulse,X11
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-a-l/gwenview.profile b/etc/profile-a-l/gwenview.profile
new file mode 100644
index 000000000..8c4453a8b
--- /dev/null
+++ b/etc/profile-a-l/gwenview.profile
@@ -0,0 +1,54 @@
1# Firejail profile for gwenview
2# Description: Image viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include gwenview.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/GIMP
10noblacklist ${HOME}/.config/gwenviewrc
11noblacklist ${HOME}/.config/org.kde.gwenviewrc
12noblacklist ${HOME}/.gimp*
13noblacklist ${HOME}/.kde/share/apps/gwenview
14noblacklist ${HOME}/.kde/share/config/gwenviewrc
15noblacklist ${HOME}/.kde4/share/apps/gwenview
16noblacklist ${HOME}/.kde4/share/config/gwenviewrc
17noblacklist ${HOME}/.local/share/gwenview
18noblacklist ${HOME}/.local/share/kxmlgui5/gwenview
19noblacklist ${HOME}/.local/share/org.kde.gwenview
20
21include disable-common.inc
22include disable-devel.inc
23include disable-exec.inc
24include disable-interpreters.inc
25include disable-programs.inc
26include disable-shell.inc
27
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32# net none
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44shell none
45# tracelog
46
47private-bin gimp*,gwenview,kbuildsycoca4,kdeinit4
48private-dev
49private-etc alternatives,fonts,gimp,gtk-2.0,kde4rc,kde5rc,ld.so.cache,machine-id,passwd,pulse,xdg
50
51# dbus-user none
52# dbus-system none
53
54# memory-deny-write-execute
diff --git a/etc/profile-a-l/gzexe.profile b/etc/profile-a-l/gzexe.profile
new file mode 100644
index 000000000..bb570d553
--- /dev/null
+++ b/etc/profile-a-l/gzexe.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gzexe
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include gzexe.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-a-l/gzip.profile b/etc/profile-a-l/gzip.profile
new file mode 100644
index 000000000..b261c16f4
--- /dev/null
+++ b/etc/profile-a-l/gzip.profile
@@ -0,0 +1,15 @@
1# Firejail profile for gzip
2# Description: GNU compression utilities
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include gzip.local
7# Persistent global definitions
8include globals.local
9
10# Arch Linux (based distributions) need access to /var/lib/pacman. As we drop
11# all capabilities this is automatically read-only.
12noblacklist /var/lib/pacman
13
14# Redirect
15include archiver-common.profile
diff --git a/etc/profile-a-l/handbrake-gtk.profile b/etc/profile-a-l/handbrake-gtk.profile
new file mode 100644
index 000000000..42371a853
--- /dev/null
+++ b/etc/profile-a-l/handbrake-gtk.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for handbrake
2# This file is overwritten after every install/update
3# Persistent local customizations
4include handbrake-gtk.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include handbrake.profile
diff --git a/etc/profile-a-l/handbrake.profile b/etc/profile-a-l/handbrake.profile
new file mode 100644
index 000000000..9ad9aef33
--- /dev/null
+++ b/etc/profile-a-l/handbrake.profile
@@ -0,0 +1,39 @@
1# Firejail profile for handbrake
2# Description: Versatile DVD ripper and video transcoder (GTK+ GUI)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include handbrake.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/ghb
10noblacklist ${MUSIC}
11noblacklist ${VIDEOS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24net none
25nogroups
26noinput
27nonewprivs
28noroot
29nou2f
30novideo
31protocol unix,inet,inet6,netlink
32seccomp
33shell none
34
35private-dev
36private-tmp
37
38dbus-user none
39dbus-system none
diff --git a/etc/profile-a-l/hashcat.profile b/etc/profile-a-l/hashcat.profile
new file mode 100644
index 000000000..3be349176
--- /dev/null
+++ b/etc/profile-a-l/hashcat.profile
@@ -0,0 +1,46 @@
1# Firejail profile for hashcat
2# Description: World's fastest and most advanced password recovery utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include hashcat.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12noblacklist ${HOME}/.hashcat
13noblacklist /usr/include
14noblacklist ${DOCUMENTS}
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23caps.drop all
24net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37x11 none
38
39disable-mnt
40private-bin hashcat
41private-cache
42private-dev
43private-tmp
44
45dbus-user none
46dbus-system none
diff --git a/etc/profile-a-l/hasher-common.profile b/etc/profile-a-l/hasher-common.profile
new file mode 100644
index 000000000..8c1ada1d1
--- /dev/null
+++ b/etc/profile-a-l/hasher-common.profile
@@ -0,0 +1,59 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include hasher-common.local
4
5# common profile for hasher/checksum tools
6
7blacklist ${RUNUSER}
8
9# Comment/uncomment the relevant include file(s) in your hasher-common.local
10# to (un)restrict file access for **all** hashers. Another option is to do this **per hasher**
11# in the relevant <hasher>.local. Beware that things tend to break when overtightening
12# profiles. For example, because you only need to hash/check files in ${DOWNLOADS},
13# other applications may need access to ${HOME}/.local/share.
14
15# Add the next line to your hasher-common.local if you don't need to hash files in disable-common.inc.
16#include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20# Add the next line to your hasher-common.local if you don't need to hash files in disable-programs.inc.
21#include disable-programs.inc
22include disable-shell.inc
23include disable-write-mnt.inc
24# Add the next line to your hasher-common.local if you don't need to hash files in disable-xdg.inc.
25#include disable-xdg.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47x11 none
48
49# Add the next line to your hasher-common.local if you don't need to hash files in ~/.cache.
50#private-cache
51private-dev
52# Add the next line to your hasher-common.local if you don't need to hash files in /tmp.
53#private-tmp
54
55dbus-user none
56dbus-system none
57
58memory-deny-write-execute
59read-only ${HOME}
diff --git a/etc/profile-a-l/hedgewars.profile b/etc/profile-a-l/hedgewars.profile
new file mode 100644
index 000000000..9c6f162c6
--- /dev/null
+++ b/etc/profile-a-l/hedgewars.profile
@@ -0,0 +1,37 @@
1# Firejail profile for hedgewars
2# Description: Funny turn-based artillery game, featuring fighting hedgehogs
3# This file is overwritten after every install/update
4# Persistent local customizations
5include hedgewars.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.hedgewars
10
11include allow-lua.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18mkdir ${HOME}/.hedgewars
19whitelist ${HOME}/.hedgewars
20include whitelist-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32seccomp
33tracelog
34
35disable-mnt
36private-dev
37private-tmp
diff --git a/etc/profile-a-l/hexchat.profile b/etc/profile-a-l/hexchat.profile
new file mode 100644
index 000000000..88448ad45
--- /dev/null
+++ b/etc/profile-a-l/hexchat.profile
@@ -0,0 +1,58 @@
1# Firejail profile for hexchat
2# Description: IRC client for X based on X-Chat 2
3# This file is overwritten after every install/update
4# Persistent local customizations
5include hexchat.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/hexchat
10
11# Allow /bin/sh (blacklisted by disable-shell.inc)
12include allow-bin-sh.inc
13
14# Allow perl (blacklisted by disable-interpreters.inc)
15include allow-perl.inc
16
17# Allow python (blacklisted by disable-interpreters.inc)
18include allow-python2.inc
19include allow-python3.inc
20
21include disable-common.inc
22include disable-devel.inc
23include disable-exec.inc
24include disable-interpreters.inc
25include disable-programs.inc
26include disable-shell.inc
27include disable-xdg.inc
28
29mkdir ${HOME}/.config/hexchat
30whitelist ${HOME}/.config/hexchat
31include whitelist-common.inc
32include whitelist-var-common.inc
33
34caps.drop all
35#machine-id -- breaks sound
36netfilter
37no3d
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43notv
44nou2f
45novideo
46protocol unix,inet,inet6
47seccomp
48shell none
49tracelog
50
51disable-mnt
52# debug note: private-bin requires perl, python, etc on some systems
53private-bin hexchat,python*,sh
54private-dev
55#private-lib - python problems
56private-tmp
57
58# memory-deny-write-execute - breaks python
diff --git a/etc/profile-a-l/highlight.profile b/etc/profile-a-l/highlight.profile
new file mode 100644
index 000000000..0145f7ceb
--- /dev/null
+++ b/etc/profile-a-l/highlight.profile
@@ -0,0 +1,41 @@
1# Firejail profile for highlight
2# Description: Universal source code to formatted text converter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include highlight.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16
17caps.drop all
18net none
19no3d
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25nosound
26notv
27nou2f
28novideo
29protocol unix
30seccomp
31shell none
32tracelog
33x11 none
34
35private-bin highlight
36private-cache
37private-dev
38private-tmp
39
40dbus-user none
41dbus-system none
diff --git a/etc/profile-a-l/hitori.profile b/etc/profile-a-l/hitori.profile
new file mode 100644
index 000000000..6d67f4587
--- /dev/null
+++ b/etc/profile-a-l/hitori.profile
@@ -0,0 +1,14 @@
1# Firejail profile for hitori
2# Description: Play the Hitori puzzle game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include hitori.local
6# Persistent global definitions
7include globals.local
8
9private-bin hitori
10
11dbus-user.own org.gnome.Hitori
12
13# Redirect
14include gnome_games-common.profile
diff --git a/etc/profile-a-l/homebank.profile b/etc/profile-a-l/homebank.profile
new file mode 100644
index 000000000..f2dac5881
--- /dev/null
+++ b/etc/profile-a-l/homebank.profile
@@ -0,0 +1,59 @@
1# Firejail profile for homebank
2# Description: Personal finance manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include homebank.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/homebank
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/homebank
20whitelist ${DOWNLOADS}
21whitelist ${HOME}/.config/homebank
22whitelist /usr/share/homebank
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30machine-id
31# net none
32netfilter
33nodvd
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix,inet,inet6
45seccomp
46shell none
47tracelog
48
49disable-mnt
50private-bin homebank
51private-cache
52private-dev
53private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gtk-3.0,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11
54private-tmp
55
56dbus-user none
57dbus-system none
58
59# memory-deny-write-execute
diff --git a/etc/profile-a-l/host.profile b/etc/profile-a-l/host.profile
new file mode 100644
index 000000000..984e90e1f
--- /dev/null
+++ b/etc/profile-a-l/host.profile
@@ -0,0 +1,52 @@
1# Firejail profile for host
2# Description: DNS lookup utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include host.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11noblacklist ${PATH}/host
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private
45private-bin bash,host,sh
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
51
52memory-deny-write-execute
diff --git a/etc/profile-a-l/hugin.profile b/etc/profile-a-l/hugin.profile
new file mode 100644
index 000000000..0a9c831f3
--- /dev/null
+++ b/etc/profile-a-l/hugin.profile
@@ -0,0 +1,42 @@
1# Firejail profile for hugin
2# Description: Panorama photo stitcher
3# This file is overwritten after every install/update
4# Persistent local customizations
5include hugin.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.hugin
10noblacklist ${DOCUMENTS}
11noblacklist ${PICTURES}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21caps.drop all
22net none
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35
36private-bin align_image_stack,autooptimiser,calibrate_lens_gui,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,enblend,fulla,geocpset,hugin,hugin_executor,hugin_hdrmerge,hugin_lensdb,hugin_stitch_project,icpfind,linefind,nona,pano_modify,pano_trafo,PTBatcherGUI,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,tca_correct,verdandi,vig_optimize
37private-cache
38private-dev
39private-tmp
40
41dbus-user none
42dbus-system none
diff --git a/etc/profile-a-l/hyperrogue.profile b/etc/profile-a-l/hyperrogue.profile
new file mode 100644
index 000000000..f210a264f
--- /dev/null
+++ b/etc/profile-a-l/hyperrogue.profile
@@ -0,0 +1,51 @@
1# Firejail profile for hyperrogue
2# Description: An SDL roguelike in a non-euclidean world
3# This file is overwritten after every install/update
4# Persistent local customizations
5include hyperrogue.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/hyperrogue.ini
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkfile ${HOME}/hyperrogue.ini
20whitelist ${HOME}/hyperrogue.ini
21whitelist /usr/share/hyperrogue
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin hyperrogue
44private-cache
45private-cwd ${HOME}
46private-dev
47private-etc fonts,machine-id
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-a-l/i2prouter.profile b/etc/profile-a-l/i2prouter.profile
new file mode 100644
index 000000000..c875cad72
--- /dev/null
+++ b/etc/profile-a-l/i2prouter.profile
@@ -0,0 +1,72 @@
1# Firejail profile for I2P
2# Description: A distributed anonymous network
3# This file is overwritten after every install/update
4# Persistent local customizations
5include i2prouter.local
6# Persistent global definitions
7include globals.local
8
9# Notice: default browser will most likely not be able to automatically open, due to sandbox.
10# Auto-opening default browser can be disabled in the I2P router console.
11# This profile will not currently work with any Arch User Repository I2P packages,
12# use the distro-independent official I2P java installer instead.
13
14# Only needed when i2prouter binary resides in home directory (official I2P java installer does so).
15ignore noexec ${HOME}
16
17noblacklist ${HOME}/.config/i2p
18noblacklist ${HOME}/.i2p
19noblacklist ${HOME}/.local/share/i2p
20noblacklist ${HOME}/i2p
21# Only needed when wrapper resides in /usr/sbin/ (Ubuntu official I2P PPA package does so).
22noblacklist /usr/sbin
23
24# Allow java (blacklisted by disable-devel.inc)
25include allow-java.inc
26
27include disable-common.inc
28include disable-devel.inc
29include disable-exec.inc
30include disable-interpreters.inc
31include disable-programs.inc
32include disable-xdg.inc
33
34mkdir ${HOME}/.config/i2p
35mkdir ${HOME}/.i2p
36mkdir ${HOME}/.local/share/i2p
37mkdir ${HOME}/i2p
38whitelist ${HOME}/.config/i2p
39whitelist ${HOME}/.i2p
40whitelist ${HOME}/.local/share/i2p
41whitelist ${HOME}/i2p
42# Only needed when wrapper resides in /usr/sbin/ (Ubuntu official I2P PPA package does so).
43whitelist /usr/sbin/wrapper*
44
45include whitelist-common.inc
46
47# May break I2P if wrapper resides in the home directory (official I2P java installer does so).
48# When using the Ubuntu official I2P PPA it should be fine to add 'apparmor' to your i2prouter.local,
49# as it places the wrapper in /usr/sbin/
50#apparmor
51caps.drop all
52ipc-namespace
53machine-id
54netfilter
55no3d
56nodvd
57nogroups
58noinput
59nonewprivs
60nosound
61notv
62nou2f
63novideo
64protocol unix,inet,inet6
65seccomp
66shell none
67
68disable-mnt
69private-cache
70private-dev
71private-etc alternatives,ca-certificates,crypto-policies,dconf,group,hostname,hosts,i2p,java-10-openjdk,java-11-openjdk,java-12-openjdk,java-13-openjdk,java-8-openjdk,java-9-openjdk,java-openjdk,ld.so.cache,localtime,machine-id,nsswitch.conf,passwd,pki,resolv.conf,ssl
72private-tmp
diff --git a/etc/profile-a-l/i3.profile b/etc/profile-a-l/i3.profile
new file mode 100644
index 000000000..e96b1843c
--- /dev/null
+++ b/etc/profile-a-l/i3.profile
@@ -0,0 +1,18 @@
1# Firejail profile for i3
2# Description: Standards-compliant, fast, light-weight and extensible window manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include i3.local
6# Persistent global definitions
7include globals.local
8
9# all applications started in i3 will run in this profile
10noblacklist ${HOME}/.config/i3
11include disable-common.inc
12
13caps.drop all
14netfilter
15noroot
16protocol unix,inet,inet6
17seccomp
18
diff --git a/etc/profile-a-l/iagno.profile b/etc/profile-a-l/iagno.profile
new file mode 100644
index 000000000..863dc8acf
--- /dev/null
+++ b/etc/profile-a-l/iagno.profile
@@ -0,0 +1,40 @@
1# Firejail profile for iagno
2# Description: Reversi clone for Gnome desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include iagno.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15
16include whitelist-var-common.inc
17
18apparmor
19caps.drop all
20net none
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26notv
27nou2f
28novideo
29protocol unix
30seccomp
31shell none
32
33disable-mnt
34private
35private-bin iagno
36private-dev
37private-tmp
38
39# dbus-user none
40# dbus-system none
diff --git a/etc/profile-a-l/icecat.profile b/etc/profile-a-l/icecat.profile
new file mode 100644
index 000000000..660343a29
--- /dev/null
+++ b/etc/profile-a-l/icecat.profile
@@ -0,0 +1,20 @@
1# Firejail profile for icecat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include icecat.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/mozilla
9noblacklist ${HOME}/.mozilla
10
11mkdir ${HOME}/.cache/mozilla/icecat
12mkdir ${HOME}/.mozilla
13whitelist ${HOME}/.cache/mozilla/icecat
14whitelist ${HOME}/.mozilla
15
16# private-etc must first be enabled in firefox-common.profile
17#private-etc icecat
18
19# Redirect
20include firefox-common.profile
diff --git a/etc/profile-a-l/icedove.profile b/etc/profile-a-l/icedove.profile
new file mode 100644
index 000000000..19690cd5a
--- /dev/null
+++ b/etc/profile-a-l/icedove.profile
@@ -0,0 +1,28 @@
1# Firejail profile for icedove
2# This file is overwritten after every install/update
3# Persistent local customizations
4include icedove.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Users have icedove set to open a browser by clicking a link in an email
10# We are not allowed to blacklist browser-specific directories
11
12noblacklist ${HOME}/.cache/icedove
13noblacklist ${HOME}/.gnupg
14noblacklist ${HOME}/.icedove
15
16mkdir ${HOME}/.cache/icedove
17mkdir ${HOME}/.gnupg
18mkdir ${HOME}/.icedove
19whitelist ${HOME}/.cache/icedove
20whitelist ${HOME}/.gnupg
21whitelist ${HOME}/.icedove
22include whitelist-common.inc
23
24ignore private-tmp
25
26# allow browsers
27# Redirect
28include firefox.profile
diff --git a/etc/profile-a-l/iceweasel.profile b/etc/profile-a-l/iceweasel.profile
new file mode 100644
index 000000000..badd2648a
--- /dev/null
+++ b/etc/profile-a-l/iceweasel.profile
@@ -0,0 +1,13 @@
1# Firejail profile for iceweasel
2# This file is overwritten after every install/update
3# Persistent local customizations
4include iceweasel.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# private-etc must first be enabled in firefox-common.profile
10#private-etc iceweasel
11
12# Redirect
13include firefox.profile
diff --git a/etc/profile-a-l/idea.profile b/etc/profile-a-l/idea.profile
new file mode 100644
index 000000000..4e43bb629
--- /dev/null
+++ b/etc/profile-a-l/idea.profile
@@ -0,0 +1,10 @@
1# Firejail profile for idea
2# This file is overwritten after every install/update
3# Persistent local customizations
4include idea.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include idea.sh.profile
diff --git a/etc/idea.sh.profile b/etc/profile-a-l/idea.sh.profile
index caec416e9..7716a5f1a 100644
--- a/etc/idea.sh.profile
+++ b/etc/profile-a-l/idea.sh.profile
@@ -1,37 +1,41 @@
1# Firejail profile for idea.sh 1# Firejail profile for idea.sh
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/idea.sh.local 4include idea.sh.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.IdeaIC* 8noblacklist ${HOME}/.IdeaIC*
9noblacklist ${HOME}/.android 9noblacklist ${HOME}/.android
10noblacklist ${HOME}/.gitconfig
11noblacklist ${HOME}/.gradle
12noblacklist ${HOME}/.jack-server 10noblacklist ${HOME}/.jack-server
13noblacklist ${HOME}/.jack-settings 11noblacklist ${HOME}/.jack-settings
14noblacklist ${HOME}/.java
15noblacklist ${HOME}/.local/share/JetBrains 12noblacklist ${HOME}/.local/share/JetBrains
16noblacklist ${HOME}/.ssh
17noblacklist ${HOME}/.tooling 13noblacklist ${HOME}/.tooling
18 14
19include /etc/firejail/disable-common.inc 15# Allows files commonly used by IDEs
20include /etc/firejail/disable-passwdmgr.inc 16include allow-common-devel.inc
21include /etc/firejail/disable-programs.inc 17
18# Allow ssh (blacklisted by disable-common.inc)
19include allow-ssh.inc
20
21include disable-common.inc
22include disable-programs.inc
22 23
23caps.drop all 24caps.drop all
24netfilter 25netfilter
25nodvd 26nodvd
26nogroups 27nogroups
28noinput
27nonewprivs 29nonewprivs
28noroot 30noroot
29notv 31notv
32nou2f
30novideo 33novideo
31protocol unix,inet,inet6 34protocol unix,inet,inet6
32seccomp 35seccomp
33shell none 36shell none
34 37
38private-cache
35private-dev 39private-dev
36# private-tmp 40# private-tmp
37 41
diff --git a/etc/profile-a-l/ideaIC.profile b/etc/profile-a-l/ideaIC.profile
new file mode 100644
index 000000000..7e1778f58
--- /dev/null
+++ b/etc/profile-a-l/ideaIC.profile
@@ -0,0 +1,10 @@
1# Firejail profile for ideaIC
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ideaIC.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include idea.sh.profile
diff --git a/etc/profile-a-l/imagej.profile b/etc/profile-a-l/imagej.profile
new file mode 100644
index 000000000..4da127fab
--- /dev/null
+++ b/etc/profile-a-l/imagej.profile
@@ -0,0 +1,41 @@
1# Firejail profile for imagej
2# Description: Image processing program with a focus on microscopy images
3# This file is overwritten after every install/update
4# Persistent local customizations
5include imagej.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.imagej
10
11# Allow java (blacklisted by disable-devel.inc)
12include allow-java.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20caps.drop all
21ipc-namespace
22net none
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35
36private-bin awk,basename,bash,cut,free,grep,hostname,imagej,ln,ls,mkdir,rm,sort,tail,touch,tr,uname,update-java-alternatives,whoami,xprop
37private-dev
38private-tmp
39
40dbus-user none
41dbus-system none
diff --git a/etc/profile-a-l/img2txt.profile b/etc/profile-a-l/img2txt.profile
new file mode 100644
index 000000000..54cad08c7
--- /dev/null
+++ b/etc/profile-a-l/img2txt.profile
@@ -0,0 +1,52 @@
1# Firejail profile for img2txt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include img2txt.local
5# Persistent global definitions
6include globals.local
7
8blacklist ${RUNUSER}/wayland-*
9
10noblacklist ${DOCUMENTS}
11noblacklist ${PICTURES}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20whitelist /usr/share/imlib2
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27machine-id
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42x11 none
43
44# private-bin img2txt
45private-cache
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
51
52memory-deny-write-execute
diff --git a/etc/profile-a-l/impressive.profile b/etc/profile-a-l/impressive.profile
new file mode 100644
index 000000000..31ad641c1
--- /dev/null
+++ b/etc/profile-a-l/impressive.profile
@@ -0,0 +1,57 @@
1# Firejail profile for impressive
2# Description: presentation tool with eye candy
3# This file is overwritten after every install/update
4# Persistent local customizations
5include impressive.local
6# Persistent global definitions
7#include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist /sbin
11noblacklist /usr/sbin
12
13# Allow python (blacklisted by disable-interpreters.inc)
14#include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.cache/mesa_shader_cache
25whitelist /usr/share/opengl-games-utils
26whitelist /usr/share/zenity
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32ipc-namespace
33machine-id
34net none
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46shell none
47tracelog
48
49private-cache
50private-dev
51private-tmp
52
53dbus-user none
54dbus-system none
55
56read-only ${HOME}
57read-write ${HOME}/.cache/mesa_shader_cache
diff --git a/etc/profile-a-l/inkscape.profile b/etc/profile-a-l/inkscape.profile
new file mode 100644
index 000000000..5e54b5441
--- /dev/null
+++ b/etc/profile-a-l/inkscape.profile
@@ -0,0 +1,61 @@
1# Firejail profile for inkscape
2# Description: Vector-based drawing program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include inkscape.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/inkscape
10noblacklist ${HOME}/.config/inkscape
11noblacklist ${HOME}/.inkscape
12noblacklist ${DOCUMENTS}
13noblacklist ${PICTURES}
14# Allow exporting .xcf files
15noblacklist ${HOME}/.config/GIMP
16noblacklist ${HOME}/.gimp*
17
18
19# Allow python (blacklisted by disable-interpreters.inc)
20include allow-python2.inc
21include allow-python3.inc
22
23include disable-common.inc
24include disable-devel.inc
25include disable-exec.inc
26include disable-interpreters.inc
27include disable-programs.inc
28include disable-xdg.inc
29
30whitelist /usr/share/inkscape
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36ipc-namespace
37machine-id
38net none
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix
49seccomp
50shell none
51tracelog
52
53# private-bin inkscape,potrace,python* - problems on Debian stretch
54private-cache
55private-dev
56private-tmp
57
58dbus-user none
59dbus-system none
60
61# memory-deny-write-execute
diff --git a/etc/profile-a-l/inkview.profile b/etc/profile-a-l/inkview.profile
new file mode 100644
index 000000000..4f88b0258
--- /dev/null
+++ b/etc/profile-a-l/inkview.profile
@@ -0,0 +1,11 @@
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# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include inkscape.profile
diff --git a/etc/profile-a-l/inox.profile b/etc/profile-a-l/inox.profile
new file mode 100644
index 000000000..a5cac12f2
--- /dev/null
+++ b/etc/profile-a-l/inox.profile
@@ -0,0 +1,22 @@
1# Firejail profile for inox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include inox.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/inox
14noblacklist ${HOME}/.config/inox
15
16mkdir ${HOME}/.cache/inox
17mkdir ${HOME}/.config/inox
18whitelist ${HOME}/.cache/inox
19whitelist ${HOME}/.config/inox
20
21# Redirect
22include chromium-common.profile
diff --git a/etc/profile-a-l/io.github.lainsce.Notejot.profile b/etc/profile-a-l/io.github.lainsce.Notejot.profile
new file mode 100644
index 000000000..6753cb332
--- /dev/null
+++ b/etc/profile-a-l/io.github.lainsce.Notejot.profile
@@ -0,0 +1,60 @@
1# Firejail profile for notejot
2# Description: Jot your ideas
3# This file is overwritten after every install/update
4# Persistent local customizations
5include io.github.lainsce.Notejot.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/io.github.lainsce.Notejot
10noblacklist ${HOME}/.local/share/io.github.lainsce.Notejot
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.cache/io.github.lainsce.Notejot
21mkdir ${HOME}/.local/share/io.github.lainsce.Notejot
22whitelist ${HOME}/.cache/io.github.lainsce.Notejot
23whitelist ${HOME}/.local/share/io.github.lainsce.Notejot
24whitelist /usr/libexec/webkit2gtk-4.0
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32machine-id
33net none
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46seccomp.block-secondary
47shell none
48tracelog
49
50disable-mnt
51private-bin io.github.lainsce.Notejot
52private-cache
53private-dev
54private-etc alternatives,dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,pango,X11
55private-tmp
56
57dbus-user filter
58dbus-user.own io.github.lainsce.Notejot
59dbus-user.talk ca.desrt.dconf
60dbus-system none
diff --git a/etc/profile-a-l/ipcalc-ng.profile b/etc/profile-a-l/ipcalc-ng.profile
new file mode 100644
index 000000000..3ad0f3a4f
--- /dev/null
+++ b/etc/profile-a-l/ipcalc-ng.profile
@@ -0,0 +1,11 @@
1# Firejail profile ipcalc-ng
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include ipcalc-ng.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include ipcalc.profile
diff --git a/etc/profile-a-l/ipcalc.profile b/etc/profile-a-l/ipcalc.profile
new file mode 100644
index 000000000..ea4ee5ae1
--- /dev/null
+++ b/etc/profile-a-l/ipcalc.profile
@@ -0,0 +1,62 @@
1# Firejail profile for ipcalc
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include ipcalc.local
6# Persistent global definitions
7include globals.local
8
9# Allow perl (blacklisted by disable-interpreters.inc)
10include allow-perl.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17# include disable-shell.inc
18include disable-write-mnt.inc
19include disable-xdg.inc
20
21# include whitelist-common.inc
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29# machine-id
30net none
31netfilter
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42# protocol unix
43seccomp
44shell none
45# tracelog
46
47disable-mnt
48private
49private-bin bash,ipcalc,ipcalc-ng,perl,sh
50# private-cache
51private-dev
52# empty etc directory
53private-etc none
54private-lib
55private-opt none
56private-tmp
57
58dbus-user none
59dbus-system none
60
61# memory-deny-write-execute
62# read-only ${HOME}
diff --git a/etc/profile-a-l/iridium-browser.profile b/etc/profile-a-l/iridium-browser.profile
new file mode 100644
index 000000000..20b24cedf
--- /dev/null
+++ b/etc/profile-a-l/iridium-browser.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for iridium
2# This file is overwritten after every install/update
3# Persistent local customizations
4include iridium-browser.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include iridium.profile
diff --git a/etc/profile-a-l/iridium.profile b/etc/profile-a-l/iridium.profile
new file mode 100644
index 000000000..3037d00e9
--- /dev/null
+++ b/etc/profile-a-l/iridium.profile
@@ -0,0 +1,22 @@
1# Firejail profile for iridium
2# This file is overwritten after every install/update
3# Persistent local customizations
4include iridium.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://github.com/netblue30/firejail/pull/3688#issuecomment-718711565
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/iridium
14noblacklist ${HOME}/.config/iridium
15
16mkdir ${HOME}/.cache/iridium
17mkdir ${HOME}/.config/iridium
18whitelist ${HOME}/.cache/iridium
19whitelist ${HOME}/.config/iridium
20
21# Redirect
22include chromium-common.profile
diff --git a/etc/itch.profile b/etc/profile-a-l/itch.profile
index 7e8f0518d..37cde1577 100644
--- a/etc/itch.profile
+++ b/etc/profile-a-l/itch.profile
@@ -1,31 +1,36 @@
1# Firejail profile for itch 1# Firejail profile for itch
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/itch.local 4include itch.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8# itch.io has native firejail/sandboxing support bundled in 8# itch.io has native firejail/sandboxing support bundled in
9# See https://itch.io/docs/itch/using/sandbox/linux.html 9# See https://itch.io/docs/itch/using/sandbox/linux.html
10 10
11noblacklist ${HOME}/.itch
11noblacklist ${HOME}/.config/itch 12noblacklist ${HOME}/.config/itch
12 13
13include /etc/firejail/disable-common.inc 14include disable-common.inc
14include /etc/firejail/disable-devel.inc 15include disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc 16include disable-interpreters.inc
16include /etc/firejail/disable-programs.inc 17include disable-programs.inc
17 18
19mkdir ${HOME}/.itch
18mkdir ${HOME}/.config/itch 20mkdir ${HOME}/.config/itch
21whitelist ${HOME}/.itch
19whitelist ${HOME}/.config/itch 22whitelist ${HOME}/.config/itch
20include /etc/firejail/whitelist-common.inc 23include whitelist-common.inc
21 24
22caps.drop all 25caps.drop all
23netfilter 26netfilter
24nodvd 27nodvd
25nogroups 28nogroups
29noinput
26nonewprivs 30nonewprivs
27noroot 31noroot
28notv 32notv
33nou2f
29novideo 34novideo
30protocol unix,inet,inet6,netlink 35protocol unix,inet,inet6,netlink
31seccomp 36seccomp
diff --git a/etc/profile-a-l/jami-gnome.profile b/etc/profile-a-l/jami-gnome.profile
new file mode 100644
index 000000000..5c4cc74c2
--- /dev/null
+++ b/etc/profile-a-l/jami-gnome.profile
@@ -0,0 +1,42 @@
1# Firejail profile for jami-gnome
2# Description: An encrypted peer-to-peer messenger
3# This file is overwritten after every install/update
4# Persistent local customizations
5include jami-gnome.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/jami
10noblacklist ${HOME}/.local/share/jami
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15#include disable-interpreters.inc
16include disable-programs.inc
17
18mkdir ${HOME}/.config/jami
19mkdir ${HOME}/.local/share/jami
20whitelist ${HOME}/.config/jami
21whitelist ${HOME}/.local/share/jami
22include whitelist-common.inc
23include whitelist-var-common.inc
24
25caps.drop all
26ipc-namespace
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37
38disable-mnt
39private-dev
40private-tmp
41
42env QT_QPA_PLATFORM=xcb
diff --git a/etc/profile-a-l/jd-gui.profile b/etc/profile-a-l/jd-gui.profile
new file mode 100644
index 000000000..37f99c2f0
--- /dev/null
+++ b/etc/profile-a-l/jd-gui.profile
@@ -0,0 +1,44 @@
1# Firejail profile for jd-gui
2# This file is overwritten after every install/update
3# Persistent local customizations
4include jd-gui.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/jd-gui.cfg
9
10# Allow java (blacklisted by disable-devel.inc)
11include allow-java.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22caps.drop all
23net none
24no3d
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37
38private-bin bash,jd-gui,sh
39private-cache
40private-dev
41private-tmp
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-a-l/jdownloader.profile b/etc/profile-a-l/jdownloader.profile
new file mode 100644
index 000000000..b5f892a9d
--- /dev/null
+++ b/etc/profile-a-l/jdownloader.profile
@@ -0,0 +1,10 @@
1# Firejail profile for jdownloader
2# This file is overwritten after every install/update
3# Persistent local customizations
4include jdownloader.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include JDownloader.profile
diff --git a/etc/profile-a-l/jerry.profile b/etc/profile-a-l/jerry.profile
new file mode 100644
index 000000000..1209c5e11
--- /dev/null
+++ b/etc/profile-a-l/jerry.profile
@@ -0,0 +1,43 @@
1# Firejail profile for jerry
2# Description: Chess GUI
3# This file is overwritten after every install/update
4# Persistent local customizations
5include jerry.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/dkl
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18caps.drop all
19machine-id
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35private-bin bash,jerry,sh,stockfish
36private-dev
37private-etc fonts,gtk-2.0,gtk-3.0
38private-tmp
39
40dbus-user none
41dbus-system none
42
43memory-deny-write-execute
diff --git a/etc/profile-a-l/jitsi-meet-desktop.profile b/etc/profile-a-l/jitsi-meet-desktop.profile
new file mode 100644
index 000000000..edb7ed840
--- /dev/null
+++ b/etc/profile-a-l/jitsi-meet-desktop.profile
@@ -0,0 +1,27 @@
1# Firejail profile for jitsi-meet-desktop
2# Description: Jitsi Meet desktop application powered by Electron
3# This file is overwritten after every install/update
4# Persistent local customizations
5include jitsi-meet-desktop.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore nou2f
11ignore novideo
12ignore shell none
13
14ignore noexec /tmp
15
16noblacklist ${HOME}/.config/Jitsi Meet
17
18nowhitelist ${DOWNLOADS}
19
20mkdir ${HOME}/.config/Jitsi Meet
21whitelist ${HOME}/.config/Jitsi Meet
22
23private-bin bash,electron,electron[0-9],electron[0-9][0-9],jitsi-meet-desktop,sh
24private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,drirc,fonts,glvnd,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,nvidia,pango,passwd,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
25
26# Redirect
27include electron.profile
diff --git a/etc/jitsi.profile b/etc/profile-a-l/jitsi.profile
index 78a57ff46..0e578909a 100644
--- a/etc/jitsi.profile
+++ b/etc/profile-a-l/jitsi.profile
@@ -1,16 +1,19 @@
1# Firejail profile for jitsi 1# Firejail profile for jitsi
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/jitsi.local 4include jitsi.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ~/.jitsi 8noblacklist ${HOME}/.jitsi
9 9
10include /etc/firejail/disable-common.inc 10# Allow java (blacklisted by disable-devel.inc)
11include /etc/firejail/disable-devel.inc 11include allow-java.inc
12include /etc/firejail/disable-passwdmgr.inc 12
13include /etc/firejail/disable-programs.inc 13include disable-common.inc
14include disable-devel.inc
15include disable-interpreters.inc
16include disable-programs.inc
14 17
15caps.drop all 18caps.drop all
16nodvd 19nodvd
@@ -24,4 +27,5 @@ shell none
24tracelog 27tracelog
25 28
26disable-mnt 29disable-mnt
30private-cache
27private-tmp 31private-tmp
diff --git a/etc/profile-a-l/jumpnbump-menu.profile b/etc/profile-a-l/jumpnbump-menu.profile
new file mode 100644
index 000000000..8d391b90f
--- /dev/null
+++ b/etc/profile-a-l/jumpnbump-menu.profile
@@ -0,0 +1,16 @@
1# Firejail profile for jumpnbump-menu
2# Description: Level selection and config menu for the Jump 'n Bump game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include jumpnbump-menu.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Allow python (blacklisted by disable-interpreters.inc)
11include allow-python3.inc
12
13private-bin jumpnbump-menu,python3*
14
15# Redirect
16include jumpnbump.profile
diff --git a/etc/profile-a-l/jumpnbump.profile b/etc/profile-a-l/jumpnbump.profile
new file mode 100644
index 000000000..77d3f6bf4
--- /dev/null
+++ b/etc/profile-a-l/jumpnbump.profile
@@ -0,0 +1,49 @@
1# Firejail profile for jumpnbump
2# Description: Cute multiplayer platform game with bunnies
3# This file is overwritten after every install/update
4# Persistent local customizations
5include jumpnbump.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.jumpnbump
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.jumpnbump
19whitelist ${HOME}/.jumpnbump
20whitelist /usr/share/jumpnbump
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27net none
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,netlink
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin jumpnbump
43private-cache
44private-dev
45private-etc none
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-a-l/k3b.profile b/etc/profile-a-l/k3b.profile
new file mode 100644
index 000000000..655257f08
--- /dev/null
+++ b/etc/profile-a-l/k3b.profile
@@ -0,0 +1,38 @@
1# Firejail profile for k3b
2# Description: Sophisticated CD/DVD burning application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include k3b.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/k3brc
10noblacklist ${HOME}/.kde/share/config/k3brc
11noblacklist ${HOME}/.kde4/share/config/k3brc
12noblacklist ${HOME}/.local/share/kxmlgui5/k3b
13noblacklist ${MUSIC}
14
15include disable-common.inc
16include disable-devel.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21include whitelist-var-common.inc
22
23caps.keep chown,dac_override,ipc_lock,net_bind_service,sys_admin,sys_nice,sys_rawio,sys_resource
24# net none
25netfilter
26no3d
27# nonewprivs - breaks privileged helpers
28noinput
29# noroot - breaks privileged helpers
30nosound
31notv
32novideo
33# protocol unix - breaks privileged helpers
34# seccomp - breaks privileged helpers
35shell none
36
37private-dev
38# private-tmp
diff --git a/etc/profile-a-l/kaffeine.profile b/etc/profile-a-l/kaffeine.profile
new file mode 100644
index 000000000..8799a6f24
--- /dev/null
+++ b/etc/profile-a-l/kaffeine.profile
@@ -0,0 +1,42 @@
1# Firejail profile for kaffeine
2# Description: Versatile media player for KDE
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kaffeine.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/kaffeinerc
10noblacklist ${HOME}/.kde/share/apps/kaffeine
11noblacklist ${HOME}/.kde/share/config/kaffeinerc
12noblacklist ${HOME}/.kde4/share/apps/kaffeine
13noblacklist ${HOME}/.kde4/share/config/kaffeinerc
14noblacklist ${HOME}/.local/share/kaffeine
15noblacklist ${MUSIC}
16noblacklist ${VIDEOS}
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-xdg.inc
24
25include whitelist-var-common.inc
26
27caps.drop all
28netfilter
29nogroups
30noinput
31nonewprivs
32noroot
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39# private-bin kaffeine
40private-dev
41private-tmp
42
diff --git a/etc/profile-a-l/kalgebra.profile b/etc/profile-a-l/kalgebra.profile
new file mode 100644
index 000000000..210b7cf03
--- /dev/null
+++ b/etc/profile-a-l/kalgebra.profile
@@ -0,0 +1,49 @@
1# Firejail profile for kalgebra
2# Description: 2D and 3D Graph Calculator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kalgebra.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/kalgebrarc
10noblacklist ${HOME}/.local/share/kalgebra
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19whitelist /usr/share/kalgebramobile
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,netlink
37seccomp !chroot
38shell none
39# tracelog
40
41disable-mnt
42private-bin kalgebra,kalgebramobile
43private-cache
44private-dev
45private-etc fonts,machine-id
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-a-l/kalgebramobile.profile b/etc/profile-a-l/kalgebramobile.profile
new file mode 100644
index 000000000..3768d277e
--- /dev/null
+++ b/etc/profile-a-l/kalgebramobile.profile
@@ -0,0 +1,10 @@
1# Firejail profile for kalgebramobile
2# This file is overwritten after every install/update
3# Persistent local customizations
4include kalgebramobile.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include kalgebra.profile
diff --git a/etc/profile-a-l/karbon.profile b/etc/profile-a-l/karbon.profile
new file mode 100644
index 000000000..231299a2f
--- /dev/null
+++ b/etc/profile-a-l/karbon.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for krita
2# This file is overwritten after every install/update
3# Persistent local customizations
4include karbon.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/karbon
10
11# Redirect
12include krita.profile
diff --git a/etc/profile-a-l/kate.profile b/etc/profile-a-l/kate.profile
new file mode 100644
index 000000000..d8b2dddb1
--- /dev/null
+++ b/etc/profile-a-l/kate.profile
@@ -0,0 +1,60 @@
1# Firejail profile for kate
2# Description: Powerful text editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kate.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.config/katemetainfos
12noblacklist ${HOME}/.config/katepartrc
13noblacklist ${HOME}/.config/katerc
14noblacklist ${HOME}/.config/kateschemarc
15noblacklist ${HOME}/.config/katesyntaxhighlightingrc
16noblacklist ${HOME}/.config/katevirc
17noblacklist ${HOME}/.local/share/kate
18noblacklist ${HOME}/.local/share/kxmlgui5/kate
19noblacklist ${HOME}/.local/share/kxmlgui5/katefiletree
20noblacklist ${HOME}/.local/share/kxmlgui5/katekonsole
21noblacklist ${HOME}/.local/share/kxmlgui5/kateopenheaderplugin
22noblacklist ${HOME}/.local/share/kxmlgui5/katepart
23noblacklist ${HOME}/.local/share/kxmlgui5/kateproject
24noblacklist ${HOME}/.local/share/kxmlgui5/katesearch
25
26include disable-common.inc
27# include disable-devel.inc
28include disable-exec.inc
29# include disable-interpreters.inc
30include disable-programs.inc
31
32include whitelist-var-common.inc
33
34# apparmor
35caps.drop all
36# net none
37netfilter
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix
48seccomp
49shell none
50tracelog
51
52# private-bin kate,kbuildsycoca4,kdeinit4
53private-dev
54# private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,xdg
55private-tmp
56
57# dbus-user none
58# dbus-system none
59
60join-or-start kate
diff --git a/etc/profile-a-l/kazam.profile b/etc/profile-a-l/kazam.profile
new file mode 100644
index 000000000..7b990bf41
--- /dev/null
+++ b/etc/profile-a-l/kazam.profile
@@ -0,0 +1,55 @@
1# Firejail profile for kazam
2# Description: Screen capture tool
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kazam.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${PICTURES}
12noblacklist ${VIDEOS}
13noblacklist ${HOME}/.config/kazam
14
15# Allow python (blacklisted by disable-interpreters.inc)
16include allow-python2.inc
17include allow-python3.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-shell.inc
25include disable-xdg.inc
26
27whitelist /usr/share/kazam
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34net none
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix
44seccomp
45shell none
46tracelog
47
48disable-mnt
49# private-bin kazam,python*
50private-cache
51private-dev
52private-etc alsa,alternatives,asound.conf,dconf,fonts,gtk-2.0,gtk-3.0,machine-id,pulse,selinux,X11,xdg
53private-tmp
54
55dbus-system none
diff --git a/etc/profile-a-l/kcalc.profile b/etc/profile-a-l/kcalc.profile
new file mode 100644
index 000000000..46e8ccb82
--- /dev/null
+++ b/etc/profile-a-l/kcalc.profile
@@ -0,0 +1,65 @@
1# Firejail profile for kcalc
2# Description: Simple and scientific calculator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kcalc.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/kxmlgui5/kcalc
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/kxmlgui5/kcalc
20mkfile ${HOME}/.config/kcalcrc
21mkfile ${HOME}/.kde/share/config/kcalcrc
22mkfile ${HOME}/.kde4/share/config/kcalcrc
23whitelist ${HOME}/.config/kcalcrc
24whitelist ${HOME}/.kde/share/config/kcalcrc
25whitelist ${HOME}/.kde4/share/config/kcalcrc
26whitelist ${HOME}/.local/share/kxmlgui5/kcalc
27whitelist /usr/share/config.kcfg/kcalc.kcfg
28whitelist /usr/share/kcalc
29whitelist /usr/share/kconf_update/kcalcrc.upd
30include whitelist-common.inc
31include whitelist-runuser-common.inc
32include whitelist-usr-share-common.inc
33include whitelist-var-common.inc
34
35apparmor
36caps.drop all
37net none
38no3d
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54disable-mnt
55private-bin kcalc
56private-cache
57private-dev
58private-etc alternatives,fonts,ld.so.cache,locale,locale.conf
59# private-lib - problems on Arch
60private-tmp
61
62dbus-user none
63dbus-system none
64
65#memory-deny-write-execute
diff --git a/etc/profile-a-l/kdeinit4.profile b/etc/profile-a-l/kdeinit4.profile
new file mode 100644
index 000000000..4ddd5dac5
--- /dev/null
+++ b/etc/profile-a-l/kdeinit4.profile
@@ -0,0 +1,37 @@
1# Firejail profile for kdeinit4
2# This file is overwritten after every install/update
3# Persistent local customizations
4include kdeinit4.local
5# Persistent global definitions
6include globals.local
7
8# use outside KDE Plasma 4
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16
17include whitelist-var-common.inc
18
19caps.drop all
20netfilter
21no3d
22nogroups
23noinput
24nonewprivs
25# nosound - disabled for knotify
26noroot
27nou2f
28novideo
29notv
30protocol unix,inet,inet6,netlink
31seccomp
32shell none
33
34private-bin kbuildsycoca4,kded4,kdeinit4,knotify4
35private-dev
36private-tmp
37
diff --git a/etc/profile-a-l/kdenlive.profile b/etc/profile-a-l/kdenlive.profile
new file mode 100644
index 000000000..87808ced7
--- /dev/null
+++ b/etc/profile-a-l/kdenlive.profile
@@ -0,0 +1,41 @@
1# Firejail profile for kdenlive
2# Description: Non-linear video editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kdenlive.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.cache/kdenlive
12noblacklist ${HOME}/.config/kdenliverc
13noblacklist ${HOME}/.local/share/kdenlive
14noblacklist ${HOME}/.local/share/kxmlgui5/kdenlive
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22apparmor
23caps.drop all
24# net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32protocol unix,netlink
33seccomp
34shell none
35
36private-bin dbus-launch,dvdauthor,ffmpeg,ffplay,ffprobe,genisoimage,kdeinit4,kdeinit4_shutdown,kdeinit4_wrapper,kdeinit5,kdeinit5_shutdown,kdeinit5_wrapper,kdenlive,kdenlive_render,kshell4,kshell5,melt,mlt-melt,vlc,xine
37private-dev
38# private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,passwd,pulse,X11,xdg
39
40# dbus-user none
41# dbus-system none
diff --git a/etc/profile-a-l/kdiff3.profile b/etc/profile-a-l/kdiff3.profile
new file mode 100644
index 000000000..7c9be2bcc
--- /dev/null
+++ b/etc/profile-a-l/kdiff3.profile
@@ -0,0 +1,56 @@
1# Firejail profile for kdiff3
2# Description: KDiff3 is a file and folder diff and merge tool.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kdiff3.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/kdiff3fileitemactionrc
10noblacklist ${HOME}/.config/kdiff3rc
11
12# Add the next line to your kdiff3.local if you don't need to compare files in disable-common.inc.
13# By default we deny access only to .ssh and .gnupg.
14#include disable-common.inc
15blacklist ${HOME}/.ssh
16blacklist ${HOME}/.gnupg
17
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21# Add the next line to your kdiff3.local if you don't need to compare files in disable-programs.inc.
22#include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26include whitelist-runuser-common.inc
27# Add the next line to your kdiff3.local if you don't need to compare files in /usr/share.
28#include whitelist-usr-share-common.inc
29# Add the next line to your kdiff3.local if you don't need to compare files in /var.
30#include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35net none
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45seccomp
46seccomp.block-secondary
47shell none
48tracelog
49
50disable-mnt
51private-bin kdiff3
52private-cache
53private-dev
54
55dbus-user none
56dbus-system none
diff --git a/etc/keepass.profile b/etc/profile-a-l/keepass.profile
index c133ce0fb..f26c10be3 100644
--- a/etc/keepass.profile
+++ b/etc/profile-a-l/keepass.profile
@@ -1,9 +1,10 @@
1# Firejail profile for keepass 1# Firejail profile for keepass
2# Description: An easy-to-use password manager
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/keepass.local 5include keepass.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/*.kdb 9noblacklist ${HOME}/*.kdb
9noblacklist ${HOME}/*.kdbx 10noblacklist ${HOME}/*.kdbx
@@ -12,28 +13,32 @@ noblacklist ${HOME}/.config/keepass
12noblacklist ${HOME}/.keepass 13noblacklist ${HOME}/.keepass
13noblacklist ${HOME}/.local/share/KeePass 14noblacklist ${HOME}/.local/share/KeePass
14noblacklist ${HOME}/.local/share/keepass 15noblacklist ${HOME}/.local/share/keepass
16noblacklist ${DOCUMENTS}
15 17
16include /etc/firejail/disable-common.inc 18include disable-common.inc
17include /etc/firejail/disable-devel.inc 19include disable-devel.inc
18include /etc/firejail/disable-passwdmgr.inc 20include disable-exec.inc
19include /etc/firejail/disable-programs.inc 21include disable-interpreters.inc
22include disable-programs.inc
23include disable-xdg.inc
20 24
21caps.drop all 25caps.drop all
22netfilter 26netfilter
23no3d 27no3d
24nodvd 28nodvd
25nogroups 29nogroups
30noinput
26nonewprivs 31nonewprivs
27noroot 32noroot
28nosound 33nosound
29notv 34notv
35nou2f
30novideo 36novideo
31protocol unix,inet,inet6 37protocol unix,inet,inet6,netlink
32seccomp 38seccomp
33shell none 39shell none
34 40
41private-cache
35private-dev 42private-dev
36private-tmp 43private-tmp
37 44
38noexec ${HOME}
39noexec /tmp
diff --git a/etc/profile-a-l/keepass2.profile b/etc/profile-a-l/keepass2.profile
new file mode 100644
index 000000000..72f79bef7
--- /dev/null
+++ b/etc/profile-a-l/keepass2.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for keepass
2# This file is overwritten after every install/update
3# Persistent local customizations
4include keepass2.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include keepass.profile
diff --git a/etc/keepassx.profile b/etc/profile-a-l/keepassx.profile
index 27ca408f5..768a3cef0 100644
--- a/etc/keepassx.profile
+++ b/etc/profile-a-l/keepassx.profile
@@ -1,21 +1,25 @@
1# Firejail profile for keepassx 1# Firejail profile for keepassx
2# Description: Cross Platform Password Manager
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/keepassx.local 5include keepassx.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/*.kdb 9noblacklist ${HOME}/*.kdb
9noblacklist ${HOME}/*.kdbx 10noblacklist ${HOME}/*.kdbx
10noblacklist ${HOME}/.config/keepassx 11noblacklist ${HOME}/.config/keepassx
11noblacklist ${HOME}/.keepassx 12noblacklist ${HOME}/.keepassx
13noblacklist ${DOCUMENTS}
12 14
13include /etc/firejail/disable-common.inc 15include disable-common.inc
14include /etc/firejail/disable-devel.inc 16include disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc 17include disable-exec.inc
16include /etc/firejail/disable-programs.inc 18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
17 21
18include /etc/firejail/whitelist-var-common.inc 22include whitelist-var-common.inc
19 23
20caps.drop all 24caps.drop all
21machine-id 25machine-id
@@ -23,10 +27,12 @@ net none
23no3d 27no3d
24nodvd 28nodvd
25nogroups 29nogroups
30noinput
26nonewprivs 31nonewprivs
27noroot 32noroot
28nosound 33nosound
29notv 34notv
35nou2f
30novideo 36novideo
31protocol unix 37protocol unix
32seccomp 38seccomp
@@ -35,9 +41,10 @@ tracelog
35 41
36private-bin keepassx,keepassx2 42private-bin keepassx,keepassx2
37private-dev 43private-dev
38private-etc fonts,machine-id 44private-etc alternatives,fonts,machine-id
39private-tmp 45private-tmp
40 46
47dbus-user none
48dbus-system none
49
41memory-deny-write-execute 50memory-deny-write-execute
42noexec ${HOME}
43noexec /tmp
diff --git a/etc/profile-a-l/keepassx2.profile b/etc/profile-a-l/keepassx2.profile
new file mode 100644
index 000000000..f2704d67f
--- /dev/null
+++ b/etc/profile-a-l/keepassx2.profile
@@ -0,0 +1,11 @@
1# Firejail profile for keepassx2
2# Description: Cross platform password manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include keepassx2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirects
11include keepassx.profile
diff --git a/etc/profile-a-l/keepassxc-cli.profile b/etc/profile-a-l/keepassxc-cli.profile
new file mode 100644
index 000000000..925609384
--- /dev/null
+++ b/etc/profile-a-l/keepassxc-cli.profile
@@ -0,0 +1,11 @@
1# Firejail profile for keepassxc-cli
2# Description: command line interface for KeePassXC
3# This file is overwritten after every install/update
4# Persistent local customizations
5include keepassxc-cli.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include keepassxc.profile
diff --git a/etc/profile-a-l/keepassxc-proxy.profile b/etc/profile-a-l/keepassxc-proxy.profile
new file mode 100644
index 000000000..b2b6763ee
--- /dev/null
+++ b/etc/profile-a-l/keepassxc-proxy.profile
@@ -0,0 +1,10 @@
1# Firejail profile for keepassxc-cli
2# This file is overwritten after every install/update
3# Persistent local customizations
4include keepassxc-proxy.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include keepassxc.profile
diff --git a/etc/profile-a-l/keepassxc.profile b/etc/profile-a-l/keepassxc.profile
new file mode 100644
index 000000000..b915f6202
--- /dev/null
+++ b/etc/profile-a-l/keepassxc.profile
@@ -0,0 +1,110 @@
1# Firejail profile for keepassxc
2# Description: Cross Platform Password Manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include keepassxc.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/*.kdb
10noblacklist ${HOME}/*.kdbx
11noblacklist ${HOME}/.cache/keepassxc
12noblacklist ${HOME}/.config/keepassxc
13noblacklist ${HOME}/.config/KeePassXCrc
14noblacklist ${HOME}/.keepassxc
15noblacklist ${DOCUMENTS}
16
17# Allow browser profiles, required for browser integration.
18noblacklist ${HOME}/.config/BraveSoftware
19noblacklist ${HOME}/.config/chromium
20noblacklist ${HOME}/.config/google-chrome
21noblacklist ${HOME}/.config/vivaldi
22noblacklist ${HOME}/.local/share/torbrowser
23noblacklist ${HOME}/.mozilla
24
25blacklist /usr/libexec
26
27include disable-common.inc
28include disable-devel.inc
29include disable-exec.inc
30include disable-interpreters.inc
31include disable-programs.inc
32include disable-shell.inc
33include disable-xdg.inc
34
35# You can enable whitelisting for keepassxc by adding the below to your keepassxc.local.
36# If you do, you MUST store your database under ${HOME}/Documents/KeePassXC/foo.kdbx.
37#mkdir ${HOME}/Documents/KeePassXC
38#whitelist ${HOME}/Documents/KeePassXC
39# Needed for KeePassXC-Browser.
40#mkdir ${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts
41#mkfile ${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
42#whitelist ${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
43#mkdir ${HOME}/.config/chromium/NativeMessagingHosts
44#mkfile ${HOME}/.config/chromium/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
45#whitelist ${HOME}/.config/chromium/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
46#mkdir ${HOME}/.config/google-chrome/NativeMessagingHosts
47#mkfile ${HOME}/.config/google-chrome/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
48#whitelist ${HOME}/.config/google-chrome/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
49#mkdir ${HOME}/.config/vivaldi/NativeMessagingHosts
50#mkfile ${HOME}/.config/vivaldi/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
51#whitelist ${HOME}/.config/vivaldi/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json
52#mkdir ${HOME}/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts
53#mkfile ${HOME}/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
54#whitelist ${HOME}/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/TorBrowser/Data/Browser/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
55#mkdir ${HOME}/.mozilla/native-messaging-hosts
56#mkfile ${HOME}/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
57#whitelist ${HOME}/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
58#mkdir ${HOME}/.cache/keepassxc
59#mkdir ${HOME}/.config/keepassxc
60#whitelist ${HOME}/.cache/keepassxc
61#whitelist ${HOME}/.config/keepassxc
62#whitelist ${HOME}/.config/KeePassXCrc
63#include whitelist-common.inc
64
65whitelist /usr/share/keepassxc
66include whitelist-run-common.inc
67include whitelist-usr-share-common.inc
68include whitelist-var-common.inc
69
70caps.drop all
71machine-id
72net none
73no3d
74nodvd
75nogroups
76noinput
77nonewprivs
78noroot
79nosound
80notv
81nou2f
82novideo
83protocol unix
84seccomp !name_to_handle_at
85seccomp.block-secondary
86shell none
87tracelog
88
89private-bin keepassxc,keepassxc-cli,keepassxc-proxy
90private-dev
91private-etc alternatives,fonts,ld.so.cache,machine-id
92private-tmp
93
94dbus-user filter
95dbus-user.own org.keepassxc.KeePassXC.*
96dbus-user.talk com.canonical.Unity
97dbus-user.talk org.freedesktop.ScreenSaver
98dbus-user.talk org.gnome.ScreenSaver
99dbus-user.talk org.gnome.SessionManager
100dbus-user.talk org.xfce.ScreenSaver
101# Add the next line to your keepassxc.local to allow notifications.
102#dbus-user.talk org.freedesktop.Notifications
103# Add the next line to your keepassxc.local to allow the tray menu.
104#dbus-user.talk org.kde.StatusNotifierWatcher
105#dbus-user.own org.kde.*
106dbus-system filter
107dbus-system.talk org.freedesktop.login1
108
109# Mutex is stored in /tmp by default, which is broken by private-tmp.
110join-or-start keepassxc
diff --git a/etc/profile-a-l/kfind.profile b/etc/profile-a-l/kfind.profile
new file mode 100644
index 000000000..40fe65e3f
--- /dev/null
+++ b/etc/profile-a-l/kfind.profile
@@ -0,0 +1,47 @@
1# Firejail profile for kfind
2# Description: File search utility
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kfind.local
6# Persistent global definitions
7include globals.local
8
9# searching in blacklisted or masked paths fails silently
10# adjust filesystem restrictions as necessary
11
12# noblacklist ${HOME}/.cache/kfind - disable-programs.inc is disabled, see below
13# noblacklist ${HOME}/.config/kfindrc
14# noblacklist ${HOME}/.kde/share/config/kfindrc
15# noblacklist ${HOME}/.kde4/share/config/kfindrc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21# include disable-programs.inc
22
23apparmor
24caps.drop all
25machine-id
26# net none
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41
42# private-bin kbuildsycoca4,kdeinit4,kfind
43private-dev
44private-tmp
45
46# dbus-user none
47# dbus-system none
diff --git a/etc/profile-a-l/kget.profile b/etc/profile-a-l/kget.profile
new file mode 100644
index 000000000..ec315b431
--- /dev/null
+++ b/etc/profile-a-l/kget.profile
@@ -0,0 +1,42 @@
1# Firejail profile for kget
2# Description: Download manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kget.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/kgetrc
10noblacklist ${HOME}/.kde/share/apps/kget
11noblacklist ${HOME}/.kde/share/config/kgetrc
12noblacklist ${HOME}/.kde4/share/apps/kget
13noblacklist ${HOME}/.kde4/share/config/kgetrc
14noblacklist ${HOME}/.local/share/kget
15noblacklist ${HOME}/.local/share/kxmlgui5/kget
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22
23include whitelist-var-common.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,inet,inet6
37seccomp
38
39private-dev
40private-tmp
41
42# memory-deny-write-execute
diff --git a/etc/profile-a-l/kid3-cli.profile b/etc/profile-a-l/kid3-cli.profile
new file mode 100644
index 000000000..bee62b5d9
--- /dev/null
+++ b/etc/profile-a-l/kid3-cli.profile
@@ -0,0 +1,6 @@
1# Firejail profile for kid3-cli
2# This file is overwritten after every install/update
3include kid3-cli.local
4
5# Redirect
6include kid3.profile
diff --git a/etc/profile-a-l/kid3-qt.profile b/etc/profile-a-l/kid3-qt.profile
new file mode 100644
index 000000000..9bcede077
--- /dev/null
+++ b/etc/profile-a-l/kid3-qt.profile
@@ -0,0 +1,8 @@
1# Firejail profile for kid3-qt
2# This file is overwritten after every install/update
3include kid3-qt.local
4
5noblacklist ${HOME}/.config/Kid3
6
7# Redirect
8include kid3.profile
diff --git a/etc/profile-a-l/kid3.profile b/etc/profile-a-l/kid3.profile
new file mode 100644
index 000000000..e66716eeb
--- /dev/null
+++ b/etc/profile-a-l/kid3.profile
@@ -0,0 +1,48 @@
1# Firejail profile for kid3
2# Description: Audio Tag Editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kid3.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${MUSIC}
10noblacklist ${HOME}/.config/kid3rc
11noblacklist ${HOME}/.local/share/kxmlgui5/kid3
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24netfilter
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32novideo
33protocol unix,inet,inet6,netlink
34seccomp
35shell none
36tracelog
37
38private-cache
39private-dev
40private-etc alternatives,ca-certificates,crypto-policies,dconf,drirc,fonts,gtk-3.0,hostname,hosts,kde5rc,machine-id,pki,pulse,resolv.conf,ssl
41private-tmp
42private-opt none
43private-srv none
44
45dbus-user none
46dbus-system none
47
48memory-deny-write-execute
diff --git a/etc/profile-a-l/kino.profile b/etc/profile-a-l/kino.profile
new file mode 100644
index 000000000..1f42526d3
--- /dev/null
+++ b/etc/profile-a-l/kino.profile
@@ -0,0 +1,37 @@
1# Firejail profile for kino
2# Description: Non-linear editor for Digital Video data
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kino.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.kino-history
10noblacklist ${HOME}/.kinorc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22netfilter
23nogroups
24noinput
25nonewprivs
26noroot
27notv
28nou2f
29novideo
30protocol unix
31seccomp
32shell none
33
34private-cache
35private-dev
36private-tmp
37
diff --git a/etc/profile-a-l/kiwix-desktop.profile b/etc/profile-a-l/kiwix-desktop.profile
new file mode 100644
index 000000000..968402a8a
--- /dev/null
+++ b/etc/profile-a-l/kiwix-desktop.profile
@@ -0,0 +1,51 @@
1# Firejail profile for kiwix-desktop
2# Description: view/manage ZIM files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kiwix-desktop.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/kiwix
10noblacklist ${HOME}/.local/share/kiwix-desktop
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/kiwix
20mkdir ${HOME}/.local/share/kiwix-desktop
21whitelist ${HOME}/.local/share/kiwix
22whitelist ${HOME}/.local/share/kiwix-desktop
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29netfilter
30# no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36# nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6,netlink
41seccomp !chroot
42shell none
43
44disable-mnt
45private-cache
46private-dev
47private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,hostname,hosts,ld.so.cache,machine-id,pki,pulse,resolv.conf,ssl
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-a-l/klatexformula.profile b/etc/profile-a-l/klatexformula.profile
new file mode 100644
index 000000000..f089658af
--- /dev/null
+++ b/etc/profile-a-l/klatexformula.profile
@@ -0,0 +1,45 @@
1# Firejail profile for klatexformula
2# Description: generating images from LaTeX equations
3# This file is overwritten after every install/update
4# Persistent local customizations
5include klatexformula.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.kde/share/apps/klatexformula
10noblacklist ${HOME}/.klatexformula
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22apparmor
23caps.drop all
24machine-id
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40private-cache
41private-dev
42private-tmp
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-a-l/klatexformula_cmdl.profile b/etc/profile-a-l/klatexformula_cmdl.profile
new file mode 100644
index 000000000..3142cbca6
--- /dev/null
+++ b/etc/profile-a-l/klatexformula_cmdl.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for klatexformula_cmdl
2# This file is overwritten after every install/update
3# Persistent local customizations
4include klatexformula_cmdl.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include klatexformula.profile
diff --git a/etc/profile-a-l/klavaro.profile b/etc/profile-a-l/klavaro.profile
new file mode 100644
index 000000000..f733fa42c
--- /dev/null
+++ b/etc/profile-a-l/klavaro.profile
@@ -0,0 +1,54 @@
1# Firejail profile for klavaro
2# Description: Yet another touch typing tutor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include klavaro.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/klavaro
10noblacklist ${HOME}/.local/share/klavaro
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/klavaro
20mkdir ${HOME}/.config/klavaro
21whitelist ${HOME}/.local/share/klavaro
22whitelist ${HOME}/.config/klavaro
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin bash,klavaro,sh,tclsh,tclsh*
46private-cache
47private-dev
48private-etc alternatives,fonts
49private-tmp
50private-opt none
51private-srv none
52
53dbus-user none
54dbus-system none
diff --git a/etc/profile-a-l/kmail.profile b/etc/profile-a-l/kmail.profile
new file mode 100644
index 000000000..2c645677c
--- /dev/null
+++ b/etc/profile-a-l/kmail.profile
@@ -0,0 +1,62 @@
1# Firejail profile for kmail
2# Description: Full featured graphical email client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kmail.local
6# Persistent global definitions
7include globals.local
8
9# kmail has problems launching akonadi in debian and ubuntu.
10# one solution is to have akonadi already running when kmail is started
11
12noblacklist ${HOME}/.cache/akonadi*
13noblacklist ${HOME}/.cache/kmail2
14noblacklist ${HOME}/.config/akonadi*
15noblacklist ${HOME}/.config/baloorc
16noblacklist ${HOME}/.config/emaildefaults
17noblacklist ${HOME}/.config/emailidentities
18noblacklist ${HOME}/.config/kmail2rc
19noblacklist ${HOME}/.config/kmailsearchindexingrc
20noblacklist ${HOME}/.config/mailtransports
21noblacklist ${HOME}/.config/specialmailcollectionsrc
22noblacklist ${HOME}/.gnupg
23noblacklist ${HOME}/.local/share/akonadi*
24noblacklist ${HOME}/.local/share/apps/korganizer
25noblacklist ${HOME}/.local/share/contacts
26noblacklist ${HOME}/.local/share/emailidentities
27noblacklist ${HOME}/.local/share/kmail2
28noblacklist ${HOME}/.local/share/kxmlgui5/kmail
29noblacklist ${HOME}/.local/share/kxmlgui5/kmail2
30noblacklist ${HOME}/.local/share/local-mail
31noblacklist ${HOME}/.local/share/notes
32noblacklist /tmp/akonadi-*
33
34include disable-common.inc
35include disable-devel.inc
36include disable-exec.inc
37include disable-interpreters.inc
38include disable-programs.inc
39
40include whitelist-var-common.inc
41
42# apparmor
43caps.drop all
44netfilter
45nodvd
46nogroups
47noinput
48nonewprivs
49noroot
50nosound
51notv
52nou2f
53novideo
54protocol unix,inet,inet6,netlink
55# we need to allow chroot, io_getevents, ioprio_set, io_setup, io_submit system calls
56seccomp !chroot,!io_getevents,!io_setup,!io_submit,!ioprio_set
57# tracelog
58
59private-dev
60# private-tmp - interrupts connection to akonadi, breaks opening of email attachments
61# writable-run-user is needed for signing and encrypting emails
62writable-run-user
diff --git a/etc/profile-a-l/kmplayer.profile b/etc/profile-a-l/kmplayer.profile
new file mode 100644
index 000000000..8d462c44c
--- /dev/null
+++ b/etc/profile-a-l/kmplayer.profile
@@ -0,0 +1,41 @@
1# Firejail profile for mplayer
2# Description: mplayer KDE GUI (movie player)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kmplayer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/kmplayerrc
10noblacklist ${HOME}/.kde/share/config/kmplayerrc
11noblacklist ${HOME}/.local/share/kmplayer
12noblacklist ${MUSIC}
13noblacklist ${VIDEOS}
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27netfilter
28nogroups
29noinput
30nonewprivs
31noroot
32nou2f
33protocol unix,inet,inet6,netlink
34seccomp
35shell none
36
37# private-bin kmplayer,mplayer
38private-cache
39private-dev
40private-tmp
41
diff --git a/etc/profile-a-l/knotes.profile b/etc/profile-a-l/knotes.profile
new file mode 100644
index 000000000..f155d0ad6
--- /dev/null
+++ b/etc/profile-a-l/knotes.profile
@@ -0,0 +1,18 @@
1# Firejail profile for knotes
2# Description: Sticky notes application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include knotes.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# knotes has problems launching akonadi in debian and ubuntu.
11# one solution is to have akonadi already running when knotes is started
12
13noblacklist ${HOME}/.config/knotesrc
14noblacklist ${HOME}/.local/share/knotes
15noblacklist ${HOME}/.local/share/kxmlgui5/knotes
16
17# Redirect
18include kmail.profile
diff --git a/etc/profile-a-l/kodi.profile b/etc/profile-a-l/kodi.profile
new file mode 100644
index 000000000..f901637f3
--- /dev/null
+++ b/etc/profile-a-l/kodi.profile
@@ -0,0 +1,55 @@
1# Firejail profile for kodi
2# Description: Open Source Home Theatre
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kodi.local
6# Persistent global definitions
7include globals.local
8
9# noexec ${HOME} breaks plugins
10ignore noexec ${HOME}
11# Add the following to your kodi.local if you use a CEC Adapter.
12#ignore nogroups
13#ignore noroot
14#ignore private-dev
15# Add the following to your kodi.local if you use the Lutris Kodi Addon
16#noblacklist /sbin
17#noblacklist /usr/sbin
18#noblacklist ${HOME}/.cache/lutris
19#noblacklist ${HOME}/.config/lutris
20#noblacklist ${HOME}/.local/share/lutris
21
22noblacklist ${HOME}/.kodi
23noblacklist ${MUSIC}
24noblacklist ${PICTURES}
25noblacklist ${VIDEOS}
26
27# Allow python (blacklisted by disable-interpreters.inc)
28include allow-python2.inc
29include allow-python3.inc
30
31include disable-common.inc
32include disable-devel.inc
33include disable-exec.inc
34include disable-interpreters.inc
35include disable-programs.inc
36include disable-xdg.inc
37
38include whitelist-var-common.inc
39
40apparmor
41caps.drop all
42netfilter
43nogroups
44noinput
45nonewprivs
46# Seems to cause issues with Nvidia drivers sometimes (#3501)
47noroot
48nou2f
49protocol unix,inet,inet6,netlink
50seccomp
51shell none
52tracelog
53
54private-dev
55private-tmp
diff --git a/etc/profile-a-l/konversation.profile b/etc/profile-a-l/konversation.profile
new file mode 100644
index 000000000..723fef0d2
--- /dev/null
+++ b/etc/profile-a-l/konversation.profile
@@ -0,0 +1,45 @@
1# Firejail profile for konversation
2# Description: User friendly Internet Relay Chat (IRC) client for KDE
3# This file is overwritten after every install/update
4# Persistent local customizations
5include konversation.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/konversationrc
10noblacklist ${HOME}/.config/konversation.notifyrc
11noblacklist ${HOME}/.kde/share/config/konversationrc
12noblacklist ${HOME}/.kde4/share/config/konversationrc
13noblacklist ${HOME}/.local/share/kxmlgui5/konversation
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23include whitelist-var-common.inc
24
25caps.drop all
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6,netlink
36seccomp
37shell none
38tracelog
39
40private-bin kbuildsycoca4,konversation
41private-cache
42private-dev
43private-tmp
44
45# memory-deny-write-execute
diff --git a/etc/profile-a-l/kopete.profile b/etc/profile-a-l/kopete.profile
new file mode 100644
index 000000000..9e75b03eb
--- /dev/null
+++ b/etc/profile-a-l/kopete.profile
@@ -0,0 +1,39 @@
1# Firejail profile for kopete
2# Description: Instant messaging and chat application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kopete.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.kde/share/apps/kopete
10noblacklist ${HOME}/.kde/share/config/kopeterc
11noblacklist ${HOME}/.kde4/share/apps/kopete
12noblacklist ${HOME}/.kde4/share/config/kopeterc
13noblacklist ${HOME}/.local/share/kxmlgui5/kopete
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21whitelist /var/lib/winpopup
22include whitelist-var-common.inc
23
24caps.drop all
25netfilter
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33protocol unix,inet,inet6,netlink
34seccomp
35
36private-dev
37private-tmp
38writable-var
39
diff --git a/etc/profile-a-l/krita.profile b/etc/profile-a-l/krita.profile
new file mode 100644
index 000000000..2d3225421
--- /dev/null
+++ b/etc/profile-a-l/krita.profile
@@ -0,0 +1,51 @@
1# Firejail profile for krita
2# Description: Pixel-based image manipulation program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include krita.local
6# Persistent global definitions
7include globals.local
8
9# noexec ${HOME} may break krita, see issue #1953
10ignore noexec ${HOME}
11
12noblacklist ${HOME}/.config/kritarc
13noblacklist ${HOME}/.local/share/krita
14noblacklist ${DOCUMENTS}
15noblacklist ${PICTURES}
16
17# Allow python (blacklisted by disable-interpreters.inc)
18include allow-python2.inc
19include allow-python3.inc
20
21include disable-common.inc
22include disable-devel.inc
23include disable-exec.inc
24include disable-interpreters.inc
25include disable-programs.inc
26include disable-xdg.inc
27
28apparmor
29caps.drop all
30ipc-namespace
31# net none
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44shell none
45
46private-cache
47private-dev
48private-tmp
49
50# dbus-user none
51# dbus-system none
diff --git a/etc/profile-a-l/krunner.profile b/etc/profile-a-l/krunner.profile
new file mode 100644
index 000000000..96eb6978d
--- /dev/null
+++ b/etc/profile-a-l/krunner.profile
@@ -0,0 +1,37 @@
1# Firejail profile for krunner
2# Description: Framework for providing different actions given a string query
3# This file is overwritten after every install/update
4# Persistent local customizations
5include krunner.local
6# Persistent global definitions
7include globals.local
8
9# - programs started in krunner run with this generic profile
10# - when a file is opened in krunner, the file viewer runs in its own sandbox
11# with its own profile, if it is sandboxed automatically
12
13# noblacklist ${HOME}/.cache/krunner
14# noblacklist ${HOME}/.cache/krunnerbookmarkrunnerfirefoxdbfile.sqlite*
15# noblacklist ${HOME}/.config/chromium
16noblacklist ${HOME}/.config/krunnerrc
17noblacklist ${HOME}/.kde/share/config/krunnerrc
18noblacklist ${HOME}/.kde4/share/config/krunnerrc
19# noblacklist ${HOME}/.local/share/baloo
20# noblacklist ${HOME}/.mozilla
21
22include disable-common.inc
23# include disable-devel.inc
24# include disable-interpreters.inc
25# include disable-programs.inc
26
27include whitelist-var-common.inc
28
29caps.drop all
30netfilter
31nogroups
32nonewprivs
33noroot
34protocol unix,inet,inet6
35seccomp
36
37# private-cache
diff --git a/etc/profile-a-l/ktorrent.profile b/etc/profile-a-l/ktorrent.profile
new file mode 100644
index 000000000..9d8aa1bd7
--- /dev/null
+++ b/etc/profile-a-l/ktorrent.profile
@@ -0,0 +1,64 @@
1# Firejail profile for ktorrent
2# Description: BitTorrent client based on the KDE platform
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ktorrent.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/ktorrentrc
10noblacklist ${HOME}/.kde/share/apps/ktorrent
11noblacklist ${HOME}/.kde/share/config/ktorrentrc
12noblacklist ${HOME}/.kde4/share/apps/ktorrent
13noblacklist ${HOME}/.kde4/share/config/ktorrentrc
14noblacklist ${HOME}/.local/share/ktorrent
15noblacklist ${HOME}/.local/share/kxmlgui5/ktorrent
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23
24mkdir ${HOME}/.kde/share/apps/ktorrent
25mkdir ${HOME}/.kde4/share/apps/ktorrent
26mkdir ${HOME}/.local/share/ktorrent
27mkdir ${HOME}/.local/share/kxmlgui5/ktorrent
28mkfile ${HOME}/.config/ktorrentrc
29mkfile ${HOME}/.kde/share/config/ktorrentrc
30mkfile ${HOME}/.kde4/share/config/ktorrentrc
31whitelist ${DOWNLOADS}
32whitelist ${HOME}/.config/ktorrentrc
33whitelist ${HOME}/.kde/share/apps/ktorrent
34whitelist ${HOME}/.kde/share/config/ktorrentrc
35whitelist ${HOME}/.kde4/share/apps/ktorrent
36whitelist ${HOME}/.kde4/share/config/ktorrentrc
37whitelist ${HOME}/.local/share/ktorrent
38whitelist ${HOME}/.local/share/kxmlgui5/ktorrent
39include whitelist-common.inc
40include whitelist-var-common.inc
41
42caps.drop all
43machine-id
44netfilter
45no3d
46nodvd
47nogroups
48noinput
49nonewprivs
50noroot
51nosound
52notv
53nou2f
54novideo
55protocol unix,inet,inet6,netlink
56seccomp
57shell none
58
59private-bin kbuildsycoca4,kdeinit4,ktorrent
60private-dev
61# private-lib - problems on Arch
62private-tmp
63
64# memory-deny-write-execute
diff --git a/etc/profile-a-l/ktouch.profile b/etc/profile-a-l/ktouch.profile
new file mode 100644
index 000000000..051782172
--- /dev/null
+++ b/etc/profile-a-l/ktouch.profile
@@ -0,0 +1,53 @@
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-programs.inc
17include disable-shell.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
31nodvd
32nogroups
33noinput
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
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-a-l/kube.profile b/etc/profile-a-l/kube.profile
new file mode 100644
index 000000000..262ffb532
--- /dev/null
+++ b/etc/profile-a-l/kube.profile
@@ -0,0 +1,81 @@
1# Firejail profile for kube
2# Description: Qt mail client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kube.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.gnupg
10noblacklist ${HOME}/.mozilla
11noblacklist ${HOME}/.cache/kube
12noblacklist ${HOME}/.config/kube
13noblacklist ${HOME}/.config/sink
14noblacklist ${HOME}/.local/share/kube
15noblacklist ${HOME}/.local/share/sink
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25mkdir ${HOME}/.gnupg
26mkdir ${HOME}/.cache/kube
27mkdir ${HOME}/.config/kube
28mkdir ${HOME}/.config/sink
29mkdir ${HOME}/.local/share/kube
30mkdir ${HOME}/.local/share/sink
31whitelist ${HOME}/.gnupg
32whitelist ${HOME}/.mozilla/firefox/profiles.ini
33whitelist ${HOME}/.cache/kube
34whitelist ${HOME}/.config/kube
35whitelist ${HOME}/.config/sink
36whitelist ${HOME}/.local/share/kube
37whitelist ${HOME}/.local/share/sink
38whitelist ${RUNUSER}/gnupg
39whitelist /usr/share/kube
40whitelist /usr/share/gnupg
41whitelist /usr/share/gnupg2
42include whitelist-common.inc
43include whitelist-runuser-common.inc
44include whitelist-usr-share-common.inc
45include whitelist-var-common.inc
46
47apparmor
48caps.drop all
49netfilter
50no3d
51nodvd
52nogroups
53noinput
54nonewprivs
55noroot
56nosound
57notv
58nou2f
59novideo
60protocol unix,inet,inet6
61seccomp
62shell none
63tracelog
64
65# disable-mnt
66# Add "gpg,gpg2,gpg-agent,pinentry-curses,pinentry-emacs,pinentry-fltk,pinentry-gnome3,pinentry-gtk,pinentry-gtk2,pinentry-gtk-2,pinentry-qt,pinentry-qt4,pinentry-tty,pinentry-x2go,pinentry-kwallet" for gpg
67# Add "ignore private-bin" for hyperlinks or have a look at the private-bins in firefox.profile and firefox-common.profile.
68private-bin kube,sink_synchronizer
69private-cache
70private-dev
71private-etc alternatives,ca-certificates,crypto-policies,fonts,gcrypt,gtk-2.0,gtk-3.0,hostname,hosts,pki,resolv.conf,selinux,ssl,xdg
72private-tmp
73writable-run-user
74
75dbus-user filter
76dbus-user.talk ca.desrt.dconf
77dbus-user.talk org.freedesktop.secrets
78dbus-user.talk org.freedesktop.Notifications
79dbus-system none
80
81read-only ${HOME}/.mozilla/firefox/profiles.ini
diff --git a/etc/profile-a-l/kwin_x11.profile b/etc/profile-a-l/kwin_x11.profile
new file mode 100644
index 000000000..5bbadfc73
--- /dev/null
+++ b/etc/profile-a-l/kwin_x11.profile
@@ -0,0 +1,46 @@
1# Firejail profile for kwin_x11
2# This file is overwritten after every install/update
3# Persistent local customizations
4include kwin_x11.local
5# Persistent global definitions
6include globals.local
7
8# fix automatical kwin_x11 sandboxing:
9# echo KDEWM=kwin_x11 >> ~/.pam_environment
10
11noblacklist ${HOME}/.cache/kwin
12noblacklist ${HOME}/.config/kwinrc
13noblacklist ${HOME}/.config/kwinrulesrc
14noblacklist ${HOME}/.local/share/kwin
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24include whitelist-var-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin kwin_x11
44private-dev
45private-etc alternatives,drirc,fonts,kde5rc,ld.so.cache,machine-id,xdg
46private-tmp
diff --git a/etc/profile-a-l/kwrite.profile b/etc/profile-a-l/kwrite.profile
new file mode 100644
index 000000000..682c7782d
--- /dev/null
+++ b/etc/profile-a-l/kwrite.profile
@@ -0,0 +1,55 @@
1# Firejail profile for kwrite
2# Description: Simple text editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include kwrite.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/katepartrc
10noblacklist ${HOME}/.config/katerc
11noblacklist ${HOME}/.config/kateschemarc
12noblacklist ${HOME}/.config/katesyntaxhighlightingrc
13noblacklist ${HOME}/.config/katevirc
14noblacklist ${HOME}/.config/kwriterc
15noblacklist ${HOME}/.local/share/kwrite
16noblacklist ${HOME}/.local/share/kxmlgui5/kwrite
17noblacklist ${DOCUMENTS}
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-shell.inc
25include disable-xdg.inc
26
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31# net none
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38# nosound - KWrite is using ALSA!
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44shell none
45tracelog
46
47private-bin kbuildsycoca4,kdeinit4,kwrite
48private-dev
49private-etc alternatives,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,pulse,xdg
50private-tmp
51
52# dbus-user none
53# dbus-system none
54
55join-or-start kwrite
diff --git a/etc/profile-a-l/latex-common.profile b/etc/profile-a-l/latex-common.profile
new file mode 100644
index 000000000..7993e97e3
--- /dev/null
+++ b/etc/profile-a-l/latex-common.profile
@@ -0,0 +1,41 @@
1# Firejail profile for latex-common
2# This file is overwritten after every install/update
3# Persistent local customizations
4include latex-common.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14
15whitelist /var/lib
16include whitelist-runuser-common.inc
17include whitelist-var-common.inc
18
19caps.drop all
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34tracelog
35
36private-cache
37private-dev
38private-tmp
39
40dbus-user none
41dbus-system none
diff --git a/etc/profile-a-l/latex.profile b/etc/profile-a-l/latex.profile
new file mode 100644
index 000000000..2230dd570
--- /dev/null
+++ b/etc/profile-a-l/latex.profile
@@ -0,0 +1,12 @@
1# Firejail profile for latex
2# This file is overwritten after every install/update
3# Persistent local customizations
4include latex.local
5# Persistent global definitions
6include globals.local
7
8private-bin latex
9
10# Redirect
11include latex-common.profile
12
diff --git a/etc/profile-a-l/lbunzip2.profile b/etc/profile-a-l/lbunzip2.profile
new file mode 100644
index 000000000..3b5b98493
--- /dev/null
+++ b/etc/profile-a-l/lbunzip2.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for gzip
2# Description: GNU compression utilities
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lbunzip2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-a-l/lbzcat.profile b/etc/profile-a-l/lbzcat.profile
new file mode 100644
index 000000000..e628ceaae
--- /dev/null
+++ b/etc/profile-a-l/lbzcat.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for gzip
2# Description: GNU compression utilities
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lbzcat.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-a-l/lbzip2.profile b/etc/profile-a-l/lbzip2.profile
new file mode 100644
index 000000000..5d7935780
--- /dev/null
+++ b/etc/profile-a-l/lbzip2.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for gzip
2# Description: GNU compression utilities
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lbzip2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-a-l/leafpad.profile b/etc/profile-a-l/leafpad.profile
new file mode 100644
index 000000000..75105abf2
--- /dev/null
+++ b/etc/profile-a-l/leafpad.profile
@@ -0,0 +1,41 @@
1# Firejail profile for leafpad
2# Description: GTK+ based simple text editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include leafpad.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/leafpad
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22net none
23no3d
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix
34seccomp
35shell none
36
37private-bin leafpad
38private-dev
39private-lib
40private-tmp
41
diff --git a/etc/profile-a-l/less.profile b/etc/profile-a-l/less.profile
new file mode 100644
index 000000000..db61bf941
--- /dev/null
+++ b/etc/profile-a-l/less.profile
@@ -0,0 +1,51 @@
1# Firejail profile for less
2# Description: Pager program similar to more
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include less.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12noblacklist ${HOME}/.lesshst
13
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17
18apparmor
19caps.drop all
20ipc-namespace
21machine-id
22net none
23no3d
24nodvd
25noinput
26nonewprivs
27#noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35tracelog
36x11 none
37
38# The user can have a custom coloring script configured in ${HOME}/.lessfilter.
39# Enable private-bin and private-lib if you are not using any filter.
40# private-bin less
41# private-lib
42private-cache
43private-dev
44writable-var-log
45
46dbus-user none
47dbus-system none
48
49memory-deny-write-execute
50read-only ${HOME}
51read-write ${HOME}/.lesshst
diff --git a/etc/profile-a-l/librecad.profile b/etc/profile-a-l/librecad.profile
new file mode 100644
index 000000000..c1ce4bb8d
--- /dev/null
+++ b/etc/profile-a-l/librecad.profile
@@ -0,0 +1,50 @@
1# Firejail profile for librecad
2# Persistent local customizations
3include librecad.local
4# Persistent global definitions
5include globals.local
6
7noblacklist ${HOME}/.config/LibreCAD
8noblacklist ${HOME}/.local/share/LibreCAD
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
17
18whitelist /usr/share/librecad
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25netfilter
26nodvd
27#nogroups
28#noinput
29nonewprivs
30noroot
31notv
32#nou2f
33novideo
34protocol unix,inet,inet6
35netfilter
36seccomp
37shell none
38#tracelog
39
40#disable-mnt
41private-bin librecad
42private-dev
43# private-etc cups,drirc,fonts,passwd,xdg
44#private-lib
45private-tmp
46
47dbus-user none
48dbus-system none
49
50memory-deny-write-execute
diff --git a/etc/profile-a-l/libreoffice.profile b/etc/profile-a-l/libreoffice.profile
new file mode 100644
index 000000000..328307705
--- /dev/null
+++ b/etc/profile-a-l/libreoffice.profile
@@ -0,0 +1,57 @@
1# Firejail profile for libreoffice
2# Description: Office productivity suite
3# This file is overwritten after every install/update
4# Persistent local customizations
5include libreoffice.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /usr/local/sbin
10noblacklist ${HOME}/.config/libreoffice
11
12# libreoffice uses java for some functionality.
13# Add 'ignore include allow-java.inc' to your libreoffice.local if you don't need that functionality.
14# Allow java (blacklisted by disable-devel.inc)
15include allow-java.inc
16
17blacklist /usr/libexec
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-programs.inc
23
24include whitelist-var-common.inc
25
26# Debian 10/Ubuntu 18.04 come with their own apparmor profile, but it is not in enforce mode.
27# Add the next lines to your libreoffice.local to use the Ubuntu profile instead of firejail's apparmor profile.
28#ignore apparmor
29#ignore nonewprivs
30#ignore protocol
31#ignore seccomp
32#ignore tracelog
33
34apparmor
35caps.drop all
36netfilter
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42notv
43nou2f
44novideo
45protocol unix,inet,inet6
46seccomp
47shell none
48tracelog
49
50#private-bin libreoffice,sh,uname,dirname,grep,sed,basename,ls
51private-cache
52private-dev
53private-tmp
54
55dbus-system none
56
57join-or-start libreoffice
diff --git a/etc/profile-a-l/librewolf-nightly.profile b/etc/profile-a-l/librewolf-nightly.profile
new file mode 100644
index 000000000..72df5a52a
--- /dev/null
+++ b/etc/profile-a-l/librewolf-nightly.profile
@@ -0,0 +1,13 @@
1# Firejail profile for librewolf-nightly
2# This file is overwritten after every install/update
3# Persistent local customizations
4include librewolf-nightly.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Add the next line to your librewolf-nightly.local to enable private-bin.
10#private-bin librewolf-nightly
11
12# Redirect
13include librewolf.profile
diff --git a/etc/profile-a-l/librewolf.profile b/etc/profile-a-l/librewolf.profile
new file mode 100644
index 000000000..ebffbbabf
--- /dev/null
+++ b/etc/profile-a-l/librewolf.profile
@@ -0,0 +1,56 @@
1# Firejail profile for Librewolf
2# Description: Firefox fork based on privacy
3# This file is overwritten after every install/update
4# Persistent local customizations
5include librewolf.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/librewolf
10noblacklist ${HOME}/.librewolf
11
12mkdir ${HOME}/.cache/librewolf
13mkdir ${HOME}/.librewolf
14whitelist ${HOME}/.cache/librewolf
15whitelist ${HOME}/.librewolf
16
17# Add the next lines to your librewolf.local if you want to use the migration wizard.
18#noblacklist ${HOME}/.mozilla
19#whitelist ${HOME}/.mozilla
20
21# To enable KeePassXC Plugin add one of the following lines to your librewolf.local.
22# NOTE: start KeePassXC before Librewolf and keep it open to allow communication between them.
23#whitelist ${RUNUSER}/kpxc_server
24#whitelist ${RUNUSER}/org.keepassxc.KeePassXC.BrowserServer
25
26whitelist /usr/share/doc
27whitelist /usr/share/gtk-doc/html
28whitelist /usr/share/mozilla
29whitelist /usr/share/webext
30include whitelist-usr-share-common.inc
31
32# Add the next line to your librewolf.local to enable private-bin (Arch Linux).
33#private-bin dbus-launch,dbus-send,librewolf,sh
34# Add the next line to your librewolf.local to enable private-etc.
35# NOTE: private-etc must first be enabled in firefox-common.local.
36#private-etc librewolf
37
38dbus-user filter
39dbus-user.own org.mozilla.librewolf.*
40# Add the next line to your librewolf.local to enable native notifications.
41#dbus-user.talk org.freedesktop.Notifications
42# Add the next line to your librewolf.local to allow inhibiting screensavers.
43#dbus-user.talk org.freedesktop.ScreenSaver
44# Add the next lines to your librewolf.local for plasma browser integration.
45#dbus-user.own org.mpris.MediaPlayer2.plasma-browser-integration
46#dbus-user.talk org.kde.JobViewServer
47#dbus-user.talk org.kde.kuiserver
48# Add the next line to your librewolf.local to allow screensharing under Wayland.
49#dbus-user.talk org.freedesktop.portal.Desktop
50# Also add the next line to your librewolf.local if screensharing does not work with
51# the above lines (depends on the portal implementation).
52#ignore noroot
53ignore dbus-user none
54
55# Redirect
56include firefox-common.profile
diff --git a/etc/profile-a-l/lifeograph.profile b/etc/profile-a-l/lifeograph.profile
new file mode 100644
index 000000000..747fd85fa
--- /dev/null
+++ b/etc/profile-a-l/lifeograph.profile
@@ -0,0 +1,57 @@
1# Firejail profile for lifeograph
2# Description: Lifeograph is a diary program to take personal notes
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lifeograph.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10
11blacklist /usr/libexec
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21whitelist ${DOCUMENTS}
22whitelist /usr/share/lifeograph
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48disable-mnt
49private-bin lifeograph
50private-cache
51private-dev
52private-etc alternatives,dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,pango,X11
53private-tmp
54
55dbus-user filter
56dbus-user.talk ca.desrt.dconf
57dbus-system none
diff --git a/etc/profile-a-l/liferea.profile b/etc/profile-a-l/liferea.profile
new file mode 100644
index 000000000..f7955e352
--- /dev/null
+++ b/etc/profile-a-l/liferea.profile
@@ -0,0 +1,62 @@
1# Firejail profile for liferea
2# Description: Feed/news/podcast client with plugin support
3# This file is overwritten after every install/update
4# Persistent local customizations
5include liferea.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/liferea
10noblacklist ${HOME}/.config/liferea
11noblacklist ${HOME}/.local/share/liferea
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22
23mkdir ${HOME}/.cache/liferea
24mkdir ${HOME}/.config/liferea
25mkdir ${HOME}/.local/share/liferea
26whitelist ${HOME}/.cache/liferea
27whitelist ${HOME}/.config/liferea
28whitelist ${HOME}/.local/share/liferea
29whitelist /usr/share/liferea
30include whitelist-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34caps.drop all
35netfilter
36# no3d
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42# nosound
43notv
44nou2f
45novideo
46protocol unix,inet,inet6
47seccomp
48shell none
49tracelog
50
51disable-mnt
52private-dev
53private-tmp
54
55dbus-user filter
56dbus-user.own net.sourceforge.liferea
57dbus-user.talk ca.desrt.dconf
58# Add the next line to your liferea.local if you use the 'Popup Notifications' plugin.
59#dbus-user.talk org.freedesktop.Notifications
60# Add the next line to your liferea.local if you use the 'Libsecret Support' plugin.
61#dbus-user.talk org.freedesktop.secrets
62dbus-system none
diff --git a/etc/profile-a-l/lightsoff.profile b/etc/profile-a-l/lightsoff.profile
new file mode 100644
index 000000000..c065c44a9
--- /dev/null
+++ b/etc/profile-a-l/lightsoff.profile
@@ -0,0 +1,16 @@
1# Firejail profile for lightsoff
2# Description: GNOME Lightsoff game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lightsoff.local
6# Persistent global definitions
7include globals.local
8
9whitelist /usr/share/lightsoff
10
11private-bin lightsoff
12
13dbus-user.own org.gnome.LightsOff
14
15# Redirect
16include gnome_games-common.profile
diff --git a/etc/profile-a-l/lincity-ng.profile b/etc/profile-a-l/lincity-ng.profile
new file mode 100644
index 000000000..073d814ec
--- /dev/null
+++ b/etc/profile-a-l/lincity-ng.profile
@@ -0,0 +1,48 @@
1# Firejail profile for lincity-ng
2# Description: City simulation game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lincity-ng.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.lincity-ng
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.lincity-ng
20whitelist ${HOME}/.lincity-ng
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27net none
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin lincity-ng
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-a-l/links-common.profile b/etc/profile-a-l/links-common.profile
new file mode 100644
index 000000000..bd28f25d6
--- /dev/null
+++ b/etc/profile-a-l/links-common.profile
@@ -0,0 +1,62 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include links-common.local
4
5# common profile for links browsers
6
7blacklist /tmp/.X11-unix
8blacklist ${RUNUSER}/wayland-*
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14# Additional noblacklist files/directories (blacklisted in disable-programs.inc)
15# used as associated programs can be added in your links-common.local.
16include disable-programs.inc
17include disable-xdg.inc
18
19whitelist ${DOWNLOADS}
20include whitelist-runuser-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26# Add 'ignore machine-id' to your links-common.local if you want to restrict access to
27# the user-configured associated media player.
28machine-id
29netfilter
30# Add 'ignore no3d' to your links-common.local if you want to restrict access to
31# the user-configured associated media player.
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38# Add 'ignore nosound' to your links-common.local if you want to restrict access to
39# the user-configured associated media player.
40nosound
41notv
42nou2f
43novideo
44protocol unix,inet,inet6
45seccomp
46shell none
47tracelog
48
49disable-mnt
50# Add 'private-bin PROGRAM1,PROGRAM2' to your links-common.local if you want to use user-configured programs.
51private-bin sh
52private-cache
53private-dev
54private-etc alternatives,ca-certificates,crypto-policies,nsswitch.conf,pki,resolv.conf,ssl
55# Add the next line to your links-common.local to allow external media players.
56# private-etc alsa,asound.conf,machine-id,openal,pulse
57private-tmp
58
59dbus-user none
60dbus-system none
61
62memory-deny-write-execute
diff --git a/etc/profile-a-l/links.profile b/etc/profile-a-l/links.profile
new file mode 100644
index 000000000..8ce39cc7f
--- /dev/null
+++ b/etc/profile-a-l/links.profile
@@ -0,0 +1,18 @@
1# Firejail profile for links
2# Description: Text WWW browser
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include links.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.links
11
12mkdir ${HOME}/.links
13whitelist ${HOME}/.links
14
15private-bin links
16
17# Redirect
18include links-common.profile
diff --git a/etc/profile-a-l/links2.profile b/etc/profile-a-l/links2.profile
new file mode 100644
index 000000000..5f91dfcd2
--- /dev/null
+++ b/etc/profile-a-l/links2.profile
@@ -0,0 +1,18 @@
1# Firejail profile for links2
2# Description: Text WWW browser with a graphic version
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include links2.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.links2
11
12mkdir ${HOME}/.links2
13whitelist ${HOME}/.links2
14
15private-bin links2
16
17# Redirect
18include links-common.profile
diff --git a/etc/profile-a-l/linphone.profile b/etc/profile-a-l/linphone.profile
new file mode 100644
index 000000000..f821c7512
--- /dev/null
+++ b/etc/profile-a-l/linphone.profile
@@ -0,0 +1,50 @@
1# Firejail profile for linphone
2# Description: SIP softphone - graphical client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include linphone.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/linphone
10noblacklist ${HOME}/.linphone-history.db
11noblacklist ${HOME}/.linphonerc
12noblacklist ${HOME}/.local/share/linphone
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20# linphone 4.0 (released 2017-06-26) moved config and database files to respect
21# freedesktop standards. For backward compatibility we continue to whitelist
22# ${HOME}/.linphone-history.db and ${HOME}/.linphonerc but no longer mkfile.
23mkdir ${HOME}/.config/linphone
24mkdir ${HOME}/.local/share/linphone
25whitelist ${HOME}/.config/linphone
26whitelist ${HOME}/.linphone-history.db
27whitelist ${HOME}/.linphonerc
28whitelist ${HOME}/.local/share/linphone
29whitelist ${DOWNLOADS}
30include whitelist-common.inc
31
32caps.drop all
33netfilter
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix,inet,inet6
44seccomp
45shell none
46
47disable-mnt
48private-dev
49private-tmp
50
diff --git a/etc/profile-a-l/lmms.profile b/etc/profile-a-l/lmms.profile
new file mode 100644
index 000000000..d1a754a6e
--- /dev/null
+++ b/etc/profile-a-l/lmms.profile
@@ -0,0 +1,40 @@
1# Firejail profile for lmms
2# Description: Linux Multimedia Studio
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lmms.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.lmmsrc.xml
10noblacklist ${DOCUMENTS}
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20caps.drop all
21ipc-namespace
22net none
23no3d
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35
36private-dev
37private-tmp
38
39dbus-user none
40dbus-system none
diff --git a/etc/profile-a-l/lobase.profile b/etc/profile-a-l/lobase.profile
new file mode 100644
index 000000000..b248d38f7
--- /dev/null
+++ b/etc/profile-a-l/lobase.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include lobase.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/localc.profile b/etc/profile-a-l/localc.profile
new file mode 100644
index 000000000..a467ef3db
--- /dev/null
+++ b/etc/profile-a-l/localc.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include localc.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/lodraw.profile b/etc/profile-a-l/lodraw.profile
new file mode 100644
index 000000000..f1db590ed
--- /dev/null
+++ b/etc/profile-a-l/lodraw.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include lodraw.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/loffice.profile b/etc/profile-a-l/loffice.profile
new file mode 100644
index 000000000..aa291017a
--- /dev/null
+++ b/etc/profile-a-l/loffice.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include loffice.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/lofromtemplate.profile b/etc/profile-a-l/lofromtemplate.profile
new file mode 100644
index 000000000..534dc5d14
--- /dev/null
+++ b/etc/profile-a-l/lofromtemplate.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include lofromtemplate.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/loimpress.profile b/etc/profile-a-l/loimpress.profile
new file mode 100644
index 000000000..a9473d1a6
--- /dev/null
+++ b/etc/profile-a-l/loimpress.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include loimpress.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/lollypop.profile b/etc/profile-a-l/lollypop.profile
new file mode 100644
index 000000000..a187ca0fc
--- /dev/null
+++ b/etc/profile-a-l/lollypop.profile
@@ -0,0 +1,42 @@
1# Firejail profile for lollypop
2# Description: Music player for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lollypop.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/lollypop
10noblacklist ${MUSIC}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-var-common.inc
24
25caps.drop all
26netfilter
27no3d
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39private-dev
40private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-3.0,host.conf,hostname,hosts,machine-id,pki,pulse,resolv.conf,ssl,xdg
41private-tmp
42
diff --git a/etc/profile-a-l/lomath.profile b/etc/profile-a-l/lomath.profile
new file mode 100644
index 000000000..8bc388be7
--- /dev/null
+++ b/etc/profile-a-l/lomath.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include lomath.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/loweb.profile b/etc/profile-a-l/loweb.profile
new file mode 100644
index 000000000..34b9dcad0
--- /dev/null
+++ b/etc/profile-a-l/loweb.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include loweb.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/lowriter.profile b/etc/profile-a-l/lowriter.profile
new file mode 100644
index 000000000..054ce3a48
--- /dev/null
+++ b/etc/profile-a-l/lowriter.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include lowriter.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-a-l/lrunzip.profile b/etc/profile-a-l/lrunzip.profile
new file mode 100644
index 000000000..c010cbd96
--- /dev/null
+++ b/etc/profile-a-l/lrunzip.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lrunzip
2# Description: Multi-threaded compression with rzip/lzma, lzo and zpaq
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lrunzip.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lrz.profile b/etc/profile-a-l/lrz.profile
new file mode 100644
index 000000000..8077be945
--- /dev/null
+++ b/etc/profile-a-l/lrz.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lrz
2# Description: Multi-threaded compression with rzip/lzma, lzo and zpaq
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lrz.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lrzcat.profile b/etc/profile-a-l/lrzcat.profile
new file mode 100644
index 000000000..d05ee7aae
--- /dev/null
+++ b/etc/profile-a-l/lrzcat.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lrzcat
2# Description: Multi-threaded compression with rzip/lzma, lzo and zpaq
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lrzcat.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lrzip.profile b/etc/profile-a-l/lrzip.profile
new file mode 100644
index 000000000..3767767f6
--- /dev/null
+++ b/etc/profile-a-l/lrzip.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lrzip
2# Description: Multi-threaded compression with rzip/lzma, lzo and zpaq
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lrzip.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lrztar.profile b/etc/profile-a-l/lrztar.profile
new file mode 100644
index 000000000..673e9f62e
--- /dev/null
+++ b/etc/profile-a-l/lrztar.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lrztar
2# Description: Multi-threaded compression with rzip/lzma, lzo and zpaq
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lrztar.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lrzuntar.profile b/etc/profile-a-l/lrzuntar.profile
new file mode 100644
index 000000000..245d1c669
--- /dev/null
+++ b/etc/profile-a-l/lrzuntar.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lrzuntar
2# Description: Multi-threaded compression with rzip/lzma, lzo and zpaq
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lrzuntar.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lsar.profile b/etc/profile-a-l/lsar.profile
new file mode 100644
index 000000000..faf5bb7f9
--- /dev/null
+++ b/etc/profile-a-l/lsar.profile
@@ -0,0 +1,13 @@
1# Firejail profile for lsar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include lsar.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10private-bin lsar
11
12# Redirect
13include ar.profile
diff --git a/etc/profile-a-l/lugaru.profile b/etc/profile-a-l/lugaru.profile
new file mode 100644
index 000000000..3d52d1266
--- /dev/null
+++ b/etc/profile-a-l/lugaru.profile
@@ -0,0 +1,52 @@
1# Firejail profile for lugaru
2# Description: Ninja rabbit fighting game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lugaru.local
6# Persistent global definitions
7include globals.local
8
9# note: crashes after entering
10
11noblacklist ${HOME}/.config/lugaru
12noblacklist ${HOME}/.local/share/lugaru
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.config/lugaru
23mkdir ${HOME}/.local/share/lugaru
24whitelist ${HOME}/.config/lugaru
25whitelist ${HOME}/.local/share/lugaru
26include whitelist-common.inc
27include whitelist-var-common.inc
28
29caps.drop all
30ipc-namespace
31net none
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39novideo
40protocol unix,netlink
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin lugaru
47private-cache
48private-dev
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/luminance-hdr.profile b/etc/profile-a-l/luminance-hdr.profile
index ec2a65290..179bc37f2 100644
--- a/etc/luminance-hdr.profile
+++ b/etc/profile-a-l/luminance-hdr.profile
@@ -1,25 +1,31 @@
1# Firejail profile for luminance-hdr 1# Firejail profile for luminance-hdr
2# Description: Graphical user interface providing a workflow for HDR imaging
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/luminance-hdr.local 5include luminance-hdr.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/Luminance 9noblacklist ${HOME}/.config/Luminance
10noblacklist ${PICTURES}
9 11
10include /etc/firejail/disable-common.inc 12include disable-common.inc
11include /etc/firejail/disable-devel.inc 13include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
13include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
14 18
15caps.drop all 19caps.drop all
16netfilter 20netfilter
17nodvd 21nodvd
18nogroups 22nogroups
23noinput
19nonewprivs 24nonewprivs
20noroot 25noroot
21nosound 26nosound
22notv 27notv
28nou2f
23novideo 29novideo
24protocol unix 30protocol unix
25seccomp 31seccomp
@@ -27,8 +33,7 @@ shell none
27tracelog 33tracelog
28 34
29#private-bin luminance-hdr,luminance-hdr-cli,align_image_stack 35#private-bin luminance-hdr,luminance-hdr-cli,align_image_stack
36private-cache
30private-dev 37private-dev
31private-tmp 38private-tmp
32 39
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/profile-a-l/lutris.profile b/etc/profile-a-l/lutris.profile
new file mode 100644
index 000000000..bf8ab9e64
--- /dev/null
+++ b/etc/profile-a-l/lutris.profile
@@ -0,0 +1,79 @@
1# Firejail profile for lutris
2# Description: Multi-library game handler with special support for Wine
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lutris.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PATH}/llvm*
10noblacklist ${HOME}/Games
11noblacklist ${HOME}/.cache/lutris
12noblacklist ${HOME}/.cache/winetricks
13noblacklist ${HOME}/.config/lutris
14noblacklist ${HOME}/.local/share/lutris
15# noblacklist ${HOME}/.wine
16noblacklist /tmp/.wine-*
17# Don't block access to /sbin and /usr/sbin to allow using ldconfig. Otherwise
18# Lutris won't even start.
19noblacklist /sbin
20noblacklist /usr/sbin
21
22ignore noexec ${HOME}
23
24# Allow python (blacklisted by disable-interpreters.inc)
25include allow-python2.inc
26include allow-python3.inc
27
28include disable-common.inc
29include disable-devel.inc
30include disable-exec.inc
31include disable-interpreters.inc
32include disable-programs.inc
33include disable-xdg.inc
34
35mkdir ${HOME}/Games
36mkdir ${HOME}/.cache/lutris
37mkdir ${HOME}/.cache/winetricks
38mkdir ${HOME}/.config/lutris
39mkdir ${HOME}/.local/share/lutris
40# mkdir ${HOME}/.wine
41whitelist ${DOWNLOADS}
42whitelist ${HOME}/Games
43whitelist ${HOME}/.cache/lutris
44whitelist ${HOME}/.cache/winetricks
45whitelist ${HOME}/.config/lutris
46whitelist ${HOME}/.local/share/lutris
47# whitelist ${HOME}/.wine
48whitelist /usr/share/lutris
49whitelist /usr/share/wine
50include whitelist-common.inc
51include whitelist-usr-share-common.inc
52include whitelist-runuser-common.inc
53include whitelist-var-common.inc
54
55# allow-debuggers
56# apparmor
57caps.drop all
58ipc-namespace
59# net none
60netfilter
61nodvd
62nogroups
63nonewprivs
64noroot
65notv
66nou2f
67novideo
68protocol unix,inet,inet6,netlink
69seccomp
70shell none
71
72# Add the next line to your lutris.local if you do not need controller support.
73#private-dev
74private-tmp
75
76dbus-user filter
77dbus-user.own net.lutris.Lutris
78dbus-user.talk com.feralinteractive.GameMode
79dbus-system none
diff --git a/etc/profile-a-l/lximage-qt.profile b/etc/profile-a-l/lximage-qt.profile
new file mode 100644
index 000000000..404535f91
--- /dev/null
+++ b/etc/profile-a-l/lximage-qt.profile
@@ -0,0 +1,38 @@
1# Firejail profile for lximage-qt
2# Description: Image viewer for LXQt
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lximage-qt.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/lximage-qt
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include whitelist-var-common.inc
17
18apparmor
19caps.drop all
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34
35private-cache
36private-dev
37private-tmp
38
diff --git a/etc/profile-a-l/lxmusic.profile b/etc/profile-a-l/lxmusic.profile
new file mode 100644
index 000000000..0651b8329
--- /dev/null
+++ b/etc/profile-a-l/lxmusic.profile
@@ -0,0 +1,40 @@
1# Firejail profile for lxmusic
2# Description: LXDE music player
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lxmusic.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/xmms2
10noblacklist ${HOME}/.config/xmms2
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24netfilter
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37
38private-dev
39private-tmp
40
diff --git a/etc/profile-a-l/lynx.profile b/etc/profile-a-l/lynx.profile
new file mode 100644
index 000000000..05a92e39d
--- /dev/null
+++ b/etc/profile-a-l/lynx.profile
@@ -0,0 +1,42 @@
1# Firejail profile for lynx
2# Description: Classic non-graphical (text-mode) web browser
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lynx.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}/wayland-*
12
13include disable-common.inc
14include disable-devel.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-runuser-common.inc
20
21caps.drop all
22netfilter
23no3d
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36tracelog
37
38# private-bin lynx
39private-cache
40private-dev
41# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl
42private-tmp
diff --git a/etc/profile-a-l/lyx.profile b/etc/profile-a-l/lyx.profile
new file mode 100644
index 000000000..fa69463d1
--- /dev/null
+++ b/etc/profile-a-l/lyx.profile
@@ -0,0 +1,38 @@
1# Firejail profile for lyx
2# Description: Open source document processor based on LaTeX typsetting
3# This file is overwritten after every install/update
4# Persistent local customizations
5include lyx.local
6# Persistent global definitions
7include globals.local
8
9ignore private-tmp
10
11noblacklist ${HOME}/.config/LyX
12noblacklist ${HOME}/.lyx
13
14# Allow lua (blacklisted by disable-interpreters.inc)
15include allow-lua.inc
16
17# Allow perl (blacklisted by disable-interpreters.inc)
18include allow-perl.inc
19
20# Allow python (blacklisted by disable-interpreters.inc)
21include allow-python2.inc
22include allow-python3.inc
23
24whitelist /usr/share/lyx
25whitelist /usr/share/texinfo
26whitelist /usr/share/texlive
27whitelist /usr/share/texmf-dist
28whitelist /usr/share/tlpkg
29include whitelist-usr-share-common.inc
30
31apparmor
32machine-id
33
34# private-bin atril,dvilualatex,env,latex,lua*,luatex,lyx,lyxclient,okular,pdf2latex,pdflatex,pdftex,perl*,python*,qpdf,qpdfview,sh,tex2lyx,texmf,xelatex
35private-etc alternatives,dconf,fonts,gtk-2.0,gtk-3.0,locale,locale.alias,locale.conf,lyx,machine-id,mime.types,passwd,texmf,X11,xdg
36
37# Redirect
38include latex-common.profile
diff --git a/etc/profile-a-l/lzcat.profile b/etc/profile-a-l/lzcat.profile
new file mode 100644
index 000000000..693a1e167
--- /dev/null
+++ b/etc/profile-a-l/lzcat.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzcat.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzcmp.profile b/etc/profile-a-l/lzcmp.profile
new file mode 100644
index 000000000..f2e49fde0
--- /dev/null
+++ b/etc/profile-a-l/lzcmp.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzcmp.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzdiff.profile b/etc/profile-a-l/lzdiff.profile
new file mode 100644
index 000000000..1e2e17eee
--- /dev/null
+++ b/etc/profile-a-l/lzdiff.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzdiff.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzegrep.profile b/etc/profile-a-l/lzegrep.profile
new file mode 100644
index 000000000..ca93f2a8b
--- /dev/null
+++ b/etc/profile-a-l/lzegrep.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzegrep.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzfgrep.profile b/etc/profile-a-l/lzfgrep.profile
new file mode 100644
index 000000000..97138e9a0
--- /dev/null
+++ b/etc/profile-a-l/lzfgrep.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzfgrep.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzgrep.profile b/etc/profile-a-l/lzgrep.profile
new file mode 100644
index 000000000..fca9a39df
--- /dev/null
+++ b/etc/profile-a-l/lzgrep.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzgrep.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzip.profile b/etc/profile-a-l/lzip.profile
new file mode 100644
index 000000000..806375b05
--- /dev/null
+++ b/etc/profile-a-l/lzip.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzip.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzless.profile b/etc/profile-a-l/lzless.profile
new file mode 100644
index 000000000..20cae4a87
--- /dev/null
+++ b/etc/profile-a-l/lzless.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzless.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzma.profile b/etc/profile-a-l/lzma.profile
new file mode 100644
index 000000000..776550bf9
--- /dev/null
+++ b/etc/profile-a-l/lzma.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzma.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzmadec.profile b/etc/profile-a-l/lzmadec.profile
new file mode 100644
index 000000000..9dac75927
--- /dev/null
+++ b/etc/profile-a-l/lzmadec.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for xzdec
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzmadec.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include xzdec.profile
diff --git a/etc/profile-a-l/lzmainfo.profile b/etc/profile-a-l/lzmainfo.profile
new file mode 100644
index 000000000..25b65c48f
--- /dev/null
+++ b/etc/profile-a-l/lzmainfo.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzmainfo.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzmore.profile b/etc/profile-a-l/lzmore.profile
new file mode 100644
index 000000000..aa4350ad5
--- /dev/null
+++ b/etc/profile-a-l/lzmore.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzmore.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-a-l/lzop.profile b/etc/profile-a-l/lzop.profile
new file mode 100644
index 000000000..f3175c590
--- /dev/null
+++ b/etc/profile-a-l/lzop.profile
@@ -0,0 +1,12 @@
1# Firejail profile for lzop
2# Description: File compressor using lzo lib
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include lzop.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/Maelstrom.profile b/etc/profile-m-z/Maelstrom.profile
new file mode 100644
index 000000000..3acb88e0e
--- /dev/null
+++ b/etc/profile-m-z/Maelstrom.profile
@@ -0,0 +1,46 @@
1# Firejail profile for Maelstrom
2# Description: A space combat game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include Maelstrom.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /var/lib/games/Maelstrom-Scores
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19whitelist /var/lib/games
20include whitelist-common.inc
21include whitelist-var-common.inc
22
23caps.drop all
24ipc-namespace
25net none
26nodvd
27nogroups
28noinput
29#nonewprivs
30#noroot
31notv
32nou2f
33novideo
34#protocol unix
35#seccomp
36shell none
37tracelog
38
39disable-mnt
40private-bin Maelstrom
41private-cache
42private-dev
43private-tmp
44
45dbus-user none
46dbus-system none
diff --git a/etc/profile-m-z/Maps.profile b/etc/profile-m-z/Maps.profile
new file mode 100644
index 000000000..493a740d7
--- /dev/null
+++ b/etc/profile-m-z/Maps.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-maps
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Maps.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include gnome-maps.profile
diff --git a/etc/profile-m-z/Mathematica.profile b/etc/profile-m-z/Mathematica.profile
new file mode 100644
index 000000000..6286f066e
--- /dev/null
+++ b/etc/profile-m-z/Mathematica.profile
@@ -0,0 +1,29 @@
1# Firejail profile for Mathematica
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Mathematica.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.Mathematica
9noblacklist ${HOME}/.Wolfram Research
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16mkdir ${HOME}/.Mathematica
17mkdir ${HOME}/.Wolfram Research
18mkdir ${HOME}/Documents/Wolfram Mathematica
19whitelist ${HOME}/.Mathematica
20whitelist ${HOME}/.Wolfram Research
21whitelist ${HOME}/Documents/Wolfram Mathematica
22include whitelist-common.inc
23
24caps.drop all
25nodvd
26nonewprivs
27noroot
28notv
29seccomp
diff --git a/etc/profile-m-z/Natron.profile b/etc/profile-m-z/Natron.profile
new file mode 100644
index 000000000..061e5d83b
--- /dev/null
+++ b/etc/profile-m-z/Natron.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for natron
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Natron.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include natron.profile
diff --git a/etc/profile-m-z/PCSX2.profile b/etc/profile-m-z/PCSX2.profile
new file mode 100644
index 000000000..59150f4c4
--- /dev/null
+++ b/etc/profile-m-z/PCSX2.profile
@@ -0,0 +1,56 @@
1# Firejail profile for PCSX2
2# Description: A PlayStation 2 emulator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include PCSX2.local
6# Persistent global definitions
7include globals.local
8
9# Note: you must whitelist your games folder in your PCSX2.local.
10
11noblacklist ${HOME}/.config/PCSX2
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-write-mnt.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.config/PCSX2
23whitelist ${HOME}/.config/PCSX2
24include whitelist-common.inc
25include whitelist-runuser-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32net none
33netfilter
34# Add the next line to your PCSX2.local if you're not loading games from disc.
35#nodvd
36nogroups
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix,netlink
43#seccomp - breaks loading with no logs
44shell none
45#tracelog - 32/64 bit incompatibility
46
47private-bin PCSX2
48private-cache
49# Add the next line to your PCSX2.local if you do not need controller support.
50#private-dev
51private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,dconf,drirc,fonts,gconf,glvnd,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,nvidia,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
52private-opt none
53private-tmp
54
55dbus-user none
56dbus-system none
diff --git a/etc/profile-m-z/PPSSPPQt.profile b/etc/profile-m-z/PPSSPPQt.profile
new file mode 100644
index 000000000..c5592f99c
--- /dev/null
+++ b/etc/profile-m-z/PPSSPPQt.profile
@@ -0,0 +1,9 @@
1# Firejail profile for PPSSPPQt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include PPSSPPQt.local
5# added by included profile
6#include globals.local
7
8# Redirect
9include ppsspp.profile
diff --git a/etc/profile-m-z/PPSSPPSDL.profile b/etc/profile-m-z/PPSSPPSDL.profile
new file mode 100644
index 000000000..deb00a436
--- /dev/null
+++ b/etc/profile-m-z/PPSSPPSDL.profile
@@ -0,0 +1,9 @@
1# Firejail profile for PPSSPPSDL
2# This file is overwritten after every install/update
3# Persistent local customizations
4include PPSSPPSDL.local
5# added by included profile
6#include globals.local
7
8# Redirect
9include ppsspp.profile
diff --git a/etc/profile-m-z/QMediathekView.profile b/etc/profile-m-z/QMediathekView.profile
new file mode 100644
index 000000000..17ea38073
--- /dev/null
+++ b/etc/profile-m-z/QMediathekView.profile
@@ -0,0 +1,59 @@
1# Firejail profile for QMediathekView
2# Description: Search, download or stream files from mediathek.de
3# This file is overwritten after every install/update
4# Persistent local customizations
5include QMediathekView.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/QMediathekView
10noblacklist ${HOME}/.local/share/QMediathekView
11
12noblacklist ${HOME}/.config/mpv
13noblacklist ${HOME}/.config/smplayer
14noblacklist ${HOME}/.config/totem
15noblacklist ${HOME}/.config/vlc
16noblacklist ${HOME}/.config/xplayer
17noblacklist ${HOME}/.local/share/totem
18noblacklist ${HOME}/.local/share/xplayer
19noblacklist ${HOME}/.mplayer
20noblacklist ${VIDEOS}
21
22include disable-common.inc
23include disable-devel.inc
24include disable-exec.inc
25include disable-interpreters.inc
26include disable-programs.inc
27include disable-shell.inc
28include disable-xdg.inc
29
30whitelist /usr/share/qtchooser
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34caps.drop all
35netfilter
36# no3d
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42notv
43nou2f
44novideo
45protocol unix,inet,inet6,netlink
46seccomp
47shell none
48tracelog
49
50disable-mnt
51private-bin mplayer,mpv,QMediathekView,smplayer,totem,vlc,xplayer
52private-cache
53private-dev
54private-tmp
55
56dbus-user none
57dbus-system none
58
59#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-m-z/QOwnNotes.profile b/etc/profile-m-z/QOwnNotes.profile
new file mode 100644
index 000000000..15cb931dd
--- /dev/null
+++ b/etc/profile-m-z/QOwnNotes.profile
@@ -0,0 +1,55 @@
1# Firejail profile for QOwnNotes
2# Description: Plain-text file notepad with markdown support and ownCloud integration
3# This file is overwritten after every install/update
4# Persistent local customizations
5include QOwnNotes.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${HOME}/Nextcloud/Notes
11noblacklist ${HOME}/.config/PBE
12noblacklist ${HOME}/.local/share/PBE
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/Nextcloud/Notes
23mkdir ${HOME}/.config/PBE
24mkdir ${HOME}/.local/share/PBE
25whitelist ${DOCUMENTS}
26whitelist ${HOME}/Nextcloud/Notes
27whitelist ${HOME}/.config/PBE
28whitelist ${HOME}/.local/share/PBE
29include whitelist-common.inc
30include whitelist-var-common.inc
31
32caps.drop all
33machine-id
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6,netlink
46seccomp
47shell none
48tracelog
49
50disable-mnt
51private-bin gio,QOwnNotes
52private-dev
53private-etc alternatives,ca-certificates,crypto-policies,fonts,host.conf,hosts,ld.so.cache,machine-id,nsswitch.conf,pki,pulse,resolv.conf,ssl
54private-tmp
55
diff --git a/etc/profile-m-z/Screenshot.profile b/etc/profile-m-z/Screenshot.profile
new file mode 100644
index 000000000..cfc53c077
--- /dev/null
+++ b/etc/profile-m-z/Screenshot.profile
@@ -0,0 +1,11 @@
1# Firejail profile for gnome-screenshot
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Screenshot.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Temporary fix for https://github.com/netblue30/firejail/issues/2624
10# Redirect
11include gnome-screenshot.profile
diff --git a/etc/profile-m-z/Telegram.profile b/etc/profile-m-z/Telegram.profile
new file mode 100644
index 000000000..6877e1578
--- /dev/null
+++ b/etc/profile-m-z/Telegram.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for telegram
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Telegram.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include telegram.profile
diff --git a/etc/profile-m-z/Thunar.profile b/etc/profile-m-z/Thunar.profile
new file mode 100644
index 000000000..28acb414b
--- /dev/null
+++ b/etc/profile-m-z/Thunar.profile
@@ -0,0 +1,12 @@
1# Firejail profile for Thunar
2# Description: File Manager for Xfce
3# This file is overwritten after every install/update
4# Persistent local customizations
5include Thunar.local
6# Persistent global definitions
7include globals.local
8
9# Put 'ignore noroot' in your pcmanfm.local if you use MPV+Vulkan (see issue #3012)
10
11# Redirect
12include file-manager-common.profile
diff --git a/etc/profile-m-z/Viber.profile b/etc/profile-m-z/Viber.profile
new file mode 100644
index 000000000..866d57e67
--- /dev/null
+++ b/etc/profile-m-z/Viber.profile
@@ -0,0 +1,37 @@
1# Firejail profile for Viber
2# This file is overwritten after every install/update
3# Persistent local customizations
4include Viber.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.ViberPC
9noblacklist ${PATH}/dig
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.ViberPC
18whitelist ${DOWNLOADS}
19whitelist ${HOME}/.ViberPC
20include whitelist-common.inc
21
22caps.drop all
23ipc-namespace
24netfilter
25nodvd
26nogroups
27nonewprivs
28noroot
29notv
30protocol unix,inet,inet6
31seccomp !chroot
32shell none
33
34disable-mnt
35private-bin awk,bash,dig,sh,Viber
36private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,hosts,localtime,machine-id,mailcap,nsswitch.conf,pki,proxychains.conf,pulse,resolv.conf,ssl,X11
37private-tmp
diff --git a/etc/profile-m-z/VirtualBox.profile b/etc/profile-m-z/VirtualBox.profile
new file mode 100644
index 000000000..4f88a26c0
--- /dev/null
+++ b/etc/profile-m-z/VirtualBox.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for virtualbox
2# Description: x86 virtualization solution
3# This file is overwritten after every install/update
4# Persistent local customizations
5include VirtualBox.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include virtualbox.profile
diff --git a/etc/profile-m-z/XMind.profile b/etc/profile-m-z/XMind.profile
new file mode 100644
index 000000000..9c797a3e5
--- /dev/null
+++ b/etc/profile-m-z/XMind.profile
@@ -0,0 +1,38 @@
1# Firejail profile for XMind
2# This file is overwritten after every install/update
3# Persistent local customizations
4include XMind.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.xmind
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16mkdir ${HOME}/.xmind
17whitelist ${HOME}/.xmind
18whitelist ${DOWNLOADS}
19include whitelist-common.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28notv
29nou2f
30protocol unix,inet,inet6
31seccomp
32shell none
33
34disable-mnt
35private-bin cp,sh,XMind
36private-tmp
37private-dev
38
diff --git a/etc/Xephyr.profile b/etc/profile-m-z/Xephyr.profile
index c0c322b67..5cf5161ce 100644
--- a/etc/Xephyr.profile
+++ b/etc/profile-m-z/Xephyr.profile
@@ -1,42 +1,43 @@
1# Firejail profile for Xephyr 1# Firejail profile for Xephyr
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/Xephyr.local 4quiet
5include Xephyr.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8# 9#
9# This profile will sandbox Xephyr server itself when used with firejail --x11=xephyr. 10# This profile will sandbox Xephyr server itself when used with firejail --x11=xephyr.
10# To enable it, create a firejail-Xephyr symlink in /usr/local/bin: 11# To enable it, create a firejail-Xephyr symlink in /usr/local/bin:
11# 12#
12# $ sudo ln -s /usr/bin/firejail /usr/local/bin/Xephyr 13# $ sudo ln -s /usr/bin/firejail /usr/local/bin/Xephyr
13# 14#
14# or run "sudo firecfg" 15# or run "sudo firecfg"
15# 16#
16 17
17
18blacklist /media
19
20whitelist /var/lib/xkb 18whitelist /var/lib/xkb
21include /etc/firejail/whitelist-common.inc 19include whitelist-common.inc
22 20
23caps.drop all 21caps.drop all
24# Xephyr needs to be allowed access to the abstract Unix socket namespace. 22# Xephyr needs to be allowed access to the abstract Unix socket namespace.
25nodvd 23nodvd
26nogroups 24nogroups
25noinput
27nonewprivs 26nonewprivs
28# In noroot mode, Xephyr cannot create a socket in the real /tmp/.X11-unix. 27# In noroot mode, Xephyr cannot create a socket in the real /tmp/.X11-unix.
29# noroot 28# noroot
30nosound 29nosound
31notv 30notv
31nou2f
32protocol unix 32protocol unix
33seccomp 33seccomp
34shell none 34shell none
35 35
36disable-mnt
36# using a private home directory 37# using a private home directory
37private 38private
38# private-bin Xephyr,sh,xkbcomp 39# private-bin sh,Xephyr,xkbcomp
39# private-bin Xephyr,sh,xkbcomp,strace,bash,cat,ls 40# private-bin bash,cat,ls,sh,strace,Xephyr,xkbcomp
40private-dev 41private-dev
41# private-etc ld.so.conf,ld.so.cache,resolv.conf,host.conf,nsswitch.conf,gai.conf,hosts,hostname 42# private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,nsswitch.conf,resolv.conf
42private-tmp 43#private-tmp
diff --git a/etc/Xvfb.profile b/etc/profile-m-z/Xvfb.profile
index 7921e0d06..1acd43023 100644
--- a/etc/Xvfb.profile
+++ b/etc/profile-m-z/Xvfb.profile
@@ -1,14 +1,16 @@
1# Firejail profile for Xvfb 1# Firejail profile for Xvfb
2# Description: Virtual Framebuffer 'fake' X server
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
4quiet
3# Persistent local customizations 5# Persistent local customizations
4include /etc/firejail/Xvfb.local 6include Xvfb.local
5# Persistent global definitions 7# Persistent global definitions
6include /etc/firejail/globals.local 8include globals.local
7 9
8# 10#
9# This profile will sandbox Xvfb server itself when used with firejail --x11=xvfb. 11# This profile will sandbox Xvfb server itself when used with firejail --x11=xvfb.
10# The target program is sandboxed with its own profile. By default the this functionality 12# The target program is sandboxed with its own profile. By default the this functionality
11# is disabled. To enable it, create a firejail-Xvfb symlink in /usr/local/bin: 13# is disabled. To enable it, create a firejail-Xvfb symlink in /usr/local/bin:
12# 14#
13# $ sudo ln -s /usr/bin/firejail /usr/local/bin/Xvfb 15# $ sudo ln -s /usr/bin/firejail /usr/local/bin/Xvfb
14# 16#
@@ -16,28 +18,30 @@ include /etc/firejail/globals.local
16# some Linux distributions. Also, older versions of Xpra use Xvfb. 18# some Linux distributions. Also, older versions of Xpra use Xvfb.
17# 19#
18 20
19blacklist /media
20
21whitelist /var/lib/xkb 21whitelist /var/lib/xkb
22include /etc/firejail/whitelist-common.inc 22include whitelist-common.inc
23 23
24caps.drop all 24caps.drop all
25# Xvfb needs to be allowed access to the abstract Unix socket namespace. 25# Xvfb needs to be allowed access to the abstract Unix socket namespace.
26nodvd 26nodvd
27nogroups 27nogroups
28noinput
28nonewprivs 29nonewprivs
29# In noroot mode, Xvfb cannot create a socket in the real /tmp/.X11-unix. 30# In noroot mode, Xvfb cannot create a socket in the real /tmp/.X11-unix.
30#noroot 31#noroot
31nosound 32nosound
32notv 33notv
34nou2f
35novideo
33protocol unix 36protocol unix
34seccomp 37seccomp
35shell none 38shell none
36 39
40disable-mnt
37# using a private home directory 41# using a private home directory
38private 42private
39# private-bin Xvfb,sh,xkbcomp 43# private-bin sh,xkbcomp,Xvfb
40# private-bin Xvfb,sh,xkbcomp,strace,bash,cat,ls 44# private-bin bash,cat,ls,sh,strace,xkbcomp,Xvfb
41private-dev 45private-dev
42private-etc ld.so.conf,ld.so.cache,resolv.conf,host.conf,nsswitch.conf,gai.conf,hosts,hostname 46private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,nsswitch.conf,resolv.conf
43private-tmp 47private-tmp
diff --git a/etc/profile-m-z/ZeGrapher.profile b/etc/profile-m-z/ZeGrapher.profile
new file mode 100644
index 000000000..21482a161
--- /dev/null
+++ b/etc/profile-m-z/ZeGrapher.profile
@@ -0,0 +1,48 @@
1# Firejail profile for ZeGrapher
2# Description: Free and opensource math graphing software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ZeGrapher.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/ZeGrapher Project
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18whitelist /usr/share/ZeGrapher
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,netlink
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin ZeGrapher
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-m-z/macrofusion.profile b/etc/profile-m-z/macrofusion.profile
new file mode 100644
index 000000000..88b68d43f
--- /dev/null
+++ b/etc/profile-m-z/macrofusion.profile
@@ -0,0 +1,45 @@
1# Firejail profile for macrofusion
2# This file is overwritten after every install/update
3# Persistent local customizations
4include macrofusion.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/mfusion
9noblacklist ${PICTURES}
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23caps.drop all
24ipc-namespace
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38
39private-bin align_image_stack,enfuse,env,exiftool,macrofusion,python*
40private-cache
41private-dev
42private-tmp
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-m-z/magicor.profile b/etc/profile-m-z/magicor.profile
new file mode 100644
index 000000000..fc5ae3ee9
--- /dev/null
+++ b/etc/profile-m-z/magicor.profile
@@ -0,0 +1,52 @@
1# Firejail profile for magicor
2# Description: Push ice blocks around to extinguish all fires
3# This file is overwritten after every install/update
4# Persistent local customizations
5include magicor.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.magicor
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.magicor
23whitelist ${HOME}/.magicor
24whitelist /usr/share/magicor
25include whitelist-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31net none
32nodvd
33nogroups
34noinput
35nonewprivs
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin magicor,python2*
46private-cache
47private-dev
48private-etc machine-id
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-m-z/makepkg.profile b/etc/profile-m-z/makepkg.profile
new file mode 100644
index 000000000..3a68cce00
--- /dev/null
+++ b/etc/profile-m-z/makepkg.profile
@@ -0,0 +1,60 @@
1# Firejail profile for makepkg
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include makepkg.local
6# Persistent global definitions
7include globals.local
8
9blacklist /tmp/.X11-unix
10blacklist ${RUNUSER}/wayland-*
11
12# Note: see this Arch forum discussion https://bbs.archlinux.org/viewtopic.php?pid=1743138
13# for potential issues and their solutions when Firejailing makepkg
14
15# This profile could be significantly strengthened by adding the following to makepkg.local
16# whitelist ${HOME}/<Your Build Folder>
17# whitelist ${HOME}/.gnupg
18
19# Enable severely restricted access to ${HOME}/.gnupg
20noblacklist ${HOME}/.gnupg
21read-only ${HOME}/.gnupg/gpg.conf
22read-only ${HOME}/.gnupg/trustdb.gpg
23read-only ${HOME}/.gnupg/pubring.kbx
24blacklist ${HOME}/.gnupg/random_seed
25blacklist ${HOME}/.gnupg/pubring.kbx~
26blacklist ${HOME}/.gnupg/private-keys-v1.d
27blacklist ${HOME}/.gnupg/crls.d
28blacklist ${HOME}/.gnupg/openpgp-revocs.d
29
30# Arch Linux (based distributions) need access to /var/lib/pacman. As we drop all capabilities this is automatically read-only.
31noblacklist /var/lib/pacman
32
33include disable-common.inc
34include disable-exec.inc
35include disable-programs.inc
36
37caps.drop all
38machine-id
39ipc-namespace
40netfilter
41no3d
42nodvd
43nogroups
44nonewprivs
45# noroot is only disabled to allow the creation of kernel headers from an official PKGBUILD.
46#noroot
47nosound
48nou2f
49notv
50novideo
51protocol unix,inet,inet6
52seccomp
53shell none
54tracelog
55
56disable-mnt
57private-cache
58private-tmp
59
60memory-deny-write-execute
diff --git a/etc/profile-m-z/man.profile b/etc/profile-m-z/man.profile
new file mode 100644
index 000000000..b2f761230
--- /dev/null
+++ b/etc/profile-m-z/man.profile
@@ -0,0 +1,69 @@
1# Firejail profile for man
2# Description: manpage viewer
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include man.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12noblacklist ${HOME}/.local/share/man
13noblacklist ${HOME}/.rustup
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22#mkdir ${HOME}/.local/share/man
23#whitelist ${HOME}/.local/share/man
24#whitelist ${HOME}/.manpath
25whitelist /usr/share/groff
26whitelist /usr/share/info
27whitelist /usr/share/lintian
28whitelist /usr/share/locale
29whitelist /usr/share/man
30whitelist /var/cache/man
31#include whitelist-common.inc
32include whitelist-runuser-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38ipc-namespace
39machine-id
40net none
41no3d
42nodvd
43nogroups
44noinput
45nonewprivs
46noroot
47nosound
48notv
49novideo
50nou2f
51protocol unix
52seccomp
53shell none
54tracelog
55x11 none
56
57disable-mnt
58#private-bin apropos,bash,cat,catman,col,gpreconv,groff,grotty,gunzip,gzip,less,man,most,nroff,preconv,sed,sh,tbl,tr,troff,whatis,which,xtotroff,zcat,zsoelim
59private-cache
60private-dev
61private-etc alternatives,fonts,groff,locale,locale.alias,locale.conf,man_db.conf,manpath.config,selinux,sysless,xdg
62#private-tmp
63
64dbus-user none
65dbus-system none
66
67memory-deny-write-execute
68read-only ${HOME}
69read-only /tmp
diff --git a/etc/profile-m-z/manaplus.profile b/etc/profile-m-z/manaplus.profile
new file mode 100644
index 000000000..28dc5d914
--- /dev/null
+++ b/etc/profile-m-z/manaplus.profile
@@ -0,0 +1,51 @@
1# Firejail profile for manaplus
2# Description: 2D MMORPG client for Evol Online and The Mana World
3# This file is overwritten after every install/update
4# Persistent local customizations
5include manaplus.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mana
10noblacklist ${HOME}/.local/share/mana
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/mana
21mkdir ${HOME}/.config/mana/mana
22mkdir ${HOME}/.local/share/mana
23whitelist ${HOME}/.config/mana
24whitelist ${HOME}/.local/share/mana
25include whitelist-common.inc
26include whitelist-var-common.inc
27
28caps.drop all
29ipc-namespace
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin manaplus
46private-cache
47private-dev
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-m-z/marker.profile b/etc/profile-m-z/marker.profile
new file mode 100644
index 000000000..746135ae5
--- /dev/null
+++ b/etc/profile-m-z/marker.profile
@@ -0,0 +1,63 @@
1# Firejail profile for marker
2# Description: Marker is a markdown editor for Linux made with Gtk+-3.0
3# This file is overwritten after every install/update
4# Persistent local customizations
5include marker.local
6# Persistent global definitions
7include globals.local
8
9# Add the next lines to your marker.local if you need internet access.
10#ignore net none
11#protocol unix,inet,inet6
12#private-etc ca-certificates,ssl,pki,crypto-policies,nsswitch.conf,resolv.conf
13
14noblacklist ${HOME}/.cache/marker
15noblacklist ${DOCUMENTS}
16
17include allow-python3.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-shell.inc
25include disable-xdg.inc
26
27whitelist /usr/libexec/webkit2gtk-4.0
28whitelist /usr/share/com.github.fabiocolacio.marker
29include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33apparmor
34caps.drop all
35machine-id
36net none
37netfilter
38no3d
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54private-bin marker,python3*
55private-cache
56private-dev
57private-etc alternatives,dconfgtk-3.0,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,pango,X11
58private-tmp
59
60dbus-user filter
61dbus-user.own com.github.fabiocolacio.marker
62dbus-user.talk ca.desrt.dconf
63dbus-system none
diff --git a/etc/profile-m-z/masterpdfeditor.profile b/etc/profile-m-z/masterpdfeditor.profile
new file mode 100644
index 000000000..e61578ffe
--- /dev/null
+++ b/etc/profile-m-z/masterpdfeditor.profile
@@ -0,0 +1,41 @@
1# Firejail profile for masterpdfeditor
2# Description: A complete solution for creating and editing PDF files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include masterpdfeditor.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Code Industry
10noblacklist ${HOME}/.masterpdfeditor
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22machine-id
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35tracelog
36
37private-cache
38private-dev
39private-etc alternatives,fonts
40private-tmp
41
diff --git a/etc/profile-m-z/masterpdfeditor4.profile b/etc/profile-m-z/masterpdfeditor4.profile
new file mode 100644
index 000000000..84e78171f
--- /dev/null
+++ b/etc/profile-m-z/masterpdfeditor4.profile
@@ -0,0 +1,11 @@
1# Firejail profile for masterpdfeditor4
2# Description: A complete solution for creating and editing PDF files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include masterpdfeditor4.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include masterpdfeditor.profile
diff --git a/etc/profile-m-z/masterpdfeditor5.profile b/etc/profile-m-z/masterpdfeditor5.profile
new file mode 100644
index 000000000..057d343dd
--- /dev/null
+++ b/etc/profile-m-z/masterpdfeditor5.profile
@@ -0,0 +1,11 @@
1# Firejail profile for masterpdfeditor5
2# Description: A complete solution for creating and editing PDF files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include masterpdfeditor5.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include masterpdfeditor.profile
diff --git a/etc/profile-m-z/mate-calc.profile b/etc/profile-m-z/mate-calc.profile
new file mode 100644
index 000000000..64b184482
--- /dev/null
+++ b/etc/profile-m-z/mate-calc.profile
@@ -0,0 +1,53 @@
1# Firejail profile for mate-calc
2# Description: MATE desktop calculator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mate-calc.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mate-calc
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.cache/mate-calc
18mkdir ${HOME}/.config/caja
19mkdir ${HOME}/.config/mate-menu
20whitelist ${HOME}/.cache/mate-calc
21whitelist ${HOME}/.config/caja
22whitelist ${HOME}/.config/mate-menu
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42
43disable-mnt
44private-bin mate-calc,mate-calculator
45private-etc alternatives,dconf,fonts,gtk-3.0
46private-dev
47private-opt none
48private-tmp
49
50dbus-user none
51dbus-system none
52
53memory-deny-write-execute
diff --git a/etc/profile-m-z/mate-calculator.profile b/etc/profile-m-z/mate-calculator.profile
new file mode 100644
index 000000000..5c8200ec5
--- /dev/null
+++ b/etc/profile-m-z/mate-calculator.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for mate-calc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include mate-calculator.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include mate-calc.profile
diff --git a/etc/profile-m-z/mate-color-select.profile b/etc/profile-m-z/mate-color-select.profile
new file mode 100644
index 000000000..a6b49315c
--- /dev/null
+++ b/etc/profile-m-z/mate-color-select.profile
@@ -0,0 +1,41 @@
1# Firejail profile for mate-color-select
2# This file is overwritten after every install/update
3# Persistent local customizations
4include mate-color-select.local
5# Persistent global definitions
6include globals.local
7
8include disable-common.inc
9include disable-devel.inc
10include disable-exec.inc
11include disable-interpreters.inc
12include disable-programs.inc
13include disable-shell.inc
14
15include whitelist-common.inc
16
17apparmor
18caps.drop all
19netfilter
20no3d
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26nosound
27notv
28nou2f
29novideo
30protocol unix
31seccomp
32shell none
33
34disable-mnt
35private-bin mate-color-select
36private-etc alternatives,fonts
37private-dev
38private-lib
39private-tmp
40
41memory-deny-write-execute
diff --git a/etc/mate-dictionary.profile b/etc/profile-m-z/mate-dictionary.profile
index 3f85addaf..3f3d027b9 100644
--- a/etc/mate-dictionary.profile
+++ b/etc/profile-m-z/mate-dictionary.profile
@@ -1,32 +1,35 @@
1# Firejail profile for mate-dictionary 1# Firejail profile for mate-dictionary
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/mate-dictionary.local 4include mate-dictionary.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/mate/mate-dictionary 8noblacklist ${HOME}/.config/mate/mate-dictionary
9 9
10include /etc/firejail/disable-common.inc 10include disable-common.inc
11include /etc/firejail/disable-devel.inc 11include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 12include disable-exec.inc
13include /etc/firejail/disable-programs.inc 13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
14 16
17mkdir ${HOME}/.config/mate/mate-dictionary
15whitelist ${HOME}/.config/mate/mate-dictionary 18whitelist ${HOME}/.config/mate/mate-dictionary
16whitelist ${HOME}/.config/gtk-3.0 19include whitelist-common.inc
17whitelist ${HOME}/.fonts
18whitelist ${HOME}/.icons
19whitelist ${HOME}/.themes
20 20
21apparmor
21caps.drop all 22caps.drop all
22netfilter 23netfilter
23no3d 24no3d
24nodvd 25nodvd
25nogroups 26nogroups
27noinput
26nonewprivs 28nonewprivs
27noroot 29noroot
28nosound 30nosound
29notv 31notv
32nou2f
30novideo 33novideo
31protocol unix,inet,inet6 34protocol unix,inet,inet6
32seccomp 35seccomp
@@ -34,11 +37,9 @@ shell none
34 37
35disable-mnt 38disable-mnt
36private-bin mate-dictionary 39private-bin mate-dictionary
37private-etc fonts,resolv.conf 40private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,resolv.conf,ssl
38private-opt mate-dictionary 41private-opt mate-dictionary
39private-dev 42private-dev
40private-tmp 43private-tmp
41 44
42memory-deny-write-execute 45memory-deny-write-execute
43noexec ${HOME}
44noexec /tmp
diff --git a/etc/profile-m-z/mathematica.profile b/etc/profile-m-z/mathematica.profile
new file mode 100644
index 000000000..cc73f9d80
--- /dev/null
+++ b/etc/profile-m-z/mathematica.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for Mathematica
2# This file is overwritten after every install/update
3# Persistent local customizations
4include mathematica.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include Mathematica.profile
diff --git a/etc/profile-m-z/matrix-mirage.profile b/etc/profile-m-z/matrix-mirage.profile
new file mode 100644
index 000000000..b3080df88
--- /dev/null
+++ b/etc/profile-m-z/matrix-mirage.profile
@@ -0,0 +1,24 @@
1# Firejail profile for matrix-mirage
2# Description: Debian name for mirage binary/package
3# This file is overwritten after every install/update
4# Persistent local customizations
5include matrix-mirage.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist ${HOME}/.cache/matrix-mirage
11noblacklist ${HOME}/.config/matrix-mirage
12noblacklist ${HOME}/.local/share/matrix-mirage
13
14mkdir ${HOME}/.cache/matrix-mirage
15mkdir ${HOME}/.config/matrix-mirage
16mkdir ${HOME}/.local/share/matrix-mirage
17whitelist ${HOME}/.cache/matrix-mirage
18whitelist ${HOME}/.config/matrix-mirage
19whitelist ${HOME}/.local/share/matrix-mirage
20
21private-bin matrix-mirage
22
23# Redirect
24include mirage.profile
diff --git a/etc/profile-m-z/mattermost-desktop.profile b/etc/profile-m-z/mattermost-desktop.profile
new file mode 100644
index 000000000..3c2bf4fa3
--- /dev/null
+++ b/etc/profile-m-z/mattermost-desktop.profile
@@ -0,0 +1,29 @@
1# Firejail profile for mattermost-desktop
2# This file is overwritten after every install/update
3# Persistent local customizations
4include mattermost-desktop.local
5# Persistent global definitions
6include globals.local
7
8# Disabled until someone reported positive feedback
9ignore apparmor
10ignore dbus-user none
11ignore dbus-system none
12
13noblacklist ${HOME}/.config/Mattermost
14
15include disable-shell.inc
16
17mkdir ${HOME}/.config/Mattermost
18whitelist ${HOME}/.config/Mattermost
19
20private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nsswitch.conf,pki,resolv.conf,ssl
21
22# Not tested
23#dbus-user filter
24#dbus-user.own com.mattermost.Desktop
25#dbus-user.talk org.freedesktop.Notifications
26#dbus-system none
27
28# Redirect
29include electron.profile
diff --git a/etc/mcabber.profile b/etc/profile-m-z/mcabber.profile
index 2e31e09ec..7592d879c 100644
--- a/etc/mcabber.profile
+++ b/etc/profile-m-z/mcabber.profile
@@ -1,25 +1,29 @@
1# Firejail profile for mcabber 1# Firejail profile for mcabber
2# Description: Small Jabber (XMPP) console client
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/mcabber.local 5include mcabber.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.mcabber 9noblacklist ${HOME}/.mcabber
9noblacklist ${HOME}/.mcabberrc 10noblacklist ${HOME}/.mcabberrc
10 11
11include /etc/firejail/disable-common.inc 12include disable-common.inc
12include /etc/firejail/disable-devel.inc 13include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 14include disable-interpreters.inc
14include /etc/firejail/disable-programs.inc 15include disable-programs.inc
16include disable-shell.inc
15 17
16caps.drop all 18caps.drop all
17netfilter 19netfilter
18nodvd 20nodvd
21noinput
19nonewprivs 22nonewprivs
20noroot 23noroot
21nosound 24nosound
22notv 25notv
26nou2f
23novideo 27novideo
24protocol inet,inet6 28protocol inet,inet6
25seccomp 29seccomp
@@ -27,4 +31,4 @@ shell none
27 31
28private-bin mcabber 32private-bin mcabber
29private-dev 33private-dev
30private-etc null 34private-etc alternatives,ca-certificates,crypto-policies,pki,ssl
diff --git a/etc/profile-m-z/mcomix.profile b/etc/profile-m-z/mcomix.profile
new file mode 100644
index 000000000..5c965f55c
--- /dev/null
+++ b/etc/profile-m-z/mcomix.profile
@@ -0,0 +1,73 @@
1# Firejail profile for mcomix
2# Description: A comic book and manga viewer in python
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mcomix.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mcomix
10noblacklist ${HOME}/.local/share/mcomix
11noblacklist ${DOCUMENTS}
12
13# Allow /bin/sh (blacklisted by disable-shell.inc)
14include allow-bin-sh.inc
15
16# Allow python (blacklisted by disable-interpreters.inc)
17# mcomix <= 1.2 uses python2
18include allow-python2.inc
19include allow-python3.inc
20
21include disable-common.inc
22include disable-devel.inc
23include disable-exec.inc
24include disable-interpreters.inc
25include disable-programs.inc
26include disable-shell.inc
27include disable-write-mnt.inc
28include disable-xdg.inc
29
30mkdir ${HOME}/.config/mcomix
31mkdir ${HOME}/.local/share/mcomix
32whitelist /usr/share/mcomix
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35include whitelist-runuser-common.inc
36
37apparmor
38caps.drop all
39machine-id
40net none
41nodvd
42nogroups
43noinput
44nonewprivs
45noroot
46nosound
47notv
48nou2f
49novideo
50protocol unix
51seccomp
52seccomp.block-secondary
53shell none
54tracelog
55
56# mcomix <= 1.2 uses python2
57private-bin 7z,lha,mcomix,mutool,python*,rar,sh,unrar,unzip
58private-cache
59private-dev
60# mcomix <= 1.2 uses gtk-2.0
61private-etc alternatives,dconf,fonts,gconf,gtk-2.0,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,pango,passwd,X11,xdg
62private-tmp
63
64dbus-user none
65dbus-system none
66
67read-only ${HOME}
68read-write ${HOME}/.config/mcomix
69read-write ${HOME}/.local/share/mcomix
70#to allow ${HOME}/.local/share/recently-used.xbel
71read-write ${HOME}/.local/share
72# used by mcomix <= 1.2, tip, make a symbolic link to .cache/thumbnails
73read-write ${HOME}/.thumbnails
diff --git a/etc/profile-m-z/md5sum.profile b/etc/profile-m-z/md5sum.profile
new file mode 100644
index 000000000..3612c73fd
--- /dev/null
+++ b/etc/profile-m-z/md5sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for md5sum
2# Description: compute and check MD5 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include md5sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin md5sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/mdr.profile b/etc/profile-m-z/mdr.profile
new file mode 100644
index 000000000..08d56ede5
--- /dev/null
+++ b/etc/profile-m-z/mdr.profile
@@ -0,0 +1,55 @@
1# Firejail profile for mdr
2# Description: A standalone Markdown renderer for the terminal
3# Persistent local customizations
4include mdr.local
5# Persistent global definitions
6include globals.local
7
8blacklist ${RUNUSER}/wayland-*
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
17
18whitelist ${DOWNLOADS}
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24hostname mdr
25ipc-namespace
26machine-id
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42x11 none
43
44disable-mnt
45private-bin mdr
46private-cache
47private-dev
48private-etc none
49private-lib
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-m-z/mediainfo.profile b/etc/profile-m-z/mediainfo.profile
new file mode 100644
index 000000000..7597d4067
--- /dev/null
+++ b/etc/profile-m-z/mediainfo.profile
@@ -0,0 +1,51 @@
1# Firejail profile for mediainfo
2# Description: Command-line utility for reading information from audio/video files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mediainfo.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18include whitelist-usr-share-common.inc
19include whitelist-var-common.inc
20
21apparmor
22caps.drop all
23ipc-namespace
24machine-id
25net none
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40x11 none
41
42private-bin mediainfo
43private-cache
44private-dev
45private-etc alternatives
46private-tmp
47
48dbus-user none
49dbus-system none
50
51memory-deny-write-execute
diff --git a/etc/profile-m-z/mediathekview.profile b/etc/profile-m-z/mediathekview.profile
new file mode 100644
index 000000000..f73ef0935
--- /dev/null
+++ b/etc/profile-m-z/mediathekview.profile
@@ -0,0 +1,49 @@
1# Firejail profile for mediathekview
2# Description: View streams from German public television stations
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mediathekview.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mpv
10noblacklist ${HOME}/.config/smplayer
11noblacklist ${HOME}/.config/totem
12noblacklist ${HOME}/.config/vlc
13noblacklist ${HOME}/.config/xplayer
14noblacklist ${HOME}/.local/share/totem
15noblacklist ${HOME}/.local/share/xplayer
16noblacklist ${HOME}/.mediathek3
17noblacklist ${HOME}/.mplayer
18noblacklist ${VIDEOS}
19
20# Allow java (blacklisted by disable-devel.inc)
21include allow-java.inc
22
23include disable-common.inc
24include disable-devel.inc
25include disable-exec.inc
26include disable-interpreters.inc
27include disable-programs.inc
28include disable-xdg.inc
29
30include whitelist-var-common.inc
31
32caps.drop all
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44tracelog
45
46private-cache
47private-dev
48private-tmp
49
diff --git a/etc/profile-m-z/megaglest.profile b/etc/profile-m-z/megaglest.profile
new file mode 100644
index 000000000..d55745698
--- /dev/null
+++ b/etc/profile-m-z/megaglest.profile
@@ -0,0 +1,53 @@
1# Firejail profile for megaglest
2# Description: 3D multi-player real time strategy game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include megaglest.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.megaglest
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.megaglest
20whitelist ${HOME}/.megaglest
21whitelist /usr/share/megaglest
22whitelist /usr/share/games/megaglest # Debian version
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30ipc-namespace
31netfilter
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39novideo
40protocol unix,inet,inet6,netlink
41seccomp
42seccomp.block-secondary
43shell none
44tracelog
45
46disable-mnt
47private-bin megaglest,megaglest_editor,megaglest_g3dviewer
48private-cache
49private-dev
50private-tmp
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-m-z/megaglest_editor.profile b/etc/profile-m-z/megaglest_editor.profile
new file mode 100644
index 000000000..4635573e6
--- /dev/null
+++ b/etc/profile-m-z/megaglest_editor.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for megaglest
2# This file is overwritten after every install/update
3# Persistent local customizations
4include megaglest_editor.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include megaglest.profile
diff --git a/etc/profile-m-z/meld.profile b/etc/profile-m-z/meld.profile
new file mode 100644
index 000000000..4aeca0f28
--- /dev/null
+++ b/etc/profile-m-z/meld.profile
@@ -0,0 +1,81 @@
1# Firejail profile for meld
2# Description: Graphical tool to diff and merge files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include meld.local
6# Persistent global definitions
7include globals.local
8
9# If you want to use meld as git mergetool (and maybe some other VCS integrations) you need
10# to bypass firejail. You can do this by removing the symlink or by calling it by its absolute path.
11# Removing the symlink:
12# $ sudo rm /usr/local/bin/meld
13# Calling it by its absolute path (example for git mergetool):
14# $ git config --global mergetool.meld.cmd /usr/bin/meld
15
16noblacklist ${HOME}/.config/meld
17noblacklist ${HOME}/.config/git
18noblacklist ${HOME}/.gitconfig
19noblacklist ${HOME}/.git-credentials
20noblacklist ${HOME}/.local/share/meld
21noblacklist ${HOME}/.subversion
22
23# Allow python (blacklisted by disable-interpreters.inc)
24# Python 2 is EOL (see #3164). Add the next line to your meld.local if you understand the risks
25# but want to keep Python 2 support for older meld versions.
26#include allow-python2.inc
27include allow-python3.inc
28
29# Allow ssh (blacklisted by disable-common.inc)
30include allow-ssh.inc
31
32blacklist /usr/libexec
33
34# Add the next line to your meld.local if you don't need to compare files in disable-common.inc.
35#include disable-common.inc
36include disable-devel.inc
37include disable-exec.inc
38include disable-interpreters.inc
39# Add the next line to your meld.local if you don't need to compare files in disable-programs.inc.
40#include disable-programs.inc
41include disable-shell.inc
42
43include whitelist-runuser-common.inc
44
45# Add the next lines to your meld.local if you don't need to compare files in /usr/share.
46#whitelist /usr/share/meld
47#include whitelist-usr-share-common.inc
48
49# Add the next line to your meld.local if you don't need to compare files in /var.
50#include whitelist-var-common.inc
51
52apparmor
53caps.drop all
54ipc-namespace
55machine-id
56netfilter
57no3d
58nodvd
59nogroups
60noinput
61nonewprivs
62noroot
63nosound
64notv
65nou2f
66novideo
67protocol unix,inet,inet6
68seccomp
69seccomp.block-secondary
70shell none
71tracelog
72
73private-bin bzr,cvs,git,hg,meld,python*,svn
74private-cache
75private-dev
76# Add the next line to your meld.local if you don't need to compare files in /etc.
77#private-etc alternatives,ca-certificates,crypto-policies,fonts,hostname,hosts,pki,resolv.conf,ssl,subversion
78# Add 'ignore private-tmp' to your meld.local if you want to use it as difftool (#3551).
79private-tmp
80
81read-only ${HOME}/.ssh
diff --git a/etc/profile-m-z/mencoder.profile b/etc/profile-m-z/mencoder.profile
new file mode 100644
index 000000000..3909e543e
--- /dev/null
+++ b/etc/profile-m-z/mencoder.profile
@@ -0,0 +1,34 @@
1# Firejail profile for mencoder
2# Description: Free command line video decoding, encoding and filtering tool
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mencoder.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# added by included profile
11#include disable-common.inc
12#include disable-devel.inc
13#include disable-interpreters.inc
14#include disable-programs.inc
15
16ipc-namespace
17machine-id
18net none
19no3d
20nosound
21notv
22protocol unix
23tracelog
24x11 none
25
26private-bin mencoder
27
28dbus-user none
29dbus-system none
30
31memory-deny-write-execute
32
33# Redirect
34include mplayer.profile
diff --git a/etc/profile-m-z/mendeleydesktop.profile b/etc/profile-m-z/mendeleydesktop.profile
new file mode 100644
index 000000000..446109e9a
--- /dev/null
+++ b/etc/profile-m-z/mendeleydesktop.profile
@@ -0,0 +1,50 @@
1# Firejail profile for Mendeley
2# Description: Academic software for managing and sharing research papers.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mendeleydesktop.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${HOME}/.cache/Mendeley Ltd.
11noblacklist ${HOME}/.config/Mendeley Ltd.
12noblacklist ${HOME}/.local/share/Mendeley Ltd.
13noblacklist ${HOME}/.local/share/data/Mendeley Ltd.
14noblacklist ${HOME}/.pki
15noblacklist ${HOME}/.local/share/pki
16
17# Allow python (blacklisted by disable-interpreters.inc)
18include allow-python2.inc
19include allow-python3.inc
20
21include disable-common.inc
22include disable-devel.inc
23include disable-exec.inc
24include disable-interpreters.inc
25include disable-programs.inc
26
27include whitelist-var-common.inc
28
29caps.drop all
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6,netlink
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin cat,env,gconftool-2,ln,mendeleydesktop,python*,sh,update-desktop-database,which
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/menulibre.profile b/etc/profile-m-z/menulibre.profile
new file mode 100644
index 000000000..4845e9cce
--- /dev/null
+++ b/etc/profile-m-z/menulibre.profile
@@ -0,0 +1,64 @@
1# Firejail profile for menulibre
2# Description: Create desktop and menu launchers easily
3# This file is overwritten after every install/update
4# Persistent local customizations
5include menulibre.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20# Whitelist your system icon directory,varies by distro
21whitelist /usr/share/app-info
22whitelist /usr/share/desktop-directories
23whitelist /usr/share/icons
24whitelist /usr/share/menulibre
25whitelist /var/lib/app-info/icons
26whitelist /var/lib/flatpak/exports/share/applications
27whitelist /var/lib/flatpak/exports/share/icons
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35net none
36nodvd
37no3d
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46protocol unix
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53private-cache
54private-dev
55private-etc alternatives,dconf,fonts,gtk-3.0,locale.alias,locale.conf,mime.types,nsswitch.conf,passwd,pki,selinux,X11,xdg
56private-tmp
57
58dbus-user none
59dbus-system none
60
61read-write ${HOME}/.config/menus
62read-write ${HOME}/.gnome/apps
63read-write ${HOME}/.local/share/applications
64read-write ${HOME}/.local/share/flatpak/exports
diff --git a/etc/profile-m-z/meteo-qt.profile b/etc/profile-m-z/meteo-qt.profile
new file mode 100644
index 000000000..bdd36949b
--- /dev/null
+++ b/etc/profile-m-z/meteo-qt.profile
@@ -0,0 +1,54 @@
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)
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.config/meteo-qt
24whitelist ${HOME}/.config/autostart
25whitelist ${HOME}/.config/meteo-qt
26include whitelist-common.inc
27include whitelist-var-common.inc
28
29caps.drop all
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin meteo-qt,python*
47private-cache
48private-dev
49private-tmp
50
51dbus-user none
52dbus-system none
53
54memory-deny-write-execute
diff --git a/etc/profile-m-z/microsoft-edge-beta.profile b/etc/profile-m-z/microsoft-edge-beta.profile
new file mode 100644
index 000000000..34d9f470a
--- /dev/null
+++ b/etc/profile-m-z/microsoft-edge-beta.profile
@@ -0,0 +1,20 @@
1# Firejail profile for Microsoft Edge Beta
2# Description: Web browser from Microsoft,beta channel
3# This file is overwritten after every install/update
4# Persistent local customizations
5include microsoft-edge-beta.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/microsoft-edge-beta
10noblacklist ${HOME}/.config/microsoft-edge-beta
11
12mkdir ${HOME}/.cache/microsoft-edge-beta
13mkdir ${HOME}/.config/microsoft-edge-beta
14whitelist ${HOME}/.cache/microsoft-edge-beta
15whitelist ${HOME}/.config/microsoft-edge-beta
16
17private-opt microsoft
18
19# Redirect
20include chromium-common.profile \ No newline at end of file
diff --git a/etc/profile-m-z/microsoft-edge-dev.profile b/etc/profile-m-z/microsoft-edge-dev.profile
new file mode 100644
index 000000000..039cd36a8
--- /dev/null
+++ b/etc/profile-m-z/microsoft-edge-dev.profile
@@ -0,0 +1,20 @@
1# Firejail profile for Microsoft Edge Dev
2# Description: Web browser from Microsoft,dev channel
3# This file is overwritten after every install/update
4# Persistent local customizations
5include microsoft-edge-dev.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/microsoft-edge-dev
10noblacklist ${HOME}/.config/microsoft-edge-dev
11
12mkdir ${HOME}/.cache/microsoft-edge-dev
13mkdir ${HOME}/.config/microsoft-edge-dev
14whitelist ${HOME}/.cache/microsoft-edge-dev
15whitelist ${HOME}/.config/microsoft-edge-dev
16
17private-opt microsoft
18
19# Redirect
20include chromium-common.profile
diff --git a/etc/profile-m-z/microsoft-edge.profile b/etc/profile-m-z/microsoft-edge.profile
new file mode 100644
index 000000000..f427507d1
--- /dev/null
+++ b/etc/profile-m-z/microsoft-edge.profile
@@ -0,0 +1,11 @@
1# Firejail profile for Microsoft Edge
2# Description: Web browser from Microsoft
3# This file is overwritten after every install/update
4# Persistent local customizations
5include microsoft-edge.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include microsoft-edge-dev.profile
diff --git a/etc/profile-m-z/midori.profile b/etc/profile-m-z/midori.profile
new file mode 100644
index 000000000..7928d124e
--- /dev/null
+++ b/etc/profile-m-z/midori.profile
@@ -0,0 +1,64 @@
1# Firejail profile for midori
2# Description: Lightweight web browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include midori.local
6# Persistent global definitions
7include globals.local
8
9# noexec ${HOME} breaks DRM binaries.
10?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
11
12noblacklist ${HOME}/.cache/midori
13noblacklist ${HOME}/.config/midori
14noblacklist ${HOME}/.local/share/midori
15# noblacklist ${HOME}/.local/share/webkit
16# noblacklist ${HOME}/.local/share/webkitgtk
17noblacklist ${HOME}/.pki
18noblacklist ${HOME}/.local/share/pki
19
20noblacklist ${HOME}/.cache/gnome-mplayer
21noblacklist ${HOME}/.config/gnome-mplayer
22noblacklist ${HOME}/.lastpass
23
24include disable-common.inc
25include disable-devel.inc
26include disable-exec.inc
27include disable-interpreters.inc
28include disable-programs.inc
29include disable-xdg.inc
30
31mkdir ${HOME}/.cache/midori
32mkdir ${HOME}/.config/midori
33mkdir ${HOME}/.local/share/midori
34mkdir ${HOME}/.local/share/webkit
35mkdir ${HOME}/.local/share/webkitgtk
36mkdir ${HOME}/.pki
37mkdir ${HOME}/.local/share/pki
38whitelist ${DOWNLOADS}
39whitelist ${HOME}/.cache/gnome-mplayer/plugin
40whitelist ${HOME}/.cache/midori
41whitelist ${HOME}/.config/gnome-mplayer
42whitelist ${HOME}/.config/midori
43whitelist ${HOME}/.lastpass
44whitelist ${HOME}/.local/share/midori
45whitelist ${HOME}/.local/share/webkit
46whitelist ${HOME}/.local/share/webkitgtk
47whitelist ${HOME}/.pki
48whitelist ${HOME}/.local/share/pki
49include whitelist-common.inc
50include whitelist-var-common.inc
51
52apparmor
53caps.drop all
54netfilter
55nodvd
56nonewprivs
57# noroot - problems on Ubuntu 14.04
58notv
59protocol unix,inet,inet6,netlink
60seccomp
61tracelog
62
63disable-mnt
64private-tmp
diff --git a/etc/profile-m-z/min.profile b/etc/profile-m-z/min.profile
new file mode 100644
index 000000000..7f3aeab44
--- /dev/null
+++ b/etc/profile-m-z/min.profile
@@ -0,0 +1,15 @@
1# Firejail profile for min
2# Description: A faster, smarter web browser.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include min.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Min
10
11mkdir ${HOME}/.config/Min
12whitelist ${HOME}/.config/Min
13
14# Redirect
15include chromium-common.profile
diff --git a/etc/profile-m-z/mindless.profile b/etc/profile-m-z/mindless.profile
new file mode 100644
index 000000000..ad7e40b12
--- /dev/null
+++ b/etc/profile-m-z/mindless.profile
@@ -0,0 +1,51 @@
1# Firejail profile for mindless
2# Description: figure out the secret code
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mindless.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/mindless
18include whitelist-usr-share-common.inc
19include whitelist-var-common.inc
20
21apparmor
22caps.drop all
23machine-id
24net none
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private
42private-bin mindless
43private-cache
44private-dev
45private-etc fonts
46private-tmp
47
48dbus-user none
49dbus-system none
50
51memory-deny-write-execute
diff --git a/etc/profile-m-z/minecraft-launcher.profile b/etc/profile-m-z/minecraft-launcher.profile
new file mode 100644
index 000000000..d4f3e344e
--- /dev/null
+++ b/etc/profile-m-z/minecraft-launcher.profile
@@ -0,0 +1,59 @@
1# Firejail profile for minecraft-launcher
2# Description: Official Minecraft launcher from Mojang
3# This file is overwritten after every install/update
4# Persistent local customizations
5include minecraft-launcher.local
6# Persistent global definitions
7include globals.local
8
9# Some distros put the executable in /opt/minecraft-launcher.
10# Run 'firejail /opt/minecraft-launcher/minecraft-launcher' to start it.
11
12ignore noexec ${HOME}
13
14noblacklist ${HOME}/.minecraft
15
16include allow-java.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/.minecraft
27whitelist ${HOME}/.minecraft
28include whitelist-common.inc
29include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33caps.drop all
34netfilter
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix,inet,inet6,netlink
44seccomp
45shell none
46tracelog
47
48disable-mnt
49private-bin java,java-config,minecraft-launcher
50private-cache
51private-dev
52# If multiplayer or realms break, add 'private-etc <your-own-java-folder-from-/etc>'
53# or 'ignore private-etc' to your minecraft-launcher.local.
54private-etc alternatives,asound.conf,ati,ca-certificates,crypto-policies,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,java-10-openjdk,java-11-openjdk,java-12-openjdk,java-13-openjdk,java-14-openjdk,java-7-openjdk,java-8-openjdk,java-9-openjdk,java-openjdk,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,login.defs,machine-id,mime.types,nvidia,passwd,pki,pulse,resolv.conf,selinux,services,ssl,timezone,X11,xdg
55private-opt minecraft-launcher
56private-tmp
57
58dbus-user none
59dbus-system none
diff --git a/etc/profile-m-z/minetest.profile b/etc/profile-m-z/minetest.profile
new file mode 100644
index 000000000..ec5de821a
--- /dev/null
+++ b/etc/profile-m-z/minetest.profile
@@ -0,0 +1,64 @@
1# Firejail profile for minetest
2# Description: Multiplayer infinite-world block sandbox
3# This file is overwritten after every install/update
4# Persistent local customizations
5include minetest.local
6# Persistent global definitions
7include globals.local
8
9# In order to save in-game screenshots to a persistent location edit ~/.minetest/minetest.conf:
10# screenshot_path = /home/<USER>/.minetest/screenshots
11
12noblacklist ${HOME}/.cache/minetest
13noblacklist ${HOME}/.minetest
14
15# Allow lua (blacklisted by disable-interpreters.inc)
16include allow-lua.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/.cache/minetest
27mkdir ${HOME}/.minetest
28whitelist ${HOME}/.cache/minetest
29whitelist ${HOME}/.minetest
30whitelist /usr/share/games/minetest
31whitelist /usr/share/minetest
32include whitelist-common.inc
33include whitelist-runuser-common.inc
34include whitelist-usr-share-common.inc
35include whitelist-var-common.inc
36
37caps.drop all
38ipc-namespace
39netfilter
40nodvd
41nogroups
42noinput
43nonewprivs
44noroot
45notv
46nou2f
47novideo
48protocol unix,inet,inet6
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54disable-mnt
55private-bin minetest,rm
56# cache is used for storing assets when connecting to servers
57#private-cache
58private-dev
59# private-etc needs to be updated, see #1702
60#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,machine-id,nsswitch.conf,passwd,pki,pulse,resolv.conf,ssl
61private-tmp
62
63dbus-user none
64dbus-system none
diff --git a/etc/profile-m-z/minitube.profile b/etc/profile-m-z/minitube.profile
new file mode 100644
index 000000000..581af9b81
--- /dev/null
+++ b/etc/profile-m-z/minitube.profile
@@ -0,0 +1,61 @@
1# Firejail profile for minitube
2# Description: Native Youtube viewer for Linux
3# This file is overwritten after every install/update
4# Persistent local customizations
5include minitube.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PICTURES}
10noblacklist ${HOME}/.cache/Flavio Tordini
11noblacklist ${HOME}/.config/Flavio Tordini
12noblacklist ${HOME}/.local/share/Flavio Tordini
13
14include allow-lua.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.cache/Flavio Tordini
25mkdir ${HOME}/.config/Flavio Tordini
26mkdir ${HOME}/.local/share/Flavio Tordini
27whitelist ${PICTURES}
28whitelist ${HOME}/.cache/Flavio Tordini
29whitelist ${HOME}/.config/Flavio Tordini
30whitelist ${HOME}/.local/share/Flavio Tordini
31whitelist /usr/share/minitube
32include whitelist-common.inc
33include whitelist-runuser-common.inc
34include whitelist-usr-share-common.inc
35include whitelist-var-common.inc
36
37apparmor
38caps.drop all
39netfilter
40nodvd
41nogroups
42noinput
43nonewprivs
44noroot
45notv
46nou2f
47novideo
48protocol unix,inet,inet6,netlink
49seccomp
50shell none
51tracelog
52
53disable-mnt
54private-bin minitube
55private-cache
56private-dev
57private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
58private-tmp
59
60dbus-user none
61dbus-system none
diff --git a/etc/profile-m-z/mirage.profile b/etc/profile-m-z/mirage.profile
new file mode 100644
index 000000000..5a8544965
--- /dev/null
+++ b/etc/profile-m-z/mirage.profile
@@ -0,0 +1,61 @@
1# Firejail profile for mirage
2# Description: Desktop client for Matrix
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mirage.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/mirage
10noblacklist ${HOME}/.config/mirage
11noblacklist ${HOME}/.local/share/mirage
12noblacklist /sbin
13
14# Allow python (blacklisted by disable-interpreters.inc)
15include allow-python2.inc
16include allow-python3.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/.cache/mirage
27mkdir ${HOME}/.config/mirage
28mkdir ${HOME}/.local/share/mirage
29whitelist ${HOME}/.cache/mirage
30whitelist ${HOME}/.config/mirage
31whitelist ${HOME}/.local/share/mirage
32whitelist ${DOWNLOADS}
33include whitelist-common.inc
34include whitelist-runuser-common.inc
35include whitelist-usr-share-common.inc
36include whitelist-var-common.inc
37
38apparmor
39caps.drop all
40netfilter
41nodvd
42nogroups
43noinput
44nonewprivs
45noroot
46notv
47nou2f
48protocol unix,inet,inet6
49seccomp
50shell none
51tracelog
52
53disable-mnt
54private-bin ldconfig,mirage
55private-cache
56private-dev
57private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
58private-tmp
59
60dbus-user none
61dbus-system none
diff --git a/etc/profile-m-z/mirrormagic.profile b/etc/profile-m-z/mirrormagic.profile
new file mode 100644
index 000000000..c47a16ffd
--- /dev/null
+++ b/etc/profile-m-z/mirrormagic.profile
@@ -0,0 +1,51 @@
1# Firejail profile for mirrormagic
2# Description: Puzzle game where you steer a beam of light using mirrors
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mirrormagic.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.mirrormagic
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.mirrormagic
20whitelist ${HOME}/.mirrormagic
21whitelist /usr/share/mirrormagic
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix,netlink
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private
44private-bin mirrormagic
45private-cache
46private-dev
47private-etc machine-id
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-m-z/mocp.profile b/etc/profile-m-z/mocp.profile
new file mode 100644
index 000000000..dbc3c1d40
--- /dev/null
+++ b/etc/profile-m-z/mocp.profile
@@ -0,0 +1,53 @@
1# Firejail profile for mocp
2# Description: A powerful & easy to use console audio player
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include mocp.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.moc
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-usr-share-common.inc
21include whitelist-runuser-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix,inet,inet6,netlink
38seccomp
39shell none
40tracelog
41
42private-bin mocp
43private-cache
44private-dev
45private-etc alternatives,asound.conf,ca-certificates,crypto-policies,group,machine-id,pki,pulse,resolv.conf,ssl
46private-tmp
47
48dbus-user none
49dbus-system none
50
51memory-deny-write-execute
52read-only ${HOME}
53read-write ${HOME}/.moc
diff --git a/etc/profile-m-z/mousepad.profile b/etc/profile-m-z/mousepad.profile
new file mode 100644
index 000000000..2939d9bde
--- /dev/null
+++ b/etc/profile-m-z/mousepad.profile
@@ -0,0 +1,40 @@
1# Firejail profile for mousepad
2# Description: Simple Xfce oriented text editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mousepad.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Mousepad
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22net none
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35tracelog
36
37private-bin mousepad
38private-dev
39private-lib
40private-tmp
diff --git a/etc/profile-m-z/mp3splt-gtk.profile b/etc/profile-m-z/mp3splt-gtk.profile
new file mode 100644
index 000000000..f0063d250
--- /dev/null
+++ b/etc/profile-m-z/mp3splt-gtk.profile
@@ -0,0 +1,44 @@
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-programs.inc
16include disable-shell.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22net none
23no3d
24nodvd
25nogroups
26noinput
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,dconf,fonts,gtk-3.0,machine-id,openal,pulse
41private-tmp
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-m-z/mp3splt.profile b/etc/profile-m-z/mp3splt.profile
new file mode 100644
index 000000000..400d8a6b6
--- /dev/null
+++ b/etc/profile-m-z/mp3splt.profile
@@ -0,0 +1,53 @@
1# Firejail profile for mp3splt
2# Description: utility for mp3 splitting without decoding
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mp3splt.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25machine-id
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41x11 none
42
43disable-mnt
44private-bin flacsplt,mp3splt,mp3wrap,oggsplt
45private-cache
46private-dev
47private-etc alternatives
48private-tmp
49
50memory-deny-write-execute
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-m-z/mp3wrap.profile b/etc/profile-m-z/mp3wrap.profile
new file mode 100644
index 000000000..9e48f7807
--- /dev/null
+++ b/etc/profile-m-z/mp3wrap.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mp3wrap
2# This file is overwritten after every install/update
3include mp3wrap.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mp3splt.profile
diff --git a/etc/profile-m-z/mpDris2.profile b/etc/profile-m-z/mpDris2.profile
new file mode 100644
index 000000000..10964ef24
--- /dev/null
+++ b/etc/profile-m-z/mpDris2.profile
@@ -0,0 +1,58 @@
1# Firejail profile for mpDris2
2# Description: MPRIS2 support for MPD
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mpDris2.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mpDris2
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15noblacklist ${MUSIC}
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25whitelist ${MUSIC}
26
27mkdir ${HOME}/.config/mpDris2
28whitelist ${HOME}/.config/mpDris2
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32caps.drop all
33machine-id
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6
46seccomp
47shell none
48
49private-bin mpDris2,notify-send,python*
50private-cache
51private-dev
52private-etc alternatives,hosts,nsswitch.conf
53private-lib libdbus-1.so.*,libdbus-glib-1.so.*,libgirepository-1.0.so.*,libnotify.so.*,libpython*,python2*,python3*
54private-tmp
55
56#memory-deny-write-execute - breaks on Arch (see issue #1803)
57
58read-only ${HOME}
diff --git a/etc/profile-m-z/mpd.profile b/etc/profile-m-z/mpd.profile
new file mode 100644
index 000000000..761d5b041
--- /dev/null
+++ b/etc/profile-m-z/mpd.profile
@@ -0,0 +1,44 @@
1# Firejail profile for mpd
2# Description: Music Player Daemon
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mpd.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mpd
10noblacklist ${HOME}/.mpd
11noblacklist ${HOME}/.mpdconf
12noblacklist ${MUSIC}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25netfilter
26no3d
27nodvd
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35# blacklisting of ioprio_set system calls breaks auto-updating of
36# MPD's database when files in music_directory are changed
37seccomp !ioprio_set
38shell none
39
40#private-bin bash,mpd
41private-cache
42private-dev
43private-tmp
44
diff --git a/etc/profile-m-z/mpg123-alsa.profile b/etc/profile-m-z/mpg123-alsa.profile
new file mode 100644
index 000000000..378435af1
--- /dev/null
+++ b/etc/profile-m-z/mpg123-alsa.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-alsa
2# Persistent local customizations
3include mpg123-alsa.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-id3dump.profile b/etc/profile-m-z/mpg123-id3dump.profile
new file mode 100644
index 000000000..370a57b3c
--- /dev/null
+++ b/etc/profile-m-z/mpg123-id3dump.profile
@@ -0,0 +1,12 @@
1# Firejail profile for mpg123-id3dump
2# Persistent local customizations
3include mpg123-id3dump.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8machine-id
9nosound
10
11# Redirect
12include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-jack.profile b/etc/profile-m-z/mpg123-jack.profile
new file mode 100644
index 000000000..e36a2e5b3
--- /dev/null
+++ b/etc/profile-m-z/mpg123-jack.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-jack
2# Persistent local customizations
3include mpg123-jack.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-nas.profile b/etc/profile-m-z/mpg123-nas.profile
new file mode 100644
index 000000000..cdbf0b1d2
--- /dev/null
+++ b/etc/profile-m-z/mpg123-nas.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-nas
2# Persistent local customizations
3include mpg123-nas.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-openal.profile b/etc/profile-m-z/mpg123-openal.profile
new file mode 100644
index 000000000..e5585feaa
--- /dev/null
+++ b/etc/profile-m-z/mpg123-openal.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-openal
2# Persistent local customizations
3include mpg123-openal.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-oss.profile b/etc/profile-m-z/mpg123-oss.profile
new file mode 100644
index 000000000..dcb92ecd6
--- /dev/null
+++ b/etc/profile-m-z/mpg123-oss.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-oss
2# Persistent local customizations
3include mpg123-oss.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-portaudio.profile b/etc/profile-m-z/mpg123-portaudio.profile
new file mode 100644
index 000000000..319843504
--- /dev/null
+++ b/etc/profile-m-z/mpg123-portaudio.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-portaudio
2# Persistent local customizations
3include mpg123-portaudio.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-pulse.profile b/etc/profile-m-z/mpg123-pulse.profile
new file mode 100644
index 000000000..31063a96b
--- /dev/null
+++ b/etc/profile-m-z/mpg123-pulse.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-pulse
2# Persistent local customizations
3include mpg123-pulse.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123-strip.profile b/etc/profile-m-z/mpg123-strip.profile
new file mode 100644
index 000000000..62de57c22
--- /dev/null
+++ b/etc/profile-m-z/mpg123-strip.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123-strip
2# Persistent local customizations
3include mpg123-strip.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123.bin.profile b/etc/profile-m-z/mpg123.bin.profile
new file mode 100644
index 000000000..0a01d0829
--- /dev/null
+++ b/etc/profile-m-z/mpg123.bin.profile
@@ -0,0 +1,9 @@
1# Firejail profile for mpg123.bin
2# Persistent local customizations
3include mpg123.bin.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/mpg123.profile b/etc/profile-m-z/mpg123.profile
new file mode 100644
index 000000000..c3bff23bc
--- /dev/null
+++ b/etc/profile-m-z/mpg123.profile
@@ -0,0 +1,45 @@
1# Firejail profile for mpg123
2# Description: MPEG audio player/decoder
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include mpg123.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24netfilter
25no3d
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32novideo
33protocol unix,inet,inet6,netlink
34seccomp
35shell none
36tracelog
37
38#private-bin mpg123*
39private-dev
40private-tmp
41
42dbus-user none
43dbus-system none
44
45memory-deny-write-execute
diff --git a/etc/profile-m-z/mplayer.profile b/etc/profile-m-z/mplayer.profile
new file mode 100644
index 000000000..2d51d9884
--- /dev/null
+++ b/etc/profile-m-z/mplayer.profile
@@ -0,0 +1,40 @@
1# Firejail profile for mplayer
2# Description: Movie player for Unix-like systems
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mplayer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.mplayer
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17read-only ${DESKTOP}
18mkdir ${HOME}/.mplayer
19whitelist ${HOME}/.mplayer
20include whitelist-common.inc
21include whitelist-player-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27# net none - mplayer can be used for streaming.
28netfilter
29# nogroups
30noinput
31nonewprivs
32noroot
33nou2f
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37
38private-bin mplayer
39private-dev
40private-tmp
diff --git a/etc/profile-m-z/mpsyt.profile b/etc/profile-m-z/mpsyt.profile
new file mode 100644
index 000000000..cadfd9b7f
--- /dev/null
+++ b/etc/profile-m-z/mpsyt.profile
@@ -0,0 +1,72 @@
1# Firejail profile for mpsyt
2# Description: Terminal based YouTube player and downloader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mpsyt.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/mps-youtube
10noblacklist ${HOME}/.config/mpv
11noblacklist ${HOME}/.config/youtube-dl
12noblacklist ${HOME}/.mplayer
13noblacklist ${HOME}/.netrc
14noblacklist ${HOME}/mps
15
16# Allow lua (blacklisted by disable-interpreters.inc)
17include allow-lua.inc
18
19# Allow python (blacklisted by disable-interpreters.inc)
20include allow-python2.inc
21include allow-python3.inc
22
23noblacklist ${MUSIC}
24noblacklist ${VIDEOS}
25
26include disable-common.inc
27include disable-devel.inc
28include disable-exec.inc
29include disable-interpreters.inc
30include disable-programs.inc
31include disable-shell.inc
32include disable-xdg.inc
33
34mkdir ${HOME}/.config/mps-youtube
35mkdir ${HOME}/.config/mpv
36mkdir ${HOME}/.config/youtube-dl
37mkdir ${HOME}/.mplayer
38mkdir ${HOME}/mps
39whitelist ${HOME}/.config/mps-youtube
40whitelist ${HOME}/.config/mpv
41whitelist ${HOME}/.config/youtube-dl
42whitelist ${HOME}/.mplayer
43whitelist ${HOME}/.netrc
44whitelist ${HOME}/mps
45include whitelist-common.inc
46include whitelist-player-common.inc
47include whitelist-var-common.inc
48
49apparmor
50caps.drop all
51netfilter
52nodvd
53# Seems to cause issues with Nvidia drivers sometimes
54nogroups
55noinput
56nonewprivs
57noroot
58notv
59nou2f
60novideo
61protocol unix,inet,inet6
62seccomp
63shell none
64tracelog
65
66private-bin env,ffmpeg,mplayer,mpsyt,mpv,python*,youtube-dl
67#private-cache
68private-dev
69private-tmp
70
71dbus-user none
72dbus-system none
diff --git a/etc/profile-m-z/mpv.profile b/etc/profile-m-z/mpv.profile
new file mode 100644
index 000000000..74402a8de
--- /dev/null
+++ b/etc/profile-m-z/mpv.profile
@@ -0,0 +1,83 @@
1# Firejail profile for mpv
2# Description: Video player based on MPlayer/mplayer2
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include mpv.local
7# Persistent global definitions
8include globals.local
9
10# In order to save screenshots to a persistent location,
11# edit ~/.config/mpv/foobar.conf:
12# screenshot-directory=~/Pictures
13
14# Mpv has a powerful lua-API, some off these lua-scripts interact
15# with external resources which are blocked by firejail. In such cases
16# you need to allow these resources by
17# - adding additional binaries to private-bin
18# - whitelisting additional paths
19# - noblacklisting paths
20# - weaking the dbus-policy
21# - ...
22#
23# Often these scripts require a shell:
24#include allow-bin-sh.inc
25#private-bin sh
26
27noblacklist ${HOME}/.config/mpv
28noblacklist ${HOME}/.config/youtube-dl
29noblacklist ${HOME}/.netrc
30
31# Allow lua (blacklisted by disable-interpreters.inc)
32include allow-lua.inc
33
34# Allow python (blacklisted by disable-interpreters.inc)
35include allow-python2.inc
36include allow-python3.inc
37
38blacklist /usr/libexec
39
40include disable-common.inc
41include disable-devel.inc
42include disable-exec.inc
43include disable-interpreters.inc
44include disable-programs.inc
45include disable-shell.inc
46
47read-only ${DESKTOP}
48mkdir ${HOME}/.config/mpv
49mkdir ${HOME}/.config/youtube-dl
50mkfile ${HOME}/.netrc
51whitelist ${HOME}/.config/mpv
52whitelist ${HOME}/.config/youtube-dl
53whitelist ${HOME}/.netrc
54include whitelist-common.inc
55include whitelist-player-common.inc
56whitelist /usr/share/lua
57whitelist /usr/share/lua*
58whitelist /usr/share/vulkan
59include whitelist-usr-share-common.inc
60include whitelist-var-common.inc
61
62apparmor
63caps.drop all
64netfilter
65# nogroups seems to cause issues with Nvidia drivers sometimes
66nogroups
67noinput
68nonewprivs
69noroot
70nou2f
71protocol unix,inet,inet6,netlink
72seccomp
73seccomp.block-secondary
74shell none
75tracelog
76
77private-bin env,mpv,python*,waf,youtube-dl
78# private-cache causes slow OSD, see #2838
79#private-cache
80private-dev
81
82dbus-user none
83dbus-system none
diff --git a/etc/profile-m-z/mrrescue.profile b/etc/profile-m-z/mrrescue.profile
new file mode 100644
index 000000000..530e779fc
--- /dev/null
+++ b/etc/profile-m-z/mrrescue.profile
@@ -0,0 +1,60 @@
1# Firejail profile for mrrescue
2# Description: Arcade-style fire fighting game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mrrescue.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/love
10
11# Allow /bin/sh (blacklisted by disable-shell.inc)
12include allow-bin-sh.inc
13
14# Allow lua (blacklisted by disable-interpreters.inc)
15include allow-lua.inc
16
17blacklist /usr/libexec
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-shell.inc
25include disable-xdg.inc
26
27mkdir ${HOME}/.local/share/love
28whitelist ${HOME}/.local/share/love
29whitelist /usr/share/mrrescue
30include whitelist-common.inc
31include whitelist-runuser-common.inc
32include whitelist-usr-share-common.inc
33include whitelist-var-common.inc
34
35apparmor
36caps.drop all
37net none
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43notv
44nou2f
45novideo
46protocol unix,netlink
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53private-bin love,mrrescue,sh
54private-cache
55private-dev
56private-etc machine-id
57private-tmp
58
59dbus-user none
60dbus-system none
diff --git a/etc/profile-m-z/ms-excel.profile b/etc/profile-m-z/ms-excel.profile
new file mode 100644
index 000000000..db24e8f9b
--- /dev/null
+++ b/etc/profile-m-z/ms-excel.profile
@@ -0,0 +1,13 @@
1# Firejail profile for Microsoft Office Online - Excel
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-excel.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/ms-excel-online
10private-bin ms-excel
11
12# Redirect
13include ms-office.profile
diff --git a/etc/profile-m-z/ms-office.profile b/etc/profile-m-z/ms-office.profile
new file mode 100644
index 000000000..ad12f53a4
--- /dev/null
+++ b/etc/profile-m-z/ms-office.profile
@@ -0,0 +1,43 @@
1# Firejail profile for Microsoft Office Online
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-office.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/ms-office-online
9noblacklist ${HOME}/.jak
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28notv
29nou2f
30novideo
31protocol unix,inet,inet6
32seccomp
33shell none
34tracelog
35
36disable-mnt
37private-bin bash,env,fonts,jak,ms-office,python*,sh
38private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl
39private-dev
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/profile-m-z/ms-onenote.profile b/etc/profile-m-z/ms-onenote.profile
new file mode 100644
index 000000000..9ea0637bd
--- /dev/null
+++ b/etc/profile-m-z/ms-onenote.profile
@@ -0,0 +1,13 @@
1# Firejail profile for Microsoft Office Online - Onenote
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-onenote.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/ms-onenote-online
10private-bin ms-onenote
11
12# Redirect
13include ms-office.profile
diff --git a/etc/profile-m-z/ms-outlook.profile b/etc/profile-m-z/ms-outlook.profile
new file mode 100644
index 000000000..fc3e7c009
--- /dev/null
+++ b/etc/profile-m-z/ms-outlook.profile
@@ -0,0 +1,13 @@
1# Firejail profile for Microsoft Office Online - Outlook
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-outlook.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/ms-outlook-online
10private-bin ms-outlook
11
12# Redirect
13include ms-office.profile
diff --git a/etc/profile-m-z/ms-powerpoint.profile b/etc/profile-m-z/ms-powerpoint.profile
new file mode 100644
index 000000000..dadcd5b1e
--- /dev/null
+++ b/etc/profile-m-z/ms-powerpoint.profile
@@ -0,0 +1,13 @@
1# Firejail profile for Microsoft Office Online - Powerpoint
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-powerpoint.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/ms-powerpoint-online
10private-bin ms-powerpoint
11
12# Redirect
13include ms-office.profile
diff --git a/etc/profile-m-z/ms-skype.profile b/etc/profile-m-z/ms-skype.profile
new file mode 100644
index 000000000..df1618361
--- /dev/null
+++ b/etc/profile-m-z/ms-skype.profile
@@ -0,0 +1,16 @@
1# Firejail profile for Microsoft Office Online - Skype
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-skype.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9ignore novideo
10
11noblacklist ${HOME}/.cache/ms-skype-online
12
13private-bin ms-skype
14
15# Redirect
16include ms-office.profile
diff --git a/etc/profile-m-z/ms-word.profile b/etc/profile-m-z/ms-word.profile
new file mode 100644
index 000000000..5a617a893
--- /dev/null
+++ b/etc/profile-m-z/ms-word.profile
@@ -0,0 +1,13 @@
1# Firejail profile for Microsoft Office Online - Word
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ms-word.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/ms-word-online
10private-bin ms-word
11
12# Redirect
13include ms-office.profile
diff --git a/etc/profile-m-z/mtpaint.profile b/etc/profile-m-z/mtpaint.profile
new file mode 100644
index 000000000..126336cb3
--- /dev/null
+++ b/etc/profile-m-z/mtpaint.profile
@@ -0,0 +1,49 @@
1# Firejail profile for mtpaint
2# Description: Simple painting and editing program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mtpaint.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PICTURES}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27nodvd
28no3d
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin mtpaint
44private-cache
45private-dev
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-m-z/multimc.profile b/etc/profile-m-z/multimc.profile
new file mode 100644
index 000000000..2c8b95a26
--- /dev/null
+++ b/etc/profile-m-z/multimc.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for multimc5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include multimc.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include multimc5.profile
diff --git a/etc/profile-m-z/multimc5.profile b/etc/profile-m-z/multimc5.profile
new file mode 100644
index 000000000..a61f9001d
--- /dev/null
+++ b/etc/profile-m-z/multimc5.profile
@@ -0,0 +1,52 @@
1# Firejail profile for multimc5
2# This file is overwritten after every install/update
3# Persistent local customizations
4include multimc5.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.local/share/multimc
9noblacklist ${HOME}/.local/share/multimc5
10noblacklist ${HOME}/.multimc5
11
12# Ignore noexec on ${HOME} as MultiMC installs LWJGL native
13# libraries in ${HOME}/.local/share/multimc
14ignore noexec ${HOME}
15
16# Allow java (blacklisted by disable-devel.inc)
17include allow-java.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24
25mkdir ${HOME}/.local/share/multimc
26mkdir ${HOME}/.local/share/multimc5
27mkdir ${HOME}/.multimc5
28whitelist ${HOME}/.local/share/multimc
29whitelist ${HOME}/.local/share/multimc5
30whitelist ${HOME}/.multimc5
31include whitelist-common.inc
32
33caps.drop all
34netfilter
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix,inet,inet6
44# seccomp
45shell none
46
47disable-mnt
48# private-bin works, but causes weirdness
49# private-bin apt-file,awk,bash,chmod,dirname,dnf,grep,java,kdialog,ldd,mkdir,multimc5,pfl,pkgfile,readlink,sort,valgrind,which,yum,zenity,zypper
50private-dev
51private-tmp
52
diff --git a/etc/profile-m-z/mumble.profile b/etc/profile-m-z/mumble.profile
new file mode 100644
index 000000000..ad0920979
--- /dev/null
+++ b/etc/profile-m-z/mumble.profile
@@ -0,0 +1,45 @@
1# Firejail profile for mumble
2# Description: Low latency encrypted VoIP client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mumble.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Mumble
10noblacklist ${HOME}/.local/share/data/Mumble
11noblacklist ${HOME}/.local/share/Mumble
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19
20mkdir ${HOME}/.config/Mumble
21mkdir ${HOME}/.local/share/data/Mumble
22mkdir ${HOME}/.local/share/Mumble
23whitelist ${HOME}/.config/Mumble
24whitelist ${HOME}/.local/share/data/Mumble
25whitelist ${HOME}/.local/share/Mumble
26include whitelist-common.inc
27include whitelist-var-common.inc
28
29caps.drop all
30netfilter
31nodvd
32nogroups
33nonewprivs
34noroot
35notv
36protocol unix,inet,inet6,netlink
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin mumble
43private-tmp
44
45#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-m-z/mupdf-gl.profile b/etc/profile-m-z/mupdf-gl.profile
new file mode 100644
index 000000000..be94a9083
--- /dev/null
+++ b/etc/profile-m-z/mupdf-gl.profile
@@ -0,0 +1,13 @@
1# Firejail profile for mupdf-gl
2# Description: Lightweight PDF viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mupdf-gl.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist ${HOME}/.mupdf.history
11
12# Redirect
13include mupdf.profile
diff --git a/etc/profile-m-z/mupdf-x11-curl.profile b/etc/profile-m-z/mupdf-x11-curl.profile
new file mode 100644
index 000000000..a04d386a2
--- /dev/null
+++ b/etc/profile-m-z/mupdf-x11-curl.profile
@@ -0,0 +1,18 @@
1# Firejail profile for mupdf-x11-curl
2# Description: Lightweight PDF viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mupdf-x11-curl.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10ignore net none
11
12netfilter
13protocol unix,inet,inet6
14
15private-etc ca-certificates,crypto-policies,hosts,nsswitch.conf,pki,resolv.conf,ssl
16
17# Redirect
18include mupdf.profile
diff --git a/etc/profile-m-z/mupdf-x11.profile b/etc/profile-m-z/mupdf-x11.profile
new file mode 100644
index 000000000..256201d0c
--- /dev/null
+++ b/etc/profile-m-z/mupdf-x11.profile
@@ -0,0 +1,14 @@
1# Firejail profile for mupdf-x11
2# Description: Lightweight PDF viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mupdf-x11.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10memory-deny-write-execute
11read-only ${HOME}
12
13# Redirect
14include mupdf.profile
diff --git a/etc/profile-m-z/mupdf.profile b/etc/profile-m-z/mupdf.profile
new file mode 100644
index 000000000..857b9e7df
--- /dev/null
+++ b/etc/profile-m-z/mupdf.profile
@@ -0,0 +1,43 @@
1# Firejail profile for mupdf
2# Description: Lightweight PDF viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mupdf.local
6# Persistent global definitions
7#include globals.local
8
9noblacklist ${DOCUMENTS}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22machine-id
23net none
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix
34seccomp
35shell none
36tracelog
37
38private-dev
39private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/mupen64plus.profile b/etc/profile-m-z/mupen64plus.profile
index 4937df51f..093767c27 100644
--- a/etc/mupen64plus.profile
+++ b/etc/profile-m-z/mupen64plus.profile
@@ -1,24 +1,24 @@
1# Firejail profile for mupen64plus 1# Firejail profile for mupen64plus
2# Description: Nintendo64 Emulator
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/mupen64plus.local 5include mupen64plus.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/mupen64plus 9noblacklist ${HOME}/.config/mupen64plus
9noblacklist ${HOME}/.local/share/mupen64plus 10noblacklist ${HOME}/.local/share/mupen64plus
10 11
11include /etc/firejail/disable-common.inc 12include disable-common.inc
12include /etc/firejail/disable-devel.inc 13include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 14include disable-programs.inc
14include /etc/firejail/disable-programs.inc
15 15
16# you'll need to manually whitelist ROM files 16# you'll need to manually whitelist ROM files
17mkdir ${HOME}/.config/mupen64plus 17mkdir ${HOME}/.config/mupen64plus
18mkdir ${HOME}/.local/share/mupen64plus 18mkdir ${HOME}/.local/share/mupen64plus
19whitelist ${HOME}/.config/mupen64plus/ 19whitelist ${HOME}/.config/mupen64plus
20whitelist ${HOME}/.local/share/mupen64plus/ 20whitelist ${HOME}/.local/share/mupen64plus
21include /etc/firejail/whitelist-common.inc 21include whitelist-common.inc
22 22
23caps.drop all 23caps.drop all
24net none 24net none
@@ -28,3 +28,6 @@ noroot
28notv 28notv
29novideo 29novideo
30seccomp 30seccomp
31
32dbus-user none
33dbus-system none
diff --git a/etc/profile-m-z/muraster.profile b/etc/profile-m-z/muraster.profile
new file mode 100644
index 000000000..90e3f2050
--- /dev/null
+++ b/etc/profile-m-z/muraster.profile
@@ -0,0 +1,11 @@
1# Firejail profile for muraster
2# Description: Lightweight PDF viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include muraster.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include mupdf.profile
diff --git a/etc/profile-m-z/musescore.profile b/etc/profile-m-z/musescore.profile
new file mode 100644
index 000000000..12bb653a8
--- /dev/null
+++ b/etc/profile-m-z/musescore.profile
@@ -0,0 +1,42 @@
1# Firejail profile for musescore
2# Description: Free music composition and notation software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include musescore.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/MusE
10noblacklist ${HOME}/.config/MuseScore
11noblacklist ${HOME}/.local/share/data/MusE
12noblacklist ${HOME}/.local/share/data/MuseScore
13noblacklist ${DOCUMENTS}
14noblacklist ${MUSIC}
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27netfilter
28no3d
29nodvd
30nogroups
31nonewprivs
32noroot
33notv
34novideo
35protocol unix,inet,inet6
36# QtWebengine needs chroot to set up its own sandbox
37seccomp !chroot
38shell none
39tracelog
40
41# private-bin musescore,mscore
42private-tmp
diff --git a/etc/profile-m-z/musictube.profile b/etc/profile-m-z/musictube.profile
new file mode 100644
index 000000000..226fb4810
--- /dev/null
+++ b/etc/profile-m-z/musictube.profile
@@ -0,0 +1,57 @@
1# Firejail profile for musictube
2# Description: Stream music
3# This file is overwritten after every install/update
4# Persistent local customizations
5include musictube.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Flavio Tordini
10noblacklist ${HOME}/.config/Flavio Tordini
11noblacklist ${HOME}/.local/share/Flavio Tordini
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.cache/Flavio Tordini
22mkdir ${HOME}/.config/Flavio Tordini
23mkdir ${HOME}/.local/share/Flavio Tordini
24whitelist ${HOME}/.cache/Flavio Tordini
25whitelist ${HOME}/.config/Flavio Tordini
26whitelist ${HOME}/.local/share/Flavio Tordini
27whitelist /usr/share/musictube
28include whitelist-common.inc
29include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33apparmor
34caps.drop all
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41notv
42nou2f
43novideo
44protocol unix,inet,inet6,netlink
45seccomp
46shell none
47tracelog
48
49disable-mnt
50private-bin musictube
51private-cache
52private-dev
53private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/profile-m-z/musixmatch.profile b/etc/profile-m-z/musixmatch.profile
new file mode 100644
index 000000000..07661cac8
--- /dev/null
+++ b/etc/profile-m-z/musixmatch.profile
@@ -0,0 +1,37 @@
1# Firejail profile for Musixmatch
2# This file is overwritten after every install/update
3# Persistent local customizations
4include musixmatch.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${MUSIC}
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-programs.inc
14include disable-xdg.inc
15
16caps.drop all
17ipc-namespace
18netfilter
19no3d
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25nogroups
26noinput
27nosound
28notv
29nou2f
30novideo
31protocol unix,inet,inet6,netlink
32seccomp
33
34disable-mnt
35private-dev
36private-etc alternatives,asound.conf,ca-certificates,crypto-policies,machine-id,pki,pulse,ssl
37
diff --git a/etc/profile-m-z/mutool.profile b/etc/profile-m-z/mutool.profile
new file mode 100644
index 000000000..e61f4665d
--- /dev/null
+++ b/etc/profile-m-z/mutool.profile
@@ -0,0 +1,11 @@
1# Firejail profile for mutool
2# Description: Lightweight PDF viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mutool.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include mupdf.profile
diff --git a/etc/profile-m-z/mutt.profile b/etc/profile-m-z/mutt.profile
new file mode 100644
index 000000000..c4d96711c
--- /dev/null
+++ b/etc/profile-m-z/mutt.profile
@@ -0,0 +1,149 @@
1# Firejail profile for mutt
2# Description: Text-based mailreader supporting MIME, GPG, PGP and threading
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include mutt.local
7# Persistent global definitions
8include globals.local
9
10noblacklist /var/mail
11noblacklist /var/spool/mail
12noblacklist ${DOCUMENTS}
13noblacklist ${HOME}/.Mail
14noblacklist ${HOME}/.bogofilter
15noblacklist ${HOME}/.cache/mutt
16noblacklist ${HOME}/.config/mutt
17noblacklist ${HOME}/.config/nano
18noblacklist ${HOME}/.elinks
19noblacklist ${HOME}/.emacs
20noblacklist ${HOME}/.emacs.d
21noblacklist ${HOME}/.gnupg
22noblacklist ${HOME}/.mail
23noblacklist ${HOME}/.mailcap
24noblacklist ${HOME}/.msmtprc
25noblacklist ${HOME}/.mutt
26noblacklist ${HOME}/.muttrc
27noblacklist ${HOME}/.nanorc
28noblacklist ${HOME}/.signature
29noblacklist ${HOME}/.vim
30noblacklist ${HOME}/.viminfo
31noblacklist ${HOME}/.vimrc
32noblacklist ${HOME}/.w3m
33noblacklist ${HOME}/Mail
34noblacklist ${HOME}/mail
35noblacklist ${HOME}/postponed
36noblacklist ${HOME}/sent
37
38blacklist /tmp/.X11-unix
39blacklist ${RUNUSER}/wayland-*
40
41# Add the next lines to your mutt.local for oauth.py,S/MIME support.
42#include allow-perl.inc
43#include allow-python2.inc
44#include allow-python3.inc
45
46include disable-common.inc
47include disable-devel.inc
48include disable-exec.inc
49include disable-interpreters.inc
50include disable-programs.inc
51include disable-xdg.inc
52
53mkdir ${HOME}/.Mail
54mkdir ${HOME}/.bogofilter
55mkdir ${HOME}/.cache/mutt
56mkdir ${HOME}/.config/mutt
57mkdir ${HOME}/.config/nano
58mkdir ${HOME}/.elinks
59mkdir ${HOME}/.emacs.d
60mkdir ${HOME}/.gnupg
61mkdir ${HOME}/.mail
62mkdir ${HOME}/.mutt
63mkdir ${HOME}/.vim
64mkdir ${HOME}/.w3m
65mkdir ${HOME}/Mail
66mkdir ${HOME}/mail
67mkdir ${HOME}/postponed
68mkdir ${HOME}/sent
69mkfile ${HOME}/.emacs
70mkfile ${HOME}/.mailcap
71mkfile ${HOME}/.msmtprc
72mkfile ${HOME}/.muttrc
73mkfile ${HOME}/.nanorc
74mkfile ${HOME}/.signature
75mkfile ${HOME}/.viminfo
76mkfile ${HOME}/.vimrc
77whitelist ${DOCUMENTS}
78whitelist ${DOWNLOADS}
79whitelist ${HOME}/.Mail
80whitelist ${HOME}/.bogofilter
81whitelist ${HOME}/.cache/mutt
82whitelist ${HOME}/.config/mutt
83whitelist ${HOME}/.config/nano
84whitelist ${HOME}/.elinks
85whitelist ${HOME}/.emacs
86whitelist ${HOME}/.emacs.d
87whitelist ${HOME}/.gnupg
88whitelist ${HOME}/.mail
89whitelist ${HOME}/.mailcap
90whitelist ${HOME}/.msmtprc
91whitelist ${HOME}/.mutt
92whitelist ${HOME}/.muttrc
93whitelist ${HOME}/.nanorc
94whitelist ${HOME}/.signature
95whitelist ${HOME}/.vim
96whitelist ${HOME}/.viminfo
97whitelist ${HOME}/.vimrc
98whitelist ${HOME}/.w3m
99whitelist ${HOME}/Mail
100whitelist ${HOME}/mail
101whitelist ${HOME}/postponed
102whitelist ${HOME}/sent
103whitelist /usr/share/gnupg
104whitelist /usr/share/gnupg2
105whitelist /usr/share/mutt
106whitelist /var/mail
107whitelist /var/spool/mail
108include whitelist-common.inc
109include whitelist-runuser-common.inc
110include whitelist-usr-share-common.inc
111include whitelist-var-common.inc
112
113apparmor
114caps.drop all
115ipc-namespace
116machine-id
117netfilter
118no3d
119nodvd
120nogroups
121noinput
122nonewprivs
123noroot
124nosound
125notv
126nou2f
127novideo
128protocol unix,inet,inet6
129seccomp
130seccomp.block-secondary
131shell none
132tracelog
133
134# disable-mnt
135private-cache
136private-dev
137private-etc alternatives,ca-certificates,crypto-policies,fonts,gai.conf,gcrypt,gnupg,gnutls,hostname,hosts,hosts.conf,mail,mailname,Mutt,Muttrc,Muttrc.d,nntpserver,nsswitch.conf,passwd,pki,resolv.conf,ssl,terminfo,xdg
138private-tmp
139writable-run-user
140writable-var
141
142dbus-user none
143dbus-system none
144
145memory-deny-write-execute
146read-only ${HOME}/.elinks
147read-only ${HOME}/.nanorc
148read-only ${HOME}/.signature
149read-only ${HOME}/.w3m
diff --git a/etc/profile-m-z/mypaint-ora-thumbnailer.profile b/etc/profile-m-z/mypaint-ora-thumbnailer.profile
new file mode 100644
index 000000000..4b4745918
--- /dev/null
+++ b/etc/profile-m-z/mypaint-ora-thumbnailer.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for mypaint-ora-thumbnailer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include mypaint-ora-thumbnailer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include mypaint.profile
diff --git a/etc/profile-m-z/mypaint.profile b/etc/profile-m-z/mypaint.profile
new file mode 100644
index 000000000..1b4fc4346
--- /dev/null
+++ b/etc/profile-m-z/mypaint.profile
@@ -0,0 +1,50 @@
1# Firejail profile for mypaint
2# Description: A fast and easy graphics application for digital painters
3# This file is overwritten after every install/update
4# Persistent local customizations
5include mypaint.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/mypaint
10noblacklist ${HOME}/.config/mypaint
11noblacklist ${HOME}/.local/share/mypaint
12noblacklist ${PICTURES}
13
14# Allow python (blacklisted by disable-interpreters.inc)
15include allow-python2.inc
16include allow-python3.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-xdg.inc
24
25apparmor
26caps.drop all
27machine-id
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43
44private-cache
45private-dev
46private-etc alternatives,dconf,fonts,gtk-3.0
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/nano.profile b/etc/profile-m-z/nano.profile
new file mode 100644
index 000000000..996a1722a
--- /dev/null
+++ b/etc/profile-m-z/nano.profile
@@ -0,0 +1,59 @@
1# Firejail profile for nano
2# Description: nano is an easy text editor for the terminal
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include nano.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12noblacklist ${HOME}/.config/nano
13noblacklist ${HOME}/.nanorc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21whitelist /usr/share/nano
22include whitelist-usr-share-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27machine-id
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol unix
40seccomp
41shell none
42tracelog
43x11 none
44
45# disable-mnt
46private-bin nano,rnano
47private-cache
48private-dev
49# Add the next lines to your nano.local if you want to edit files in /etc directly.
50#ignore private-etc
51#writable-etc
52private-etc alternatives,nanorc
53# Add the next line to your nano.local if you want to edit files in /var directly.
54#writable-var
55
56dbus-user none
57dbus-system none
58
59memory-deny-write-execute
diff --git a/etc/natron.profile b/etc/profile-m-z/natron.profile
index b76649605..2464844c4 100644
--- a/etc/natron.profile
+++ b/etc/profile-m-z/natron.profile
@@ -1,34 +1,37 @@
1# Firejail profile for natron 1# Firejail profile for natron
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/natron.local 4include natron.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7
8 7
9noblacklist ${HOME}/.Natron 8noblacklist ${HOME}/.Natron
10noblacklist ${HOME}/.cache/INRIA/Natron 9noblacklist ${HOME}/.cache/INRIA/Natron
11noblacklist ${HOME}/.config/INRIA 10noblacklist ${HOME}/.config/INRIA
12noblacklist /opt/natron
13 11
14include /etc/firejail/disable-common.inc 12# Allow python (blacklisted by disable-interpreters.inc)
15include /etc/firejail/disable-devel.inc 13include allow-python2.inc
16include /etc/firejail/disable-passwdmgr.inc 14include allow-python3.inc
17include /etc/firejail/disable-programs.inc 15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
18 21
19caps.drop all 22caps.drop all
20netfilter 23net none
21nodvd 24nodvd
22nogroups 25nogroups
23nonewprivs 26nonewprivs
24noroot 27noroot
25notv 28notv
26protocol unix,inet,inet6 29nou2f
30protocol unix
27seccomp 31seccomp
28shell none 32shell none
29net none
30 33
31private-bin natron,Natron,NatronRenderer 34private-bin natron,Natron,NatronRenderer
32 35
33noexec ${HOME} 36dbus-user none
34noexec /tmp 37dbus-system none
diff --git a/etc/profile-m-z/nautilus.profile b/etc/profile-m-z/nautilus.profile
new file mode 100644
index 000000000..e54bea228
--- /dev/null
+++ b/etc/profile-m-z/nautilus.profile
@@ -0,0 +1,15 @@
1# Firejail profile for nautilus
2# Description: File manager and graphical shell for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nautilus.local
6# Persistent global definitions
7include globals.local
8
9# Nautilus is started by systemd on most systems. Therefore it is not firejailed by default. Since there
10# is already a nautilus process running on gnome desktops firejail will have no effect.
11
12# Put 'ignore noroot' in your nautilus.local if you use MPV+Vulkan (see issue #3012)
13
14# Redirect
15include file-manager-common.profile
diff --git a/etc/profile-m-z/ncdu.profile b/etc/profile-m-z/ncdu.profile
new file mode 100644
index 000000000..063e30366
--- /dev/null
+++ b/etc/profile-m-z/ncdu.profile
@@ -0,0 +1,37 @@
1# Firejail profile for ncdu
2# Description: Ncurses disk usage viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ncdu.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11include disable-exec.inc
12
13caps.drop all
14ipc-namespace
15net none
16no3d
17nodvd
18nogroups
19noinput
20nonewprivs
21noroot
22nosound
23notv
24nou2f
25novideo
26protocol unix
27seccomp
28shell none
29x11 none
30
31private-dev
32# private-tmp
33
34dbus-user none
35dbus-system none
36
37memory-deny-write-execute
diff --git a/etc/profile-m-z/ncdu2.profile b/etc/profile-m-z/ncdu2.profile
new file mode 100644
index 000000000..5b6364c5d
--- /dev/null
+++ b/etc/profile-m-z/ncdu2.profile
@@ -0,0 +1,11 @@
1# Firejail profile for ncdu2
2# Description: Ncurses disk usage viewer (zig rewrite)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ncdu2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include ncdu.profile
diff --git a/etc/profile-m-z/nemo.profile b/etc/profile-m-z/nemo.profile
new file mode 100644
index 000000000..1b3333e8c
--- /dev/null
+++ b/etc/profile-m-z/nemo.profile
@@ -0,0 +1,12 @@
1# Firejail profile for nemo
2# Description: File manager and graphical shell for Cinnamon
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nemo.local
6# Persistent global definitions
7include globals.local
8
9# Put 'ignore noroot' in your nemo.local if you use MPV+Vulkan (see issue #3012)
10
11# Redirect
12include file-manager-common.profile
diff --git a/etc/profile-m-z/neochat.profile b/etc/profile-m-z/neochat.profile
new file mode 100644
index 000000000..58cc716d9
--- /dev/null
+++ b/etc/profile-m-z/neochat.profile
@@ -0,0 +1,65 @@
1# Firejail profile for neochat
2# Description: Matrix Client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include neochat.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/KDE/neochat
10noblacklist ${HOME}/.config/KDE
11noblacklist ${HOME}/.config/KDE/neochat
12noblacklist ${HOME}/.config/neochatrc
13noblacklist ${HOME}/.config/neochat.notifyrc
14noblacklist ${HOME}/.local/share/KDE/neochat
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.cache/KDE/neochat
25mkdir ${HOME}/.local/share/KDE/neochat
26whitelist ${HOME}/.cache/KDE/neochat
27whitelist ${HOME}/.local/share/KDE/neochat
28whitelist ${DOWNLOADS}
29include whitelist-1793-workaround.inc
30include whitelist-common.inc
31include whitelist-runuser-common.inc
32include whitelist-usr-share-common.inc
33include whitelist-var-common.inc
34
35apparmor
36caps.drop all
37machine-id
38netfilter
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44nosound
45notv
46nou2f
47novideo
48protocol unix,inet,inet6
49seccomp
50seccomp.block-secondary
51shell none
52tracelog
53
54disable-mnt
55private-bin neochat
56private-dev
57private-etc alternatives,ca-certificates,crypto-policies,dbus-1,fonts,host.conf,hostname,hosts,kde4rc,kde5rc,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,resolv.conf,rpc,services,ssl,Trolltech.conf,X11,xdg
58private-tmp
59
60dbus-user filter
61dbus-user.own org.kde.neochat
62dbus-user.talk org.freedesktop.Notifications
63dbus-user.talk org.kde.StatusNotifierWatcher
64dbus-user.talk org.kde.kwalletd5
65dbus-system none
diff --git a/etc/profile-m-z/neomutt.profile b/etc/profile-m-z/neomutt.profile
new file mode 100644
index 000000000..7e627a52e
--- /dev/null
+++ b/etc/profile-m-z/neomutt.profile
@@ -0,0 +1,152 @@
1# Firejail profile for neomutt
2# Description: Mutt fork with advanced features and better documentation
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include neomutt.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${DOCUMENTS}
11noblacklist ${HOME}/.Mail
12noblacklist ${HOME}/.bogofilter
13noblacklist ${HOME}/.config/mutt
14noblacklist ${HOME}/.config/nano
15noblacklist ${HOME}/.config/neomutt
16noblacklist ${HOME}/.elinks
17noblacklist ${HOME}/.emacs
18noblacklist ${HOME}/.emacs.d
19noblacklist ${HOME}/.gnupg
20noblacklist ${HOME}/.mail
21noblacklist ${HOME}/.mailcap
22noblacklist ${HOME}/.msmtprc
23noblacklist ${HOME}/.mutt
24noblacklist ${HOME}/.muttrc
25noblacklist ${HOME}/.nanorc
26noblacklist ${HOME}/.neomutt
27noblacklist ${HOME}/.neomuttrc
28noblacklist ${HOME}/.signature
29noblacklist ${HOME}/.vim
30noblacklist ${HOME}/.viminfo
31noblacklist ${HOME}/.vimrc
32noblacklist ${HOME}/.w3m
33noblacklist ${HOME}/Mail
34noblacklist ${HOME}/mail
35noblacklist ${HOME}/postponed
36noblacklist ${HOME}/sent
37noblacklist /var/mail
38noblacklist /var/spool/mail
39
40blacklist /tmp/.X11-unix
41blacklist ${RUNUSER}/wayland-*
42
43include allow-lua.inc
44
45include disable-common.inc
46include disable-devel.inc
47include disable-exec.inc
48include disable-interpreters.inc
49include disable-programs.inc
50include disable-xdg.inc
51
52mkdir ${HOME}/.Mail
53mkdir ${HOME}/.bogofilter
54mkdir ${HOME}/.config/mutt
55mkdir ${HOME}/.config/nano
56mkdir ${HOME}/.config/neomutt
57mkdir ${HOME}/.elinks
58mkdir ${HOME}/.emacs.d
59mkdir ${HOME}/.gnupg
60mkdir ${HOME}/.mail
61mkdir ${HOME}/.mutt
62mkdir ${HOME}/.neomutt
63mkdir ${HOME}/.vim
64mkdir ${HOME}/.w3m
65mkdir ${HOME}/Mail
66mkdir ${HOME}/mail
67mkdir ${HOME}/postponed
68mkdir ${HOME}/sent
69mkfile ${HOME}/.emacs
70mkfile ${HOME}/.mailcap
71mkfile ${HOME}/.msmtprc
72mkfile ${HOME}/.muttrc
73mkfile ${HOME}/.nanorc
74mkfile ${HOME}/.neomuttrc
75mkfile ${HOME}/.signature
76mkfile ${HOME}/.viminfo
77mkfile ${HOME}/.vimrc
78whitelist ${DOCUMENTS}
79whitelist ${DOWNLOADS}
80whitelist ${HOME}/.Mail
81whitelist ${HOME}/.bogofilter
82whitelist ${HOME}/.config/mutt
83whitelist ${HOME}/.config/nano
84whitelist ${HOME}/.config/neomutt
85whitelist ${HOME}/.elinks
86whitelist ${HOME}/.emacs
87whitelist ${HOME}/.emacs.d
88whitelist ${HOME}/.gnupg
89whitelist ${HOME}/.mail
90whitelist ${HOME}/.mailcap
91whitelist ${HOME}/.msmtprc
92whitelist ${HOME}/.mutt
93whitelist ${HOME}/.muttrc
94whitelist ${HOME}/.nanorc
95whitelist ${HOME}/.neomutt
96whitelist ${HOME}/.neomuttrc
97whitelist ${HOME}/.signature
98whitelist ${HOME}/.vim
99whitelist ${HOME}/.viminfo
100whitelist ${HOME}/.vimrc
101whitelist ${HOME}/.w3m
102whitelist ${HOME}/Mail
103whitelist ${HOME}/mail
104whitelist ${HOME}/postponed
105whitelist ${HOME}/sent
106whitelist /usr/share/gnupg
107whitelist /usr/share/gnupg2
108whitelist /usr/share/neomutt
109whitelist /var/mail
110whitelist /var/spool/mail
111include whitelist-common.inc
112include whitelist-runuser-common.inc
113include whitelist-usr-share-common.inc
114include whitelist-var-common.inc
115
116apparmor
117caps.drop all
118ipc-namespace
119machine-id
120netfilter
121no3d
122nodvd
123nogroups
124noinput
125nonewprivs
126noroot
127nosound
128notv
129nou2f
130novideo
131protocol unix,inet,inet6
132seccomp
133seccomp.block-secondary
134shell none
135tracelog
136
137# disable-mnt
138private-cache
139private-dev
140private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gcrypt,gnupg,hostname,hosts,hosts.conf,mail,mailname,Mutt,Muttrc,Muttrc.d,neomuttrc,neomuttrc.d,nntpserver,nsswitch.conf,passwd,pki,resolv.conf,ssl,xdg
141private-tmp
142writable-run-user
143writable-var
144
145dbus-user none
146dbus-system none
147
148memory-deny-write-execute
149read-only ${HOME}/.elinks
150read-only ${HOME}/.nanorc
151read-only ${HOME}/.signature
152read-only ${HOME}/.w3m
diff --git a/etc/profile-m-z/netactview.profile b/etc/profile-m-z/netactview.profile
new file mode 100644
index 000000000..1bcc6a962
--- /dev/null
+++ b/etc/profile-m-z/netactview.profile
@@ -0,0 +1,55 @@
1# Firejail profile for netactview
2# Description: A graphical network connections viewer similar in functionality to netstat
3# This file is overwritten after every install/update
4# Persistent local customizations
5include netactview.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.netactview
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkfile ${HOME}/.netactview
20whitelist ${HOME}/.netactview
21whitelist /usr/share/netactview
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41seccomp
42shell none
43
44disable-mnt
45private-bin netactview,netactview_polkit
46private-cache
47private-dev
48private-etc alternatives,fonts
49private-lib
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-m-z/nethack-vultures.profile b/etc/profile-m-z/nethack-vultures.profile
new file mode 100644
index 000000000..4da43a2d0
--- /dev/null
+++ b/etc/profile-m-z/nethack-vultures.profile
@@ -0,0 +1,45 @@
1# Firejail profile for nethack-vultures
2# Description: A rogue-like single player dungeon exploration game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nethack.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.vultures
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.vultures
18whitelist ${HOME}/.vultures
19whitelist /var/log/vultures
20include whitelist-common.inc
21include whitelist-var-common.inc
22
23caps.drop all
24ipc-namespace
25net none
26nodvd
27nogroups
28noinput
29#nonewprivs
30#noroot
31notv
32novideo
33#protocol unix,netlink
34#seccomp
35shell none
36
37disable-mnt
38#private
39private-cache
40private-dev
41private-tmp
42writable-var
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-m-z/nethack.profile b/etc/profile-m-z/nethack.profile
new file mode 100644
index 000000000..5037133f2
--- /dev/null
+++ b/etc/profile-m-z/nethack.profile
@@ -0,0 +1,47 @@
1# Firejail profile for nethack
2# Description: A rogue-like single player dungeon exploration game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nethack.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /var/games/nethack
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17whitelist /var/games/nethack
18include whitelist-common.inc
19include whitelist-var-common.inc
20
21caps.drop all
22ipc-namespace
23net none
24no3d
25nodvd
26nogroups
27noinput
28#nonewprivs
29#noroot
30nosound
31notv
32novideo
33#protocol unix,netlink
34#seccomp
35shell none
36
37disable-mnt
38#private
39private-cache
40private-dev
41private-tmp
42writable-var
43
44dbus-user none
45dbus-system none
46
47#memory-deny-write-execute
diff --git a/etc/profile-m-z/netsurf.profile b/etc/profile-m-z/netsurf.profile
new file mode 100644
index 000000000..0ddb7bbbe
--- /dev/null
+++ b/etc/profile-m-z/netsurf.profile
@@ -0,0 +1,34 @@
1# Firejail profile for netsurf
2# Description: Lightweight and fast web browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include netsurf.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/netsurf
10noblacklist ${HOME}/.config/netsurf
11
12include disable-common.inc
13include disable-devel.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.cache/netsurf
18mkdir ${HOME}/.config/netsurf
19whitelist ${DOWNLOADS}
20whitelist ${HOME}/.cache/netsurf
21whitelist ${HOME}/.config/netsurf
22include whitelist-common.inc
23
24caps.drop all
25netfilter
26nodvd
27nonewprivs
28noroot
29notv
30protocol unix,inet,inet6,netlink
31seccomp
32tracelog
33
34disable-mnt
diff --git a/etc/profile-m-z/neverball-wrapper.profile b/etc/profile-m-z/neverball-wrapper.profile
new file mode 100644
index 000000000..534e41dd1
--- /dev/null
+++ b/etc/profile-m-z/neverball-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for neverball-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include neverball-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin neverball-wrapper
12
13# Redirect
14include neverball.profile
diff --git a/etc/profile-m-z/neverball.profile b/etc/profile-m-z/neverball.profile
new file mode 100644
index 000000000..9b7826fd0
--- /dev/null
+++ b/etc/profile-m-z/neverball.profile
@@ -0,0 +1,51 @@
1# Firejail profile for neverball
2# Description: 3D floor-tilting game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include neverball.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.neverball
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.neverball
20whitelist ${HOME}/.neverball
21whitelist /usr/share/neverball
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39seccomp.block-secondary
40shell none
41tracelog
42
43disable-mnt
44private-bin neverball
45private-cache
46private-dev
47private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,machine-id
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-m-z/neverputt-wrapper.profile b/etc/profile-m-z/neverputt-wrapper.profile
new file mode 100644
index 000000000..dacd113cc
--- /dev/null
+++ b/etc/profile-m-z/neverputt-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for neverputt-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include neverputt-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin neverputt-wrapper
12
13# Redirect
14include neverputt.profile
diff --git a/etc/profile-m-z/neverputt.profile b/etc/profile-m-z/neverputt.profile
new file mode 100644
index 000000000..d370d1218
--- /dev/null
+++ b/etc/profile-m-z/neverputt.profile
@@ -0,0 +1,11 @@
1# Firejail profile for neverputt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include neverputt.local
5# added by included profile
6#include globals.local
7
8private-bin neverputt
9
10# Redirect
11include neverball.profile
diff --git a/etc/profile-m-z/newsbeuter.profile b/etc/profile-m-z/newsbeuter.profile
new file mode 100644
index 000000000..6efb19502
--- /dev/null
+++ b/etc/profile-m-z/newsbeuter.profile
@@ -0,0 +1,31 @@
1# Firejail profile for Newsbeuter
2# Description: Text based Atom/RSS feed reader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include newsbeuter.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10ignore include newsboat.local
11ignore mkdir ${HOME}/.config/newsboat
12ignore mkdir ${HOME}/.local/share/newsboat
13ignore mkdir ${HOME}/.newsboat
14blacklist ${PATH}/newsboat
15
16blacklist ${HOME}/.config/newsboat
17blacklist ${HOME}/.local/share/newsboat
18blacklist ${HOME}/.newsboat
19
20nowhitelist ${HOME}/.config/newsboat
21nowhitelist ${HOME}/.local/share/newsboat
22nowhitelist ${HOME}/.newsboat
23
24mkdir ${HOME}/.config/newsbeuter
25mkdir ${HOME}/.local/share/newsbeuter
26mkdir ${HOME}/.newsbeuter
27
28private-bin newsbeuter
29
30# Redirect
31include newsboat.profile
diff --git a/etc/profile-m-z/newsboat.profile b/etc/profile-m-z/newsboat.profile
new file mode 100644
index 000000000..fa4ccea7c
--- /dev/null
+++ b/etc/profile-m-z/newsboat.profile
@@ -0,0 +1,62 @@
1# Firejail profile for Newsboat
2# Description: RSS program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include newsboat.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/newsbeuter
10noblacklist ${HOME}/.config/newsboat
11noblacklist ${HOME}/.local/share/newsbeuter
12noblacklist ${HOME}/.local/share/newsboat
13noblacklist ${HOME}/.newsbeuter
14noblacklist ${HOME}/.newsboat
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.config/newsboat
24mkdir ${HOME}/.local/share/newsboat
25mkdir ${HOME}/.newsboat
26whitelist ${HOME}/.config/newsbeuter
27whitelist ${HOME}/.config/newsboat
28whitelist ${HOME}/.local/share/newsbeuter
29whitelist ${HOME}/.local/share/newsboat
30whitelist ${HOME}/.newsbeuter
31whitelist ${HOME}/.newsboat
32include whitelist-common.inc
33include whitelist-runuser-common.inc
34include whitelist-var-common.inc
35
36caps.drop all
37ipc-namespace
38netfilter
39no3d
40nodvd
41nogroups
42noinput
43nonewprivs
44noroot
45notv
46nou2f
47novideo
48protocol inet,inet6
49seccomp
50shell none
51
52disable-mnt
53private-bin gzip,lynx,newsboat,sh,w3m
54private-cache
55private-dev
56private-etc alternatives,ca-certificates,crypto-policies,lynx.cfg,lynx.lss,pki,resolv.conf,ssl,terminfo
57private-tmp
58
59dbus-user none
60dbus-system none
61
62memory-deny-write-execute
diff --git a/etc/profile-m-z/newsflash.profile b/etc/profile-m-z/newsflash.profile
new file mode 100644
index 000000000..56cedec03
--- /dev/null
+++ b/etc/profile-m-z/newsflash.profile
@@ -0,0 +1,60 @@
1# Firejail profile for newsflash
2# Description: Modern feed reader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include newsflash.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/NewsFlashGTK
10noblacklist ${HOME}/.config/news-flash
11noblacklist ${HOME}/.local/share/news-flash
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.cache/NewsFlashGTK
22mkdir ${HOME}/.config/news-flash
23mkdir ${HOME}/.local/share/news-flash
24whitelist ${HOME}/.cache/NewsFlashGTK
25whitelist ${HOME}/.config/news-flash
26whitelist ${HOME}/.local/share/news-flash
27include whitelist-common.inc
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34machine-id
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6
46seccomp
47shell none
48tracelog
49
50disable-mnt
51private-bin com.gitlab.newsflash,newsflash
52private-cache
53private-dev
54private-etc ca-certificates,crypto-policies,dconf,fonts,gtk-3.0,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,nsswitch.conf,pango,pki,resolv.conf,ssl,X11
55private-tmp
56
57dbus-user none
58#dbus-user.own com.gitlab.newsflash
59#dbus-user.talk org.freedesktop.Notifications
60dbus-system none
diff --git a/etc/profile-m-z/nextcloud-desktop.profile b/etc/profile-m-z/nextcloud-desktop.profile
new file mode 100644
index 000000000..e74f9c03f
--- /dev/null
+++ b/etc/profile-m-z/nextcloud-desktop.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for nextcloud
2# This file is overwritten after every install/update
3# Persistent local customizations
4include nextcloud-desktop.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include nextcloud.profile
diff --git a/etc/profile-m-z/nextcloud.profile b/etc/profile-m-z/nextcloud.profile
new file mode 100644
index 000000000..cb499ba34
--- /dev/null
+++ b/etc/profile-m-z/nextcloud.profile
@@ -0,0 +1,72 @@
1# Firejail profile for nextcloud
2# Description: Nextcloud desktop synchronization client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nextcloud.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/Nextcloud
10noblacklist ${HOME}/.config/Nextcloud
11noblacklist ${HOME}/.local/share/Nextcloud
12# Add the next lines to your nextcloud.local to allow sync in more directories.
13#noblacklist ${DOCUMENTS}
14#noblacklist ${MUSIC}
15#noblacklist ${PICTURES}
16#noblacklist ${VIDEOS}
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/Nextcloud
27mkdir ${HOME}/.config/Nextcloud
28mkdir ${HOME}/.local/share/Nextcloud
29whitelist ${HOME}/Nextcloud
30whitelist ${HOME}/.config/Nextcloud
31whitelist ${HOME}/.local/share/Nextcloud
32# Add the next lines to your nextcloud.local to allow sync in more directories.
33#whitelist ${DOCUMENTS}
34#whitelist ${MUSIC}
35#whitelist ${PICTURES}
36#whitelist ${VIDEOS}
37include whitelist-common.inc
38include whitelist-runuser-common.inc
39include whitelist-usr-share-common.inc
40include whitelist-var-common.inc
41
42apparmor
43caps.drop all
44machine-id
45netfilter
46nodvd
47nogroups
48noinput
49nonewprivs
50noroot
51nosound
52notv
53nou2f
54novideo
55protocol unix,inet,inet6,netlink
56seccomp
57seccomp.block-secondary
58shell none
59tracelog
60
61disable-mnt
62private-bin nextcloud,nextcloud-desktop
63private-cache
64private-etc alternatives,ca-certificates,crypto-policies,drirc,fonts,gcrypt,host.conf,hosts,ld.so.cache,machine-id,Nextcloud,nsswitch.conf,os-release,passwd,pki,pulse,resolv.conf,selinux,ssl,xdg
65private-dev
66private-tmp
67
68dbus-user filter
69dbus-user.talk org.freedesktop.secrets
70# Add the next line to your nextcloud.local for tray icon support
71#dbus-user.talk org.kde.StatusNotifierWatcher
72dbus-system none
diff --git a/etc/profile-m-z/nheko.profile b/etc/profile-m-z/nheko.profile
new file mode 100644
index 000000000..035ad086a
--- /dev/null
+++ b/etc/profile-m-z/nheko.profile
@@ -0,0 +1,61 @@
1# Firejail profile for nheko
2# Description: Desktop IM client for the Matrix protocol
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nheko.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/nheko
10noblacklist ${HOME}/.config/nheko
11noblacklist ${HOME}/.local/share/nheko
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.cache/nheko
22mkdir ${HOME}/.config/nheko
23mkdir ${HOME}/.local/share/nheko
24whitelist ${HOME}/.cache/nheko
25whitelist ${HOME}/.config/nheko
26whitelist ${HOME}/.local/share/nheko
27whitelist ${DOWNLOADS}
28include whitelist-common.inc
29include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33apparmor
34caps.drop all
35netfilter
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41notv
42protocol unix,inet,inet6
43seccomp
44shell none
45tracelog
46
47disable-mnt
48private-bin nheko
49private-cache
50private-dev
51private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
52private-tmp
53
54
55# Add the next lines to your nheko.local to enable notification support.
56#ignore dbus-user none
57#dbus-user filter
58#dbus-user.talk org.freedesktop.Notifications
59#dbus-user.talk org.kde.StatusNotifierWatcher
60dbus-user none
61dbus-system none
diff --git a/etc/profile-m-z/nicotine.profile b/etc/profile-m-z/nicotine.profile
new file mode 100644
index 000000000..0b55a0d3a
--- /dev/null
+++ b/etc/profile-m-z/nicotine.profile
@@ -0,0 +1,57 @@
1# Firejail profile for Nicotine Plus
2# Description: Soulseek music-sharing client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nicotine.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.nicotine
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.nicotine
23whitelist ${DOWNLOADS}
24whitelist ${HOME}/.nicotine
25whitelist /usr/share/GeoIP
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33#ipc-namespace
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6
46seccomp
47shell none
48tracelog
49
50disable-mnt
51private-bin nicotine,python2*
52private-cache
53private-dev
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/profile-m-z/nitroshare-cli.profile b/etc/profile-m-z/nitroshare-cli.profile
new file mode 100644
index 000000000..13c6b59ae
--- /dev/null
+++ b/etc/profile-m-z/nitroshare-cli.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for nitroshare
2# Description: Network File Transfer Application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nitroshare-cli.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include nitroshare.profile
diff --git a/etc/profile-m-z/nitroshare-nmh.profile b/etc/profile-m-z/nitroshare-nmh.profile
new file mode 100644
index 000000000..513d26703
--- /dev/null
+++ b/etc/profile-m-z/nitroshare-nmh.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for nitroshare
2# Description: Network File Transfer Application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nitroshare-nmh.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include nitroshare.profile
diff --git a/etc/profile-m-z/nitroshare-send.profile b/etc/profile-m-z/nitroshare-send.profile
new file mode 100644
index 000000000..6edff3cce
--- /dev/null
+++ b/etc/profile-m-z/nitroshare-send.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for nitroshare
2# Description: Network File Transfer Application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nitroshare-send.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include nitroshare.profile
diff --git a/etc/profile-m-z/nitroshare-ui.profile b/etc/profile-m-z/nitroshare-ui.profile
new file mode 100644
index 000000000..ba5f8edf5
--- /dev/null
+++ b/etc/profile-m-z/nitroshare-ui.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for nitroshare
2# Description: Network File Transfer Application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nitroshare-ui.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include nitroshare.profile
diff --git a/etc/profile-m-z/nitroshare.profile b/etc/profile-m-z/nitroshare.profile
new file mode 100644
index 000000000..d5dd4ca95
--- /dev/null
+++ b/etc/profile-m-z/nitroshare.profile
@@ -0,0 +1,52 @@
1# Firejail profile for nitroshare
2# Description: Network File Transfer Application
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nitroshare.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Nathan Osman
10noblacklist ${HOME}/.config/NitroShare
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25caps.drop all
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6,netlink
38seccomp
39shell none
40
41disable-mnt
42private-bin awk,grep,nitroshare,nitroshare-cli,nitroshare-nmh,nitroshare-send,nitroshare-ui
43private-cache
44private-dev
45private-etc alternatives,ca-certificates,dconf,fonts,hostname,hosts,ld.so.cache,machine-id,nsswitch.conf,ssl
46# private-lib libnitroshare.so.*,libqhttpengine.so.*,libqmdnsengine.so.*,nitroshare
47private-tmp
48
49# dbus-user none
50# dbus-system none
51
52# memory-deny-write-execute
diff --git a/etc/profile-m-z/node.profile b/etc/profile-m-z/node.profile
new file mode 100644
index 000000000..cd48ed3c7
--- /dev/null
+++ b/etc/profile-m-z/node.profile
@@ -0,0 +1,11 @@
1# Firejail profile for node
2# Description: Evented I/O for V8 javascript
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include node.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include nodejs-common.profile
diff --git a/etc/profile-m-z/nodejs-common.profile b/etc/profile-m-z/nodejs-common.profile
new file mode 100644
index 000000000..ab69136f6
--- /dev/null
+++ b/etc/profile-m-z/nodejs-common.profile
@@ -0,0 +1,95 @@
1# Firejail profile for Node.js
2# Description: Asynchronous event-driven JavaScript runtime
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nodejs-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13ignore read-only ${HOME}/.npm-packages
14ignore read-only ${HOME}/.npmrc
15ignore read-only ${HOME}/.nvm
16ignore read-only ${HOME}/.yarnrc
17
18noblacklist ${HOME}/.node-gyp
19noblacklist ${HOME}/.npm
20noblacklist ${HOME}/.npmrc
21noblacklist ${HOME}/.nvm
22noblacklist ${HOME}/.yarn
23noblacklist ${HOME}/.yarn-config
24noblacklist ${HOME}/.yarncache
25noblacklist ${HOME}/.yarnrc
26
27ignore noexec ${HOME}
28
29include allow-bin-sh.inc
30
31include disable-common.inc
32include disable-exec.inc
33include disable-programs.inc
34include disable-shell.inc
35include disable-xdg.inc
36
37# If you want whitelisting, change ${HOME}/Projects below to your node projects directory
38# and add the next lines to your nodejs-common.local.
39#mkdir ${HOME}/.node-gyp
40#mkdir ${HOME}/.npm
41#mkdir ${HOME}/.npm-packages
42#mkfile ${HOME}/.npmrc
43#mkdir ${HOME}/.nvm
44#mkdir ${HOME}/.yarn
45#mkdir ${HOME}/.yarn-config
46#mkdir ${HOME}/.yarncache
47#mkfile ${HOME}/.yarnrc
48#whitelist ${HOME}/.node-gyp
49#whitelist ${HOME}/.npm
50#whitelist ${HOME}/.npm-packages
51#whitelist ${HOME}/.npmrc
52#whitelist ${HOME}/.nvm
53#whitelist ${HOME}/.yarn
54#whitelist ${HOME}/.yarn-config
55#whitelist ${HOME}/.yarncache
56#whitelist ${HOME}/.yarnrc
57#whitelist ${HOME}/Projects
58#include whitelist-common.inc
59
60whitelist /usr/share/doc/node
61whitelist /usr/share/nvm
62whitelist /usr/share/systemtap/tapset/node.stp
63include whitelist-runuser-common.inc
64include whitelist-usr-share-common.inc
65include whitelist-var-common.inc
66
67caps.drop all
68ipc-namespace
69machine-id
70netfilter
71no3d
72nodvd
73nogroups
74noinput
75nonewprivs
76noroot
77nosound
78notv
79nou2f
80novideo
81protocol unix,inet,inet6,netlink
82seccomp
83seccomp.block-secondary
84shell none
85
86disable-mnt
87private-dev
88private-etc alternatives,ca-certificates,crypto-policies,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,login.defs,mime.types,nsswitch.conf,passwd,pki,protocols,resolv.conf,rpc,services,ssl,xdg
89#private-tmp
90
91dbus-user none
92dbus-system none
93
94# Add the next line to your nodejs-common.local if you prefer to disable gatsby telemetry.
95#env GATSBY_TELEMETRY_DISABLED=1
diff --git a/etc/profile-m-z/nomacs.profile b/etc/profile-m-z/nomacs.profile
new file mode 100644
index 000000000..b044fb879
--- /dev/null
+++ b/etc/profile-m-z/nomacs.profile
@@ -0,0 +1,45 @@
1# Firejail profile for nomacs
2# Description: a fast and small image viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nomacs.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/nomacs
10noblacklist ${HOME}/.local/share/nomacs
11noblacklist ${HOME}/.local/share/data/nomacs
12noblacklist ${PICTURES}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37seccomp
38shell none
39tracelog
40
41#private-bin nomacs
42private-cache
43private-dev
44private-etc alternatives,ca-certificates,crypto-policies,dconf,drirc,fonts,gtk-3.0,hosts,login.defs,machine-id,pki,resolv.conf,ssl
45private-tmp
diff --git a/etc/profile-m-z/notify-send.profile b/etc/profile-m-z/notify-send.profile
new file mode 100644
index 000000000..5caf3374d
--- /dev/null
+++ b/etc/profile-m-z/notify-send.profile
@@ -0,0 +1,60 @@
1# Firejail profile for notify-send
2# Description: a program to send desktop notifications
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include notify-send.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-write-mnt.inc
19include disable-xdg.inc
20
21include whitelist-common.inc
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43shell none
44tracelog
45x11 none
46
47disable-mnt
48private
49private-bin notify-send
50private-cache
51private-dev
52private-etc none
53private-tmp
54
55dbus-user filter
56dbus-user.talk org.freedesktop.Notifications
57dbus-system none
58
59memory-deny-write-execute
60read-only ${HOME}
diff --git a/etc/profile-m-z/npm.profile b/etc/profile-m-z/npm.profile
new file mode 100644
index 000000000..4d8beea5a
--- /dev/null
+++ b/etc/profile-m-z/npm.profile
@@ -0,0 +1,11 @@
1# Firejail profile for npm
2# Description: The Node.js Package Manager
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include npm.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include nodejs-common.profile
diff --git a/etc/profile-m-z/nslookup.profile b/etc/profile-m-z/nslookup.profile
new file mode 100644
index 000000000..baa8ddfeb
--- /dev/null
+++ b/etc/profile-m-z/nslookup.profile
@@ -0,0 +1,55 @@
1# Firejail profile for nslookup
2# Description: DNS lookup utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include nslookup.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13noblacklist ${PATH}/nslookup
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22whitelist ${HOME}/.nslookuprc
23include whitelist-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29ipc-namespace
30machine-id
31netfilter
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44shell none
45tracelog
46
47disable-mnt
48private-bin bash,nslookup,sh
49private-dev
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-m-z/nuclear.profile b/etc/profile-m-z/nuclear.profile
new file mode 100644
index 000000000..886403b9e
--- /dev/null
+++ b/etc/profile-m-z/nuclear.profile
@@ -0,0 +1,25 @@
1# Firejail profile for nuclear
2# Description: Stream music from Youtube,Soundcloud,Jamendo
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nuclear.local
6# Persistent global definitions
7include globals.local
8
9ignore dbus-user
10
11noblacklist ${HOME}/.config/nuclear
12
13include disable-shell.inc
14
15mkdir ${HOME}/.config/nuclear
16whitelist ${HOME}/.config/nuclear
17
18no3d
19
20# private-bin nuclear
21private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
22private-opt nuclear
23
24# Redirect
25include electron.profile
diff --git a/etc/profile-m-z/nvm.profile b/etc/profile-m-z/nvm.profile
new file mode 100644
index 000000000..80da22834
--- /dev/null
+++ b/etc/profile-m-z/nvm.profile
@@ -0,0 +1,13 @@
1# Firejail profile for nvm
2# Description: Node Version Manager - Simple bash script to manage multiple active node.js versions
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include nvm.local
7# Persistent global definitions
8include globals.local
9
10ignore noroot
11
12# Redirect
13include nodejs-common.profile
diff --git a/etc/profile-m-z/nylas.profile b/etc/profile-m-z/nylas.profile
new file mode 100644
index 000000000..3474a075f
--- /dev/null
+++ b/etc/profile-m-z/nylas.profile
@@ -0,0 +1,38 @@
1# Firejail profile for nylas
2# This file is overwritten after every install/update
3# Persistent local customizations
4include nylas.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/Nylas Mail
9noblacklist ${HOME}/.nylas-mail
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15
16mkdir ${HOME}/.config/Nylas Mail
17mkdir ${HOME}/.nylas-mail
18whitelist ${DOWNLOADS}
19whitelist ${HOME}/.config/Nylas Mail
20whitelist ${HOME}/.nylas-mail
21include whitelist-common.inc
22
23caps.drop all
24netfilter
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix,inet,inet6,netlink
35seccomp
36shell none
37
38private-dev
diff --git a/etc/profile-m-z/nyx.profile b/etc/profile-m-z/nyx.profile
new file mode 100644
index 000000000..460a580b3
--- /dev/null
+++ b/etc/profile-m-z/nyx.profile
@@ -0,0 +1,54 @@
1# Firejail profile for nyx
2# Description: Command-line status monitor for tor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nyx.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13noblacklist ${HOME}/.nyx
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.nyx
24whitelist ${HOME}/.nyx
25include whitelist-common.inc
26include whitelist-var-common.inc
27
28caps.drop all
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43
44disable-mnt
45private-bin nyx,python*
46private-cache
47private-dev
48private-etc alternatives,fonts,passwd,tor
49private-opt none
50private-srv none
51private-tmp
52
53dbus-user none
54dbus-system none
diff --git a/etc/profile-m-z/obs.profile b/etc/profile-m-z/obs.profile
new file mode 100644
index 000000000..1ff9ad48a
--- /dev/null
+++ b/etc/profile-m-z/obs.profile
@@ -0,0 +1,43 @@
1# Firejail profile for obs
2# This file is overwritten after every install/update
3# Persistent local customizations
4include obs.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/obs-studio
9noblacklist ${MUSIC}
10noblacklist ${PICTURES}
11noblacklist ${VIDEOS}
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24include whitelist-var-common.inc
25
26caps.drop all
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34protocol unix,inet,inet6
35seccomp
36shell none
37tracelog
38
39private-bin bash,obs,obs-ffmpeg-mux,python*,sh
40private-cache
41private-dev
42private-tmp
43
diff --git a/etc/profile-m-z/ocenaudio.profile b/etc/profile-m-z/ocenaudio.profile
new file mode 100644
index 000000000..8e87f1d5d
--- /dev/null
+++ b/etc/profile-m-z/ocenaudio.profile
@@ -0,0 +1,55 @@
1# Firejail profile for ocenaudio
2# Description: Cross-platform, easy to use, fast and functional audio editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ocenaudio.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/ocenaudio
10noblacklist ${DOCUMENTS}
11noblacklist ${MUSIC}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27# net none - breaks update functionality and AppArmor on Ubuntu systems
28# Add 'net none' to your ocenaudio.local when you want that functionality.
29#net none
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42shell none
43tracelog
44
45private-bin ocenaudio
46private-cache
47private-dev
48private-etc alternatives,asound.conf,fonts,ld.so.cache,pulse
49private-tmp
50
51# breaks preferences
52# dbus-user none
53# dbus-system none
54
55#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-m-z/odt2txt.profile b/etc/profile-m-z/odt2txt.profile
new file mode 100644
index 000000000..22cec475b
--- /dev/null
+++ b/etc/profile-m-z/odt2txt.profile
@@ -0,0 +1,47 @@
1# Firejail profile for odt2txt
2# Description: Simple converter from OpenDocument Text to plain text
3# This file is overwritten after every install/update
4# Persistent local customizations
5include odt2txt.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11noblacklist ${DOCUMENTS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20caps.drop all
21net none
22no3d
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35tracelog
36x11 none
37
38private-bin odt2txt
39private-cache
40private-dev
41private-etc alternatives
42private-tmp
43
44dbus-user none
45dbus-system none
46
47read-only ${HOME}
diff --git a/etc/profile-m-z/oggsplt.profile b/etc/profile-m-z/oggsplt.profile
new file mode 100644
index 000000000..5aedadde9
--- /dev/null
+++ b/etc/profile-m-z/oggsplt.profile
@@ -0,0 +1,9 @@
1# Firejail profile for oggsplt
2# This file is overwritten after every install/update
3include oggsplt.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mp3splt.profile
diff --git a/etc/profile-m-z/okular.profile b/etc/profile-m-z/okular.profile
new file mode 100644
index 000000000..84edc65ef
--- /dev/null
+++ b/etc/profile-m-z/okular.profile
@@ -0,0 +1,72 @@
1# Firejail profile for okular
2# Description: Universal document viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include okular.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/okular
10noblacklist ${HOME}/.config/okularpartrc
11noblacklist ${HOME}/.config/okularrc
12noblacklist ${HOME}/.kde/share/apps/okular
13noblacklist ${HOME}/.kde/share/config/okularpartrc
14noblacklist ${HOME}/.kde/share/config/okularrc
15noblacklist ${HOME}/.kde4/share/apps/okular
16noblacklist ${HOME}/.kde4/share/config/okularpartrc
17noblacklist ${HOME}/.kde4/share/config/okularrc
18noblacklist ${HOME}/.local/share/kxmlgui5/okular
19noblacklist ${HOME}/.local/share/okular
20noblacklist ${DOCUMENTS}
21
22include disable-common.inc
23include disable-devel.inc
24include disable-exec.inc
25include disable-interpreters.inc
26include disable-programs.inc
27include disable-shell.inc
28include disable-xdg.inc
29
30whitelist /usr/share/config.kcfg/gssettings.kcfg
31whitelist /usr/share/config.kcfg/pdfsettings.kcfg
32whitelist /usr/share/config.kcfg/okular.kcfg
33whitelist /usr/share/config.kcfg/okular_core.kcfg
34whitelist /usr/share/ghostscript
35whitelist /usr/share/kconf_update/okular.upd
36whitelist /usr/share/kxmlgui5/okular
37whitelist /usr/share/okular
38whitelist /usr/share/poppler
39include whitelist-runuser-common.inc
40include whitelist-usr-share-common.inc
41include whitelist-var-common.inc
42
43apparmor
44caps.drop all
45machine-id
46# net none
47netfilter
48nodvd
49nogroups
50noinput
51nonewprivs
52noroot
53nosound
54notv
55nou2f
56novideo
57protocol unix
58seccomp
59shell none
60tracelog
61
62private-bin kbuildsycoca4,kdeinit4,lpr,okular,unar,unrar
63private-dev
64private-etc alternatives,cups,fonts,kde4rc,kde5rc,ld.so.cache,machine-id,passwd,xdg
65# private-tmp - on KDE we need access to the real /tmp for data exchange with email clients
66
67# dbus-user none
68# dbus-system none
69
70# memory-deny-write-execute
71
72join-or-start okular
diff --git a/etc/profile-m-z/onboard.profile b/etc/profile-m-z/onboard.profile
new file mode 100644
index 000000000..b0ffba19c
--- /dev/null
+++ b/etc/profile-m-z/onboard.profile
@@ -0,0 +1,56 @@
1# Firejail profile for onboard
2# Description: On-screen keyboard
3# This file is overwritten after every install/update
4# Persistent local customizations
5include onboard.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/onboard
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.config/onboard
24whitelist ${HOME}/.config/onboard
25whitelist /usr/share/onboard
26include whitelist-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-runuser-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33machine-id
34net none
35nodvd
36no3d
37nogroups
38noinput
39nonewprivs
40noroot
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46shell none
47tracelog
48
49disable-mnt
50private-cache
51private-bin onboard,python*,tput
52private-dev
53private-etc alternatives,dbus-1,dconf,fonts,gtk-2.0,gtk-3.0,locale,locale.alias,locale.conf,mime.types,selinux,X11,xdg
54private-tmp
55
56dbus-system none
diff --git a/etc/profile-m-z/onionshare-gui.profile b/etc/profile-m-z/onionshare-gui.profile
new file mode 100644
index 000000000..cf4d7db30
--- /dev/null
+++ b/etc/profile-m-z/onionshare-gui.profile
@@ -0,0 +1,41 @@
1# Firejail profile for onionshare-gui
2# This file is overwritten after every install/update
3# Persistent local customizations
4include onionshare-gui.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/onionshare
9
10# Allow python (blacklisted by disable-interpreters.inc)
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19include whitelist-var-common.inc
20
21caps.drop all
22ipc-namespace
23netfilter
24no3d
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37
38private-dev
39private-tmp
40
41memory-deny-write-execute
diff --git a/etc/profile-m-z/ooffice.profile b/etc/profile-m-z/ooffice.profile
new file mode 100644
index 000000000..8df7b502b
--- /dev/null
+++ b/etc/profile-m-z/ooffice.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ooffice.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-m-z/ooviewdoc.profile b/etc/profile-m-z/ooviewdoc.profile
new file mode 100644
index 000000000..c55d58ba7
--- /dev/null
+++ b/etc/profile-m-z/ooviewdoc.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include ooviewdoc.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-m-z/open-invaders.profile b/etc/profile-m-z/open-invaders.profile
new file mode 100644
index 000000000..12c7ea3d0
--- /dev/null
+++ b/etc/profile-m-z/open-invaders.profile
@@ -0,0 +1,43 @@
1# Firejail profile for open-invaders
2# Description: Space Invaders clone
3# This file is overwritten after every install/update
4# Persistent local customizations
5include open-invaders.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.openinvaders
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18mkdir ${HOME}/.openinvaders
19whitelist ${HOME}/.openinvaders
20include whitelist-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25net none
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,netlink
35seccomp
36shell none
37
38private-bin open-invaders
39private-dev
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/profile-m-z/openarena.profile b/etc/profile-m-z/openarena.profile
new file mode 100644
index 000000000..076a655a1
--- /dev/null
+++ b/etc/profile-m-z/openarena.profile
@@ -0,0 +1,50 @@
1# Firejail profile for OpenArena
2# Description: deathmatch FPS game based on GPL idTech3 technology
3# This file is overwritten after every install/update
4# Persistent local customizations
5include openarena.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.openarena
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.openarena
19whitelist ${HOME}/.openarena
20whitelist /usr/share/openarena
21include whitelist-common.inc
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28netfilter
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix,inet,inet6,netlink
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin bash,cut,glxinfo,grep,head,openarena,openarena_ded,quake3,zenity
44private-cache
45private-dev
46private-etc drirc,machine-id,openal,passwd,selinux,udev,xdg
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/openarena_ded.profile b/etc/profile-m-z/openarena_ded.profile
new file mode 100644
index 000000000..d70fbc101
--- /dev/null
+++ b/etc/profile-m-z/openarena_ded.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for openarena
2# This file is overwritten after every install/update
3# Persistent local customizations
4include openarena_ded.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include openarena.profile
diff --git a/etc/profile-m-z/openbox.profile b/etc/profile-m-z/openbox.profile
new file mode 100644
index 000000000..b49fd9932
--- /dev/null
+++ b/etc/profile-m-z/openbox.profile
@@ -0,0 +1,20 @@
1# Firejail profile for openbox
2# Description: Standards-compliant, fast, light-weight and extensible window manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include openbox.local
6# Persistent global definitions
7include globals.local
8
9# all applications started in openbox will run in this profile
10noblacklist ${HOME}/.config/openbox
11include disable-common.inc
12
13caps.drop all
14netfilter
15noroot
16protocol unix,inet,inet6
17seccomp
18
19read-only ${HOME}/.config/openbox/autostart
20read-only ${HOME}/.config/openbox/environment
diff --git a/etc/profile-m-z/opencity.profile b/etc/profile-m-z/opencity.profile
new file mode 100644
index 000000000..560bc6cbc
--- /dev/null
+++ b/etc/profile-m-z/opencity.profile
@@ -0,0 +1,48 @@
1# Firejail profile for opencity
2# Description: Full 3D city simulator game project
3# This file is overwritten after every install/update
4# Persistent local customizations
5include opencity.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.opencity
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.opencity
20whitelist ${HOME}/.opencity
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27net none
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin opencity
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-m-z/openclonk.profile b/etc/profile-m-z/openclonk.profile
new file mode 100644
index 000000000..253465991
--- /dev/null
+++ b/etc/profile-m-z/openclonk.profile
@@ -0,0 +1,49 @@
1# Firejail profile for openclonk
2# Description: Multiplayer action, tactics and skill game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include openclonk.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.clonk
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.clonk
20whitelist ${HOME}/.clonk
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27# net none - networked game
28netfilter
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin c4group,openclonk
44private-cache
45private-dev
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-m-z/openmw-launcher.profile b/etc/profile-m-z/openmw-launcher.profile
new file mode 100644
index 000000000..c9cc144e4
--- /dev/null
+++ b/etc/profile-m-z/openmw-launcher.profile
@@ -0,0 +1,7 @@
1# Firejail profile for openmw-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include openmw-launcher.local
5
6# Redirect
7include openmw.profile
diff --git a/etc/profile-m-z/openmw.profile b/etc/profile-m-z/openmw.profile
new file mode 100644
index 000000000..ce3399ad6
--- /dev/null
+++ b/etc/profile-m-z/openmw.profile
@@ -0,0 +1,61 @@
1# Firejail profile for openmw
2# Description: Open source engine re-implementation for Morrowind
3# This file is overwritten after every install/update
4# Persistent local customizations
5include openmw.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/openmw
10noblacklist ${HOME}/.local/share/openmw
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-write-mnt.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.config/openmw
22mkdir ${HOME}/.local/share/openmw
23whitelist ${HOME}/.config/openmw
24# Copy Morrowind data files into ${HOME}/.local/share/openmw or load them from /mnt.
25# Alternatively you can whitelist custom paths in your openmw.local.
26whitelist ${HOME}/.local/share/openmw
27whitelist /usr/share/openmw
28include whitelist-common.inc
29include whitelist-runuser-common.inc
30include whitelist-usr-share-common.inc
31include whitelist-var-common.inc
32
33apparmor
34caps.drop all
35ipc-namespace
36net none
37netfilter
38# Add 'ignore nodvd' to your openmw.local when installing from disc.
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44notv
45nou2f
46novideo
47protocol unix,netlink
48seccomp
49seccomp.block-secondary
50shell none
51tracelog
52
53private-bin bsatool,esmtool,niftest,openmw,openmw-cs,openmw-essimporter,openmw-iniimporter,openmw-launcher,openmw-wizard
54private-cache
55private-dev
56private-etc alsa,alternatives,asound.conf,bumblebee,drirc,fonts,glvnd,group,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nvidia,openmw,pango,passwd,pulse,Trolltech.conf,X11,xdg
57private-opt none
58private-tmp
59
60dbus-user none
61dbus-system none
diff --git a/etc/profile-m-z/openoffice.org.profile b/etc/profile-m-z/openoffice.org.profile
new file mode 100644
index 000000000..4221db409
--- /dev/null
+++ b/etc/profile-m-z/openoffice.org.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include openoffice.org.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-m-z/openshot-qt.profile b/etc/profile-m-z/openshot-qt.profile
new file mode 100644
index 000000000..c1a030556
--- /dev/null
+++ b/etc/profile-m-z/openshot-qt.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for openshot
2# This file is overwritten after every install/update
3# Persistent local customizations
4include openshot-qt.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include openshot.profile
diff --git a/etc/profile-m-z/openshot.profile b/etc/profile-m-z/openshot.profile
new file mode 100644
index 000000000..e2af2e714
--- /dev/null
+++ b/etc/profile-m-z/openshot.profile
@@ -0,0 +1,49 @@
1# Firejail profile for openshot
2# Description: Create and edit videos and movies
3# This file is overwritten after every install/update
4# Persistent local customizations
5include openshot.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.openshot
10noblacklist ${HOME}/.openshot_qt
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21whitelist /usr/share/blender
22whitelist /usr/share/inkscape
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37protocol unix,inet,inet6,netlink
38seccomp
39seccomp.block-secondary
40shell none
41tracelog
42
43private-bin blender,inkscape,openshot,openshot-qt,python3*
44private-cache
45private-dev
46private-tmp
47
48dbus-user filter
49dbus-system none
diff --git a/etc/profile-m-z/openttd.profile b/etc/profile-m-z/openttd.profile
new file mode 100644
index 000000000..6c31ebf65
--- /dev/null
+++ b/etc/profile-m-z/openttd.profile
@@ -0,0 +1,48 @@
1# Firejail profile for openttd
2# Description: Transport system simulation game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include openttd.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.openttd
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.openttd
20whitelist ${HOME}/.openttd
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27net none
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin openttd
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-m-z/opera-beta.profile b/etc/profile-m-z/opera-beta.profile
new file mode 100644
index 000000000..551f1aba4
--- /dev/null
+++ b/etc/profile-m-z/opera-beta.profile
@@ -0,0 +1,22 @@
1# Firejail profile for opera-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include opera-beta.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://www.tutorialspoint.com/difference-between-void-main-and-int-main-in-c-cplusplus
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/opera
14noblacklist ${HOME}/.config/opera-beta
15
16mkdir ${HOME}/.cache/opera
17mkdir ${HOME}/.config/opera-beta
18whitelist ${HOME}/.cache/opera
19whitelist ${HOME}/.config/opera-beta
20
21# Redirect
22include chromium-common.profile
diff --git a/etc/profile-m-z/opera.profile b/etc/profile-m-z/opera.profile
new file mode 100644
index 000000000..2c7c5fc35
--- /dev/null
+++ b/etc/profile-m-z/opera.profile
@@ -0,0 +1,26 @@
1# Firejail profile for opera
2# Description: A fast and secure web browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include opera.local
6# Persistent global definitions
7include globals.local
8
9# Disable for now, see https://www.tutorialspoint.com/difference-between-void-main-and-int-main-in-c-cplusplus
10ignore whitelist /usr/share/chromium
11ignore include whitelist-runuser-common.inc
12ignore include whitelist-usr-share-common.inc
13
14noblacklist ${HOME}/.cache/opera
15noblacklist ${HOME}/.config/opera
16noblacklist ${HOME}/.opera
17
18mkdir ${HOME}/.cache/opera
19mkdir ${HOME}/.config/opera
20mkdir ${HOME}/.opera
21whitelist ${HOME}/.cache/opera
22whitelist ${HOME}/.config/opera
23whitelist ${HOME}/.opera
24
25# Redirect
26include chromium-common.profile
diff --git a/etc/orage.profile b/etc/profile-m-z/orage.profile
index 209c7e9db..a3ec6a386 100644
--- a/etc/orage.profile
+++ b/etc/profile-m-z/orage.profile
@@ -1,35 +1,39 @@
1# Firejail profile for orage 1# Firejail profile for orage
2# Description: Calendar for Xfce Desktop Environment
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/orage.local 5include orage.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/orage 9noblacklist ${HOME}/.config/orage
9noblacklist ${HOME}/.local/share/orage 10noblacklist ${HOME}/.local/share/orage
10 11
11include /etc/firejail/disable-common.inc 12include disable-common.inc
12include /etc/firejail/disable-devel.inc 13include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
14include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
15 18
16caps.drop all 19caps.drop all
17netfilter 20netfilter
18no3d 21no3d
19nodvd 22nodvd
20nogroups 23nogroups
24noinput
21nonewprivs 25nonewprivs
22noroot 26noroot
23nosound 27# nosound - calendar application, It must be able to play sound to wake you up.
24notv 28notv
29nou2f
25novideo 30novideo
26protocol unix 31protocol unix
27seccomp 32seccomp
28shell none 33shell none
29 34
30disable-mnt 35disable-mnt
36private-cache
31private-dev 37private-dev
32private-tmp 38private-tmp
33 39
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/profile-m-z/org.gnome.NautilusPreviewer.profile b/etc/profile-m-z/org.gnome.NautilusPreviewer.profile
new file mode 100644
index 000000000..eb75add58
--- /dev/null
+++ b/etc/profile-m-z/org.gnome.NautilusPreviewer.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for sushi
2# This file is overwritten after every install/update
3# Persistent local customizations
4include org.gnome.NautilusPreviewer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include sushi.profile
diff --git a/etc/profile-m-z/ostrichriders.profile b/etc/profile-m-z/ostrichriders.profile
new file mode 100644
index 000000000..de6a6d3f5
--- /dev/null
+++ b/etc/profile-m-z/ostrichriders.profile
@@ -0,0 +1,50 @@
1# Firejail profile for ostrichriders
2# Description: Knights flying on ostriches compete against other riders
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ostrichriders.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.ostrichriders
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.ostrichriders
20whitelist ${HOME}/.ostrichriders
21whitelist /usr/share/ostrichriders
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27ipc-namespace
28net none
29nodvd
30nogroups
31# Add 'ignore noinput' to your ostrichriders.local if you need controller support.
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,netlink
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin ostrichriders
45private-cache
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/otter-browser.profile b/etc/profile-m-z/otter-browser.profile
new file mode 100644
index 000000000..78f92a860
--- /dev/null
+++ b/etc/profile-m-z/otter-browser.profile
@@ -0,0 +1,59 @@
1# Firejail profile for otter-browser
2# Description: Lightweight web browser based on Qt5
3# This file is overwritten after every install/update
4# Persistent local customizations
5include otter-browser.local
6# Persistent global definitions
7include globals.local
8
9?BROWSER_ALLOW_DRM: ignore noexec ${HOME}
10
11noblacklist ${HOME}/.cache/Otter
12noblacklist ${HOME}/.config/otter
13noblacklist ${HOME}/.pki
14noblacklist ${HOME}/.local/share/pki
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.cache/Otter
24mkdir ${HOME}/.config/otter
25mkdir ${HOME}/.pki
26mkdir ${HOME}/.local/share/pki
27whitelist ${DOWNLOADS}
28whitelist ${HOME}/.cache/Otter
29whitelist ${HOME}/.config/otter
30whitelist ${HOME}/.pki
31whitelist ${HOME}/.local/share/pki
32whitelist /usr/share/otter-browser
33include whitelist-common.inc
34include whitelist-runuser-common.inc
35include whitelist-usr-share-common.inc
36include whitelist-var-common.inc
37
38apparmor
39caps.drop all
40netfilter
41nodvd
42nogroups
43noinput
44nonewprivs
45noroot
46notv
47?BROWSER_DISABLE_U2F: nou2f
48protocol unix,inet,inet6,netlink
49seccomp !chroot
50shell none
51
52disable-mnt
53private-bin bash,otter-browser,sh,which
54private-cache
55?BROWSER_DISABLE_U2F: private-dev
56private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,group,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
57private-tmp
58
59dbus-system none
diff --git a/etc/profile-m-z/out123.profile b/etc/profile-m-z/out123.profile
new file mode 100644
index 000000000..4754c05ba
--- /dev/null
+++ b/etc/profile-m-z/out123.profile
@@ -0,0 +1,9 @@
1# Firejail profile for out123
2# Persistent local customizations
3include out123.local
4# Persistent global definitions
5# added by included profile
6#include globals.local
7
8# Redirect
9include mpg123.profile
diff --git a/etc/profile-m-z/p7zip.profile b/etc/profile-m-z/p7zip.profile
new file mode 100644
index 000000000..652fac7bd
--- /dev/null
+++ b/etc/profile-m-z/p7zip.profile
@@ -0,0 +1,12 @@
1# Firejail profile for p7zip
2# Description: File archiver with high compression ratio
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include p7zip.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include 7z.profile
diff --git a/etc/profile-m-z/palemoon.profile b/etc/profile-m-z/palemoon.profile
new file mode 100644
index 000000000..acb2ce176
--- /dev/null
+++ b/etc/profile-m-z/palemoon.profile
@@ -0,0 +1,26 @@
1# Firejail profile for palemoon
2# This file is overwritten after every install/update
3# Persistent local customizations
4include palemoon.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/moonchild productions/pale moon
9noblacklist ${HOME}/.moonchild productions/pale moon
10
11mkdir ${HOME}/.cache/moonchild productions/pale moon
12mkdir ${HOME}/.moonchild productions
13whitelist ${HOME}/.cache/moonchild productions/pale moon
14whitelist ${HOME}/.moonchild productions
15
16# Palemoon can use the full firejail seccomp filter (unlike firefox >= 60)
17seccomp
18ignore seccomp
19
20#private-bin palemoon
21# private-etc must first be enabled in firefox-common.profile
22#private-etc palemoon
23#private-opt palemoon
24
25# Redirect
26include firefox-common.profile
diff --git a/etc/profile-m-z/pandoc.profile b/etc/profile-m-z/pandoc.profile
new file mode 100644
index 000000000..2595d8a8f
--- /dev/null
+++ b/etc/profile-m-z/pandoc.profile
@@ -0,0 +1,56 @@
1# Firejail profile for pandoc
2# Description: general markup converter
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include pandoc.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12noblacklist ${DOCUMENTS}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22# breaks pdf output
23#include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27ipc-namespace
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42shell none
43tracelog
44x11 none
45
46disable-mnt
47private-bin context,latex,mktexfmt,pandoc,pdflatex,pdfroff,prince,weasyprint,wkhtmltopdf
48private-cache
49private-dev
50private-etc alternatives,texlive,texmf
51private-tmp
52
53dbus-user none
54dbus-system none
55
56memory-deny-write-execute
diff --git a/etc/profile-m-z/parole.profile b/etc/profile-m-z/parole.profile
new file mode 100644
index 000000000..33d75f0d2
--- /dev/null
+++ b/etc/profile-m-z/parole.profile
@@ -0,0 +1,30 @@
1# Firejail profile for parole
2# Description: Media player based on GStreamer framework
3# This file is overwritten after every install/update
4# Persistent local customizations
5include parole.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${MUSIC}
10noblacklist ${VIDEOS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19caps.drop all
20netfilter
21nonewprivs
22noroot
23notv
24protocol unix,inet,inet6
25seccomp
26shell none
27
28private-bin dbus-launch,parole
29private-cache
30private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,group,machine-id,passwd,pki,pulse,ssl
diff --git a/etc/profile-m-z/patch.profile b/etc/profile-m-z/patch.profile
new file mode 100644
index 000000000..3973c1b4a
--- /dev/null
+++ b/etc/profile-m-z/patch.profile
@@ -0,0 +1,51 @@
1# Firejail profile for patch
2# Description: Apply a diff file to an original
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include patch.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12noblacklist ${DOCUMENTS}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39seccomp.block-secondary
40shell none
41tracelog
42x11 none
43
44private-bin patch,red
45private-dev
46private-lib libdl.so.*,libfakeroot
47
48dbus-user none
49dbus-system none
50
51memory-deny-write-execute
diff --git a/etc/profile-m-z/pavucontrol-qt.profile b/etc/profile-m-z/pavucontrol-qt.profile
new file mode 100644
index 000000000..f96ba14d2
--- /dev/null
+++ b/etc/profile-m-z/pavucontrol-qt.profile
@@ -0,0 +1,19 @@
1# Firejail profile for pavucontrol-qt
2# Description: PulseAudio Volume Control [Qt]
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pavucontrol-qt.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist ${HOME}/.config/pavucontrol-qt
11
12mkdir ${HOME}/.config/pavucontrol-qt
13whitelist ${HOME}/.config/pavucontrol-qt
14
15private-bin pavucontrol-qt
16ignore private-lib
17
18# Redirect
19include pavucontrol.profile
diff --git a/etc/profile-m-z/pavucontrol.profile b/etc/profile-m-z/pavucontrol.profile
new file mode 100644
index 000000000..0bd14e88e
--- /dev/null
+++ b/etc/profile-m-z/pavucontrol.profile
@@ -0,0 +1,56 @@
1# Firejail profile for pavucontrol
2# Description: PulseAudio Volume Control [GTK]
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pavucontrol.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/pavucontrol.ini
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18# whitelisting in ${HOME} is broken, see #3112
19#mkfile ${HOME}/.config/pavucontrol.ini
20#whitelist ${HOME}/.config/pavucontrol.ini
21whitelist /usr/share/pavucontrol
22whitelist /usr/share/pavucontrol-qt
23#include whitelist-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin pavucontrol
46private-cache
47private-dev
48private-etc alternatives,asound.conf,avahi,fonts,machine-id,pulse
49private-lib
50private-tmp
51
52dbus-user none
53dbus-system none
54
55# mdwe is broken under Wayland, but works under Xorg.
56#memory-deny-write-execute
diff --git a/etc/profile-m-z/pcmanfm.profile b/etc/profile-m-z/pcmanfm.profile
new file mode 100644
index 000000000..5718ab164
--- /dev/null
+++ b/etc/profile-m-z/pcmanfm.profile
@@ -0,0 +1,12 @@
1# Firejail profile for pcmanfm
2# Description: Extremely fast and lightweight file manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pcmanfm.local
6# Persistent global definitions
7include globals.local
8
9# Put 'ignore noroot' in your pcmanfm.local if you use MPV+Vulkan (see issue #3012)
10
11# Redirect
12include file-manager-common.profile
diff --git a/etc/profile-m-z/pcsxr.profile b/etc/profile-m-z/pcsxr.profile
new file mode 100644
index 000000000..e52a1c4a9
--- /dev/null
+++ b/etc/profile-m-z/pcsxr.profile
@@ -0,0 +1,56 @@
1# Firejail profile for pcsxr
2# Description: A PlayStation emulator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pcsxr.local
6# Persistent global definitions
7include globals.local
8
9# Note: you must whitelist your games folder in your pcsxr.local
10
11noblacklist ${HOME}/.pcsxr
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-write-mnt.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.pcsxr
23whitelist ${HOME}/.pcsxr
24include whitelist-common.inc
25include whitelist-runuser-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32net none
33netfilter
34# Add the next line to your pcsxr.local when not loading games from disc.
35#nodvd
36nogroups
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix,netlink
43seccomp
44shell none
45tracelog
46
47private-bin pcsxr
48private-cache
49# Add the next line to your pcsxr.local if you do not need controller support.
50#private-dev
51private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,dconf,drirc,fonts,gconf,glvnd,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,nvidia,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
52private-opt none
53private-tmp
54
55dbus-user none
56dbus-system none
diff --git a/etc/profile-m-z/pdfchain.profile b/etc/profile-m-z/pdfchain.profile
new file mode 100644
index 000000000..bebd4ba44
--- /dev/null
+++ b/etc/profile-m-z/pdfchain.profile
@@ -0,0 +1,43 @@
1# Firejail profile for pdfchain
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pdfchain.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${DOCUMENTS}
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
16
17include whitelist-var-common.inc
18
19caps.drop all
20ipc-namespace
21net none
22no3d
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34
35private-bin pdfchain,pdftk,sh
36private-dev
37private-etc alternatives,dconf,fonts,gtk-3.0,xdg
38private-tmp
39
40dbus-user none
41dbus-system none
42
43memory-deny-write-execute
diff --git a/etc/profile-m-z/pdflatex.profile b/etc/profile-m-z/pdflatex.profile
new file mode 100644
index 000000000..caf980d4d
--- /dev/null
+++ b/etc/profile-m-z/pdflatex.profile
@@ -0,0 +1,12 @@
1# Firejail profile for pdflatex
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pdflatex.local
5# Persistent global definitions
6include globals.local
7
8private-bin pdflatex
9
10# Redirect
11include latex-common.profile
12
diff --git a/etc/pdfmod.profile b/etc/profile-m-z/pdfmod.profile
index 8489e79a6..c8397a31e 100644
--- a/etc/pdfmod.profile
+++ b/etc/profile-m-z/pdfmod.profile
@@ -1,31 +1,37 @@
1# Firejail profile for pdfmod 1# Firejail profile for pdfmod
2# Description: Simple tool for modifying PDF documents
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/pdfmod.local 5include pdfmod.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7
8 8
9noblacklist ${HOME}/.cache/pdfmod 9noblacklist ${HOME}/.cache/pdfmod
10noblacklist ${HOME}/.config/pdfmod 10noblacklist ${HOME}/.config/pdfmod
11noblacklist ${DOCUMENTS}
11 12
12include /etc/firejail/disable-common.inc 13include disable-common.inc
13include /etc/firejail/disable-devel.inc 14include disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 15include disable-exec.inc
15include /etc/firejail/disable-programs.inc 16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
16 19
17include /etc/firejail/whitelist-var-common.inc 20include whitelist-var-common.inc
18 21
19caps.drop all 22caps.drop all
20ipc-namespace 23ipc-namespace
24machine-id
21net none 25net none
22no3d 26no3d
23nodvd 27nodvd
24nogroups 28nogroups
29noinput
25nonewprivs 30nonewprivs
26noroot 31noroot
27nosound 32nosound
28notv 33notv
34nou2f
29novideo 35novideo
30protocol unix 36protocol unix
31seccomp 37seccomp
@@ -34,5 +40,5 @@ shell none
34private-dev 40private-dev
35private-tmp 41private-tmp
36 42
37noexec ${HOME} 43dbus-user none
38noexec /tmp 44dbus-system none
diff --git a/etc/profile-m-z/pdfsam.profile b/etc/profile-m-z/pdfsam.profile
new file mode 100644
index 000000000..0c2ce0588
--- /dev/null
+++ b/etc/profile-m-z/pdfsam.profile
@@ -0,0 +1,44 @@
1# Firejail profile for pdfsam
2# Description: PDF Split and Merge
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pdfsam.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10
11# Allow java (blacklisted by disable-devel.inc)
12include allow-java.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21caps.drop all
22machine-id
23net none
24no3d
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37
38private-bin archlinux-java,awk,bash,dirname,expr,find,grep,java,java-config,ls,pdfsam,readlink,sh,sort,uname,which
39private-cache
40private-dev
41private-tmp
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-m-z/pdftotext.profile b/etc/profile-m-z/pdftotext.profile
new file mode 100644
index 000000000..0cb08aa74
--- /dev/null
+++ b/etc/profile-m-z/pdftotext.profile
@@ -0,0 +1,55 @@
1# Firejail profile for pdftotext
2# Description: Portable Document Format (PDF) to text converter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pdftotext.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}
10
11noblacklist ${DOCUMENTS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21whitelist ${DOCUMENTS}
22whitelist ${DOWNLOADS}
23whitelist /usr/share/poppler
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43seccomp.block-secondary
44shell none
45tracelog
46x11 none
47
48private-bin pdftotext
49private-cache
50private-dev
51private-etc alternatives
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-m-z/peek.profile b/etc/profile-m-z/peek.profile
new file mode 100644
index 000000000..a8f925313
--- /dev/null
+++ b/etc/profile-m-z/peek.profile
@@ -0,0 +1,62 @@
1# Firejail profile for peek
2# This file is overwritten after every install/update
3# Persistent local customizations
4include peek.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/peek
9noblacklist ${PICTURES}
10noblacklist ${VIDEOS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19#mkdir ${HOME}/.cache/peek
20#whitelist ${HOME}/.cache/peek
21#whitelist ${PICTURES}
22#whitelist ${VIDEOS}
23#include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30machine-id
31net none
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48disable-mnt
49private-bin bash,convert,ffmpeg,firejail,fish,peek,sh,which,zsh
50private-dev
51private-etc dconf,firejail,fonts,gtk-3.0,login.defs,pango,passwd,X11
52private-tmp
53
54dbus-user filter
55dbus-user.own com.uploadedlobster.peek
56dbus-user.talk ca.desrt.dconf
57dbus-user.talk org.freedesktop.FileManager1
58dbus-user.talk org.freedesktop.Notifications
59dbus-user.talk org.gnome.Shell.Screencast
60dbus-system none
61
62memory-deny-write-execute
diff --git a/etc/profile-m-z/penguin-command.profile b/etc/profile-m-z/penguin-command.profile
new file mode 100644
index 000000000..13e89616e
--- /dev/null
+++ b/etc/profile-m-z/penguin-command.profile
@@ -0,0 +1,42 @@
1# Firejail profile for open-invaders
2# Description: Space Invaders clone
3# This file is overwritten after every install/update
4# Persistent local customizations
5include penguin-command.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.penguin-command
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18whitelist ${HOME}/.penguin-command
19include whitelist-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32novideo
33protocol unix,netlink
34seccomp
35shell none
36
37private-bin penguin-command
38private-dev
39private-tmp
40
41dbus-user none
42dbus-system none
diff --git a/etc/profile-m-z/photoflare.profile b/etc/profile-m-z/photoflare.profile
new file mode 100644
index 000000000..c012504c4
--- /dev/null
+++ b/etc/profile-m-z/photoflare.profile
@@ -0,0 +1,50 @@
1# Firejail profile for photoflare
2# Description: Simple painting and editing program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include photoflare.local
6# Persistent global definitions
7include photoflare.local
8
9noblacklist ${PICTURES}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19include whitelist-runuser-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27nodvd
28no3d
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin photoflare
44private-cache
45private-dev
46private-etc alternatives,fonts,locale,locale.alias,locale.conf,mime.types,X11
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/picard.profile b/etc/profile-m-z/picard.profile
new file mode 100644
index 000000000..dbbfc5275
--- /dev/null
+++ b/etc/profile-m-z/picard.profile
@@ -0,0 +1,43 @@
1# Firejail profile for picard
2# Description: Next-Generation MusicBrainz audio files tagger
3# This file is overwritten after every install/update
4# Persistent local customizations
5include picard.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/MusicBrainz
10noblacklist ${HOME}/.config/MusicBrainz
11noblacklist ${MUSIC}
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24include whitelist-var-common.inc
25
26caps.drop all
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6
38seccomp
39shell none
40
41private-dev
42private-tmp
43
diff --git a/etc/profile-m-z/pidgin.profile b/etc/profile-m-z/pidgin.profile
new file mode 100644
index 000000000..904c17e09
--- /dev/null
+++ b/etc/profile-m-z/pidgin.profile
@@ -0,0 +1,47 @@
1# Firejail profile for pidgin
2# Description: Graphical multi-protocol instant messaging client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pidgin.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${RUNUSER}
10ignore noexec /dev/shm
11
12noblacklist ${HOME}/.purple
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.purple
22whitelist ${HOME}/.purple
23whitelist ${DOWNLOADS}
24whitelist ${PICTURES}
25include whitelist-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31netfilter
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39protocol unix,inet,inet6
40seccomp
41# shell none
42tracelog
43
44# private-bin pidgin
45private-cache
46private-dev
47private-tmp
diff --git a/etc/profile-m-z/pinball-wrapper.profile b/etc/profile-m-z/pinball-wrapper.profile
new file mode 100644
index 000000000..2b5ed6e27
--- /dev/null
+++ b/etc/profile-m-z/pinball-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for pinball-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pinball-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin pinball-wrapper
12
13# Redirect
14include pinball.profile
diff --git a/etc/profile-m-z/pinball.profile b/etc/profile-m-z/pinball.profile
new file mode 100644
index 000000000..3c76ad99c
--- /dev/null
+++ b/etc/profile-m-z/pinball.profile
@@ -0,0 +1,55 @@
1# Firejail profile for pinball
2# Description: Emilia 3D Pinball Game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pinball.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/emilia
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/emilia
20whitelist ${HOME}/.config/emilia
21
22whitelist /usr/share/pinball
23# on debian games are stored under /usr/share/games
24whitelist /usr/share/games/pinball
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32net none
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43seccomp.block-secondary
44shell none
45tracelog
46
47disable-mnt
48private-bin pinball
49private-cache
50private-dev
51private-etc alsa,alternatives,asound.conf,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,machine-id,pulse
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-m-z/ping.profile b/etc/profile-m-z/ping.profile
new file mode 100644
index 000000000..b4923c38a
--- /dev/null
+++ b/etc/profile-m-z/ping.profile
@@ -0,0 +1,58 @@
1# Firejail profile for ping
2# Description: send ICMP ECHO_REQUEST to network hosts
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ping.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.keep net_raw
26ipc-namespace
27#net tun0
28#netfilter /etc/firejail/ping.net
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34# ping needs to rise privileges, noroot and nonewprivs will kill it
35#nonewprivs
36#noroot
37nosound
38notv
39nou2f
40novideo
41# protocol command is built using seccomp; nonewprivs will kill it
42#protocol unix,inet,inet6,netlink,packet
43# killed by no-new-privs
44#seccomp
45
46disable-mnt
47private
48#private-bin has mammoth problems with execvp: "No such file or directory"
49private-dev
50# /etc/hosts is required in private-etc; however, just adding it to the list doesn't solve the problem!
51#private-etc ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl
52private-tmp
53
54# memory-deny-write-execute is built using seccomp; nonewprivs will kill it
55#memory-deny-write-execute
56
57dbus-user none
58dbus-system none
diff --git a/etc/profile-m-z/pingus.profile b/etc/profile-m-z/pingus.profile
new file mode 100644
index 000000000..5b2d7a5a4
--- /dev/null
+++ b/etc/profile-m-z/pingus.profile
@@ -0,0 +1,57 @@
1# Firejail profile for pingus
2# Description: Free Lemmings(TM) clone
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pingus.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.pingus
10
11# Allow /bin/sh (blacklisted by disable-shell.inc)
12include allow-bin-sh.inc
13
14blacklist /usr/libexec
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.pingus
25whitelist ${HOME}/.pingus
26whitelist /usr/share/pingus
27include whitelist-common.inc
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34net none
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix,netlink
44seccomp
45seccomp.block-secondary
46shell none
47tracelog
48
49disable-mnt
50private-bin pingus,pingus.bin,sh
51private-cache
52private-dev
53private-etc machine-id
54private-tmp
55
56dbus-user none
57dbus-system none
diff --git a/etc/profile-m-z/pinta.profile b/etc/profile-m-z/pinta.profile
new file mode 100644
index 000000000..f52803d50
--- /dev/null
+++ b/etc/profile-m-z/pinta.profile
@@ -0,0 +1,41 @@
1# Firejail profile for pinta
2# Description: Simple drawing/painting program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pinta.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Pinta
10noblacklist ${DOCUMENTS}
11noblacklist ${PICTURES}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20caps.drop all
21ipc-namespace
22net none
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28nosound
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35
36private-dev
37private-cache
38private-tmp
39
40dbus-user none
41dbus-system none
diff --git a/etc/profile-m-z/pioneer.profile b/etc/profile-m-z/pioneer.profile
new file mode 100644
index 000000000..7c9bb352b
--- /dev/null
+++ b/etc/profile-m-z/pioneer.profile
@@ -0,0 +1,47 @@
1# Firejail profile for pioneer
2# Description: A game of lonely space adventure
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pioneer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.pioneer
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.pioneer
20whitelist ${HOME}/.pioneer
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26net none
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,netlink
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private-bin modelcompiler,pioneer,savegamedump
42private-cache
43private-dev
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-m-z/pipe-viewer.profile b/etc/profile-m-z/pipe-viewer.profile
new file mode 100644
index 000000000..3de064311
--- /dev/null
+++ b/etc/profile-m-z/pipe-viewer.profile
@@ -0,0 +1,21 @@
1# Firejail profile for pipe-viewer
2# Description: Fork of youtube-viewer, scrapes youtube directly and with invidious
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include pipe-viewer.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.cache/pipe-viewer
11noblacklist ${HOME}/.config/pipe-viewer
12
13mkdir ${HOME}/.config/pipe-viewer
14mkdir ${HOME}/.cache/pipe-viewer
15whitelist ${HOME}/.cache/pipe-viewer
16whitelist ${HOME}/.config/pipe-viewer
17
18private-bin gtk-pipe-viewer,pipe-viewer
19
20# Redirect
21include youtube-viewers-common.profile
diff --git a/etc/profile-m-z/pithos.profile b/etc/profile-m-z/pithos.profile
new file mode 100644
index 000000000..91814d8bb
--- /dev/null
+++ b/etc/profile-m-z/pithos.profile
@@ -0,0 +1,43 @@
1# Firejail profile for pithos
2# Description: Pandora Radio client for the GNOME desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pithos.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25netfilter
26no3d
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39disable-mnt
40private-bin env,pithos,python*
41private-dev
42private-tmp
43
diff --git a/etc/profile-m-z/pitivi.profile b/etc/profile-m-z/pitivi.profile
new file mode 100644
index 000000000..245ffae22
--- /dev/null
+++ b/etc/profile-m-z/pitivi.profile
@@ -0,0 +1,42 @@
1# Firejail profile for pitivi
2# Description: Non-linear audio/video editor using GStreamer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pitivi.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/pitivi
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21include whitelist-runuser-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27net none
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix
37seccomp
38shell none
39
40private-dev
41private-tmp
42
diff --git a/etc/pix.profile b/etc/profile-m-z/pix.profile
index 5440e4634..6bd1ad02e 100644
--- a/etc/pix.profile
+++ b/etc/profile-m-z/pix.profile
@@ -1,27 +1,30 @@
1# Firejail profile for pix 1# Firejail profile for pix
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/pix.local 4include pix.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/pix 8noblacklist ${HOME}/.config/pix
9noblacklist ${HOME}/.local/share/pix 9noblacklist ${HOME}/.local/share/pix
10noblacklist ~/.Steam 10noblacklist ${HOME}/.Steam
11noblacklist ~/.steam 11noblacklist ${HOME}/.steam
12 12
13include /etc/firejail/disable-common.inc 13include disable-common.inc
14include /etc/firejail/disable-devel.inc 14include disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc 15include disable-interpreters.inc
16include /etc/firejail/disable-programs.inc 16include disable-programs.inc
17include disable-shell.inc
17 18
18caps.drop all 19caps.drop all
19nodvd 20nodvd
20nogroups 21nogroups
22noinput
21nonewprivs 23nonewprivs
22noroot 24noroot
23nosound 25nosound
24notv 26notv
27nou2f
25novideo 28novideo
26protocol unix 29protocol unix
27seccomp 30seccomp
@@ -29,5 +32,6 @@ shell none
29tracelog 32tracelog
30 33
31private-bin pix 34private-bin pix
35private-cache
32private-dev 36private-dev
33private-tmp 37private-tmp
diff --git a/etc/profile-m-z/pkglog.profile b/etc/profile-m-z/pkglog.profile
new file mode 100644
index 000000000..c2707dac4
--- /dev/null
+++ b/etc/profile-m-z/pkglog.profile
@@ -0,0 +1,59 @@
1# Firejail profile for pklog
2# Description: Reports log of package updates
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pkglog.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python3.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19whitelist /var/log/apt/history.log
20whitelist /var/log/dnf.rpm.log
21whitelist /var/log/pacman.log
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private
44private-bin pkglog,python*
45private-cache
46private-dev
47private-etc alternatives
48private-opt none
49private-tmp
50writable-var-log
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
56read-only ${HOME}
57read-only /var/log/apt/history.log
58read-only /var/log/dnf.rpm.log
59read-only /var/log/pacman.log
diff --git a/etc/profile-m-z/planmaker18.profile b/etc/profile-m-z/planmaker18.profile
new file mode 100644
index 000000000..4cf1efb7f
--- /dev/null
+++ b/etc/profile-m-z/planmaker18.profile
@@ -0,0 +1,10 @@
1# Firejail profile for planmaker18
2# Description: SoftMaker Office - spreadsheet program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include planmaker18.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
diff --git a/etc/profile-m-z/planmaker18free.profile b/etc/profile-m-z/planmaker18free.profile
new file mode 100644
index 000000000..bb85f1fc7
--- /dev/null
+++ b/etc/profile-m-z/planmaker18free.profile
@@ -0,0 +1,10 @@
1# Firejail profile for planmaker18free
2# Description: SoftMaker FreeOffice - spreadsheet program
3# This file is overwritten after every install/update
4# Persistent local customizations
5include planmaker18free.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
diff --git a/etc/profile-m-z/playonlinux.profile b/etc/profile-m-z/playonlinux.profile
new file mode 100644
index 000000000..8e98905b5
--- /dev/null
+++ b/etc/profile-m-z/playonlinux.profile
@@ -0,0 +1,23 @@
1# Firejail profile for playonlinux
2# Description: Front-end for Wine
3# This file is overwritten after every install/update
4# Persistent local customizations
5include playonlinux.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist ${HOME}/.PlayOnLinux
11
12# nc is needed to run playonlinux
13noblacklist ${PATH}/nc
14
15# Allow perl (blacklisted by disable-interpreters.inc)
16include allow-perl.inc
17
18# Allow python (blacklisted by disable-interpreters.inc)
19include allow-python2.inc
20include allow-python3.inc
21
22# Redirect
23include wine.profile
diff --git a/etc/profile-m-z/pluma.profile b/etc/profile-m-z/pluma.profile
new file mode 100644
index 000000000..567725be4
--- /dev/null
+++ b/etc/profile-m-z/pluma.profile
@@ -0,0 +1,52 @@
1# Firejail profile for pluma
2# Description: Official text editor of the MATE desktop environment
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pluma.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/enchant
10noblacklist ${HOME}/.config/pluma
11
12# Allows files commonly used by IDEs
13include allow-common-devel.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21
22include whitelist-var-common.inc
23
24# apparmor - makes settings immutable
25caps.drop all
26machine-id
27# net none - makes settings immutable
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43private-bin pluma
44private-dev
45private-lib aspell,gconv,libgspell-1.so.*,libreadline.so.*,libtinfo.so.*,pluma
46private-tmp
47
48# makes settings immutable
49# dbus-user none
50# dbus-system none
51
52join-or-start pluma
diff --git a/etc/profile-m-z/plv.profile b/etc/profile-m-z/plv.profile
new file mode 100644
index 000000000..80f768170
--- /dev/null
+++ b/etc/profile-m-z/plv.profile
@@ -0,0 +1,60 @@
1# Firejail profile for plv
2# Description: Inspect pacman log files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include plv.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/PacmanLogViewer
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.config/PacmanLogViewer
19whitelist ${HOME}/.config/PacmanLogViewer
20whitelist /var/log/pacman.log
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin plv
47private-cache
48private-dev
49private-etc alternatives,fonts
50private-opt none
51private-tmp
52writable-var-log
53
54dbus-user none
55dbus-system none
56
57#memory-deny-write-execute - breaks opening file-chooser
58read-only ${HOME}
59read-write ${HOME}/.config/PacmanLogViewer
60read-only /var/log/pacman.log
diff --git a/etc/profile-m-z/pngquant.profile b/etc/profile-m-z/pngquant.profile
new file mode 100644
index 000000000..0b3d2b44c
--- /dev/null
+++ b/etc/profile-m-z/pngquant.profile
@@ -0,0 +1,56 @@
1# Firejail profile for pngquant
2# Description: PNG converter and lossy image compressor
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include pngquant.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${PICTURES}
11
12blacklist ${RUNUSER}/wayland-*
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41# block the socket syscall to simulate an be empty protocol line, see #639
42seccomp socket
43shell none
44tracelog
45x11 none
46
47private-bin pngquant
48private-cache
49private-dev
50private-etc alternatives
51private-tmp
52
53dbus-user none
54dbus-system none
55
56memory-deny-write-execute
diff --git a/etc/polari.profile b/etc/profile-m-z/polari.profile
index a990194c9..a3d4f9851 100644
--- a/etc/polari.profile
+++ b/etc/profile-m-z/polari.profile
@@ -1,14 +1,19 @@
1# Firejail profile for polari 1# Firejail profile for polari
2# Description: Internet Relay Chat (IRC) client
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/polari.local 5include polari.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
9# Allow gjs (blacklisted by disable-interpreters.inc)
10include allow-gjs.inc
8 11
9include /etc/firejail/disable-common.inc 12include disable-common.inc
10include /etc/firejail/disable-devel.inc 13include disable-devel.inc
11include /etc/firejail/disable-programs.inc 14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
12 17
13mkdir ${HOME}/.cache/telepathy 18mkdir ${HOME}/.cache/telepathy
14mkdir ${HOME}/.config/telepathy-account-widgets 19mkdir ${HOME}/.config/telepathy-account-widgets
@@ -22,17 +27,20 @@ whitelist ${HOME}/.local/share/Empathy
22whitelist ${HOME}/.local/share/TpLogger 27whitelist ${HOME}/.local/share/TpLogger
23whitelist ${HOME}/.local/share/telepathy 28whitelist ${HOME}/.local/share/telepathy
24whitelist ${HOME}/.purple 29whitelist ${HOME}/.purple
25include /etc/firejail/whitelist-common.inc 30include whitelist-common.inc
31include whitelist-runuser-common.inc
26 32
27caps.drop all 33caps.drop all
28netfilter 34netfilter
29no3d 35no3d
30nodvd 36nodvd
31nogroups 37nogroups
38noinput
32nonewprivs 39nonewprivs
33noroot 40noroot
34nosound 41nosound
35notv 42notv
43nou2f
36protocol unix,inet,inet6 44protocol unix,inet,inet6
37seccomp 45seccomp
38shell none 46shell none
@@ -42,5 +50,3 @@ disable-mnt
42private-dev 50private-dev
43private-tmp 51private-tmp
44 52
45noexec ${HOME}
46noexec /tmp
diff --git a/etc/profile-m-z/ppsspp.profile b/etc/profile-m-z/ppsspp.profile
new file mode 100644
index 000000000..3e06cf300
--- /dev/null
+++ b/etc/profile-m-z/ppsspp.profile
@@ -0,0 +1,51 @@
1# Firejail profile for ppsspp
2# Description: A PSP emulator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ppsspp.local
6# Persistent global definitions
7include globals.local
8
9# Note: you must whitelist your games folder in your ppsspp.local.
10
11noblacklist ${HOME}/.config/ppsspp
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-write-mnt.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.config/ppsspp
22whitelist ${HOME}/.config/ppsspp
23whitelist /usr/share/ppsspp
24include whitelist-common.inc
25include whitelist-runuser-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29caps.drop all
30ipc-namespace
31net none
32nodvd
33nogroups
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,netlink
40seccomp
41shell none
42
43private-bin ppsspp,PPSSPP,PPSSPPQt,PPSSPPSDL
44# Add the next line to your ppsspp.local if you do not need controller support.
45#private-dev
46private-etc alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,machine-id,nsswitch.conf,passwd,pki,pulse,resolv.conf,ssl
47private-opt ppsspp
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-m-z/pragha.profile b/etc/profile-m-z/pragha.profile
new file mode 100644
index 000000000..bc0ff0e85
--- /dev/null
+++ b/etc/profile-m-z/pragha.profile
@@ -0,0 +1,38 @@
1# Firejail profile for pragha
2# Description: A lightweight GTK music player
3# This file is overwritten after every install/update
4# Persistent local customizations
5include pragha.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/pragha
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21caps.drop all
22netfilter
23no3d
24nogroups
25noinput
26nonewprivs
27noroot
28notv
29nou2f
30novideo
31protocol unix,inet,inet6
32seccomp
33shell none
34
35private-dev
36private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-3.0,host.conf,hostname,hosts,machine-id,pki,pulse,resolv.conf,ssl,xdg
37private-tmp
38
diff --git a/etc/profile-m-z/presentations18.profile b/etc/profile-m-z/presentations18.profile
new file mode 100644
index 000000000..65d684c40
--- /dev/null
+++ b/etc/profile-m-z/presentations18.profile
@@ -0,0 +1,11 @@
1# Firejail profile for presentations18
2# Description: SoftMaker Office - presentations software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include presentations18.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
11
diff --git a/etc/profile-m-z/presentations18free.profile b/etc/profile-m-z/presentations18free.profile
new file mode 100644
index 000000000..218747224
--- /dev/null
+++ b/etc/profile-m-z/presentations18free.profile
@@ -0,0 +1,10 @@
1# Firejail profile for presentations18free
2# Description: SoftMaker FreeOffice - presentations software
3# This file is overwritten after every install/update
4# Persistent local customizations
5include presentations18free.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
diff --git a/etc/profile-m-z/profanity.profile b/etc/profile-m-z/profanity.profile
new file mode 100644
index 000000000..705af370b
--- /dev/null
+++ b/etc/profile-m-z/profanity.profile
@@ -0,0 +1,53 @@
1# Firejail profile for profanity
2# Description: profanity is an XMPP chat client for the terminal
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include profanity.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.config/profanity
11noblacklist ${HOME}/.local/share/profanity
12
13# Allow Python
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28caps.drop all
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43
44private-bin profanity
45private-cache
46private-dev
47private-etc alternatives,ca-certificates,crypto-policies,localtime,mime.types,nsswitch.conf,pki,resolv.conf,ssl
48private-tmp
49
50dbus-user none
51dbus-system none
52
53memory-deny-write-execute
diff --git a/etc/profile-m-z/psi-plus.profile b/etc/profile-m-z/psi-plus.profile
new file mode 100644
index 000000000..5f598cec5
--- /dev/null
+++ b/etc/profile-m-z/psi-plus.profile
@@ -0,0 +1,45 @@
1# Firejail profile for psi-plus
2# Description: Qt-based XMPP/Jabber client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include psi-plus.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/psi+
10noblacklist ${HOME}/.local/share/psi+
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18mkdir ${HOME}/.cache/psi+
19mkdir ${HOME}/.config/psi+
20mkdir ${HOME}/.local/share/psi+
21whitelist ${DOWNLOADS}
22whitelist ${HOME}/.cache/psi+
23whitelist ${HOME}/.config/psi+
24whitelist ${HOME}/.local/share/psi+
25include whitelist-common.inc
26
27caps.drop all
28netfilter
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39# QtWebengine needs chroot to set up its own sandbox
40seccomp !chroot
41shell none
42
43disable-mnt
44private-dev
45private-tmp
diff --git a/etc/profile-m-z/psi.profile b/etc/profile-m-z/psi.profile
new file mode 100644
index 000000000..450bb10c7
--- /dev/null
+++ b/etc/profile-m-z/psi.profile
@@ -0,0 +1,78 @@
1# Firejail profile for psi
2# Description: Native XMPP client with GPG support
3# This file is overwritten after every install/update
4# Persistent local customizations
5include psi.local
6# Persistent global definitions
7include globals.local
8
9# Add the next line to your psi.local to enable GPG support.
10#noblacklist ${HOME}/.gnupg
11noblacklist ${HOME}/.cache/psi
12noblacklist ${HOME}/.cache/Psi
13noblacklist ${HOME}/.config/psi
14noblacklist ${HOME}/.local/share/psi
15noblacklist ${HOME}/.local/share/Psi
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25# Add the next line to your psi.local to enable GPG support.
26#mkdir ${HOME}/.gnupg
27mkdir ${HOME}/.cache/psi
28mkdir ${HOME}/.cache/Psi
29mkdir ${HOME}/.config/psi
30mkdir ${HOME}/.local/share/psi
31mkdir ${HOME}/.local/share/Psi
32# Add the next line to your psi.local to enable GPG support.
33#whitelist ${HOME}/.gnupg
34whitelist ${HOME}/.cache/psi
35whitelist ${HOME}/.cache/Psi
36whitelist ${HOME}/.config/psi
37whitelist ${HOME}/.local/share/psi
38whitelist ${HOME}/.local/share/Psi
39whitelist ${DOWNLOADS}
40# Add the next lines to your psi.local to enable GPG support.
41#whitelist /usr/share/gnupg
42#whitelist /usr/share/gnupg2
43whitelist /usr/share/psi
44# Add the next lines to your psi.local to enable GPG support.
45#whitelist ${RUNUSER}/gnupg
46#whitelist ${RUNUSER}/keyring
47include whitelist-common.inc
48include whitelist-runuser-common.inc
49include whitelist-usr-share-common.inc
50include whitelist-var-common.inc
51
52apparmor
53caps.drop all
54netfilter
55nodvd
56nogroups
57noinput
58nonewprivs
59noroot
60notv
61novideo
62nou2f
63protocol unix,inet,inet6,netlink
64seccomp !chroot
65shell none
66#tracelog - breaks on Arch
67
68disable-mnt
69# Add the next line to your psi.local to enable GPG support.
70#private-bin gpg,gpg2,gpg-agent,pinentry-curses,pinentry-emacs,pinentry-fltk,pinentry-gnome3,pinentry-gtk,pinentry-gtk2,pinentry-gtk-2,pinentry-qt,pinentry-qt4,pinentry-tty,pinentry-x2go,pinentry-kwallet
71private-bin getopt,psi
72private-cache
73private-dev
74private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,gcrypt,group,hostname,hosts,ld.so.cache,ld.so.conf,machine-id,passwd,pki,pulse,resolv.conf,selinux,ssl,xdg
75private-tmp
76
77dbus-user none
78dbus-system none
diff --git a/etc/profile-m-z/pybitmessage.profile b/etc/profile-m-z/pybitmessage.profile
new file mode 100644
index 000000000..8d8729d4a
--- /dev/null
+++ b/etc/profile-m-z/pybitmessage.profile
@@ -0,0 +1,46 @@
1# Firejail profile for pybitmessage
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pybitmessage.local
5# Persistent global definitions
6include globals.local
7
8noblacklist /sbin
9noblacklist /usr/local/sbin
10noblacklist /usr/sbin
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-programs.inc
20include disable-interpreters.inc
21
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26netfilter
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6,netlink
38seccomp
39shell none
40
41disable-mnt
42private-bin bash,env,ldconfig,pybitmessage,python*,sh,stat
43private-dev
44private-etc alternatives,ca-certificates,crypto-policies,fonts,gtk-2.0,hosts,ld.so.cache,ld.so.preload,localtime,pki,pki,PyBitmessage,PyBitmessage.conf,resolv.conf,selinux,sni-qt.conf,ssl,system-fips,Trolltech.conf,xdg
45private-tmp
46
diff --git a/etc/profile-m-z/pycharm-community.profile b/etc/profile-m-z/pycharm-community.profile
new file mode 100644
index 000000000..f3d40e7f3
--- /dev/null
+++ b/etc/profile-m-z/pycharm-community.profile
@@ -0,0 +1,38 @@
1# Firejail profile for pycharm-community
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pycharm-community.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.PyCharmCE*
9
10# Allow java (blacklisted by disable-devel.inc)
11include allow-java.inc
12
13# Allows files commonly used by IDEs
14include allow-common-devel.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-programs.inc
19
20caps.drop all
21machine-id
22nodvd
23nogroups
24noinput
25nosound
26notv
27nou2f
28novideo
29shell none
30tracelog
31
32# private-etc alternatives,fonts,passwd - minimal required to run but will probably break
33# program!
34private-cache
35private-dev
36private-tmp
37
38noexec /tmp
diff --git a/etc/profile-m-z/pycharm-professional.profile b/etc/profile-m-z/pycharm-professional.profile
new file mode 100644
index 000000000..b754a18c9
--- /dev/null
+++ b/etc/profile-m-z/pycharm-professional.profile
@@ -0,0 +1,12 @@
1# Firejail profilen alias for pycharm-professional
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pyucharm-professional.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.PyCharm*
10
11# Redirect
12include pycharm-community.profile
diff --git a/etc/profile-m-z/pzstd.profile b/etc/profile-m-z/pzstd.profile
new file mode 100644
index 000000000..b0a4c6be8
--- /dev/null
+++ b/etc/profile-m-z/pzstd.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for zstd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include pzstd.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include zstd.profile
diff --git a/etc/profile-m-z/qbittorrent.profile b/etc/profile-m-z/qbittorrent.profile
new file mode 100644
index 000000000..8778ec5fb
--- /dev/null
+++ b/etc/profile-m-z/qbittorrent.profile
@@ -0,0 +1,63 @@
1# Firejail profile for qbittorrent
2# Description: BitTorrent client based on libtorrent-rasterbar with a Qt5 GUI
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qbittorrent.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/qBittorrent
10noblacklist ${HOME}/.config/qBittorrent
11noblacklist ${HOME}/.config/qBittorrentrc
12noblacklist ${HOME}/.local/share/data/qBittorrent
13
14# Allow python (blacklisted by disable-interpreters.inc)
15include allow-python2.inc
16include allow-python3.inc
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24
25mkdir ${HOME}/.cache/qBittorrent
26mkdir ${HOME}/.config/qBittorrent
27mkfile ${HOME}/.config/qBittorrentrc
28mkdir ${HOME}/.local/share/data/qBittorrent
29whitelist ${DOWNLOADS}
30whitelist ${HOME}/.cache/qBittorrent
31whitelist ${HOME}/.config/qBittorrent
32whitelist ${HOME}/.config/qBittorrentrc
33whitelist ${HOME}/.local/share/data/qBittorrent
34include whitelist-common.inc
35include whitelist-var-common.inc
36
37apparmor
38caps.drop all
39machine-id
40netfilter
41nodvd
42nogroups
43noinput
44nonewprivs
45noroot
46nosound
47notv
48nou2f
49novideo
50protocol unix,inet,inet6,netlink
51seccomp
52shell none
53
54private-bin python*,qbittorrent
55private-dev
56# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,resolv.conf,ssl,X11,xdg
57private-tmp
58
59# See https://github.com/netblue30/firejail/issues/3707 for tray-icon
60dbus-user none
61dbus-system none
62
63# memory-deny-write-execute - problems on Arch, see #1690 on GitHub repo
diff --git a/etc/profile-m-z/qcomicbook.profile b/etc/profile-m-z/qcomicbook.profile
new file mode 100644
index 000000000..4d4d3694b
--- /dev/null
+++ b/etc/profile-m-z/qcomicbook.profile
@@ -0,0 +1,67 @@
1# Firejail profile for qcomicbook
2# Description: A comic book and manga viewer in QT
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qcomicbook.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/PawelStolowski
10noblacklist ${HOME}/.config/PawelStolowski
11noblacklist ${HOME}/.local/share/PawelStolowski
12noblacklist ${DOCUMENTS}
13
14# Allow /bin/sh (blacklisted by disable-shell.inc)
15include allow-bin-sh.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-write-mnt.inc
24include disable-xdg.inc
25
26mkdir ${HOME}/.cache/PawelStolowski
27mkdir ${HOME}/.config/PawelStolowski
28mkdir ${HOME}/.local/share/PawelStolowski
29whitelist /usr/share/qcomicbook
30include whitelist-runuser-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36machine-id
37net none
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix
48seccomp
49seccomp.block-secondary
50shell none
51tracelog
52
53private-bin 7z,7zr,qcomicbook,rar,sh,tar,unace,unrar,unzip
54private-cache
55private-dev
56private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,pango,passwd,Trolltech.conf,X11,xdg
57private-tmp
58
59dbus-user none
60dbus-system none
61
62read-only ${HOME}
63read-write ${HOME}/.cache/PawelStolowski
64read-write ${HOME}/.config/PawelStolowski
65read-write ${HOME}/.local/share/PawelStolowski
66#to allow ${HOME}/.local/share/recently-used.xbel
67read-write ${HOME}/.local/share
diff --git a/etc/qemu-launcher.profile b/etc/profile-m-z/qemu-launcher.profile
index 2738e04bb..2aea715dc 100644
--- a/etc/qemu-launcher.profile
+++ b/etc/profile-m-z/qemu-launcher.profile
@@ -1,15 +1,14 @@
1# Firejail profile for qemu-launcher 1# Firejail profile for qemu-launcher
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/qemu-launcher.local 4include qemu-launcher.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ~/.qemu-launcher 8noblacklist ${HOME}/.qemu-launcher
9 9
10include /etc/firejail/disable-common.inc 10include disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc 11include disable-programs.inc
12include /etc/firejail/disable-programs.inc
13 12
14caps.drop all 13caps.drop all
15netfilter 14netfilter
@@ -23,6 +22,7 @@ seccomp
23shell none 22shell none
24tracelog 23tracelog
25 24
25private-cache
26private-tmp 26private-tmp
27 27
28noexec /tmp 28noexec /tmp
diff --git a/etc/qemu-system-x86_64.profile b/etc/profile-m-z/qemu-system-x86_64.profile
index 7a60007fe..2333e07d9 100644
--- a/etc/qemu-system-x86_64.profile
+++ b/etc/profile-m-z/qemu-system-x86_64.profile
@@ -1,14 +1,13 @@
1# Firejail profile for qemu-system-x86_64 1# Firejail profile for qemu-system-x86_64
2# Description: QEMU system emulator for x86_64
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/qemu-system-x86_64.local 5include qemu-system-x86_64.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8 9include disable-common.inc
9include /etc/firejail/disable-common.inc 10include disable-programs.inc
10include /etc/firejail/disable-passwdmgr.inc
11include /etc/firejail/disable-programs.inc
12 11
13caps.drop all 12caps.drop all
14netfilter 13netfilter
@@ -22,6 +21,7 @@ seccomp
22shell none 21shell none
23tracelog 22tracelog
24 23
24private-cache
25private-tmp 25private-tmp
26 26
27noexec /tmp 27noexec /tmp
diff --git a/etc/profile-m-z/qgis.profile b/etc/profile-m-z/qgis.profile
new file mode 100644
index 000000000..3dc232b55
--- /dev/null
+++ b/etc/profile-m-z/qgis.profile
@@ -0,0 +1,59 @@
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/QGIS
10noblacklist ${HOME}/.local/share/QGIS
11noblacklist ${HOME}/.qgis2
12noblacklist ${DOCUMENTS}
13
14# Allow python (blacklisted by disable-interpreters.inc)
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.local/share/QGIS
25mkdir ${HOME}/.qgis2
26mkdir ${HOME}/.config/QGIS
27whitelist ${HOME}/.local/share/QGIS
28whitelist ${HOME}/.qgis2
29whitelist ${HOME}/.config/QGIS
30whitelist ${DOCUMENTS}
31include whitelist-common.inc
32include whitelist-var-common.inc
33
34caps.drop all
35netfilter
36machine-id
37nodvd
38nogroups
39noinput
40nonewprivs
41noroot
42nosound
43notv
44nou2f
45novideo
46# blacklisting of mbind system calls breaks old version
47seccomp !mbind
48protocol unix,inet,inet6,netlink
49shell none
50tracelog
51
52disable-mnt
53private-cache
54private-dev
55private-etc alternatives,ca-certificates,crypto-policies,fonts,machine-id,pki,QGIS,QGIS.conf,resolv.conf,ssl,Trolltech.conf
56private-tmp
57
58dbus-user none
59dbus-system none
diff --git a/etc/qlipper.profile b/etc/profile-m-z/qlipper.profile
index 796015654..7176d8a39 100644
--- a/etc/qlipper.profile
+++ b/etc/profile-m-z/qlipper.profile
@@ -1,34 +1,38 @@
1# Firejail profile for qlipper 1# Firejail profile for qlipper
2# Description: Lightweight and cross-platform clipboard history applet
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/qlipper.local 5include qlipper.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/Qlipper 9noblacklist ${HOME}/.config/Qlipper
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-exec.inc
13include /etc/firejail/disable-programs.inc 14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
14 17
15caps.drop all 18caps.drop all
16netfilter 19netfilter
17no3d 20no3d
18nodvd 21nodvd
19nogroups 22nogroups
23noinput
20nonewprivs 24nonewprivs
21noroot 25noroot
22nosound 26nosound
23notv 27notv
28nou2f
24novideo 29novideo
25protocol unix 30protocol unix
26seccomp 31seccomp
27shell none 32shell none
28 33
29disable-mnt 34disable-mnt
35private-cache
30private-dev 36private-dev
31private-tmp 37private-tmp
32 38
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/profile-m-z/qmmp.profile b/etc/profile-m-z/qmmp.profile
new file mode 100644
index 000000000..af85c95e7
--- /dev/null
+++ b/etc/profile-m-z/qmmp.profile
@@ -0,0 +1,39 @@
1# Firejail profile for qmmp
2# Description: Feature-rich audio player with support of many formats
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qmmp.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.qmmp
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19caps.drop all
20netfilter
21# no3d
22nogroups
23noinput
24nonewprivs
25noroot
26notv
27nou2f
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32tracelog
33
34private-bin bzip2,gzip,qmmp,tar,unzip
35private-dev
36private-tmp
37
38dbus-user none
39dbus-system none
diff --git a/etc/profile-m-z/qnapi.profile b/etc/profile-m-z/qnapi.profile
new file mode 100644
index 000000000..4eee0df5f
--- /dev/null
+++ b/etc/profile-m-z/qnapi.profile
@@ -0,0 +1,55 @@
1# Firejail profile for qnapi
2# Description: Qt client for downloading movie subtitles from NapiProjekt, OpenSubtitles and Napisy24
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qnapi.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/qnapi.ini
10
11ignore noexec /tmp
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkfile ${HOME}/.config/qnapi.ini
22whitelist ${HOME}/.config/qnapi.ini
23whitelist ${DOWNLOADS}
24include whitelist-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-runuser-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix,inet,inet6,netlink
43seccomp
44shell none
45tracelog
46
47private-bin 7z,qnapi
48private-cache
49private-dev
50private-etc alternatives,fonts
51private-opt none
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-m-z/qpdfview.profile b/etc/profile-m-z/qpdfview.profile
new file mode 100644
index 000000000..3ad8a19c8
--- /dev/null
+++ b/etc/profile-m-z/qpdfview.profile
@@ -0,0 +1,46 @@
1# Firejail profile for qpdfview
2# Description: Tabbed document viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qpdfview.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/qpdfview
10noblacklist ${HOME}/.local/share/qpdfview
11noblacklist ${DOCUMENTS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40private-bin qpdfview
41private-dev
42private-tmp
43
44# needs D-Bus when started from a file manager
45# dbus-user none
46# dbus-system none
diff --git a/etc/profile-m-z/qrencode.profile b/etc/profile-m-z/qrencode.profile
new file mode 100644
index 000000000..7ef676068
--- /dev/null
+++ b/etc/profile-m-z/qrencode.profile
@@ -0,0 +1,57 @@
1# Firejail profile for qrencode
2# Description: Encode input data in a QR Code and save as a PNG or EPS image.
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include qrencode.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-write-mnt.inc
19include disable-xdg.inc
20
21include whitelist-runuser-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27ipc-namespace
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42shell none
43tracelog
44x11 none
45
46disable-mnt
47private-bin qrencode
48private-cache
49private-dev
50private-etc none
51private-lib libpcre*
52private-tmp
53
54dbus-user none
55dbus-system none
56
57memory-deny-write-execute
diff --git a/etc/profile-m-z/qt-faststart.profile b/etc/profile-m-z/qt-faststart.profile
new file mode 100644
index 000000000..2cdff33a6
--- /dev/null
+++ b/etc/profile-m-z/qt-faststart.profile
@@ -0,0 +1,14 @@
1# Firejail profile for qt-faststart
2# Description: FFmpeg-based media utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include qt-faststart.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11private-bin qt-faststart
12
13# Redirect
14include ffmpeg.profile
diff --git a/etc/profile-m-z/qtox.profile b/etc/profile-m-z/qtox.profile
new file mode 100644
index 000000000..bae802cc6
--- /dev/null
+++ b/etc/profile-m-z/qtox.profile
@@ -0,0 +1,52 @@
1# Firejail profile for qtox
2# Description: Powerful Tox client written in C++/Qt that follows the Tox design guidelines
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qtox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Tox
10noblacklist ${HOME}/.config/tox
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/tox
21whitelist ${DOWNLOADS}
22whitelist ${HOME}/.config/tox
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37protocol unix,inet,inet6
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin qtox
44private-cache
45private-dev
46private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,localtime,machine-id,pki,pulse,resolv.conf,ssl
47private-tmp
48
49dbus-user none
50dbus-system none
51
52#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-m-z/quadrapassel.profile b/etc/profile-m-z/quadrapassel.profile
new file mode 100644
index 000000000..91e0d9d0d
--- /dev/null
+++ b/etc/profile-m-z/quadrapassel.profile
@@ -0,0 +1,20 @@
1# Firejail profile for quadrapassel
2# Description: Tetris-like game for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include quadrapassel.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/quadrapassel
10
11mkdir ${HOME}/.local/share/quadrapassel
12whitelist ${HOME}/.local/share/quadrapassel
13whitelist /usr/share/quadrapassel
14
15private-bin quadrapassel
16
17dbus-user.own org.gnome.Quadrapassel
18
19# Redirect
20include gnome_games-common.profile
diff --git a/etc/profile-m-z/quassel.profile b/etc/profile-m-z/quassel.profile
new file mode 100644
index 000000000..c65089e20
--- /dev/null
+++ b/etc/profile-m-z/quassel.profile
@@ -0,0 +1,26 @@
1# Firejail profile for quassel
2# Description: Distributed IRC client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include quassel.local
6# Persistent global definitions
7include globals.local
8
9
10include disable-common.inc
11include disable-devel.inc
12include disable-interpreters.inc
13include disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nonewprivs
19noroot
20notv
21protocol unix,inet,inet6
22# QtWebengine needs chroot to set up its own sandbox
23seccomp !chroot
24
25private-cache
26private-tmp
diff --git a/etc/profile-m-z/quaternion.profile b/etc/profile-m-z/quaternion.profile
new file mode 100644
index 000000000..dfb46ddae
--- /dev/null
+++ b/etc/profile-m-z/quaternion.profile
@@ -0,0 +1,54 @@
1# Firejail profile for quaternion
2# Description: Desktop client for Matrix
3# This file is overwritten after every install/update
4# Persistent local customizations
5include quaternion.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Quotient/quaternion
10noblacklist ${HOME}/.config/Quotient
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.cache/Quotient/quaternion
21mkdir ${HOME}/.config/Quotient
22whitelist ${HOME}/.cache/Quotient/quaternion
23whitelist ${HOME}/.config/Quotient
24whitelist ${DOWNLOADS}
25whitelist /usr/share/Quotient/quaternion
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33netfilter
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41protocol unix,inet,inet6,netlink
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private-bin quaternion
48private-cache
49private-dev
50private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
51private-tmp
52
53dbus-user none
54dbus-system none
diff --git a/etc/quiterss.profile b/etc/profile-m-z/quiterss.profile
index f820b590e..8f89931c7 100644
--- a/etc/quiterss.profile
+++ b/etc/profile-m-z/quiterss.profile
@@ -1,40 +1,47 @@
1# Firejail profile for quiterss 1# Firejail profile for quiterss
2# Description: RSS/Atom news feeds reader
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/quiterss.local 5include quiterss.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.cache/QuiteRss 9noblacklist ${HOME}/.cache/QuiteRss
9noblacklist ${HOME}/.config/QuiteRss 10noblacklist ${HOME}/.config/QuiteRss
10noblacklist ${HOME}/.config/QuiteRssrc 11noblacklist ${HOME}/.config/QuiteRssrc
11noblacklist ${HOME}/.local/share/QuiteRss 12noblacklist ${HOME}/.local/share/QuiteRss
12 13
13include /etc/firejail/disable-common.inc 14include disable-common.inc
14include /etc/firejail/disable-devel.inc 15include disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc 16include disable-exec.inc
16include /etc/firejail/disable-programs.inc 17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
17 20
18mkdir ~/.cache/QuiteRss 21mkdir ${HOME}/.cache/QuiteRss
19mkdir ~/.config/QuiteRss 22mkdir ${HOME}/.config/QuiteRss
20mkdir ~/.local/share/data 23mkdir ${HOME}/.local/share/data
21mkdir ~/.local/share/data/QuiteRss 24mkdir ${HOME}/.local/share/data/QuiteRss
25mkdir ${HOME}/.local/share/QuiteRss
26mkfile ${HOME}/quiterssfeeds.opml
22whitelist ${HOME}/.cache/QuiteRss 27whitelist ${HOME}/.cache/QuiteRss
23whitelist ${HOME}/.config/QuiteRss/ 28whitelist ${HOME}/.config/QuiteRss
24whitelist ${HOME}/.config/QuiteRssrc 29whitelist ${HOME}/.config/QuiteRssrc
25whitelist ${HOME}/.local/share/data/QuiteRss 30whitelist ${HOME}/.local/share/data/QuiteRss
26whitelist ${HOME}/.local/share/QuiteRss 31whitelist ${HOME}/.local/share/QuiteRss
27whitelist ${HOME}/quiterssfeeds.opml 32whitelist ${HOME}/quiterssfeeds.opml
28include /etc/firejail/whitelist-common.inc 33include whitelist-common.inc
29 34
30caps.drop all 35caps.drop all
31netfilter 36netfilter
32nodvd 37nodvd
33nogroups 38nogroups
39noinput
34nonewprivs 40nonewprivs
35noroot 41noroot
36nosound 42nosound
37notv 43notv
44nou2f
38novideo 45novideo
39protocol unix,inet,inet6 46protocol unix,inet,inet6
40seccomp 47seccomp
@@ -44,7 +51,5 @@ tracelog
44disable-mnt 51disable-mnt
45private-bin quiterss 52private-bin quiterss
46private-dev 53private-dev
47# private-etc X11,ssl 54# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl,X11
48 55
49noexec ${HOME}
50noexec /tmp
diff --git a/etc/profile-m-z/quodlibet.profile b/etc/profile-m-z/quodlibet.profile
new file mode 100644
index 000000000..bc435653d
--- /dev/null
+++ b/etc/profile-m-z/quodlibet.profile
@@ -0,0 +1,66 @@
1# Firejail profile for quodlibet
2# Description: Music player and music library manager
3# This file is overwritten after every install/update
4# Persistent local customizations
5include quodlibet.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/quodlibet
10noblacklist ${HOME}/.config/quodlibet
11noblacklist ${HOME}/.quodlibet
12noblacklist ${MUSIC}
13
14include allow-bin-sh.inc
15
16# Allow python (blacklisted by disable-interpreters.inc)
17include allow-python2.inc
18include allow-python3.inc
19
20include disable-common.inc
21include disable-devel.inc
22include disable-exec.inc
23include disable-interpreters.inc
24include disable-programs.inc
25include disable-shell.inc
26include disable-xdg.inc
27
28mkdir ${HOME}/.cache/quodlibet
29mkdir ${HOME}/.config/quodlibet
30mkdir ${HOME}/.quodlibet
31
32whitelist ${HOME}/.cache/quodlibet
33whitelist ${HOME}/.config/quodlibet
34whitelist ${HOME}/.quodlibet
35whitelist ${DOWNLOADS}
36whitelist ${MUSIC}
37include whitelist-common.inc
38include whitelist-runuser-common.inc
39include whitelist-usr-share-common.inc
40include whitelist-var-common.inc
41
42apparmor
43caps.drop all
44netfilter
45no3d
46nodvd
47nogroups
48noinput
49nonewprivs
50noroot
51notv
52nou2f
53novideo
54protocol unix,inet,inet6
55seccomp
56seccomp.block-secondary
57shell none
58tracelog
59
60private-bin exfalso,operon,python*,quodlibet,sh
61private-cache
62private-dev
63private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,passwd,pki,pulse,resolv.conf,ssl
64private-tmp
65
66dbus-system none
diff --git a/etc/profile-m-z/qupzilla.profile b/etc/profile-m-z/qupzilla.profile
new file mode 100644
index 000000000..c29d87a73
--- /dev/null
+++ b/etc/profile-m-z/qupzilla.profile
@@ -0,0 +1,24 @@
1# Firejail profile for qupzilla
2# This file is overwritten after every install/update
3# Persistent local customizations
4include qupzilla.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.cache/qupzilla
10noblacklist ${HOME}/.config/qupzilla
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18mkdir ${HOME}/.cache/qupzilla
19mkdir ${HOME}/.config/qupzilla
20whitelist ${HOME}/.cache/qupzilla
21whitelist ${HOME}/.config/qupzilla
22
23# Redirect
24include falkon.profile
diff --git a/etc/profile-m-z/qutebrowser.profile b/etc/profile-m-z/qutebrowser.profile
new file mode 100644
index 000000000..fc910b589
--- /dev/null
+++ b/etc/profile-m-z/qutebrowser.profile
@@ -0,0 +1,40 @@
1# Firejail profile for qutebrowser
2# Description: Keyboard-driven, vim-like browser based on PyQt5
3# This file is overwritten after every install/update
4# Persistent local customizations
5include qutebrowser.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/qutebrowser
10noblacklist ${HOME}/.config/qutebrowser
11noblacklist ${HOME}/.local/share/qutebrowser
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22mkdir ${HOME}/.cache/qutebrowser
23mkdir ${HOME}/.config/qutebrowser
24mkdir ${HOME}/.local/share/qutebrowser
25whitelist ${DOWNLOADS}
26whitelist ${HOME}/.cache/qutebrowser
27whitelist ${HOME}/.config/qutebrowser
28whitelist ${HOME}/.local/share/qutebrowser
29include whitelist-common.inc
30
31caps.drop all
32netfilter
33nodvd
34nonewprivs
35noroot
36notv
37protocol unix,inet,inet6,netlink
38# blacklisting of chroot system calls breaks qt webengine
39seccomp !chroot,!name_to_handle_at
40# tracelog
diff --git a/etc/profile-m-z/rambox.profile b/etc/profile-m-z/rambox.profile
new file mode 100644
index 000000000..ffa2022ee
--- /dev/null
+++ b/etc/profile-m-z/rambox.profile
@@ -0,0 +1,38 @@
1# Firejail profile for rambox
2# Description: Free and Open Source messaging and emailing app that combines common web applications into one (Electron-based)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include rambox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Rambox
10noblacklist ${HOME}/.pki
11noblacklist ${HOME}/.local/share/pki
12
13include disable-common.inc
14include disable-devel.inc
15include disable-interpreters.inc
16include disable-programs.inc
17
18mkdir ${HOME}/.config/Rambox
19mkdir ${HOME}/.pki
20mkdir ${HOME}/.local/share/pki
21whitelist ${DOWNLOADS}
22whitelist ${HOME}/.config/Rambox
23whitelist ${HOME}/.pki
24whitelist ${HOME}/.local/share/pki
25include whitelist-common.inc
26
27caps.drop all
28netfilter
29nodvd
30nogroups
31nonewprivs
32noroot
33notv
34protocol unix,inet,inet6,netlink
35# electron-based application, needing chroot
36#seccomp
37seccomp !chroot
38# tracelog
diff --git a/etc/profile-m-z/ranger.profile b/etc/profile-m-z/ranger.profile
new file mode 100644
index 000000000..8b3fe97d8
--- /dev/null
+++ b/etc/profile-m-z/ranger.profile
@@ -0,0 +1,12 @@
1# Firejail profile for ranger
2# Description: File manager with an ncurses frontend written in Python
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ranger.local
6# Persistent global definitions
7include globals.local
8
9# Put 'ignore noroot' in your ranger.local if you use MPV+Vulkan (see issue #3012)
10
11# Redirect
12include file-manager-common.profile
diff --git a/etc/profile-m-z/redeclipse.profile b/etc/profile-m-z/redeclipse.profile
new file mode 100644
index 000000000..436b98f29
--- /dev/null
+++ b/etc/profile-m-z/redeclipse.profile
@@ -0,0 +1,48 @@
1# Firejail profile for redeclipse
2# Description: Free, casual arena shooter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include redeclipse.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.redeclipse
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.redeclipse
19whitelist ${HOME}/.redeclipse
20whitelist /usr/share/redeclipse
21include whitelist-common.inc
22include whitelist-runuser-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6
37seccomp
38shell none
39tracelog
40
41disable-mnt
42#private-bin redeclipse,sh,man
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-m-z/rednotebook.profile b/etc/profile-m-z/rednotebook.profile
new file mode 100644
index 000000000..d1dd365ab
--- /dev/null
+++ b/etc/profile-m-z/rednotebook.profile
@@ -0,0 +1,66 @@
1# Firejail profile for rednotebook
2# Description: Daily journal with calendar, templates and keyword searching
3# This file is overwritten after every install/update
4# Persistent local customizations
5include rednotebook.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/rednotebook
10noblacklist ${HOME}/.rednotebook
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21
22mkdir ${HOME}/.cache/rednotebook
23mkdir ${HOME}/.rednotebook
24whitelist ${HOME}/.cache/rednotebook
25whitelist ${HOME}/.rednotebook
26whitelist ${DESKTOP}
27whitelist ${DOCUMENTS}
28whitelist ${DOWNLOADS}
29whitelist ${MUSIC}
30whitelist ${PICTURES}
31whitelist ${VIDEOS}
32whitelist /usr/libexec/webkit2gtk-4.0
33include whitelist-common.inc
34include whitelist-runuser-common.inc
35include whitelist-usr-share-common.inc
36include whitelist-var-common.inc
37
38apparmor
39caps.drop all
40machine-id
41net none
42no3d
43nodvd
44nogroups
45noinput
46nonewprivs
47noroot
48nosound
49notv
50nou2f
51novideo
52protocol unix
53seccomp
54seccomp.block-secondary
55shell none
56tracelog
57
58disable-mnt
59private-bin python3*,rednotebook
60private-cache
61private-dev
62private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,pango,X11
63private-tmp
64
65dbus-user none
66dbus-system none
diff --git a/etc/profile-m-z/redshift.profile b/etc/profile-m-z/redshift.profile
new file mode 100644
index 000000000..06ae67ae1
--- /dev/null
+++ b/etc/profile-m-z/redshift.profile
@@ -0,0 +1,53 @@
1# Firejail profile for redshift
2# Description: Adjusts the color temperature of your screen according to your surroundings
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include redshift.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.config/redshift
11noblacklist ${HOME}/.config/redshift.conf
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/redshift
21whitelist ${HOME}/.config/redshift
22whitelist ${HOME}/.config/redshift.conf
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27ipc-namespace
28machine-id
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-cache
47private-dev
48private-tmp
49
50dbus-user none
51dbus-system none
52
53memory-deny-write-execute
diff --git a/etc/profile-m-z/regextester.profile b/etc/profile-m-z/regextester.profile
new file mode 100644
index 000000000..1de59bc7c
--- /dev/null
+++ b/etc/profile-m-z/regextester.profile
@@ -0,0 +1,55 @@
1# Firejail profile for regextester
2# Description: A simple regex tester built for Pantheon Shell
3# This file is overwritten after every install/update
4# Persistent local customizations
5include regextester.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/com.github.artemanufrij.regextester
18include whitelist-common.inc
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24ipc-namespace
25machine-id
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin regextester
44private-cache
45private-dev
46private-etc alternatives,fonts
47private-lib libgranite.so.*
48private-tmp
49
50dbus-user filter
51dbus-user.talk ca.desrt.dconf
52dbus-system none
53
54# never write anything
55read-only ${HOME}
diff --git a/etc/profile-m-z/remmina.profile b/etc/profile-m-z/remmina.profile
new file mode 100644
index 000000000..16da40daf
--- /dev/null
+++ b/etc/profile-m-z/remmina.profile
@@ -0,0 +1,42 @@
1# Firejail profile for remmina
2# Description: GTK+ Remote Desktop Client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include remmina.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.remmina
10noblacklist ${HOME}/.config/remmina
11noblacklist ${HOME}/.local/share/remmina
12
13# Allow ssh (blacklisted by disable-common.inc)
14include allow-ssh.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-runuser-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38
39private-cache
40private-dev
41private-tmp
42
diff --git a/etc/profile-m-z/rhythmbox-client.profile b/etc/profile-m-z/rhythmbox-client.profile
new file mode 100644
index 000000000..29e65d716
--- /dev/null
+++ b/etc/profile-m-z/rhythmbox-client.profile
@@ -0,0 +1,11 @@
1# Firejail profile for rhythmbox-client
2# Description: controls a running instance of rhythmbox
3# This file is overwritten after every install/update
4# Persistent local customizations
5include rhythmbox-client.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include rhythmbox.profile
diff --git a/etc/profile-m-z/rhythmbox.profile b/etc/profile-m-z/rhythmbox.profile
new file mode 100644
index 000000000..26b62e456
--- /dev/null
+++ b/etc/profile-m-z/rhythmbox.profile
@@ -0,0 +1,66 @@
1# Firejail profile for rhythmbox
2# Description: Music player and organizer for GNOME
3# This file is overwritten after every install/update
4# Persistent local customizations
5include rhythmbox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${MUSIC}
10noblacklist ${HOME}/.cache/rhythmbox
11noblacklist ${HOME}/.local/share/rhythmbox
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17# Allow lua (blacklisted by disable-interpreters.inc)
18include allow-lua.inc
19
20include disable-common.inc
21include disable-devel.inc
22include disable-exec.inc
23include disable-interpreters.inc
24include disable-programs.inc
25include disable-shell.inc
26include disable-xdg.inc
27
28whitelist /usr/share/rhythmbox
29whitelist /usr/share/lua
30whitelist /usr/share/libquvi-scripts
31whitelist /usr/share/tracker
32include whitelist-runuser-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38netfilter
39nogroups
40noinput
41nonewprivs
42noroot
43notv
44nou2f
45novideo
46protocol unix,inet,inet6,netlink
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52private-bin rhythmbox,rhythmbox-client
53private-cache
54private-dev
55private-tmp
56
57dbus-user filter
58dbus-user.own org.gnome.Rhythmbox3
59dbus-user.own org.mpris.MediaPlayer2.rhythmbox
60dbus-user.own org.gnome.UPnP.MediaServer2.Rhythmbox
61dbus-user.talk ca.desrt.dconf
62dbus-user.talk org.gtk.vfs.*
63dbus-user.talk org.freedesktop.Notifications
64dbus-user.talk org.gnome.SettingsDaemon.MediaKeys
65dbus-system filter
66dbus-system.talk org.freedesktop.Avahi
diff --git a/etc/ricochet.profile b/etc/profile-m-z/ricochet.profile
index 6da0e21d5..705ca0045 100644
--- a/etc/ricochet.profile
+++ b/etc/profile-m-z/ricochet.profile
@@ -1,21 +1,23 @@
1# Firejail profile for ricochet 1# Firejail profile for ricochet
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/ricochet.local 4include ricochet.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7
8 7
9noblacklist ${HOME}/.local/share/Ricochet 8noblacklist ${HOME}/.local/share/Ricochet
10 9
11include /etc/firejail/disable-common.inc 10include disable-common.inc
12include /etc/firejail/disable-devel.inc 11include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 12include disable-exec.inc
14include /etc/firejail/disable-programs.inc 13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
15 16
17mkdir ${HOME}/.local/share/Ricochet
16whitelist ${DOWNLOADS} 18whitelist ${DOWNLOADS}
17whitelist ${HOME}/.local/share/Ricochet 19whitelist ${HOME}/.local/share/Ricochet
18include /etc/firejail/whitelist-common.inc 20include whitelist-common.inc
19 21
20caps.drop all 22caps.drop all
21ipc-namespace 23ipc-namespace
@@ -23,9 +25,11 @@ netfilter
23no3d 25no3d
24nodvd 26nodvd
25nogroups 27nogroups
28noinput
26nonewprivs 29nonewprivs
27noroot 30noroot
28notv 31notv
32nou2f
29novideo 33novideo
30protocol unix,inet,inet6 34protocol unix,inet,inet6
31seccomp 35seccomp
@@ -34,7 +38,5 @@ shell none
34disable-mnt 38disable-mnt
35private-bin ricochet,tor 39private-bin ricochet,tor
36private-dev 40private-dev
37#private-etc fonts,tor,X11,alternatives 41#private-etc alternatives,alternatives,ca-certificates,crypto-policies,fonts,pki,ssl,tor,X11
38 42
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/profile-m-z/riot-desktop.profile b/etc/profile-m-z/riot-desktop.profile
new file mode 100644
index 000000000..e91d25196
--- /dev/null
+++ b/etc/profile-m-z/riot-desktop.profile
@@ -0,0 +1,11 @@
1# Firejail profile for riot-desktop
2# Description: A glossy Matrix collaboration client for the desktop
3# This file is overwritten after every install/update
4# Persistent local customizations
5include riot-desktop.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include riot-web.profile
diff --git a/etc/riot-web.profile b/etc/profile-m-z/riot-web.profile
index 06dbbe9d9..687c943b0 100644
--- a/etc/riot-web.profile
+++ b/etc/profile-m-z/riot-web.profile
@@ -1,14 +1,18 @@
1# Firejail profile for riot-web 1# Firejail profile for riot-web
2# Description: A glossy Matrix collaboration client for the web
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/riot-web.local 5include riot-web.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
8
9ignore noexec /tmp
7 10
8noblacklist ${HOME}/.config/Riot 11noblacklist ${HOME}/.config/Riot
9 12
13mkdir ${HOME}/.config/Riot
10whitelist ${HOME}/.config/Riot 14whitelist ${HOME}/.config/Riot
11include /etc/firejail/whitelist-common.inc 15whitelist /usr/share/webapps/element
12 16
13# Redirect 17# Redirect
14include /etc/firejail/electron.profile 18include electron.profile
diff --git a/etc/profile-m-z/ripperx.profile b/etc/profile-m-z/ripperx.profile
new file mode 100644
index 000000000..81aef5a65
--- /dev/null
+++ b/etc/profile-m-z/ripperx.profile
@@ -0,0 +1,43 @@
1# Firejail profile for mpv
2# Description: Graphical audio CD ripper and encoder
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ripperx.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.ripperXrc
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24netfilter
25no3d
26nogroups
27noinput
28nonewprivs
29noroot
30nou2f
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36tracelog
37
38private-cache
39private-dev
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/profile-m-z/ristretto.profile b/etc/profile-m-z/ristretto.profile
new file mode 100644
index 000000000..79f090d95
--- /dev/null
+++ b/etc/profile-m-z/ristretto.profile
@@ -0,0 +1,42 @@
1# Firejail profile for ristretto
2# Description: Lightweight picture-viewer for the Xfce desktop environment
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ristretto.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/ristretto
10noblacklist ${HOME}/.Steam
11noblacklist ${HOME}/.steam
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19include whitelist-var-common.inc
20
21apparmor
22caps.drop all
23net none
24netfilter
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38
39private-cache
40private-dev
41private-tmp
42
diff --git a/etc/profile-m-z/rnano.profile b/etc/profile-m-z/rnano.profile
new file mode 100644
index 000000000..d9048982a
--- /dev/null
+++ b/etc/profile-m-z/rnano.profile
@@ -0,0 +1,12 @@
1# Firejail profile for rnano
2# Description: A restricted nano
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include rnano.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include nano.profile
diff --git a/etc/profile-m-z/rocketchat.profile b/etc/profile-m-z/rocketchat.profile
new file mode 100644
index 000000000..8d3607c75
--- /dev/null
+++ b/etc/profile-m-z/rocketchat.profile
@@ -0,0 +1,30 @@
1# Firejail profile for rocketchat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include rocketchat.local
5# Persistent global definitions
6include globals.local
7
8# Disabled until someone reported positive feedback
9ignore include disable-devel.inc
10ignore include disable-exec.inc
11ignore include disable-interpreters.inc
12ignore include disable-xdg.inc
13ignore include whitelist-runuser-common.inc
14ignore include whitelist-usr-share-common.inc
15ignore include whitelist-var-common.inc
16ignore nou2f
17ignore novideo
18ignore shell none
19ignore disable-mnt
20ignore private-cache
21ignore private-dev
22ignore private-tmp
23
24noblacklist ${HOME}/.config/Rocket.Chat
25
26mkdir ${HOME}/.config/Rocket.Chat
27whitelist ${HOME}/.config/Rocket.Chat
28
29# Redirect
30include electron.profile
diff --git a/etc/profile-m-z/rsync-download_only.profile b/etc/profile-m-z/rsync-download_only.profile
new file mode 100644
index 000000000..23a65f54a
--- /dev/null
+++ b/etc/profile-m-z/rsync-download_only.profile
@@ -0,0 +1,58 @@
1# Firejail profile for rsync
2# Description: a fast, versatile, remote (and local) file-copying tool
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include rsync.local
7# Persistent global definitions
8include globals.local
9
10# WARNING: this profile is designed to use rsync as a client for downloading,
11# not as a daemon (rsync --daemon) nor to create backups.
12# Usage: firejail --profile=rsync-download_only rsync
13
14blacklist /tmp/.X11-unix
15blacklist ${RUNUSER}
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23include disable-xdg.inc
24
25# Add the next line to your rsync-download_only.local to enable extra hardening.
26#whitelist ${DOWNLOADS}
27include whitelist-var-common.inc
28
29caps.drop all
30ipc-namespace
31machine-id
32netfilter
33no3d
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39nosound
40notv
41nou2f
42novideo
43protocol unix,inet,inet6
44seccomp
45shell none
46tracelog
47
48disable-mnt
49private-bin rsync
50private-cache
51private-dev
52private-etc alternatives,ca-certificates,crypto-policies,host.conf,hostname,hosts,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl
53private-tmp
54
55dbus-user none
56dbus-system none
57
58memory-deny-write-execute
diff --git a/etc/profile-m-z/rtin.profile b/etc/profile-m-z/rtin.profile
new file mode 100644
index 000000000..cd84ce05e
--- /dev/null
+++ b/etc/profile-m-z/rtin.profile
@@ -0,0 +1,8 @@
1# Firejail profile for rtin
2# Description: ncurses-based Usenet newsreader
3# symlink to tin, same as `tin -r`
4# This file is overwritten after every install/update
5# Persistent local customizations
6include rtin.local
7
8include tin.profile
diff --git a/etc/rtorrent.profile b/etc/profile-m-z/rtorrent.profile
index c18a1b06c..757624938 100644
--- a/etc/rtorrent.profile
+++ b/etc/profile-m-z/rtorrent.profile
@@ -1,28 +1,34 @@
1# Firejail profile for rtorrent 1# Firejail profile for rtorrent
2# Description: Ncurses BitTorrent client based on LibTorrent from rakshasa
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/rtorrent.local 5include rtorrent.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8 9
9include /etc/firejail/disable-common.inc 10include disable-common.inc
10include /etc/firejail/disable-devel.inc 11include disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc 12include disable-interpreters.inc
12include /etc/firejail/disable-programs.inc 13include disable-programs.inc
14include disable-shell.inc
13 15
14caps.drop all 16caps.drop all
17machine-id
15netfilter 18netfilter
16nodvd 19nodvd
20noinput
17nonewprivs 21nonewprivs
18noroot 22noroot
19nosound 23nosound
20notv 24notv
25nou2f
21novideo 26novideo
22protocol unix,inet,inet6 27protocol unix,inet,inet6
23seccomp 28seccomp
24shell none 29shell none
25 30
26private-bin rtorrent 31private-bin rtorrent
32private-cache
27private-dev 33private-dev
28private-tmp 34private-tmp
diff --git a/etc/profile-m-z/rtv-addons.profile b/etc/profile-m-z/rtv-addons.profile
new file mode 100644
index 000000000..cc6db5043
--- /dev/null
+++ b/etc/profile-m-z/rtv-addons.profile
@@ -0,0 +1,28 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include rtv-addons.local
4# You can configure rtv to open different type of links
5# in external applications. Configuration here:
6# https://github.com/michael-lazar/rtv#viewing-media-links
7# This include is meant to facilitate that configuration
8# with the use of a .local file.
9
10ignore nosound
11ignore private-bin
12ignore dbus-user none
13
14noblacklist ${HOME}/.config/mpv
15noblacklist ${HOME}/.mailcap
16noblacklist ${HOME}/.netrc
17noblacklist ${HOME}/.w3m
18
19whitelist ${HOME}/.cache/youtube-dl/youtube-sigfuncs
20whitelist ${HOME}/.config/mpv
21whitelist ${HOME}/.mailcap
22whitelist ${HOME}/.netrc
23whitelist ${HOME}/.w3m
24
25#private-bin w3m,mpv,youtube-dl
26
27# tells rtv, which browser to use
28#env RTV_BROWSER=w3m
diff --git a/etc/profile-m-z/rtv.profile b/etc/profile-m-z/rtv.profile
new file mode 100644
index 000000000..03d812270
--- /dev/null
+++ b/etc/profile-m-z/rtv.profile
@@ -0,0 +1,65 @@
1# Firejail profile for rtv
2# Description: Browse Reddit from your terminal
3# This file is overwritten after every install/update
4# Persistent local customizations
5include rtv.local
6# Persistent global definitions
7include globals.local
8
9blacklist /tmp/.X11-unix
10blacklist ${RUNUSER}/wayland-*
11
12noblacklist ${HOME}/.config/rtv
13noblacklist ${HOME}/.local/share/rtv
14
15# Allow /bin/sh (blacklisted by disable-shell.inc)
16include allow-bin-sh.inc
17
18# Allow python (blacklisted by disable-interpreters.inc)
19include allow-python2.inc
20include allow-python3.inc
21
22# You can configure rtv to open different type of links in external applications.
23# Configuration: https://github.com/michael-lazar/rtv#viewing-media-links.
24# Add the next line to your rtv.local to enable external application support.
25#include rtv-addons.profile
26include disable-common.inc
27include disable-devel.inc
28include disable-exec.inc
29include disable-interpreters.inc
30include disable-programs.inc
31include disable-xdg.inc
32
33mkdir ${HOME}/.config/rtv
34mkdir ${HOME}/.local/share/rtv
35whitelist ${HOME}/.config/rtv
36whitelist ${HOME}/.local/share/rtv
37include whitelist-var-common.inc
38
39apparmor
40caps.drop all
41machine-id
42netfilter
43no3d
44nodvd
45nogroups
46noinput
47nonewprivs
48noroot
49nosound
50notv
51nou2f
52novideo
53protocol unix,inet,inet6
54seccomp
55shell none
56tracelog
57
58disable-mnt
59private-bin less,python*,rtv,sh,xdg-settings
60private-cache
61private-dev
62private-etc alternatives,ca-certificates,crypto-policies,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mailcap,mime.types,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl,terminfo,xdg
63
64dbus-user none
65dbus-system none
diff --git a/etc/profile-m-z/runenpass.sh.profile b/etc/profile-m-z/runenpass.sh.profile
new file mode 100644
index 000000000..304bda87b
--- /dev/null
+++ b/etc/profile-m-z/runenpass.sh.profile
@@ -0,0 +1,10 @@
1# Firejail alias profile for enpass
2# This file is overwritten after every install/update
3# Persistent local customizations
4include runenpass.sh.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include enpass.profile
diff --git a/etc/profile-m-z/rview.profile b/etc/profile-m-z/rview.profile
new file mode 100644
index 000000000..fb72a00de
--- /dev/null
+++ b/etc/profile-m-z/rview.profile
@@ -0,0 +1,10 @@
1# Firejail profile for rview
2# This file is overwritten after every install/update
3# Persistent local customizations
4include rview.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include vim.profile
diff --git a/etc/profile-m-z/rvim.profile b/etc/profile-m-z/rvim.profile
new file mode 100644
index 000000000..7c6465d3c
--- /dev/null
+++ b/etc/profile-m-z/rvim.profile
@@ -0,0 +1,10 @@
1# Firejail profile for rvim
2# This file is overwritten after every install/update
3# Persistent local customizations
4include rvim.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include vim.profile
diff --git a/etc/profile-m-z/sayonara.profile b/etc/profile-m-z/sayonara.profile
new file mode 100644
index 000000000..d447be443
--- /dev/null
+++ b/etc/profile-m-z/sayonara.profile
@@ -0,0 +1,36 @@
1# Firejail profile for sayonara player
2# This file is overwritten after every install/update
3# Persistent local customizations
4include sayonara.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.Sayonara
9noblacklist ${MUSIC}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
17
18caps.drop all
19netfilter
20no3d
21nogroups
22noinput
23nonewprivs
24noroot
25notv
26nou2f
27novideo
28protocol unix,inet,inet6
29seccomp
30shell none
31tracelog
32
33private-bin sayonara
34private-dev
35private-tmp
36
diff --git a/etc/profile-m-z/scallion.profile b/etc/profile-m-z/scallion.profile
new file mode 100644
index 000000000..1fa45a747
--- /dev/null
+++ b/etc/profile-m-z/scallion.profile
@@ -0,0 +1,44 @@
1# Firejail profile for scallion
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include scallion.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PATH}/llvm*
10noblacklist ${PATH}/openssl
11noblacklist ${PATH}/openssl-1.0
12noblacklist ${DOCUMENTS}
13
14include disable-common.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-var-common.inc
21
22caps.drop all
23ipc-namespace
24net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37
38disable-mnt
39private
40private-dev
41private-tmp
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-m-z/scorched3d-wrapper.profile b/etc/profile-m-z/scorched3d-wrapper.profile
new file mode 100644
index 000000000..e76caec1d
--- /dev/null
+++ b/etc/profile-m-z/scorched3d-wrapper.profile
@@ -0,0 +1,11 @@
1# Firejail profile for scorched3d-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include scorched3d-wrapper.local
5
6include allow-opengl-game.inc
7
8private-bin scorched3d-wrapper
9
10# Redirect
11include scorched3d.profile
diff --git a/etc/profile-m-z/scorched3d.profile b/etc/profile-m-z/scorched3d.profile
new file mode 100644
index 000000000..77b3d8923
--- /dev/null
+++ b/etc/profile-m-z/scorched3d.profile
@@ -0,0 +1,50 @@
1# Firejail profile for scorched3d
2# Description: Game based loosely on the classic DOS game Scorched Earth
3# This file is overwritten after every install/update
4# Persistent local customizations
5include scorched3d.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.scorched3d
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.scorched3d
19whitelist ${HOME}/.scorched3d
20whitelist /usr/share/scorched3d
21whitelist /usr/share/games/scorched3d
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28ipc-namespace
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin scorched3d,scorched3dc,scorched3ds
45private-cache
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/scorchwentbonkers.profile b/etc/profile-m-z/scorchwentbonkers.profile
new file mode 100644
index 000000000..1069c34ea
--- /dev/null
+++ b/etc/profile-m-z/scorchwentbonkers.profile
@@ -0,0 +1,50 @@
1# Firejail profile for scorchwentbonkers
2# Description: Realtime remake of Scorched Earth
3# This file is overwritten after every install/update
4# Persistent local customizations
5include scorchwentbonkers.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.swb.ini
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.swb.ini
20whitelist ${HOME}/.swb.ini
21whitelist /usr/share/scorchwentbonkers
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin scorchwentbonkers
44private-cache
45private-dev
46private-etc alsa,asound.conf,machine-id,pulse
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/scp.profile b/etc/profile-m-z/scp.profile
new file mode 100644
index 000000000..287b8029a
--- /dev/null
+++ b/etc/profile-m-z/scp.profile
@@ -0,0 +1,12 @@
1# Firejail profile for scp
2# Description: Secure shell copy
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include scp.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include ssh.profile
diff --git a/etc/profile-m-z/scribus.profile b/etc/profile-m-z/scribus.profile
new file mode 100644
index 000000000..5cf60baea
--- /dev/null
+++ b/etc/profile-m-z/scribus.profile
@@ -0,0 +1,64 @@
1# Firejail profile for scribus
2# Description: Open Source Desktop Page Layout
3# This file is overwritten after every install/update
4# Persistent local customizations
5include scribus.local
6# Persistent global definitions
7include globals.local
8
9# Support for PDF readers comes with Scribus 1.5 and higher
10noblacklist ${HOME}/.cache/okular
11noblacklist ${HOME}/.config/GIMP
12noblacklist ${HOME}/.config/okularpartrc
13noblacklist ${HOME}/.config/okularrc
14noblacklist ${HOME}/.config/scribus
15noblacklist ${HOME}/.config/scribusrc
16noblacklist ${HOME}/.gimp*
17noblacklist ${HOME}/.kde/share/apps/okular
18noblacklist ${HOME}/.kde/share/config/okularpartrc
19noblacklist ${HOME}/.kde/share/config/okularrc
20noblacklist ${HOME}/.kde4/share/apps/okular
21noblacklist ${HOME}/.kde4/share/config/okularpartrc
22noblacklist ${HOME}/.kde4/share/config/okularrc
23noblacklist ${HOME}/.local/share/okular
24noblacklist ${HOME}/.local/share/scribus
25noblacklist ${HOME}/.scribus
26noblacklist ${DOCUMENTS}
27noblacklist ${PICTURES}
28
29# Allow python (blacklisted by disable-interpreters.inc)
30include allow-python2.inc
31include allow-python3.inc
32
33include disable-common.inc
34include disable-devel.inc
35include disable-exec.inc
36include disable-interpreters.inc
37include disable-programs.inc
38include disable-xdg.inc
39
40include whitelist-var-common.inc
41
42apparmor
43caps.drop all
44net none
45nodvd
46nogroups
47noinput
48nonewprivs
49noroot
50nosound
51notv
52nou2f
53novideo
54protocol unix
55seccomp
56shell none
57tracelog
58
59# private-bin gimp*,gs,scribus
60private-dev
61private-tmp
62
63dbus-user none
64dbus-system none
diff --git a/etc/profile-m-z/sdat2img.profile b/etc/profile-m-z/sdat2img.profile
new file mode 100644
index 000000000..81a7dc929
--- /dev/null
+++ b/etc/profile-m-z/sdat2img.profile
@@ -0,0 +1,44 @@
1# Firejail profile for sdat2img
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include sdat2img.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21include whitelist-var-common.inc
22
23caps.drop all
24net none
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38
39private-bin env,python*,sdat2img
40private-cache
41private-dev
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-m-z/seahorse-adventures.profile b/etc/profile-m-z/seahorse-adventures.profile
new file mode 100644
index 000000000..af7d5eeac
--- /dev/null
+++ b/etc/profile-m-z/seahorse-adventures.profile
@@ -0,0 +1,55 @@
1# Firejail profile for seahorse-adventures
2# Description: Help barbie the seahorse float on bubbles to the moon
3# This file is overwritten after every install/update
4# Persistent local customizations
5include seahorse-adventures.local
6# Persistent global definitions
7include globals.local
8
9# Allow /bin/sh (blacklisted by disable-shell.inc)
10include allow-bin-sh.inc
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24whitelist /usr/share/seahorse-adventures
25whitelist /usr/share/games/seahorse-adventures
26include whitelist-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32net none
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private
48private-bin bash,dash,python*,seahorse-adventures,sh
49private-cache
50private-dev
51private-etc machine-id
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-m-z/seahorse-daemon.profile b/etc/profile-m-z/seahorse-daemon.profile
new file mode 100644
index 000000000..6410da4d8
--- /dev/null
+++ b/etc/profile-m-z/seahorse-daemon.profile
@@ -0,0 +1,14 @@
1# Firejail profile for seahorse-daemon
2# Description: PGP encryption and signing
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include seahorse-daemon.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11memory-deny-write-execute
12
13# Redirect
14include seahorse.profile
diff --git a/etc/profile-m-z/seahorse-tool.profile b/etc/profile-m-z/seahorse-tool.profile
new file mode 100644
index 000000000..96ff74edf
--- /dev/null
+++ b/etc/profile-m-z/seahorse-tool.profile
@@ -0,0 +1,15 @@
1# Firejail profile for seahorse-tool
2# Description: PGP encryption and signing
3# This file is overwritten after every install/update
4# Persistent local customizations
5include seahorse-tool.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# private-etc workaround for: #2877
11private-etc firejail,login.defs,passwd
12private-tmp
13
14# Redirect
15include seahorse.profile
diff --git a/etc/profile-m-z/seahorse.profile b/etc/profile-m-z/seahorse.profile
new file mode 100644
index 000000000..94a27da87
--- /dev/null
+++ b/etc/profile-m-z/seahorse.profile
@@ -0,0 +1,70 @@
1# Firejail profile for seahorse
2# Description: GNOME application for managing PGP keys
3# This file is overwritten after every install/update
4# Persistent local customizations
5include seahorse.local
6# Persistent global definitions
7include globals.local
8
9blacklist /tmp/.X11-unix
10
11noblacklist ${HOME}/.gnupg
12
13# Allow ssh (blacklisted by disable-common.inc)
14include allow-ssh.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23# whitelisting in ${HOME} breaks file encryption feature of nautilus.
24# Once #2882 is fixed this can be activated here and nowhitelisted in seahorse-tool.profile.
25#mkdir ${HOME}/.gnupg
26#mkdir ${HOME}/.ssh
27#whitelist ${HOME}/.gnupg
28#whitelist ${HOME}/.ssh
29whitelist /tmp/ssh-*
30whitelist /usr/share/gnupg
31whitelist /usr/share/gnupg2
32whitelist /usr/share/seahorse
33whitelist /usr/share/seahorse-nautilus
34whitelist ${RUNUSER}/gnupg
35whitelist ${RUNUSER}/keyring
36#include whitelist-common.inc
37include whitelist-runuser-common.inc
38include whitelist-usr-share-common.inc
39include whitelist-var-common.inc
40
41apparmor
42caps.drop all
43machine-id
44netfilter
45no3d
46nodvd
47nogroups
48noinput
49nonewprivs
50noroot
51nosound
52notv
53nou2f
54novideo
55protocol unix,inet,inet6
56seccomp
57shell none
58tracelog
59
60disable-mnt
61private-cache
62private-dev
63private-etc ca-certificates,crypto-policies,dconf,fonts,gconf,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.preload,nsswitch.conf,pango,pki,protocols,resolv.conf,rpc,services,ssh,ssl,X11
64writable-run-user
65
66dbus-user filter
67dbus-user.own org.gnome.seahorse
68dbus-user.own org.gnome.seahorse.Application
69dbus-user.talk org.freedesktop.secrets
70dbus-system none
diff --git a/etc/profile-m-z/seamonkey-bin.profile b/etc/profile-m-z/seamonkey-bin.profile
new file mode 100644
index 000000000..f9cb08432
--- /dev/null
+++ b/etc/profile-m-z/seamonkey-bin.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for seamonkey
2# This file is overwritten after every install/update
3# Persistent local customizations
4include seamonkey-bin.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include seamonkey.profile
diff --git a/etc/profile-m-z/seamonkey.profile b/etc/profile-m-z/seamonkey.profile
new file mode 100644
index 000000000..807effbeb
--- /dev/null
+++ b/etc/profile-m-z/seamonkey.profile
@@ -0,0 +1,55 @@
1# Firejail profile for seamonkey
2# Description: SeaMonkey internet suite
3# This file is overwritten after every install/update
4# Persistent local customizations
5include seamonkey.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/mozilla
10noblacklist ${HOME}/.mozilla
11noblacklist ${HOME}/.pki
12noblacklist ${HOME}/.local/share/pki
13
14include disable-common.inc
15include disable-devel.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19mkdir ${HOME}/.cache/mozilla
20mkdir ${HOME}/.mozilla
21mkdir ${HOME}/.pki
22mkdir ${HOME}/.local/share/pki
23whitelist ${DOWNLOADS}
24whitelist ${HOME}/.cache/gnome-mplayer/plugin
25whitelist ${HOME}/.cache/mozilla
26whitelist ${HOME}/.config/gnome-mplayer
27whitelist ${HOME}/.config/pipelight-silverlight5.1
28whitelist ${HOME}/.config/pipelight-widevine
29whitelist ${HOME}/.keysnail.js
30whitelist ${HOME}/.lastpass
31whitelist ${HOME}/.mozilla
32whitelist ${HOME}/.pentadactyl
33whitelist ${HOME}/.pentadactylrc
34whitelist ${HOME}/.pki
35whitelist ${HOME}/.local/share/pki
36whitelist ${HOME}/.vimperator
37whitelist ${HOME}/.vimperatorrc
38whitelist ${HOME}/.wine-pipelight
39whitelist ${HOME}/.wine-pipelight64
40whitelist ${HOME}/.zotero
41whitelist ${HOME}/dwhelper
42include whitelist-common.inc
43
44caps.drop all
45netfilter
46nodvd
47nonewprivs
48noroot
49notv
50protocol unix,inet,inet6,netlink
51seccomp
52tracelog
53
54disable-mnt
55# private-etc adobe,alternatives,asound.conf,ca-certificates,crypto-policies,firefox,fonts,group,gtk-2.0,hostname,hosts,iceweasel,localtime,machine-id,mailcap,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,ssl
diff --git a/etc/profile-m-z/secret-tool.profile b/etc/profile-m-z/secret-tool.profile
new file mode 100644
index 000000000..99ba11d30
--- /dev/null
+++ b/etc/profile-m-z/secret-tool.profile
@@ -0,0 +1,12 @@
1# Firejail profile for secret-tool
2# Description: Library for storing and retrieving passwords and other secrets
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include secret-tool.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include gnome-keyring.profile
diff --git a/etc/profile-m-z/server.profile b/etc/profile-m-z/server.profile
new file mode 100644
index 000000000..3c9ef3a86
--- /dev/null
+++ b/etc/profile-m-z/server.profile
@@ -0,0 +1,90 @@
1# Generic Firejail profile for servers started as root
2#
3# This profile is used as a default when starting the sandbox as root.
4# Example:
5#
6# $ sudo firejail
7# [sudo] password for netblue:
8# Reading profile /etc/firejail/server.profile
9# Reading profile /etc/firejail/disable-common.inc
10# Reading profile /etc/firejail/disable-programs.inc
11#
12# ** Note: you can use --noprofile to disable server.profile **
13#
14# Parent pid 5347, child pid 5348
15# The new log directory is /proc/5348/root/var/log
16# Child process initialized in 64.43 ms
17# root@debian:~#
18#
19# Customize the profile as usual. Examples: unbound.profile, fdns.profile.
20# All the rules for regular user profiles apply with the exception of
21# /usr/local/bin symlink redirection and firecfg tool. The redirection is disabled
22# by default for root user.
23
24# This file is overwritten after every install/update
25# Persistent local customizations
26include server.local
27# Persistent global definitions
28include globals.local
29
30# generic server profile
31# it allows /sbin and /usr/sbin directories - this is where servers are installed
32# depending on your usage, you can enable some of the commands below:
33
34noblacklist /sbin
35noblacklist /usr/sbin
36# noblacklist /var/opt
37
38blacklist /tmp/.X11-unix
39blacklist ${RUNUSER}/wayland-*
40
41include disable-common.inc
42# include disable-devel.inc
43# include disable-exec.inc
44# include disable-interpreters.inc
45include disable-programs.inc
46include disable-write-mnt.inc
47include disable-xdg.inc
48
49# include whitelist-runuser-common.inc
50# include whitelist-usr-share-common.inc
51# include whitelist-var-common.inc
52
53apparmor
54caps
55# ipc-namespace
56machine-id
57# netfilter /etc/firejail/webserver.net
58no3d
59nodvd
60# nogroups
61noinput
62# nonewprivs
63# noroot
64nosound
65notv
66nou2f
67novideo
68# protocol unix,inet,inet6,netlink
69seccomp
70# shell none
71
72disable-mnt
73private
74# private-bin program
75# private-cache
76private-dev
77# see /usr/share/doc/firejail/profile.template for more common private-etc paths.
78# private-etc alternatives
79# private-lib
80# private-opt none
81private-tmp
82
83dbus-user none
84# dbus-system none
85
86# memory-deny-write-execute
87# read-only ${HOME}
88# writable-run-user
89# writable-var
90# writable-var-log
diff --git a/etc/profile-m-z/servo.profile b/etc/profile-m-z/servo.profile
new file mode 100644
index 000000000..7788974ce
--- /dev/null
+++ b/etc/profile-m-z/servo.profile
@@ -0,0 +1,49 @@
1# Firejail profile for servo
2# Description: The Servo Browser Engine
3# This file is overwritten after every install/update
4# Persistent local customizations
5include servo.local
6# Persistent global definitions
7include globals.local
8
9# Servo is usually installed inside $HOME
10ignore noexec ${HOME}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19# Add the next lines to your servo.local to turn this into a whitelisting profile.
20# You will need to add a whitelist for the directory where servo is installed.
21#whitelist ${DOWNLOADS}
22#include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28netfilter
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix,inet,inet6
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin servo,sh
44private-cache
45private-dev
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-m-z/sftp.profile b/etc/profile-m-z/sftp.profile
new file mode 100644
index 000000000..66dc2a57b
--- /dev/null
+++ b/etc/profile-m-z/sftp.profile
@@ -0,0 +1,12 @@
1# Firejail profile for sftp
2# Description: Secure file transport protocol
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sftp.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include ssh.profile
diff --git a/etc/profile-m-z/sha1sum.profile b/etc/profile-m-z/sha1sum.profile
new file mode 100644
index 000000000..b2064b95d
--- /dev/null
+++ b/etc/profile-m-z/sha1sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for sha1sum
2# Description: compute and check SHA1 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sha1sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin sha1sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/sha224sum.profile b/etc/profile-m-z/sha224sum.profile
new file mode 100644
index 000000000..cb26cc5ff
--- /dev/null
+++ b/etc/profile-m-z/sha224sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for sha224sum
2# Description: compute and check SHA224 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sha224sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin sha224sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/sha256sum.profile b/etc/profile-m-z/sha256sum.profile
new file mode 100644
index 000000000..48944ebea
--- /dev/null
+++ b/etc/profile-m-z/sha256sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for sha256sum
2# Description: compute and check SHA256 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sha256sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin sha256sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/sha384sum.profile b/etc/profile-m-z/sha384sum.profile
new file mode 100644
index 000000000..6d876daed
--- /dev/null
+++ b/etc/profile-m-z/sha384sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for sha384sum
2# Description: compute and check SHA384 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sha384sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin sha384sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/sha512sum.profile b/etc/profile-m-z/sha512sum.profile
new file mode 100644
index 000000000..7ebaf3540
--- /dev/null
+++ b/etc/profile-m-z/sha512sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for sha512sum
2# Description: compute and check SHA512 message digest
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sha512sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin sha512sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/shellcheck.profile b/etc/profile-m-z/shellcheck.profile
new file mode 100644
index 000000000..f2469048f
--- /dev/null
+++ b/etc/profile-m-z/shellcheck.profile
@@ -0,0 +1,54 @@
1# Firejail profile for shellcheck
2# Description: Lint tool for shell scripts
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include shellcheck.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12noblacklist ${DOCUMENTS}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21whitelist /usr/share/shellcheck
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27ipc-namespace
28machine-id
29net none
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42seccomp.block-secondary
43shell none
44tracelog
45x11 none
46
47private-cache
48private-dev
49private-tmp
50
51dbus-user none
52dbus-system none
53
54memory-deny-write-execute
diff --git a/etc/profile-m-z/shortwave.profile b/etc/profile-m-z/shortwave.profile
new file mode 100644
index 000000000..0bcf5f693
--- /dev/null
+++ b/etc/profile-m-z/shortwave.profile
@@ -0,0 +1,50 @@
1# Firejail profile for shortwave
2# Description: Listen to internet radio
3# This file is overwritten after every install/update
4# Persistent local customizations
5include shortwave.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Shortwave
10noblacklist ${HOME}/.local/share/Shortwave
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.cache/Shortwave
20mkdir ${HOME}/.local/share/Shortwave
21whitelist ${HOME}/.cache/Shortwave
22whitelist ${HOME}/.local/share/Shortwave
23whitelist /usr/share/shortwave
24include whitelist-common.inc
25include whitelist-runuser-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31netfilter
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin shortwave
47private-cache
48private-dev
49private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gconf,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,passwd,pki,pulse,resolv.conf,ssl,X11,xdg
50private-tmp
diff --git a/etc/profile-m-z/shotcut.profile b/etc/profile-m-z/shotcut.profile
new file mode 100644
index 000000000..e5dbf5c5f
--- /dev/null
+++ b/etc/profile-m-z/shotcut.profile
@@ -0,0 +1,38 @@
1# Firejail profile for shotcut
2# Description: A free, open source, cross-platform video editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include shotcut.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.config/Meltytech
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19caps.drop all
20net none
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26notv
27nou2f
28protocol unix
29seccomp
30shell none
31tracelog
32
33#private-bin melt,nice,qmelt,shotcut
34private-cache
35private-dev
36
37dbus-user none
38dbus-system none
diff --git a/etc/profile-m-z/shotwell.profile b/etc/profile-m-z/shotwell.profile
new file mode 100644
index 000000000..b6a828636
--- /dev/null
+++ b/etc/profile-m-z/shotwell.profile
@@ -0,0 +1,60 @@
1# Firejail profile for shotwell
2# Description: A digital photo organizer designed for the GNOME desktop environment
3# This file is overwritten after every install/update
4# Persistent local customizations
5include shotwell.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/shotwell
10noblacklist ${HOME}/.local/share/shotwell
11
12noblacklist ${PICTURES}
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.cache/shotwell
22mkdir ${HOME}/.local/share/shotwell
23whitelist ${HOME}/.cache/shotwell
24whitelist ${HOME}/.local/share/shotwell
25whitelist ${PICTURES}
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33machine-id
34netfilter
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix
45seccomp
46shell none
47tracelog
48
49private-bin shotwell
50private-cache
51private-dev
52private-etc alternatives,fonts,machine-id
53private-opt none
54private-tmp
55
56dbus-user filter
57dbus-user.own org.gnome.Shotwell
58dbus-user.talk ca.desrt.dconf
59dbus-user.talk org.gtk.vfs.UDisks2VolumeMonitor
60dbus-system none
diff --git a/etc/profile-m-z/signal-cli.profile b/etc/profile-m-z/signal-cli.profile
new file mode 100644
index 000000000..24f1464f9
--- /dev/null
+++ b/etc/profile-m-z/signal-cli.profile
@@ -0,0 +1,51 @@
1# Firejail profile for signal-cli
2# Description: signal-cli provides a commandline and dbus interface for signalapp/libsignal-service-java
3# This file is overwritten after every install/update
4# Persistent local customizations
5include signal-cli.local
6# Persistent global definitions
7include globals.local
8
9blacklist /tmp/.X11-unix
10blacklist ${RUNUSER}/wayland-*
11
12noblacklist ${HOME}/.local/share/signal-cli
13
14include allow-java.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.local/share/signal-cli
24whitelist ${HOME}/.local/share/signal-cli
25include whitelist-common.inc
26include whitelist-var-common.inc
27
28caps.drop all
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-bin java,sh,signal-cli
47private-cache
48private-dev
49# Does not work with all Java configurations. You will notice immediately, so you might want to give it a try
50#private-etc alternatives,ca-certificates,crypto-policies,dbus-1,host.conf,hostname,hosts,java-10-openjdk,java-7-openjdk,java-8-openjdk,java-9-openjdk,java.conf,machine-id,nsswitch.conf,passwd,pki,protocols,resolv.conf,rpc,services,ssl
51private-tmp
diff --git a/etc/profile-m-z/signal-desktop.profile b/etc/profile-m-z/signal-desktop.profile
new file mode 100644
index 000000000..77a7f5b38
--- /dev/null
+++ b/etc/profile-m-z/signal-desktop.profile
@@ -0,0 +1,30 @@
1# Firejail profile for signal-desktop
2# This file is overwritten after every install/update
3# Persistent local customizations
4include signal-desktop.local
5# Persistent global definitions
6include globals.local
7
8ignore novideo
9
10ignore noexec /tmp
11
12noblacklist ${HOME}/.config/Signal
13
14# These lines are needed to allow Firefox to open links
15noblacklist ${HOME}/.mozilla
16whitelist ${HOME}/.mozilla/firefox/profiles.ini
17read-only ${HOME}/.mozilla/firefox/profiles.ini
18
19mkdir ${HOME}/.config/Signal
20whitelist ${HOME}/.config/Signal
21
22private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,machine-id,nsswitch.conf,pki,resolv.conf,ssl
23
24# allow D-Bus notifications
25dbus-user filter
26dbus-user.talk org.freedesktop.Notifications
27ignore dbus-user none
28
29# Redirect
30include electron.profile
diff --git a/etc/profile-m-z/silentarmy.profile b/etc/profile-m-z/silentarmy.profile
new file mode 100644
index 000000000..4351a4d43
--- /dev/null
+++ b/etc/profile-m-z/silentarmy.profile
@@ -0,0 +1,40 @@
1# Firejail profile for silentarmy
2# This file is overwritten after every install/update
3# Persistent local customizations
4include silentarmy.local
5# Persistent global definitions
6include globals.local
7
8
9include disable-common.inc
10# include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17include whitelist-var-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23noinput
24nonewprivs
25noroot
26nosound
27notv
28nou2f
29novideo
30protocol unix,inet,inet6
31seccomp
32shell none
33
34disable-mnt
35private
36private-bin python*,sa-solver,silentarmy
37private-dev
38private-opt none
39private-tmp
40
diff --git a/etc/profile-m-z/simple-scan.profile b/etc/profile-m-z/simple-scan.profile
new file mode 100644
index 000000000..b0ab0d039
--- /dev/null
+++ b/etc/profile-m-z/simple-scan.profile
@@ -0,0 +1,41 @@
1# Firejail profile for simple-scan
2# Description: Simple Scanning Utility
3# This file is overwritten after every install/update
4# Persistent local customizations
5include simple-scan.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/simple-scan
10noblacklist ${DOCUMENTS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18whitelist /usr/share/hplip
19whitelist /usr/share/simple-scan
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23caps.drop all
24netfilter
25nodvd
26nogroups
27nonewprivs
28noroot
29nosound
30notv
31# novideo
32protocol unix,inet,inet6,netlink
33# blacklisting of ioperm system calls breaks simple-scan
34seccomp !ioperm
35shell none
36tracelog
37
38# private-bin simple-scan
39# private-dev
40# private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,ssl
41# private-tmp
diff --git a/etc/profile-m-z/simplescreenrecorder.profile b/etc/profile-m-z/simplescreenrecorder.profile
new file mode 100644
index 000000000..03a350327
--- /dev/null
+++ b/etc/profile-m-z/simplescreenrecorder.profile
@@ -0,0 +1,39 @@
1# Firejail profile for simplescreenrecorder
2# Description: A feature-rich screen recorder that supports X11 and OpenGL
3# This file is overwritten after every install/update
4# Persistent local customizations
5include simplescreenrecorder.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${VIDEOS}
10noblacklist ${HOME}/.ssr
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19whitelist /usr/share/simplescreenrecorder
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32protocol unix
33seccomp
34shell none
35tracelog
36
37private-cache
38private-dev
39private-tmp
diff --git a/etc/profile-m-z/simutrans.profile b/etc/profile-m-z/simutrans.profile
new file mode 100644
index 000000000..55e472dbe
--- /dev/null
+++ b/etc/profile-m-z/simutrans.profile
@@ -0,0 +1,42 @@
1# Firejail profile for simutrans
2# Description: Transportation simulator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include simutrans.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.simutrans
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/.simutrans
18whitelist ${HOME}/.simutrans
19include whitelist-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24net none
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32novideo
33protocol unix
34seccomp
35shell none
36
37# private-bin simutrans
38private-dev
39private-tmp
40
41dbus-user none
42dbus-system none
diff --git a/etc/profile-m-z/skanlite.profile b/etc/profile-m-z/skanlite.profile
new file mode 100644
index 000000000..4965d3882
--- /dev/null
+++ b/etc/profile-m-z/skanlite.profile
@@ -0,0 +1,36 @@
1# Firejail profile for skanlite
2# Description: Image scanner based on the KSane backend
3# This file is overwritten after every install/update
4# Persistent local customizations
5include skanlite.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
16
17caps.drop all
18netfilter
19nodvd
20nogroups
21nonewprivs
22noroot
23nosound
24notv
25# novideo
26protocol unix,inet,inet6,netlink
27# blacklisting of ioperm system calls breaks skanlite
28seccomp !ioperm
29shell none
30
31# private-bin kbuildsycoca4,kdeinit4,skanlite
32# private-dev
33# private-tmp
34
35# dbus-user none
36# dbus-system none
diff --git a/etc/profile-m-z/skypeforlinux.profile b/etc/profile-m-z/skypeforlinux.profile
new file mode 100644
index 000000000..ed04eda8e
--- /dev/null
+++ b/etc/profile-m-z/skypeforlinux.profile
@@ -0,0 +1,29 @@
1# Firejail profile for skypeforlinux
2# This file is overwritten after every install/update
3# Persistent local customizations
4include skypeforlinux.local
5# Persistent global definitions
6include globals.local
7
8# Disabled until someone reported positive feedback
9ignore whitelist ${DOWNLOADS}
10ignore include whitelist-common.inc
11ignore include whitelist-runuser-common.inc
12ignore include whitelist-usr-share-common.inc
13ignore include whitelist-var-common.inc
14ignore nou2f
15ignore novideo
16ignore private-dev
17ignore dbus-user none
18ignore dbus-system none
19
20# breaks Skype
21ignore apparmor
22ignore noexec /tmp
23
24noblacklist ${HOME}/.config/skypeforlinux
25
26# private-dev - needs /dev/disk
27
28# Redirect
29include electron.profile
diff --git a/etc/profile-m-z/slack.profile b/etc/profile-m-z/slack.profile
new file mode 100644
index 000000000..51f6c8b00
--- /dev/null
+++ b/etc/profile-m-z/slack.profile
@@ -0,0 +1,32 @@
1# Firejail profile for slack
2# This file is overwritten after every install/update
3# Persistent local customizations
4include slack.local
5# Persistent global definitions
6include globals.local
7
8# Disabled until someone reported positive feedback
9ignore include disable-exec.inc
10ignore include disable-xdg.inc
11ignore include whitelist-runuser-common.inc
12ignore include whitelist-usr-share-common.inc
13ignore apparmor
14ignore novideo
15ignore private-tmp
16ignore dbus-user none
17ignore dbus-system none
18
19noblacklist ${HOME}/.config/Slack
20
21include allow-bin-sh.inc
22
23include disable-shell.inc
24
25mkdir ${HOME}/.config/Slack
26whitelist ${HOME}/.config/Slack
27
28private-bin electron,electron[0-9],electron[0-9][0-9],locale,sh,slack
29private-etc alternatives,asound.conf,ca-certificates,crypto-policies,debian_version,fedora-release,fonts,group,ld.so.cache,ld.so.conf,localtime,machine-id,os-release,passwd,pki,pulse,redhat-release,resolv.conf,ssl,system-release,system-release-cpe
30
31# Redirect
32include electron.profile
diff --git a/etc/profile-m-z/slashem.profile b/etc/profile-m-z/slashem.profile
new file mode 100644
index 000000000..bebf77ccc
--- /dev/null
+++ b/etc/profile-m-z/slashem.profile
@@ -0,0 +1,47 @@
1# Firejail profile for slashem
2# Description: A rogue-like single player dungeon exploration game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include slashem.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /var/games/slashem
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17whitelist /var/games/slashem
18include whitelist-common.inc
19include whitelist-var-common.inc
20
21caps.drop all
22ipc-namespace
23net none
24no3d
25nodvd
26nogroups
27noinput
28#nonewprivs
29#noroot
30nosound
31notv
32novideo
33#protocol unix,netlink
34#seccomp
35shell none
36
37disable-mnt
38#private
39private-cache
40private-dev
41private-tmp
42writable-var
43
44dbus-user none
45dbus-system none
46
47#memory-deny-write-execute
diff --git a/etc/profile-m-z/smplayer.profile b/etc/profile-m-z/smplayer.profile
new file mode 100644
index 000000000..7c1e18ac3
--- /dev/null
+++ b/etc/profile-m-z/smplayer.profile
@@ -0,0 +1,55 @@
1# Firejail profile for smplayer
2# Description: Complete front-end for MPlayer and mpv
3# This file is overwritten after every install/update
4# Persistent local customizations
5include smplayer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/smplayer
10noblacklist ${HOME}/.config/youtube-dl
11noblacklist ${HOME}/.mplayer
12
13# Allow lua (blacklisted by disable-interpreters.inc)
14include allow-lua.inc
15
16# Allow python (blacklisted by disable-interpreters.inc)
17include allow-python2.inc
18include allow-python3.inc
19
20noblacklist ${MUSIC}
21noblacklist ${VIDEOS}
22
23include disable-common.inc
24include disable-devel.inc
25include disable-exec.inc
26include disable-interpreters.inc
27include disable-programs.inc
28include disable-shell.inc
29include disable-xdg.inc
30
31whitelist /usr/share/lua*
32whitelist /usr/share/smplayer
33whitelist /usr/share/vulkan
34include whitelist-usr-share-common.inc
35include whitelist-var-common.inc
36
37apparmor
38caps.drop all
39netfilter
40# nogroups
41noinput
42nonewprivs
43noroot
44nou2f
45protocol unix,inet,inet6,netlink
46seccomp
47shell none
48
49private-bin env,mplayer,mpv,python*,smplayer,smtube,waf,youtube-dl
50private-dev
51private-tmp
52
53# problems with KDE
54# dbus-user none
55# dbus-system none
diff --git a/etc/smtube.profile b/etc/profile-m-z/smtube.profile
index 2694dd5b0..65e6d38e4 100644
--- a/etc/smtube.profile
+++ b/etc/profile-m-z/smtube.profile
@@ -1,9 +1,10 @@
1# Firejail profile for smtube 1# Firejail profile for smtube
2# Description: YouTube videos browser
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/smtube.local 5include smtube.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/smplayer 9noblacklist ${HOME}/.config/smplayer
9noblacklist ${HOME}/.config/smtube 10noblacklist ${HOME}/.config/smtube
@@ -11,18 +12,30 @@ noblacklist ${HOME}/.config/mpv
11noblacklist ${HOME}/.mplayer 12noblacklist ${HOME}/.mplayer
12noblacklist ${HOME}/.config/vlc 13noblacklist ${HOME}/.config/vlc
13noblacklist ${HOME}/.local/share/vlc 14noblacklist ${HOME}/.local/share/vlc
15noblacklist ${MUSIC}
16noblacklist ${VIDEOS}
14 17
15include /etc/firejail/disable-common.inc 18include disable-common.inc
16include /etc/firejail/disable-devel.inc 19include disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc 20include disable-exec.inc
18include /etc/firejail/disable-programs.inc 21include disable-interpreters.inc
22include disable-programs.inc
23include disable-xdg.inc
19 24
25whitelist /usr/share/smplayer
26whitelist /usr/share/smtube
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
20caps.drop all 31caps.drop all
21netfilter 32netfilter
22nodvd 33nodvd
23notv 34notv
35nou2f
24novideo 36novideo
25nogroups 37nogroups
38noinput
26nonewprivs 39nonewprivs
27noroot 40noroot
28protocol unix,inet,inet6,netlink 41protocol unix,inet,inet6,netlink
@@ -33,5 +46,3 @@ shell none
33private-dev 46private-dev
34private-tmp 47private-tmp
35 48
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/profile-m-z/smuxi-frontend-gnome.profile b/etc/profile-m-z/smuxi-frontend-gnome.profile
new file mode 100644
index 000000000..31d14924c
--- /dev/null
+++ b/etc/profile-m-z/smuxi-frontend-gnome.profile
@@ -0,0 +1,55 @@
1# Firejail profile for smuxi-frontend-gnome
2# Description: Multi protocol chat client with Twitter support
3# This file is overwritten after every install/update
4# Persistent local customizations
5include smuxi-frontend-gnome.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/smuxi
10noblacklist ${HOME}/.config/smuxi
11noblacklist ${HOME}/.local/share/smuxi
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.cache/smuxi
21mkdir ${HOME}/.config/smuxi
22mkdir ${HOME}/.local/share/smuxi
23whitelist ${HOME}/.cache/smuxi
24whitelist ${HOME}/.config/smuxi
25whitelist ${HOME}/.local/share/smuxi
26whitelist ${DOWNLOADS}
27include whitelist-common.inc
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34netfilter
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42protocol unix,inet,inet6,netlink
43seccomp
44shell none
45tracelog
46
47disable-mnt
48private-bin bash,mono,mono-sgen,sh,smuxi-frontend-gnome
49private-cache
50private-dev
51private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,hostname,hosts,ld.so.cache,ld.so.conf,machine-id,mono,passwd,pki,pulse,resolv.conf,selinux,ssl,xdg
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-m-z/snox.profile b/etc/profile-m-z/snox.profile
new file mode 100644
index 000000000..83493652c
--- /dev/null
+++ b/etc/profile-m-z/snox.profile
@@ -0,0 +1,24 @@
1# Firejail profile for snox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include snox.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://www.tutorialspoint.com/difference-between-void-main-and-int-main-in-c-cplusplus
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/snox
14noblacklist ${HOME}/.config/snox
15
16#mkdir ${HOME}/.cache/dnox
17#mkdir ${HOME}/.config/dnox
18mkdir ${HOME}/.cache/snox
19mkdir ${HOME}/.config/snox
20whitelist ${HOME}/.cache/snox
21whitelist ${HOME}/.config/snox
22
23# Redirect
24include chromium-common.profile
diff --git a/etc/profile-m-z/soffice.profile b/etc/profile-m-z/soffice.profile
new file mode 100644
index 000000000..f7f86c33c
--- /dev/null
+++ b/etc/profile-m-z/soffice.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3# Persistent local customizations
4include soffice.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include libreoffice.profile
diff --git a/etc/profile-m-z/softmaker-common.profile b/etc/profile-m-z/softmaker-common.profile
new file mode 100644
index 000000000..47468a531
--- /dev/null
+++ b/etc/profile-m-z/softmaker-common.profile
@@ -0,0 +1,50 @@
1# Firejail profile for softmaker-common
2# This file is overwritten after every install/update
3# Persistent local customizations
4include softmaker-common.local
5# Persistent global definitions
6# added by caller profile
7#include globals.local
8
9# The official packages install the desktop file under /usr/local/share/applications
10# with an absolute Exec line. These files are NOT handled by firecfg,
11# therefore you must manually copy them in you home and remove '/usr/bin/'.
12
13noblacklist ${HOME}/SoftMaker
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21whitelist /usr/share/office2018
22whitelist /usr/share/freeoffice2018
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43private-bin freeoffice-planmaker,freeoffice-presentations,freeoffice-textmaker,planmaker18,planmaker18free,presentations18,presentations18free,sh,textmaker18,textmaker18free
44private-cache
45private-dev
46private-etc ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nsswitch.conf,pki,SoftMaker,ssl
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/sol.profile b/etc/profile-m-z/sol.profile
new file mode 100644
index 000000000..0af88e048
--- /dev/null
+++ b/etc/profile-m-z/sol.profile
@@ -0,0 +1,47 @@
1# Firejail profile for default
2# This file is overwritten after every install/update
3# Persistent local customizations
4include sol.local
5# Persistent global definitions
6include globals.local
7
8include disable-common.inc
9include disable-devel.inc
10include disable-exec.inc
11include disable-interpreters.inc
12include disable-programs.inc
13include disable-shell.inc
14include disable-xdg.inc
15
16# all necessary files in $HOME are in whitelist-common.inc
17include whitelist-common.inc
18include whitelist-var-common.inc
19
20apparmor
21caps.drop all
22ipc-namespace
23net none
24# no3d
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30# nosound
31notv
32nou2f
33novideo
34protocol unix
35seccomp
36shell none
37
38disable-mnt
39private-bin sol
40private-cache
41private-dev
42private-tmp
43
44dbus-user none
45dbus-system none
46
47# memory-deny-write-execute
diff --git a/etc/profile-m-z/sound-juicer.profile b/etc/profile-m-z/sound-juicer.profile
new file mode 100644
index 000000000..4c37ece8a
--- /dev/null
+++ b/etc/profile-m-z/sound-juicer.profile
@@ -0,0 +1,43 @@
1# Firejail profile for mpv
2# Description: Graphical audio CD ripper and encoder
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sound-juicer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/sound-juicer
10noblacklist ${MUSIC}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21apparmor
22caps.drop all
23netfilter
24no3d
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30nou2f
31notv
32novideo
33protocol unix,inet,inet6,netlink
34seccomp
35shell none
36tracelog
37
38private-cache
39private-dev
40private-tmp
41
42# dbus-user none
43# dbus-system none
diff --git a/etc/profile-m-z/soundconverter.profile b/etc/profile-m-z/soundconverter.profile
new file mode 100644
index 000000000..e5ff26327
--- /dev/null
+++ b/etc/profile-m-z/soundconverter.profile
@@ -0,0 +1,50 @@
1# Firejail profile for soundconverter
2# Description: GNOME application to convert audio files into other formats
3# This file is overwritten after every install/update
4# Persistent local customizations
5include soundconverter.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python2.inc
11include allow-python3.inc
12
13noblacklist ${MUSIC}
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22whitelist ${DOWNLOADS}
23whitelist ${MUSIC}
24whitelist /usr/share/soundconverter
25include whitelist-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32machine-id
33no3d
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39nosound
40notv
41nou2f
42novideo
43protocol unix
44seccomp
45shell none
46
47private-cache
48private-dev
49private-tmp
50
diff --git a/etc/profile-m-z/spectacle.profile b/etc/profile-m-z/spectacle.profile
new file mode 100644
index 000000000..d803fa5ce
--- /dev/null
+++ b/etc/profile-m-z/spectacle.profile
@@ -0,0 +1,68 @@
1# Firejail profile for spectacle
2# Description: Spectacle is a simple application for capturing desktop screenshots.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include spectacle.local
6# Persistent global definitions
7include globals.local
8
9# Add the next lines to your spectacle.local to use sharing services.
10#netfilter
11#ignore net none
12#private-etc ca-certificates,crypto-policies,pki,resolv.conf,ssl
13#protocol unix,inet,inet6
14
15noblacklist ${HOME}/.config/spectaclerc
16noblacklist ${PICTURES}
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-xdg.inc
24
25mkfile ${HOME}/.config/spectaclerc
26whitelist ${HOME}/.config/spectaclerc
27whitelist ${PICTURES}
28whitelist /usr/share/kconf_update/spectacle_newConfig.upd
29whitelist /usr/share/kconf_update/spectacle_shortcuts.upd
30include whitelist-common.inc
31include whitelist-runuser-common.inc
32include whitelist-usr-share-common.inc
33include whitelist-var-common.inc
34
35apparmor
36caps.drop all
37machine-id
38net none
39no3d
40nodvd
41nogroups
42noinput
43nonewprivs
44noroot
45nosound
46notv
47nou2f
48novideo
49protocol unix
50seccomp
51seccomp.block-secondary
52shell none
53tracelog
54
55disable-mnt
56private-bin spectacle
57private-cache
58private-dev
59private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d
60private-tmp
61
62dbus-user filter
63dbus-user.own org.kde.spectacle
64dbus-user.own org.kde.Spectacle
65dbus-user.talk org.freedesktop.FileManager1
66#dbus-user.talk org.kde.JobViewServer
67#dbus-user.talk org.kde.kglobalaccel
68dbus-system none
diff --git a/etc/profile-m-z/spectral.profile b/etc/profile-m-z/spectral.profile
new file mode 100644
index 000000000..5f17b73dc
--- /dev/null
+++ b/etc/profile-m-z/spectral.profile
@@ -0,0 +1,58 @@
1# Firejail profile for spectral
2# Description: Desktop client for Matrix
3# This file is overwritten after every install/update
4# Persistent local customizations
5include spectral.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/ENCOM/Spectral
10noblacklist ${HOME}/.config/ENCOM
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.cache/ENCOM/Spectral
21mkdir ${HOME}/.config/ENCOM
22whitelist ${HOME}/.cache/ENCOM/Spectral
23whitelist ${HOME}/.config/ENCOM
24whitelist ${DOWNLOADS}
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40protocol unix,inet,inet6,netlink
41seccomp
42shell none
43tracelog
44
45disable-mnt
46private-cache
47private-bin spectral
48private-dev
49private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,mime.types,nsswitch.conf,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
50private-tmp
51
52dbus-user none
53# Add the next lines to your spectral.local to enable notification support.
54#ignore dbus-user none
55#dbus-user filter
56#dbus-user.talk org.freedesktop.Notifications
57#dbus-user.talk org.kde.StatusNotifierWatcher
58dbus-system none
diff --git a/etc/profile-m-z/spectre-meltdown-checker.profile b/etc/profile-m-z/spectre-meltdown-checker.profile
new file mode 100644
index 000000000..19d7f8ae3
--- /dev/null
+++ b/etc/profile-m-z/spectre-meltdown-checker.profile
@@ -0,0 +1,52 @@
1# Firejail profile for spectre-meltdown-checker
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include spectre-meltdown-checker.local
6# Persistent global definitions
7include globals.local
8
9blacklist ${RUNUSER}/wayland-*
10
11noblacklist ${PATH}/mount
12noblacklist ${PATH}/umount
13
14# Allow perl (blacklisted by disable-interpreters.inc)
15include allow-perl.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-xdg.inc
23
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27allow-debuggers
28caps.keep sys_rawio
29ipc-namespace
30net none
31no3d
32nodvd
33nogroups
34nonewprivs
35nosound
36notv
37novideo
38protocol unix
39seccomp.drop @clock,@cpu-emulation,@module,@obsolete,@reboot,@resources,@swap
40shell none
41x11 none
42
43disable-mnt
44private
45private-bin awk,bzip2,cat,coreos-install,cpucontrol,cut,dd,dirname,dmesg,dnf,echo,grep,gunzip,gz,gzip,head,id,kldload,kldstat,liblz4-tool,lzop,mktemp,modinfo,modprobe,mount,nm,objdump,od,perl,printf,readelf,rm,sed,seq,sh,sort,spectre-meltdown-checker,spectre-meltdown-checker.sh,stat,strings,sysctl,tail,test,toolbox,tr,uname,which,xz-utils
46private-cache
47private-tmp
48
49dbus-user none
50dbus-system none
51
52memory-deny-write-execute
diff --git a/etc/profile-m-z/spotify.profile b/etc/profile-m-z/spotify.profile
new file mode 100644
index 000000000..ffee76d23
--- /dev/null
+++ b/etc/profile-m-z/spotify.profile
@@ -0,0 +1,54 @@
1# Firejail profile for spotify
2# This file is overwritten after every install/update
3# Persistent local customizations
4include spotify.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/spotify
9noblacklist ${HOME}/.config/spotify
10noblacklist ${HOME}/.local/share/spotify
11
12blacklist ${HOME}/.bashrc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20mkdir ${HOME}/.cache/spotify
21mkdir ${HOME}/.config/spotify
22mkdir ${HOME}/.local/share/spotify
23whitelist ${HOME}/.cache/spotify
24whitelist ${HOME}/.config/spotify
25whitelist ${HOME}/.local/share/spotify
26include whitelist-common.inc
27include whitelist-var-common.inc
28
29caps.drop all
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38protocol unix,inet,inet6,netlink
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin bash,cat,dirname,find,grep,head,rm,sh,spotify,tclsh,touch,zenity
45private-dev
46# If you want to see album covers or want to use the radio, add 'ignore private-etc' to your spotify.local.
47private-etc alternatives,ca-certificates,crypto-policies,fonts,group,host.conf,hosts,ld.so.cache,machine-id,nsswitch.conf,pki,pulse,resolv.conf,ssl
48private-opt spotify
49private-srv none
50private-tmp
51
52# dbus needed for MPRIS
53# dbus-user none
54# dbus-system none
diff --git a/etc/profile-m-z/sqlitebrowser.profile b/etc/profile-m-z/sqlitebrowser.profile
new file mode 100644
index 000000000..e35f74404
--- /dev/null
+++ b/etc/profile-m-z/sqlitebrowser.profile
@@ -0,0 +1,52 @@
1# Firejail profile for sqlitebrowser
2# Description: GUI editor for SQLite databases
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sqlitebrowser.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/sqlitebrowser
10noblacklist ${DOCUMENTS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20include whitelist-runuser-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6,netlink
38seccomp
39seccomp.block-secondary
40shell none
41
42private-bin sqlitebrowser
43private-cache
44private-dev
45private-etc alternatives,ca-certificates,crypto-policies,fonts,group,machine-id,passwd,pki,ssl
46private-tmp
47
48# breaks proxy creation
49# dbus-user none
50# dbus-system none
51
52#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/ssh-agent.profile b/etc/profile-m-z/ssh-agent.profile
index fa5728d9b..11723664f 100644
--- a/etc/ssh-agent.profile
+++ b/etc/profile-m-z/ssh-agent.profile
@@ -2,21 +2,21 @@
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3quiet 3quiet
4# Persistent local customizations 4# Persistent local customizations
5include /etc/firejail/ssh-agent.local 5include ssh-agent.local
6# Persistent global definitions 6# Persistent global definitions
7include /etc/firejail/globals.local 7include globals.local
8
9# Allow ssh (blacklisted by disable-common.inc)
10include allow-ssh.inc
8 11
9blacklist /tmp/.X11-unix 12blacklist /tmp/.X11-unix
13blacklist ${RUNUSER}/wayland-*
10 14
11noblacklist /etc/ssh 15include disable-common.inc
12noblacklist /tmp/ssh-* 16include disable-programs.inc
13noblacklist ~/.ssh
14 17
15include /etc/firejail/disable-common.inc 18include whitelist-usr-share-common.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18 19
19shell none
20caps.drop all 20caps.drop all
21netfilter 21netfilter
22no3d 22no3d
@@ -24,6 +24,13 @@ nodvd
24nonewprivs 24nonewprivs
25noroot 25noroot
26notv 26notv
27novideo
27protocol unix,inet,inet6 28protocol unix,inet,inet6
28seccomp 29seccomp
30shell none
31tracelog
32
29writable-run-user 33writable-run-user
34
35dbus-user none
36dbus-system none
diff --git a/etc/profile-m-z/ssh.profile b/etc/profile-m-z/ssh.profile
new file mode 100644
index 000000000..9295013e7
--- /dev/null
+++ b/etc/profile-m-z/ssh.profile
@@ -0,0 +1,53 @@
1# Firejail profile for ssh
2# Description: Secure shell client and server
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include ssh.local
7# Persistent global definitions
8include globals.local
9
10# nc can be used as ProxyCommand, e.g. when using tor
11noblacklist ${PATH}/nc
12noblacklist ${PATH}/ncat
13
14# Allow ssh (blacklisted by disable-common.inc)
15include allow-ssh.inc
16
17include disable-common.inc
18include disable-exec.inc
19include disable-programs.inc
20
21whitelist ${RUNUSER}/gnupg/S.gpg-agent.ssh
22whitelist ${RUNUSER}/keyring/ssh
23include whitelist-usr-share-common.inc
24include whitelist-runuser-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35# noroot - see issue #1543
36nosound
37notv
38# nou2f - OpenSSH >= 8.2 supports U2F
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45private-cache
46private-dev
47# private-tmp # Breaks when exiting
48writable-run-user
49
50dbus-user none
51dbus-system none
52
53memory-deny-write-execute
diff --git a/etc/profile-m-z/standardnotes-desktop.profile b/etc/profile-m-z/standardnotes-desktop.profile
new file mode 100644
index 000000000..d54ddacdd
--- /dev/null
+++ b/etc/profile-m-z/standardnotes-desktop.profile
@@ -0,0 +1,44 @@
1# Firejail profile for standardnotes-desktop
2# This file is overwritten after every install/update
3# Persistent local customizations
4include standardnotes-desktop.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/Standard Notes Backups
9noblacklist ${HOME}/.config/Standard Notes
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16
17mkdir ${HOME}/Standard Notes Backups
18mkdir ${HOME}/.config/Standard Notes
19whitelist ${HOME}/Standard Notes Backups
20whitelist ${HOME}/.config/Standard Notes
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32nosound
33notv
34nou2f
35protocol unix,inet,inet6,netlink
36seccomp !chroot
37
38disable-mnt
39private-dev
40private-tmp
41private-etc alternatives,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,pki,resolv.conf,ssl,xdg
42
43dbus-user none
44dbus-system none
diff --git a/etc/profile-m-z/start-tor-browser.desktop.profile b/etc/profile-m-z/start-tor-browser.desktop.profile
new file mode 100644
index 000000000..2f73c9fee
--- /dev/null
+++ b/etc/profile-m-z/start-tor-browser.desktop.profile
@@ -0,0 +1,76 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include start-tor-browser.desktop.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser*
10
11whitelist ${HOME}/.tor-browser-ar
12whitelist ${HOME}/.tor-browser-ca
13whitelist ${HOME}/.tor-browser-cs
14whitelist ${HOME}/.tor-browser-da
15whitelist ${HOME}/.tor-browser-de
16whitelist ${HOME}/.tor-browser-el
17whitelist ${HOME}/.tor-browser-en
18whitelist ${HOME}/.tor-browser-en-us
19whitelist ${HOME}/.tor-browser-es
20whitelist ${HOME}/.tor-browser-es-es
21whitelist ${HOME}/.tor-browser-fa
22whitelist ${HOME}/.tor-browser-fr
23whitelist ${HOME}/.tor-browser-ga-ie
24whitelist ${HOME}/.tor-browser-he
25whitelist ${HOME}/.tor-browser-hu
26whitelist ${HOME}/.tor-browser-id
27whitelist ${HOME}/.tor-browser-is
28whitelist ${HOME}/.tor-browser-it
29whitelist ${HOME}/.tor-browser-ja
30whitelist ${HOME}/.tor-browser-ka
31whitelist ${HOME}/.tor-browser-ko
32whitelist ${HOME}/.tor-browser-nb
33whitelist ${HOME}/.tor-browser-nl
34whitelist ${HOME}/.tor-browser-pl
35whitelist ${HOME}/.tor-browser-pt-br
36whitelist ${HOME}/.tor-browser-ru
37whitelist ${HOME}/.tor-browser-sv-se
38whitelist ${HOME}/.tor-browser-tr
39whitelist ${HOME}/.tor-browser-vi
40whitelist ${HOME}/.tor-browser-zh-cn
41whitelist ${HOME}/.tor-browser-zh-tw
42
43whitelist ${HOME}/.tor-browser_ar
44whitelist ${HOME}/.tor-browser_ca
45whitelist ${HOME}/.tor-browser_cs
46whitelist ${HOME}/.tor-browser_da
47whitelist ${HOME}/.tor-browser_de
48whitelist ${HOME}/.tor-browser_el
49whitelist ${HOME}/.tor-browser_en
50whitelist ${HOME}/.tor-browser_en_US
51whitelist ${HOME}/.tor-browser_es
52whitelist ${HOME}/.tor-browser_es-ES
53whitelist ${HOME}/.tor-browser_fa
54whitelist ${HOME}/.tor-browser_fr
55whitelist ${HOME}/.tor-browser_ga-IE
56whitelist ${HOME}/.tor-browser_he
57whitelist ${HOME}/.tor-browser_hu
58whitelist ${HOME}/.tor-browser_id
59whitelist ${HOME}/.tor-browser_is
60whitelist ${HOME}/.tor-browser_it
61whitelist ${HOME}/.tor-browser_ja
62whitelist ${HOME}/.tor-browser_ka
63whitelist ${HOME}/.tor-browser_ko
64whitelist ${HOME}/.tor-browser_nb
65whitelist ${HOME}/.tor-browser_nl
66whitelist ${HOME}/.tor-browser_pl
67whitelist ${HOME}/.tor-browser_pt-BR
68whitelist ${HOME}/.tor-browser_ru
69whitelist ${HOME}/.tor-browser_sv-SE
70whitelist ${HOME}/.tor-browser_tr
71whitelist ${HOME}/.tor-browser_vi
72whitelist ${HOME}/.tor-browser_zh-CN
73whitelist ${HOME}/.tor-browser_zh-TW
74
75# Redirect
76include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/start-tor-browser.profile b/etc/profile-m-z/start-tor-browser.profile
new file mode 100644
index 000000000..17ceedee7
--- /dev/null
+++ b/etc/profile-m-z/start-tor-browser.profile
@@ -0,0 +1,10 @@
1# Firejail profile for start-tor-browser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include start-tor-browser.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include start-tor-browser.desktop.profile
diff --git a/etc/profile-m-z/steam-native.profile b/etc/profile-m-z/steam-native.profile
new file mode 100644
index 000000000..6b4281c5c
--- /dev/null
+++ b/etc/profile-m-z/steam-native.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for steam
2# This file is overwritten after every install/update
3# Persistent local customizations
4include steam-native.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include steam.profile
diff --git a/etc/profile-m-z/steam-runtime.profile b/etc/profile-m-z/steam-runtime.profile
new file mode 100644
index 000000000..a7e128d40
--- /dev/null
+++ b/etc/profile-m-z/steam-runtime.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for steam
2# This file is overwritten after every install/update
3# Persistent local customizations
4include steam-runtime.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include steam.profile
diff --git a/etc/profile-m-z/steam.profile b/etc/profile-m-z/steam.profile
new file mode 100644
index 000000000..dfefd7c2c
--- /dev/null
+++ b/etc/profile-m-z/steam.profile
@@ -0,0 +1,165 @@
1# Firejail profile for steam
2# Description: Valve's Steam digital software delivery system
3# This file is overwritten after every install/update
4# Persistent local customizations
5include steam.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Epic
10noblacklist ${HOME}/.config/Loop_Hero
11noblacklist ${HOME}/.config/ModTheSpire
12noblacklist ${HOME}/.config/RogueLegacy
13noblacklist ${HOME}/.config/RogueLegacyStorageContainer
14noblacklist ${HOME}/.killingfloor
15noblacklist ${HOME}/.klei
16noblacklist ${HOME}/.local/share/3909/PapersPlease
17noblacklist ${HOME}/.local/share/aspyr-media
18noblacklist ${HOME}/.local/share/bohemiainteractive
19noblacklist ${HOME}/.local/share/cdprojektred
20noblacklist ${HOME}/.local/share/Dredmor
21noblacklist ${HOME}/.local/share/FasterThanLight
22noblacklist ${HOME}/.local/share/feral-interactive
23noblacklist ${HOME}/.local/share/IntoTheBreach
24noblacklist ${HOME}/.local/share/Paradox Interactive
25noblacklist ${HOME}/.local/share/PillarsOfEternity
26noblacklist ${HOME}/.local/share/RogueLegacy
27noblacklist ${HOME}/.local/share/RogueLegacyStorageContainer
28noblacklist ${HOME}/.local/share/Steam
29noblacklist ${HOME}/.local/share/SteamWorldDig
30noblacklist ${HOME}/.local/share/SteamWorld Dig 2
31noblacklist ${HOME}/.local/share/SuperHexagon
32noblacklist ${HOME}/.local/share/Terraria
33noblacklist ${HOME}/.local/share/vpltd
34noblacklist ${HOME}/.local/share/vulkan
35noblacklist ${HOME}/.mbwarband
36noblacklist ${HOME}/.paradoxinteractive
37noblacklist ${HOME}/.steam
38noblacklist ${HOME}/.steampath
39noblacklist ${HOME}/.steampid
40# needed for STEAM_RUNTIME_PREFER_HOST_LIBRARIES=1 to work
41noblacklist /sbin
42noblacklist /usr/sbin
43
44# Allow java (blacklisted by disable-devel.inc)
45include allow-java.inc
46
47# Allow python (blacklisted by disable-interpreters.inc)
48include allow-python2.inc
49include allow-python3.inc
50
51include disable-common.inc
52include disable-devel.inc
53include disable-interpreters.inc
54include disable-programs.inc
55
56mkdir ${HOME}/.config/Epic
57mkdir ${HOME}/.config/Loop_Hero
58mkdir ${HOME}/.config/ModTheSpire
59mkdir ${HOME}/.config/RogueLegacy
60mkdir ${HOME}/.config/unity3d
61mkdir ${HOME}/.killingfloor
62mkdir ${HOME}/.klei
63mkdir ${HOME}/.local/share/3909/PapersPlease
64mkdir ${HOME}/.local/share/aspyr-media
65mkdir ${HOME}/.local/share/bohemiainteractive
66mkdir ${HOME}/.local/share/cdprojektred
67mkdir ${HOME}/.local/share/Dredmor
68mkdir ${HOME}/.local/share/FasterThanLight
69mkdir ${HOME}/.local/share/feral-interactive
70mkdir ${HOME}/.local/share/IntoTheBreach
71mkdir ${HOME}/.local/share/Paradox Interactive
72mkdir ${HOME}/.local/share/PillarsOfEternity
73mkdir ${HOME}/.local/share/RogueLegacy
74mkdir ${HOME}/.local/share/Steam
75mkdir ${HOME}/.local/share/SteamWorldDig
76mkdir ${HOME}/.local/share/SteamWorld Dig 2
77mkdir ${HOME}/.local/share/SuperHexagon
78mkdir ${HOME}/.local/share/Terraria
79mkdir ${HOME}/.local/share/vpltd
80mkdir ${HOME}/.local/share/vulkan
81mkdir ${HOME}/.mbwarband
82mkdir ${HOME}/.paradoxinteractive
83mkdir ${HOME}/.steam
84mkfile ${HOME}/.steampath
85mkfile ${HOME}/.steampid
86whitelist ${HOME}/.config/Epic
87whitelist ${HOME}/.config/Loop_Hero
88whitelist ${HOME}/.config/ModTheSpire
89whitelist ${HOME}/.config/RogueLegacy
90whitelist ${HOME}/.config/RogueLegacyStorageContainer
91whitelist ${HOME}/.config/unity3d
92whitelist ${HOME}/.killingfloor
93whitelist ${HOME}/.klei
94whitelist ${HOME}/.local/share/3909/PapersPlease
95whitelist ${HOME}/.local/share/aspyr-media
96whitelist ${HOME}/.local/share/bohemiainteractive
97whitelist ${HOME}/.local/share/cdprojektred
98whitelist ${HOME}/.local/share/Dredmor
99whitelist ${HOME}/.local/share/FasterThanLight
100whitelist ${HOME}/.local/share/feral-interactive
101whitelist ${HOME}/.local/share/IntoTheBreach
102whitelist ${HOME}/.local/share/Paradox Interactive
103whitelist ${HOME}/.local/share/PillarsOfEternity
104whitelist ${HOME}/.local/share/RogueLegacy
105whitelist ${HOME}/.local/share/RogueLegacyStorageContainer
106whitelist ${HOME}/.local/share/Steam
107whitelist ${HOME}/.local/share/SteamWorldDig
108whitelist ${HOME}/.local/share/SteamWorld Dig 2
109whitelist ${HOME}/.local/share/SuperHexagon
110whitelist ${HOME}/.local/share/Terraria
111whitelist ${HOME}/.local/share/vpltd
112whitelist ${HOME}/.local/share/vulkan
113whitelist ${HOME}/.mbwarband
114whitelist ${HOME}/.paradoxinteractive
115whitelist ${HOME}/.steam
116whitelist ${HOME}/.steampath
117whitelist ${HOME}/.steampid
118include whitelist-common.inc
119include whitelist-var-common.inc
120
121# NOTE: The following were intentionally left out as they are alternative
122# (i.e.: unnecessary and/or legacy) paths whose existence may potentially
123# clobber other paths (see #4225). If you use any, either add the entry to
124# steam.local or move the contents to a path listed above (or open an issue if
125# it's missing above).
126#mkdir ${HOME}/.config/RogueLegacyStorageContainer
127#mkdir ${HOME}/.local/share/RogueLegacyStorageContainer
128
129caps.drop all
130#ipc-namespace
131netfilter
132nodvd
133nogroups
134nonewprivs
135# If you use nVidia you might need to add 'ignore noroot' to your steam.local.
136noroot
137notv
138nou2f
139# For VR support add 'ignore novideo' to your steam.local.
140novideo
141protocol unix,inet,inet6,netlink
142# seccomp sometimes causes issues (see #2951, #3267).
143# Add 'ignore seccomp' to your steam.local if you experience this.
144seccomp !ptrace
145shell none
146# tracelog breaks integrated browser
147#tracelog
148
149# private-bin is disabled while in testing, but is known to work with multiple games.
150# Add the next line to your steam.local to enable private-bin.
151#private-bin awk,basename,bash,bsdtar,bzip2,cat,chmod,cksum,cmp,comm,compress,cp,curl,cut,date,dbus-launch,dbus-send,desktop-file-edit,desktop-file-install,desktop-file-validate,dirname,echo,env,expr,file,find,getopt,grep,gtar,gzip,head,hostname,id,lbzip2,ldconfig,ldd,ln,ls,lsb_release,lsof,lspci,lz4,lzip,lzma,lzop,md5sum,mkdir,mktemp,mv,netstat,ps,pulseaudio,python*,readlink,realpath,rm,sed,sh,sha1sum,sha256sum,sha512sum,sleep,sort,steam,steamdeps,steam-native,steam-runtime,sum,tail,tar,tclsh,test,touch,tr,umask,uname,update-desktop-database,wc,wget,which,whoami,xterm,xz,zenity
152# Extra programs are available which might be needed for select games.
153# Add the next line to your steam.local to enable support for these programs.
154#private-bin java,java-config,mono
155# To view screenshots add the next line to your steam.local.
156#private-bin eog,eom,gthumb,pix,viewnior,xviewer
157
158private-dev
159# private-etc breaks a small selection of games on some systems. Add 'ignore private-etc'
160# to your steam.local to support those.
161private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,lsb-release,machine-id,mime.types,nvidia,os-release,passwd,pki,pulse,resolv.conf,services,ssl
162private-tmp
163
164# dbus-user none
165# dbus-system none
diff --git a/etc/profile-m-z/stellarium.profile b/etc/profile-m-z/stellarium.profile
new file mode 100644
index 000000000..d2ebce45f
--- /dev/null
+++ b/etc/profile-m-z/stellarium.profile
@@ -0,0 +1,46 @@
1# Firejail profile for stellarium
2# Description: Real-time photo-realistic sky generator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include stellarium.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/stellarium
10noblacklist ${HOME}/.stellarium
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18
19mkdir ${HOME}/.config/stellarium
20mkdir ${HOME}/.stellarium
21whitelist ${HOME}/.config/stellarium
22whitelist ${HOME}/.stellarium
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27machine-id
28netfilter
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37protocol unix,inet,inet6,netlink
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin stellarium
44private-dev
45private-tmp
46
diff --git a/etc/profile-m-z/straw-viewer.profile b/etc/profile-m-z/straw-viewer.profile
new file mode 100644
index 000000000..d73927f2a
--- /dev/null
+++ b/etc/profile-m-z/straw-viewer.profile
@@ -0,0 +1,21 @@
1# Firejail profile for straw-viewer
2# Description: Fork of youtube-viewer acts like an invidious frontend
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include straw-viewer.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.cache/straw-viewer
11noblacklist ${HOME}/.config/straw-viewer
12
13mkdir ${HOME}/.config/straw-viewer
14mkdir ${HOME}/.cache/straw-viewer
15whitelist ${HOME}/.cache/straw-viewer
16whitelist ${HOME}/.config/straw-viewer
17
18private-bin gtk-straw-viewer,straw-viewer
19
20# Redirect
21include youtube-viewers-common.profile \ No newline at end of file
diff --git a/etc/profile-m-z/strawberry.profile b/etc/profile-m-z/strawberry.profile
new file mode 100644
index 000000000..dfb0a3e3b
--- /dev/null
+++ b/etc/profile-m-z/strawberry.profile
@@ -0,0 +1,49 @@
1# Firejail profile for strawberry
2# Description: A music player and music collection organizer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include strawberry.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/strawberry
10noblacklist ${HOME}/.config/strawberry
11noblacklist ${HOME}/.local/share/strawberry
12noblacklist ${MUSIC}
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-xdg.inc
20
21include whitelist-runuser-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37# blacklisting of ioprio_set system calls breaks strawberry
38seccomp !ioprio_set
39shell none
40tracelog
41
42disable-mnt
43private-bin strawberry,strawberry-tagreader
44private-cache
45private-dev
46private-etc ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,nsswitch.conf,pki,resolv.conf,ssl
47private-tmp
48
49dbus-system none
diff --git a/etc/profile-m-z/strings.profile b/etc/profile-m-z/strings.profile
new file mode 100644
index 000000000..9298e6614
--- /dev/null
+++ b/etc/profile-m-z/strings.profile
@@ -0,0 +1,57 @@
1# Firejail profile for strings
2# Description: print the strings of printable characters in files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include strings.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}
11
12#include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16#include disable-programs.inc
17include disable-shell.inc
18#include disable-xdg.inc
19
20#include whitelist-usr-share-common.inc
21#include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25ipc-namespace
26machine-id
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33#noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40seccomp.block-secondary
41shell none
42tracelog
43x11 none
44
45#private
46#private-bin strings
47private-cache
48private-dev
49#private-etc alternatives
50#private-lib libfakeroot
51private-tmp
52
53dbus-user none
54dbus-system none
55
56memory-deny-write-execute
57read-only ${HOME}
diff --git a/etc/profile-m-z/studio.sh.profile b/etc/profile-m-z/studio.sh.profile
new file mode 100644
index 000000000..8df11eef2
--- /dev/null
+++ b/etc/profile-m-z/studio.sh.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for Android Studio
2# This file is overwritten after every install/update
3# Persistent local customizations
4include studio.sh.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include android-studio.profile
diff --git a/etc/profile-m-z/subdownloader.profile b/etc/profile-m-z/subdownloader.profile
new file mode 100644
index 000000000..100ac9d14
--- /dev/null
+++ b/etc/profile-m-z/subdownloader.profile
@@ -0,0 +1,53 @@
1# Firejail profile for subdownloader
2# Description: Automatic download/upload of subtitles using fast hashing
3# This file is overwritten after every install/update
4# Persistent local customizations
5include subdownloader.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/SubDownloader
10noblacklist ${VIDEOS}
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45private-cache
46private-dev
47private-etc alternatives,fonts
48private-tmp
49
50dbus-user none
51dbus-system none
52
53#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-m-z/sum.profile b/etc/profile-m-z/sum.profile
new file mode 100644
index 000000000..cd73af919
--- /dev/null
+++ b/etc/profile-m-z/sum.profile
@@ -0,0 +1,13 @@
1# Firejail profile for sum
2# Description: checksum and count the blocks in a file
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include sum.local
7# Persistent global definitions
8include globals.local
9
10private-bin sum
11
12# Redirect
13include hasher-common.profile
diff --git a/etc/profile-m-z/supertux2.profile b/etc/profile-m-z/supertux2.profile
new file mode 100644
index 000000000..0e9113821
--- /dev/null
+++ b/etc/profile-m-z/supertux2.profile
@@ -0,0 +1,53 @@
1# Firejail profile for supertux2
2# Description: Jump'n run like game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include supertux2.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/supertux2
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.local/share/supertux2
20whitelist ${HOME}/.local/share/supertux2
21whitelist /usr/share/supertux2
22whitelist /usr/share/games/supertux2 # Debian version
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30net none
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,netlink
40seccomp
41seccomp.block-secondary
42shell none
43tracelog
44
45disable-mnt
46# private-bin supertux2
47private-cache
48private-etc machine-id
49private-dev
50private-tmp
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-m-z/supertuxkart-wrapper.profile b/etc/profile-m-z/supertuxkart-wrapper.profile
new file mode 100644
index 000000000..af8d73deb
--- /dev/null
+++ b/etc/profile-m-z/supertuxkart-wrapper.profile
@@ -0,0 +1,14 @@
1# Firejail profile for supertuxkart-wrapper
2# This file is overwritten after every install/update
3# Persistent local customizations
4include supertuxkart-wrapper.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9include allow-opengl-game.inc
10
11private-bin supertuxkart-wrapper
12
13# Redirect
14include supertuxkart.profile
diff --git a/etc/profile-m-z/supertuxkart.profile b/etc/profile-m-z/supertuxkart.profile
new file mode 100644
index 000000000..7ba7e7023
--- /dev/null
+++ b/etc/profile-m-z/supertuxkart.profile
@@ -0,0 +1,63 @@
1# Firejail profile for supertuxkart
2# Description: Free kart racing game.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include supertuxkart.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/supertuxkart
10noblacklist ${HOME}/.cache/supertuxkart
11noblacklist ${HOME}/.local/share/supertuxkart
12
13blacklist /usr/libexec
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.config/supertuxkart
24mkdir ${HOME}/.cache/supertuxkart
25mkdir ${HOME}/.local/share/supertuxkart
26whitelist ${HOME}/.config/supertuxkart
27whitelist ${HOME}/.cache/supertuxkart
28whitelist ${HOME}/.local/share/supertuxkart
29whitelist /usr/share/supertuxkart
30whitelist /usr/share/games/supertuxkart # Debian version
31include whitelist-common.inc
32include whitelist-runuser-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38netfilter
39nodvd
40nogroups
41nonewprivs
42noroot
43notv
44nou2f
45novideo
46protocol unix,inet,inet6,bluetooth
47seccomp
48seccomp.block-secondary
49shell none
50tracelog
51
52disable-mnt
53private-bin supertuxkart
54private-cache
55# Add the next line to your supertuxkart.local if you do not need controller support.
56#private-dev
57private-etc alternatives,ca-certificates,crypto-policies,drirc,hosts,machine-id,openal,pki,resolv.conf,ssl
58private-tmp
59private-opt none
60private-srv none
61
62dbus-user none
63dbus-system none
diff --git a/etc/profile-m-z/surf.profile b/etc/profile-m-z/surf.profile
new file mode 100644
index 000000000..7c092fccc
--- /dev/null
+++ b/etc/profile-m-z/surf.profile
@@ -0,0 +1,39 @@
1# Firejail profile for surf
2# Description: Simple web browser by suckless community
3# This file is overwritten after every install/update
4# Persistent local customizations
5include surf.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.surf
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-programs.inc
15
16mkdir ${HOME}/.surf
17whitelist ${HOME}/.surf
18whitelist ${DOWNLOADS}
19include whitelist-common.inc
20
21caps.drop all
22netfilter
23nodvd
24noinput
25nonewprivs
26noroot
27notv
28nou2f
29protocol unix,inet,inet6,netlink
30seccomp
31shell none
32tracelog
33
34disable-mnt
35private-bin bash,curl,dmenu,ls,printf,sed,sh,sleep,st,stterm,surf,xargs,xprop
36private-dev
37private-etc alternatives,ca-certificates,crypto-policies,fonts,group,hosts,machine-id,passwd,pki,resolv.conf,ssl
38private-tmp
39
diff --git a/etc/profile-m-z/sushi.profile b/etc/profile-m-z/sushi.profile
new file mode 100644
index 000000000..621622043
--- /dev/null
+++ b/etc/profile-m-z/sushi.profile
@@ -0,0 +1,48 @@
1# Firejail profile for sushi
2# Description: A quick previewer for Nautilus
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sushi.local
6# Persistent global definitions
7include globals.local
8
9# Allow gjs (blacklisted by disable-interpreters.inc)
10include allow-gjs.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16# include disable-programs.inc
17include disable-shell.inc
18
19include whitelist-runuser-common.inc
20
21apparmor
22caps.drop all
23net none
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29notv
30nou2f
31novideo
32protocol unix
33seccomp
34shell none
35tracelog
36
37private-bin gjs,sushi
38private-dev
39private-tmp
40
41dbus-system none
42
43read-only /
44read-only /mnt
45read-only /media
46read-only /run/mount
47read-only /run/media
48read-only ${HOME}
diff --git a/etc/profile-m-z/sway.profile b/etc/profile-m-z/sway.profile
new file mode 100644
index 000000000..4637419bf
--- /dev/null
+++ b/etc/profile-m-z/sway.profile
@@ -0,0 +1,19 @@
1# Firejail profile for Sway
2# Description: i3-compatible Wayland compositor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sway.local
6# Persistent global definitions
7include globals.local
8
9# all applications started in sway will run in this profile
10noblacklist ${HOME}/.config/sway
11# sway uses ~/.config/i3 as fallback if there is no ~/.config/sway
12noblacklist ${HOME}/.config/i3
13include disable-common.inc
14
15caps.drop all
16netfilter
17noroot
18protocol unix,inet,inet6
19seccomp
diff --git a/etc/profile-m-z/swell-foop.profile b/etc/profile-m-z/swell-foop.profile
new file mode 100644
index 000000000..9efae815d
--- /dev/null
+++ b/etc/profile-m-z/swell-foop.profile
@@ -0,0 +1,21 @@
1# Firejail profile for swell-foop
2# Description: GNOME colored tiles puzzle game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include swell-foop.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.local/share/swell-foop
10
11mkdir ${HOME}/.local/share/swell-foop
12whitelist ${HOME}/.local/share/swell-foop
13
14whitelist /usr/share/swell-foop
15
16private-bin swell-foop
17
18dbus-user.own org.gnome.SwellFoop
19
20# Redirect
21include gnome_games-common.profile
diff --git a/etc/profile-m-z/sylpheed.profile b/etc/profile-m-z/sylpheed.profile
new file mode 100644
index 000000000..328812b04
--- /dev/null
+++ b/etc/profile-m-z/sylpheed.profile
@@ -0,0 +1,26 @@
1# Firejail profile for sylpheed
2# Description: Light weight e-mail client with GTK+
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sylpheed.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.sylpheed-2.0
10
11mkdir ${HOME}/.sylpheed-2.0
12whitelist ${HOME}/.sylpheed-2.0
13
14whitelist /usr/share/sylpheed
15
16# private-bin curl,gpg,gpg2,gpg-agent,gpgsm,pinentry,pinentry-gtk-2,sylpheed
17
18dbus-user filter
19dbus-user.talk ca.desrt.dconf
20dbus-user.talk org.freedesktop.secrets
21dbus-user.talk org.gnome.keyring.SystemPrompter
22# Add the next line to your sylpheed.local to enable notifications.
23# dbus-user.talk org.freedesktop.Notifications
24
25# Redirect
26include email-common.profile
diff --git a/etc/synfigstudio.profile b/etc/profile-m-z/synfigstudio.profile
index 2617c0e51..7f23992a8 100644
--- a/etc/synfigstudio.profile
+++ b/etc/profile-m-z/synfigstudio.profile
@@ -1,34 +1,39 @@
1# Firejail profile for synfigstudio 1# Firejail profile for synfigstudio
2# Description: Vector-based 2D animation package
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/synfigstudio.local 5include synfigstudio.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/synfig 9noblacklist ${HOME}/.config/synfig
9noblacklist ${HOME}/.synfig 10noblacklist ${HOME}/.synfig
10 11
11include /etc/firejail/disable-common.inc 12include disable-common.inc
12include /etc/firejail/disable-devel.inc 13include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
14include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
15 17
16caps.drop all 18caps.drop all
17net none 19net none
18nodvd 20nodvd
19nogroups 21nogroups
22noinput
20nonewprivs 23nonewprivs
21noroot 24noroot
22nosound 25nosound
23notv 26notv
27nou2f
24novideo 28novideo
25protocol unix 29protocol unix
26seccomp 30seccomp
27shell none 31shell none
28 32
29#private-bin synfigstudio,synfig,ffmpeg 33#private-bin ffmpeg,synfig,synfigstudio
34private-cache
30private-dev 35private-dev
31private-tmp 36private-tmp
32 37
33noexec ${HOME} 38dbus-user none
34noexec /tmp 39dbus-system none
diff --git a/etc/profile-m-z/sysprof-cli.profile b/etc/profile-m-z/sysprof-cli.profile
new file mode 100644
index 000000000..8f4de130b
--- /dev/null
+++ b/etc/profile-m-z/sysprof-cli.profile
@@ -0,0 +1,20 @@
1# Firejail profile for sysprof-cli
2# Description: Kernel based performance profiler (CLI)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sysprof-cli.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# There is no GUI help menu to break in the CLI version
11private-bin sysprof-cli
12private-lib
13
14dbus-user none
15dbus-system none
16
17memory-deny-write-execute
18
19# Redirect
20include sysprof.profile
diff --git a/etc/profile-m-z/sysprof.profile b/etc/profile-m-z/sysprof.profile
new file mode 100644
index 000000000..ac4a380bb
--- /dev/null
+++ b/etc/profile-m-z/sysprof.profile
@@ -0,0 +1,77 @@
1# Firejail profile for sysprof
2# Description: Kernel based performance profiler (GUI)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include sysprof.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
16
17# Add the next lines to your sysprof.local if you don't need (yelp) help menu functionality.
18#ignore noblacklist ${HOME}/.config/yelp
19#ignore mkdir ${HOME}/.config/yelp
20#nowhitelist ${HOME}/.config/yelp
21#nowhitelist /usr/share/help/C/sysprof
22#nowhitelist /usr/share/yelp
23#nowhitelist /usr/share/yelp-tools
24#nowhitelist /usr/share/yelp-xsl
25
26noblacklist ${HOME}/.config/yelp
27mkdir ${HOME}/.config/yelp
28whitelist ${HOME}/.config/yelp
29whitelist /usr/share/help/C/sysprof
30whitelist /usr/share/yelp
31whitelist /usr/share/yelp-tools
32whitelist /usr/share/yelp-xsl
33
34whitelist ${DOCUMENTS}
35include whitelist-common.inc
36include whitelist-runuser-common.inc
37include whitelist-usr-share-common.inc
38include whitelist-var-common.inc
39
40apparmor
41caps.drop all
42ipc-namespace
43machine-id
44net none
45no3d
46nodvd
47nogroups
48noinput
49nonewprivs
50# Some older Debian/Ubuntu sysprof versions need root privileges.
51# Add 'ignore noroot' to your sysprof.local if you run one of these.
52noroot
53nosound
54notv
55nou2f
56novideo
57protocol unix,netlink
58seccomp
59shell none
60tracelog
61
62disable-mnt
63#private-bin sysprof - breaks help menu
64private-cache
65private-dev
66private-etc alternatives,fonts,ld.so.cache,machine-id,ssl
67# private-lib - breaks help menu
68#private-lib gdk-pixbuf-2.*,gio,gtk3,gvfs/libgvfscommon.so,libgconf-2.so.*,librsvg-2.so.*,libsysprof-2.so,libsysprof-ui-2.so
69private-tmp
70
71dbus-user filter
72dbus-user.own org.gnome.Shell
73dbus-user.own org.gnome.Yelp
74dbus-user.own org.gnome.Sysprof3
75dbus-user.talk ca.desrt.dconf
76
77# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-m-z/tar.profile b/etc/profile-m-z/tar.profile
new file mode 100644
index 000000000..0d3a900e9
--- /dev/null
+++ b/etc/profile-m-z/tar.profile
@@ -0,0 +1,23 @@
1# Firejail profile for tar
2# Description: GNU version of the tar archiving utility
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include tar.local
7# Persistent global definitions
8include globals.local
9
10# Included in archiver-common.profile
11ignore include disable-shell.inc
12
13# Arch Linux (based distributions) need access to /var/lib/pacman. As we drop
14# all capabilities this is automatically read-only.
15noblacklist /var/lib/pacman
16
17private-etc alternatives,group,localtime,login.defs,passwd
18#private-lib libfakeroot,liblzma.so.*,libreadline.so.*
19# Debian based distributions need this for 'dpkg --unpack' (incl. synaptic)
20writable-var
21
22# Redirect
23include archiver-common.profile
diff --git a/etc/profile-m-z/tb-starter-wrapper.profile b/etc/profile-m-z/tb-starter-wrapper.profile
new file mode 100644
index 000000000..ffe9605b6
--- /dev/null
+++ b/etc/profile-m-z/tb-starter-wrapper.profile
@@ -0,0 +1,19 @@
1# Firejail profile for tb-starter-wrapper
2# Description: wrapper-script used by whonix to start the tor browser
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include tb-starter-wrapper.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11noblacklist ${HOME}/.tb
12
13mkdir ${HOME}/.tb
14whitelist ${HOME}/.tb
15
16private-bin tb-starter-wrapper
17
18# Redirect
19include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tcpdump.profile b/etc/profile-m-z/tcpdump.profile
new file mode 100644
index 000000000..57301a54d
--- /dev/null
+++ b/etc/profile-m-z/tcpdump.profile
@@ -0,0 +1,46 @@
1# Firejail profile for tcpdump
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include tcpdump.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /sbin
10noblacklist /usr/sbin
11noblacklist ${PATH}/tcpdump
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-common.inc
21
22apparmor
23caps.keep net_raw
24ipc-namespace
25#net tun0
26netfilter
27no3d
28nodvd
29#nogroups
30noinput
31nonewprivs
32#noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix,inet,inet6,netlink,packet,bluetooth
38seccomp
39
40disable-mnt
41#private
42#private-bin tcpdump
43private-dev
44private-tmp
45
46memory-deny-write-execute
diff --git a/etc/profile-m-z/teams-for-linux.profile b/etc/profile-m-z/teams-for-linux.profile
new file mode 100644
index 000000000..c97921d92
--- /dev/null
+++ b/etc/profile-m-z/teams-for-linux.profile
@@ -0,0 +1,26 @@
1# Firejail profile for teams-for-linux
2# Description: Unofficial Microsoft Teams client for Linux using Electron.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include teams-for-linux.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore include disable-xdg.inc
11ignore include whitelist-runuser-common.inc
12ignore include whitelist-usr-share-common.inc
13
14ignore dbus-user none
15ignore dbus-system none
16
17noblacklist ${HOME}/.config/teams-for-linux
18
19mkdir ${HOME}/.config/teams-for-linux
20whitelist ${HOME}/.config/teams-for-linux
21
22private-bin bash,cut,echo,egrep,electron,electron[0-9],electron[0-9][0-9],grep,head,sed,sh,teams-for-linux,tr,xdg-mime,xdg-open,zsh
23private-etc ca-certificates,crypto-policies,fonts,ld.so.cache,localtime,machine-id,pki,resolv.conf,ssl
24
25# Redirect
26include electron.profile
diff --git a/etc/profile-m-z/teams.profile b/etc/profile-m-z/teams.profile
new file mode 100644
index 000000000..c8d98cbaa
--- /dev/null
+++ b/etc/profile-m-z/teams.profile
@@ -0,0 +1,30 @@
1# Firejail profile for teams
2# Description: Official Microsoft Teams client for Linux using Electron.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include teams.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore include disable-xdg.inc
11ignore include whitelist-runuser-common.inc
12ignore include whitelist-usr-share-common.inc
13ignore novideo
14ignore private-tmp
15
16# see #3404
17ignore apparmor
18ignore dbus-user none
19ignore dbus-system none
20
21noblacklist ${HOME}/.config/teams
22noblacklist ${HOME}/.config/Microsoft
23
24mkdir ${HOME}/.config/teams
25mkdir ${HOME}/.config/Microsoft
26whitelist ${HOME}/.config/teams
27whitelist ${HOME}/.config/Microsoft
28
29# Redirect
30include electron.profile
diff --git a/etc/teamspeak3.profile b/etc/profile-m-z/teamspeak3.profile
index 86f96ba50..c149473f6 100644
--- a/etc/teamspeak3.profile
+++ b/etc/profile-m-z/teamspeak3.profile
@@ -1,21 +1,24 @@
1# Firejail profile for teamspeak3 1# Firejail profile for teamspeak3
2# Description: TeamSpeak is software for quality voice communication via the Internet
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/teamspeak3.local 5include teamspeak3.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.ts3client 9noblacklist ${HOME}/.ts3client
10noblacklist ${PATH}/openssl
9 11
10include /etc/firejail/disable-common.inc 12include disable-common.inc
11include /etc/firejail/disable-devel.inc 13include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 14include disable-exec.inc
13include /etc/firejail/disable-programs.inc 15include disable-interpreters.inc
16include disable-programs.inc
14 17
15mkdir ${HOME}/.ts3client 18mkdir ${HOME}/.ts3client
16whitelist ${DOWNLOADS} 19whitelist ${DOWNLOADS}
17whitelist ${HOME}/.ts3client 20whitelist ${HOME}/.ts3client
18include /etc/firejail/whitelist-common.inc 21include whitelist-common.inc
19 22
20caps.drop all 23caps.drop all
21ipc-namespace 24ipc-namespace
@@ -23,17 +26,17 @@ netfilter
23no3d 26no3d
24nodvd 27nodvd
25nogroups 28nogroups
29noinput
26nonewprivs 30nonewprivs
27noroot 31noroot
28notv 32notv
33nou2f
29novideo 34novideo
30protocol unix,inet,inet6 35protocol unix,inet,inet6,netlink
31seccomp 36seccomp !chroot
32shell none 37shell none
33 38
34disable-mnt 39disable-mnt
35private-dev 40private-dev
36private-tmp 41private-tmp
37 42
38noexec ${HOME}
39noexec /tmp
diff --git a/etc/profile-m-z/teeworlds.profile b/etc/profile-m-z/teeworlds.profile
new file mode 100644
index 000000000..df54fb9ba
--- /dev/null
+++ b/etc/profile-m-z/teeworlds.profile
@@ -0,0 +1,47 @@
1# Firejail profile for teeworlds
2# Description: Online multi-player platform 2D shooter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include teeworlds.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.teeworlds
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.teeworlds
20whitelist ${HOME}/.teeworlds
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25ipc-namespace
26netfilter
27nodvd
28nogroups
29noinput
30nonewprivs
31noroot
32notv
33nou2f
34novideo
35protocol unix,inet,inet6
36seccomp
37shell none
38tracelog
39
40disable-mnt
41private-bin teeworlds
42private-cache
43private-dev
44private-tmp
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-m-z/telegram-desktop.profile b/etc/profile-m-z/telegram-desktop.profile
new file mode 100644
index 000000000..7463b761f
--- /dev/null
+++ b/etc/profile-m-z/telegram-desktop.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for telegram
2# Description: Official Telegram Desktop client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include telegram-desktop.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include telegram.profile
diff --git a/etc/profile-m-z/telegram.profile b/etc/profile-m-z/telegram.profile
new file mode 100644
index 000000000..115be54eb
--- /dev/null
+++ b/etc/profile-m-z/telegram.profile
@@ -0,0 +1,56 @@
1# Firejail profile for telegram
2# This file is overwritten after every install/update
3# Persistent local customizations
4include telegram.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.TelegramDesktop
9noblacklist ${HOME}/.local/share/TelegramDesktop
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.TelegramDesktop
20mkdir ${HOME}/.local/share/TelegramDesktop
21whitelist ${HOME}/.TelegramDesktop
22whitelist ${HOME}/.local/share/TelegramDesktop
23whitelist ${DOWNLOADS}
24whitelist /usr/share/TelegramDesktop
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32netfilter
33nodvd
34noinput
35nonewprivs
36noroot
37notv
38protocol unix,inet,inet6,netlink
39seccomp
40seccomp.block-secondary
41shell none
42
43disable-mnt
44#private-bin telegram,Telegram,telegram-desktop
45private-cache
46private-dev
47private-etc alsa,alternatives,ca-certificates,crypto-policies,fonts,group,ld.so.cache,localtime,machine-id,os-release,passwd,pki,pulse,resolv.conf,ssl,xdg
48private-tmp
49
50dbus-user filter
51dbus-user.own org.telegram.desktop.*
52dbus-user.talk org.freedesktop.Notifications
53dbus-user.talk org.kde.StatusNotifierWatcher
54dbus-user.talk org.gnome.Mutter.IdleMonitor
55dbus-user.talk org.freedesktop.ScreenSaver
56dbus-system none
diff --git a/etc/profile-m-z/terasology.profile b/etc/profile-m-z/terasology.profile
new file mode 100644
index 000000000..0f6691b49
--- /dev/null
+++ b/etc/profile-m-z/terasology.profile
@@ -0,0 +1,48 @@
1# Firejail profile for terasology
2# This file is overwritten after every install/update
3# Persistent local customizations
4include terasology.local
5# Persistent global definitions
6include globals.local
7
8ignore noexec /tmp
9
10noblacklist ${HOME}/.local/share/terasology
11
12# Allow java (blacklisted by disable-devel.inc)
13include allow-java.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.java
22mkdir ${HOME}/.local/share/terasology
23whitelist ${HOME}/.java
24whitelist ${HOME}/.local/share/terasology
25include whitelist-common.inc
26
27caps.drop all
28ipc-namespace
29net none
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41
42disable-mnt
43private-dev
44private-etc alternatives,asound.conf,ca-certificates,crypto-policies,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,java-7-openjdk,java-8-openjdk,ld.so.cache,ld.so.preload,localtime,lsb-release,machine-id,mime.types,passwd,pki,pulse,resolv.conf,ssl
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-m-z/tex.profile b/etc/profile-m-z/tex.profile
new file mode 100644
index 000000000..f56c3038e
--- /dev/null
+++ b/etc/profile-m-z/tex.profile
@@ -0,0 +1,12 @@
1# Firejail profile for tex
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tex.local
5# Persistent global definitions
6include globals.local
7
8private-bin tex
9
10# Redirect
11include latex-common.profile
12
diff --git a/etc/profile-m-z/textmaker18.profile b/etc/profile-m-z/textmaker18.profile
new file mode 100644
index 000000000..e5a4b6454
--- /dev/null
+++ b/etc/profile-m-z/textmaker18.profile
@@ -0,0 +1,11 @@
1# Firejail profile for textmaker18
2# Description: SoftMaker Office - word processor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include textmaker18.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
11
diff --git a/etc/profile-m-z/textmaker18free.profile b/etc/profile-m-z/textmaker18free.profile
new file mode 100644
index 000000000..0e918bf0a
--- /dev/null
+++ b/etc/profile-m-z/textmaker18free.profile
@@ -0,0 +1,11 @@
1# Firejail profile for textmaker18free
2# Description: SoftMaker Office - word processor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include textmaker18free.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include softmaker-common.profile
11
diff --git a/etc/profile-m-z/thunar.profile b/etc/profile-m-z/thunar.profile
new file mode 100644
index 000000000..984c5579f
--- /dev/null
+++ b/etc/profile-m-z/thunar.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for Thunar
2# Description: Modern file manager for Xfce
3# This file is overwritten after every install/update
4# Persistent local customizations
5include thunar.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include Thunar.profile
diff --git a/etc/profile-m-z/thunderbird-beta.profile b/etc/profile-m-z/thunderbird-beta.profile
new file mode 100644
index 000000000..46a1e57c8
--- /dev/null
+++ b/etc/profile-m-z/thunderbird-beta.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for thunderbird-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include thunderbird-beta.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9private-opt thunderbird-beta
10
11# Redirect
12include thunderbird.profile
diff --git a/etc/profile-m-z/thunderbird-wayland.profile b/etc/profile-m-z/thunderbird-wayland.profile
new file mode 100644
index 000000000..9fbb80d29
--- /dev/null
+++ b/etc/profile-m-z/thunderbird-wayland.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for thunderbird-wayland
2# This file is overwritten after every install/update
3# Persistent local customizations
4include thunderbird-wayland.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include thunderbird.profile
diff --git a/etc/profile-m-z/thunderbird.profile b/etc/profile-m-z/thunderbird.profile
new file mode 100644
index 000000000..b66b81fdf
--- /dev/null
+++ b/etc/profile-m-z/thunderbird.profile
@@ -0,0 +1,63 @@
1# Firejail profile for thunderbird
2# Description: Email, RSS and newsgroup client with integrated spam filter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include thunderbird.local
6# Persistent global definitions
7include globals.local
8
9ignore include whitelist-runuser-common.inc
10
11# writable-run-user and dbus are needed by enigmail
12ignore dbus-user none
13ignore dbus-system none
14writable-run-user
15
16# If you want to read local mail stored in /var/mail edit /etc/apparmor.d/firejail-default accordingly
17# and add the following to thunderbird.local:
18#noblacklist /var/mail
19#noblacklist /var/spool/mail
20#whitelist /var/mail
21#whitelist /var/spool/mail
22#writable-var
23
24# These lines are needed to allow Firefox to load your profile when clicking a link in an email
25noblacklist ${HOME}/.mozilla
26whitelist ${HOME}/.mozilla/firefox/profiles.ini
27read-only ${HOME}/.mozilla/firefox/profiles.ini
28
29noblacklist ${HOME}/.cache/thunderbird
30noblacklist ${HOME}/.gnupg
31# noblacklist ${HOME}/.icedove
32noblacklist ${HOME}/.thunderbird
33
34include disable-xdg.inc
35
36# If you have setup Thunderbird to archive emails to a local folder,
37# make sure you add the path to that folder to the mkdir and whitelist
38# rules below. Otherwise they will be deleted when you close Thunderbird.
39# See https://github.com/netblue30/firejail/issues/2357
40mkdir ${HOME}/.cache/thunderbird
41mkdir ${HOME}/.gnupg
42# mkdir ${HOME}/.icedove
43mkdir ${HOME}/.thunderbird
44whitelist ${HOME}/.cache/thunderbird
45whitelist ${HOME}/.gnupg
46# whitelist ${HOME}/.icedove
47whitelist ${HOME}/.thunderbird
48
49whitelist /usr/share/gnupg
50whitelist /usr/share/mozilla
51whitelist /usr/share/thunderbird
52whitelist /usr/share/webext
53include whitelist-usr-share-common.inc
54
55# machine-id breaks audio in browsers; enable or put it in your thunderbird.local when sound is not required
56#machine-id
57novideo
58
59# We need the real /tmp for data exchange when xdg-open handles email attachments on KDE
60ignore private-tmp
61
62# Redirect
63include firefox-common.profile
diff --git a/etc/profile-m-z/tilp.profile b/etc/profile-m-z/tilp.profile
new file mode 100644
index 000000000..7c18aab50
--- /dev/null
+++ b/etc/profile-m-z/tilp.profile
@@ -0,0 +1,35 @@
1# Firejail profile for tilp
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tilp.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.tilp
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16
17caps.drop all
18net none
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24novideo
25protocol unix,netlink
26seccomp
27shell none
28tracelog
29
30disable-mnt
31private-bin tilp
32private-cache
33private-etc alternatives,fonts
34private-tmp
35
diff --git a/etc/profile-m-z/tin.profile b/etc/profile-m-z/tin.profile
new file mode 100644
index 000000000..039063c1e
--- /dev/null
+++ b/etc/profile-m-z/tin.profile
@@ -0,0 +1,68 @@
1# Firejail profile for tin
2# Description: ncurses-based Usenet newsreader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include tin.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.newsrc
10noblacklist ${HOME}/.tin
11
12blacklist /tmp/.X11-unix
13blacklist ${RUNUSER}
14blacklist /usr/libexec
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.tin
25mkfile ${HOME}/.newsrc
26# Note: files/directories directly in ${HOME} can't be whitelisted, as
27# tin saves .newsrc by renaming a temporary file, which is not possible for
28# bind-mounted files.
29#whitelist ${HOME}/.newsrc
30#whitelist ${HOME}/.tin
31#include whitelist-common.inc
32include whitelist-runuser-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38ipc-namespace
39machine-id
40netfilter
41no3d
42nodvd
43nogroups
44noinput
45nonewprivs
46noroot
47nosound
48notv
49nou2f
50novideo
51protocol inet,inet6
52seccomp
53seccomp.block-secondary
54shell none
55tracelog
56
57disable-mnt
58private-bin rtin,tin
59private-cache
60private-dev
61private-etc passwd,resolv.conf,terminfo,tin
62private-lib terminfo
63private-tmp
64
65dbus-user none
66dbus-system none
67
68memory-deny-write-execute
diff --git a/etc/profile-m-z/tmux.profile b/etc/profile-m-z/tmux.profile
new file mode 100644
index 000000000..1e783d2b9
--- /dev/null
+++ b/etc/profile-m-z/tmux.profile
@@ -0,0 +1,45 @@
1# Firejail profile for tmux
2# Description: terminal multiplexer
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include tmux.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13noblacklist /tmp/tmux-*
14
15# include disable-common.inc
16# include disable-devel.inc
17# include disable-exec.inc
18# include disable-programs.inc
19
20caps.drop all
21ipc-namespace
22machine-id
23netfilter
24no3d
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30nosound
31notv
32nou2f
33novideo
34protocol unix,inet,inet6,netlink
35seccomp
36seccomp.block-secondary
37shell none
38tracelog
39
40# private-cache
41private-dev
42# private-tmp
43
44dbus-user none
45dbus-system none
diff --git a/etc/profile-m-z/tor-browser-ar.profile b/etc/profile-m-z/tor-browser-ar.profile
new file mode 100644
index 000000000..59f1bc3b1
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ar.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ar.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ar
10
11mkdir ${HOME}/.tor-browser-ar
12whitelist ${HOME}/.tor-browser-ar
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-ca.profile b/etc/profile-m-z/tor-browser-ca.profile
new file mode 100644
index 000000000..68577e352
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ca.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ca.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ca
10
11mkdir ${HOME}/.tor-browser-ca
12whitelist ${HOME}/.tor-browser-ca
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-cs.profile b/etc/profile-m-z/tor-browser-cs.profile
new file mode 100644
index 000000000..33e51fcd0
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-cs.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-cs.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-cs
10
11mkdir ${HOME}/.tor-browser-cs
12whitelist ${HOME}/.tor-browser-cs
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-da.profile b/etc/profile-m-z/tor-browser-da.profile
new file mode 100644
index 000000000..440bb7fc3
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-da.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-da.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-da
10
11mkdir ${HOME}/.tor-browser-da
12whitelist ${HOME}/.tor-browser-da
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-de.profile b/etc/profile-m-z/tor-browser-de.profile
new file mode 100644
index 000000000..b2b98cf82
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-de.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-de.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-de
10
11mkdir ${HOME}/.tor-browser-de
12whitelist ${HOME}/.tor-browser-de
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-el.profile b/etc/profile-m-z/tor-browser-el.profile
new file mode 100644
index 000000000..626757dd5
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-el.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-el.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-el
10
11mkdir ${HOME}/.tor-browser-el
12whitelist ${HOME}/.tor-browser-el
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-en-us.profile b/etc/profile-m-z/tor-browser-en-us.profile
new file mode 100644
index 000000000..15e690748
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-en-us.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-en-us.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-en-us
10
11mkdir ${HOME}/.tor-browser-en-us
12whitelist ${HOME}/.tor-browser-en-us
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-en.profile b/etc/profile-m-z/tor-browser-en.profile
new file mode 100644
index 000000000..ef8c1eb8b
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-en.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-en.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-en
10
11mkdir ${HOME}/.tor-browser-en
12whitelist ${HOME}/.tor-browser-en
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-es-es.profile b/etc/profile-m-z/tor-browser-es-es.profile
new file mode 100644
index 000000000..ad734662e
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-es-es.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-es-es.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-es-es
10
11mkdir ${HOME}/.tor-browser-es-es
12whitelist ${HOME}/.tor-browser-es-es
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-es.profile b/etc/profile-m-z/tor-browser-es.profile
new file mode 100644
index 000000000..97d8d8577
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-es.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-es.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-es
10
11mkdir ${HOME}/.tor-browser-es
12whitelist ${HOME}/.tor-browser-es
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-fa.profile b/etc/profile-m-z/tor-browser-fa.profile
new file mode 100644
index 000000000..095be69e4
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-fa.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-fa.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-fa
10
11mkdir ${HOME}/.tor-browser-fa
12whitelist ${HOME}/.tor-browser-fa
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-fr.profile b/etc/profile-m-z/tor-browser-fr.profile
new file mode 100644
index 000000000..37f61fc3a
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-fr.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-fr.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-fr
10
11mkdir ${HOME}/.tor-browser-fr
12whitelist ${HOME}/.tor-browser-fr
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-ga-ie.profile b/etc/profile-m-z/tor-browser-ga-ie.profile
new file mode 100644
index 000000000..ab7141fc4
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ga-ie.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ga-ie.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ga-ie
10
11mkdir ${HOME}/.tor-browser-ga-ie
12whitelist ${HOME}/.tor-browser-ga-ie
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-he.profile b/etc/profile-m-z/tor-browser-he.profile
new file mode 100644
index 000000000..ae56f3b7f
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-he.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-he.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-he
10
11mkdir ${HOME}/.tor-browser-he
12whitelist ${HOME}/.tor-browser-he
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-hu.profile b/etc/profile-m-z/tor-browser-hu.profile
new file mode 100644
index 000000000..65cd18ac8
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-hu.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-hu.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-hu
10
11mkdir ${HOME}/.tor-browser-hu
12whitelist ${HOME}/.tor-browser-hu
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-id.profile b/etc/profile-m-z/tor-browser-id.profile
new file mode 100644
index 000000000..57fe09f47
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-id.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-id.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-id
10
11mkdir ${HOME}/.tor-browser-id
12whitelist ${HOME}/.tor-browser-id
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-is.profile b/etc/profile-m-z/tor-browser-is.profile
new file mode 100644
index 000000000..54f1df42d
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-is.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-is.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-is
10
11mkdir ${HOME}/.tor-browser-is
12whitelist ${HOME}/.tor-browser-is
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-it.profile b/etc/profile-m-z/tor-browser-it.profile
new file mode 100644
index 000000000..a7d46e875
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-it.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-it.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-it
10
11mkdir ${HOME}/.tor-browser-it
12whitelist ${HOME}/.tor-browser-it
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-ja.profile b/etc/profile-m-z/tor-browser-ja.profile
new file mode 100644
index 000000000..b89016141
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ja.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ja.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ja
10
11mkdir ${HOME}/.tor-browser-ja
12whitelist ${HOME}/.tor-browser-ja
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-ka.profile b/etc/profile-m-z/tor-browser-ka.profile
new file mode 100644
index 000000000..b57cf10de
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ka.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ka.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ka
10
11mkdir ${HOME}/.tor-browser-ka
12whitelist ${HOME}/.tor-browser-ka
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-ko.profile b/etc/profile-m-z/tor-browser-ko.profile
new file mode 100644
index 000000000..a9bedb6fd
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ko.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ko.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ko
10
11mkdir ${HOME}/.tor-browser-ko
12whitelist ${HOME}/.tor-browser-ko
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-nb.profile b/etc/profile-m-z/tor-browser-nb.profile
new file mode 100644
index 000000000..fbe9f92bd
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-nb.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-nb.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-nb
10
11mkdir ${HOME}/.tor-browser-nb
12whitelist ${HOME}/.tor-browser-nb
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-nl.profile b/etc/profile-m-z/tor-browser-nl.profile
new file mode 100644
index 000000000..678ac1713
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-nl.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-nl.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-nl
10
11mkdir ${HOME}/.tor-browser-nl
12whitelist ${HOME}/.tor-browser-nl
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-pl.profile b/etc/profile-m-z/tor-browser-pl.profile
new file mode 100644
index 000000000..25d473b1a
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-pl.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-pl.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-pl
10
11mkdir ${HOME}/.tor-browser-pl
12whitelist ${HOME}/.tor-browser-pl
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-pt-br.profile b/etc/profile-m-z/tor-browser-pt-br.profile
new file mode 100644
index 000000000..55adbd5ea
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-pt-br.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-pt-br.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-pt-br
10
11mkdir ${HOME}/.tor-browser-pt-br
12whitelist ${HOME}/.tor-browser-pt-br
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-ru.profile b/etc/profile-m-z/tor-browser-ru.profile
new file mode 100644
index 000000000..aea13be9d
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-ru.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-ru.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-ru
10
11mkdir ${HOME}/.tor-browser-ru
12whitelist ${HOME}/.tor-browser-ru
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-sv-se.profile b/etc/profile-m-z/tor-browser-sv-se.profile
new file mode 100644
index 000000000..b7882bd04
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-sv-se.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-sv-se.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-sv-se
10
11mkdir ${HOME}/.tor-browser-sv-se
12whitelist ${HOME}/.tor-browser-sv-se
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-tr.profile b/etc/profile-m-z/tor-browser-tr.profile
new file mode 100644
index 000000000..c52e8c4c4
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-tr.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-tr.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-tr
10
11mkdir ${HOME}/.tor-browser-tr
12whitelist ${HOME}/.tor-browser-tr
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-vi.profile b/etc/profile-m-z/tor-browser-vi.profile
new file mode 100644
index 000000000..d5bf76655
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-vi.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-vi.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-vi
10
11mkdir ${HOME}/.tor-browser-vi
12whitelist ${HOME}/.tor-browser-vi
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-zh-cn.profile b/etc/profile-m-z/tor-browser-zh-cn.profile
new file mode 100644
index 000000000..6c8925a4a
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-zh-cn.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-zh-cn.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-zh-cn
10
11mkdir ${HOME}/.tor-browser-zh-cn
12whitelist ${HOME}/.tor-browser-zh-cn
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser-zh-tw.profile b/etc/profile-m-z/tor-browser-zh-tw.profile
new file mode 100644
index 000000000..141a6701e
--- /dev/null
+++ b/etc/profile-m-z/tor-browser-zh-tw.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser-zh-tw.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser-zh-tw
10
11mkdir ${HOME}/.tor-browser-zh-tw
12whitelist ${HOME}/.tor-browser-zh-tw
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser.profile b/etc/profile-m-z/tor-browser.profile
new file mode 100644
index 000000000..76a0e1fa5
--- /dev/null
+++ b/etc/profile-m-z/tor-browser.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser
10
11mkdir ${HOME}/.tor-browser
12whitelist ${HOME}/.tor-browser
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ar.profile b/etc/profile-m-z/tor-browser_ar.profile
new file mode 100644
index 000000000..d811b7549
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ar.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ar.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ar
10
11mkdir ${HOME}/.tor-browser_ar
12whitelist ${HOME}/.tor-browser_ar
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ca.profile b/etc/profile-m-z/tor-browser_ca.profile
new file mode 100644
index 000000000..8bf1f7cd4
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ca.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ca.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ca
10
11mkdir ${HOME}/.tor-browser_ca
12whitelist ${HOME}/.tor-browser_ca
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_cs.profile b/etc/profile-m-z/tor-browser_cs.profile
new file mode 100644
index 000000000..b41107bf1
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_cs.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_cs.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_cs
10
11mkdir ${HOME}/.tor-browser_cs
12whitelist ${HOME}/.tor-browser_cs
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_da.profile b/etc/profile-m-z/tor-browser_da.profile
new file mode 100644
index 000000000..cbec4ee2e
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_da.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_da.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_da
10
11mkdir ${HOME}/.tor-browser_da
12whitelist ${HOME}/.tor-browser_da
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_de.profile b/etc/profile-m-z/tor-browser_de.profile
new file mode 100644
index 000000000..ea26765d3
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_de.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_de.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_de
10
11mkdir ${HOME}/.tor-browser_de
12whitelist ${HOME}/.tor-browser_de
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_el.profile b/etc/profile-m-z/tor-browser_el.profile
new file mode 100644
index 000000000..ff57a8722
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_el.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_el.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_el
10
11mkdir ${HOME}/.tor-browser_el
12whitelist ${HOME}/.tor-browser_el
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_en-US.profile b/etc/profile-m-z/tor-browser_en-US.profile
new file mode 100644
index 000000000..18c92b638
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_en-US.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_en-US.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_en-US
10
11mkdir ${HOME}/.tor-browser_en-US
12whitelist ${HOME}/.tor-browser_en-US
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_en.profile b/etc/profile-m-z/tor-browser_en.profile
new file mode 100644
index 000000000..ebba83cc4
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_en.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_en.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_en
10
11mkdir ${HOME}/.tor-browser_en
12whitelist ${HOME}/.tor-browser_en
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_es-ES.profile b/etc/profile-m-z/tor-browser_es-ES.profile
new file mode 100644
index 000000000..aecab38d5
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_es-ES.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_es-ES.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_es-ES
10
11mkdir ${HOME}/.tor-browser_es-ES
12whitelist ${HOME}/.tor-browser_es-ES
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_es.profile b/etc/profile-m-z/tor-browser_es.profile
new file mode 100644
index 000000000..e19e9b5e6
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_es.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_es.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_es
10
11mkdir ${HOME}/.tor-browser_es
12whitelist ${HOME}/.tor-browser_es
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_fa.profile b/etc/profile-m-z/tor-browser_fa.profile
new file mode 100644
index 000000000..68414c277
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_fa.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_fa.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_fa
10
11mkdir ${HOME}/.tor-browser_fa
12whitelist ${HOME}/.tor-browser_fa
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_fr.profile b/etc/profile-m-z/tor-browser_fr.profile
new file mode 100644
index 000000000..0a8bb30b7
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_fr.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_fr.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_fr
10
11mkdir ${HOME}/.tor-browser_fr
12whitelist ${HOME}/.tor-browser_fr
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ga-IE.profile b/etc/profile-m-z/tor-browser_ga-IE.profile
new file mode 100644
index 000000000..12354b900
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ga-IE.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ga-IE.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ga-IE
10
11mkdir ${HOME}/.tor-browser_ga-IE
12whitelist ${HOME}/.tor-browser_ga-IE
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_he.profile b/etc/profile-m-z/tor-browser_he.profile
new file mode 100644
index 000000000..19cbb0809
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_he.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_he.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_he
10
11mkdir ${HOME}/.tor-browser_he
12whitelist ${HOME}/.tor-browser_he
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_hu.profile b/etc/profile-m-z/tor-browser_hu.profile
new file mode 100644
index 000000000..62b55e170
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_hu.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_hu.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_hu
10
11mkdir ${HOME}/.tor-browser_hu
12whitelist ${HOME}/.tor-browser_hu
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_id.profile b/etc/profile-m-z/tor-browser_id.profile
new file mode 100644
index 000000000..2970a7747
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_id.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_id.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_id
10
11mkdir ${HOME}/.tor-browser_id
12whitelist ${HOME}/.tor-browser_id
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_is.profile b/etc/profile-m-z/tor-browser_is.profile
new file mode 100644
index 000000000..f922c7644
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_is.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_is.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_is
10
11mkdir ${HOME}/.tor-browser_is
12whitelist ${HOME}/.tor-browser_is
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_it.profile b/etc/profile-m-z/tor-browser_it.profile
new file mode 100644
index 000000000..406901759
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_it.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_it.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_it
10
11mkdir ${HOME}/.tor-browser_it
12whitelist ${HOME}/.tor-browser_it
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ja.profile b/etc/profile-m-z/tor-browser_ja.profile
new file mode 100644
index 000000000..8f9d8d751
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ja.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ja.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ja
10
11mkdir ${HOME}/.tor-browser_ja
12whitelist ${HOME}/.tor-browser_ja
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ka.profile b/etc/profile-m-z/tor-browser_ka.profile
new file mode 100644
index 000000000..4de4135e1
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ka.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ka.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ka
10
11mkdir ${HOME}/.tor-browser_ka
12whitelist ${HOME}/.tor-browser_ka
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ko.profile b/etc/profile-m-z/tor-browser_ko.profile
new file mode 100644
index 000000000..125c733ce
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ko.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ko.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ko
10
11mkdir ${HOME}/.tor-browser_ko
12whitelist ${HOME}/.tor-browser_ko
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_nb.profile b/etc/profile-m-z/tor-browser_nb.profile
new file mode 100644
index 000000000..dc6ac876b
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_nb.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_nb.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_nb
10
11mkdir ${HOME}/.tor-browser_nb
12whitelist ${HOME}/.tor-browser_nb
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_nl.profile b/etc/profile-m-z/tor-browser_nl.profile
new file mode 100644
index 000000000..2a3a5b519
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_nl.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_nl.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_nl
10
11mkdir ${HOME}/.tor-browser_nl
12whitelist ${HOME}/.tor-browser_nl
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_pl.profile b/etc/profile-m-z/tor-browser_pl.profile
new file mode 100644
index 000000000..b7dec32db
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_pl.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_pl.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_pl
10
11mkdir ${HOME}/.tor-browser_pl
12whitelist ${HOME}/.tor-browser_pl
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_pt-BR.profile b/etc/profile-m-z/tor-browser_pt-BR.profile
new file mode 100644
index 000000000..7a7d4726c
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_pt-BR.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_pt-BR.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_pt-BR
10
11mkdir ${HOME}/.tor-browser_pt-BR
12whitelist ${HOME}/.tor-browser_pt-BR
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_ru.profile b/etc/profile-m-z/tor-browser_ru.profile
new file mode 100644
index 000000000..7d2e6bc97
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_ru.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_ru.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_ru
10
11mkdir ${HOME}/.tor-browser_ru
12whitelist ${HOME}/.tor-browser_ru
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_sv-SE.profile b/etc/profile-m-z/tor-browser_sv-SE.profile
new file mode 100644
index 000000000..585925e81
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_sv-SE.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_sv-SE.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_sv-SE
10
11mkdir ${HOME}/.tor-browser_sv-SE
12whitelist ${HOME}/.tor-browser_sv-SE
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_tr.profile b/etc/profile-m-z/tor-browser_tr.profile
new file mode 100644
index 000000000..4b0cc3821
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_tr.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_tr.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_tr
10
11mkdir ${HOME}/.tor-browser_tr
12whitelist ${HOME}/.tor-browser_tr
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_vi.profile b/etc/profile-m-z/tor-browser_vi.profile
new file mode 100644
index 000000000..4dcfbf56d
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_vi.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_vi.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_vi
10
11mkdir ${HOME}/.tor-browser_vi
12whitelist ${HOME}/.tor-browser_vi
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_zh-CN.profile b/etc/profile-m-z/tor-browser_zh-CN.profile
new file mode 100644
index 000000000..1e03b8d6b
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_zh-CN.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_zh-CN.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_zh-CN
10
11mkdir ${HOME}/.tor-browser_zh-CN
12whitelist ${HOME}/.tor-browser_zh-CN
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/profile-m-z/tor-browser_zh-TW.profile b/etc/profile-m-z/tor-browser_zh-TW.profile
new file mode 100644
index 000000000..a2dcf5cf1
--- /dev/null
+++ b/etc/profile-m-z/tor-browser_zh-TW.profile
@@ -0,0 +1,15 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include tor-browser_zh-TW.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.tor-browser_zh-TW
10
11mkdir ${HOME}/.tor-browser_zh-TW
12whitelist ${HOME}/.tor-browser_zh-TW
13
14# Redirect
15include torbrowser-launcher.profile
diff --git a/etc/tor.profile b/etc/profile-m-z/tor.profile
index fcb123eef..08e949309 100644
--- a/etc/tor.profile
+++ b/etc/profile-m-z/tor.profile
@@ -1,9 +1,10 @@
1# Firejail profile for tor 1# Firejail profile for tor
2# Description: Anonymizing overlay network for TCP
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/tor.local 5include tor.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8# How to use: 9# How to use:
9# Create a script called anything (e.g. mytor) 10# Create a script called anything (e.g. mytor)
@@ -16,32 +17,35 @@ include /etc/firejail/globals.local
16# You'll also likely want to disable the system service (if it exists) 17# You'll also likely want to disable the system service (if it exists)
17# Run mytor (or whatever you called the script above) whenever you want to start tor 18# Run mytor (or whatever you called the script above) whenever you want to start tor
18 19
19include /etc/firejail/disable-common.inc 20include disable-common.inc
20include /etc/firejail/disable-devel.inc 21include disable-devel.inc
21include /etc/firejail/disable-passwdmgr.inc 22include disable-exec.inc
22include /etc/firejail/disable-programs.inc 23include disable-interpreters.inc
24include disable-programs.inc
25include disable-xdg.inc
23 26
24caps.keep setuid,setgid,net_bind_service,dac_read_search 27caps.keep dac_read_search,net_bind_service,setgid,setuid
25ipc-namespace 28ipc-namespace
29machine-id
26netfilter 30netfilter
27no3d 31no3d
28nodvd 32nodvd
29nogroups 33nogroups
34noinput
30nonewprivs 35nonewprivs
31nosound 36nosound
32notv 37notv
38nou2f
33novideo 39novideo
34protocol unix,inet,inet6 40protocol unix,inet,inet6
35seccomp 41seccomp
36shell none 42shell none
37writable-var
38 43
39disable-mnt 44disable-mnt
40private 45private
41private-bin tor,bash 46private-bin bash,tor
47private-cache
42private-dev 48private-dev
43private-etc tor,passwd 49private-etc alternatives,ca-certificates,crypto-policies,passwd,pki,ssl,tor
44private-tmp 50private-tmp
45 51writable-var
46noexec ${HOME}
47noexec /tmp
diff --git a/etc/profile-m-z/torbrowser-launcher.profile b/etc/profile-m-z/torbrowser-launcher.profile
new file mode 100644
index 000000000..e7b8ecd3f
--- /dev/null
+++ b/etc/profile-m-z/torbrowser-launcher.profile
@@ -0,0 +1,65 @@
1# Firejail profile for torbrowser-launcher
2# Description: Helps download and run the Tor Browser Bundle
3# This file is overwritten after every install/update
4# Persistent local customizations
5include torbrowser-launcher.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.config/torbrowser
12noblacklist ${HOME}/.local/share/torbrowser
13
14# Allow python (blacklisted by disable-interpreters.inc)
15include allow-python2.inc
16include allow-python3.inc
17
18blacklist /opt
19blacklist /srv
20
21include disable-common.inc
22include disable-devel.inc
23include disable-exec.inc
24include disable-interpreters.inc
25include disable-programs.inc
26include disable-xdg.inc
27
28mkdir ${HOME}/.config/torbrowser
29mkdir ${HOME}/.local/share/torbrowser
30whitelist ${DOWNLOADS}
31whitelist ${HOME}/.config/torbrowser
32whitelist ${HOME}/.local/share/torbrowser
33whitelist /usr/share/torbrowser-launcher
34include whitelist-common.inc
35include whitelist-var-common.inc
36include whitelist-runuser-common.inc
37include whitelist-usr-share-common.inc
38
39# Add 'apparmor' to your torbrowser-launcher.local to enable AppArmor support.
40# IMPORTANT: the relevant rule in /etc/apparmor.d/local/firejail-default will need
41# to be uncommented too for this to work as expected.
42#apparmor
43caps.drop all
44netfilter
45nodvd
46nogroups
47noinput
48nonewprivs
49noroot
50notv
51nou2f
52novideo
53protocol unix,inet,inet6
54seccomp !chroot
55shell none
56#tracelog - may cause issues, see #1930
57
58disable-mnt
59private-bin bash,cat,cp,cut,dirname,env,expr,file,gpg,grep,gxmessage,id,kdialog,ln,mkdir,mv,python*,rm,sed,sh,tail,tar,tclsh,test,tor-browser,tor-browser-en,torbrowser-launcher,update-desktop-database,xmessage,xz,zenity
60private-dev
61private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,pki,pulse,resolv.conf,ssl
62private-tmp
63
64dbus-user none
65dbus-system none
diff --git a/etc/profile-m-z/torcs.profile b/etc/profile-m-z/torcs.profile
new file mode 100644
index 000000000..a7ebaf2af
--- /dev/null
+++ b/etc/profile-m-z/torcs.profile
@@ -0,0 +1,49 @@
1# Firejail profile for torcs
2# Description: The Open Racing Car Simulator
3# This file is overwritten after every install/update
4# Persistent local customizations
5include torcs.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.torcs
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.torcs
19whitelist ${HOME}/.torcs
20whitelist /usr/share/games/torcs
21whitelist /var/games/torcs
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26caps.drop all
27ipc-namespace
28net none
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin bash,chmod,cp,mkdir,rm,torcs
44private-cache
45private-dev
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-m-z/totem.profile b/etc/profile-m-z/totem.profile
new file mode 100644
index 000000000..dac753fd1
--- /dev/null
+++ b/etc/profile-m-z/totem.profile
@@ -0,0 +1,60 @@
1# Firejail profile for totem
2# Description: Simple media player for the GNOME desktop based on GStreamer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include totem.local
6# Persistent global definitions
7include globals.local
8
9# Allow lua (blacklisted by disable-interpreters.inc)
10# required for youtube video
11include allow-lua.inc
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python3.inc
15
16noblacklist ${HOME}/.config/totem
17noblacklist ${HOME}/.local/share/totem
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-shell.inc
25
26read-only ${DESKTOP}
27mkdir ${HOME}/.config/totem
28mkdir ${HOME}/.local/share/totem
29whitelist ${HOME}/.config/totem
30whitelist ${HOME}/.local/share/totem
31whitelist /usr/share/totem
32include whitelist-common.inc
33include whitelist-player-common.inc
34include whitelist-runuser-common.inc
35include whitelist-usr-share-common.inc
36include whitelist-var-common.inc
37
38# apparmor - makes settings immutable
39caps.drop all
40netfilter
41nogroups
42noinput
43nonewprivs
44noroot
45nou2f
46protocol unix,inet,inet6
47seccomp
48shell none
49tracelog
50
51private-bin totem
52# totem needs access to ~/.cache/tracker or it exits
53#private-cache
54private-dev
55# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl
56private-tmp
57
58# makes settings immutable
59# dbus-user none
60dbus-system none
diff --git a/etc/tracker.profile b/etc/profile-m-z/tracker.profile
index f3dfb2d4e..ba44224f9 100644
--- a/etc/tracker.profile
+++ b/etc/profile-m-z/tracker.profile
@@ -1,18 +1,23 @@
1# Firejail profile for tracker 1# Firejail profile for tracker
2# Description: Metadata database, indexer and search tool
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/tracker.local 5include tracker.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8# Tracker is started by systemd on most systems. Therefore it is not firejailed by default 9# Tracker is started by systemd on most systems. Therefore it is not firejailed by default
9 10
10blacklist /tmp/.X11-unix 11blacklist /tmp/.X11-unix
12blacklist ${RUNUSER}/wayland-*
11 13
12include /etc/firejail/disable-common.inc 14include disable-common.inc
13include /etc/firejail/disable-devel.inc 15include disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 16include disable-interpreters.inc
15include /etc/firejail/disable-programs.inc 17include disable-programs.inc
18include disable-shell.inc
19
20include whitelist-runuser-common.inc
16 21
17caps.drop all 22caps.drop all
18netfilter 23netfilter
@@ -31,5 +36,4 @@ tracelog
31 36
32# private-bin tracker 37# private-bin tracker
33# private-dev 38# private-dev
34# private-etc fonts
35# private-tmp 39# private-tmp
diff --git a/etc/profile-m-z/transgui.profile b/etc/profile-m-z/transgui.profile
new file mode 100644
index 000000000..2b63f6448
--- /dev/null
+++ b/etc/profile-m-z/transgui.profile
@@ -0,0 +1,55 @@
1# Firejail profile for transgui
2# Description: Cross-platform Transmission BitTorrent client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include transgui.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/transgui
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/transgui
20whitelist ${HOME}/.config/transgui
21whitelist ${DOWNLOADS}
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29machine-id
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43tracelog
44
45private-bin geoiplookup,geoiplookup6,transgui
46private-cache
47private-dev
48private-etc alternatives,fonts
49private-lib libgdk_pixbuf-2.0.so.*,libGeoIP.so*,libgthread-2.0.so.*,libgtk-x11-2.0.so.*,libX11.so.*
50private-tmp
51
52dbus-user none
53dbus-system none
54
55memory-deny-write-execute
diff --git a/etc/profile-m-z/transmission-cli.profile b/etc/profile-m-z/transmission-cli.profile
new file mode 100644
index 000000000..486be5fe6
--- /dev/null
+++ b/etc/profile-m-z/transmission-cli.profile
@@ -0,0 +1,14 @@
1# Firejail profile for transmission-cli
2# Description: Fast, easy and free BitTorrent client (CLI tools and web client)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-cli.local
7# Persistent global definitions
8include globals.local
9
10private-bin transmission-cli
11private-etc alternatives,ca-certificates,crypto-policies,nsswitch.conf,pki,resolv.conf,ssl
12
13# Redirect
14include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-common.profile b/etc/profile-m-z/transmission-common.profile
new file mode 100644
index 000000000..9d9b8cc2c
--- /dev/null
+++ b/etc/profile-m-z/transmission-common.profile
@@ -0,0 +1,54 @@
1# Firejail profile for transmission-common
2# Description: Fast, easy and free BitTorrent client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include transmission-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10noblacklist ${HOME}/.cache/transmission
11noblacklist ${HOME}/.config/transmission
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19mkdir ${HOME}/.cache/transmission
20mkdir ${HOME}/.config/transmission
21whitelist ${DOWNLOADS}
22whitelist ${HOME}/.cache/transmission
23whitelist ${HOME}/.config/transmission
24include whitelist-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30machine-id
31netfilter
32nodvd
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42seccomp.block-secondary
43shell none
44tracelog
45
46private-cache
47private-dev
48private-lib
49private-tmp
50
51dbus-user none
52dbus-system none
53
54memory-deny-write-execute
diff --git a/etc/profile-m-z/transmission-create.profile b/etc/profile-m-z/transmission-create.profile
new file mode 100644
index 000000000..8220b7887
--- /dev/null
+++ b/etc/profile-m-z/transmission-create.profile
@@ -0,0 +1,13 @@
1# Firejail profile for transmission-create
2# Description: CLI utility to create BitTorrent .torrent files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-create.local
7# Persistent global definitions
8include globals.local
9
10private-bin transmission-create
11
12# Redirect
13include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-daemon.profile b/etc/profile-m-z/transmission-daemon.profile
new file mode 100644
index 000000000..348d3cb80
--- /dev/null
+++ b/etc/profile-m-z/transmission-daemon.profile
@@ -0,0 +1,27 @@
1# Firejail profile for transmission-daemon
2# Description: Fast, easy and free BitTorrent client (daemon)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-daemon.local
7# Persistent global definitions
8include globals.local
9
10ignore caps.drop all
11
12mkdir ${HOME}/.config/transmission-daemon
13whitelist ${HOME}/.config/transmission-daemon
14whitelist /var/lib/transmission
15
16caps.keep ipc_lock,net_bind_service,setgid,setuid,sys_chroot
17protocol packet
18
19private-bin transmission-daemon
20private-etc alternatives,ca-certificates,crypto-policies,nsswitch.conf,pki,resolv.conf,ssl
21
22read-write /var/lib/transmission
23writable-var-log
24writable-run-user
25
26# Redirect
27include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-edit.profile b/etc/profile-m-z/transmission-edit.profile
new file mode 100644
index 000000000..df381b5cd
--- /dev/null
+++ b/etc/profile-m-z/transmission-edit.profile
@@ -0,0 +1,13 @@
1# Firejail profile for transmission-edit
2# Description: CLI utility to modify BitTorrent .torrent files' announce URLs
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-edit.local
7# Persistent global definitions
8include globals.local
9
10private-bin transmission-edit
11
12# Redirect
13include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-gtk.profile b/etc/profile-m-z/transmission-gtk.profile
new file mode 100644
index 000000000..03111ec56
--- /dev/null
+++ b/etc/profile-m-z/transmission-gtk.profile
@@ -0,0 +1,18 @@
1# Firejail profile for transmission-gtk
2# Description: Fast, easy and free BitTorrent client (GTK GUI)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-gtk.local
7# Persistent global definitions
8include globals.local
9
10include whitelist-runuser-common.inc
11
12private-bin transmission-gtk
13private-cache
14
15ignore memory-deny-write-execute
16
17# Redirect
18include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-qt.profile b/etc/profile-m-z/transmission-qt.profile
new file mode 100644
index 000000000..94f3c3a20
--- /dev/null
+++ b/etc/profile-m-z/transmission-qt.profile
@@ -0,0 +1,18 @@
1# Firejail profile for transmission-qt
2# Description: Fast, easy and free BitTorrent client (Qt GUI)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-qt.local
7# Persistent global definitions
8include globals.local
9
10private-bin transmission-qt
11
12# private-lib - breaks on Arch
13ignore private-lib
14
15ignore memory-deny-write-execute
16
17# Redirect
18include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-remote-cli.profile b/etc/profile-m-z/transmission-remote-cli.profile
new file mode 100644
index 000000000..7b9285e66
--- /dev/null
+++ b/etc/profile-m-z/transmission-remote-cli.profile
@@ -0,0 +1,17 @@
1# Firejail profile for transmission-remote-cli
2# Description: A remote control utility for transmission-daemon (CLI)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-remote-cli.local
7# Persistent global definitions
8include globals.local
9
10# Allow python (blacklisted by disable-interpreters.inc)
11include allow-python2.inc
12include allow-python3.inc
13
14private-bin python*,transmission-remote-cli
15
16# Redirect
17include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-remote-gtk.profile b/etc/profile-m-z/transmission-remote-gtk.profile
new file mode 100644
index 000000000..a6400e2c0
--- /dev/null
+++ b/etc/profile-m-z/transmission-remote-gtk.profile
@@ -0,0 +1,22 @@
1# Firejail profile for transmission-remote-gtk
2# Description: A remote control utility for transmission-daemon (GTK GUI)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-remote-gtk.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.config/transmission-remote-gtk
11
12mkdir ${HOME}/.config/transmission-remote-gtk
13whitelist ${HOME}/.config/transmission-remote-gtk
14
15private-etc fonts,hostname,hosts,resolv.conf
16# Problems with private-lib (see issue #2889)
17ignore private-lib
18
19ignore memory-deny-write-execute
20
21# Redirect
22include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-remote.profile b/etc/profile-m-z/transmission-remote.profile
new file mode 100644
index 000000000..fee4999e6
--- /dev/null
+++ b/etc/profile-m-z/transmission-remote.profile
@@ -0,0 +1,14 @@
1# Firejail profile for transmission-remote
2# Description: A remote control utility for transmission-daemon (CLI)
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-remote.local
7# Persistent global definitions
8include globals.local
9
10private-bin transmission-remote
11private-etc alternatives,hosts,nsswitch.conf
12
13# Redirect
14include transmission-common.profile
diff --git a/etc/profile-m-z/transmission-show.profile b/etc/profile-m-z/transmission-show.profile
new file mode 100644
index 000000000..5a3c83f58
--- /dev/null
+++ b/etc/profile-m-z/transmission-show.profile
@@ -0,0 +1,14 @@
1# Firejail profile for transmission-show
2# Description: CLI utility to show BitTorrent .torrent file metadata
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include transmission-show.local
7# Persistent global definitions
8include globals.local
9
10private-bin transmission-show
11private-etc alternatives,hosts,nsswitch.conf
12
13# Redirect
14include transmission-common.profile
diff --git a/etc/profile-m-z/tremulous.profile b/etc/profile-m-z/tremulous.profile
new file mode 100644
index 000000000..4e16df553
--- /dev/null
+++ b/etc/profile-m-z/tremulous.profile
@@ -0,0 +1,50 @@
1# Firejail profile for tremulous
2# Description: First Person Shooter game based on the Quake 3 engine
3# This file is overwritten after every install/update
4# Persistent local customizations
5include tremulous.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.tremulous
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.tremulous
20whitelist ${HOME}/.tremulous
21whitelist /usr/share/tremulous
22include whitelist-common.inc
23include whitelist-runuser-common.inc
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28ipc-namespace
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private-bin tremded,tremulous,tremulous-wrapper
45private-cache
46private-dev
47private-tmp
48
49dbus-user none
50dbus-system none
diff --git a/etc/profile-m-z/trojita.profile b/etc/profile-m-z/trojita.profile
new file mode 100644
index 000000000..41426c606
--- /dev/null
+++ b/etc/profile-m-z/trojita.profile
@@ -0,0 +1,64 @@
1# Firejail profile for trojita
2# Description: Qt mail client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include trojita.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.abook
10noblacklist ${HOME}/.mozilla
11noblacklist ${HOME}/.cache/flaska.net/trojita
12noblacklist ${HOME}/.config/flaska.net
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.abook
23mkdir ${HOME}/.cache/flaska.net/trojita
24mkdir ${HOME}/.config/flaska.net
25whitelist ${HOME}/.abook
26whitelist ${HOME}/.mozilla/firefox/profiles.ini
27whitelist ${HOME}/.cache/flaska.net/trojita
28whitelist ${HOME}/.config/flaska.net
29include whitelist-common.inc
30include whitelist-runuser-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36netfilter
37no3d
38nodvd
39nogroups
40noinput
41nonewprivs
42noroot
43nosound
44notv
45nou2f
46novideo
47protocol unix,inet,inet6,netlink
48seccomp
49shell none
50tracelog
51
52# disable-mnt
53# Add "ignore private-bin" for hyperlinks or have a look at the private-bins in firefox.profile and firefox-common.profile.
54private-bin trojita
55private-cache
56private-dev
57private-etc alternatives,ca-certificates,crypto-policies,fonts,hostname,hosts,pki,resolv.conf,selinux,ssl,xdg
58private-tmp
59
60dbus-user filter
61dbus-user.talk org.freedesktop.secrets
62dbus-system none
63
64read-only ${HOME}/.mozilla/firefox/profiles.ini
diff --git a/etc/truecraft.profile b/etc/profile-m-z/truecraft.profile
index 4e48f6c6b..503e1ae64 100644
--- a/etc/truecraft.profile
+++ b/etc/profile-m-z/truecraft.profile
@@ -1,30 +1,33 @@
1# Firejail profile for truecraft 1# Firejail profile for truecraft
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/truecraft.local 4include truecraft.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/mono 8noblacklist ${HOME}/.config/mono
9noblacklist ${HOME}/.config/truecraft 9noblacklist ${HOME}/.config/truecraft
10 10
11include /etc/firejail/disable-common.inc 11include disable-common.inc
12include /etc/firejail/disable-devel.inc 12include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 13include disable-exec.inc
14include /etc/firejail/disable-programs.inc 14include disable-interpreters.inc
15include disable-programs.inc
15 16
16mkdir ${HOME}/.config/mono 17mkdir ${HOME}/.config/mono
17mkdir ${HOME}/.config/truecraft 18mkdir ${HOME}/.config/truecraft
18whitelist ${HOME}/.config/mono 19whitelist ${HOME}/.config/mono
19whitelist ${HOME}/.config/truecraft 20whitelist ${HOME}/.config/truecraft
20include /etc/firejail/whitelist-common.inc 21include whitelist-common.inc
21 22
22caps.drop all 23caps.drop all
23nodvd 24nodvd
24nogroups 25nogroups
26noinput
25nonewprivs 27nonewprivs
26noroot 28noroot
27notv 29notv
30nou2f
28novideo 31novideo
29protocol unix,inet,inet6 32protocol unix,inet,inet6
30seccomp 33seccomp
@@ -34,5 +37,3 @@ disable-mnt
34private-dev 37private-dev
35private-tmp 38private-tmp
36 39
37noexec ${HOME}
38noexec /tmp
diff --git a/etc/profile-m-z/ts3client_runscript.sh.profile b/etc/profile-m-z/ts3client_runscript.sh.profile
new file mode 100644
index 000000000..8d4675454
--- /dev/null
+++ b/etc/profile-m-z/ts3client_runscript.sh.profile
@@ -0,0 +1,19 @@
1# Firejail profile alias for teamspeak3
2# Description: TeamSpeak is software for quality voice communication via the Internet
3# This file is overwritten after every install/update
4# Persistent local customizations
5include ts3client_runscript.sh.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10ignore noexec ${HOME}
11
12noblacklist ${HOME}/TeamSpeak3-Client-linux_x86
13noblacklist ${HOME}/TeamSpeak3-Client-linux_amd64
14
15whitelist ${HOME}/TeamSpeak3-Client-linux_x86
16whitelist ${HOME}/TeamSpeak3-Client-linux_amd64
17
18# Redirect
19include teamspeak3.profile
diff --git a/etc/profile-m-z/tshark.profile b/etc/profile-m-z/tshark.profile
new file mode 100644
index 000000000..3f5a9647e
--- /dev/null
+++ b/etc/profile-m-z/tshark.profile
@@ -0,0 +1,11 @@
1# Firejail profile for tshark
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include tshark.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include wireshark.profile
diff --git a/etc/profile-m-z/tutanota-desktop.profile b/etc/profile-m-z/tutanota-desktop.profile
new file mode 100644
index 000000000..d2cb0cc8a
--- /dev/null
+++ b/etc/profile-m-z/tutanota-desktop.profile
@@ -0,0 +1,31 @@
1# Firejail profile for tutanota-desktop
2# Description: Encrypted email client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include tutanota-desktop.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/tuta_integration
10noblacklist ${HOME}/.config/tutanota-desktop
11
12ignore noexec /tmp
13
14include disable-shell.inc
15
16mkdir ${HOME}/.config/tuta_integration
17mkdir ${HOME}/.config/tutanota-desktop
18whitelist ${HOME}/.config/tuta_integration
19whitelist ${HOME}/.config/tutanota-desktop
20
21# These lines are needed to allow Firefox to open links
22noblacklist ${HOME}/.mozilla
23whitelist ${HOME}/.mozilla/firefox/profiles.ini
24read-only ${HOME}/.mozilla/firefox/profiles.ini
25
26?HAS_APPIMAGE: ignore private-dev
27private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nsswitch.conf,pki,resolv.conf,ssl
28private-opt tutanota-desktop
29
30# Redirect
31include electron.profile
diff --git a/etc/profile-m-z/tuxguitar.profile b/etc/profile-m-z/tuxguitar.profile
new file mode 100644
index 000000000..807d43281
--- /dev/null
+++ b/etc/profile-m-z/tuxguitar.profile
@@ -0,0 +1,45 @@
1# Firejail profile for tuxguitar
2# Description: Multitrack guitar tablature editor and player (gp3 to gp5)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include tuxguitar.local
6# Persistent global definitions
7include globals.local
8
9# tuxguitar fails to launch
10ignore noexec ${HOME}
11
12noblacklist ${HOME}/.tuxguitar*
13noblacklist ${DOCUMENTS}
14noblacklist ${MUSIC}
15
16# Allow java (blacklisted by disable-devel.inc)
17include allow-java.inc
18
19include disable-common.inc
20include disable-devel.inc
21include disable-exec.inc
22include disable-interpreters.inc
23include disable-programs.inc
24include disable-xdg.inc
25
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30netfilter
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42tracelog
43
44private-dev
45private-tmp
diff --git a/etc/profile-m-z/tvbrowser.profile b/etc/profile-m-z/tvbrowser.profile
new file mode 100644
index 000000000..8a18519ac
--- /dev/null
+++ b/etc/profile-m-z/tvbrowser.profile
@@ -0,0 +1,53 @@
1# Firejail profile for tvbrowser
2# Description: java tv programm form tvbrowser.org
3# This file is overwritten after every install/update
4# Persistent local customizations
5include tvbrowser.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/tvbrowser
10noblacklist ${HOME}/.tvbrowser
11
12# Allow java (blacklisted by disable-devel.inc)
13include allow-java.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.config/tvbrowser
23mkdir ${HOME}/.tvbrowser
24whitelist ${HOME}/.config/tvbrowser
25whitelist ${HOME}/.tvbrowser
26whitelist /usr/share/tvbrowser
27include whitelist-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31caps.drop all
32netfilter
33no3d
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44shell none
45tracelog
46
47disable-mnt
48private-cache
49private-dev
50private-tmp
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-m-z/twitch.profile b/etc/profile-m-z/twitch.profile
new file mode 100644
index 000000000..d767b4c9d
--- /dev/null
+++ b/etc/profile-m-z/twitch.profile
@@ -0,0 +1,25 @@
1# Firejail profile for twitch
2# Description: Unofficial electron based desktop warpper for Twitch
3# This file is overwritten after every install/update
4# Persistent local customizations
5include twitch.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore nou2f
11ignore novideo
12
13noblacklist ${HOME}/.config/Twitch
14
15include disable-shell.inc
16
17mkdir ${HOME}/.config/Twitch
18whitelist ${HOME}/.config/Twitch
19
20private-bin electron,electron[0-9],electron[0-9][0-9],twitch
21private-etc alsa,alternatives,asound.conf,ati,bumblebee,ca-certificates,crypto-policies,drirc,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,nvidia,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
22private-opt Twitch
23
24# Redirect
25include electron.profile
diff --git a/etc/profile-m-z/udiskie.profile b/etc/profile-m-z/udiskie.profile
new file mode 100644
index 000000000..02f05af16
--- /dev/null
+++ b/etc/profile-m-z/udiskie.profile
@@ -0,0 +1,45 @@
1# Firejail profile for udiskie
2# Description: Removable disk automounter using udisks
3# This file is overwritten after every install/update
4# Persistent local customizations
5include udiskie.local
6# Persistent global definitions
7include globals.local
8
9# Allow python (blacklisted by disable-interpreters.inc)
10include allow-python3.inc
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21caps.drop all
22machine-id
23net none
24no3d
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix
34seccomp !request_key
35shell none
36tracelog
37
38private-bin awk,cut,dbus-send,egrep,file,grep,head,python*,readlink,sed,sh,udiskie,uname,which,xdg-mime,xdg-open,xprop
39# add your configured file browser in udiskie.local, e. g.
40# private-bin nautilus
41# private-bin thunar
42private-cache
43private-dev
44private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mime.types,xdg
45private-tmp
diff --git a/etc/uefitool.profile b/etc/profile-m-z/uefitool.profile
index 138f69aa8..2e5630f3d 100644
--- a/etc/uefitool.profile
+++ b/etc/profile-m-z/uefitool.profile
@@ -1,15 +1,18 @@
1# Firejail profile for uefitool 1# Firejail profile for uefitool
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/uefitool.local 4include uefitool.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${DOCUMENTS}
8 9
9include /etc/firejail/disable-common.inc 10include disable-common.inc
10include /etc/firejail/disable-devel.inc 11include disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc 12include disable-exec.inc
12include /etc/firejail/disable-programs.inc 13include disable-interpreters.inc
14include disable-programs.inc
15include disable-xdg.inc
13 16
14caps.drop all 17caps.drop all
15ipc-namespace 18ipc-namespace
@@ -17,17 +20,20 @@ net none
17no3d 20no3d
18nodvd 21nodvd
19nogroups 22nogroups
23noinput
20nonewprivs 24nonewprivs
21noroot 25noroot
22nosound 26nosound
23notv 27notv
28nou2f
24novideo 29novideo
25protocol unix 30protocol unix
26seccomp 31seccomp
27shell none 32shell none
28 33
34private-cache
29private-dev 35private-dev
30private-tmp 36private-tmp
31 37
32noexec ${HOME} 38dbus-user none
33noexec /tmp 39dbus-system none
diff --git a/etc/uget-gtk.profile b/etc/profile-m-z/uget-gtk.profile
index 56ff4f886..4420099ff 100644
--- a/etc/uget-gtk.profile
+++ b/etc/profile-m-z/uget-gtk.profile
@@ -1,28 +1,34 @@
1# Firejail profile for uget-gtk 1# Firejail profile for uget-gtk
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/uget-gtk.local 4include uget-gtk.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.config/uGet 8noblacklist ${HOME}/.config/uGet
9 9
10include /etc/firejail/disable-common.inc 10include disable-common.inc
11include /etc/firejail/disable-devel.inc 11include disable-devel.inc
12include /etc/firejail/disable-programs.inc 12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
13 15
14mkdir ~/.config/uGet 16mkdir ${HOME}/.config/uGet
15whitelist ${DOWNLOADS} 17whitelist ${DOWNLOADS}
16whitelist ~/.config/uGet 18whitelist ${HOME}/.config/uGet
17include /etc/firejail/whitelist-common.inc 19include whitelist-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
18 22
19caps.drop all 23caps.drop all
20netfilter 24netfilter
21nodvd 25nodvd
26noinput
22nonewprivs 27nonewprivs
23noroot 28noroot
24nosound 29nosound
25notv 30notv
31nou2f
26novideo 32novideo
27protocol unix,inet,inet6 33protocol unix,inet,inet6
28seccomp 34seccomp
diff --git a/etc/profile-m-z/unar.profile b/etc/profile-m-z/unar.profile
new file mode 100644
index 000000000..0226a7de8
--- /dev/null
+++ b/etc/profile-m-z/unar.profile
@@ -0,0 +1,13 @@
1# Firejail profile for unar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include unar.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10private-bin unar
11
12# Redirect
13include ar.profile
diff --git a/etc/profile-m-z/unbound.profile b/etc/profile-m-z/unbound.profile
new file mode 100644
index 000000000..e8424cd7d
--- /dev/null
+++ b/etc/profile-m-z/unbound.profile
@@ -0,0 +1,52 @@
1# Firejail profile for unbound
2# Description: Validating, recursive, caching DNS resolver
3# This file is overwritten after every install/update
4# Persistent local customizations
5include unbound.local
6# Persistent global definitions
7include globals.local
8
9noblacklist /sbin
10noblacklist /usr/sbin
11
12blacklist /tmp/.X11-unix
13blacklist ${RUNUSER}/wayland-*
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-xdg.inc
21
22include whitelist-usr-share-common.inc
23
24whitelist /var/lib/unbound
25whitelist /var/run
26
27caps.keep net_admin,net_bind_service,setgid,setuid,sys_chroot,sys_resource
28ipc-namespace
29machine-id
30netfilter
31no3d
32nodvd
33noinput
34nonewprivs
35nosound
36notv
37nou2f
38novideo
39protocol inet,inet6
40seccomp.drop _sysctl,acct,add_key,adjtimex,clock_adjtime,delete_module,fanotify_init,finit_module,get_mempolicy,init_module,io_cancel,io_destroy,io_getevents,io_setup,io_submit,ioperm,iopl,kcmp,kexec_file_load,kexec_load,keyctl,lookup_dcookie,mbind,migrate_pages,modify_ldt,mount,move_pages,open_by_handle_at,perf_event_open,perf_event_open,pivot_root,process_vm_readv,process_vm_writev,ptrace,remap_file_pages,request_key,set_mempolicy,swapoff,swapon,sysfs,syslog,umount2,uselib,vmsplice
41
42disable-mnt
43private
44private-dev
45private-tmp
46writable-var
47
48dbus-user none
49dbus-system none
50
51# mdwe can break modules/plugins
52memory-deny-write-execute
diff --git a/etc/profile-m-z/uncompress.profile b/etc/profile-m-z/uncompress.profile
new file mode 100644
index 000000000..f659d8e87
--- /dev/null
+++ b/etc/profile-m-z/uncompress.profile
@@ -0,0 +1,11 @@
1# Firejail profile for uncompress
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include uncompress.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/unf.profile b/etc/profile-m-z/unf.profile
new file mode 100644
index 000000000..212e6d181
--- /dev/null
+++ b/etc/profile-m-z/unf.profile
@@ -0,0 +1,59 @@
1# Firejail profile for unf
2# Description: UNixize Filename -- replace annoying anti-unix characters in filenames
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include unf.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20whitelist ${DOWNLOADS}
21include whitelist-common.inc
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27hostname unf
28ipc-namespace
29machine-id
30net none
31no3d
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43shell none
44tracelog
45x11 none
46
47disable-mnt
48private-bin unf
49private-cache
50?HAS_APPIMAGE: ignore private-dev
51private-dev
52private-etc alternatives
53private-lib gcc/*/*/libgcc_s.so.*
54private-tmp
55
56dbus-user none
57dbus-system none
58
59memory-deny-write-execute
diff --git a/etc/profile-m-z/unknown-horizons.profile b/etc/profile-m-z/unknown-horizons.profile
new file mode 100644
index 000000000..b8f4dc431
--- /dev/null
+++ b/etc/profile-m-z/unknown-horizons.profile
@@ -0,0 +1,44 @@
1# Firejail profile for unknown-horizons
2# Description: 2D realtime strategy simulation
3# This file is overwritten after every install/update
4# Persistent local customizations
5include unknown-horizons.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.unknown-horizons
10
11include disable-common.inc
12include disable-exec.inc
13include disable-programs.inc
14
15mkdir ${HOME}/.unknown-horizons
16whitelist ${HOME}/.unknown-horizons
17include whitelist-common.inc
18include whitelist-runuser-common.inc
19whitelist /usr/share/unknown-horizons
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25nodvd
26nogroups
27noinput
28nonewprivs
29noroot
30notv
31nou2f
32novideo
33protocol unix,inet,inet6,netlink
34seccomp
35shell none
36
37disable-mnt
38# private-bin unknown-horizons
39private-dev
40# private-etc alternatives,ca-certificates,crypto-policies,pki,ssl
41private-tmp
42
43# doesn't work - maybe all Tcl/Tk programs have this problem
44# memory-deny-write-execute
diff --git a/etc/profile-m-z/unlzma.profile b/etc/profile-m-z/unlzma.profile
new file mode 100644
index 000000000..115d982e2
--- /dev/null
+++ b/etc/profile-m-z/unlzma.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include unlzma.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/unrar.profile b/etc/profile-m-z/unrar.profile
new file mode 100644
index 000000000..9d3d9b40e
--- /dev/null
+++ b/etc/profile-m-z/unrar.profile
@@ -0,0 +1,15 @@
1# Firejail profile for unrar
2# Description: Unarchiver for .rar files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include unrar.local
7# Persistent global definitions
8include globals.local
9
10private-bin unrar
11private-etc alternatives,group,localtime,passwd
12private-tmp
13
14# Redirect
15include archiver-common.profile
diff --git a/etc/profile-m-z/unxz.profile b/etc/profile-m-z/unxz.profile
new file mode 100644
index 000000000..d86313028
--- /dev/null
+++ b/etc/profile-m-z/unxz.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include unxz.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/unzip.profile b/etc/profile-m-z/unzip.profile
new file mode 100644
index 000000000..0231e3dba
--- /dev/null
+++ b/etc/profile-m-z/unzip.profile
@@ -0,0 +1,16 @@
1# Firejail profile for unzip
2# Description: De-archiver for .zip files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include unzip.local
7# Persistent global definitions
8include globals.local
9
10# GNOME Shell integration (chrome-gnome-shell)
11noblacklist ${HOME}/.local/share/gnome-shell
12
13private-etc alternatives,group,localtime,passwd
14
15# Redirect
16include archiver-common.profile
diff --git a/etc/profile-m-z/unzstd.profile b/etc/profile-m-z/unzstd.profile
new file mode 100644
index 000000000..0294aceff
--- /dev/null
+++ b/etc/profile-m-z/unzstd.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for zstd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include unzstd.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include zstd.profile
diff --git a/etc/profile-m-z/utox.profile b/etc/profile-m-z/utox.profile
new file mode 100644
index 000000000..b164494fa
--- /dev/null
+++ b/etc/profile-m-z/utox.profile
@@ -0,0 +1,49 @@
1# Firejail profile for utox
2# Description: Lightweight Tox client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include utox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/Tox
10noblacklist ${HOME}/.config/tox
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20mkdir ${HOME}/.config/tox
21whitelist ${DOWNLOADS}
22whitelist ${HOME}/.config/tox
23include whitelist-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28ipc-namespace
29netfilter
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37protocol unix,inet,inet6
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin utox
44private-cache
45private-dev
46private-etc alternatives,ca-certificates,crypto-policies,fonts,ld.so.cache,localtime,machine-id,openal,pki,pulse,resolv.conf,ssl
47private-tmp
48
49memory-deny-write-execute
diff --git a/etc/profile-m-z/uudeview.profile b/etc/profile-m-z/uudeview.profile
new file mode 100644
index 000000000..3b38f16e0
--- /dev/null
+++ b/etc/profile-m-z/uudeview.profile
@@ -0,0 +1,47 @@
1# Firejail profile for uudeview
2# Description: Smart multi-file multi-part decoder
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include uudeview.local
7# Persistent global definitions
8include globals.local
9
10blacklist ${RUNUSER}/wayland-*
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18
19include whitelist-usr-share-common.inc
20
21caps.drop all
22hostname uudeview
23ipc-namespace
24machine-id
25net none
26nodvd
27#nogroups
28noinput
29nonewprivs
30#noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39x11 none
40
41private-bin uudeview
42private-cache
43private-dev
44private-etc alternatives,ld.so.preload
45
46dbus-user none
47dbus-system none
diff --git a/etc/profile-m-z/uzbl-browser.profile b/etc/profile-m-z/uzbl-browser.profile
new file mode 100644
index 000000000..41487a8f2
--- /dev/null
+++ b/etc/profile-m-z/uzbl-browser.profile
@@ -0,0 +1,40 @@
1# Firejail profile for uzbl-browser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include uzbl-browser.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/uzbl
9noblacklist ${HOME}/.gnupg
10noblacklist ${HOME}/.local/share/uzbl
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21mkdir ${HOME}/.config/uzbl
22mkdir ${HOME}/.gnupg
23mkdir ${HOME}/.local/share/uzbl
24mkdir ${HOME}/.password-store
25whitelist ${DOWNLOADS}
26whitelist ${HOME}/.config/uzbl
27whitelist ${HOME}/.gnupg
28whitelist ${HOME}/.local/share/uzbl
29whitelist ${HOME}/.password-store
30include whitelist-common.inc
31
32caps.drop all
33netfilter
34nodvd
35nonewprivs
36noroot
37notv
38protocol unix,inet,inet6
39seccomp
40tracelog
diff --git a/etc/profile-m-z/viewnior.profile b/etc/profile-m-z/viewnior.profile
new file mode 100644
index 000000000..469e65542
--- /dev/null
+++ b/etc/profile-m-z/viewnior.profile
@@ -0,0 +1,52 @@
1# Firejail profile for viewnior
2# Description: Simple, fast and elegant image viewer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include viewnior.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.Steam
10noblacklist ${HOME}/.config/viewnior
11noblacklist ${HOME}/.steam
12
13blacklist ${HOME}/.bashrc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20include disable-shell.inc
21
22include whitelist-usr-share-common.inc
23include whitelist-var-common.inc
24
25apparmor
26caps.drop all
27net none
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43private-bin viewnior
44private-cache
45private-dev
46private-etc alternatives,fonts,machine-id
47private-tmp
48
49dbus-user none
50dbus-system none
51
52#memory-deny-write-execute - breaks on Arch (see issues #1803 and #1808)
diff --git a/etc/viking.profile b/etc/profile-m-z/viking.profile
index 30e89b511..fd15228cf 100644
--- a/etc/viking.profile
+++ b/etc/profile-m-z/viking.profile
@@ -1,27 +1,33 @@
1# Firejail profile for viking 1# Firejail profile for viking
2# Description: GPS data editor, analyzer and viewer
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/viking.local 5include viking.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.viking 9noblacklist ${HOME}/.viking
9noblacklist ${HOME}/.viking-maps 10noblacklist ${HOME}/.viking-maps
11noblacklist ${DOCUMENTS}
10 12
11include /etc/firejail/disable-common.inc 13include disable-common.inc
12include /etc/firejail/disable-devel.inc 14include disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc 15include disable-exec.inc
14include /etc/firejail/disable-programs.inc 16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
15 19
16caps.drop all 20caps.drop all
17netfilter 21netfilter
18no3d 22no3d
19nodvd 23nodvd
20nogroups 24nogroups
25noinput
21nonewprivs 26nonewprivs
22noroot 27noroot
23nosound 28nosound
24notv 29notv
30nou2f
25protocol unix,inet,inet6 31protocol unix,inet,inet6
26seccomp 32seccomp
27shell none 33shell none
@@ -29,5 +35,3 @@ shell none
29private-dev 35private-dev
30private-tmp 36private-tmp
31 37
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/profile-m-z/vim.profile b/etc/profile-m-z/vim.profile
new file mode 100644
index 000000000..a6e05a32a
--- /dev/null
+++ b/etc/profile-m-z/vim.profile
@@ -0,0 +1,34 @@
1# Firejail profile for vim
2# Description: Vi IMproved - enhanced vi editor
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vim.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.vim
10noblacklist ${HOME}/.viminfo
11noblacklist ${HOME}/.vimrc
12
13# Allows files commonly used by IDEs
14include allow-common-devel.inc
15
16include disable-common.inc
17include disable-programs.inc
18
19include whitelist-runuser-common.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28notv
29nou2f
30novideo
31protocol unix,inet,inet6
32seccomp
33
34private-dev
diff --git a/etc/profile-m-z/vimcat.profile b/etc/profile-m-z/vimcat.profile
new file mode 100644
index 000000000..73b76b5ab
--- /dev/null
+++ b/etc/profile-m-z/vimcat.profile
@@ -0,0 +1,10 @@
1# Firejail profile for vimcat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vimcat.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include vim.profile
diff --git a/etc/profile-m-z/vimdiff.profile b/etc/profile-m-z/vimdiff.profile
new file mode 100644
index 000000000..f09faf1d6
--- /dev/null
+++ b/etc/profile-m-z/vimdiff.profile
@@ -0,0 +1,10 @@
1# Firejail profile for vimdiff
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vimdiff.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include vim.profile
diff --git a/etc/profile-m-z/vimpager.profile b/etc/profile-m-z/vimpager.profile
new file mode 100644
index 000000000..af7703752
--- /dev/null
+++ b/etc/profile-m-z/vimpager.profile
@@ -0,0 +1,11 @@
1# Firejail profile for vimpager
2# Description: A vim-based script to use as a PAGER
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vimpager.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include vim.profile
diff --git a/etc/profile-m-z/vimtutor.profile b/etc/profile-m-z/vimtutor.profile
new file mode 100644
index 000000000..b9584cc49
--- /dev/null
+++ b/etc/profile-m-z/vimtutor.profile
@@ -0,0 +1,10 @@
1# Firejail profile for vimtutor
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vimtutor.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include vim.profile
diff --git a/etc/profile-m-z/virtualbox.profile b/etc/profile-m-z/virtualbox.profile
new file mode 100644
index 000000000..6ab9aa15b
--- /dev/null
+++ b/etc/profile-m-z/virtualbox.profile
@@ -0,0 +1,52 @@
1# Firejail profile for virtualbox
2# Description: x86 virtualization solution
3# This file is overwritten after every install/update
4# Persistent local customizations
5include virtualbox.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.VirtualBox
10noblacklist ${HOME}/.config/VirtualBox
11noblacklist ${HOME}/VirtualBox VMs
12# noblacklist /usr/bin/virtualbox
13noblacklist /usr/lib/virtualbox
14noblacklist /usr/lib64/virtualbox
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23mkdir ${HOME}/.config/VirtualBox
24mkdir ${HOME}/VirtualBox VMs
25whitelist ${HOME}/.config/VirtualBox
26whitelist ${HOME}/VirtualBox VMs
27whitelist ${DOWNLOADS}
28whitelist /usr/share/virtualbox
29include whitelist-common.inc
30include whitelist-runuser-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34# For host-only network sys_admin is needed. See https://github.com/netblue30/firejail/issues/2868#issuecomment-518647630
35
36apparmor
37caps.keep net_raw,sys_nice
38netfilter
39nodvd
40#nogroups
41notv
42shell none
43tracelog
44
45#disable-mnt
46#private-bin awk,basename,bash,env,gawk,grep,ps,readlink,sh,virtualbox,VirtualBox,VBox*,vbox*,whoami
47private-cache
48private-etc alsa,asound.conf,ca-certificates,conf.d,crypto-policies,dconf,fonts,hostname,hosts,ld.so.cache,localtime,machine-id,pki,pulse,resolv.conf,ssl
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-m-z/vivaldi-beta.profile b/etc/profile-m-z/vivaldi-beta.profile
new file mode 100644
index 000000000..0d80167f3
--- /dev/null
+++ b/etc/profile-m-z/vivaldi-beta.profile
@@ -0,0 +1,7 @@
1# Firejail profile for vivaldi-beta
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vivaldi-beta.local
5
6# Redirect
7include vivaldi.profile
diff --git a/etc/profile-m-z/vivaldi-snapshot.profile b/etc/profile-m-z/vivaldi-snapshot.profile
new file mode 100644
index 000000000..543f206af
--- /dev/null
+++ b/etc/profile-m-z/vivaldi-snapshot.profile
@@ -0,0 +1,7 @@
1# Firejail profile for vivaldi-snapshot
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vivaldi-snapshot.local
5
6# Redirect
7include vivaldi.profile
diff --git a/etc/profile-m-z/vivaldi-stable.profile b/etc/profile-m-z/vivaldi-stable.profile
new file mode 100644
index 000000000..94b2cd76c
--- /dev/null
+++ b/etc/profile-m-z/vivaldi-stable.profile
@@ -0,0 +1,7 @@
1# Firejail profile for vivaldi-stable
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vivaldi-stable.local
5
6# Redirect
7include vivaldi.profile
diff --git a/etc/profile-m-z/vivaldi.profile b/etc/profile-m-z/vivaldi.profile
new file mode 100644
index 000000000..fdeb0307f
--- /dev/null
+++ b/etc/profile-m-z/vivaldi.profile
@@ -0,0 +1,41 @@
1# Firejail profile for vivaldi
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vivaldi.local
5# Persistent global definitions
6include globals.local
7
8# Allow HTML5 Proprietary Media & DRM/EME (Widevine)
9ignore apparmor
10ignore noexec /var
11noblacklist /var/opt
12whitelist /var/opt/vivaldi
13writable-var
14
15noblacklist ${HOME}/.cache/vivaldi
16noblacklist ${HOME}/.cache/vivaldi-snapshot
17noblacklist ${HOME}/.config/vivaldi
18noblacklist ${HOME}/.config/vivaldi-snapshot
19noblacklist ${HOME}/.local/lib/vivaldi
20
21mkdir ${HOME}/.cache/vivaldi
22mkdir ${HOME}/.cache/vivaldi-snapshot
23mkdir ${HOME}/.config/vivaldi
24mkdir ${HOME}/.config/vivaldi-snapshot
25mkdir ${HOME}/.local/lib/vivaldi
26whitelist ${HOME}/.cache/vivaldi
27whitelist ${HOME}/.cache/vivaldi-snapshot
28whitelist ${HOME}/.config/vivaldi
29whitelist ${HOME}/.config/vivaldi-snapshot
30whitelist ${HOME}/.local/lib/vivaldi
31
32#private-bin bash,cat,dirname,readlink,rm,vivaldi,vivaldi-stable,vivaldi-snapshot
33
34# breaks vivaldi sync
35ignore dbus-user none
36ignore dbus-system none
37
38read-write ${HOME}/.local/lib/vivaldi
39
40# Redirect
41include chromium-common.profile
diff --git a/etc/profile-m-z/vlc.profile b/etc/profile-m-z/vlc.profile
new file mode 100644
index 000000000..68db032aa
--- /dev/null
+++ b/etc/profile-m-z/vlc.profile
@@ -0,0 +1,53 @@
1# Firejail profile for vlc
2# Description: Multimedia player and streamer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vlc.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/vlc
10noblacklist ${HOME}/.config/vlc
11noblacklist ${HOME}/.config/aacs
12noblacklist ${HOME}/.local/share/vlc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20read-only ${DESKTOP}
21mkdir ${HOME}/.cache/vlc
22mkdir ${HOME}/.config/vlc
23mkdir ${HOME}/.local/share/vlc
24whitelist ${HOME}/.cache/vlc
25whitelist ${HOME}/.config/vlc
26whitelist ${HOME}/.config/aacs
27whitelist ${HOME}/.local/share/vlc
28include whitelist-common.inc
29include whitelist-player-common.inc
30include whitelist-var-common.inc
31
32#apparmor - on Ubuntu 18.04 it refuses to start without dbus access
33caps.drop all
34netfilter
35nogroups
36noinput
37nonewprivs
38noroot
39nou2f
40protocol unix,inet,inet6,netlink
41seccomp
42shell none
43
44private-bin cvlc,nvlc,qvlc,rvlc,svlc,vlc
45private-dev
46private-tmp
47
48# dbus needed for MPRIS
49# dbus-user none
50# dbus-system none
51
52# mdwe is disabled due to breaking hardware accelerated decoding
53#memory-deny-write-execute
diff --git a/etc/profile-m-z/vmware-player.profile b/etc/profile-m-z/vmware-player.profile
new file mode 100644
index 000000000..582a0f693
--- /dev/null
+++ b/etc/profile-m-z/vmware-player.profile
@@ -0,0 +1,8 @@
1# Firejail profile for vmware-player
2# Description: The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vmware-player.local
6
7# Redirect
8include vmware.profile
diff --git a/etc/profile-m-z/vmware-view.profile b/etc/profile-m-z/vmware-view.profile
new file mode 100644
index 000000000..b2b019ff4
--- /dev/null
+++ b/etc/profile-m-z/vmware-view.profile
@@ -0,0 +1,56 @@
1# Firejail profile for vmware-view
2# Description: VMware Horizon Client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vmware-view.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.vmware
10
11noblacklist /sbin
12noblacklist /usr/sbin
13
14include allow-bin-sh.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-shell.inc
22include disable-xdg.inc
23
24mkdir ${HOME}/.vmware
25whitelist ${HOME}/.vmware
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31caps.drop all
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40# Add 'ignore novideo' to your vmware-view.local if you need your webcam.
41novideo
42protocol unix,inet,inet6
43seccomp !iopl
44seccomp.block-secondary
45shell none
46tracelog
47
48disable-mnt
49private-cache
50private-dev
51private-etc alsa,alternatives,asound.conf,bumblebee,ca-certificates,crypto-policies,dconf,drirc,fonts,gai.conf,gconf,glvnd,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,login.defs,machine-id,magic,magic.mgc,mime.types,nsswitch.conf,nvidia,pango,passwd,pki,protocols,proxychains.conf,pulse,resolv.conf,rpc,services,ssl,terminfo,vmware,vmware-tools,vmware-vix,X11,xdg
52# Logs are kept in /tmp. Add 'ignore private-tmp' to your vmware-view.local if you need them without joining the sandbox.
53private-tmp
54
55dbus-user none
56dbus-system none
diff --git a/etc/profile-m-z/vmware-workstation.profile b/etc/profile-m-z/vmware-workstation.profile
new file mode 100644
index 000000000..6290b57f4
--- /dev/null
+++ b/etc/profile-m-z/vmware-workstation.profile
@@ -0,0 +1,8 @@
1# Firejail profile for vmware-workstation
2# Description: The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vmware-workstation.local
6
7# Redirect
8include vmware.profile
diff --git a/etc/profile-m-z/vmware.profile b/etc/profile-m-z/vmware.profile
new file mode 100644
index 000000000..cb85836b7
--- /dev/null
+++ b/etc/profile-m-z/vmware.profile
@@ -0,0 +1,43 @@
1# Firejail profile for vmware
2# Description: The industry standard for running multiple operating systems as virtual machines on a single Linux PC.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include vmware.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/vmware
10noblacklist ${HOME}/.vmware
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.cache/vmware
20mkdir ${HOME}/.vmware
21whitelist ${HOME}/.cache/vmware
22whitelist ${HOME}/.vmware
23# Add the next lines to your vmware.local if you need to use "shared VM".
24#whitelist /var/lib/vmware
25#writable-var
26include whitelist-common.inc
27include whitelist-runuser-common.inc
28include whitelist-usr-share-common.inc
29include whitelist-var-common.inc
30
31caps.keep chown,net_raw,sys_nice
32netfilter
33nogroups
34notv
35shell none
36tracelog
37
38#disable-mnt
39# Add the next line to your vmware.local to enable private-bin.
40#private-bin env,bash,sh,ovftool,vmafossexec,vmaf_*,vmnet-*,vmplayer,vmrest,vmrun,vmss2core,vmstat,vmware,vmware-*
41private-etc alsa,asound.conf,ca-certificates,conf.d,crypto-policies,dconf,fonts,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,localtime,machine-id,passwd,pki,pulse,resolv.conf,ssl,vmware,vmware-installer,vmware-vix
42dbus-user none
43dbus-system none
diff --git a/etc/profile-m-z/vscodium.profile b/etc/profile-m-z/vscodium.profile
new file mode 100644
index 000000000..a4a4fb7d8
--- /dev/null
+++ b/etc/profile-m-z/vscodium.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for Visual Studio Code
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vscodium.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist ${HOME}/.VSCodium
10
11# Redirect
12include code.profile
diff --git a/etc/profile-m-z/vulturesclaw.profile b/etc/profile-m-z/vulturesclaw.profile
new file mode 100644
index 000000000..fa6ddf1fb
--- /dev/null
+++ b/etc/profile-m-z/vulturesclaw.profile
@@ -0,0 +1,13 @@
1# Firejail profile alias for nethack-vultures
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vulturesclaw.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist /var/games/vulturesclaw
10whitelist /var/games/vulturesclaw
11
12# Redirect
13include nethack-vultures.profile
diff --git a/etc/profile-m-z/vultureseye.profile b/etc/profile-m-z/vultureseye.profile
new file mode 100644
index 000000000..49d3fa94f
--- /dev/null
+++ b/etc/profile-m-z/vultureseye.profile
@@ -0,0 +1,13 @@
1# Firejail profile alias for nethack-vultures
2# This file is overwritten after every install/update
3# Persistent local customizations
4include vultureseye.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9noblacklist /var/games/vultureseye
10whitelist /var/games/vultureseye
11
12# Redirect
13include nethack-vultures.profile
diff --git a/etc/vym.profile b/etc/profile-m-z/vym.profile
index 4f60b2ada..6632ccb6b 100644
--- a/etc/vym.profile
+++ b/etc/profile-m-z/vym.profile
@@ -1,26 +1,30 @@
1# Firejail profile for vym 1# Firejail profile for vym
2# Description: Mindmapping tool
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/vym.local 5include vym.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ./.config/InSilmaril 9noblacklist ${HOME}/.config/InSilmaril
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-exec.inc
13include /etc/firejail/disable-programs.inc 14include disable-interpreters.inc
15include disable-programs.inc
14 16
15caps.drop all 17caps.drop all
16netfilter 18netfilter
17no3d 19no3d
18nodvd 20nodvd
19nogroups 21nogroups
22noinput
20nonewprivs 23nonewprivs
21noroot 24noroot
22nosound 25nosound
23notv 26notv
27nou2f
24novideo 28novideo
25protocol unix 29protocol unix
26seccomp 30seccomp
@@ -30,5 +34,3 @@ disable-mnt
30private-dev 34private-dev
31private-tmp 35private-tmp
32 36
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/profile-m-z/w3m.profile b/etc/profile-m-z/w3m.profile
new file mode 100644
index 000000000..81c8a2f5c
--- /dev/null
+++ b/etc/profile-m-z/w3m.profile
@@ -0,0 +1,71 @@
1# Firejail profile for w3m
2# Description: WWW browsable pager with excellent tables/frames support
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include w3m.local
7# Persistent global definitions
8include globals.local
9
10# Add the next lines to your w3m.local if you want to use w3m-img on a vconsole.
11#ignore nogroups
12#ignore private-dev
13#ignore private-etc
14
15noblacklist ${HOME}/.w3m
16
17blacklist /tmp/.X11-unix
18blacklist ${RUNUSER}/wayland-*
19
20# Allow /bin/sh (blacklisted by disable-shell.inc)
21include allow-bin-sh.inc
22
23# Allow perl (blacklisted by disable-interpreters.inc)
24include allow-perl.inc
25
26include disable-common.inc
27include disable-devel.inc
28include disable-exec.inc
29include disable-interpreters.inc
30include disable-programs.inc
31include disable-shell.inc
32include disable-xdg.inc
33
34mkdir ${HOME}/.w3m
35whitelist /usr/share/w3m
36whitelist ${DOWNLOADS}
37whitelist ${HOME}/.w3m
38include whitelist-runuser-common.inc
39include whitelist-usr-share-common.inc
40include whitelist-var-common.inc
41
42caps.drop all
43ipc-namespace
44machine-id
45netfilter
46no3d
47nodvd
48nogroups
49noinput
50nonewprivs
51noroot
52nosound
53notv
54nou2f
55novideo
56protocol unix,inet,inet6
57seccomp
58shell none
59tracelog
60
61disable-mnt
62private-bin perl,sh,w3m
63private-cache
64private-dev
65private-etc alternatives,ca-certificates,crypto-policies,mailcap,nsswitch.conf,pki,resolv.conf,ssl
66private-tmp
67
68dbus-user none
69dbus-system none
70
71memory-deny-write-execute
diff --git a/etc/profile-m-z/warmux.profile b/etc/profile-m-z/warmux.profile
new file mode 100644
index 000000000..92e0e7a83
--- /dev/null
+++ b/etc/profile-m-z/warmux.profile
@@ -0,0 +1,56 @@
1# Firejail profile for warmux
2# Description: a convivial mass murder game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include warmux.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/wormux
10noblacklist ${HOME}/.local/share/wormux
11noblacklist ${HOME}/.wormux
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.config/wormux
22mkdir ${HOME}/.local/share/wormux
23mkdir ${HOME}/.wormux
24whitelist ${HOME}/.config/wormux
25whitelist ${HOME}/.local/share/wormux
26whitelist ${HOME}/.wormux
27whitelist /usr/share/warmux
28include whitelist-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32apparmor
33caps.drop all
34netfilter
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix,inet,inet6
44seccomp
45shell none
46tracelog
47
48disable-mnt
49private-bin warmux
50private-cache
51private-dev
52private-etc ca-certificates,crypto-policies,host.conf,hostname,hosts,machine-id,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl
53private-tmp
54
55dbus-user none
56dbus-system none
diff --git a/etc/profile-m-z/warsow.profile b/etc/profile-m-z/warsow.profile
new file mode 100644
index 000000000..5659ec69c
--- /dev/null
+++ b/etc/profile-m-z/warsow.profile
@@ -0,0 +1,55 @@
1# Firejail profile for warsow
2# Description: Fast paced 3D first person shooter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include warsow.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec ${HOME}
10
11noblacklist ${HOME}/.cache/warsow-2.1
12noblacklist ${HOME}/.local/share/warsow-2.1
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.cache/warsow-2.1
23mkdir ${HOME}/.local/share/warsow-2.1
24whitelist ${HOME}/.cache/warsow-2.1
25whitelist ${HOME}/.local/share/warsow-2.1
26whitelist /usr/share/warsow
27include whitelist-common.inc
28include whitelist-runuser-common.inc
29include whitelist-usr-share-common.inc
30include whitelist-var-common.inc
31
32caps.drop all
33ipc-namespace
34netfilter
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40notv
41nou2f
42novideo
43protocol unix,inet,inet6
44seccomp
45shell none
46tracelog
47
48disable-mnt
49private-bin warsow
50private-cache
51private-dev
52private-tmp
53
54dbus-user none
55dbus-system none
diff --git a/etc/profile-m-z/warzone2100.profile b/etc/profile-m-z/warzone2100.profile
new file mode 100644
index 000000000..46dca0547
--- /dev/null
+++ b/etc/profile-m-z/warzone2100.profile
@@ -0,0 +1,47 @@
1# Firejail profile for warzone2100
2# Description: 3D real time strategy game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include warzone2100.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.warzone2100-3.*
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17
18mkdir ${HOME}/.warzone2100-3.1
19mkdir ${HOME}/.warzone2100-3.2
20whitelist ${HOME}/.warzone2100-3.1
21whitelist ${HOME}/.warzone2100-3.2
22whitelist /usr/share/games
23include whitelist-common.inc
24include whitelist-runuser-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6,netlink
40seccomp
41shell none
42tracelog
43
44disable-mnt
45private-bin warzone2100
46private-dev
47private-tmp
diff --git a/etc/profile-m-z/waterfox-classic.profile b/etc/profile-m-z/waterfox-classic.profile
new file mode 100644
index 000000000..6c7e18a46
--- /dev/null
+++ b/etc/profile-m-z/waterfox-classic.profile
@@ -0,0 +1,7 @@
1# Firejail profile for waterfox-classic
2# This file is overwritten after every install/update
3# Persistent local customizations
4include waterfox-classic.local
5
6# Redirect
7include waterfox.profile
diff --git a/etc/profile-m-z/waterfox-current.profile b/etc/profile-m-z/waterfox-current.profile
new file mode 100644
index 000000000..5e12a6fe3
--- /dev/null
+++ b/etc/profile-m-z/waterfox-current.profile
@@ -0,0 +1,7 @@
1# Firejail profile for waterfox-current
2# This file is overwritten after every install/update
3# Persistent local customizations
4include waterfox-current.local
5
6# Redirect
7include waterfox.profile
diff --git a/etc/profile-m-z/waterfox.profile b/etc/profile-m-z/waterfox.profile
new file mode 100644
index 000000000..18f1ca79a
--- /dev/null
+++ b/etc/profile-m-z/waterfox.profile
@@ -0,0 +1,28 @@
1# Firejail profile for waterfox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include waterfox.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.cache/waterfox
9noblacklist ${HOME}/.waterfox
10
11mkdir ${HOME}/.cache/waterfox
12mkdir ${HOME}/.waterfox
13whitelist ${HOME}/.cache/waterfox
14whitelist ${HOME}/.waterfox
15
16# Add the next lines to your watefox.local if you want to use the migration wizard.
17#noblacklist ${HOME}/.mozilla
18#whitelist ${HOME}/.mozilla
19
20# waterfox requires a shell to launch on Arch. We can possibly remove sh though.
21# Add the next line to your waterfox.local to enable private-bin.
22#private-bin bash,dbus-launch,dbus-send,env,sh,waterfox,waterfox-classic,waterfox-current,which
23# Add the next line to your waterfox.local to enable private-etc. Note that private-etc must first be
24# enabled in your firefox-common.local.
25#private-etc waterfox
26
27# Redirect
28include firefox-common.profile
diff --git a/etc/profile-m-z/webstorm.profile b/etc/profile-m-z/webstorm.profile
new file mode 100644
index 000000000..4d849c582
--- /dev/null
+++ b/etc/profile-m-z/webstorm.profile
@@ -0,0 +1,45 @@
1# Firejail profile for WebStorm
2# This file is overwritten after every install/update
3# Persistent local customizations
4include webstorm.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.WebStorm*
9noblacklist ${HOME}/.android
10noblacklist ${HOME}/.local/share/JetBrains
11noblacklist ${HOME}/.tooling
12# Allow KDE file manager to open with log directories (blacklisted by disable-programs.inc)
13noblacklist ${HOME}/.config/dolphinrc
14
15# Allows files commonly used by IDEs
16include allow-common-devel.inc
17
18# Allow ssh (blacklisted by disable-common.inc)
19include allow-ssh.inc
20
21noblacklist ${PATH}/node
22noblacklist ${HOME}/.nvm
23
24include disable-common.inc
25include disable-devel.inc
26include disable-interpreters.inc
27include disable-programs.inc
28
29caps.drop all
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42
43private-cache
44private-dev
45private-tmp
diff --git a/etc/profile-m-z/webui-aria2.profile b/etc/profile-m-z/webui-aria2.profile
new file mode 100644
index 000000000..2fe727b9c
--- /dev/null
+++ b/etc/profile-m-z/webui-aria2.profile
@@ -0,0 +1,38 @@
1# Firejail profile for webui-aria2
2# Run this with firejail --profile=webui-aria2 node node-server.js
3# This file is overwritten after every install/update
4# Persistent local customizations
5include webui-aria2.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PATH}/node
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-xdg.inc
17
18caps.drop all
19netfilter
20nodvd
21nogroups
22noinput
23nonewprivs
24noroot
25nosound
26notv
27nou2f
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32
33private-cache
34private-dev
35private-tmp
36
37dbus-user none
38dbus-system none
diff --git a/etc/profile-m-z/weechat-curses.profile b/etc/profile-m-z/weechat-curses.profile
new file mode 100644
index 000000000..92c968fb6
--- /dev/null
+++ b/etc/profile-m-z/weechat-curses.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for weechat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include weechat-curses.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include weechat.profile
diff --git a/etc/weechat.profile b/etc/profile-m-z/weechat.profile
index b0971ae19..76935212f 100644
--- a/etc/weechat.profile
+++ b/etc/profile-m-z/weechat.profile
@@ -1,14 +1,19 @@
1# Firejail profile for weechat 1# Firejail profile for weechat
2# Description: Fast, light and extensible chat client
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/weechat.local 5include weechat.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.weechat 9noblacklist ${HOME}/.weechat
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-programs.inc 12include disable-programs.inc
13
14whitelist /usr/share/weechat
15include whitelist-usr-share-common.inc
16include whitelist-var-common.inc
12 17
13caps.drop all 18caps.drop all
14netfilter 19netfilter
diff --git a/etc/wesnoth.profile b/etc/profile-m-z/wesnoth.profile
index d6318c81b..345b26a2c 100644
--- a/etc/wesnoth.profile
+++ b/etc/profile-m-z/wesnoth.profile
@@ -1,18 +1,19 @@
1# Firejail profile for wesnoth 1# Firejail profile for wesnoth
2# Description: Fantasy turn-based strategy game
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/wesnoth.local 5include wesnoth.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.cache/wesnoth 9noblacklist ${HOME}/.cache/wesnoth
9noblacklist ${HOME}/.config/wesnoth 10noblacklist ${HOME}/.config/wesnoth
10noblacklist ${HOME}/.local/share/wesnoth 11noblacklist ${HOME}/.local/share/wesnoth
11 12
12include /etc/firejail/disable-common.inc 13include disable-common.inc
13include /etc/firejail/disable-devel.inc 14include disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 15include disable-interpreters.inc
15include /etc/firejail/disable-programs.inc 16include disable-programs.inc
16 17
17mkdir ${HOME}/.cache/wesnoth 18mkdir ${HOME}/.cache/wesnoth
18mkdir ${HOME}/.config/wesnoth 19mkdir ${HOME}/.config/wesnoth
@@ -20,13 +21,16 @@ mkdir ${HOME}/.local/share/wesnoth
20whitelist ${HOME}/.cache/wesnoth 21whitelist ${HOME}/.cache/wesnoth
21whitelist ${HOME}/.config/wesnoth 22whitelist ${HOME}/.config/wesnoth
22whitelist ${HOME}/.local/share/wesnoth 23whitelist ${HOME}/.local/share/wesnoth
23include /etc/firejail/whitelist-common.inc 24include whitelist-common.inc
24 25
25caps.drop all 26caps.drop all
26nodvd 27nodvd
28noinput
27nonewprivs 29nonewprivs
28noroot 30noroot
29notv 31notv
32nou2f
33novideo
30protocol unix,inet,inet6 34protocol unix,inet,inet6
31seccomp 35seccomp
32 36
diff --git a/etc/profile-m-z/wget.profile b/etc/profile-m-z/wget.profile
new file mode 100644
index 000000000..4c21d6965
--- /dev/null
+++ b/etc/profile-m-z/wget.profile
@@ -0,0 +1,60 @@
1# Firejail profile for wget
2# Description: Retrieves files from the web
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include wget.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.netrc
11noblacklist ${HOME}/.wget-hsts
12noblacklist ${HOME}/.wgetrc
13
14blacklist /tmp/.X11-unix
15blacklist ${RUNUSER}
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23# Depending on workflow you can add the next line to your wget.local.
24#include disable-xdg.inc
25
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31ipc-namespace
32machine-id
33netfilter
34no3d
35nodvd
36nogroups
37noinput
38nonewprivs
39noroot
40nosound
41notv
42nou2f
43novideo
44protocol unix,inet,inet6
45seccomp
46seccomp.block-secondary
47shell none
48tracelog
49
50private-bin wget
51private-cache
52private-dev
53# Depending on workflow you can add the next line to your wget.local.
54#private-etc alternatives,ca-certificates,crypto-policies,pki,resolv.conf,ssl,wgetrc
55#private-tmp
56
57dbus-user none
58dbus-system none
59
60memory-deny-write-execute
diff --git a/etc/profile-m-z/whalebird.profile b/etc/profile-m-z/whalebird.profile
new file mode 100644
index 000000000..2f26bf14c
--- /dev/null
+++ b/etc/profile-m-z/whalebird.profile
@@ -0,0 +1,27 @@
1# Firejail profile for whalebird
2# Description: Electron-based Mastodon/Pleroma client
3# This file is overwritten after every install/update
4# Persistent local customizations
5include whalebird.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13ignore dbus-user none
14ignore dbus-system none
15
16noblacklist ${HOME}/.config/Whalebird
17
18mkdir ${HOME}/.config/Whalebird
19whitelist ${HOME}/.config/Whalebird
20
21no3d
22
23private-bin electron,electron[0-9],electron[0-9][0-9],whalebird
24private-etc fonts,machine-id
25
26# Redirect
27include electron.profile
diff --git a/etc/profile-m-z/whois.profile b/etc/profile-m-z/whois.profile
new file mode 100644
index 000000000..755e62f60
--- /dev/null
+++ b/etc/profile-m-z/whois.profile
@@ -0,0 +1,57 @@
1# Firejail profile for whois
2# Description: Intelligent WHOIS client
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include whois.local
7# Persistent global definitions
8include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25hostname whois
26ipc-namespace
27machine-id
28netfilter
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35nosound
36notv
37nou2f
38novideo
39protocol inet,inet6
40seccomp
41seccomp.block-secondary
42shell none
43tracelog
44
45disable-mnt
46private
47private-bin bash,sh,whois
48private-cache
49private-dev
50private-etc alternatives,hosts,jwhois.conf,resolv.conf,services,whois.conf
51private-lib gconv
52private-tmp
53
54dbus-user none
55dbus-system none
56
57memory-deny-write-execute
diff --git a/etc/profile-m-z/widelands.profile b/etc/profile-m-z/widelands.profile
new file mode 100644
index 000000000..6561be784
--- /dev/null
+++ b/etc/profile-m-z/widelands.profile
@@ -0,0 +1,48 @@
1# Firejail profile for widelands
2# Description: Open source realtime-strategy game
3# This file is overwritten after every install/update
4# Persistent local customizations
5include widelands.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.widelands
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.widelands
20whitelist ${HOME}/.widelands
21include whitelist-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26ipc-namespace
27netfilter
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33notv
34nou2f
35novideo
36protocol unix,inet,inet6,netlink
37seccomp
38shell none
39tracelog
40
41disable-mnt
42private-bin widelands
43private-cache
44private-dev
45private-tmp
46
47dbus-user none
48dbus-system none
diff --git a/etc/profile-m-z/wine.profile b/etc/profile-m-z/wine.profile
new file mode 100644
index 000000000..1e9b9341b
--- /dev/null
+++ b/etc/profile-m-z/wine.profile
@@ -0,0 +1,41 @@
1# Firejail profile for wine
2# Description: A compatibility layer for running Windows programs
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wine.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/winetricks
10noblacklist ${HOME}/.Steam
11noblacklist ${HOME}/.local/share/Steam
12noblacklist ${HOME}/.local/share/steam
13noblacklist ${HOME}/.steam
14noblacklist ${HOME}/.wine
15noblacklist /tmp/.wine-*
16
17include disable-common.inc
18include disable-devel.inc
19include disable-interpreters.inc
20include disable-programs.inc
21
22# whitelist /usr/share/wine
23# include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26# Some applications don't need allow-debuggers. Add 'ignore allow-debuggers' to your wine.local if you want to override this.
27allow-debuggers
28caps.drop all
29# net none
30netfilter
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36# nosound
37notv
38# novideo
39seccomp
40
41private-dev
diff --git a/etc/profile-m-z/wire-desktop.profile b/etc/profile-m-z/wire-desktop.profile
new file mode 100644
index 000000000..151cd2adb
--- /dev/null
+++ b/etc/profile-m-z/wire-desktop.profile
@@ -0,0 +1,32 @@
1# Firejail profile for wire-desktop
2# Description: End-to-end encrypted messenger with file sharing, voice calls and video conferences
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wire-desktop.local
6# Persistent global definitions
7include globals.local
8
9# Debian/Ubuntu use /opt/Wire. As that is not in PATH by default, run `firejail /opt/Wire/wire-desktop` to start it.
10
11# Disabled until someone reported positive feedback
12ignore include disable-exec.inc
13ignore include disable-xdg.inc
14ignore include whitelist-runuser-common.inc
15ignore include whitelist-usr-share-common.inc
16ignore include whitelist-var-common.inc
17ignore novideo
18ignore private-cache
19
20ignore dbus-user none
21ignore dbus-system none
22
23noblacklist ${HOME}/.config/Wire
24
25mkdir ${HOME}/.config/Wire
26whitelist ${HOME}/.config/Wire
27
28private-bin bash,electron,electron[0-9],electron[0-9][0-9],env,sh,wire-desktop
29private-etc alternatives,ca-certificates,crypto-policies,fonts,machine-id,pki,resolv.conf,ssl
30
31# Redirect
32include electron.profile
diff --git a/etc/profile-m-z/wireshark-gtk.profile b/etc/profile-m-z/wireshark-gtk.profile
new file mode 100644
index 000000000..4d54e986e
--- /dev/null
+++ b/etc/profile-m-z/wireshark-gtk.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for wireshark
2# Description: Network protocol analyzer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wireshark-gtk.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include wireshark.profile
diff --git a/etc/profile-m-z/wireshark-qt.profile b/etc/profile-m-z/wireshark-qt.profile
new file mode 100644
index 000000000..4e0694f95
--- /dev/null
+++ b/etc/profile-m-z/wireshark-qt.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for wireshark
2# Description: Network protocol analyzer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wireshark-qt.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include wireshark.profile
diff --git a/etc/profile-m-z/wireshark.profile b/etc/profile-m-z/wireshark.profile
new file mode 100644
index 000000000..16875ad9b
--- /dev/null
+++ b/etc/profile-m-z/wireshark.profile
@@ -0,0 +1,53 @@
1# Firejail profile for wireshark
2# Description: Network traffic analyzer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wireshark.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/wireshark
10noblacklist ${HOME}/.wireshark
11noblacklist ${DOCUMENTS}
12
13# Allow lua (blacklisted by disable-interpreters.inc)
14include allow-lua.inc
15
16include disable-common.inc
17include disable-devel.inc
18include disable-exec.inc
19include disable-interpreters.inc
20include disable-programs.inc
21include disable-xdg.inc
22
23whitelist /usr/share/wireshark
24include whitelist-usr-share-common.inc
25include whitelist-var-common.inc
26
27apparmor
28# caps.drop all
29caps.keep dac_override,net_admin,net_raw
30netfilter
31no3d
32# nogroups - breaks network traffic capture for unprivileged users
33noinput
34# nonewprivs - breaks network traffic capture for unprivileged users
35# noroot
36nodvd
37nosound
38notv
39nou2f
40novideo
41# protocol unix,inet,inet6,netlink,packet,bluetooth - commented out in case they bring in new protocols
42#seccomp
43shell none
44tracelog
45
46# private-bin wireshark
47private-cache
48private-dev
49# private-etc alternatives,ca-certificates,crypto-policies,fonts,group,hosts,machine-id,passwd,pki,ssl
50private-tmp
51
52dbus-user none
53dbus-system none
diff --git a/etc/profile-m-z/wordwarvi.profile b/etc/profile-m-z/wordwarvi.profile
new file mode 100644
index 000000000..b2f3341ee
--- /dev/null
+++ b/etc/profile-m-z/wordwarvi.profile
@@ -0,0 +1,52 @@
1# Firejail profile for wordwarvi
2# Description: Old school '80's style side scrolling space shoot'em up game.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wordwarvi.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.wordwarvi
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.wordwarvi
20whitelist ${HOME}/.wordwarvi
21whitelist /usr/share/wordwarvi
22include whitelist-common.inc
23include whitelist-usr-share-common.inc
24include whitelist-var-common.inc
25
26apparmor
27caps.drop all
28net none
29no3d
30nodvd
31nogroups
32noinput
33nonewprivs
34noroot
35notv
36nou2f
37novideo
38protocol unix
39seccomp
40shell none
41tracelog
42
43disable-mnt
44private
45private-bin wordwarvi
46private-cache
47private-dev
48private-etc alsa,asound.conf,machine-id,pulse
49private-tmp
50
51dbus-user none
52dbus-system none
diff --git a/etc/profile-m-z/wpp.profile b/etc/profile-m-z/wpp.profile
new file mode 100644
index 000000000..a219397a9
--- /dev/null
+++ b/etc/profile-m-z/wpp.profile
@@ -0,0 +1,14 @@
1# Firejail profile for wpp
2# Description: WPS Office - Presentation
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wpp.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10ignore machine-id
11ignore nosound
12
13# Redirect
14include wps.profile
diff --git a/etc/profile-m-z/wps.profile b/etc/profile-m-z/wps.profile
new file mode 100644
index 000000000..cb0301378
--- /dev/null
+++ b/etc/profile-m-z/wps.profile
@@ -0,0 +1,49 @@
1# Firejail profile for wps
2# Description: WPS Office - Writer
3# This file is overwritten after every install/update
4# Persistent local customizations
5include wps.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.kingsoft
10noblacklist ${HOME}/.config/Kingsoft
11noblacklist ${HOME}/.local/share/Kingsoft
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18
19include whitelist-usr-share-common.inc
20include whitelist-var-common.inc
21
22apparmor
23caps.drop all
24machine-id
25# Add the next line to your wps.local if you don't use network features.
26#net none
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34nosound
35notv
36nou2f
37novideo
38protocol unix,inet,inet6
39# seccomp causes some minor issues. Add the next line to your wps.local if you can live with those.
40#seccomp
41shell none
42tracelog
43
44private-cache
45private-dev
46private-tmp
47
48dbus-user none
49dbus-system none
diff --git a/etc/profile-m-z/wpspdf.profile b/etc/profile-m-z/wpspdf.profile
new file mode 100644
index 000000000..82080acbc
--- /dev/null
+++ b/etc/profile-m-z/wpspdf.profile
@@ -0,0 +1,11 @@
1# Firejail profile for wpspdf
2# Description: Kingsoft Pdf Reader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include et.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include wps.profile
diff --git a/etc/x-terminal-emulator.profile b/etc/profile-m-z/x-terminal-emulator.profile
index 1395b81c9..141d167a8 100644
--- a/etc/x-terminal-emulator.profile
+++ b/etc/profile-m-z/x-terminal-emulator.profile
@@ -1,20 +1,23 @@
1# Firejail profile for x-terminal-emulator 1# Firejail profile for x-terminal-emulator
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/x-terminal-emulator.local 4include x-terminal-emulator.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7
8 7
9caps.drop all 8caps.drop all
10ipc-namespace 9ipc-namespace
11net none 10net none
12netfilter
13nogroups 11nogroups
12noinput
14noroot 13noroot
14nou2f
15protocol unix 15protocol unix
16seccomp 16seccomp
17 17
18private-dev 18private-dev
19 19
20dbus-user none
21dbus-system none
22
20noexec /tmp 23noexec /tmp
diff --git a/etc/profile-m-z/x2goclient.profile b/etc/profile-m-z/x2goclient.profile
new file mode 100644
index 000000000..3fcac351d
--- /dev/null
+++ b/etc/profile-m-z/x2goclient.profile
@@ -0,0 +1,51 @@
1# Firejail profile for x2goclient
2# Description: Graphical client for X2Go remote desktop system
3# This file is overwritten after every install/update
4# Persistent local customizations
5include x2goclient.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.x2go
10noblacklist ${HOME}/.x2goclient
11
12# Allow ssh (blacklisted by disable-common.inc)
13include allow-ssh.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21apparmor
22caps.drop all
23ipc-namespace
24netfilter
25#no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31notv
32nou2f
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37tracelog
38
39#private-bin nxproxy,x2goclient
40private-cache
41private-dev
42#private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-3.0,host.conf,hostname,hosts,machine-id,pki,pulse,resolv.conf,ssl,X11,xdg
43#private-lib
44private-opt none
45private-srv none
46private-tmp
47
48dbus-user none
49dbus-system none
50
51#memory-deny-write-execute
diff --git a/etc/profile-m-z/xbill.profile b/etc/profile-m-z/xbill.profile
new file mode 100644
index 000000000..c9e408ccd
--- /dev/null
+++ b/etc/profile-m-z/xbill.profile
@@ -0,0 +1,54 @@
1# Firejail profile for xbill
2# Description: save your computers from Wingdows [TM] virus
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xbill.local
6# Persistent global definitions
7include globals.local
8
9include disable-common.inc
10include disable-devel.inc
11include disable-exec.inc
12include disable-interpreters.inc
13include disable-programs.inc
14include disable-shell.inc
15include disable-xdg.inc
16
17whitelist /usr/share/xbill
18whitelist /var/games/xbill/scores
19include whitelist-common.inc
20include whitelist-usr-share-common.inc
21include whitelist-var-common.inc
22
23apparmor
24caps.drop all
25machine-id
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private
44private-bin xbill
45private-cache
46private-dev
47private-etc none
48private-tmp
49
50dbus-user none
51dbus-system none
52
53memory-deny-write-execute
54read-only ${HOME}
diff --git a/etc/profile-m-z/xcalc.profile b/etc/profile-m-z/xcalc.profile
new file mode 100644
index 000000000..3f8aa2d34
--- /dev/null
+++ b/etc/profile-m-z/xcalc.profile
@@ -0,0 +1,43 @@
1# Firejail profile for xcalc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xcalc.local
5# Persistent global definitions
6include globals.local
7
8include disable-common.inc
9include disable-devel.inc
10include disable-exec.inc
11include disable-interpreters.inc
12include disable-programs.inc
13include disable-shell.inc
14include disable-xdg.inc
15
16include whitelist-var-common.inc
17
18apparmor
19caps.drop all
20net none
21no3d
22nodvd
23nogroups
24noinput
25nonewprivs
26noroot
27nosound
28notv
29nou2f
30novideo
31protocol unix
32seccomp
33shell none
34
35disable-mnt
36private
37private-bin xcalc
38private-dev
39private-lib
40private-tmp
41
42dbus-user none
43dbus-system none
diff --git a/etc/xchat.profile b/etc/profile-m-z/xchat.profile
index ab62160b5..a94444aab 100644
--- a/etc/xchat.profile
+++ b/etc/profile-m-z/xchat.profile
@@ -1,15 +1,16 @@
1# Firejail profile for xchat 1# Firejail profile for xchat
2# Description: IRC client for X similar to AmIRC
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/xchat.local 5include xchat.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/xchat 9noblacklist ${HOME}/.config/xchat
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-programs.inc 13include disable-programs.inc
13 14
14caps.drop all 15caps.drop all
15nodvd 16nodvd
@@ -19,4 +20,4 @@ notv
19protocol unix,inet,inet6 20protocol unix,inet,inet6
20seccomp 21seccomp
21 22
22# private-bin requires perl, python, etc. 23# private-bin requires perl, python*, etc.
diff --git a/etc/profile-m-z/xed.profile b/etc/profile-m-z/xed.profile
new file mode 100644
index 000000000..26383bda3
--- /dev/null
+++ b/etc/profile-m-z/xed.profile
@@ -0,0 +1,54 @@
1# Firejail profile for xed
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xed.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/xed
9noblacklist ${HOME}/.python-history
10noblacklist ${HOME}/.python_history
11noblacklist ${HOME}/.pythonhist
12
13# Allow python (blacklisted by disable-interpreters.inc)
14include allow-python2.inc
15include allow-python3.inc
16
17include disable-common.inc
18include disable-devel.inc
19include disable-exec.inc
20include disable-interpreters.inc
21include disable-programs.inc
22include disable-shell.inc
23
24include whitelist-var-common.inc
25
26# apparmor - makes settings immutable
27caps.drop all
28machine-id
29# net none - makes settings immutable
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix
41seccomp
42shell none
43tracelog
44
45private-bin xed
46private-dev
47private-tmp
48
49# makes settings immutable
50# dbus-user none
51# dbus-system none
52
53# xed uses python plugins, memory-deny-write-execute breaks python
54# memory-deny-write-execute
diff --git a/etc/xfburn.profile b/etc/profile-m-z/xfburn.profile
index ec1aca75f..91e25048d 100644
--- a/etc/xfburn.profile
+++ b/etc/profile-m-z/xfburn.profile
@@ -1,16 +1,17 @@
1# Firejail profile for xfburn 1# Firejail profile for xfburn
2# Description: CD-burner application for Xfce Desktop Environment
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/xfburn.local 5include xfburn.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ~/.config/xfburn 9noblacklist ${HOME}/.config/xfburn
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-interpreters.inc
13include /etc/firejail/disable-programs.inc 14include disable-programs.inc
14 15
15caps.drop all 16caps.drop all
16netfilter 17netfilter
@@ -27,5 +28,4 @@ tracelog
27 28
28# private-bin xfburn 29# private-bin xfburn
29# private-dev 30# private-dev
30# private-etc fonts
31# private-tmp 31# private-tmp
diff --git a/etc/xfce4-dict.profile b/etc/profile-m-z/xfce4-dict.profile
index ab52d17e9..fcfec10d0 100644
--- a/etc/xfce4-dict.profile
+++ b/etc/profile-m-z/xfce4-dict.profile
@@ -1,34 +1,40 @@
1# Firejail profile for xfce4-dict 1# Firejail profile for xfce4-dict
2# Description: Dictionary plugin for Xfce4 panel
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/xfce4-dict.local 5include xfce4-dict.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/xfce4-dict 9noblacklist ${HOME}/.config/xfce4-dict
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-exec.inc
13include /etc/firejail/disable-programs.inc 14include disable-interpreters.inc
15include disable-programs.inc
14 16
17include whitelist-var-common.inc
18
19apparmor
15caps.drop all 20caps.drop all
16netfilter 21netfilter
17no3d 22no3d
18nodvd 23nodvd
19nogroups 24nogroups
25noinput
20nonewprivs 26nonewprivs
21noroot 27noroot
22nosound 28nosound
23notv 29notv
30nou2f
24novideo 31novideo
25protocol unix,inet,inet6 32protocol unix,inet,inet6
26seccomp 33seccomp
27shell none 34shell none
28 35
29disable-mnt 36disable-mnt
37private-cache
30private-dev 38private-dev
31private-tmp 39private-tmp
32 40
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/profile-m-z/xfce4-mixer.profile b/etc/profile-m-z/xfce4-mixer.profile
new file mode 100644
index 000000000..05c46dffb
--- /dev/null
+++ b/etc/profile-m-z/xfce4-mixer.profile
@@ -0,0 +1,57 @@
1# Firejail profile for xfce4-mixer
2# Description: Volume control for Xfce
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xfce4-mixer.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-mixer.xml
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkfile ${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-mixer.xml
20whitelist ${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-mixer.xml
21whitelist /usr/share/gstreamer-*
22whitelist /usr/share/xfce4
23whitelist /usr/share/xfce4-mixer
24include whitelist-common.inc
25include whitelist-usr-share-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30ipc-namespace
31netfilter
32no3d
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40novideo
41protocol unix
42seccomp
43shell none
44
45disable-mnt
46private-bin xfce4-mixer,xfconf-query
47private-cache
48private-dev
49private-etc alternatives,asound.conf,fonts,machine-id,pulse
50private-tmp
51
52dbus-user filter
53dbus-user.own org.xfce.xfce4-mixer
54dbus-user.talk org.xfce.Xfconf
55dbus-system none
56
57# memory-deny-write-execute - breaks on Arch
diff --git a/etc/xfce4-notes.profile b/etc/profile-m-z/xfce4-notes.profile
index 868b4796b..5004b8fb6 100644
--- a/etc/xfce4-notes.profile
+++ b/etc/profile-m-z/xfce4-notes.profile
@@ -1,36 +1,42 @@
1# Firejail profile for xfce4-notes 1# Firejail profile for xfce4-notes
2# Description: Notes application for the Xfce4 desktop
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
3# Persistent local customizations 4# Persistent local customizations
4include /etc/firejail/xfce4-notes.local 5include xfce4-notes.local
5# Persistent global definitions 6# Persistent global definitions
6include /etc/firejail/globals.local 7include globals.local
7 8
8noblacklist ${HOME}/.config/xfce4/xfce4-notes.gtkrc 9noblacklist ${HOME}/.config/xfce4/xfce4-notes.gtkrc
9noblacklist ${HOME}/.config/xfce4/xfce4-notes.rc 10noblacklist ${HOME}/.config/xfce4/xfce4-notes.rc
10noblacklist ${HOME}/.local/share/notes 11noblacklist ${HOME}/.local/share/notes
11 12
12include /etc/firejail/disable-common.inc 13include disable-common.inc
13include /etc/firejail/disable-devel.inc 14include disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc 15include disable-exec.inc
15include /etc/firejail/disable-programs.inc 16include disable-interpreters.inc
17include disable-programs.inc
16 18
19include whitelist-var-common.inc
20
21apparmor
17caps.drop all 22caps.drop all
18netfilter 23netfilter
19no3d 24no3d
20nodvd 25nodvd
21nogroups 26nogroups
27noinput
22nonewprivs 28nonewprivs
23noroot 29noroot
24nosound 30nosound
25notv 31notv
32nou2f
26novideo 33novideo
27protocol unix 34protocol unix
28seccomp 35seccomp
29shell none 36shell none
30 37
31disable-mnt 38disable-mnt
39private-cache
32private-dev 40private-dev
33private-tmp 41private-tmp
34 42
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/profile-m-z/xfce4-screenshooter.profile b/etc/profile-m-z/xfce4-screenshooter.profile
new file mode 100644
index 000000000..b869ae005
--- /dev/null
+++ b/etc/profile-m-z/xfce4-screenshooter.profile
@@ -0,0 +1,51 @@
1# Firejail profile for xfce4-screenshooter
2# Description: Xfce screenshot tool
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xfce4-screenshooter.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${PICTURES}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19whitelist /usr/share/xfce4
20include whitelist-runuser-common.inc
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24apparmor
25caps.drop all
26machine-id
27netfilter
28no3d
29nodvd
30nogroups
31noinput
32nonewprivs
33noroot
34notv
35nou2f
36novideo
37protocol unix,inet,inet6
38seccomp
39shell none
40tracelog
41
42disable-mnt
43private-bin xfce4-screenshooter,xfconf-query
44private-dev
45private-etc ca-certificates,crypto-policies,dconf,fonts,gtk-3.0,pki,resolv.conf,ssl
46private-tmp
47
48dbus-user none
49dbus-system none
50
51# memory-deny-write-execute -- see #3790
diff --git a/etc/profile-m-z/xiphos.profile b/etc/profile-m-z/xiphos.profile
new file mode 100644
index 000000000..070e5e0f7
--- /dev/null
+++ b/etc/profile-m-z/xiphos.profile
@@ -0,0 +1,51 @@
1# Firejail profile for xiphos
2# Description: Environment for Bible reading, study, and research
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xiphos.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.sword
10noblacklist ${HOME}/.xiphos
11
12blacklist ${HOME}/.bashrc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20
21mkdir ${HOME}/.sword
22mkdir ${HOME}/.xiphos
23whitelist ${HOME}/.sword
24whitelist ${HOME}/.xiphos
25include whitelist-common.inc
26include whitelist-var-common.inc
27
28apparmor
29caps.drop all
30machine-id
31netfilter
32nodvd
33nogroups
34noinput
35nonewprivs
36noroot
37nosound
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private-bin xiphos
48private-cache
49private-dev
50private-etc alternatives,ca-certificates,crypto-policies,fonts,pki,resolv.conf,ssli,sword,sword.conf
51private-tmp
diff --git a/etc/profile-m-z/xlinks.profile b/etc/profile-m-z/xlinks.profile
new file mode 100644
index 000000000..d5e25cfe7
--- /dev/null
+++ b/etc/profile-m-z/xlinks.profile
@@ -0,0 +1,20 @@
1# Firejail profile for xlinks
2# Description: Text WWW browser (X11)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xlinks.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist /tmp/.X11-unix
11
12include whitelist-common.inc
13
14# if you want to use user-configured programs add 'private-bin PROGRAM1,PROGRAM2'
15# to your xlinks.local or append 'PROGRAM1,PROGRAM2' to this private-bin line
16private-bin xlinks
17private-etc fonts
18
19# Redirect
20include links.profile
diff --git a/etc/profile-m-z/xlinks2 b/etc/profile-m-z/xlinks2
new file mode 100644
index 000000000..1ae6a60ca
--- /dev/null
+++ b/etc/profile-m-z/xlinks2
@@ -0,0 +1,20 @@
1# Firejail profile for xlinks2
2# Description: Text WWW browser (X11)
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xlinks2.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist /tmp/.X11-unix
11
12include whitelist-common.inc
13
14# if you want to use user-configured programs add 'private-bin PROGRAM1,PROGRAM2'
15# to your xlinks.local or append 'PROGRAM1,PROGRAM2' to this private-bin line
16private-bin xlinks2
17private-etc fonts
18
19# Redirect
20include links2.profile
diff --git a/etc/xmms.profile b/etc/profile-m-z/xmms.profile
index 717c81fd0..4003f69a2 100644
--- a/etc/xmms.profile
+++ b/etc/profile-m-z/xmms.profile
@@ -1,23 +1,28 @@
1# Firejail profile for xmms 1# Firejail profile for xmms
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3# Persistent local customizations 3# Persistent local customizations
4include /etc/firejail/xmms.local 4include xmms.local
5# Persistent global definitions 5# Persistent global definitions
6include /etc/firejail/globals.local 6include globals.local
7 7
8noblacklist ${HOME}/.xmms 8noblacklist ${HOME}/.xmms
9noblacklist ${MUSIC}
9 10
10include /etc/firejail/disable-common.inc 11include disable-common.inc
11include /etc/firejail/disable-devel.inc 12include disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc 13include disable-interpreters.inc
13include /etc/firejail/disable-programs.inc 14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
14 17
15caps.drop all 18caps.drop all
16netfilter 19netfilter
17no3d 20no3d
21noinput
18nonewprivs 22nonewprivs
19noroot 23noroot
20notv 24notv
25nou2f
21novideo 26novideo
22protocol unix,inet,inet6 27protocol unix,inet,inet6
23seccomp 28seccomp
diff --git a/etc/profile-m-z/xmr-stak.profile b/etc/profile-m-z/xmr-stak.profile
new file mode 100644
index 000000000..8179e8d76
--- /dev/null
+++ b/etc/profile-m-z/xmr-stak.profile
@@ -0,0 +1,46 @@
1# Firejail profile for xmr-stak
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xmr-stak.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.xmr-stak
9
10include disable-common.inc
11include disable-devel.inc
12include disable-exec.inc
13include disable-interpreters.inc
14include disable-programs.inc
15include disable-shell.inc
16include disable-xdg.inc
17
18mkdir ${HOME}/.xmr-stak
19include whitelist-var-common.inc
20
21caps.drop all
22ipc-namespace
23netfilter
24nodvd
25nogroups
26noinput
27nonewprivs
28noroot
29nosound
30notv
31nou2f
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37disable-mnt
38private ${HOME}/.xmr-stak
39private-bin xmr-stak
40private-dev
41private-etc alternatives,ca-certificates,crypto-policies,nsswitch.conf,pki,resolv.conf,ssl
42#private-lib libxmrstak_opencl_backend,libxmrstak_cuda_backend
43private-opt cuda
44private-tmp
45
46memory-deny-write-execute
diff --git a/etc/profile-m-z/xonotic-glx.profile b/etc/profile-m-z/xonotic-glx.profile
new file mode 100644
index 000000000..f1766fcf4
--- /dev/null
+++ b/etc/profile-m-z/xonotic-glx.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for xonotic
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xonotic-glx.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include xonotic.profile
diff --git a/etc/xonotic-glx.profile b/etc/profile-m-z/xonotic-sdl-wrapper.profile
index 041a063bb..6f0c7cf4c 100644
--- a/etc/xonotic-glx.profile
+++ b/etc/profile-m-z/xonotic-sdl-wrapper.profile
@@ -1,6 +1,6 @@
1# Firejail profile alias for xonotic 1# Firejail profile alias for xonotic
2# This file is overwritten after every install/update 2# This file is overwritten after every install/update
3 3include xonotic-sdl-wrapper.local
4 4
5# Redirect 5# Redirect
6include /etc/firejail/xonotic.profile 6include xonotic.profile
diff --git a/etc/profile-m-z/xonotic-sdl.profile b/etc/profile-m-z/xonotic-sdl.profile
new file mode 100644
index 000000000..4b680edb1
--- /dev/null
+++ b/etc/profile-m-z/xonotic-sdl.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for xonotic
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xonotic-sdl.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include xonotic.profile
diff --git a/etc/profile-m-z/xonotic.profile b/etc/profile-m-z/xonotic.profile
new file mode 100644
index 000000000..6ffe9ece9
--- /dev/null
+++ b/etc/profile-m-z/xonotic.profile
@@ -0,0 +1,57 @@
1# Firejail profile for xonotic
2# Description: A free, fast-paced crossplatform first-person shooter
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xonotic.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.xonotic
10
11include allow-bin-sh.inc
12include allow-opengl-game.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19include disable-shell.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.xonotic
23whitelist ${HOME}/.xonotic
24whitelist /usr/share/xonotic
25include whitelist-common.inc
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38notv
39nou2f
40novideo
41protocol unix,inet,inet6
42seccomp
43shell none
44tracelog
45
46disable-mnt
47private-cache
48private-bin blind-id,darkplaces-glx,darkplaces-sdl,dirname,ldd,netstat,ps,readlink,sh,uname,xonotic*
49private-dev
50private-etc alternatives,asound.conf,ca-certificates,crypto-policies,drirc,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,machine-id,nsswitch.conf,passwd,pki,pulse,resolv.conf,ssl
51private-tmp
52
53dbus-user none
54dbus-system none
55
56read-only ${HOME}
57read-write ${HOME}/.xonotic
diff --git a/etc/profile-m-z/xournal.profile b/etc/profile-m-z/xournal.profile
new file mode 100644
index 000000000..e4282a125
--- /dev/null
+++ b/etc/profile-m-z/xournal.profile
@@ -0,0 +1,51 @@
1# Firejail profile for xournal
2# Description: Note taking and PDF editing
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xournal.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10
11include disable-common.inc
12include disable-devel.inc
13include disable-exec.inc
14include disable-interpreters.inc
15include disable-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19whitelist /usr/share/xournal
20whitelist /usr/share/poppler
21include whitelist-usr-share-common.inc
22include whitelist-var-common.inc
23
24caps.drop all
25machine-id
26net none
27no3d
28nodvd
29nogroups
30noinput
31nonewprivs
32noroot
33nosound
34notv
35nou2f
36novideo
37protocol unix
38seccomp
39seccomp.block-secondary
40shell none
41tracelog
42
43private-bin xournal
44private-cache
45private-dev
46private-etc alternatives,fonts,group,machine-id,passwd
47# TODO should use private-lib
48private-tmp
49
50dbus-user none
51dbus-system none
diff --git a/etc/profile-m-z/xournalpp.profile b/etc/profile-m-z/xournalpp.profile
new file mode 100644
index 000000000..a23ad68df
--- /dev/null
+++ b/etc/profile-m-z/xournalpp.profile
@@ -0,0 +1,34 @@
1# Firejail profile for xournalpp
2# Description: Handwriting note-taking software with PDF annotation support
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xournalpp.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10noblacklist ${HOME}/.cache/xournalpp
11noblacklist ${HOME}/.config/xournalpp
12noblacklist ${HOME}/.xournalpp
13
14include allow-lua.inc
15
16whitelist /usr/share/texlive
17whitelist /usr/share/xournalpp
18whitelist /var/lib/texmf
19include whitelist-runuser-common.inc
20
21#mkdir ${HOME}/.cache/xournalpp
22#mkdir ${HOME}/.config/xournalpp
23#whitelist ${HOME}/.cache/xournalpp
24#whitelist ${HOME}/.config/xournalpp
25#whitelist ${HOME}/.xournalpp
26#whitelist ${HOME}/.texlive20*
27#whitelist ${DOCUMENTS}
28#include whitelist-common.inc
29
30private-bin kpsewhich,pdflatex,xournalpp
31private-etc alternatives,latexmk.conf,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,texlive
32
33# Redirect
34include xournal.profile
diff --git a/etc/profile-m-z/xpdf.profile b/etc/profile-m-z/xpdf.profile
new file mode 100644
index 000000000..0149d36a3
--- /dev/null
+++ b/etc/profile-m-z/xpdf.profile
@@ -0,0 +1,45 @@
1# Firejail profile for xpdf
2# Description: Portable Document Format (PDF) reader
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xpdf.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.xpdfrc
10noblacklist ${DOCUMENTS}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-xdg.inc
18
19include whitelist-var-common.inc
20
21apparmor
22caps.drop all
23machine-id
24net none
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38
39private-dev
40private-tmp
41
42dbus-user none
43dbus-system none
44
45memory-deny-write-execute
diff --git a/etc/profile-m-z/xplayer-audio-preview.profile b/etc/profile-m-z/xplayer-audio-preview.profile
new file mode 100644
index 000000000..0559b8183
--- /dev/null
+++ b/etc/profile-m-z/xplayer-audio-preview.profile
@@ -0,0 +1,10 @@
1# Firejail profile for xplayer-audio-preview
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xplayer-audio-preview.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include xplayer.profile
diff --git a/etc/profile-m-z/xplayer-video-thumbnailer.profile b/etc/profile-m-z/xplayer-video-thumbnailer.profile
new file mode 100644
index 000000000..6b2878476
--- /dev/null
+++ b/etc/profile-m-z/xplayer-video-thumbnailer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for xplayer-video-thumbnailer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xplayer-video-thumbnailer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include xplayer.profile
diff --git a/etc/profile-m-z/xplayer.profile b/etc/profile-m-z/xplayer.profile
new file mode 100644
index 000000000..d1ea2c9d5
--- /dev/null
+++ b/etc/profile-m-z/xplayer.profile
@@ -0,0 +1,50 @@
1# Firejail profile for xplayer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xplayer.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.config/xplayer
9noblacklist ${HOME}/.local/share/xplayer
10
11# Allow python (blacklisted by disable-interpreters.inc)
12include allow-python2.inc
13include allow-python3.inc
14
15include disable-common.inc
16include disable-devel.inc
17include disable-exec.inc
18include disable-interpreters.inc
19include disable-programs.inc
20
21read-only ${DESKTOP}
22mkdir ${HOME}/.config/xplayer
23mkdir ${HOME}/.local/share/xplayer
24whitelist ${HOME}/.config/xplayer
25whitelist ${HOME}/.local/share/xplayer
26include whitelist-common.inc
27include whitelist-player-common.inc
28include whitelist-var-common.inc
29
30# apparmor - makes settings immutable
31caps.drop all
32netfilter
33nogroups
34noinput
35nonewprivs
36noroot
37nou2f
38protocol unix,inet,inet6
39seccomp
40shell none
41tracelog
42
43private-bin xplayer,xplayer-audio-preview,xplayer-video-thumbnailer
44private-dev
45# private-etc alternatives,asound.conf,ca-certificates,crypto-policies,fonts,machine-id,pki,pulse,ssl
46private-tmp
47
48# makes settings immutable
49# dbus-user none
50# dbus-system none
diff --git a/etc/xpra.profile b/etc/profile-m-z/xpra.profile
index 2bd91e8b5..aed6c102f 100644
--- a/etc/xpra.profile
+++ b/etc/profile-m-z/xpra.profile
@@ -1,24 +1,28 @@
1# Firejail profile for xpra 1# Firejail profile for xpra
2# Description: Tool to detach/reattach running X programs
2# This file is overwritten after every install/update 3# This file is overwritten after every install/update
4quiet
3# Persistent local customizations 5# Persistent local customizations
4include /etc/firejail/xpra.local 6include xpra.local
5# Persistent global definitions 7# Persistent global definitions
6include /etc/firejail/globals.local 8include globals.local
7 9
8# 10#
9# This profile will sandbox Xpra server itself when used with firejail --x11=xpra. 11# This profile will sandbox Xpra server itself when used with firejail --x11=xpra.
10# To enable it, create a firejail-xpra symlink in /usr/local/bin: 12# To enable it, create a firejail-xpra symlink in /usr/local/bin:
11# 13#
12# $ sudo ln -s /usr/bin/firejail /usr/local/bin/xpra 14# $ sudo ln -s /usr/bin/firejail /usr/local/bin/xpra
13# 15#
14# or run "sudo firecfg" 16# or run "sudo firecfg"
15 17
16blacklist /media 18# Allow python (blacklisted by disable-interpreters.inc)
19include allow-python2.inc
20include allow-python3.inc
17 21
18include /etc/firejail/disable-common.inc 22include disable-common.inc
19include /etc/firejail/disable-devel.inc 23include disable-devel.inc
20include /etc/firejail/disable-passwdmgr.inc 24include disable-interpreters.inc
21include /etc/firejail/disable-programs.inc 25include disable-programs.inc
22 26
23whitelist /var/lib/xkb 27whitelist /var/lib/xkb
24# whitelisting home directory, or including whitelist-common.inc 28# whitelisting home directory, or including whitelist-common.inc
@@ -28,20 +32,23 @@ caps.drop all
28# xpra needs to be allowed access to the abstract Unix socket namespace. 32# xpra needs to be allowed access to the abstract Unix socket namespace.
29nodvd 33nodvd
30nogroups 34nogroups
35noinput
31nonewprivs 36nonewprivs
32# In noroot mode, xpra cannot create a socket in the real /tmp/.X11-unix. 37# In noroot mode, xpra cannot create a socket in the real /tmp/.X11-unix.
33#noroot 38#noroot
34nosound 39nosound
35notv 40notv
41nou2f
36novideo 42novideo
37protocol unix 43protocol unix
38seccomp 44seccomp
39shell none 45shell none
40 46
47disable-mnt
41# private home directory doesn't work on some distros, so we go for a regular home 48# private home directory doesn't work on some distros, so we go for a regular home
42# private 49# private
43# older Xpra versions also use Xvfb 50# older Xpra versions also use Xvfb
44# private-bin xpra,python,Xvfb,Xorg,sh,xkbcomp,xauth,dbus-launch,pactl,ldconfig,which,strace,bash,cat,ls 51# private-bin bash,cat,dbus-launch,ldconfig,ls,pactl,python*,sh,strace,which,xauth,xkbcomp,Xorg,xpra,Xvfb
45private-dev 52private-dev
46# private-etc ld.so.conf,ld.so.cache,resolv.conf,host.conf,nsswitch.conf,gai.conf,hosts,hostname,machine-id,xpra,X11 53# private-etc alternatives,gai.conf,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,machine-id,nsswitch.conf,resolv.conf,X11,xpra
47private-tmp 54private-tmp
diff --git a/etc/profile-m-z/xreader-previewer.profile b/etc/profile-m-z/xreader-previewer.profile
new file mode 100644
index 000000000..6e1dcb5d2
--- /dev/null
+++ b/etc/profile-m-z/xreader-previewer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for xreader-previewer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xreader-previewer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include xreader.profile
diff --git a/etc/profile-m-z/xreader-thumbnailer.profile b/etc/profile-m-z/xreader-thumbnailer.profile
new file mode 100644
index 000000000..a6925fcde
--- /dev/null
+++ b/etc/profile-m-z/xreader-thumbnailer.profile
@@ -0,0 +1,10 @@
1# Firejail profile for xreader-thumbnailer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xreader-thumbnailer.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include xreader.profile
diff --git a/etc/profile-m-z/xreader.profile b/etc/profile-m-z/xreader.profile
new file mode 100644
index 000000000..f59adc6e2
--- /dev/null
+++ b/etc/profile-m-z/xreader.profile
@@ -0,0 +1,45 @@
1# Firejail profile for xreader
2# Description: Document viewer for files like PDF and Postscript. X-Apps Project.
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xreader.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/xreader
10noblacklist ${HOME}/.config/xreader
11noblacklist ${DOCUMENTS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-xdg.inc
19
20# Breaks xreader on Mint 18.3
21# include whitelist-var-common.inc
22
23# apparmor
24caps.drop all
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40private-bin xreader,xreader-previewer,xreader-thumbnailer
41private-dev
42private-etc alternatives,fonts,ld.so.cache
43private-tmp
44
45memory-deny-write-execute
diff --git a/etc/profile-m-z/xviewer.profile b/etc/profile-m-z/xviewer.profile
new file mode 100644
index 000000000..5c8d6a47e
--- /dev/null
+++ b/etc/profile-m-z/xviewer.profile
@@ -0,0 +1,49 @@
1# Firejail profile for xviewer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include xviewer.local
5# Persistent global definitions
6include globals.local
7
8noblacklist ${HOME}/.Steam
9noblacklist ${HOME}/.config/xviewer
10noblacklist ${HOME}/.local/share/Trash
11noblacklist ${HOME}/.steam
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19
20include whitelist-var-common.inc
21
22# apparmor - makes settings immutable
23caps.drop all
24# net none - makes settings immutable
25no3d
26nodvd
27nogroups
28noinput
29nonewprivs
30noroot
31nosound
32notv
33nou2f
34novideo
35protocol unix
36seccomp
37shell none
38tracelog
39
40private-bin xviewer
41private-dev
42private-lib
43private-tmp
44
45# makes settings immutable
46# dbus-user none
47# dbus-system none
48
49memory-deny-write-execute
diff --git a/etc/profile-m-z/xxd.profile b/etc/profile-m-z/xxd.profile
new file mode 100644
index 000000000..864e8ce9c
--- /dev/null
+++ b/etc/profile-m-z/xxd.profile
@@ -0,0 +1,12 @@
1# Firejail profile for xxd
2# Description: Tool to make (or reverse) a hex dump
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xxd.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xz.profile b/etc/profile-m-z/xz.profile
new file mode 100644
index 000000000..7d6be2f49
--- /dev/null
+++ b/etc/profile-m-z/xz.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xz.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xzcat.profile b/etc/profile-m-z/xzcat.profile
new file mode 100644
index 000000000..8ba77eece
--- /dev/null
+++ b/etc/profile-m-z/xzcat.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzcat.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xzcmp.profile b/etc/profile-m-z/xzcmp.profile
new file mode 100644
index 000000000..9626048ba
--- /dev/null
+++ b/etc/profile-m-z/xzcmp.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzcmp.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xzdec.profile b/etc/profile-m-z/xzdec.profile
new file mode 100644
index 000000000..79f71f2fd
--- /dev/null
+++ b/etc/profile-m-z/xzdec.profile
@@ -0,0 +1,11 @@
1# Firejail profile for xzdec
2# Description: XZ-format compression utilities - tiny decompressors
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzdec.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include archiver-common.profile
diff --git a/etc/profile-m-z/xzdiff.profile b/etc/profile-m-z/xzdiff.profile
new file mode 100644
index 000000000..825fa9180
--- /dev/null
+++ b/etc/profile-m-z/xzdiff.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzdiff.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xzegrep.profile b/etc/profile-m-z/xzegrep.profile
new file mode 100644
index 000000000..8d50a3bc6
--- /dev/null
+++ b/etc/profile-m-z/xzegrep.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzegrep.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xzfgrep.profile b/etc/profile-m-z/xzfgrep.profile
new file mode 100644
index 000000000..a8aac86b7
--- /dev/null
+++ b/etc/profile-m-z/xzfgrep.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzfgrep.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/xzgrep.profile b/etc/profile-m-z/xzgrep.profile
new file mode 100644
index 000000000..ac4cc81c4
--- /dev/null
+++ b/etc/profile-m-z/xzgrep.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xzgrep.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include cpio.profile
diff --git a/etc/profile-m-z/xzless.profile b/etc/profile-m-z/xzless.profile
new file mode 100644
index 000000000..f17c5e1f6
--- /dev/null
+++ b/etc/profile-m-z/xzless.profile
@@ -0,0 +1,11 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4# Persistent local customizations
5include xzless.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include cpio.profile
diff --git a/etc/profile-m-z/xzmore.profile b/etc/profile-m-z/xzmore.profile
new file mode 100644
index 000000000..ef4106f66
--- /dev/null
+++ b/etc/profile-m-z/xzmore.profile
@@ -0,0 +1,12 @@
1# Firejail profile alias for cpio
2# Description: Library and command line tools for XZ and LZMA compressed files
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include xzmore.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# Redirect
12include cpio.profile
diff --git a/etc/profile-m-z/yandex-browser.profile b/etc/profile-m-z/yandex-browser.profile
new file mode 100644
index 000000000..81cd021f7
--- /dev/null
+++ b/etc/profile-m-z/yandex-browser.profile
@@ -0,0 +1,28 @@
1# Firejail profile for yandex-browser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include yandex-browser.local
5# Persistent global definitions
6include globals.local
7
8# Disable for now, see https://www.tutorialspoint.com/difference-between-void-main-and-int-main-in-c-cplusplus
9ignore whitelist /usr/share/chromium
10ignore include whitelist-runuser-common.inc
11ignore include whitelist-usr-share-common.inc
12
13noblacklist ${HOME}/.cache/yandex-browser
14noblacklist ${HOME}/.cache/yandex-browser-beta
15noblacklist ${HOME}/.config/yandex-browser
16noblacklist ${HOME}/.config/yandex-browser-beta
17
18mkdir ${HOME}/.cache/yandex-browser
19mkdir ${HOME}/.cache/yandex-browser-beta
20mkdir ${HOME}/.config/yandex-browser
21mkdir ${HOME}/.config/yandex-browser-beta
22whitelist ${HOME}/.cache/yandex-browser
23whitelist ${HOME}/.cache/yandex-browser-beta
24whitelist ${HOME}/.config/yandex-browser
25whitelist ${HOME}/.config/yandex-browser-beta
26
27# Redirect
28include chromium-common.profile
diff --git a/etc/profile-m-z/yarn.profile b/etc/profile-m-z/yarn.profile
new file mode 100644
index 000000000..05b55d071
--- /dev/null
+++ b/etc/profile-m-z/yarn.profile
@@ -0,0 +1,10 @@
1# Firejail profile for yarn
2# Description: Fast, reliable, and secure dependency management
3quiet
4# Persistent local customizations
5include yarn.local
6# Persistent global definitions
7include globals.local
8
9# Redirect
10include nodejs-common.profile
diff --git a/etc/profile-m-z/yelp.profile b/etc/profile-m-z/yelp.profile
new file mode 100644
index 000000000..2a6dbe1bf
--- /dev/null
+++ b/etc/profile-m-z/yelp.profile
@@ -0,0 +1,77 @@
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-programs.inc
16include disable-shell.inc
17include disable-xdg.inc
18
19mkdir ${HOME}/.config/yelp
20whitelist ${HOME}/.config/yelp
21whitelist /usr/libexec/webkit2gtk-4.0
22whitelist /usr/share/doc
23whitelist /usr/share/groff
24whitelist /usr/share/help
25whitelist /usr/share/man
26whitelist /usr/share/yelp
27whitelist /usr/share/yelp-tools
28whitelist /usr/share/yelp-xsl
29include whitelist-common.inc
30include whitelist-runuser-common.inc
31include whitelist-usr-share-common.inc
32include whitelist-var-common.inc
33
34apparmor
35caps.drop all
36# machine-id breaks sound - add the next line to your yelp.local if you don't need sound support.
37#machine-id
38net none
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44# nosound - add the next line to your yelp.local if you don't need sound support.
45#nosound
46notv
47nou2f
48novideo
49protocol unix
50seccomp
51seccomp.block-secondary
52shell none
53tracelog
54
55disable-mnt
56private-bin groff,man,tbl,troff,yelp
57private-cache
58private-dev
59private-etc alsa,alternatives,asound.conf,crypto-policies,cups,dconf,drirc,fonts,gcrypt,groff,gtk-3.0,machine-id,man_db.conf,openal,os-release,pulse,sgml,xml
60private-tmp
61
62dbus-user filter
63dbus-user.own org.gnome.Yelp
64dbus-user.talk ca.desrt.dconf
65dbus-system none
66
67# read-only ${HOME} breaks some features:
68# 1. yelp --editor-mode
69# 2. saving the window geometry
70# add 'ignore read-only ${HOME}' to your yelp.local if you need these features.
71read-only ${HOME}
72read-write ${HOME}/.cache
73# 3. printing to PDF in ${DOCUMENTS}
74# additionally add 'noblacklist ${DOCUMENTS}' and 'whitelist ${DOCUMENTS}' to
75# your yelp.local if you need PDF printing support.
76#noblacklist ${DOCUMENTS}
77#whitelist ${DOCUMENTS}
diff --git a/etc/profile-m-z/youtube-dl-gui.profile b/etc/profile-m-z/youtube-dl-gui.profile
new file mode 100644
index 000000000..5d6fb47c1
--- /dev/null
+++ b/etc/profile-m-z/youtube-dl-gui.profile
@@ -0,0 +1,56 @@
1# Firejail profile for youtube-dl-gui
2# Description: A cross platform front-end GUI of the popular youtube-dl media downloader
3include youtube-dl-gui.local
4# This file is overwritten after every install/update
5include globals.local
6
7#These are blacklisted by disable-interpreters.inc
8include allow-python2.inc
9include allow-python3.inc
10
11noblacklist ${HOME}/.config/youtube-dlg
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.config/youtube-dlg
22whitelist ${HOME}/.config/youtube-dlg
23whitelist ${DOWNLOADS}
24include whitelist-common.inc
25include whitelist-runuser-common.inc
26include whitelist-usr-share-common.inc
27include whitelist-var-common.inc
28
29apparmor
30caps.drop all
31machine-id
32netfilter
33nodvd
34nogroups
35noinput
36nonewprivs
37noroot
38nosound
39notv
40nou2f
41novideo
42protocol unix,inet,inet6
43seccomp
44seccomp.block-secondary
45shell none
46tracelog
47
48disable-mnt
49private-bin atomicparsley,ffmpeg,ffprobe,python*,youtube-dl-gui
50private-cache
51private-dev
52private-etc alternatives,ca-certificates,crypto-policies,dconf,fonts,gtk-2.0,gtk-3.0,hostname,hosts,ld.so.cache,locale,locale.conf,passwd,pki,resolv.conf,ssl
53private-tmp
54
55dbus-user none
56dbus-system none
diff --git a/etc/profile-m-z/youtube-dl.profile b/etc/profile-m-z/youtube-dl.profile
new file mode 100644
index 000000000..145e565fd
--- /dev/null
+++ b/etc/profile-m-z/youtube-dl.profile
@@ -0,0 +1,67 @@
1# Firejail profile for youtube-dl
2# Description: Downloader of videos from YouTube and other sites
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include youtube-dl.local
7# Persistent global definitions
8include globals.local
9
10# breaks when installed under ${HOME} via `pip install --user` (see #2833)
11ignore noexec ${HOME}
12
13noblacklist ${HOME}/.cache/youtube-dl
14noblacklist ${HOME}/.config/youtube-dl
15noblacklist ${HOME}/.netrc
16noblacklist ${MUSIC}
17noblacklist ${VIDEOS}
18
19# Allow python (blacklisted by disable-interpreters.inc)
20include allow-python2.inc
21include allow-python3.inc
22
23blacklist /tmp/.X11-unix
24blacklist ${RUNUSER}
25
26include disable-common.inc
27include disable-devel.inc
28include disable-exec.inc
29include disable-interpreters.inc
30include disable-programs.inc
31include disable-shell.inc
32include disable-xdg.inc
33
34include whitelist-usr-share-common.inc
35include whitelist-var-common.inc
36
37apparmor
38caps.drop all
39ipc-namespace
40machine-id
41netfilter
42no3d
43nodvd
44nogroups
45noinput
46nonewprivs
47noroot
48nosound
49notv
50nou2f
51novideo
52protocol unix,inet,inet6
53seccomp
54seccomp.block-secondary
55shell none
56tracelog
57
58private-bin env,ffmpeg,python*,youtube-dl
59private-cache
60private-dev
61private-etc alternatives,ca-certificates,crypto-policies,hostname,hosts,ld.so.cache,mime.types,pki,resolv.conf,ssl,youtube-dl.conf
62private-tmp
63
64dbus-user none
65dbus-system none
66
67#memory-deny-write-execute - breaks on Arch (see issue #1803)
diff --git a/etc/profile-m-z/youtube-viewer.profile b/etc/profile-m-z/youtube-viewer.profile
new file mode 100644
index 000000000..b54dd37ad
--- /dev/null
+++ b/etc/profile-m-z/youtube-viewer.profile
@@ -0,0 +1,21 @@
1# Firejail profile for youtube-viewer
2# Description: Trizen's CLI Youtube viewer with login support
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include youtube-viewer.local
7# Persistent global definitions
8include globals.local
9
10noblacklist ${HOME}/.cache/youtube-viewer
11noblacklist ${HOME}/.config/youtube-viewer
12
13mkdir ${HOME}/.cache/youtube-viewer
14mkdir ${HOME}/.config/youtube-viewer
15whitelist ${HOME}/.cache/youtube-viewer
16whitelist ${HOME}/.config/youtube-viewer
17
18private-bin gtk-youtube-viewer,gtk2-youtube-viewer,gtk3-youtube-viewer,youtube-viewer
19
20# Redirect
21include youtube-viewers-common.profile \ No newline at end of file
diff --git a/etc/profile-m-z/youtube-viewers-common.profile b/etc/profile-m-z/youtube-viewers-common.profile
new file mode 100644
index 000000000..a05f05c51
--- /dev/null
+++ b/etc/profile-m-z/youtube-viewers-common.profile
@@ -0,0 +1,60 @@
1# Firejail profile for youtube-viewer clones
2# Description: common profile for Trizen's Youtube viewers
3# This file is overwritten after every install/update
4# Persistent local customizations
5include youtube-viewers-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10noblacklist ${HOME}/.cache/youtube-dl
11
12# Allow lua (blacklisted by disable-interpreters.inc)
13include allow-lua.inc
14
15# Allow perl (blacklisted by disable-interpreters.inc)
16include allow-perl.inc
17
18# Allow python (blacklisted by disable-interpreters.inc)
19include allow-python2.inc
20include allow-python3.inc
21
22include disable-common.inc
23include disable-devel.inc
24include disable-exec.inc
25include disable-interpreters.inc
26include disable-programs.inc
27include disable-xdg.inc
28
29whitelist ${DOWNLOADS}
30whitelist ${HOME}/.cache/youtube-dl/youtube-sigfuncs
31include whitelist-common.inc
32include whitelist-runuser-common.inc
33include whitelist-usr-share-common.inc
34include whitelist-var-common.inc
35
36apparmor
37caps.drop all
38netfilter
39nodvd
40nogroups
41noinput
42nonewprivs
43noroot
44notv
45nou2f
46novideo
47protocol unix,inet,inet6
48seccomp
49shell none
50tracelog
51
52disable-mnt
53private-bin bash,ffmpeg,ffprobe,firefox,mpv,perl,python*,sh,smplayer,stty,wget,which,xterm,youtube-dl,yt-dlp
54private-cache
55private-dev
56private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,machine-id,mime.types,nsswitch.conf,passwd,pki,pulse,resolv.conf,ssl,X11,xdg
57private-tmp
58
59dbus-user none
60dbus-system none
diff --git a/etc/profile-m-z/youtube.profile b/etc/profile-m-z/youtube.profile
new file mode 100644
index 000000000..efb001ee6
--- /dev/null
+++ b/etc/profile-m-z/youtube.profile
@@ -0,0 +1,24 @@
1# Firejail profile for youtube
2# Description: Unofficial electron based desktop warpper for YouTube
3# This file is overwritten after every install/update
4# Persistent local customizations
5include youtube.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reported positive feedback
10ignore nou2f
11
12noblacklist ${HOME}/.config/Youtube
13
14include disable-shell.inc
15
16mkdir ${HOME}/.config/Youtube
17whitelist ${HOME}/.config/Youtube
18
19private-bin electron,electron[0-9],electron[0-9][0-9],youtube
20private-etc alsa,alternatives,asound.conf,ati,bumblebee,ca-certificates,crypto-policies,drirc,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,nvidia,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
21private-opt Youtube
22
23# Redirect
24include electron.profile
diff --git a/etc/profile-m-z/youtubemusic-nativefier.profile b/etc/profile-m-z/youtubemusic-nativefier.profile
new file mode 100644
index 000000000..ce7161a70
--- /dev/null
+++ b/etc/profile-m-z/youtubemusic-nativefier.profile
@@ -0,0 +1,21 @@
1# Firejail profile for youtubemusic-nativefier
2# Description: Unofficial electron based desktop warpper for YouTube Music
3# This file is overwritten after every install/update
4# Persistent local customizations
5include youtube.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/youtubemusic-nativefier-040164
10
11include disable-shell.inc
12
13mkdir ${HOME}/.config/youtubemusic-nativefier-040164
14whitelist ${HOME}/.config/youtubemusic-nativefier-040164
15
16private-bin electron,electron[0-9],electron[0-9][0-9],youtubemusic-nativefier
17private-etc alsa,alternatives,asound.conf,ati,bumblebee,ca-certificates,crypto-policies,drirc,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,nvidia,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
18private-opt youtubemusic-nativefier
19
20# Redirect
21include electron.profile
diff --git a/etc/profile-m-z/yt-dlp.profile b/etc/profile-m-z/yt-dlp.profile
new file mode 100644
index 000000000..1c3382a08
--- /dev/null
+++ b/etc/profile-m-z/yt-dlp.profile
@@ -0,0 +1,19 @@
1# Firejail profile for yt-dlp
2# Description: Downloader of videos of various sites
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include yt-dlp.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11noblacklist ${HOME}/.cache/yt-dlp
12noblacklist ${HOME}/.config/yt-dlp
13noblacklist ${HOME}/yt-dlp.conf
14
15private-bin yt-dlp
16private-etc yt-dlp.conf
17
18# Redirect
19include youtube-dl.profile
diff --git a/etc/profile-m-z/ytmdesktop.profile b/etc/profile-m-z/ytmdesktop.profile
new file mode 100644
index 000000000..ab46fccc2
--- /dev/null
+++ b/etc/profile-m-z/ytmdesktop.profile
@@ -0,0 +1,21 @@
1# Firejail profile for ytmdesktop
2# Description: Unofficial electron based desktop warpper for YouTube Music
3# This file is overwritten after every install/update
4# Persistent local customizations
5include youtube.local
6# Persistent global definitions
7include globals.local
8
9ignore dbus-user none
10
11noblacklist ${HOME}/.config/youtube-music-desktop-app
12
13mkdir ${HOME}/.config/youtube-music-desktop-app
14whitelist ${HOME}/.config/youtube-music-desktop-app
15
16# private-bin env,ytmdesktop
17private-etc alsa,alternatives,asound.conf,ati,bumblebee,ca-certificates,crypto-policies,drirc,fonts,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,mime.types,nsswitch.conf,nvidia,pki,pulse,resolv.conf,selinux,ssl,X11,xdg
18# private-opt
19
20# Redirect
21include electron.profile
diff --git a/etc/profile-m-z/zaproxy.profile b/etc/profile-m-z/zaproxy.profile
new file mode 100644
index 000000000..1f11f133f
--- /dev/null
+++ b/etc/profile-m-z/zaproxy.profile
@@ -0,0 +1,47 @@
1# Firejail profile for zaproxy
2# Description: Integrated penetration testing tool for finding vulnerabilities in web applications
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zaproxy.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.ZAP
10
11# Allow java (blacklisted by disable-devel.inc)
12include allow-java.inc
13
14include disable-common.inc
15include disable-devel.inc
16include disable-exec.inc
17include disable-interpreters.inc
18include disable-programs.inc
19
20mkdir ${HOME}/.java
21mkdir ${HOME}/.ZAP
22whitelist ${HOME}/.java
23whitelist ${HOME}/.ZAP
24include whitelist-common.inc
25include whitelist-var-common.inc
26
27caps.drop all
28ipc-namespace
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36nosound
37notv
38nou2f
39novideo
40protocol unix,inet,inet6
41seccomp
42shell none
43
44disable-mnt
45private-dev
46private-tmp
47
diff --git a/etc/profile-m-z/zart.profile b/etc/profile-m-z/zart.profile
new file mode 100644
index 000000000..f534aee8f
--- /dev/null
+++ b/etc/profile-m-z/zart.profile
@@ -0,0 +1,38 @@
1# Firejail profile for zart
2# Description: A GUI for G'MIC real-time manipulations on the output of a webcam
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zart.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${DOCUMENTS}
10noblacklist ${PICTURES}
11
12include disable-common.inc
13include disable-devel.inc
14include disable-exec.inc
15include disable-interpreters.inc
16include disable-programs.inc
17include disable-shell.inc
18include disable-xdg.inc
19
20caps.drop all
21ipc-namespace
22net none
23nodvd
24nogroups
25noinput
26nonewprivs
27noroot
28notv
29nou2f
30protocol unix
31seccomp
32shell none
33
34private-bin ffmpeg,ffplay,ffprobe,melt,zart
35private-dev
36
37dbus-user none
38dbus-system none
diff --git a/etc/profile-m-z/zathura.profile b/etc/profile-m-z/zathura.profile
new file mode 100644
index 000000000..68c9b0a93
--- /dev/null
+++ b/etc/profile-m-z/zathura.profile
@@ -0,0 +1,62 @@
1# Firejail profile for zathura
2# Description: Document viewer with a minimalistic interface
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zathura.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/zathura
10noblacklist ${HOME}/.local/share/zathura
11noblacklist ${DOCUMENTS}
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-write-mnt.inc
20include disable-xdg.inc
21
22mkdir ${HOME}/.config/zathura
23mkdir ${HOME}/.local/share/zathura
24whitelist /usr/share/doc
25whitelist /usr/share/zathura
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30apparmor
31caps.drop all
32machine-id
33net none
34nodvd
35nogroups
36noinput
37nonewprivs
38noroot
39nosound
40notv
41nou2f
42novideo
43protocol unix
44seccomp
45seccomp.block-secondary
46shell none
47tracelog
48
49private-bin zathura
50private-cache
51private-dev
52private-etc alternatives,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id
53# private-lib has problems on Debian 10
54#private-lib gcc/*/*/libgcc_s.so.*,gcc/*/*/libstdc++.so.*,libarchive.so.*,libdjvulibre.so.*,libgirara-gtk*,libpoppler-glib.so.*,libspectre.so.*,zathura
55private-tmp
56
57dbus-user none
58dbus-system none
59
60read-only ${HOME}
61read-write ${HOME}/.config/zathura
62read-write ${HOME}/.local/share/zathura
diff --git a/etc/profile-m-z/zcat.profile b/etc/profile-m-z/zcat.profile
new file mode 100644
index 000000000..5de13ab90
--- /dev/null
+++ b/etc/profile-m-z/zcat.profile
@@ -0,0 +1,15 @@
1# Firejail profile for zcat
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zcat.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Allow running kernel config check
11ignore include disable-shell.inc
12noblacklist /proc/config.gz
13
14# Redirect
15include gzip.profile
diff --git a/etc/profile-m-z/zcmp.profile b/etc/profile-m-z/zcmp.profile
new file mode 100644
index 000000000..795cdae2a
--- /dev/null
+++ b/etc/profile-m-z/zcmp.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zcmp
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zcmp.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zdiff.profile b/etc/profile-m-z/zdiff.profile
new file mode 100644
index 000000000..1e75e38fe
--- /dev/null
+++ b/etc/profile-m-z/zdiff.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zdiff
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zdiff.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zeal.profile b/etc/profile-m-z/zeal.profile
new file mode 100644
index 000000000..c148e717b
--- /dev/null
+++ b/etc/profile-m-z/zeal.profile
@@ -0,0 +1,60 @@
1# Firejail profile for zeal
2# Description: Offline API documentation browser
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zeal.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.config/Zeal
10noblacklist ${HOME}/.cache/Zeal
11noblacklist ${HOME}/.local/share/Zeal
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.cache/Zeal
22mkdir ${HOME}/.config/qt5ct
23mkdir ${HOME}/.config/Zeal
24mkdir ${HOME}/.local/share/Zeal
25whitelist ${HOME}/.cache/Zeal
26whitelist ${HOME}/.config/Zeal
27whitelist ${HOME}/.local/share/Zeal
28include whitelist-common.inc
29include whitelist-var-common.inc
30
31apparmor
32caps.drop all
33machine-id
34netfilter
35no3d
36nodvd
37nogroups
38noinput
39nonewprivs
40noroot
41nosound
42notv
43nou2f
44novideo
45protocol unix,inet,inet6,netlink
46seccomp
47shell none
48tracelog
49
50disable-mnt
51private-bin zeal
52private-cache
53private-dev
54private-etc alternatives,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mime.types,nsswitch.conf,pango,pki,protocols,resolv.conf,rpc,services,ssl,Trolltech.conf,X11,xdg
55private-tmp
56
57dbus-user none
58dbus-system none
59
60# memory-deny-write-execute - breaks on Arch
diff --git a/etc/profile-m-z/zegrep.profile b/etc/profile-m-z/zegrep.profile
new file mode 100644
index 000000000..54dc6b2a0
--- /dev/null
+++ b/etc/profile-m-z/zegrep.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zegrep
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zegrep.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zfgrep.profile b/etc/profile-m-z/zfgrep.profile
new file mode 100644
index 000000000..73b22f2e8
--- /dev/null
+++ b/etc/profile-m-z/zfgrep.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zfgrep
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zfgrep.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zforce.profile b/etc/profile-m-z/zforce.profile
new file mode 100644
index 000000000..d62e57065
--- /dev/null
+++ b/etc/profile-m-z/zforce.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zforce
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zforce.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zgrep.profile b/etc/profile-m-z/zgrep.profile
new file mode 100644
index 000000000..f63dc871f
--- /dev/null
+++ b/etc/profile-m-z/zgrep.profile
@@ -0,0 +1,15 @@
1# Firejail profile for zgrep
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zgrep.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Allow running kernel config check
11ignore include disable-shell.inc
12noblacklist /proc/config.gz
13
14# Redirect
15include gzip.profile
diff --git a/etc/profile-m-z/zim.profile b/etc/profile-m-z/zim.profile
new file mode 100644
index 000000000..fa67b76c7
--- /dev/null
+++ b/etc/profile-m-z/zim.profile
@@ -0,0 +1,71 @@
1# Firejail profile for Zim
2# Description: Desktop wiki & notekeeper
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zim.local
6# Persistent global definitions
7include globals.local
8
9noblacklist ${HOME}/.cache/zim
10noblacklist ${HOME}/.config/zim
11
12# Allow python (blacklisted by disable-interpreters.inc)
13include allow-python2.inc
14include allow-python3.inc
15
16blacklist /usr/libexec
17
18include disable-common.inc
19include disable-devel.inc
20include disable-exec.inc
21include disable-interpreters.inc
22include disable-programs.inc
23include disable-shell.inc
24
25mkdir ${HOME}/.cache/zim
26mkdir ${HOME}/.config/zim
27mkdir ${HOME}/Notebooks
28whitelist ${HOME}/.cache/zim
29whitelist ${HOME}/.config/zim
30whitelist ${HOME}/Notebooks
31whitelist ${DESKTOP}
32whitelist ${DOCUMENTS}
33whitelist ${DOWNLOADS}
34whitelist ${MUSIC}
35whitelist ${PICTURES}
36whitelist ${VIDEOS}
37whitelist /usr/share/zim
38include whitelist-common.inc
39include whitelist-runuser-common.inc
40include whitelist-usr-share-common.inc
41include whitelist-var-common.inc
42
43apparmor
44caps.drop all
45machine-id
46net none
47no3d
48nodvd
49nogroups
50noinput
51nonewprivs
52noroot
53nosound
54notv
55nou2f
56novideo
57protocol unix
58seccomp
59seccomp.block-secondary
60shell none
61tracelog
62
63disable-mnt
64private-bin python*,zim
65private-cache
66private-dev
67private-etc alternatives,dconf,fonts,gconf,gtk-2.0,gtk-3.0,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,pango,X11
68private-tmp
69
70dbus-user none
71dbus-system none
diff --git a/etc/profile-m-z/zless.profile b/etc/profile-m-z/zless.profile
new file mode 100644
index 000000000..0a26cda1f
--- /dev/null
+++ b/etc/profile-m-z/zless.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zless
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zless.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zmore.profile b/etc/profile-m-z/zmore.profile
new file mode 100644
index 000000000..3a8f63562
--- /dev/null
+++ b/etc/profile-m-z/zmore.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zmore
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include zmore.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/znew.profile b/etc/profile-m-z/znew.profile
new file mode 100644
index 000000000..a8593e58e
--- /dev/null
+++ b/etc/profile-m-z/znew.profile
@@ -0,0 +1,11 @@
1# Firejail profile for znew
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include znew.local
6# Persistent global definitions
7# added by included profile
8#include globals.local
9
10# Redirect
11include gzip.profile
diff --git a/etc/profile-m-z/zoom.profile b/etc/profile-m-z/zoom.profile
new file mode 100644
index 000000000..ac615d861
--- /dev/null
+++ b/etc/profile-m-z/zoom.profile
@@ -0,0 +1,35 @@
1# Firejail profile for zoom
2# Description: Video Conferencing and Web Conferencing Service
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zoom.local
6# Persistent global definitions
7include globals.local
8
9# Disabled until someone reports positive feedback.
10ignore apparmor
11ignore novideo
12ignore dbus-user none
13ignore dbus-system none
14
15# nogroups breaks webcam access on non-systemd systems (see #3711).
16# If you use such a system, add 'ignore nogroups' to your zoom.local.
17#ignore nogroups
18
19noblacklist ${HOME}/.config/zoomus.conf
20noblacklist ${HOME}/.zoom
21
22nowhitelist ${DOWNLOADS}
23
24mkdir ${HOME}/.cache/zoom
25mkfile ${HOME}/.config/zoomus.conf
26mkdir ${HOME}/.zoom
27whitelist ${HOME}/.cache/zoom
28whitelist ${HOME}/.config/zoomus.conf
29whitelist ${HOME}/.zoom
30
31# Disable for now, see https://github.com/netblue30/firejail/issues/3726
32#private-etc alternatives,ca-certificates,crypto-policies,fonts,group,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,nsswitch.conf,pki,resolv.conf,ssl
33
34# Redirect
35include electron.profile
diff --git a/etc/profile-m-z/zpaq.profile b/etc/profile-m-z/zpaq.profile
new file mode 100644
index 000000000..80329ecfd
--- /dev/null
+++ b/etc/profile-m-z/zpaq.profile
@@ -0,0 +1,15 @@
1# Firejail profile for zpaq
2# Description: Programmable file compressor, library and utilities. Based on the PAQ compression algorithm.
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include zpaq.local
7# Persistent global definitions
8# added by included profile
9#include globals.local
10
11# mdwx breaks 'list' functionality
12ignore memory-deny-write-execute
13
14# Redirect
15include cpio.profile
diff --git a/etc/profile-m-z/zstd.profile b/etc/profile-m-z/zstd.profile
new file mode 100644
index 000000000..faeb5c5c5
--- /dev/null
+++ b/etc/profile-m-z/zstd.profile
@@ -0,0 +1,11 @@
1# Firejail profile for zstd
2# Description: Zstandard - Fast real-time compression algorithm
3# This file is overwritten after every install/update
4quiet
5# Persistent local customizations
6include zstd.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include archiver-common.profile
diff --git a/etc/profile-m-z/zstdcat.profile b/etc/profile-m-z/zstdcat.profile
new file mode 100644
index 000000000..df4c493fd
--- /dev/null
+++ b/etc/profile-m-z/zstdcat.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for zstd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include zstdcat.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include zstd.profile
diff --git a/etc/profile-m-z/zstdgrep.profile b/etc/profile-m-z/zstdgrep.profile
new file mode 100644
index 000000000..8a2683119
--- /dev/null
+++ b/etc/profile-m-z/zstdgrep.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for zstd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include zstdgrep.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include zstd.profile
diff --git a/etc/profile-m-z/zstdless.profile b/etc/profile-m-z/zstdless.profile
new file mode 100644
index 000000000..e5821e4c5
--- /dev/null
+++ b/etc/profile-m-z/zstdless.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for zstd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include zstdless.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include zstd.profile
diff --git a/etc/profile-m-z/zstdmt.profile b/etc/profile-m-z/zstdmt.profile
new file mode 100644
index 000000000..0a43fd556
--- /dev/null
+++ b/etc/profile-m-z/zstdmt.profile
@@ -0,0 +1,10 @@
1# Firejail profile alias for zstd
2# This file is overwritten after every install/update
3# Persistent local customizations
4include zstdmt.local
5# Persistent global definitions
6# added by included profile
7#include globals.local
8
9# Redirect
10include zstd.profile
diff --git a/etc/profile-m-z/zulip.profile b/etc/profile-m-z/zulip.profile
new file mode 100644
index 000000000..604da4c8e
--- /dev/null
+++ b/etc/profile-m-z/zulip.profile
@@ -0,0 +1,48 @@
1# Firejail profile for zulip
2# Description: Real-time team chat based on the email threading model
3# This file is overwritten after every install/update
4# Persistent local customizations
5include zulip.local
6# Persistent global definitions
7include globals.local
8
9ignore noexec /tmp
10
11noblacklist ${HOME}/.config/Zulip
12
13include disable-common.inc
14include disable-devel.inc
15include disable-exec.inc
16include disable-interpreters.inc
17include disable-programs.inc
18include disable-shell.inc
19include disable-xdg.inc
20
21mkdir ${HOME}/.config/Zulip
22whitelist ${HOME}/.config/Zulip
23whitelist ${DOWNLOADS}
24include whitelist-common.inc
25include whitelist-var-common.inc
26
27apparmor
28caps.drop all
29netfilter
30no3d
31nodvd
32nogroups
33noinput
34nonewprivs
35noroot
36notv
37nou2f
38novideo
39protocol unix,inet,inet6
40seccomp
41shell none
42
43disable-mnt
44private-bin locale,zulip
45private-cache
46private-dev
47private-etc asound.conf,fonts,machine-id
48private-tmp
diff --git a/etc/psi-plus.profile b/etc/psi-plus.profile
deleted file mode 100644
index 72c52d967..000000000
--- a/etc/psi-plus.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for psi-plus
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/psi-plus.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/psi+
9noblacklist ${HOME}/.local/share/psi+
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/psi+
17mkdir ~/.config/psi+
18mkdir ~/.local/share/psi+
19whitelist ${DOWNLOADS}
20whitelist ~/.cache/psi+
21whitelist ~/.config/psi+
22whitelist ~/.local/share/psi+
23include /etc/firejail/whitelist-common.inc
24
25caps.drop all
26netfilter
27no3d
28nodvd
29nogroups
30nonewprivs
31noroot
32notv
33novideo
34protocol unix,inet,inet6
35seccomp
36shell none
37
38disable-mnt
39private-dev
40private-tmp
41
42noexec ${HOME}
43noexec /tmp
diff --git a/etc/qbittorrent.profile b/etc/qbittorrent.profile
deleted file mode 100644
index aeb52b991..000000000
--- a/etc/qbittorrent.profile
+++ /dev/null
@@ -1,51 +0,0 @@
1# Firejail profile for qbittorrent
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/qbittorrent.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/qBittorrent
9noblacklist ~/.config/qBittorrent
10noblacklist ~/.config/qBittorrentrc
11noblacklist ~/.config/qt5ct
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18mkdir ~/.cache/qBittorrent
19mkdir ~/.config/qBittorrent
20mkdir ~/.local/share/data/qBittorrent
21whitelist ${DOWNLOADS}
22whitelist ~/.cache/qBittorrent
23whitelist ~/.config/qBittorrent
24whitelist ~/.config/qBittorrentrc
25whitelist ~/.config/qt5ct
26whitelist ~/.local/share/data/qBittorrent
27include /etc/firejail/whitelist-common.inc
28include /etc/firejail/whitelist-var-common.inc
29
30caps.drop all
31machine-id
32netfilter
33nodvd
34nogroups
35nonewprivs
36noroot
37nosound
38notv
39novideo
40protocol unix,inet,inet6,netlink
41seccomp
42# shell none
43
44# private-bin qbittorrent
45private-dev
46# private-etc X11,fonts,xdg,resolv.conf
47private-tmp
48
49memory-deny-write-execute
50noexec ${HOME}
51noexec /tmp
diff --git a/etc/qpdfview.profile b/etc/qpdfview.profile
deleted file mode 100644
index 2d1df0f72..000000000
--- a/etc/qpdfview.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for qpdfview
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/qpdfview.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/qpdfview
9noblacklist ${HOME}/.config/qt5ct
10noblacklist ${HOME}/.local/share/qpdfview
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28tracelog
29
30private-bin qpdfview
31private-dev
32private-tmp
33
34memory-deny-write-execute
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/qtox.profile b/etc/qtox.profile
deleted file mode 100644
index 5cbe68c90..000000000
--- a/etc/qtox.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for qtox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/qtox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/qt5ct
9noblacklist ~/.config/tox
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ${HOME}/.config/qt5ct
17mkdir ${HOME}/.config/tox
18whitelist ${DOWNLOADS}
19whitelist ${HOME}/.config/qt5ct
20whitelist ${HOME}/.config/tox
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24netfilter
25nodvd
26nogroups
27nonewprivs
28noroot
29notv
30protocol unix,inet,inet6
31seccomp
32shell none
33tracelog
34
35disable-mnt
36private-bin qtox
37private-tmp
38
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/quassel.profile b/etc/quassel.profile
deleted file mode 100644
index af0f723f1..000000000
--- a/etc/quassel.profile
+++ /dev/null
@@ -1,20 +0,0 @@
1# Firejail profile for quassel
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/quassel.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-programs.inc
12
13caps.drop all
14netfilter
15nodvd
16nonewprivs
17noroot
18notv
19protocol unix,inet,inet6
20seccomp
diff --git a/etc/qupzilla.profile b/etc/qupzilla.profile
deleted file mode 100644
index 7b7086bde..000000000
--- a/etc/qupzilla.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for qupzilla
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/qupzilla.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/qupzilla
9noblacklist ${HOME}/.config/qupzilla
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16whitelist ${DOWNLOADS}
17whitelist ~/.cache/qupzilla
18whitelist ~/.config/qupzilla
19include /etc/firejail/whitelist-common.inc
20
21caps.drop all
22netfilter
23nodvd
24noroot
25notv
26protocol unix,inet,inet6,netlink
27seccomp
28tracelog
29
30# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
diff --git a/etc/qutebrowser.profile b/etc/qutebrowser.profile
deleted file mode 100644
index 31721617f..000000000
--- a/etc/qutebrowser.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for qutebrowser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/qutebrowser.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/qutebrowser
9noblacklist ~/.config/qutebrowser
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.cache/qutebrowser
16mkdir ~/.config/qutebrowser
17mkdir ~/.local/share/qutebrowser
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/qutebrowser
20whitelist ~/.config/qutebrowser
21whitelist ~/.local/share/qutebrowser
22include /etc/firejail/whitelist-common.inc
23
24caps.drop all
25netfilter
26nodvd
27nonewprivs
28noroot
29notv
30protocol unix,inet,inet6,netlink
31seccomp
32tracelog
diff --git a/etc/rambox.profile b/etc/rambox.profile
deleted file mode 100644
index 2696df86b..000000000
--- a/etc/rambox.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for rambox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/rambox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/Rambox
9noblacklist ~/.pki
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.config/Rambox
16mkdir ~/.pki
17whitelist ${DOWNLOADS}
18whitelist ~/.config/Rambox
19whitelist ~/.pki
20include /etc/firejail/whitelist-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26nonewprivs
27noroot
28notv
29protocol unix,inet,inet6,netlink
30seccomp
31# tracelog
diff --git a/etc/ranger.profile b/etc/ranger.profile
deleted file mode 100644
index 9be19c4b1..000000000
--- a/etc/ranger.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for ranger
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ranger.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# noblacklist /usr/bin/cpan*
9noblacklist /usr/bin/perl
10noblacklist /usr/lib/perl*
11noblacklist /usr/share/perl*
12noblacklist ~/.config/ranger
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19caps.drop all
20net none
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix
29seccomp
30
31private-dev
diff --git a/etc/remmina.profile b/etc/remmina.profile
deleted file mode 100644
index 3bb6aa0b1..000000000
--- a/etc/remmina.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for remmina
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/remmina.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/remmina
9noblacklist ${HOME}/.local/share/remmina
10noblacklist ${HOME}/.ssh
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/rhythmbox.profile b/etc/rhythmbox.profile
deleted file mode 100644
index 9401f6681..000000000
--- a/etc/rhythmbox.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for rhythmbox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/rhythmbox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18# no3d
19nogroups
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27tracelog
28
29private-bin rhythmbox
30private-dev
31private-tmp
32
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/ristretto.profile b/etc/ristretto.profile
deleted file mode 100644
index 3de5de34a..000000000
--- a/etc/ristretto.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for ristretto
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/ristretto.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/ristretto
9noblacklist ~/.Steam
10noblacklist ~/.steam
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix
28seccomp
29shell none
30
31private-dev
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/rocketchat.profile b/etc/rocketchat.profile
deleted file mode 100644
index da92cd938..000000000
--- a/etc/rocketchat.profile
+++ /dev/null
@@ -1,14 +0,0 @@
1# Firejail profile for rocketchat
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/rocketchat.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/Rocket.Chat
9
10whitelist ${HOME}/.config/Rocket.Chat
11include /etc/firejail/whitelist-common.inc
12
13# Redirect
14include /etc/firejail/electron.profile
diff --git a/etc/scribus.profile b/etc/scribus.profile
deleted file mode 100644
index 1b2d0c0b8..000000000
--- a/etc/scribus.profile
+++ /dev/null
@@ -1,46 +0,0 @@
1# Firejail profile for scribus
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/scribus.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Support for PDF readers comes with Scribus 1.5 and higher
9noblacklist ~/.config/okularpartrc
10noblacklist ~/.config/okularrc
11noblacklist ~/.config/scribus
12noblacklist ~/.config/scribusrc
13noblacklist ~/.gimp*
14noblacklist ~/.kde/share/apps/okular
15noblacklist ~/.kde/share/config/okularpartrc
16noblacklist ~/.kde/share/config/okularrc
17noblacklist ~/.kde4/share/apps/okular
18noblacklist ~/.kde4/share/config/okularpartrc
19noblacklist ~/.kde4/share/config/okularrc
20noblacklist ~/.local/share/okular
21noblacklist ~/.local/share/scribus
22noblacklist ~/.scribus
23
24include /etc/firejail/disable-common.inc
25include /etc/firejail/disable-devel.inc
26include /etc/firejail/disable-passwdmgr.inc
27include /etc/firejail/disable-programs.inc
28
29include /etc/firejail/whitelist-var-common.inc
30
31caps.drop all
32net none
33nodvd
34nogroups
35nonewprivs
36noroot
37nosound
38notv
39novideo
40protocol unix
41seccomp
42tracelog
43
44#private-bin scribus,gs
45private-dev
46# private-tmp
diff --git a/etc/sdat2img.profile b/etc/sdat2img.profile
deleted file mode 100644
index ce4c4d416..000000000
--- a/etc/sdat2img.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for sdat2img
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/sdat2img.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29# private-bin sdat2img,env,python,python3,python3.6
30private-dev
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/seamonkey-bin.profile b/etc/seamonkey-bin.profile
deleted file mode 100644
index 1ceed99fd..000000000
--- a/etc/seamonkey-bin.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for seamonkey
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/seamonkey.profile
diff --git a/etc/seamonkey.profile b/etc/seamonkey.profile
deleted file mode 100644
index 36dde66b0..000000000
--- a/etc/seamonkey.profile
+++ /dev/null
@@ -1,48 +0,0 @@
1# Firejail profile for seamonkey
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/seamonkey.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/mozilla
9noblacklist ~/.mozilla
10noblacklist ~/.pki
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/mozilla
17mkdir ~/.mozilla
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/gnome-mplayer/plugin
20whitelist ~/.cache/mozilla
21whitelist ~/.config/gnome-mplayer
22whitelist ~/.config/pipelight-silverlight5.1
23whitelist ~/.config/pipelight-widevine
24whitelist ~/.keysnail.js
25whitelist ~/.lastpass
26whitelist ~/.mozilla
27whitelist ~/.pentadactyl
28whitelist ~/.pentadactylrc
29whitelist ~/.pki
30whitelist ~/.vimperator
31whitelist ~/.vimperatorrc
32whitelist ~/.wine-pipelight
33whitelist ~/.wine-pipelight64
34whitelist ~/.zotero
35whitelist ~/dwhelper
36include /etc/firejail/whitelist-common.inc
37
38caps.drop all
39netfilter
40nodvd
41nonewprivs
42noroot
43notv
44protocol unix,inet,inet6,netlink
45seccomp
46tracelog
47
48# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,gtk-2.0,pango,fonts,iceweasel,firefox,adobe,mime.types,mailcap,asound.conf,pulse
diff --git a/etc/server.profile b/etc/server.profile
deleted file mode 100644
index 860e0056d..000000000
--- a/etc/server.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for server
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/server.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# generic server profile
9# it allows /sbin and /usr/sbin directories - this is where servers are installed
10# depending on your usage, you can enable some of the commands below:
11
12blacklist /tmp/.X11-unix
13
14noblacklist /sbin
15noblacklist /usr/sbin
16# noblacklist /var/opt
17
18include /etc/firejail/disable-common.inc
19# include /etc/firejail/disable-devel.inc
20include /etc/firejail/disable-passwdmgr.inc
21include /etc/firejail/disable-programs.inc
22
23caps
24no3d
25nodvd
26nosound
27notv
28novideo
29seccomp
30
31# netfilter /etc/firejail/webserver.net
32
33# disable-mnt
34private
35# private-bin program
36private-dev
37# private-etc none
38# private-lib
39private-tmp
40
41# memory-deny-write-execute
42# noexec ${HOME}
43# noexec /tmp
diff --git a/etc/shotcut.profile b/etc/shotcut.profile
deleted file mode 100644
index 4e8b1da05..000000000
--- a/etc/shotcut.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for shotcut
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/shotcut.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.config/Meltytech
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17net none
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23protocol unix
24seccomp
25shell none
26
27#private-bin shotcut,melt,qmelt,nice
28private-dev
29
30#noexec ${HOME}
31noexec /tmp
diff --git a/etc/silentarmy.profile b/etc/silentarmy.profile
deleted file mode 100644
index 977cfea99..000000000
--- a/etc/silentarmy.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for silentarmy
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/silentarmy.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10# include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix,inet,inet6
26seccomp
27shell none
28
29disable-mnt
30private
31# private-bin silentarmy,sa-solver,python3
32private-dev
33private-opt none
34private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/simple-scan.profile b/etc/simple-scan.profile
deleted file mode 100644
index edd4db861..000000000
--- a/etc/simple-scan.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for simple-scan
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/simple-scan.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/simple-scan
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23# novideo
24protocol unix,inet,inet6,netlink
25# simple-scan makes ioperm system calls, which are blacklisted by default.
26seccomp.drop @clock,@cpu-emulation,@debug,@module,@obsolete,@reboot,@resources,@swap,acct,add_key,bpf,chroot,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,iopl,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,pciconfig_iobase,pciconfig_read,pciconfig_write,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,s390_mmio_read,s390_mmio_write,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice
27shell none
28tracelog
29
30# private-bin simple-scan
31# private-dev
32# private-etc fonts
33# private-tmp
diff --git a/etc/simutrans.profile b/etc/simutrans.profile
deleted file mode 100644
index fda5204e2..000000000
--- a/etc/simutrans.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for simutrans
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/simutrans.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.simutrans
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.simutrans
15whitelist ~/.simutrans
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19net none
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix
26seccomp
27shell none
28
29# private-bin simutrans
30private-dev
31# private-etc none
32private-tmp
diff --git a/etc/skanlite.profile b/etc/skanlite.profile
deleted file mode 100644
index 1a53cc71c..000000000
--- a/etc/skanlite.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for skanlite
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/skanlite.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15# net none
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23# novideo
24protocol unix,netlink
25# skanlite makes ioperm system calls, which are blacklisted by default.
26seccomp.drop @clock,@cpu-emulation,@debug,@module,@obsolete,@reboot,@resources,@swap,acct,add_key,bpf,chroot,fanotify_init,io_cancel,io_destroy,io_getevents,io_setup,io_submit,iopl,ioprio_set,kcmp,keyctl,mount,name_to_handle_at,nfsservctl,ni_syscall,open_by_handle_at,pciconfig_iobase,pciconfig_read,pciconfig_write,personality,pivot_root,process_vm_readv,ptrace,remap_file_pages,request_key,s390_mmio_read,s390_mmio_write,setdomainname,sethostname,syslog,umount,umount2,userfaultfd,vhangup,vmsplice
27shell none
28
29# private-bin skanlite,kbuildsycoca4
30# private-dev
31# private-etc
32# private-tmp
diff --git a/etc/skype.profile b/etc/skype.profile
deleted file mode 100644
index b12f9879e..000000000
--- a/etc/skype.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for skype
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/skype.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.Skype
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix,inet,inet6
23seccomp
24shell none
25
26disable-mnt
27#private-bin skype,bash
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/skypeforlinux.profile b/etc/skypeforlinux.profile
deleted file mode 100644
index b69a208a8..000000000
--- a/etc/skypeforlinux.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for skypeforlinux
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/skypeforlinux.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/skypeforlinux
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16netfilter
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix,inet,inet6,netlink
23seccomp
24shell none
25
26disable-mnt
27private-dev
28private-tmp
29
30noexec ${HOME}
31noexec /tmp
diff --git a/etc/slack.profile b/etc/slack.profile
deleted file mode 100644
index faf875cf1..000000000
--- a/etc/slack.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for slack
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/slack.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /var
9
10noblacklist ${HOME}/.config/Slack
11noblacklist ${HOME}/Downloads
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18mkdir ${HOME}/.config
19mkdir ${HOME}/.config/Slack
20whitelist ${HOME}/.config/Slack
21whitelist ${HOME}/Downloads
22include /etc/firejail/whitelist-common.inc
23
24caps.drop all
25name slack
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32protocol unix,inet,inet6,netlink
33seccomp
34shell none
35
36disable-mnt
37private-bin slack
38private-dev
39private-etc asound.conf,ca-certificates,fonts,group,passwd,pulse,resolv.conf,ssl,ld.so.conf,ld.so.cache,localtime
40private-tmp
diff --git a/etc/smplayer.profile b/etc/smplayer.profile
deleted file mode 100644
index 7563ad730..000000000
--- a/etc/smplayer.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for smplayer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/smplayer.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/smplayer
9noblacklist ${HOME}/.mplayer
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18# nogroups
19nonewprivs
20noroot
21protocol unix,inet,inet6,netlink
22seccomp
23shell none
24
25private-bin smplayer,smtube,mplayer,mpv
26private-dev
27private-tmp
28
29noexec ${HOME}
30noexec /tmp
diff --git a/etc/snap.profile b/etc/snap.profile
deleted file mode 100644
index 38aef7c23..000000000
--- a/etc/snap.profile
+++ /dev/null
@@ -1,16 +0,0 @@
1# Firejail profile for snap
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/snap.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Generic Ubuntu snap application profile
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14whitelist ${DOWNLOADS}
15whitelist ~/snap
16include /etc/firejail/whitelist-common.inc
diff --git a/etc/soffice.profile b/etc/soffice.profile
deleted file mode 100644
index c702a4ece..000000000
--- a/etc/soffice.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for libreoffice
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/libreoffice.profile
diff --git a/etc/soundconverter.profile b/etc/soundconverter.profile
deleted file mode 100644
index 5d7129b5a..000000000
--- a/etc/soundconverter.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for soundconverter
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/soundconverter.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15net none
16no3d
17nodvd
18nogroups
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27
28private-dev
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/spotify.profile b/etc/spotify.profile
deleted file mode 100644
index 3506b793b..000000000
--- a/etc/spotify.profile
+++ /dev/null
@@ -1,50 +0,0 @@
1# Firejail profile for spotify
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/spotify.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist ${HOME}/.bashrc
9blacklist /lost+found
10blacklist /sbin
11blacklist /srv
12blacklist /sys
13
14noblacklist ${HOME}/.cache/spotify
15noblacklist ${HOME}/.config/spotify
16noblacklist ${HOME}/.local/share/spotify
17
18include /etc/firejail/disable-common.inc
19include /etc/firejail/disable-devel.inc
20include /etc/firejail/disable-passwdmgr.inc
21include /etc/firejail/disable-programs.inc
22
23mkdir ${HOME}/.cache/spotify
24mkdir ${HOME}/.config/spotify
25mkdir ${HOME}/.local/share/spotify
26whitelist ${HOME}/.cache/spotify
27whitelist ${HOME}/.config/spotify
28whitelist ${HOME}/.local/share/spotify
29include /etc/firejail/whitelist-common.inc
30include /etc/firejail/whitelist-var-common.inc
31
32caps.drop all
33netfilter
34nogroups
35nonewprivs
36noroot
37notv
38protocol unix,inet,inet6,netlink
39seccomp
40shell none
41
42disable-mnt
43private-bin spotify,bash,sh,dash
44private-dev
45private-etc fonts,machine-id,pulse,resolv.conf
46private-opt spotify
47private-tmp
48
49noexec ${HOME}
50noexec /tmp
diff --git a/etc/sqlitebrowser.profile b/etc/sqlitebrowser.profile
deleted file mode 100644
index 65e8073c9..000000000
--- a/etc/sqlitebrowser.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for sqlitebrowser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/sqlitebrowser.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/sqlitebrowser
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29private-bin sqlitebrowser
30private-dev
31private-tmp
32
33memory-deny-write-execute
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/ssh.profile b/etc/ssh.profile
deleted file mode 100644
index 7ac0b8417..000000000
--- a/etc/ssh.profile
+++ /dev/null
@@ -1,39 +0,0 @@
1# Firejail profile for ssh
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/ssh.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9noblacklist /etc/ssh
10noblacklist /tmp/ssh-*
11noblacklist ~/.ssh
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18ipc-namespace
19netfilter
20no3d
21nodvd
22nogroups
23nonewprivs
24# noroot - see issue #1543
25nosound
26notv
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32private-dev
33# private-tmp # Breaks when exiting
34
35memory-deny-write-execute
36noexec ${HOME}
37noexec /tmp
38writable-run-user
39
diff --git a/etc/start-tor-browser.profile b/etc/start-tor-browser.profile
deleted file mode 100644
index e12a38164..000000000
--- a/etc/start-tor-browser.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for start-tor-browser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/start-tor-browser.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16nodvd
17nogroups
18nonewprivs
19noroot
20notv
21novideo
22protocol unix,inet,inet6
23seccomp
24shell none
25tracelog
26
27private-bin bash,dash,sh,grep,tail,env,gpg,id,readlink,dirname,test,mkdir,ln,sed,cp,rm,getconf
28private-dev
29private-etc fonts
30private-tmp
31
32noexec /tmp
diff --git a/etc/steam.profile b/etc/steam.profile
deleted file mode 100644
index 33c082533..000000000
--- a/etc/steam.profile
+++ /dev/null
@@ -1,51 +0,0 @@
1# Firejail profile for steam
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/steam.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.java
9noblacklist ${HOME}/.killingfloor
10noblacklist ${HOME}/.local/share/3909/PapersPlease
11noblacklist ${HOME}/.local/share/aspyr-media
12noblacklist ${HOME}/.local/share/cdprojektred
13noblacklist ${HOME}/.local/share/feral-interactive
14noblacklist ${HOME}/.local/share/Steam
15noblacklist ${HOME}/.local/share/SuperHexagon
16noblacklist ${HOME}/.local/share/Terraria
17noblacklist ${HOME}/.local/share/vpltd
18noblacklist ${HOME}/.local/share/vulkan
19noblacklist ${HOME}/.steam
20noblacklist ${HOME}/.steampath
21noblacklist ${HOME}/.steampid
22# with >=llvm-4 mesa drivers need llvm stuff
23noblacklist /usr/lib/llvm*
24# needed for STEAM_RUNTIME_PREFER_HOST_LIBRARIES=1 to work
25noblacklist /sbin
26
27include /etc/firejail/disable-common.inc
28include /etc/firejail/disable-devel.inc
29include /etc/firejail/disable-passwdmgr.inc
30include /etc/firejail/disable-programs.inc
31
32caps.drop all
33netfilter
34nodvd
35nogroups
36nonewprivs
37noroot
38notv
39# novideo should be commented for VR
40novideo
41protocol unix,inet,inet6,netlink
42seccomp
43shell none
44# tracelog disabled as it breaks integrated browser
45# tracelog
46
47# private-dev should be commented for controllers
48private-dev
49# private-etc breaks some games
50#private-etc asound.conf,ca-certificates,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,ld.so.conf,ld.so.conf.d,localtime,lsb-release,machine-id,mime.types,passwd,pulse,resolv.conf,ssl
51private-tmp
diff --git a/etc/stellarium.profile b/etc/stellarium.profile
deleted file mode 100644
index 360b9f881..000000000
--- a/etc/stellarium.profile
+++ /dev/null
@@ -1,43 +0,0 @@
1# Firejail profile for stellarium
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/stellarium.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/stellarium
9noblacklist ~/.stellarium
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.config/stellarium
17mkdir ~/.stellarium
18whitelist ~/.config/stellarium
19whitelist ~/.stellarium
20include /etc/firejail/whitelist-common.inc
21include /etc/firejail/whitelist-var-common.inc
22
23caps.drop all
24machine-id
25netfilter
26nodvd
27nogroups
28nonewprivs
29noroot
30nosound
31notv
32protocol unix,inet,inet6,netlink
33seccomp
34shell none
35tracelog
36
37disable-mnt
38private-bin stellarium
39private-dev
40private-tmp
41
42noexec ${HOME}
43noexec /tmp
diff --git a/etc/strings.profile b/etc/strings.profile
deleted file mode 100644
index 90bb35ecd..000000000
--- a/etc/strings.profile
+++ /dev/null
@@ -1,26 +0,0 @@
1# Firejail profile for strings
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/strings.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11ignore noroot
12net none
13no3d
14nodvd
15nosound
16notv
17novideo
18shell none
19tracelog
20
21# private-bin strings - breaking on Debian
22private-dev
23
24memory-deny-write-execute
25
26include /etc/firejail/default.profile
diff --git a/etc/supertux2.profile b/etc/supertux2.profile
deleted file mode 100644
index cd6496a7b..000000000
--- a/etc/supertux2.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for supertux2
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/supertux2.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.local/share/supertux2
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.local/share/supertux2
15whitelist ~/.local/share/supertux2
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19net none
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25protocol unix,netlink
26seccomp
27shell none
28
29# private-bin supertux2
30private-dev
31# private-etc none
32private-tmp
diff --git a/etc/surf.profile b/etc/surf.profile
deleted file mode 100644
index 251331902..000000000
--- a/etc/surf.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for surf
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/surf.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.surf
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.surf
15whitelist ${DOWNLOADS}
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19netfilter
20nodvd
21nonewprivs
22noroot
23notv
24protocol unix,inet,inet6,netlink
25seccomp
26shell none
27tracelog
28
29private-bin ls,surf,sh,dash,bash,curl,dmenu,printf,sed,sleep,st,stterm,xargs,xprop
30private-dev
31private-etc passwd,group,hosts,resolv.conf,fonts,ssl
32private-tmp
33
34noexec ${HOME}
35noexec /tmp
diff --git a/etc/tar.profile b/etc/tar.profile
deleted file mode 100644
index f14894c25..000000000
--- a/etc/tar.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for tar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/tar.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11hostname tar
12ignore noroot
13net none
14no3d
15nodvd
16nosound
17notv
18novideo
19shell none
20tracelog
21
22# support compressed archives
23private-bin sh,bash,dash,tar,gtar,compress,gzip,lzma,xz,bzip2,lbzip2,lzip,lzop
24private-dev
25private-etc passwd,group,localtime
26
27include /etc/firejail/default.profile
diff --git a/etc/telegram-desktop.profile b/etc/telegram-desktop.profile
deleted file mode 100644
index df6557a90..000000000
--- a/etc/telegram-desktop.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for telegram
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/telegram.profile
diff --git a/etc/telegram.profile b/etc/telegram.profile
deleted file mode 100644
index e3ccaf1a0..000000000
--- a/etc/telegram.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for telegram
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/telegram.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.TelegramDesktop
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15netfilter
16nodvd
17nonewprivs
18noroot
19notv
20protocol unix,inet,inet6
21seccomp
22
23disable-mnt
24private-tmp
25
26noexec ${HOME}
27noexec /tmp
diff --git a/etc/templates/profile.template b/etc/templates/profile.template
new file mode 100644
index 000000000..7628313e0
--- /dev/null
+++ b/etc/templates/profile.template
@@ -0,0 +1,227 @@
1# Firejail profile for PROGRAM_NAME
2# Description: DESCRIPTION OF THE PROGRAM
3# This file is overwritten after every install/update
4# --- CUT HERE ---
5# This is a generic template to help you create profiles.
6# PRs welcome at https://github.com/netblue30/firejail/.
7#
8# Rules to follow:
9# - lines with one # are often used in profiles
10# - lines with two ## are only needed in special situations
11# - make the profile as restrictive as possible while still keeping the program useful
12# (e.g. a program that is unable to save user's work is considered bad practice)
13# - dedicate ample time (based on the complexity of the application) to profile testing before
14# submitting a pull request
15# - keep the sections structure, use a single empty line as separator
16# - entries within sections are alphabetically sorted
17# - consider putting binary into src/firecfg/firecfg.config (keep list sorted) but beware
18# to not do this for essential utilities as this may *break* your OS! (related discussion:
19# https://github.com/netblue30/firejail/issues/2507)
20# - remove this comment section and any generic comment past 'Persistent global definitions'
21#
22# Sections structure
23# HEADER
24# COMMENTS
25# IGNORES
26# NOBLACKLISTS
27# ALLOW INCLUDES
28# BLACKLISTS
29# DISABLE INCLUDES
30# NOWHITELISTS
31# MKDIRS
32# WHITELISTS
33# WHITELIST INCLUDES
34# OPTIONS (caps*, net*, no*, protocol, seccomp*, shell none, tracelog)
35# PRIVATE OPTIONS (disable-mnt, private-*, writable-*)
36# DBUS FILTER
37# SPECIAL OPTIONS (mdwx, noexec, read-only, join-or-start)
38# REDIRECT INCLUDES
39#
40# The following macros may be used in path names to substitute common locations:
41# ${DESKTOP}
42# ${DOCUMENTS}
43# ${DOWNLOADS}
44# ${HOME} (user's home)
45# ${PATH} (contents of PATH env var)
46# ${MUSIC}
47# ${RUNUSER} (/run/user/UID)
48# ${VIDEOS}
49#
50# Check contents of ~/.config/user-dirs.dirs to see how they translate to actual paths.
51#
52# --- CUT HERE ---
53##quiet
54# Persistent local customizations
55include PROFILE.local
56# Persistent global definitions
57include globals.local
58
59##ignore noexec ${HOME}
60##ignore noexec /tmp
61
62# It is common practice to add files/dirs containing program-specific configuration
63# (often ${HOME}/PROGRAMNAME or ${HOME}/.config/PROGRAMNAME) into disable-programs.inc
64# (keep list sorted) and then disable blacklisting below.
65# One way to retrieve the files a program uses is:
66# - launch binary with --private naming a sandbox
67# `firejail --name=test --ignore=private-bin [--profile=PROFILE] --private BINARY`
68# - work with the program, make some configuration changes and save them, open new documents,
69# install plugins if they exists, etc.
70# - join the sandbox with bash:
71# `firejail --join=test bash`
72# - look what has changed and use that information to populate blacklist and whitelist sections
73# `ls -aR`
74#noblacklist PATH
75
76# Allow /bin/sh (blacklisted by disable-shell.inc)
77#include allow-bin-sh.inc
78
79# Allows files commonly used by IDEs
80#include allow-common-devel.inc
81
82# Allow gjs (blacklisted by disable-interpreters.inc)
83#include allow-gjs.inc
84
85# Allow java (blacklisted by disable-devel.inc)
86#include allow-java.inc
87
88# Allow lua (blacklisted by disable-interpreters.inc)
89#include allow-lua.inc
90
91# Allow perl (blacklisted by disable-interpreters.inc)
92#include allow-perl.inc
93
94# Allow python (blacklisted by disable-interpreters.inc)
95#include allow-python2.inc
96#include allow-python3.inc
97
98# Allow ruby (blacklisted by disable-interpreters.inc)
99#include allow-ruby.inc
100
101# Allow ssh (blacklisted by disable-common.inc)
102#include allow-ssh.inc
103
104##blacklist PATH
105# Disable Wayland
106#blacklist ${RUNUSER}/wayland-*
107# Disable RUNUSER (cli only; supersedes Disable Wayland)
108#blacklist ${RUNUSER}
109# Remove the next blacklist if you system has no /usr/libexec dir,
110# otherwise try to add it.
111#blacklist /usr/libexec
112
113# disable-*.inc includes
114# remove disable-write-mnt.inc if you set disable-mnt
115#include disable-common.inc
116#include disable-devel.inc
117#include disable-exec.inc
118#include disable-interpreters.inc
119#include disable-programs.inc
120#include disable-shell.inc
121#include disable-write-mnt.inc
122#include disable-X11.inc
123#include disable-xdg.inc
124
125# This section often mirrors noblacklist section above. The idea is
126# that if a user feels too restricted (e.g. unable to save files into
127# home directory) they may disable whitelist (nowhitelist)
128# in PROFILE.local but still be protected by BLACKLISTS section
129# (explanation at https://github.com/netblue30/firejail/issues/1569)
130#mkdir PATH
131##mkfile PATH
132#whitelist PATH
133#include whitelist-common.inc
134#include whitelist-run-common.inc
135#include whitelist-runuser-common.inc
136#include whitelist-usr-share-common.inc
137#include whitelist-var-common.inc
138
139##allusers
140#apparmor
141#caps.drop all
142##caps.keep CAPS
143##hostname NAME
144# CLI only
145##ipc-namespace
146# breaks audio and sometimes dbus related functions
147#machine-id
148# 'net none' or 'netfilter'
149#net none
150#netfilter
151#no3d
152##nodbus (deprecated, use 'dbus-user none' and 'dbus-system none', see below)
153#nodvd
154#nogroups
155#noinput
156#nonewprivs
157#noroot
158#nosound
159#notv
160#nou2f
161#novideo
162# Remove each unneeded protocol:
163# - unix is usually needed
164# - inet,inet6 only if internet access is required (see 'net none'/'netfilter' above)
165# - netlink is rarely needed
166# - packet and bluetooth almost never
167#protocol unix,inet,inet6,netlink,packet,bluetooth
168#seccomp
169##seccomp !chroot
170##seccomp.drop SYSCALLS (see syscalls.txt)
171#seccomp.block-secondary
172##seccomp-error-action log (only for debugging seccomp issues)
173#shell none
174#tracelog
175# Prefer 'x11 none' instead of 'disable-X11.inc' if 'net none' is set
176##x11 none
177
178#disable-mnt
179##private
180# It's common practice to refer to the python executable(s) in private-bin with `python*`, which covers both v2 and v3
181#private-bin PROGRAMS
182#private-cache
183#private-dev
184#private-etc FILES
185# private-etc templates (see also #1734, #2093)
186# Common: alternatives,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,mime.types,xdg
187# Extra: group,magic,magic.mgc,passwd
188# 3D: bumblebee,drirc,glvnd,nvidia
189# Audio: alsa,asound.conf,machine-id,pulse
190# D-Bus: dbus-1,machine-id
191# GUI: fonts,pango,X11
192# GTK: dconf,gconf,gtk-2.0,gtk-3.0
193# KDE: kde4rc,kde5rc
194# Networking: ca-certificates,crypto-policies,host.conf,hostname,hosts,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl
195# Extra: gai.conf,proxychains.conf
196# Qt: Trolltech.conf
197##private-lib LIBS
198##private-opt NAME
199#private-tmp
200##writable-etc
201##writable-run-user
202##writable-var
203##writable-var-log
204
205# Since 0.9.63 also a more granular control of dbus is supported.
206# To get the dbus-addresses an application needs access to you can
207# check with flatpak (when the application is distributed that way):
208# flatpak remote-info --show-metadata flathub <APP-ID>
209# Notes:
210# - flatpak implicitly allows an app to own <APP-ID> on the session bus
211# - Some features like native notifications are implemented as portal too.
212# - In order to make dconf work (when used by the app) you need to allow
213# 'ca.desrt.dconf' even when not allowed by flatpak.
214# Notes and policies about addresses can be found at
215# <https://github.com/netblue30/firejail/wiki/Restrict-D-Bus>
216#dbus-user filter
217#dbus-user.own com.github.netblue30.firejail
218#dbus-user.talk ca.desrt.dconf
219#dbus-user.talk org.freedesktop.Notifications
220#dbus-system none
221
222##env VAR=VALUE
223##join-or-start NAME
224#memory-deny-write-execute
225##noexec PATH
226##read-only ${HOME}
227##read-write ${HOME}
diff --git a/etc/templates/redirect_alias-profile.template b/etc/templates/redirect_alias-profile.template
new file mode 100644
index 000000000..0c7ba0b72
--- /dev/null
+++ b/etc/templates/redirect_alias-profile.template
@@ -0,0 +1,44 @@
1# Firejail profile for PROGRAM_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: keep include globals.local commented, except when redirecting to a *-common.profile
10
11# For more information, see profile.template
12
13# Ignoring option(s) from the included profile
14#ignore net none
15#ignore private-bin
16#ignore seccomp
17#...
18
19# Additional noblacklisting (when needed)
20#noblacklist PATH
21
22# Additional allow includes (when needed)
23
24# Additional blacklisting (when needed)
25#blacklist PATH
26
27# Additional whitelisting (when needed)
28#NOTE: never use mkdir/mkfile when 'private' is set (see https://github.com/netblue30/firejail/issues/903)
29#mkdir PATH
30##mkfile PATH
31#whitelist PATH
32
33# Additional options (when needed)
34
35# Additional private-options (when needed)
36# Add programs to private-bin (when needed)
37#private-bin PROGRAMS
38# Add files to private-etc (when needed)
39#private-etc FILES
40
41# Additional special options (when needed)
42
43# Redirect
44include PROFILE.profile
diff --git a/etc/templates/syscalls.txt b/etc/templates/syscalls.txt
new file mode 100644
index 000000000..827b075e5
--- /dev/null
+++ b/etc/templates/syscalls.txt
@@ -0,0 +1,112 @@
1Hints to write own seccomp filters
2==================================
3
4
5The different seccomp commands
6------------------------------
7
8Always have a look at 'man 1 firejail'.
9
10 - seccomp
11 Blocks all syscalls in the default-group.
12 - The default-group is @default-nodebuggers, unless allow-debuggers is
13 specified, then @default is used.
14 - Listed syscalls and groups are also blocked.
15 - Exceptions are possible by putting a ! in before the name of a syscall.
16 - seccomp.block-secondary
17 Allows only native syscalls, all syscalls for other architectures are blocked.
18 - seccomp.drop
19 Blocks all listed syscalls.
20 - Exceptions are possible by putting a ! in before the name of a syscall.
21 - seccomp.keep
22 Allows only listed syscalls.
23 To write your own seccomp.keep line, see:
24 - https://firejail.wordpress.com/documentation-2/seccomp-guide/
25 - https://github.com/netblue30/firejail/blob/master/contrib/syscalls.sh
26
27Definition of groups
28--------------------
29
30@aio=io_cancel,io_destroy,io_getevents,io_pgetevents,io_setup,io_submit
31@basic-io=_llseek,close,dup,dup2,dup3,lseek,pread64,preadv,preadv2,pwrite64,pwritev,pwritev2,read,readv,write,writev
32@chown=chown,chown32,fchown,fchown32,fchownat,lchown,lchown32
33@clock=adjtimex,clock_adjtime,clock_settime,settimeofday,stime
34@cpu-emulation=modify_ldt,subpage_prot,switch_endian,vm86,vm86old
35@debug=lookup_dcookie,perf_event_open,process_vm_writev,rtas,s390_runtime_instr,sys_debug_setcontext
36@default=@clock,@cpu-emulation,@debug,@module,@mount,@obsolete,@raw-io,@reboot,@swap,open_by_handle_at,name_to_handle_at,ioprio_set,ni_syscall,syslog,fanotify_init,add_key,request_key,mbind,migrate_pages,move_pages,keyctl,io_setup,io_destroy,io_getevents,io_submit,io_cancel,remap_file_pages,set_mempolicyvmsplice,userfaultfd,acct,bpf,nfsservctl,setdomainname,sethostname,vhangup
37@default-nodebuggers=@default,ptrace,personality,process_vm_readv
38@default-keep=execveat,execve,prctl
39@file-system=access,chdir,chmod,close,creat,faccessat,faccessat2,fallocate,fchdir,fchmod,fchmodat,fcntl,fcntl64,fgetxattr,flistxattr,fremovexattr,fsetxattr,fstat,fstat64,fstatat64,fstatfs,fstatfs64,ftruncate,ftruncate64,futimesat,getcwd,getdents,getdents64,getxattr,inotify_add_watch,inotify_init,inotify_init1,inotify_rm_watch,lgetxattr,link,linkat,listxattr,llistxattr,lremovexattr,lsetxattr,lstat,lstat64,mkdir,mkdirat,mknod,mknodat,mmap,mmap2,munmap,newfstatat,oldfstat,oldlstat,oldstat,open,openat,readlink,readlinkat,removexattr,rename,renameat,renameat2,rmdir,setxattr,stat,stat64,statfs,statfs64,statx,symlink,symlinkat,truncate,truncate64,unlink,unlinkat,utime,utimensat,utimes
40@io-event=_newselect,epoll_create,epoll_create1,epoll_ctl,epoll_ctl_old,epoll_pwait,epoll_wait,epoll_wait_old,eventfd,eventfd2,poll,ppoll,pselect6,select
41@ipc=ipc,memfd_create,mq_getsetattr,mq_notify,mq_open,mq_timedreceive,mq_timedsend,mq_unlink,msgctl,msgget,msgrcv,msgsnd,pipe,pipe2,process_vm_readv,process_vm_writev,semctl,semget,semop,semtimedop,shmat,shmctl,shmdt,shmget
42@keyring=add_key,keyctl,request_key
43@memlock=mlock,mlock2,mlockall,munlock,munlockall
44@module=delete_module,finit_module,init_module
45@mount=chroot,mount,pivot_root,umount,umount2
46@network-io=accept,accept4,bind,connect,getpeername,getsockname,getsockopt,listen,recv,recvfrom,recvmmsg,recvmsg,send,sendmmsg,sendmsg,sendto,setsockopt,shutdown,socket,socketcall,socketpair
47@obsolete=_sysctl,afs_syscall,bdflush,break,create_module,ftime,get_kernel_syms,getpmsg,gtty,idle,lock,mpx,prof,profil,putpmsg,query_module,security,sgetmask,ssetmask,stty,sysfs,tuxcall,ulimit,uselib,ustat,vserver
48@privileged=@chown,@clock,@module,@raw-io,@reboot,@swap,_sysctl,acct,bpf,capset,chroot,fanotify_init,mount,nfsservctl,open_by_handle_at,pivot_root,quotactl,setdomainname,setfsuid,setfsuid32,setgroups,setgroups32,sethostname,setresuid,setresuid32,setreuid,setreuid32,setuid,setuid32,umount2,vhangup
49@process=arch_prctl,capget,clone,execveat,fork,getrusage,kill,pidfd_send_signal,prctl,rt_sigqueueinfo,rt_tgsigqueueinfo,setns,swapcontext,tgkill,times,tkill,unshare,vfork,wait4,waitid,waitpid
50@raw-io=ioperm,iopl,pciconfig_iobase,pciconfig_read,pciconfig_write,s390_mmio_read,s390_mmio_write
51@reboot=kexec_load,kexec_file_load,reboot
52@resources=ioprio_set,mbind,migrate_pages,move_pages,nice,sched_setaffinity,sched_setattr,sched_setparam,sched_setscheduler,set_mempolicy
53@setuid=setgid,setgid32,setgroups,setgroups32,setregid,setregid32,setresgid,setresgid32,setresuid,setresuid32,setreuid,setreuid32,setuid,setuid32
54@signal=rt_sigaction,rt_sigpending,rt_sigprocmask,rt_sigsuspend,rt_sigtimedwait,sigaction,sigaltstack,signal,signalfd,signalfd4,sigpending,sigprocmask,sigsuspend
55@swap=swapon,swapoff
56@sync=fdatasync,fsync,msync,sync,sync_file_range,sync_file_range2,syncfs
57@system-service=@aio,@basic-io,@chown,@default,@file-system,@io-event,@ipc,@keyring,@memlock,@network-io,@process,@resources,@setuid,@signal,@sync,@timer,brk,capget,capset,copy_file_range,fadvise64,fadvise64_64,flock,get_mempolicy,getcpu,getpriority,getrandom,ioctl,ioprio_get,kcmp,madvise,mprotect,mremap,name_to_handle_at,oldolduname,olduname,personality,readahead,readdir,remap_file_pages,sched_get_priority_max,sched_get_priority_min,sched_getaffinity,sched_getattr,sched_getparam,sched_getscheduler,sched_rr_get_interval,sched_yield,sendfile,sendfile64,setfsgid,setfsgid32,setfsuid,setfsuid32,setpgid,setsid,splice,sysinfo,tee,umask,uname,userfaultfd,vmsplice
58@timer=alarm,getitimer,setitimer,timer_create,timer_delete,timer_getoverrun,timer_gettime,timer_settime,timerfd_create,timerfd_gettime,timerfd_settime,times
59
60Inheritance of groups
61---------------------
62
63+---------------+
64| @default-keep |
65+---------------+
66
67+----------------+ +---------+ +--------+ +--------------+
68| @cpu-emulation | | @clock | | @chown | | @aio |
69| @debug | | @module | +--------+ | @basic-io |
70| @obsolete | | @raw-io | : : | @file-system |
71| @mount | | @reboot | : : | @io-event |
72+----------------+ | @swap | : : | @ipc |
73 : +---------+ : : | @keyring |
74 : : : : : | @memlock |
75 : ..............: : : : | @network-io |
76 : : : ........: : | @process |
77 : : : : : | @resources |
78+----------+ +-------------+ : | @setuid |
79| @default | | @privileged | : | @signal |
80+----------+ +-------------+ : | @sync |
81 : : : | @timer |
82 : :........................... : +--------------+
83 : : : :
84+----------------------+ +-----------------+
85| @default-nodebuggers | | @system-service |
86+----------------------+ +-----------------+
87
88
89What to do if seccomp breaks a program
90--------------------------------------
91
92Start `journalctl --grep=SECCOMP --follow` in a terminal and run
93`firejail --seccomp-error-action=log /path/to/program` in a second terminal.
94Now switch back to the first terminal (where `journalctl` is running) and look
95for the numbers of the blocked syscall(s) (`syscall=<NUMBER>`). As soon as you
96have found them, you can stop `journalctl` (^C) and execute
97`firejail --debug-syscalls | grep NUMBER` to get the name of the syscall.
98In the particular case that it is a 32bit syscall on a 64bit system, use `firejail --debug-syscalls32 | grep NUMBER`.
99Now you can add a seccomp exception using `seccomp !NAME`.
100
101If the blocked syscall is ptrace, consider to add allow-debuggers to the profile.
102
103```
104term1$ journalctl --grep=SECCOMP --follow
105term2$ firejail --seccomp-error-action=log /usr/bin/signal-desktop
106term1$ (journalctl --grep=SECCOMP --follow)
107audit[1234]: SECCOMP ... comm="signal-desktop" exe="/usr/bin/signal-desktop" sig=31 arch=c000003e syscall=161 ...
108^C
109term1$ firejail --debug-syscalls | grep "^161[[:space:]]"
110161 - chroot
111```
112Profile: `seccomp -> seccomp !chroot`
diff --git a/etc/terasology.profile b/etc/terasology.profile
deleted file mode 100644
index ca580c0d0..000000000
--- a/etc/terasology.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for terasology
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/default.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9noblacklist ${HOME}/.java
10noblacklist ${HOME}/.local/share/terasology
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17mkdir ${HOME}/.java
18mkdir ${HOME}/.local/share/terasology
19whitelist ${HOME}/.java
20whitelist ${HOME}/.local/share/terasology
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24ipc-namespace
25net none
26netfilter
27nodvd
28nogroups
29nonewprivs
30noroot
31notv
32novideo
33protocol unix,inet,inet6
34seccomp
35shell none
36
37disable-mnt
38private-dev
39private-etc asound.conf,ca-certificates,dbus-1,drirc,fonts,group,gtk-2.0,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,lsb-release,machine-id,mime.types,passwd,pulse,resolv.conf,ssl,java-8-openjdk,java-7-openjdk
40private-tmp
41
42noexec ${HOME}
diff --git a/etc/thunar.profile b/etc/thunar.profile
deleted file mode 100644
index 1545e8c7e..000000000
--- a/etc/thunar.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for Thunar
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/Thunar.profile
diff --git a/etc/thunderbird.profile b/etc/thunderbird.profile
deleted file mode 100644
index db944a2c0..000000000
--- a/etc/thunderbird.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for thunderbird
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/thunderbird.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Users have thunderbird set to open a browser by clicking a link in an email
9# We are not allowed to blacklist browser-specific directories
10
11noblacklist ~/.cache/thunderbird
12noblacklist ~/.gnupg
13noblacklist ~/.icedove
14noblacklist ~/.thunderbird
15
16mkdir ~/.cache/thunderbird
17mkdir ~/.gnupg
18mkdir ~/.icedove
19mkdir ~/.thunderbird
20whitelist ~/.cache/thunderbird
21whitelist ~/.gnupg
22whitelist ~/.icedove
23whitelist ~/.thunderbird
24include /etc/firejail/whitelist-common.inc
25include /etc/firejail/whitelist-var-common.inc
26
27ignore private-tmp
28machine-id
29disable-mnt
30read-only ~/.config/mimeapps.list
31
32# allow browsers
33# Redirect
34include /etc/firejail/firefox.profile
diff --git a/etc/tor-browser-en.profile b/etc/tor-browser-en.profile
deleted file mode 100644
index bf3a80139..000000000
--- a/etc/tor-browser-en.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for torbrowser-launcher
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/torbrowser-launcher.profile
diff --git a/etc/torbrowser-launcher.profile b/etc/torbrowser-launcher.profile
deleted file mode 100644
index 3b6b65bec..000000000
--- a/etc/torbrowser-launcher.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for torbrowser-launcher
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/torbrowser-launcher.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.tor-browser-en
9noblacklist ~/.config/torbrowser
10noblacklist ~/.local/share/torbrowser
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17whitelist ~/.tor-browser-en
18whitelist ~/.config/torbrowser
19whitelist ~/.local/share/torbrowser
20include /etc/firejail/whitelist-common.inc
21
22caps.drop all
23netfilter
24nodvd
25nogroups
26nonewprivs
27noroot
28notv
29novideo
30protocol unix,inet,inet6
31seccomp
32shell none
33tracelog
34
35private-bin bash,cp,dash,dirname,env,expr,file,getconf,gpg,grep,id,ln,mkdir,python,python2.7,readlink,rm,sed,sh,tail,test,tor-browser-en,torbrowser-launcher
36private-dev
37private-etc fonts
38private-tmp
39
40noexec /tmp
diff --git a/etc/totem.profile b/etc/totem.profile
deleted file mode 100644
index ccf292da0..000000000
--- a/etc/totem.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for totem
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/totem.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/totem
9noblacklist ~/.local/share/totem
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19netfilter
20nogroups
21nonewprivs
22noroot
23protocol unix,inet,inet6
24seccomp
25shell none
26
27private-bin totem
28private-dev
29# private-etc fonts
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/transmission-cli.profile b/etc/transmission-cli.profile
deleted file mode 100644
index c7446ed68..000000000
--- a/etc/transmission-cli.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for transmission-cli
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/transmission-cli.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/transmission
9noblacklist ${HOME}/.config/transmission
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nodvd
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
26shell none
27tracelog
28
29# private-bin transmission-cli
30private-dev
31private-etc none
32private-tmp
33
34memory-deny-write-execute
diff --git a/etc/transmission-gtk.profile b/etc/transmission-gtk.profile
deleted file mode 100644
index 6a8d6c679..000000000
--- a/etc/transmission-gtk.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for transmission-gtk
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/transmission-gtk.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/transmission
9noblacklist ${HOME}/.config/transmission
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/transmission
17mkdir ~/.config/transmission
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/transmission
20whitelist ~/.config/transmission
21include /etc/firejail/whitelist-common.inc
22include /etc/firejail/whitelist-var-common.inc
23
24caps.drop all
25netfilter
26nodvd
27nonewprivs
28noroot
29nosound
30notv
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37private-bin transmission-gtk
38private-dev
39private-tmp
40
41memory-deny-write-execute
diff --git a/etc/transmission-qt.profile b/etc/transmission-qt.profile
deleted file mode 100644
index 4db8e19ce..000000000
--- a/etc/transmission-qt.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for transmission-qt
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/transmission-qt.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/transmission
9noblacklist ${HOME}/.config/transmission
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16mkdir ~/.cache/transmission
17mkdir ~/.config/transmission
18whitelist ${DOWNLOADS}
19whitelist ~/.cache/transmission
20whitelist ~/.config/transmission
21include /etc/firejail/whitelist-common.inc
22include /etc/firejail/whitelist-var-common.inc
23
24caps.drop all
25netfilter
26nodvd
27nonewprivs
28noroot
29nosound
30notv
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37private-bin transmission-qt
38private-dev
39private-tmp
40
41memory-deny-write-execute
diff --git a/etc/transmission-show.profile b/etc/transmission-show.profile
deleted file mode 100644
index 0b09bffcb..000000000
--- a/etc/transmission-show.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for transmission-show
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/transmission-show.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.cache/transmission
9noblacklist ${HOME}/.config/transmission
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17net none
18nodvd
19nonewprivs
20noroot
21nosound
22notv
23novideo
24protocol unix
25seccomp
26shell none
27tracelog
28
29# private-bin
30private-dev
31private-etc none
32private-tmp
diff --git a/etc/tuxguitar.profile b/etc/tuxguitar.profile
deleted file mode 100644
index 30e2a619d..000000000
--- a/etc/tuxguitar.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for tuxguitar
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/tuxguitar.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.java
9noblacklist ~/.tuxguitar*
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19netfilter
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29tracelog
30
31private-dev
32private-tmp
33
34# noexec ${HOME} - tuxguitar may fail to launch
35noexec /tmp
diff --git a/etc/unbound.profile b/etc/unbound.profile
deleted file mode 100644
index d380b5698..000000000
--- a/etc/unbound.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for unbound
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/unbound.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist /sbin
11noblacklist /usr/sbin
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18caps
19# caps.keep net_bind_service,setgid,setuid,sys_chroot,sys_resource
20no3d
21nodvd
22nonewprivs
23nosound
24notv
25novideo
26seccomp.drop mount,umount2,ptrace,kexec_load,kexec_file_load,open_by_handle_at,init_module,finit_module,delete_module,iopl,ioperm,swapon,swapoff,syslog,process_vm_readv,process_vm_writev,sysfs,_sysctl,adjtimex,clock_adjtime,lookup_dcookie,perf_event_open,fanotify_init,kcmp,add_key,request_key,keyctl,uselib,acct,modify_ldt,pivot_root,io_setup,io_destroy,io_getevents,io_submit,io_cancel,remap_file_pages,mbind,get_mempolicy,set_mempolicy,migrate_pages,move_pages,vmsplice,perf_event_open
27
28disable-mnt
29private
30private-dev
31
32# mdwe can break modules/plugins
33memory-deny-write-execute
diff --git a/etc/unknown-horizons.profile b/etc/unknown-horizons.profile
deleted file mode 100644
index 5f70843d6..000000000
--- a/etc/unknown-horizons.profile
+++ /dev/null
@@ -1,31 +0,0 @@
1# Firejail profile for unknown-horizons
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/unknown-horizons.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.unknown-horizons
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.unknown-horizons
15whitelist ~/.unknown-horizons
16include /etc/firejail/whitelist-common.inc
17
18caps.drop all
19nodvd
20nogroups
21nonewprivs
22noroot
23notv
24protocol unix,netlink,inet,inet6
25seccomp
26shell none
27
28# private-bin unknown-horizons
29private-dev
30# private-etc none
31private-tmp
diff --git a/etc/unrar.profile b/etc/unrar.profile
deleted file mode 100644
index 12559a721..000000000
--- a/etc/unrar.profile
+++ /dev/null
@@ -1,27 +0,0 @@
1# Firejail profile for unrar
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/unrar.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11hostname unrar
12ignore noroot
13net none
14no3d
15nodvd
16nosound
17notv
18novideo
19shell none
20tracelog
21
22private-bin unrar
23private-dev
24private-etc passwd,group,localtime
25private-tmp
26
27include /etc/firejail/default.profile
diff --git a/etc/unzip.profile b/etc/unzip.profile
deleted file mode 100644
index 9828fa9b4..000000000
--- a/etc/unzip.profile
+++ /dev/null
@@ -1,26 +0,0 @@
1# Firejail profile for unzip
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/unzip.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11hostname unzip
12ignore noroot
13net none
14no3d
15nodvd
16nosound
17notv
18novideo
19shell none
20tracelog
21
22private-bin unzip
23private-dev
24private-etc passwd,group,localtime
25
26include /etc/firejail/default.profile
diff --git a/etc/uudeview.profile b/etc/uudeview.profile
deleted file mode 100644
index b30cbaa2a..000000000
--- a/etc/uudeview.profile
+++ /dev/null
@@ -1,24 +0,0 @@
1# Firejail profile for uudeview
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/uudeview.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9
10hostname uudeview
11ignore noroot
12net none
13nodvd
14nosound
15notv
16novideo
17shell none
18tracelog
19
20private-bin uudeview
21private-dev
22private-etc ld.so.preload
23
24include /etc/firejail/default.profile
diff --git a/etc/uzbl-browser.profile b/etc/uzbl-browser.profile
deleted file mode 100644
index e7c931f30..000000000
--- a/etc/uzbl-browser.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for uzbl-browser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/uzbl-browser.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/uzbl
9noblacklist ~/.gnupg
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.config/uzbl
16mkdir ~/.gnupg
17mkdir ~/.local/share/uzbl
18mkdir ~/.password-store
19whitelist ${DOWNLOADS}
20whitelist ~/.config/uzbl
21whitelist ~/.gnupg
22whitelist ~/.local/share/uzbl
23whitelist ~/.password-store
24include /etc/firejail/whitelist-common.inc
25
26caps.drop all
27netfilter
28nodvd
29nonewprivs
30noroot
31notv
32protocol unix,inet,inet6
33seccomp
34tracelog
diff --git a/etc/viewnior.profile b/etc/viewnior.profile
deleted file mode 100644
index af4a2d655..000000000
--- a/etc/viewnior.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for viewnior
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/viewnior.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist ~/.Xauthority
9blacklist ~/.bashrc
10
11noblacklist ~/.Steam
12noblacklist ~/.config/viewnior
13noblacklist ~/.steam
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-devel.inc
17include /etc/firejail/disable-passwdmgr.inc
18include /etc/firejail/disable-programs.inc
19
20caps.drop all
21net none
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35private-bin viewnior
36private-dev
37private-etc fonts
38private-tmp
39
40memory-deny-write-execute
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/vim.profile b/etc/vim.profile
deleted file mode 100644
index 97ed06d96..000000000
--- a/etc/vim.profile
+++ /dev/null
@@ -1,25 +0,0 @@
1# Firejail profile for vim
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/vim.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.vim
9noblacklist ~/.viminfo
10noblacklist ~/.vimrc
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nodvd
19nogroups
20nonewprivs
21noroot
22notv
23novideo
24protocol unix,inet,inet6
25seccomp
diff --git a/etc/virtualbox.profile b/etc/virtualbox.profile
deleted file mode 100644
index b01e6d144..000000000
--- a/etc/virtualbox.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for virtualbox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/virtualbox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.VirtualBox
9noblacklist ${HOME}/.config/VirtualBox
10noblacklist ${HOME}/VirtualBox VMs
11# noblacklist /usr/bin/virtualbox
12noblacklist /usr/lib/virtualbox
13noblacklist /usr/lib64/virtualbox
14
15include /etc/firejail/disable-common.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19mkdir ~/.config/VirtualBox
20mkdir ~/VirtualBox VMs
21whitelist ~/.config/VirtualBox
22whitelist ~/VirtualBox VMs
23whitelist ${DOWNLOADS}
24include /etc/firejail/whitelist-common.inc
25include /etc/firejail/whitelist-var-common.inc
26
27caps.drop all
28netfilter
29nodvd
30notv
diff --git a/etc/vivaldi-beta.profile b/etc/vivaldi-beta.profile
deleted file mode 100644
index d1ceb74f4..000000000
--- a/etc/vivaldi-beta.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for vivaldi
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/vivaldi.profile
diff --git a/etc/vivaldi-stable.profile b/etc/vivaldi-stable.profile
deleted file mode 100644
index d1ceb74f4..000000000
--- a/etc/vivaldi-stable.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for vivaldi
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/vivaldi.profile
diff --git a/etc/vivaldi.profile b/etc/vivaldi.profile
deleted file mode 100644
index 503916b26..000000000
--- a/etc/vivaldi.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for vivaldi
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/vivaldi.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/vivaldi
9noblacklist ~/.config/vivaldi
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ~/.cache/vivaldi
16mkdir ~/.config/vivaldi
17whitelist ${DOWNLOADS}
18whitelist ~/.cache/vivaldi
19whitelist ~/.config/vivaldi
20include /etc/firejail/whitelist-common.inc
21
22caps.keep sys_chroot,sys_admin
23netfilter
24nodvd
25nogroups
26notv
27shell none
28
29private-dev
30# private-tmp - problems with multiple browser sessions
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/vlc.profile b/etc/vlc.profile
deleted file mode 100644
index 4e6d37fc5..000000000
--- a/etc/vlc.profile
+++ /dev/null
@@ -1,34 +0,0 @@
1# Firejail profile for vlc
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/vlc.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/vlc
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18machine-id
19netfilter
20# nogroups
21nonewprivs
22noroot
23protocol unix,inet,inet6,netlink
24seccomp
25shell none
26
27private-bin vlc,cvlc,nvlc,rvlc,qvlc,svlc
28private-dev
29private-tmp
30
31# mdwe is disabled due to breaking hardware accelerated decoding
32# memory-deny-write-execute
33noexec ${HOME}
34noexec /tmp
diff --git a/etc/w3m.profile b/etc/w3m.profile
deleted file mode 100644
index 0d3037b26..000000000
--- a/etc/w3m.profile
+++ /dev/null
@@ -1,35 +0,0 @@
1# Firejail profile for w3m
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/w3m.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist /tmp/.X11-unix
9
10noblacklist ~/.w3m
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30tracelog
31
32# private-bin w3m
33private-dev
34private-etc none
35private-tmp
diff --git a/etc/warzone2100.profile b/etc/warzone2100.profile
deleted file mode 100644
index 976f7db5f..000000000
--- a/etc/warzone2100.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for warzone2100
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/warzone2100.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.warzone2100-3.*
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15# mkdir ~/.warzone2100-3.1
16# mkdir ~/.warzone2100-3.2
17whitelist ~/.warzone2100-3.1
18whitelist ~/.warzone2100-3.2
19include /etc/firejail/whitelist-common.inc
20
21caps.drop all
22netfilter
23nodvd
24nogroups
25nonewprivs
26noroot
27notv
28protocol unix,inet,inet6,netlink
29seccomp
30shell none
31tracelog
32
33disable-mnt
34private-bin warzone2100
35private-dev
36private-tmp
diff --git a/etc/waterfox.profile b/etc/waterfox.profile
deleted file mode 100644
index 67995f345..000000000
--- a/etc/waterfox.profile
+++ /dev/null
@@ -1,89 +0,0 @@
1# Firejail profile for waterfox
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/waterfox.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/mozilla
9noblacklist ~/.cache/waterfox
10noblacklist ~/.config/okularpartrc
11noblacklist ~/.config/okularrc
12noblacklist ~/.config/qpdfview
13noblacklist ~/.kde/share/apps/okular
14noblacklist ~/.kde/share/config/okularpartrc
15noblacklist ~/.kde/share/config/okularrc
16noblacklist ~/.kde4/share/apps/okular
17noblacklist ~/.kde4/share/config/okularpartrc
18noblacklist ~/.kde4/share/config/okularrc
19noblacklist ~/.local/share/gnome-shell/extensions
20noblacklist ~/.local/share/okular
21noblacklist ~/.local/share/qpdfview
22noblacklist ~/.mozilla
23noblacklist ~/.waterfox
24noblacklist ~/.pki
25
26include /etc/firejail/disable-common.inc
27include /etc/firejail/disable-devel.inc
28include /etc/firejail/disable-programs.inc
29
30mkdir ~/.cache/mozilla/firefox
31mkdir ~/.mozilla
32mkdir ~/.cache/waterfox
33mkdir ~/.waterfox
34mkdir ~/.pki
35whitelist ${DOWNLOADS}
36whitelist ~/.cache/gnome-mplayer/plugin
37whitelist ~/.cache/mozilla/firefox
38whitelist ~/.cache/waterfox
39whitelist ~/.config/gnome-mplayer
40whitelist ~/.config/okularpartrc
41whitelist ~/.config/okularrc
42whitelist ~/.config/pipelight-silverlight5.1
43whitelist ~/.config/pipelight-widevine
44whitelist ~/.config/qpdfview
45whitelist ~/.kde/share/apps/okular
46whitelist ~/.kde/share/config/okularpartrc
47whitelist ~/.kde/share/config/okularrc
48whitelist ~/.kde4/share/apps/okular
49whitelist ~/.kde4/share/config/okularpartrc
50whitelist ~/.kde4/share/config/okularrc
51whitelist ~/.keysnail.js
52whitelist ~/.lastpass
53whitelist ~/.local/share/gnome-shell/extensions
54whitelist ~/.local/share/okular
55whitelist ~/.local/share/qpdfview
56whitelist ~/.mozilla
57whitelist ~/.waterfox
58whitelist ~/.pentadactyl
59whitelist ~/.pentadactylrc
60whitelist ~/.pki
61whitelist ~/.vimperator
62whitelist ~/.vimperatorrc
63whitelist ~/.wine-pipelight
64whitelist ~/.wine-pipelight64
65whitelist ~/.zotero
66whitelist ~/dwhelper
67include /etc/firejail/whitelist-common.inc
68include /etc/firejail/whitelist-var-common.inc
69
70caps.drop all
71netfilter
72nodvd
73nogroups
74nonewprivs
75noroot
76notv
77protocol unix,inet,inet6,netlink
78seccomp
79shell none
80tracelog
81
82# waterfox requires a shell to launch on Arch. We can possibly remove sh though.
83# private-bin waterfox,which,sh,dbus-launch,dbus-send,env,dash,bash
84private-dev
85# private-etc passwd,group,hostname,hosts,localtime,nsswitch.conf,resolv.conf,xdg,gtk-2.0,gtk-3.0,X11,pango,fonts,waterfox,mime.types,mailcap,asound.conf,pulse
86private-tmp
87
88noexec ${HOME}
89noexec /tmp
diff --git a/etc/weechat-curses.profile b/etc/weechat-curses.profile
deleted file mode 100644
index 0da7d45d6..000000000
--- a/etc/weechat-curses.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for weechat
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/weechat.profile
diff --git a/etc/wget.profile b/etc/wget.profile
deleted file mode 100644
index 5072cb9c5..000000000
--- a/etc/wget.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for wget
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/wget.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11noblacklist ~/.wgetrc
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17caps.drop all
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31# private-bin wget
32private-dev
33# private-etc resolv.conf
34# private-tmp
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/whitelist-common.inc b/etc/whitelist-common.inc
deleted file mode 100644
index 310149ecd..000000000
--- a/etc/whitelist-common.inc
+++ /dev/null
@@ -1,60 +0,0 @@
1# Local customizations come here
2include /etc/firejail/whitelist-common.local
3
4# common whitelist for all profiles
5
6whitelist ~/.XCompose
7whitelist ~/.config/mimeapps.list
8whitelist ~/.icons
9whitelist ~/.local/share/icons
10whitelist ~/.config/user-dirs.dirs
11read-only ~/.config/user-dirs.dirs
12whitelist ~/.asoundrc
13whitelist ~/.config/Trolltech.conf
14whitelist ~/.local/share/mime
15whitelist ~/.drirc
16whitelist ~/.mime.types
17whitelist ~/.local/share/applications
18read-only ~/.local/share/applications
19whitelist ~/.config/ibus
20
21# fonts
22whitelist ~/.fonts
23whitelist ~/.fonts.d
24whitelist ~/.fontconfig
25whitelist ~/.fonts.conf
26whitelist ~/.fonts.conf.d
27whitelist ~/.local/share/fonts
28whitelist ~/.config/fontconfig
29whitelist ~/.cache/fontconfig
30whitelist ~/.pangorc
31
32# gtk
33whitelist ~/.gtkrc
34whitelist ~/.gtkrc-2.0
35whitelist ~/.gtk-2.0
36whitelist ~/.config/gtk-2.0
37whitelist ~/.config/gtk-3.0
38whitelist ~/.config/gtkrc
39whitelist ~/.config/gtkrc-2.0
40whitelist ~/.themes
41whitelist ~/.local/share/themes
42whitelist ~/.kde/share/config/gtkrc
43whitelist ~/.kde/share/config/gtkrc-2.0
44whitelist ~/.kde4/share/config/gtkrc
45whitelist ~/.kde4/share/config/gtkrc-2.0
46whitelist ~/.gnome2
47whitelist ~/.gnome2-private
48
49# dconf
50mkdir ~/.config/dconf
51whitelist ~/.config/dconf
52
53# qt/kde
54whitelist ~/.config/kdeglobals
55whitelist ~/.kde/share/config/oxygenrc
56whitelist ~/.kde/share/config/kdeglobals
57whitelist ~/.kde/share/icons
58whitelist ~/.kde4/share/config/oxygenrc
59whitelist ~/.kde4/share/config/kdeglobals
60whitelist ~/.kde4/share/icons
diff --git a/etc/whitelist-var-common.inc b/etc/whitelist-var-common.inc
deleted file mode 100644
index 024995f20..000000000
--- a/etc/whitelist-var-common.inc
+++ /dev/null
@@ -1,11 +0,0 @@
1# Local customizations come here
2include /etc/firejail/whitelist-var-common.local
3
4# common /var whitelist for all profiles
5
6whitelist /var/lib/dbus
7whitelist /var/lib/menu-xdg
8whitelist /var/cache/fontconfig
9whitelist /var/tmp
10whitelist /var/run
11whitelist /var/lock
diff --git a/etc/wine.profile b/etc/wine.profile
deleted file mode 100644
index b1bc7df78..000000000
--- a/etc/wine.profile
+++ /dev/null
@@ -1,25 +0,0 @@
1# Firejail profile for wine
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/wine.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.Steam
9noblacklist ${HOME}/.local/share/Steam
10noblacklist ${HOME}/.local/share/steam
11noblacklist ${HOME}/.steam
12noblacklist ${HOME}/.wine
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-programs.inc
17
18caps.drop all
19netfilter
20nodvd
21nogroups
22nonewprivs
23noroot
24notv
25seccomp
diff --git a/etc/wire.profile b/etc/wire.profile
deleted file mode 100644
index af14f686f..000000000
--- a/etc/wire.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for wire
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/wire.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8# Note: the current beta version of wire is located in /opt/Wire/wire and therefore not in PATH.
9# To use wire with firejail run "firejail /opt/Wire/wire"
10
11noblacklist ~/.config/Wire
12noblacklist ~/.config/wire
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26protocol unix,inet,inet6,netlink
27seccomp
28shell none
29
30disable-mnt
31private-dev
32private-tmp
diff --git a/etc/wireshark-gtk.profile b/etc/wireshark-gtk.profile
deleted file mode 100644
index 38599b85e..000000000
--- a/etc/wireshark-gtk.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for wireshark
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/wireshark.profile
diff --git a/etc/wireshark-qt.profile b/etc/wireshark-qt.profile
deleted file mode 100644
index 38599b85e..000000000
--- a/etc/wireshark-qt.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for wireshark
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/wireshark.profile
diff --git a/etc/wireshark.profile b/etc/wireshark.profile
deleted file mode 100644
index f1a17ba93..000000000
--- a/etc/wireshark.profile
+++ /dev/null
@@ -1,36 +0,0 @@
1# Firejail profile for wireshark
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/wireshark.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/wireshark
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.keep dac_override,net_admin,net_raw
16netfilter
17no3d
18# nogroups - breaks unprivileged wireshark usage
19# nonewprivs - breaks unprivileged wireshark usage
20# noroot
21nodvd
22nosound
23notv
24novideo
25# protocol unix,inet,inet6,netlink
26# seccomp - breaks unprivileged wireshark usage
27shell none
28tracelog
29
30# private-bin wireshark
31private-dev
32# private-etc fonts,group,hosts,machine-id,passwd
33private-tmp
34
35noexec ${HOME}
36noexec /tmp
diff --git a/etc/xed.profile b/etc/xed.profile
deleted file mode 100644
index bb8b0bf23..000000000
--- a/etc/xed.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for xed
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xed.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.config/xed
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15include /etc/firejail/whitelist-var-common.inc
16
17caps.drop all
18# net none - makes settings immutable
19machine-id
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix
29seccomp
30shell none
31tracelog
32
33private-bin xed
34private-dev
35# private-etc fonts
36private-tmp
37
38memory-deny-write-execute
39noexec ${HOME}
40noexec /tmp
diff --git a/etc/xiphos.profile b/etc/xiphos.profile
deleted file mode 100644
index 5a07d4b74..000000000
--- a/etc/xiphos.profile
+++ /dev/null
@@ -1,40 +0,0 @@
1# Firejail profile for xiphos
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xiphos.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8blacklist ~/.Xauthority
9blacklist ~/.bashrc
10
11noblacklist ~/.sword
12noblacklist ~/.xiphos
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-passwdmgr.inc
17include /etc/firejail/disable-programs.inc
18
19whitelist ${HOME}/.sword
20whitelist ${HOME}/.xiphos
21include /etc/firejail/whitelist-common.inc
22
23caps.drop all
24netfilter
25nodvd
26nogroups
27nonewprivs
28noroot
29nosound
30notv
31novideo
32protocol unix,inet,inet6
33seccomp
34shell none
35tracelog
36
37private-bin xiphos
38private-dev
39private-etc fonts,resolv.conf,sword
40private-tmp
diff --git a/etc/xmr-stak-cpu.profile b/etc/xmr-stak-cpu.profile
deleted file mode 100644
index 9cc6e0c1f..000000000
--- a/etc/xmr-stak-cpu.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for xmr-stak-cpu
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xmr-stak-cpu.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14include /etc/firejail/whitelist-var-common.inc
15
16caps.drop all
17ipc-namespace
18netfilter
19no3d
20nodvd
21nogroups
22nonewprivs
23noroot
24nosound
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31disable-mnt
32private
33private-bin xmr-stak-cpu
34private-dev
35private-etc xmr-stak-cpu.json
36private-lib
37private-opt none
38private-tmp
39
40memory-deny-write-execute
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/xonotic-sdl.profile b/etc/xonotic-sdl.profile
deleted file mode 100644
index 041a063bb..000000000
--- a/etc/xonotic-sdl.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for xonotic
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/xonotic.profile
diff --git a/etc/xonotic.profile b/etc/xonotic.profile
deleted file mode 100644
index 6dc62c33b..000000000
--- a/etc/xonotic.profile
+++ /dev/null
@@ -1,39 +0,0 @@
1# Firejail profile for xonotic
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xonotic.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.xonotic
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15mkdir ${HOME}/.xonotic
16whitelist ${HOME}/.xonotic
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nogroups
23nonewprivs
24noroot
25notv
26novideo
27protocol unix,inet,inet6
28seccomp
29shell none
30
31disable-mnt
32private-bin bash,blind-id,darkplaces-glx,darkplaces-sdl,dash,dirname,grep,ldd,netstat,ps,readlink,sh,uname,xonotic,xonotic-glx,xonotic-linux32-dedicated,xonotic-linux32-glx,xonotic-linux32-sdl,xonotic-linux64-dedicated,xonotic-linux64-glx,xonotic-linux64-sdl,xonotic-sdl
33private-dev
34# private-etc breaks audio on some distros
35#private-etc asound.conf,ca-certificates,drirc,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.preload,localtime,nsswitch.conf,passwd,pulse,resolv.conf,ssl
36private-tmp
37
38noexec ${HOME}
39noexec /tmp
diff --git a/etc/xpdf.profile b/etc/xpdf.profile
deleted file mode 100644
index f34358521..000000000
--- a/etc/xpdf.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for xpdf
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xpdf.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ${HOME}/.xpdfrc
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-passwdmgr.inc
13include /etc/firejail/disable-programs.inc
14
15caps.drop all
16net none
17no3d
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24novideo
25protocol unix
26seccomp
27shell none
28
29private-dev
30private-tmp
31
32noexec ${HOME}
33noexec /tmp
diff --git a/etc/xplayer.profile b/etc/xplayer.profile
deleted file mode 100644
index 5c845e977..000000000
--- a/etc/xplayer.profile
+++ /dev/null
@@ -1,32 +0,0 @@
1# Firejail profile for xplayer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xplayer.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/xplayer
9noblacklist ~/.local/share/xplayer
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17netfilter
18nogroups
19nonewprivs
20noroot
21protocol unix,inet,inet6
22seccomp
23shell none
24tracelog
25
26private-bin xplayer,xplayer-audio-preview,xplayer-video-thumbnailer
27private-dev
28# private-etc fonts
29private-tmp
30
31noexec ${HOME}
32noexec /tmp
diff --git a/etc/xreader.profile b/etc/xreader.profile
deleted file mode 100644
index bebcb262f..000000000
--- a/etc/xreader.profile
+++ /dev/null
@@ -1,41 +0,0 @@
1# Firejail profile for xreader
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xreader.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/xreader
9noblacklist ~/.config/xreader
10noblacklist ~/.local/share
11
12include /etc/firejail/disable-common.inc
13include /etc/firejail/disable-devel.inc
14include /etc/firejail/disable-passwdmgr.inc
15include /etc/firejail/disable-programs.inc
16
17include /etc/firejail/whitelist-var-common.inc
18
19caps.drop all
20no3d
21nodvd
22nogroups
23nonewprivs
24noroot
25nosound
26notv
27novideo
28protocol unix
29seccomp
30shell none
31tracelog
32
33private-bin xreader,xreader-previewer,xreader-thumbnailer
34private-dev
35# private-etc fonts,ld.so.cache
36# xreader needs access to /tmp/mozilla* to work in firefox
37# private-tmp
38
39memory-deny-write-execute
40noexec ${HOME}
41noexec /tmp
diff --git a/etc/xviewer.profile b/etc/xviewer.profile
deleted file mode 100644
index 53f2a0c82..000000000
--- a/etc/xviewer.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for xviewer
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/xviewer.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.Steam
9noblacklist ~/.config/xviewer
10noblacklist ~/.local/share/Trash
11noblacklist ~/.steam
12
13include /etc/firejail/disable-common.inc
14include /etc/firejail/disable-devel.inc
15include /etc/firejail/disable-passwdmgr.inc
16include /etc/firejail/disable-programs.inc
17
18include /etc/firejail/whitelist-var-common.inc
19
20caps.drop all
21# net none - makes settings immutable
22no3d
23nodvd
24nogroups
25nonewprivs
26noroot
27nosound
28notv
29novideo
30protocol unix
31seccomp
32shell none
33tracelog
34
35private-bin xviewer
36private-dev
37private-etc fonts
38private-tmp
39
40memory-deny-write-execute
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/xz.profile b/etc/xz.profile
deleted file mode 100644
index d77fc85b4..000000000
--- a/etc/xz.profile
+++ /dev/null
@@ -1,6 +0,0 @@
1# Firejail profile alias for cpio
2# This file is overwritten after every install/update
3
4
5# Redirect
6include /etc/firejail/cpio.profile
diff --git a/etc/xzdec.profile b/etc/xzdec.profile
deleted file mode 100644
index d5c4ac6f0..000000000
--- a/etc/xzdec.profile
+++ /dev/null
@@ -1,23 +0,0 @@
1# Firejail profile for xzdec
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/xzdec.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9blacklist /tmp/.X11-unix
10
11ignore noroot
12net none
13no3d
14nodvd
15nosound
16notv
17novideo
18shell none
19tracelog
20
21private-dev
22
23include /etc/firejail/default.profile
diff --git a/etc/yandex-browser.profile b/etc/yandex-browser.profile
deleted file mode 100644
index bfb7b9d87..000000000
--- a/etc/yandex-browser.profile
+++ /dev/null
@@ -1,42 +0,0 @@
1# Firejail profile for yandex-browser
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/yandex-browser.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.cache/yandex-browser
9noblacklist ~/.cache/yandex-browser-beta
10noblacklist ~/.config/yandex-browser
11noblacklist ~/.config/yandex-browser-beta
12noblacklist ~/.pki
13
14include /etc/firejail/disable-common.inc
15include /etc/firejail/disable-devel.inc
16include /etc/firejail/disable-programs.inc
17
18mkdir ~/.cache/yandex-browser
19mkdir ~/.cache/yandex-browser-beta
20mkdir ~/.config/yandex-browser
21mkdir ~/.config/yandex-browser-beta
22mkdir ~/.pki
23whitelist ${DOWNLOADS}
24whitelist ~/.cache/yandex-browser
25whitelist ~/.cache/yandex-browser-beta
26whitelist ~/.config/yandex-browser
27whitelist ~/.config/yandex-browser-beta
28whitelist ~/.pki
29include /etc/firejail/whitelist-common.inc
30
31caps.keep sys_chroot,sys_admin
32netfilter
33nodvd
34nogroups
35notv
36shell none
37
38private-dev
39# private-tmp - problems with multiple browser sessions
40
41noexec ${HOME}
42noexec /tmp
diff --git a/etc/youtube-dl.profile b/etc/youtube-dl.profile
deleted file mode 100644
index d41591fd6..000000000
--- a/etc/youtube-dl.profile
+++ /dev/null
@@ -1,37 +0,0 @@
1# Firejail profile for youtube-dl
2# This file is overwritten after every install/update
3quiet
4# Persistent local customizations
5include /etc/firejail/youtube-dl.local
6# Persistent global definitions
7include /etc/firejail/globals.local
8
9noblacklist ${HOME}/.netrc
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16include /etc/firejail/whitelist-var-common.inc
17
18caps.drop all
19ipc-namespace
20netfilter
21no3d
22nodvd
23nogroups
24nonewprivs
25noroot
26nosound
27notv
28novideo
29protocol unix,inet,inet6
30seccomp
31shell none
32tracelog
33
34private-dev
35
36noexec ${HOME}
37noexec /tmp
diff --git a/etc/zart.profile b/etc/zart.profile
deleted file mode 100644
index 6e136d0c9..000000000
--- a/etc/zart.profile
+++ /dev/null
@@ -1,30 +0,0 @@
1# Firejail profile for zart
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/zart.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8
9include /etc/firejail/disable-common.inc
10include /etc/firejail/disable-devel.inc
11include /etc/firejail/disable-passwdmgr.inc
12include /etc/firejail/disable-programs.inc
13
14caps.drop all
15ipc-namespace
16net none
17nodvd
18nogroups
19nonewprivs
20noroot
21notv
22protocol unix
23seccomp
24shell none
25
26private-bin zart,ffmpeg,melt,ffprobe,ffplay
27private-dev
28
29noexec ${HOME}
30noexec /tmp
diff --git a/etc/zathura.profile b/etc/zathura.profile
deleted file mode 100644
index 0036a3521..000000000
--- a/etc/zathura.profile
+++ /dev/null
@@ -1,33 +0,0 @@
1# Firejail profile for zathura
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/zathura.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/zathura
9noblacklist ~/.local/share/zathura
10
11include /etc/firejail/disable-common.inc
12include /etc/firejail/disable-devel.inc
13include /etc/firejail/disable-passwdmgr.inc
14include /etc/firejail/disable-programs.inc
15
16caps.drop all
17net none
18nodvd
19nogroups
20nonewprivs
21noroot
22nosound
23notv
24protocol unix
25seccomp
26shell none
27
28private-bin zathura
29private-dev
30private-etc fonts
31private-tmp
32read-only ~/
33read-write ~/.local/share/zathura/
diff --git a/etc/zoom.profile b/etc/zoom.profile
deleted file mode 100644
index 381df9ab5..000000000
--- a/etc/zoom.profile
+++ /dev/null
@@ -1,28 +0,0 @@
1# Firejail profile for zoom
2# This file is overwritten after every install/update
3# Persistent local customizations
4include /etc/firejail/zoom.local
5# Persistent global definitions
6include /etc/firejail/globals.local
7
8noblacklist ~/.config/zoomus.conf
9
10include /etc/firejail/disable-common.inc
11include /etc/firejail/disable-devel.inc
12include /etc/firejail/disable-programs.inc
13
14mkdir ~/.zoom
15whitelist ~/.cache/zoom
16whitelist ~/.zoom
17include /etc/firejail/whitelist-common.inc
18
19caps.drop all
20netfilter
21nodvd
22nonewprivs
23noroot
24notv
25protocol unix,inet,inet6
26seccomp
27
28private-tmp
diff --git a/gcov.sh b/gcov.sh
index df1fcb51b..65f06a4d4 100755
--- a/gcov.sh
+++ b/gcov.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3gcov_init() { 6gcov_init() {
4 USER=`whoami` 7 USER=`whoami`
@@ -10,11 +13,18 @@ gcov_init() {
10 /usr/lib/firejail/fcopy --help > /dev/null 13 /usr/lib/firejail/fcopy --help > /dev/null
11 /usr/lib/firejail/fldd --help > /dev/null 14 /usr/lib/firejail/fldd --help > /dev/null
12 firecfg --help > /dev/null 15 firecfg --help > /dev/null
16
17 /usr/lib/firejail/fnetfilter --help > /dev/null
18 /usr/lib/firejail/fsec-print --help > /dev/null
19 /usr/lib/firejail/fsec-optimize --help > /dev/null
20 /usr/lib/firejail/faudit --help > /dev/null
21 /usr/lib/firejail/fbuilder --help > /dev/null
22
13 sudo chown $USER:$USER `find .` 23 sudo chown $USER:$USER `find .`
14} 24}
15 25
16generate() { 26generate() {
17 lcov -q --capture -d src/firejail -d src/firemon -d src/fcopy -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-new 27 lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder -d src/fcopy -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-new
18 lcov --add-tracefile gcov-file-old --add-tracefile gcov-file-new --output-file gcov-file 28 lcov --add-tracefile gcov-file-old --add-tracefile gcov-file-new --output-file gcov-file
19 rm -fr gcov-dir 29 rm -fr gcov-dir
20 genhtml -q gcov-file --output-directory gcov-dir 30 genhtml -q gcov-file --output-directory gcov-dir
@@ -25,9 +35,9 @@ generate() {
25 35
26 36
27gcov_init 37gcov_init
28lcov -q --capture -d src/firejail -d src/firemon -d src/fcopy -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-old 38lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder -d src/fcopy -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file-old
29 39
30#make test-environment 40#make test-utils
31#generate 41#generate
32#sleep 2 42#sleep 2
33#exit 43#exit
@@ -50,6 +60,10 @@ make test-stress
50generate 60generate
51sleep 2 61sleep 2
52 62
63make test-ssh
64generate
65sleep 2
66
53make test-appimage 67make test-appimage
54generate 68generate
55sleep 2 69sleep 2
diff --git a/install.sh b/install.sh
index a8a506096..e26cea7b0 100755
--- a/install.sh
+++ b/install.sh
@@ -1,2 +1,6 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
2echo "installing..." 6echo "installing..."
diff --git a/linecnt.sh b/linecnt.sh
new file mode 100755
index 000000000..ccce2da82
--- /dev/null
+++ b/linecnt.sh
@@ -0,0 +1,31 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6gcov_init() {
7 USER=`whoami`
8 firejail --help > /dev/null
9 firemon --help > /dev/null
10 /usr/lib/firejail/fnet --help > /dev/null
11 /usr/lib/firejail/fseccomp --help > /dev/null
12 /usr/lib/firejail/ftee --help > /dev/null
13 /usr/lib/firejail/fcopy --help > /dev/null
14 /usr/lib/firejail/fldd --help > /dev/null
15 firecfg --help > /dev/null
16
17 /usr/lib/firejail/fnetfilter --help > /dev/null
18 /usr/lib/firejail/fsec-print --help > /dev/null
19 /usr/lib/firejail/fsec-optimize --help > /dev/null
20 /usr/lib/firejail/faudit --help > /dev/null
21 /usr/lib/firejail/fbuilder --help > /dev/null
22
23 sudo chown $USER:$USER `find .`
24}
25
26rm -fr gcov-dir
27gcov_init
28lcov -q --capture -d src/firejail -d src/firemon -d src/faudit -d src/fbuilder \
29 -d src/fcopy -d src/fnetfilter -d src/fsec-print -d src/fsec-optimize -d src/fseccomp \
30 -d src/fnet -d src/ftee -d src/lib -d src/firecfg -d src/fldd --output-file gcov-file
31genhtml -q gcov-file --output-directory gcov-dir
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
new file mode 100644
index 000000000..dcabb92a1
--- /dev/null
+++ b/m4/ax_check_compile_flag.m4
@@ -0,0 +1,74 @@
1# ===========================================================================
2# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
8#
9# DESCRIPTION
10#
11# Check whether the given FLAG works with the current language's compiler
12# or gives an error. (Warnings, however, are ignored)
13#
14# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
15# success/failure.
16#
17# If EXTRA-FLAGS is defined, it is added to the current language's default
18# flags (e.g. CFLAGS) when the check is done. The check is thus made with
19# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
20# force the compiler to issue an error when a bad flag is given.
21#
22# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
23#
24# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
25# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
26#
27# LICENSE
28#
29# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
30# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
31#
32# This program is free software: you can redistribute it and/or modify it
33# under the terms of the GNU General Public License as published by the
34# Free Software Foundation, either version 3 of the License, or (at your
35# option) any later version.
36#
37# This program is distributed in the hope that it will be useful, but
38# WITHOUT ANY WARRANTY; without even the implied warranty of
39# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40# Public License for more details.
41#
42# You should have received a copy of the GNU General Public License along
43# with this program. If not, see <https://www.gnu.org/licenses/>.
44#
45# As a special exception, the respective Autoconf Macro's copyright owner
46# gives unlimited permission to copy, distribute and modify the configure
47# scripts that are the output of Autoconf when processing the Macro. You
48# need not follow the terms of the GNU General Public License when using
49# or distributing such scripts, even though portions of the text of the
50# Macro appear in them. The GNU General Public License (GPL) does govern
51# all other use of the material that constitutes the Autoconf Macro.
52#
53# This special exception to the GPL applies to versions of the Autoconf
54# Macro released by the Autoconf Archive. When you make and distribute a
55# modified version of the Autoconf Macro, you may extend this special
56# exception to the GPL to apply to your modified version as well.
57
58#serial 5
59
60AC_DEFUN([AX_CHECK_COMPILE_FLAG],
61[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
62AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
63AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
64 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
65 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
66 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
67 [AS_VAR_SET(CACHEVAR,[yes])],
68 [AS_VAR_SET(CACHEVAR,[no])])
69 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
70AS_VAR_IF(CACHEVAR,yes,
71 [m4_default([$2], :)],
72 [m4_default([$3], :)])
73AS_VAR_POPDEF([CACHEVAR])dnl
74])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/mkasc.sh b/mkasc.sh
index 3bbfc6eb5..31c3f4ffd 100755
--- a/mkasc.sh
+++ b/mkasc.sh
@@ -1,6 +1,9 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3echo "Calculationg SHA256 for all files in /transfer - firejail version $1" 6echo "Calculating SHA256 for all files in /transfer - firejail version $1"
4 7
5cd /transfer 8cd /transfer
6sha256sum * > firejail-$1-unsigned 9sha256sum * > firejail-$1-unsigned
diff --git a/mkdeb.sh b/mkdeb.sh.in
index 68f0e12d4..e45acf8eb 100755
--- a/mkdeb.sh
+++ b/mkdeb.sh.in
@@ -1,10 +1,30 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
2# based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ 6# based on http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/
3# a code archive should already be available 7# a code archive should already be available
4 8
9set -e
10NAME=@PACKAGE_NAME@
11VERSION=@PACKAGE_VERSION@
12PACKAGE_TARNAME=@PACKAGE_TARNAME@
13HAVE_APPARMOR=@HAVE_APPARMOR@
14HAVE_SELINUX=@HAVE_SELINUX@
15EXTRA_VERSION=$1
16
17CONFIG_ARGS="--prefix=/usr"
18if [ -n "$HAVE_APPARMOR" ]; then
19 CONFIG_ARGS="$CONFIG_ARGS --enable-apparmor"
20fi
21if [ -n "$HAVE_SELINUX" ]; then
22 CONFIG_ARGS="$CONFIG_ARGS --enable-selinux"
23fi
24
5TOP=`pwd` 25TOP=`pwd`
6CODE_ARCHIVE="$1-$2.tar.xz" 26CODE_ARCHIVE="$NAME-$VERSION.tar.xz"
7CODE_DIR="$1-$2" 27CODE_DIR="$NAME-$VERSION"
8INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian" 28INSTALL_DIR="${INSTALL_DIR}${CODE_DIR}/debian"
9DEBIAN_CTRL_DIR="${DEBIAN_CTRL_DIR}${CODE_DIR}/debian/DEBIAN" 29DEBIAN_CTRL_DIR="${DEBIAN_CTRL_DIR}${CODE_DIR}/debian/DEBIAN"
10 30
@@ -18,7 +38,7 @@ echo "*****************************************"
18tar -xJvf $CODE_ARCHIVE 38tar -xJvf $CODE_ARCHIVE
19#mkdir -p $INSTALL_DIR 39#mkdir -p $INSTALL_DIR
20cd $CODE_DIR 40cd $CODE_DIR
21./configure --prefix=/usr --enable-git-install 41./configure $CONFIG_ARGS
22make -j2 42make -j2
23mkdir debian 43mkdir debian
24DESTDIR=debian make install-strip 44DESTDIR=debian make install-strip
@@ -32,19 +52,19 @@ echo "*****************************************"
32mv $INSTALL_DIR/usr/share/doc/firejail/RELNOTES $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian 52mv $INSTALL_DIR/usr/share/doc/firejail/RELNOTES $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
33gzip -9 -n $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian 53gzip -9 -n $INSTALL_DIR/usr/share/doc/firejail/changelog.Debian
34rm $INSTALL_DIR/usr/share/doc/firejail/COPYING 54rm $INSTALL_DIR/usr/share/doc/firejail/COPYING
35cp platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/. 55install -m644 $CODE_DIR/platform/debian/copyright $INSTALL_DIR/usr/share/doc/firejail/.
36mkdir -p $DEBIAN_CTRL_DIR 56mkdir -p $DEBIAN_CTRL_DIR
37sed "s/FIREJAILVER/$2/g" platform/debian/control > $DEBIAN_CTRL_DIR/control 57sed "s/FIREJAILVER/$VERSION/g" $CODE_DIR/platform/debian/control.$(dpkg-architecture -qDEB_HOST_ARCH) > $DEBIAN_CTRL_DIR/control
38 58
39mkdir -p $INSTALL_DIR/usr/share/lintian/overrides/ 59mkdir -p $INSTALL_DIR/usr/share/lintian/overrides/
40cp platform/debian/firejail.lintian-overrides $INSTALL_DIR/usr/share/lintian/overrides/firejail 60install -m644 $CODE_DIR/platform/debian/firejail.lintian-overrides $INSTALL_DIR/usr/share/lintian/overrides/firejail
41 61
42cp platform/debian/conffiles $DEBIAN_CTRL_DIR/. 62find $INSTALL_DIR/etc -type f | sed "s,^$INSTALL_DIR,," | LC_ALL=C sort > $DEBIAN_CTRL_DIR/conffiles
63chmod 644 $DEBIAN_CTRL_DIR/conffiles
43find $INSTALL_DIR -type d | xargs chmod 755 64find $INSTALL_DIR -type d | xargs chmod 755
44cd $CODE_DIR 65cd $CODE_DIR
45fakeroot dpkg-deb --build debian 66fakeroot dpkg-deb --build debian
46lintian --no-tag-display-limit debian.deb 67lintian --no-tag-display-limit debian.deb
47mv debian.deb ../firejail_$2_1_amd64.deb 68mv debian.deb ../firejail_${VERSION}${EXTRA_VERSION}_1_$(dpkg-architecture -qDEB_HOST_ARCH).deb
48echo "if building a 32bit package, rename the deb file manually"
49cd .. 69cd ..
50rm -fr $CODE_DIR 70rm -fr $CODE_DIR
diff --git a/mketc.sh b/mketc.sh
index f98c5479f..0aa313b17 100755
--- a/mketc.sh
+++ b/mketc.sh
@@ -1,22 +1,17 @@
1#!/bin/sh 1#!/bin/sh
2rm -fr .etc 2# This file is part of Firejail project
3mkdir .etc 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
4 5
5for file in etc/*.profile etc/*.inc etc/*.net;
6do
7 sed "s;/etc/firejail;$1/firejail;g" $file > .$file
8done
9
10if [ "x$2" = "xyes" ]
11then
12sed -i -e ' 6sed -i -e '
131i# Workaround for systems where common UNIX utilities are symlinks to busybox.\ 71i# Workaround for systems where common UNIX utilities are symlinks to busybox.\
14# If this is not your case you can remove --enable-busybox-workaround from\ 8# If this is not your case you can remove --enable-busybox-workaround from\
15# ./configure options, for added security.\ 9# ./configure options, for added security.\
10noblacklist \${PATH}/busybox\
11noblacklist \${PATH}/crontab\
16noblacklist \${PATH}/mount\ 12noblacklist \${PATH}/mount\
17noblacklist \${PATH}/umount\ 13noblacklist \${PATH}/nc\
18noblacklist \${PATH}/su\ 14noblacklist \${PATH}/su\
19noblacklist \${PATH}/sudo\ 15noblacklist \${PATH}/sudo\
20noblacklist \${PATH}/nc\ 16noblacklist \${PATH}/umount\
21' .etc/disable-common.inc 17' "$1"
22fi
diff --git a/mkman.sh b/mkman.sh
index e36475aad..8767972d1 100755
--- a/mkman.sh
+++ b/mkman.sh
@@ -1,4 +1,9 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set -e
2 7
3sed "s/VERSION/$1/g" $2 > $3 8sed "s/VERSION/$1/g" $2 > $3
4MONTH=`LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b` 9MONTH=`LC_ALL=C date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%b`
diff --git a/mkuid.sh b/mkuid.sh
index a59f58143..0264628cc 100755
--- a/mkuid.sh
+++ b/mkuid.sh
@@ -1,4 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3echo "extracting UID_MIN and GID_MIN" 6echo "extracting UID_MIN and GID_MIN"
4echo "#ifndef FIREJAIL_UIDS_H" > uids.h 7echo "#ifndef FIREJAIL_UIDS_H" > uids.h
@@ -6,15 +9,15 @@ echo "#define FIREJAIL_UIDS_H" >> uids.h
6 9
7if [ -r /etc/login.defs ] 10if [ -r /etc/login.defs ]
8then 11then
9 echo "// using values extracted from /etc/login.defs" >> uids.h
10 UID_MIN=`awk '/^\s*UID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs` 12 UID_MIN=`awk '/^\s*UID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs`
11 GID_MIN=`awk '/^\s*GID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs` 13 GID_MIN=`awk '/^\s*GID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs`
12 echo "#define UID_MIN $UID_MIN" >> uids.h
13 echo "#define GID_MIN $GID_MIN" >> uids.h
14else
15 echo "// using default values" >> uids.h
16 echo "#define UID_MIN 1000" >> uids.h
17 echo "#define GID_MIN 1000" >> uids.h
18fi 14fi
19 15
16# use default values if not found
17[ -z "$UID_MIN" ] && UID_MIN="1000"
18[ -z "$GID_MIN" ] && GID_MIN="1000"
19
20echo "#define UID_MIN $UID_MIN" >> uids.h
21echo "#define GID_MIN $GID_MIN" >> uids.h
22
20echo "#endif" >> uids.h 23echo "#endif" >> uids.h
diff --git a/platform/debian/conffiles b/platform/debian/conffiles
deleted file mode 100644
index cee008786..000000000
--- a/platform/debian/conffiles
+++ /dev/null
@@ -1,417 +0,0 @@
1/etc/firejail/0ad.profile
2/etc/firejail/2048-qt.profile
3/etc/firejail/7z.profile
4/etc/firejail/Cryptocat.profile
5/etc/firejail/Cyberfox.profile
6/etc/firejail/FossaMail.profile
7/etc/firejail/Gitter.profile
8/etc/firejail/Mathematica.profile
9/etc/firejail/Telegram.profile
10/etc/firejail/Thunar.profile
11/etc/firejail/VirtualBox.profile
12/etc/firejail/Wire.profile
13/etc/firejail/Xephyr.profile
14/etc/firejail/Xvfb.profile
15/etc/firejail/abrowser.profile
16/etc/firejail/akregator.profile
17/etc/firejail/amarok.profile
18/etc/firejail/android-studio.profile
19/etc/firejail/apktool.profile
20/etc/firejail/arduino.profile
21/etc/firejail/ark.profile
22/etc/firejail/arm.profile
23/etc/firejail/atom-beta.profile
24/etc/firejail/atom.profile
25/etc/firejail/atool.profile
26/etc/firejail/atril.profile
27/etc/firejail/audacious.profile
28/etc/firejail/audacity.profile
29/etc/firejail/aweather.profile
30/etc/firejail/baloo_file.profile
31/etc/firejail/baobab.profile
32/etc/firejail/bibletime.profile
33/etc/firejail/bitlbee.profile
34/etc/firejail/bleachbit.profile
35/etc/firejail/blender.profile
36/etc/firejail/bless.profile
37/etc/firejail/brasero.profile
38/etc/firejail/brave.profile
39/etc/firejail/caja.profile
40/etc/firejail/calibre.profile
41/etc/firejail/catfish.profile
42/etc/firejail/cherrytree.profile
43/etc/firejail/chromium-browser.profile
44/etc/firejail/chromium.profile
45/etc/firejail/claws-mail.profile
46/etc/firejail/clementine.profile
47/etc/firejail/clipit.profile
48/etc/firejail/cmus.profile
49/etc/firejail/conkeror.profile
50/etc/firejail/corebird.profile
51/etc/firejail/cpio.profile
52/etc/firejail/cryptocat.profile
53/etc/firejail/curl.profile
54/etc/firejail/cvlc.profile
55/etc/firejail/cyberfox.profile
56/etc/firejail/darktable.profile
57/etc/firejail/deadbeef.profile
58/etc/firejail/default.profile
59/etc/firejail/deluge.profile
60/etc/firejail/dex2jar.profile
61/etc/firejail/dia.profile
62/etc/firejail/digikam.profile
63/etc/firejail/dillo.profile
64/etc/firejail/dino.profile
65/etc/firejail/disable-common.inc
66/etc/firejail/disable-devel.inc
67/etc/firejail/disable-passwdmgr.inc
68/etc/firejail/disable-programs.inc
69/etc/firejail/display.profile
70/etc/firejail/dnscrypt-proxy.profile
71/etc/firejail/dnsmasq.profile
72/etc/firejail/dolphin.profile
73/etc/firejail/dosbox.profile
74/etc/firejail/dragon.profile
75/etc/firejail/dropbox.profile
76/etc/firejail/ebook-viewer.profile
77/etc/firejail/electron.profile
78/etc/firejail/elinks.profile
79/etc/firejail/emacs.profile
80/etc/firejail/empathy.profile
81/etc/firejail/enchant.profile
82/etc/firejail/engrampa.profile
83/etc/firejail/eog.profile
84/etc/firejail/eom.profile
85/etc/firejail/epiphany.profile
86/etc/firejail/etr.profile
87/etc/firejail/evince.profile
88/etc/firejail/evolution.profile
89/etc/firejail/exiftool.profile
90/etc/firejail/fbreader.profile
91/etc/firejail/feh.profile
92/etc/firejail/file-roller.profile
93/etc/firejail/file.profile
94/etc/firejail/filezilla.profile
95/etc/firejail/firefox-esr.profile
96/etc/firejail/firefox.profile
97/etc/firejail/firefox-nightly.profile
98/etc/firejail/firejail.config
99/etc/firejail/flashpeak-slimjet.profile
100/etc/firejail/flowblade.profile
101/etc/firejail/fontforge.profile
102/etc/firejail/fossamail.profile
103/etc/firejail/franz.profile
104/etc/firejail/frozen-bubble.profile
105/etc/firejail/gajim.profile
106/etc/firejail/galculator.profile
107/etc/firejail/geany.profile
108/etc/firejail/geary.profile
109/etc/firejail/gedit.profile
110/etc/firejail/geeqie.profile
111/etc/firejail/ghb.profile
112/etc/firejail/gimp-2.8.profile
113/etc/firejail/gimp.profile
114/etc/firejail/git.profile
115/etc/firejail/gitg.profile
116/etc/firejail/gitter.profile
117/etc/firejail/gjs.profile
118/etc/firejail/globaltime.profile
119/etc/firejail/gnome-2048.profile
120/etc/firejail/gnome-books.profile
121/etc/firejail/gnome-calculator.profile
122/etc/firejail/gnome-chess.profile
123/etc/firejail/gnome-clocks.profile
124/etc/firejail/gnome-contacts.profile
125/etc/firejail/gnome-documents.profile
126/etc/firejail/gnome-font-viewer.profile
127/etc/firejail/gnome-maps.profile
128/etc/firejail/gnome-mplayer.profile
129/etc/firejail/gnome-music.profile
130/etc/firejail/gnome-photos.profile
131/etc/firejail/gnome-twitch.profile
132/etc/firejail/gnome-weather.profile
133/etc/firejail/goobox.profile
134/etc/firejail/google-chrome-beta.profile
135/etc/firejail/google-chrome-stable.profile
136/etc/firejail/google-chrome-unstable.profile
137/etc/firejail/google-chrome.profile
138/etc/firejail/google-play-music-desktop-player.profile
139/etc/firejail/gpa.profile
140/etc/firejail/gpg-agent.profile
141/etc/firejail/gpg.profile
142/etc/firejail/gpicview.profile
143/etc/firejail/gpredict.profile
144/etc/firejail/gtar.profile
145/etc/firejail/gthumb.profile
146/etc/firejail/guayadeque.profile
147/etc/firejail/gucharmap.profile
148/etc/firejail/gwenview.profile
149/etc/firejail/gzip.profile
150/etc/firejail/handbrake-gtk.profile
151/etc/firejail/handbrake.profile
152/etc/firejail/hashcat.profile
153/etc/firejail/hedgewars.profile
154/etc/firejail/hexchat.profile
155/etc/firejail/highlight.profile
156/etc/firejail/hugin.profile
157/etc/firejail/icecat.profile
158/etc/firejail/icedove.profile
159/etc/firejail/iceweasel.profile
160/etc/firejail/idea.sh.profile
161/etc/firejail/img2txt.profile
162/etc/firejail/inkscape.profile
163/etc/firejail/inox.profile
164/etc/firejail/iridium-browser.profile
165/etc/firejail/iridium.profile
166/etc/firejail/jd-gui.profile
167/etc/firejail/jitsi.profile
168/etc/firejail/k3b.profile
169/etc/firejail/kate.profile
170/etc/firejail/kcalc.profile
171/etc/firejail/keepass.profile
172/etc/firejail/keepass2.profile
173/etc/firejail/keepassx.profile
174/etc/firejail/keepassx2.profile
175/etc/firejail/keepassxc.profile
176/etc/firejail/kino.profile
177/etc/firejail/kmail.profile
178/etc/firejail/knotes.profile
179/etc/firejail/kodi.profile
180/etc/firejail/konversation.profile
181/etc/firejail/ktorrent.profile
182/etc/firejail/kwrite.profile
183/etc/firejail/leafpad.profile
184/etc/firejail/less.profile
185/etc/firejail/libreoffice.profile
186/etc/firejail/liferea.profile
187/etc/firejail/localc.profile
188/etc/firejail/lodraw.profile
189/etc/firejail/loffice.profile
190/etc/firejail/lofromtemplate.profile
191/etc/firejail/login.users
192/etc/firejail/loimpress.profile
193/etc/firejail/lollypop.profile
194/etc/firejail/lomath.profile
195/etc/firejail/loweb.profile
196/etc/firejail/lowriter.profile
197/etc/firejail/luminance-hdr.profile
198/etc/firejail/lximage-qt.profile
199/etc/firejail/lxmusic.profile
200/etc/firejail/lxterminal.profile
201/etc/firejail/lynx.profile
202/etc/firejail/mate-calc.profile
203/etc/firejail/mate-calculator.profile
204/etc/firejail/mate-color-select.profile
205/etc/firejail/mate-dictionary.profile
206/etc/firejail/mathematica.profile
207/etc/firejail/mcabber.profile
208/etc/firejail/mediainfo.profile
209/etc/firejail/mediathekview.profile
210/etc/firejail/meld.profile
211/etc/firejail/midori.profile
212/etc/firejail/minetest.profile
213/etc/firejail/mousepad.profile
214/etc/firejail/mplayer.profile
215/etc/firejail/mpv.profile
216/etc/firejail/multimc5.profile
217/etc/firejail/mumble.profile
218/etc/firejail/mupdf.profile
219/etc/firejail/mupen64plus.profile
220/etc/firejail/musescore.profile
221/etc/firejail/mutt.profile
222/etc/firejail/nautilus.profile
223/etc/firejail/nemo.profile
224/etc/firejail/neverball.profile
225/etc/firejail/netsurf.profile
226/etc/firejail/nolocal.net
227/etc/firejail/nylas.profile
228/etc/firejail/obs.profile
229/etc/firejail/odt2txt.profile
230/etc/firejail/okular.profile
231/etc/firejail/open-invaders.profile
232/etc/firejail/openbox.profile
233/etc/firejail/openshot.profile
234/etc/firejail/opera-beta.profile
235/etc/firejail/opera.profile
236/etc/firejail/orage.profile
237/etc/firejail/palemoon.profile
238/etc/firejail/parole.profile
239/etc/firejail/pcmanfm.profile
240/etc/firejail/pdfsam.profile
241/etc/firejail/pdftotext.profile
242/etc/firejail/peek.profile
243/etc/firejail/picard.profile
244/etc/firejail/pidgin.profile
245/etc/firejail/pingus.profile
246/etc/firejail/pithos.profile
247/etc/firejail/pix.profile
248/etc/firejail/pluma.profile
249/etc/firejail/polari.profile
250/etc/firejail/psi-plus.profile
251/etc/firejail/qbittorrent.profile
252/etc/firejail/qemu-launcher.profile
253/etc/firejail/qemu-system-x86_64.profile
254/etc/firejail/qlipper.profile
255/etc/firejail/qpdfview.profile
256/etc/firejail/qtox.profile
257/etc/firejail/quassel.profile
258/etc/firejail/quiterss.profile
259/etc/firejail/qupzilla.profile
260/etc/firejail/qutebrowser.profile
261/etc/firejail/rambox.profile
262/etc/firejail/ranger.profile
263/etc/firejail/remmina.profile
264/etc/firejail/rhythmbox.profile
265/etc/firejail/riot-web.profile
266/etc/firejail/ristretto.profile
267/etc/firejail/rtorrent.profile
268/etc/firejail/scribus.profile
269/etc/firejail/sdat2img.profile
270/etc/firejail/seamonkey-bin.profile
271/etc/firejail/seamonkey.profile
272/etc/firejail/server.profile
273/etc/firejail/silentarmy.profile
274/etc/firejail/simple-scan.profile
275/etc/firejail/simutrans.profile
276/etc/firejail/skanlite.profile
277/etc/firejail/skype.profile
278/etc/firejail/skypeforlinux.profile
279/etc/firejail/slack.profile
280/etc/firejail/smplayer.profile
281/etc/firejail/snap.profile
282/etc/firejail/soffice.profile
283/etc/firejail/soundconverter.profile
284/etc/firejail/spotify.profile
285/etc/firejail/sqlitebrowser.profile
286/etc/firejail/ssh-agent.profile
287/etc/firejail/ssh.profile
288/etc/firejail/start-tor-browser.profile
289/etc/firejail/steam.profile
290/etc/firejail/stellarium.profile
291/etc/firejail/strings.profile
292/etc/firejail/supertux2.profile
293/etc/firejail/synfigstudio.profile
294/etc/firejail/tar.profile
295/etc/firejail/telegram-desktop.profile
296/etc/firejail/telegram.profile
297/etc/firejail/thunar.profile
298/etc/firejail/thunderbird.profile
299/etc/firejail/torbrowser-launcher.profile
300/etc/firejail/totem.profile
301/etc/firejail/tracker.profile
302/etc/firejail/transmission-cli.profile
303/etc/firejail/transmission-gtk.profile
304/etc/firejail/transmission-qt.profile
305/etc/firejail/transmission-show.profile
306/etc/firejail/truecraft.profile
307/etc/firejail/tuxguitar.profile
308/etc/firejail/uget-gtk.profile
309/etc/firejail/unbound.profile
310/etc/firejail/unknown-horizons.profile
311/etc/firejail/unrar.profile
312/etc/firejail/unzip.profile
313/etc/firejail/uudeview.profile
314/etc/firejail/uzbl-browser.profile
315/etc/firejail/viewnior.profile
316/etc/firejail/viking.profile
317/etc/firejail/vim.profile
318/etc/firejail/virtualbox.profile
319/etc/firejail/vivaldi-beta.profile
320/etc/firejail/vivaldi-stable.profile
321/etc/firejail/vivaldi.profile
322/etc/firejail/vlc.profile
323/etc/firejail/vym.profile
324/etc/firejail/w3m.profile
325/etc/firejail/warzone2100.profile
326/etc/firejail/waterfox.profile
327/etc/firejail/webserver.net
328/etc/firejail/weechat-curses.profile
329/etc/firejail/weechat.profile
330/etc/firejail/wesnoth.profile
331/etc/firejail/wget.profile
332/etc/firejail/whitelist-common.inc
333/etc/firejail/wine.profile
334/etc/firejail/wire.profile
335/etc/firejail/wireshark-gtk.profile
336/etc/firejail/wireshark-qt.profile
337/etc/firejail/wireshark.profile
338/etc/firejail/xchat.profile
339/etc/firejail/xed.profile
340/etc/firejail/xfburn.profile
341/etc/firejail/xfce4-dict.profile
342/etc/firejail/xfce4-notes.profile
343/etc/firejail/xiphos.profile
344/etc/firejail/xmms.profile
345/etc/firejail/xonotic-glx.profile
346/etc/firejail/xonotic-sdl.profile
347/etc/firejail/xonotic.profile
348/etc/firejail/xpdf.profile
349/etc/firejail/xplayer.profile
350/etc/firejail/xpra.profile
351/etc/firejail/xreader.profile
352/etc/firejail/xviewer.profile
353/etc/firejail/xz.profile
354/etc/firejail/xzdec.profile
355/etc/firejail/youtube-dl.profile
356/etc/firejail/zathura.profile
357/etc/firejail/zoom.profile
358/etc/firejail/yandex-browser.profile
359/etc/firejail/itch.profile
360/etc/firejail/whitelist-var-common.inc
361/etc/firejail/ffmpeg.profile
362/etc/firejail/Natron.profile
363/etc/firejail/Viber.profile
364/etc/firejail/amule.profile
365/etc/firejail/arch-audit.profile
366/etc/firejail/ardour4.profile
367/etc/firejail/ardour5.profile
368/etc/firejail/bluefish.profile
369/etc/firejail/brackets.profile
370/etc/firejail/calligra.profile
371/etc/firejail/calligraauthor.profile
372/etc/firejail/calligraconverter.profile
373/etc/firejail/calligraflow.profile
374/etc/firejail/calligraplan.profile
375/etc/firejail/calligraplanwork.profile
376/etc/firejail/calligrasheets.profile
377/etc/firejail/cin.profile
378/etc/firejail/calligrastage.profile
379/etc/firejail/calligrawords.profile
380/etc/firejail/cinelerra.profile
381/etc/firejail/clamav.profile
382/etc/firejail/clamdscan.profile
383/etc/firejail/clamdtop.profile
384/etc/firejail/clamscan.profile
385/etc/firejail/cliqz.profile
386/etc/firejail/conky.profile
387/etc/firejail/dooble-qt4.profile
388/etc/firejail/dooble.profile
389/etc/firejail/fetchmail.profile
390/etc/firejail/freecad.profile
391/etc/firejail/freecadcmd.profile
392/etc/firejail/freshclam.profile
393/etc/firejail/google-earth.profile
394/etc/firejail/imagej.profile
395/etc/firejail/karbon.profile
396/etc/firejail/kdenlive.profile
397/etc/firejail/krita.profile
398/etc/firejail/linphone.profile
399/etc/firejail/lmms.profile
400/etc/firejail/macrofusion.profile
401/etc/firejail/mpd.profile
402/etc/firejail/natron.profile
403/etc/firejail/openshot-qt.profile
404/etc/firejail/pinta.profile
405/etc/firejail/ricochet.profile
406/etc/firejail/rocketchat.profile
407/etc/firejail/shotcut.profile
408/etc/firejail/smtube.profile
409/etc/firejail/surf.profile
410/etc/firejail/teamspeak3.profile
411/etc/firejail/terasology.profile
412/etc/firejail/tor-browser-en.profile
413/etc/firejail/tor.profile
414/etc/firejail/uefitool.profile
415/etc/firejail/x-terminal-emulator.profile
416/etc/firejail/xmr-stak-cpu.profile
417/etc/firejail/zart.profile
diff --git a/platform/debian/control b/platform/debian/control.amd64
index 4161cbfb2..f666200d5 100644
--- a/platform/debian/control
+++ b/platform/debian/control.amd64
@@ -1,13 +1,13 @@
1Package: firejail 1Package: firejail
2Version: FIREJAILVER-1 2Version: FIREJAILVER-1
3Architecture: amd64 3Architecture: amd64
4Maintainer: netblue30 <netblue30@yahoo.com> 4Maintainer: netblue30 <netblue30@protonmail.com>
5Installed-Size: 2024 5Installed-Size: 2024
6Depends: libc6 6Depends: libc6
7Suggests: python, python3 7Suggests: python, python3
8Section: admin 8Section: admin
9Priority: extra 9Priority: optional
10Homepage: http://github.com/netblue30/firejail 10Homepage: https://github.com/netblue30/firejail
11Description: Linux namepaces sandbox program. 11Description: Linux namepaces sandbox program.
12 Firejail is a SUID sandbox program that reduces the risk of security 12 Firejail is a SUID sandbox program that reduces the risk of security
13 breaches by restricting the running environment of untrusted applications 13 breaches by restricting the running environment of untrusted applications
diff --git a/platform/debian/control.i386 b/platform/debian/control.i386
new file mode 100644
index 000000000..ab9e0fc52
--- /dev/null
+++ b/platform/debian/control.i386
@@ -0,0 +1,20 @@
1Package: firejail
2Version: FIREJAILVER-1
3Architecture: i386
4Maintainer: netblue30 <netblue30@protonmail.com>
5Installed-Size: 2024
6Depends: libc6
7Suggests: python, python3
8Section: admin
9Priority: optional
10Homepage: https://github.com/netblue30/firejail
11Description: Linux namepaces sandbox program.
12 Firejail is a SUID sandbox program that reduces the risk of security
13 breaches by restricting the running environment of untrusted applications
14 using Linux namespaces and seccmp-bpf. It includes sandbox profiles for
15 Iceweasel/Mozilla Firefox, Chromium, Midori, Opera, Evince, Transmission
16 and VLC.
17 .
18 Firejail also expands the restricted shell facility found in bash by
19 adding Linux namespace support. It also supports sandboxing SSH users
20 upon login.
diff --git a/platform/debian/copyright b/platform/debian/copyright
index 83952080f..d4bdb1283 100644
--- a/platform/debian/copyright
+++ b/platform/debian/copyright
@@ -7,7 +7,7 @@ This is the Debian/Ubuntu prepackaged version of firejail.
7 and networking stack isolation, and it runs on any recent Linux system. It 7 and networking stack isolation, and it runs on any recent Linux system. It
8 includes a sandbox profile for Mozilla Firefox. 8 includes a sandbox profile for Mozilla Firefox.
9 9
10 Copyright (C) 2014-2017 Firejail Authors (see README file for more details) 10 Copyright (C) 2014-2021 Firejail Authors (see README file for more details)
11 11
12 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
@@ -26,4 +26,4 @@ This is the Debian/Ubuntu prepackaged version of firejail.
26The complete text of the GNU General Public License can be found 26The complete text of the GNU General Public License can be found
27in /usr/share/common-licenses/GPL-2. 27in /usr/share/common-licenses/GPL-2.
28 28
29Homepage: http://github.com/netblue30/firejail. 29Homepage: https://github.com/netblue30/firejail.
diff --git a/platform/rpm/firejail.spec b/platform/rpm/firejail.spec
index 382f85bb2..86cd6006e 100644
--- a/platform/rpm/firejail.spec
+++ b/platform/rpm/firejail.spec
@@ -1,17 +1,17 @@
1Name: __NAME__ 1Name: __NAME__
2Version: __VERSION__ 2Version: __VERSION__
3Release: 1 3Release: 1
4Summary: Linux namepaces sandbox program 4Summary: Linux namespaces sandbox program
5 5
6License: GPLv2+ 6License: GPLv2+
7Group: Development/Tools 7Group: Development/Tools
8Source0: https://github.com/netblue30/firejail/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz 8Source0: https://github.com/netblue30/firejail/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
9URL: http://github.com/netblue30/firejail 9URL: https://github.com/netblue30/firejail
10 10
11BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 11BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
12 12
13%description 13%description
14Firejail is a SUID sandbox program that reduces the risk of security 14Firejail is a SUID sandbox program that reduces the risk of security
15breaches by restricting the running environment of untrusted applications 15breaches by restricting the running environment of untrusted applications
16using Linux namespaces. It includes a sandbox profile for Mozilla Firefox. 16using Linux namespaces. It includes a sandbox profile for Mozilla Firefox.
17 17
@@ -19,7 +19,7 @@ using Linux namespaces. It includes a sandbox profile for Mozilla Firefox.
19%setup -q 19%setup -q
20 20
21%build 21%build
22%configure --disable-userns 22%configure __CONFIG_OPT__
23make %{?_smp_mflags} 23make %{?_smp_mflags}
24 24
25%install 25%install
@@ -35,19 +35,18 @@ rm -rf %{buildroot}
35%attr(4755, -, -) %{_bindir}/__NAME__ 35%attr(4755, -, -) %{_bindir}/__NAME__
36%{_bindir}/firecfg 36%{_bindir}/firecfg
37%{_bindir}/firemon 37%{_bindir}/firemon
38%{_libdir}/__NAME__/firecfg.config 38%{_bindir}/jailcheck
39%{_libdir}/__NAME__/ftee 39%{_libdir}/__NAME__
40%{_libdir}/__NAME__/faudit
41%{_libdir}/__NAME__/fshaper.sh
42%{_libdir}/__NAME__/libtrace.so
43%{_libdir}/__NAME__/libtracelog.so
44%{_datarootdir}/bash-completion/completions/__NAME__ 40%{_datarootdir}/bash-completion/completions/__NAME__
45%{_datarootdir}/bash-completion/completions/firecfg 41%{_datarootdir}/bash-completion/completions/firecfg
46%{_datarootdir}/bash-completion/completions/firemon 42%{_datarootdir}/bash-completion/completions/firemon
43%{_datarootdir}/zsh/site-functions/_firejail
47%{_docdir}/__NAME__ 44%{_docdir}/__NAME__
48%{_mandir}/man1/__NAME__.1.gz 45%{_mandir}/man1/__NAME__.1.gz
49%{_mandir}/man1/firecfg.1.gz 46%{_mandir}/man1/firecfg.1.gz
50%{_mandir}/man1/firemon.1.gz 47%{_mandir}/man1/firemon.1.gz
48%{_mandir}/man1/jailcheck.1.gz
51%{_mandir}/man5/__NAME__-login.5.gz 49%{_mandir}/man5/__NAME__-login.5.gz
52%{_mandir}/man5/__NAME__-profile.5.gz 50%{_mandir}/man5/__NAME__-profile.5.gz
53%config %{_sysconfdir}/__NAME__ 51%{_mandir}/man5/__NAME__-users.5.gz
52%config(noreplace) %{_sysconfdir}/__NAME__
diff --git a/platform/rpm/mkrpm.sh b/platform/rpm/mkrpm.sh
index b63340e43..b8470dd71 100755
--- a/platform/rpm/mkrpm.sh
+++ b/platform/rpm/mkrpm.sh
@@ -1,6 +1,9 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# Usage: ./platform/rpm/mkrpm.sh firejail <version> 6# Usage: ./platform/rpm/mkrpm.sh firejail <version> "<config options>"
4# 7#
5# Builds rpms in a temporary directory then places the result in the 8# Builds rpms in a temporary directory then places the result in the
6# current working directory. 9# current working directory.
@@ -8,6 +11,7 @@
8name=$1 11name=$1
9# Strip any trailing prefix from the version like -rc1 etc 12# Strip any trailing prefix from the version like -rc1 etc
10version=$(echo "$2" | sed 's/\-.*//g') 13version=$(echo "$2" | sed 's/\-.*//g')
14config_opt=$3
11 15
12if [[ ! -f platform/rpm/${name}.spec ]]; then 16if [[ ! -f platform/rpm/${name}.spec ]]; then
13 echo error: spec file not found for name \"${name}\" 17 echo error: spec file not found for name \"${name}\"
@@ -19,6 +23,10 @@ if [[ -z "${version}" ]]; then
19 exit 1 23 exit 1
20fi 24fi
21 25
26if [[ -z "${config_opt}" ]]; then
27 config_opt="--disable-userns --disable-contrib-install"
28fi
29
22# Make a temporary directory and arrange to clean up on exit 30# Make a temporary directory and arrange to clean up on exit
23tmpdir=$(mktemp -d) 31tmpdir=$(mktemp -d)
24mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} 32mkdir -p ${tmpdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
@@ -29,11 +37,14 @@ trap cleanup EXIT
29 37
30# Create the spec file 38# Create the spec file
31tmp_spec_file=${tmpdir}/SPECS/${name}.spec 39tmp_spec_file=${tmpdir}/SPECS/${name}.spec
32sed -e "s/__NAME__/${name}/g" -e "s/__VERSION__/${version}/g" platform/rpm/${name}.spec >${tmp_spec_file} 40sed -e "s/__NAME__/${name}/g" \
41 -e "s/__VERSION__/${version}/g" \
42 -e "s/__CONFIG_OPT__/${config_opt}/g" \
43 platform/rpm/${name}.spec >${tmp_spec_file}
33# FIXME: We could parse RELNOTES and create a %changelog section here 44# FIXME: We could parse RELNOTES and create a %changelog section here
34 45
35# Copy the source to build into a tarball 46# Copy the source to build into a tarball
36tar czf ${tmpdir}/SOURCES/${name}-${version}.tar.gz . --transform "s/^./${name}-${version}/" --exclude='./.git*' --exclude='./test*' 47tar --exclude='./.git*' --transform "s/^./${name}-${version}/" -czf ${tmpdir}/SOURCES/${name}-${version}.tar.gz .
37 48
38# Build the files (rpm, debug rpm and source rpm) 49# Build the files (rpm, debug rpm and source rpm)
39rpmbuild --quiet --define "_topdir ${tmpdir}" -ba ${tmp_spec_file} 50rpmbuild --quiet --define "_topdir ${tmpdir}" -ba ${tmp_spec_file}
diff --git a/platform/rpm/old-mkrpm.sh b/platform/rpm/old-mkrpm.sh
deleted file mode 100755
index 13049f736..000000000
--- a/platform/rpm/old-mkrpm.sh
+++ /dev/null
@@ -1,667 +0,0 @@
1#!/bin/bash
2VERSION="0.9.51"
3rm -fr ~/rpmbuild
4rm -f firejail-$VERSION-1.x86_64.rpm
5
6mkdir -p ~/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}
7cat <<EOF >~/.rpmmacros
8%_topdir %(echo $HOME)/rpmbuild
9%_tmppath %{_topdir}/tmp
10EOF
11
12cd ~/rpmbuild
13echo "building directory tree"
14
15mkdir -p firejail-$VERSION/usr/bin
16install -m 755 /usr/bin/firejail firejail-$VERSION/usr/bin/.
17install -m 755 /usr/bin/firemon firejail-$VERSION/usr/bin/.
18install -m 755 /usr/bin/firecfg firejail-$VERSION/usr/bin/.
19
20mkdir -p firejail-$VERSION/usr/lib/firejail
21install -m 755 /usr/lib/firejail/faudit firejail-$VERSION/usr/lib/firejail/.
22install -m 755 /usr/lib/firejail/fcopy firejail-$VERSION/usr/lib/firejail/.
23install -m 755 /usr/lib/firejail/fgit-install.sh firejail-$VERSION/usr/lib/firejail/.
24install -m 755 /usr/lib/firejail/fgit-uninstall.sh firejail-$VERSION/usr/lib/firejail/.
25install -m 644 /usr/lib/firejail/firecfg.config firejail-$VERSION/usr/lib/firejail/.
26# Python 3 is not available on CentOS
27#install -m 755 /usr/lib/firejail/fix_private-bin.py firejail-$VERSION/usr/lib/firejail/.
28#install -m 755 /usr/lib/firejail/fjclip.py firejail-$VERSION/usr/lib/firejail/.
29#install -m 755 /usr/lib/firejail/fjdisplay.py firejail-$VERSION/usr/lib/firejail/.
30#install -m 755 /usr/lib/firejail/fjresize.py firejail-$VERSION/usr/lib/firejail/.
31install -m 755 /usr/lib/firejail/fldd firejail-$VERSION/usr/lib/firejail/.
32install -m 755 /usr/lib/firejail/fnet firejail-$VERSION/usr/lib/firejail/.
33install -m 755 /usr/lib/firejail/fseccomp firejail-$VERSION/usr/lib/firejail/.
34install -m 755 /usr/lib/firejail/fshaper.sh firejail-$VERSION/usr/lib/firejail/.
35install -m 755 /usr/lib/firejail/ftee firejail-$VERSION/usr/lib/firejail/.
36install -m 755 /usr/lib/firejail/fbuilder firejail-$VERSION/usr/lib/firejail/.
37install -m 644 /usr/lib/firejail/libtracelog.so firejail-$VERSION/usr/lib/firejail/.
38install -m 644 /usr/lib/firejail/libtrace.so firejail-$VERSION/usr/lib/firejail/.
39install -m 644 /usr/lib/firejail/libpostexecseccomp.so firejail-$VERSION/usr/lib/firejail/.
40install -m 644 /usr/lib/firejail/seccomp firejail-$VERSION/usr/lib/firejail/.
41install -m 644 /usr/lib/firejail/seccomp.64 firejail-$VERSION/usr/lib/firejail/.
42install -m 644 /usr/lib/firejail/seccomp.debug firejail-$VERSION/usr/lib/firejail/.
43install -m 644 /usr/lib/firejail/seccomp.32 firejail-$VERSION/usr/lib/firejail/.
44install -m 644 /usr/lib/firejail/seccomp.block_secondary firejail-$VERSION/usr/lib/firejail/.
45install -m 644 /usr/lib/firejail/seccomp.mdwx firejail-$VERSION/usr/lib/firejail/.
46
47mkdir -p firejail-$VERSION/usr/share/man/man1
48install -m 644 /usr/share/man/man1/firejail.1.gz firejail-$VERSION/usr/share/man/man1/.
49install -m 644 /usr/share/man/man1/firemon.1.gz firejail-$VERSION/usr/share/man/man1/.
50install -m 644 /usr/share/man/man1/firecfg.1.gz firejail-$VERSION/usr/share/man/man1/.
51
52mkdir -p firejail-$VERSION/usr/share/man/man5
53install -m 644 /usr/share/man/man5/firejail-profile.5.gz firejail-$VERSION/usr/share/man/man5/.
54install -m 644 /usr/share/man/man5/firejail-login.5.gz firejail-$VERSION/usr/share/man/man5/.
55
56mkdir -p firejail-$VERSION/usr/share/doc/packages/firejail
57install -m 644 /usr/share/doc/firejail/COPYING firejail-$VERSION/usr/share/doc/packages/firejail/.
58install -m 644 /usr/share/doc/firejail/README firejail-$VERSION/usr/share/doc/packages/firejail/.
59install -m 644 /usr/share/doc/firejail/RELNOTES firejail-$VERSION/usr/share/doc/packages/firejail/.
60
61mkdir -p firejail-$VERSION/etc/firejail
62install -m 644 /etc/firejail/* firejail-$VERSION/etc/firejail/.
63
64mkdir -p firejail-$VERSION/usr/share/bash-completion/completions
65install -m 644 /usr/share/bash-completion/completions/firejail firejail-$VERSION/usr/share/bash-completion/completions/.
66install -m 644 /usr/share/bash-completion/completions/firemon firejail-$VERSION/usr/share/bash-completion/completions/.
67install -m 644 /usr/share/bash-completion/completions/firecfg firejail-$VERSION/usr/share/bash-completion/completions/.
68
69echo "building tar.gz archive"
70tar -czvf firejail-$VERSION.tar.gz firejail-$VERSION
71
72cp firejail-$VERSION.tar.gz SOURCES/.
73
74echo "building config spec"
75cat <<EOF > SPECS/firejail.spec
76%define __spec_install_post %{nil}
77%define debug_package %{nil}
78%define __os_install_post %{_dbpath}/brp-compress
79
80Summary: Linux namepaces sandbox program
81Name: firejail
82Version: $VERSION
83Release: 1
84License: GPL+
85Group: Development/Tools
86SOURCE0 : %{name}-%{version}.tar.gz
87URL: http://firejail.wordpress.com
88
89BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
90
91%description
92Firejail is a SUID sandbox program that reduces the risk of security
93breaches by restricting the running environment of untrusted applications
94using Linux namespaces. It includes a sandbox profile for Mozilla Firefox.
95
96%prep
97%setup -q
98
99%build
100
101%install
102rm -rf %{buildroot}
103mkdir -p %{buildroot}
104
105cp -a * %{buildroot}
106
107
108%clean
109rm -rf %{buildroot}
110
111%files
112%defattr(-,root,root,-)
113%{_sysconfdir}/%{name}/0ad.profile
114%{_sysconfdir}/%{name}/abrowser.profile
115%{_sysconfdir}/%{name}/atom-beta.profile
116%{_sysconfdir}/%{name}/atom.profile
117%{_sysconfdir}/%{name}/atril.profile
118%{_sysconfdir}/%{name}/audacious.profile
119%{_sysconfdir}/%{name}/audacity.profile
120%{_sysconfdir}/%{name}/aweather.profile
121%{_sysconfdir}/%{name}/bitlbee.profile
122%{_sysconfdir}/%{name}/brave.profile
123%{_sysconfdir}/%{name}/cherrytree.profile
124%{_sysconfdir}/%{name}/chromium-browser.profile
125%{_sysconfdir}/%{name}/chromium.profile
126%{_sysconfdir}/%{name}/clementine.profile
127%{_sysconfdir}/%{name}/cmus.profile
128%{_sysconfdir}/%{name}/conkeror.profile
129%{_sysconfdir}/%{name}/corebird.profile
130%{_sysconfdir}/%{name}/cpio.profile
131%{_sysconfdir}/%{name}/cyberfox.profile
132%{_sysconfdir}/%{name}/Cyberfox.profile
133%{_sysconfdir}/%{name}/deadbeef.profile
134%{_sysconfdir}/%{name}/default.profile
135%{_sysconfdir}/%{name}/deluge.profile
136%{_sysconfdir}/%{name}/dillo.profile
137%{_sysconfdir}/%{name}/disable-common.inc
138%{_sysconfdir}/%{name}/disable-devel.inc
139%{_sysconfdir}/%{name}/disable-passwdmgr.inc
140%{_sysconfdir}/%{name}/disable-programs.inc
141%{_sysconfdir}/%{name}/dnscrypt-proxy.profile
142%{_sysconfdir}/%{name}/dnsmasq.profile
143%{_sysconfdir}/%{name}/dosbox.profile
144%{_sysconfdir}/%{name}/dropbox.profile
145%{_sysconfdir}/%{name}/empathy.profile
146%{_sysconfdir}/%{name}/eom.profile
147%{_sysconfdir}/%{name}/epiphany.profile
148%{_sysconfdir}/%{name}/evince.profile
149%{_sysconfdir}/%{name}/fbreader.profile
150%{_sysconfdir}/%{name}/file.profile
151%{_sysconfdir}/%{name}/filezilla.profile
152%{_sysconfdir}/%{name}/firefox-esr.profile
153%{_sysconfdir}/%{name}/firefox.profile
154%config(noreplace) %{_sysconfdir}/%{name}/firejail.config
155%{_sysconfdir}/%{name}/flashpeak-slimjet.profile
156%{_sysconfdir}/%{name}/franz.profile
157%{_sysconfdir}/%{name}/gajim.profile
158%{_sysconfdir}/%{name}/gitter.profile
159%{_sysconfdir}/%{name}/gnome-chess.profile
160%{_sysconfdir}/%{name}/gnome-mplayer.profile
161%{_sysconfdir}/%{name}/google-chrome-beta.profile
162%{_sysconfdir}/%{name}/google-chrome.profile
163%{_sysconfdir}/%{name}/google-chrome-stable.profile
164%{_sysconfdir}/%{name}/google-chrome-unstable.profile
165%{_sysconfdir}/%{name}/google-play-music-desktop-player.profile
166%{_sysconfdir}/%{name}/gpredict.profile
167%{_sysconfdir}/%{name}/gtar.profile
168%{_sysconfdir}/%{name}/gthumb.profile
169%{_sysconfdir}/%{name}/gwenview.profile
170%{_sysconfdir}/%{name}/gzip.profile
171%{_sysconfdir}/%{name}/hedgewars.profile
172%{_sysconfdir}/%{name}/hexchat.profile
173%{_sysconfdir}/%{name}/icecat.profile
174%{_sysconfdir}/%{name}/icedove.profile
175%{_sysconfdir}/%{name}/iceweasel.profile
176%{_sysconfdir}/%{name}/inox.profile
177%{_sysconfdir}/%{name}/jitsi.profile
178%{_sysconfdir}/%{name}/kmail.profile
179%{_sysconfdir}/%{name}/konversation.profile
180%{_sysconfdir}/%{name}/less.profile
181%{_sysconfdir}/%{name}/libreoffice.profile
182%{_sysconfdir}/%{name}/localc.profile
183%{_sysconfdir}/%{name}/lodraw.profile
184%{_sysconfdir}/%{name}/loffice.profile
185%{_sysconfdir}/%{name}/lofromtemplate.profile
186%config(noreplace) %{_sysconfdir}/%{name}/login.users
187%{_sysconfdir}/%{name}/loimpress.profile
188%{_sysconfdir}/%{name}/lomath.profile
189%{_sysconfdir}/%{name}/loweb.profile
190%{_sysconfdir}/%{name}/lowriter.profile
191%{_sysconfdir}/%{name}/lxterminal.profile
192%{_sysconfdir}/%{name}/mathematica.profile
193%{_sysconfdir}/%{name}/Mathematica.profile
194%{_sysconfdir}/%{name}/mcabber.profile
195%{_sysconfdir}/%{name}/midori.profile
196%{_sysconfdir}/%{name}/mpv.profile
197%{_sysconfdir}/%{name}/mupen64plus.profile
198%{_sysconfdir}/%{name}/netsurf.profile
199%{_sysconfdir}/%{name}/nolocal.net
200%{_sysconfdir}/%{name}/okular.profile
201%{_sysconfdir}/%{name}/openbox.profile
202%{_sysconfdir}/%{name}/opera-beta.profile
203%{_sysconfdir}/%{name}/opera.profile
204%{_sysconfdir}/%{name}/palemoon.profile
205%{_sysconfdir}/%{name}/parole.profile
206%{_sysconfdir}/%{name}/pidgin.profile
207%{_sysconfdir}/%{name}/pix.profile
208%{_sysconfdir}/%{name}/polari.profile
209%{_sysconfdir}/%{name}/psi-plus.profile
210%{_sysconfdir}/%{name}/qbittorrent.profile
211%{_sysconfdir}/%{name}/qtox.profile
212%{_sysconfdir}/%{name}/quassel.profile
213%{_sysconfdir}/%{name}/quiterss.profile
214%{_sysconfdir}/%{name}/qutebrowser.profile
215%{_sysconfdir}/%{name}/rhythmbox.profile
216%{_sysconfdir}/%{name}/rtorrent.profile
217%{_sysconfdir}/%{name}/seamonkey-bin.profile
218%{_sysconfdir}/%{name}/seamonkey.profile
219%{_sysconfdir}/%{name}/server.profile
220%{_sysconfdir}/%{name}/skypeforlinux.profile
221%{_sysconfdir}/%{name}/skype.profile
222%{_sysconfdir}/%{name}/slack.profile
223%{_sysconfdir}/%{name}/snap.profile
224%{_sysconfdir}/%{name}/soffice.profile
225%{_sysconfdir}/%{name}/spotify.profile
226%{_sysconfdir}/%{name}/ssh.profile
227%{_sysconfdir}/%{name}/steam.profile
228%{_sysconfdir}/%{name}/stellarium.profile
229%{_sysconfdir}/%{name}/strings.profile
230%{_sysconfdir}/%{name}/tar.profile
231%{_sysconfdir}/%{name}/telegram.profile
232%{_sysconfdir}/%{name}/Telegram.profile
233%{_sysconfdir}/%{name}/thunderbird.profile
234%{_sysconfdir}/%{name}/totem.profile
235%{_sysconfdir}/%{name}/transmission-gtk.profile
236%{_sysconfdir}/%{name}/transmission-qt.profile
237%{_sysconfdir}/%{name}/uget-gtk.profile
238%{_sysconfdir}/%{name}/unbound.profile
239%{_sysconfdir}/%{name}/unrar.profile
240%{_sysconfdir}/%{name}/unzip.profile
241%{_sysconfdir}/%{name}/uudeview.profile
242%{_sysconfdir}/%{name}/vivaldi-beta.profile
243%{_sysconfdir}/%{name}/vivaldi.profile
244%{_sysconfdir}/%{name}/vlc.profile
245%{_sysconfdir}/%{name}/warzone2100.profile
246%{_sysconfdir}/%{name}/webserver.net
247%{_sysconfdir}/%{name}/weechat-curses.profile
248%{_sysconfdir}/%{name}/weechat.profile
249%{_sysconfdir}/%{name}/wesnoth.profile
250%{_sysconfdir}/%{name}/whitelist-common.inc
251%{_sysconfdir}/%{name}/wine.profile
252%{_sysconfdir}/%{name}/xchat.profile
253%{_sysconfdir}/%{name}/xplayer.profile
254%{_sysconfdir}/%{name}/xreader.profile
255%{_sysconfdir}/%{name}/xviewer.profile
256%{_sysconfdir}/%{name}/xzdec.profile
257%{_sysconfdir}/%{name}/xz.profile
258%{_sysconfdir}/%{name}/zathura.profile
259%{_sysconfdir}/%{name}/7z.profile
260%{_sysconfdir}/%{name}/keepass.profile
261%{_sysconfdir}/%{name}/keepassx.profile
262%{_sysconfdir}/%{name}/claws-mail.profile
263%{_sysconfdir}/%{name}/mutt.profile
264%{_sysconfdir}/%{name}/git.profile
265%{_sysconfdir}/%{name}/emacs.profile
266%{_sysconfdir}/%{name}/vim.profile
267%{_sysconfdir}/%{name}/xpdf.profile
268%{_sysconfdir}/%{name}/virtualbox.profile
269%{_sysconfdir}/%{name}/openshot.profile
270%{_sysconfdir}/%{name}/flowblade.profile
271%{_sysconfdir}/%{name}/eog.profile
272%{_sysconfdir}/%{name}/evolution.profile
273%{_sysconfdir}/%{name}/feh.profile
274%{_sysconfdir}/%{name}/inkscape.profile
275%{_sysconfdir}/%{name}/gimp.profile
276%{_sysconfdir}/%{name}/luminance-hdr.profile
277%{_sysconfdir}/%{name}/mupdf.profile
278%{_sysconfdir}/%{name}/qpdfview.profile
279%{_sysconfdir}/%{name}/ranger.profile
280%{_sysconfdir}/%{name}/synfigstudio.profile
281# 0.9.45
282%{_sysconfdir}/%{name}/Cryptocat.profile
283%{_sysconfdir}/%{name}/FossaMail.profile
284%{_sysconfdir}/%{name}/Thunar.profile
285%{_sysconfdir}/%{name}/VirtualBox.profile
286%{_sysconfdir}/%{name}/Wire.profile
287%{_sysconfdir}/%{name}/amarok.profile
288%{_sysconfdir}/%{name}/ark.profile
289%{_sysconfdir}/%{name}/atool.profile
290%{_sysconfdir}/%{name}/bleachbit.profile
291%{_sysconfdir}/%{name}/bless.profile
292%{_sysconfdir}/%{name}/brasero.profile
293%{_sysconfdir}/%{name}/cryptocat.profile
294%{_sysconfdir}/%{name}/cvlc.profile
295%{_sysconfdir}/%{name}/display.profile
296%{_sysconfdir}/%{name}/dolphin.profile
297%{_sysconfdir}/%{name}/dragon.profile
298%{_sysconfdir}/%{name}/elinks.profile
299%{_sysconfdir}/%{name}/enchant.profile
300%{_sysconfdir}/%{name}/engrampa.profile
301%{_sysconfdir}/%{name}/exiftool.profile
302%{_sysconfdir}/%{name}/file-roller.profile
303%{_sysconfdir}/%{name}/fossamail.profile
304%{_sysconfdir}/%{name}/gedit.profile
305%{_sysconfdir}/%{name}/geeqie.profile
306%{_sysconfdir}/%{name}/gjs.profile
307%{_sysconfdir}/%{name}/gnome-2048.profile
308%{_sysconfdir}/%{name}/gnome-books.profile
309%{_sysconfdir}/%{name}/gnome-calculator.profile
310%{_sysconfdir}/%{name}/gnome-clocks.profile
311%{_sysconfdir}/%{name}/gnome-contacts.profile
312%{_sysconfdir}/%{name}/gnome-documents.profile
313%{_sysconfdir}/%{name}/gnome-maps.profile
314%{_sysconfdir}/%{name}/gnome-music.profile
315%{_sysconfdir}/%{name}/gnome-photos.profile
316%{_sysconfdir}/%{name}/gnome-weather.profile
317%{_sysconfdir}/%{name}/goobox.profile
318%{_sysconfdir}/%{name}/gpa.profile
319%{_sysconfdir}/%{name}/gpg-agent.profile
320%{_sysconfdir}/%{name}/gpg.profile
321%{_sysconfdir}/%{name}/gpicview.profile
322%{_sysconfdir}/%{name}/guayadeque.profile
323%{_sysconfdir}/%{name}/highlight.profile
324%{_sysconfdir}/%{name}/img2txt.profile
325%{_sysconfdir}/%{name}/iridium-browser.profile
326%{_sysconfdir}/%{name}/iridium.profile
327%{_sysconfdir}/%{name}/jd-gui.profile
328%{_sysconfdir}/%{name}/k3b.profile
329%{_sysconfdir}/%{name}/kate.profile
330%{_sysconfdir}/%{name}/keepass2.profile
331%{_sysconfdir}/%{name}/keepassx2.profile
332%{_sysconfdir}/%{name}/keepassxc.profile
333%{_sysconfdir}/%{name}/kino.profile
334%{_sysconfdir}/%{name}/lollypop.profile
335%{_sysconfdir}/%{name}/lynx.profile
336%{_sysconfdir}/%{name}/mediainfo.profile
337%{_sysconfdir}/%{name}/mediathekview.profile
338%{_sysconfdir}/%{name}/mousepad.profile
339%{_sysconfdir}/%{name}/multimc5.profile
340%{_sysconfdir}/%{name}/mumble.profile
341%{_sysconfdir}/%{name}/nautilus.profile
342%{_sysconfdir}/%{name}/odt2txt.profile
343%{_sysconfdir}/%{name}/pdfsam.profile
344%{_sysconfdir}/%{name}/pdftotext.profile
345%{_sysconfdir}/%{name}/pithos.profile
346%{_sysconfdir}/%{name}/pluma.profile
347%{_sysconfdir}/%{name}/qemu-launcher.profile
348%{_sysconfdir}/%{name}/qemu-system-x86_64.profile
349%{_sysconfdir}/%{name}/qupzilla.profile
350%{_sysconfdir}/%{name}/scribus.profile
351%{_sysconfdir}/%{name}/simple-scan.profile
352%{_sysconfdir}/%{name}/skanlite.profile
353%{_sysconfdir}/%{name}/ssh-agent.profile
354%{_sysconfdir}/%{name}/start-tor-browser.profile
355%{_sysconfdir}/%{name}/thunar.profile
356%{_sysconfdir}/%{name}/tracker.profile
357%{_sysconfdir}/%{name}/transmission-cli.profile
358%{_sysconfdir}/%{name}/transmission-show.profile
359%{_sysconfdir}/%{name}/uzbl-browser.profile
360%{_sysconfdir}/%{name}/vivaldi-stable.profile
361%{_sysconfdir}/%{name}/w3m.profile
362%{_sysconfdir}/%{name}/wget.profile
363%{_sysconfdir}/%{name}/wire.profile
364%{_sysconfdir}/%{name}/wireshark.profile
365%{_sysconfdir}/%{name}/xed.profile
366%{_sysconfdir}/%{name}/xfburn.profile
367%{_sysconfdir}/%{name}/xiphos.profile
368%{_sysconfdir}/%{name}/xmms.profile
369%{_sysconfdir}/%{name}/xonotic-glx.profile
370%{_sysconfdir}/%{name}/xonotic-sdl.profile
371%{_sysconfdir}/%{name}/xonotic.profile
372%{_sysconfdir}/%{name}/xpra.profile
373%{_sysconfdir}/%{name}/zoom.profile
374%{_sysconfdir}/%{name}/2048-qt.profile
375%{_sysconfdir}/%{name}/Xephyr.profile
376%{_sysconfdir}/%{name}/Xvfb.profile
377%{_sysconfdir}/%{name}/akregator.profile
378%{_sysconfdir}/%{name}/arduino.profile
379%{_sysconfdir}/%{name}/baloo_file.profile
380%{_sysconfdir}/%{name}/bibletime.profile
381%{_sysconfdir}/%{name}/blender.profile
382%{_sysconfdir}/%{name}/caja.profile
383%{_sysconfdir}/%{name}/clipit.profile
384%{_sysconfdir}/%{name}/dia.profile
385%{_sysconfdir}/%{name}/dino.profile
386%{_sysconfdir}/%{name}/fontforge.profile
387%{_sysconfdir}/%{name}/galculator.profile
388%{_sysconfdir}/%{name}/geany.profile
389%{_sysconfdir}/%{name}/gimp-2.8.profile
390%{_sysconfdir}/%{name}/globaltime.profile
391%{_sysconfdir}/%{name}/gnome-font-viewer.profile
392%{_sysconfdir}/%{name}/gucharmap.profile
393%{_sysconfdir}/%{name}/hugin.profile
394%{_sysconfdir}/%{name}/kcalc.profile
395%{_sysconfdir}/%{name}/knotes.profile
396%{_sysconfdir}/%{name}/kodi.profile
397%{_sysconfdir}/%{name}/ktorrent.profile
398%{_sysconfdir}/%{name}/leafpad.profile
399%{_sysconfdir}/%{name}/lximage-qt.profile
400%{_sysconfdir}/%{name}/lxmusic.profile
401%{_sysconfdir}/%{name}/mate-calc.profile
402%{_sysconfdir}/%{name}/mate-calculator.profile
403%{_sysconfdir}/%{name}/mate-color-select.profile
404%{_sysconfdir}/%{name}/mate-dictionary.profile
405%{_sysconfdir}/%{name}/meld.profile
406%{_sysconfdir}/%{name}/nemo.profile
407%{_sysconfdir}/%{name}/nylas.profile
408%{_sysconfdir}/%{name}/orage.profile
409%{_sysconfdir}/%{name}/pcmanfm.profile
410%{_sysconfdir}/%{name}/qlipper.profile
411%{_sysconfdir}/%{name}/ristretto.profile
412%{_sysconfdir}/%{name}/viewnior.profile
413%{_sysconfdir}/%{name}/viking.profile
414%{_sysconfdir}/%{name}/xfce4-dict.profile
415%{_sysconfdir}/%{name}/xfce4-notes.profile
416%{_sysconfdir}/%{name}/youtube-dl.profile
417%{_sysconfdir}/%{name}/catfish.profile
418%{_sysconfdir}/%{name}/darktable.profile
419%{_sysconfdir}/%{name}/digikam.profile
420%{_sysconfdir}/%{name}/handbrake.profile
421%{_sysconfdir}/%{name}/vym.profile
422%{_sysconfdir}/%{name}/waterfox.profile
423# 0.9.49
424%{_sysconfdir}/%{name}/Gitter.profile
425%{_sysconfdir}/%{name}/android-studio.profile
426%{_sysconfdir}/%{name}/apktool.profile
427%{_sysconfdir}/%{name}/arm.profile
428%{_sysconfdir}/%{name}/baobab.profile
429%{_sysconfdir}/%{name}/calibre.profile
430%{_sysconfdir}/%{name}/curl.profile
431%{_sysconfdir}/%{name}/dex2jar.profile
432%{_sysconfdir}/%{name}/ebook-viewer.profile
433%{_sysconfdir}/%{name}/electron.profile
434%{_sysconfdir}/%{name}/etr.profile
435%{_sysconfdir}/%{name}/firefox-nightly.profile
436%{_sysconfdir}/%{name}/frozen-bubble.profile
437%{_sysconfdir}/%{name}/geary.profile
438%{_sysconfdir}/%{name}/ghb.profile
439%{_sysconfdir}/%{name}/gitg.profile
440%{_sysconfdir}/%{name}/gnome-twitch.profile
441%{_sysconfdir}/%{name}/handbrake-gtk.profile
442%{_sysconfdir}/%{name}/hashcat.profile
443%{_sysconfdir}/%{name}/idea.sh.profile
444%{_sysconfdir}/%{name}/kwrite.profile
445%{_sysconfdir}/%{name}/liferea.profile
446%{_sysconfdir}/%{name}/mplayer.profile
447%{_sysconfdir}/%{name}/musescore.profile
448%{_sysconfdir}/%{name}/neverball.profile
449%{_sysconfdir}/%{name}/obs.profile
450%{_sysconfdir}/%{name}/open-invaders.profile
451%{_sysconfdir}/%{name}/peek.profile
452%{_sysconfdir}/%{name}/picard.profile
453%{_sysconfdir}/%{name}/pingus.profile
454%{_sysconfdir}/%{name}/rambox.profile
455%{_sysconfdir}/%{name}/remmina.profile
456%{_sysconfdir}/%{name}/riot-web.profile
457%{_sysconfdir}/%{name}/sdat2img.profile
458%{_sysconfdir}/%{name}/silentarmy.profile
459%{_sysconfdir}/%{name}/simutrans.profile
460%{_sysconfdir}/%{name}/smplayer.profile
461%{_sysconfdir}/%{name}/soundconverter.profile
462%{_sysconfdir}/%{name}/sqlitebrowser.profile
463%{_sysconfdir}/%{name}/supertux2.profile
464%{_sysconfdir}/%{name}/telegram-desktop.profile
465%{_sysconfdir}/%{name}/torbrowser-launcher.profile
466%{_sysconfdir}/%{name}/truecraft.profile
467%{_sysconfdir}/%{name}/tuxguitar.profile
468%{_sysconfdir}/%{name}/unknown-horizons.profile
469%{_sysconfdir}/%{name}/wireshark-gtk.profile
470%{_sysconfdir}/%{name}/wireshark-qt.profile
471%{_sysconfdir}/%{name}/itch.profile
472%{_sysconfdir}/%{name}/minetest.profile
473%{_sysconfdir}/%{name}/yandex-browser.profile
474# 0.9.51
475%{_sysconfdir}/%{name}/Natron.profile
476%{_sysconfdir}/%{name}/Viber.profile
477%{_sysconfdir}/%{name}/amule.profile
478%{_sysconfdir}/%{name}/arch-audit.profile
479%{_sysconfdir}/%{name}/ardour4.profile
480%{_sysconfdir}/%{name}/ardour5.profile
481%{_sysconfdir}/%{name}/bluefish.profile
482%{_sysconfdir}/%{name}/brackets.profile
483%{_sysconfdir}/%{name}/calligra.profile
484%{_sysconfdir}/%{name}/calligraauthor.profile
485%{_sysconfdir}/%{name}/calligraconverter.profile
486%{_sysconfdir}/%{name}/calligraflow.profile
487%{_sysconfdir}/%{name}/calligraplan.profile
488%{_sysconfdir}/%{name}/calligraplanwork.profile
489%{_sysconfdir}/%{name}/calligrasheets.profile
490%{_sysconfdir}/%{name}/calligrastage.profile
491%{_sysconfdir}/%{name}/calligrawords.profile
492%{_sysconfdir}/%{name}/cin.profile
493%{_sysconfdir}/%{name}/cinelerra.profile
494%{_sysconfdir}/%{name}/clamav.profile
495%{_sysconfdir}/%{name}/clamdscan.profile
496%{_sysconfdir}/%{name}/clamdtop.profile
497%{_sysconfdir}/%{name}/clamscan.profile
498%{_sysconfdir}/%{name}/cliqz.profile
499%{_sysconfdir}/%{name}/conky.profile
500%{_sysconfdir}/%{name}/dooble-qt4.profile
501%{_sysconfdir}/%{name}/dooble.profile
502%{_sysconfdir}/%{name}/fetchmail.profile
503%{_sysconfdir}/%{name}/ffmpeg.profile
504%{_sysconfdir}/%{name}/freecad.profile
505%{_sysconfdir}/%{name}/freecadcmd.profile
506%{_sysconfdir}/%{name}/freshclam.profile
507%{_sysconfdir}/%{name}/google-earth.profile
508%{_sysconfdir}/%{name}/imagej.profile
509%{_sysconfdir}/%{name}/karbon.profile
510%{_sysconfdir}/%{name}/kdenlive.profile
511%{_sysconfdir}/%{name}/krita.profile
512%{_sysconfdir}/%{name}/linphone.profile
513%{_sysconfdir}/%{name}/lmms.profile
514%{_sysconfdir}/%{name}/macrofusion.profile
515%{_sysconfdir}/%{name}/mpd.profile
516%{_sysconfdir}/%{name}/natron.profile
517%{_sysconfdir}/%{name}/openshot-qt.profile
518%{_sysconfdir}/%{name}/pinta.profile
519%{_sysconfdir}/%{name}/ricochet.profile
520%{_sysconfdir}/%{name}/rocketchat.profile
521%{_sysconfdir}/%{name}/shotcut.profile
522%{_sysconfdir}/%{name}/smtube.profile
523%{_sysconfdir}/%{name}/surf.profile
524%{_sysconfdir}/%{name}/teamspeak3.profile
525%{_sysconfdir}/%{name}/terasology.profile
526%{_sysconfdir}/%{name}/tor-browser-en.profile
527%{_sysconfdir}/%{name}/tor.profile
528%{_sysconfdir}/%{name}/uefitool.profile
529%{_sysconfdir}/%{name}/whitelist-var-common.inc
530%{_sysconfdir}/%{name}/x-terminal-emulator.profile
531%{_sysconfdir}/%{name}/xmr-stak-cpu.profile
532%{_sysconfdir}/%{name}/zart.profile
533
534/usr/bin/firejail
535/usr/bin/firemon
536/usr/bin/firecfg
537
538/usr/lib/firejail/libtrace.so
539/usr/lib/firejail/libtracelog.so
540/usr/lib/firejail/libpostexecseccomp.so
541/usr/lib/firejail/faudit
542/usr/lib/firejail/ftee
543/usr/lib/firejail/fbuilder
544/usr/lib/firejail/firecfg.config
545/usr/lib/firejail/fshaper.sh
546/usr/lib/firejail/fcopy
547/usr/lib/firejail/fgit-install.sh
548/usr/lib/firejail/fgit-uninstall.sh
549#/usr/lib/firejail/fix_private-bin.py
550#/usr/lib/firejail/fjclip.py
551#/usr/lib/firejail/fjdisplay.py
552#/usr/lib/firejail/fjresize.py
553/usr/lib/firejail/fnet
554/usr/lib/firejail/fldd
555/usr/lib/firejail/fseccomp
556/usr/lib/firejail/seccomp
557/usr/lib/firejail/seccomp.64
558/usr/lib/firejail/seccomp.debug
559/usr/lib/firejail/seccomp.32
560/usr/lib/firejail/seccomp.block_secondary
561/usr/lib/firejail/seccomp.mdwx
562
563/usr/share/doc/packages/firejail/COPYING
564/usr/share/doc/packages/firejail/README
565/usr/share/doc/packages/firejail/RELNOTES
566/usr/share/man/man1/firejail.1.gz
567/usr/share/man/man1/firemon.1.gz
568/usr/share/man/man1/firecfg.1.gz
569/usr/share/man/man5/firejail-profile.5.gz
570/usr/share/man/man5/firejail-login.5.gz
571/usr/share/bash-completion/completions/firejail
572/usr/share/bash-completion/completions/firemon
573/usr/share/bash-completion/completions/firecfg
574
575%post
576chmod u+s /usr/bin/firejail
577
578%changelog
579* Sat Sep 23 2017 netblue30 <netblue30@yahoo.com> 0.9.51-1
580
581* Fri Sep 8 2017 netblue30 <netblue30@yahoo.com> 0.9.50-1
582
583* Mon Jun 12 2017 netblue30 <netblue30@yahoo.com> 0.9.48-1
584
585* Mon May 15 2017 netblue30 <netblue30@yahoo.com> 0.9.46-1
586
587* Fri Oct 21 2016 netblue30 <netblue30@yahoo.com> 0.9.44-1
588 - CVE-2016-7545 submitted by Aleksey Manevich
589 - modifs: removed man firejail-config
590 - modifs: --private-tmp whitelists /tmp/.X11-unix directory
591 - modifs: Nvidia drivers added to --private-dev
592 - modifs: /srv supported by --whitelist
593 - feature: allow user access to /sys/fs (--noblacklist=/sys/fs)
594 - feature: support starting/joining sandbox is a single command
595 (--join-or-start)
596 - feature: X11 detection support for --audit
597 - feature: assign a name to the interface connected to the bridge
598 (--veth-name)
599 - feature: all user home directories are visible (--allusers)
600 - feature: add files to sandbox container (--put)
601 - feature: blocking x11 (--x11=block)
602 - feature: X11 security extension (--x11=xorg)
603 - feature: disable 3D hardware acceleration (--no3d)
604 - feature: x11 xpra, x11 xephyr, x11 block, allusers, no3d profile commands
605 - feature: move files in sandbox (--put)
606 - feature: accept wildcard patterns in user name field of restricted
607 shell login feature
608 - new profiles: qpdfview, mupdf, Luminance HDR, Synfig Studio, Gimp, Inkscape
609 - new profiles: feh, ranger, zathura, 7z, keepass, keepassx,
610 - new profiles: claws-mail, mutt, git, emacs, vim, xpdf, VirtualBox, OpenShot
611 - new profiles: Flowblade, Eye of GNOME (eog), Evolution
612 - bugfixes
613
614* Thu Sep 8 2016 netblue30 <netblue30@yahoo.com> 0.9.42-1
615 - security: --whitelist deleted files, submitted by Vasya Novikov
616 - security: disable x32 ABI in seccomp, submitted by Jann Horn
617 - security: tighten --chroot, submitted by Jann Horn
618 - security: terminal sandbox escape, submitted by Stephan Sokolow
619 - security: several TOCTOU fixes submitted by Aleksey Manevich
620 - modifs: bringing back --private-home option
621 - modifs: deprecated --user option, please use "sudo -u username firejail"
622 - modifs: allow symlinks in home directory for --whitelist option
623 - modifs: Firejail prompt is enabled by env variable FIREJAIL_PROMPT="yes"
624 - modifs: recursive mkdir
625 - modifs: include /dev/snd in --private-dev
626 - modifs: seccomp filter update
627 - modifs: release archives moved to .xz format
628 - feature: AppImage support (--appimage)
629 - feature: AppArmor support (--apparmor)
630 - feature: Ubuntu snap support (/etc/firejail/snap.profile)
631 - feature: Sandbox auditing support (--audit)
632 - feature: remove environment variable (--rmenv)
633 - feature: noexec support (--noexec)
634 - feature: clean local overlay storage directory (--overlay-clean)
635 - feature: store and reuse overlay (--overlay-named)
636 - feature: allow debugging inside the sandbox with gdb and strace
637 (--allow-debuggers)
638 - feature: mkfile profile command
639 - feature: quiet profile command
640 - feature: x11 profile command
641 - feature: option to fix desktop files (firecfg --fix)
642 - compile time: Busybox support (--enable-busybox-workaround)
643 - compile time: disable overlayfs (--disable-overlayfs)
644 - compile time: disable whitlisting (--disable-whitelist)
645 - compile time: disable global config (--disable-globalcfg)
646 - run time: enable/disable overlayfs (overlayfs yes/no)
647 - run time: enable/disable quiet as default (quiet-by-default yes/no)
648 - run time: user-defined network filter (netfilter-default)
649 - run time: enable/disable whitelisting (whitelist yes/no)
650 - run time: enable/disable remounting of /proc and /sys
651 (remount-proc-sys yes/no)
652 - run time: enable/disable chroot desktop features (chroot-desktop yes/no)
653 - profiles: Gitter, gThumb, mpv, Franz messenger, LibreOffice
654 - profiles: pix, audacity, xz, xzdec, gzip, cpio, less
655 - profiles: Atom Beta, Atom, jitsi, eom, uudeview
656 - profiles: tar (gtar), unzip, unrar, file, skypeforlinux,
657 - profiles: inox, Slack, gnome-chess. Gajim IM client, DOSBox
658 - bugfixes
659
660EOF
661
662echo "building rpm"
663rpmbuild -ba SPECS/firejail.spec
664rpm -qpl RPMS/x86_64/firejail-$VERSION-1.x86_64.rpm
665cd ..
666rm -f firejail-$VERSION-1.x86_64.rpm
667cp rpmbuild/RPMS/x86_64/firejail-$VERSION-1.x86_64.rpm .
diff --git a/platform/snap/snap.sh b/platform/snap/snap.sh
deleted file mode 100755
index d7f924293..000000000
--- a/platform/snap/snap.sh
+++ /dev/null
@@ -1,20 +0,0 @@
1#!/bin/bash
2
3rm -fr faudit-snap
4rm -f faudit_*.snap
5mkdir faudit-snap
6cd faudit-snap
7snapcraft init
8cp ../snapcraft.yaml .
9#snapcraft stage
10mkdir -p stage/usr/lib/firejail
11cp ../../../src/faudit/faudit stage/usr/lib/firejail/.
12find stage
13snapcraft stage
14snapcraft snap
15cd ..
16mv faudit-snap/faudit_*.snap ../../.
17rm -fr faudit-snap
18
19
20
diff --git a/platform/snap/snapcraft.yaml b/platform/snap/snapcraft.yaml
deleted file mode 100644
index d3755de96..000000000
--- a/platform/snap/snapcraft.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
1name: faudit # the name of the snap
2version: 0 # the version of the snap
3summary: Fireajail audit snap edition # 79 char long summary
4description: faudit program extracted from Firejail and packaged as a snap # a longer description for the snap
5confinement: strict # use "strict" to enforce system access only via declared interfaces
6
7apps:
8 faudit:
9 command: /usr/lib/firejail/faudit
10
11parts:
12 faudit: # Replace with a part name of your liking
13 # Get more information about plugins by running
14 # snapcraft help plugins
15 # and more information about the available plugins
16 # by running
17 # snapcraft list-plugins
18 plugin: nil
19 snap:
20 - usr/lib/firejail/faudit
diff --git a/src/bash_completion/Makefile.in b/src/bash_completion/Makefile.in
new file mode 100644
index 000000000..f7db9e6b4
--- /dev/null
+++ b/src/bash_completion/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: firejail.bash_completion
3
4include ../common.mk
5
6firejail.bash_completion: firejail.bash_completion.in
7 gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp
8 sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@
9 rm $@.tmp
10
11.PHONY: clean
12clean:
13 rm -fr firejail.bash_completion
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/bash_completion/firejail.bash_completion b/src/bash_completion/firejail.bash_completion.in
index 09798f505..f68edf380 100644
--- a/src/bash_completion/firejail.bash_completion
+++ b/src/bash_completion/firejail.bash_completion.in
@@ -9,6 +9,17 @@ __interfaces(){
9 cut -f 1 -d ':' /proc/net/dev | tail -n +3 | grep -v lo | xargs 9 cut -f 1 -d ':' /proc/net/dev | tail -n +3 | grep -v lo | xargs
10} 10}
11 11
12_profiles() {
13 if [[ -d "$1" ]] ; then
14 ls -1 $1/*.profile 2>/dev/null | sed -E 's;^.*\/;;g'
15 fi
16}
17_all_profiles() {
18 local sys_profiles=$(_profiles _SYSCONFDIR_/firejail)
19 local user_profiles=$(_profiles $HOME/.config/firejail)
20 COMPREPLY=($(compgen -W "${sys_profiles} ${user_profiles}" -- "$cur"))
21}
22
12 23
13_firejail() 24_firejail()
14{ 25{
@@ -16,11 +27,11 @@ _firejail()
16 _init_completion -s || return 27 _init_completion -s || return
17 28
18 case $prev in 29 case $prev in
19 --help|--version|-debug-caps|--debug-syscalls|--list|--tree|--top|--join|--shutdown) 30 --help|--version|-debug-caps|--debug-syscalls|--debug-syscalls32|--list|--tree|--top|--join|--shutdown)
20 return 0 31 return 0
21 ;; 32 ;;
22 --profile) 33 --profile)
23 _filedir 34 _all_profiles
24 return 0 35 return 0
25 ;; 36 ;;
26 --hosts-file) 37 --hosts-file)
@@ -79,10 +90,6 @@ _firejail()
79 _filedir 90 _filedir
80 return 0 91 return 0
81 ;; 92 ;;
82 --audit)
83 _filedir
84 return 0
85 ;;
86 --net) 93 --net)
87 comps=$(__interfaces) 94 comps=$(__interfaces)
88 COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) 95 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
diff --git a/src/common.mk.in b/src/common.mk.in
new file mode 100644
index 000000000..d117433dc
--- /dev/null
+++ b/src/common.mk.in
@@ -0,0 +1,53 @@
1# common definitions for all makefiles
2
3CC=@CC@
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6bindir=@bindir@
7libdir=@libdir@
8sysconfdir=@sysconfdir@
9
10VERSION=@PACKAGE_VERSION@
11NAME=@PACKAGE_NAME@
12HAVE_CHROOT=@HAVE_CHROOT@
13HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
14HAVE_NETWORK=@HAVE_NETWORK@
15HAVE_USERNS=@HAVE_USERNS@
16HAVE_X11=@HAVE_X11@
17HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
18HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
19HAVE_APPARMOR=@HAVE_APPARMOR@
20HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
21HAVE_FIRETUNNEL=@HAVE_FIRETUNNEL@
22HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
23HAVE_GCOV=@HAVE_GCOV@
24HAVE_SELINUX=@HAVE_SELINUX@
25ifeq (@HAVE_SUID@, yes)
26HAVE_SUID=-DHAVE_SUID
27else
28HAVE_SUID=
29endif
30HAVE_DBUSPROXY=@HAVE_DBUSPROXY@
31HAVE_USERTMPFS=@HAVE_USERTMPFS@
32HAVE_OUTPUT=@HAVE_OUTPUT@
33HAVE_LTS=@HAVE_LTS@
34HAVE_FORCE_NONEWPRIVS=@HAVE_FORCE_NONEWPRIVS@
35
36H_FILE_LIST = $(sort $(wildcard *.h))
37C_FILE_LIST = $(sort $(wildcard *.c))
38OBJS = $(C_FILE_LIST:.c=.o)
39BINOBJS = $(foreach file, $(OBJS), $file)
40
41CFLAGS = @CFLAGS@
42CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV)
43CFLAGS += -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' -DVARDIR='"/var/lib/firejail"'
44MANFLAGS = $(HAVE_LTS) $(HAVE_OUTPUT) $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_USERTMPFS) $(HAVE_DBUSPROXY) $(HAVE_FIRETUNNEL) $(HAVE_GLOBALCFG) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_FILE_TRANSFER) $(HAVE_SELINUX) $(HAVE_SUID) $(HAVE_FORCE_NONEWPRIVS)
45CFLAGS += $(MANFLAGS)
46CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -Wformat -Wformat-security
47LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now -lpthread
48EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
49
50ifdef NO_EXTRA_CFLAGS
51else
52EXTRA_CFLAGS +=@EXTRA_CFLAGS@
53endif
diff --git a/src/faudit/Makefile.in b/src/faudit/Makefile.in
deleted file mode 100644
index a3b505c39..000000000
--- a/src/faudit/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
1all: faudit
2
3CC=@CC@
4PREFIX=@prefix@
5VERSION=@PACKAGE_VERSION@
6NAME=@PACKAGE_NAME@
7HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
8
9H_FILE_LIST = $(sort $(wildcard *.[h]))
10C_FILE_LIST = $(sort $(wildcard *.c))
11OBJS = $(C_FILE_LIST:.c=.o)
12BINOBJS = $(foreach file, $(OBJS), $file)
13CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(PREFIX)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
14LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
15
16%.o : %.c $(H_FILE_LIST)
17 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
18
19faudit: $(OBJS)
20 $(CC) $(LDFLAGS) -o $@ $(OBJS)
21
22clean:; rm -f *.o faudit
23
24distclean: clean
25 rm -fr Makefile
diff --git a/src/faudit/caps.c b/src/faudit/caps.c
deleted file mode 100644
index d4a98676c..000000000
--- a/src/faudit/caps.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "faudit.h"
22#include <linux/capability.h>
23
24#define MAXBUF 4098
25static int extract_caps(uint64_t *val) {
26 FILE *fp = fopen("/proc/self/status", "r");
27 if (!fp)
28 return 1;
29
30 char buf[MAXBUF];
31 while (fgets(buf, MAXBUF, fp)) {
32 if (strncmp(buf, "CapBnd:\t", 8) == 0) {
33 char *ptr = buf + 8;
34 unsigned long long tmp;
35 sscanf(ptr, "%llx", &tmp);
36 *val = tmp;
37 fclose(fp);
38 return 0;
39 }
40 }
41
42 fclose(fp);
43 return 1;
44}
45
46// return 1 if the capability is in tbe map
47static int check_capability(uint64_t map, int cap) {
48 int i;
49 uint64_t mask = 1ULL;
50
51 for (i = 0; i < 64; i++, mask <<= 1) {
52 if ((i == cap) && (mask & map))
53 return 1;
54 }
55
56 return 0;
57}
58
59void caps_test(void) {
60 uint64_t caps_val;
61
62 if (extract_caps(&caps_val)) {
63 printf("SKIP: cannot extract capabilities on this platform.\n");
64 return;
65 }
66
67 if (caps_val) {
68 printf("BAD: the capability map is %llx, it should be all zero. ", (unsigned long long) caps_val);
69 printf("Use \"firejail --caps.drop=all\" to fix it.\n");
70
71 if (check_capability(caps_val, CAP_SYS_ADMIN))
72 printf("UGLY: CAP_SYS_ADMIN is enabled.\n");
73 if (check_capability(caps_val, CAP_SYS_BOOT))
74 printf("UGLY: CAP_SYS_BOOT is enabled.\n");
75 }
76 else
77 printf("GOOD: all capabilities are disabled.\n");
78}
diff --git a/src/faudit/dbus.c b/src/faudit/dbus.c
deleted file mode 100644
index 54300c9b8..000000000
--- a/src/faudit/dbus.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21#include <sys/socket.h>
22#include <sys/un.h>
23
24// return 0 if the connection is possible
25int check_unix(const char *sockfile) {
26 assert(sockfile);
27 int rv = -1;
28
29 // open socket
30 int sock = socket(AF_UNIX, SOCK_STREAM, 0);
31 if (sock == -1)
32 return rv;
33
34 // connect
35 struct sockaddr_un remote;
36 memset(&remote, 0, sizeof(struct sockaddr_un));
37 remote.sun_family = AF_UNIX;
38 strncpy(remote.sun_path, sockfile, sizeof(remote.sun_path));
39 int len = strlen(remote.sun_path) + sizeof(remote.sun_family);
40 if (*sockfile == '@')
41 remote.sun_path[0] = '\0';
42 if (connect(sock, (struct sockaddr *)&remote, len) == 0)
43 rv = 0;
44
45 close(sock);
46 return rv;
47}
48
49void dbus_test(void) {
50 // check the session bus
51 char *str = getenv("DBUS_SESSION_BUS_ADDRESS");
52 if (str) {
53 int rv = 0;
54 char *bus = strdup(str);
55 if (!bus)
56 errExit("strdup");
57 char *sockfile;
58 if ((sockfile = strstr(bus, "unix:abstract=")) != NULL) {
59 sockfile += 13;
60 *sockfile = '@';
61 char *ptr = strchr(sockfile, ',');
62 if (ptr)
63 *ptr = '\0';
64 rv = check_unix(sockfile);
65 *sockfile = '@';
66 if (rv == 0)
67 printf("MAYBE: D-Bus socket %s is available\n", sockfile);
68 else if (rv == -1)
69 printf("GOOD: cannot connect to D-Bus socket %s\n", sockfile);
70 }
71 else if ((sockfile = strstr(bus, "unix:path=")) != NULL) {
72 sockfile += 10;
73 char *ptr = strchr(sockfile, ',');
74 if (ptr)
75 *ptr = '\0';
76 rv = check_unix(sockfile);
77 if (rv == 0)
78 printf("MAYBE: D-Bus socket %s is available\n", sockfile);
79 else if (rv == -1)
80 printf("GOOD: cannot connect to D-Bus socket %s\n", sockfile);
81 }
82 else if ((sockfile = strstr(bus, "tcp:host=")) != NULL)
83 printf("UGLY: session bus configured for TCP communication.\n");
84 else
85 printf("GOOD: cannot find a D-Bus socket\n");
86
87
88 free(bus);
89 }
90 else
91 printf("GOOD: DBUS_SESSION_BUS_ADDRESS environment variable not configured.");
92}
diff --git a/src/faudit/files.c b/src/faudit/files.c
deleted file mode 100644
index aa5b3aafb..000000000
--- a/src/faudit/files.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21#include <fcntl.h>
22#include <pwd.h>
23
24static char *username = NULL;
25static char *homedir = NULL;
26
27static void check_home_file(const char *name) {
28 assert(homedir);
29
30 char *fname;
31 if (asprintf(&fname, "%s/%s", homedir, name) == -1)
32 errExit("asprintf");
33
34 if (access(fname, R_OK) == 0) {
35 printf("UGLY: I can access files in %s directory. ", fname);
36 printf("Use \"firejail --blacklist=%s\" to block it.\n", fname);
37 }
38 else
39 printf("GOOD: I cannot access files in %s directory.\n", fname);
40
41 free(fname);
42}
43
44void files_test(void) {
45 struct passwd *pw = getpwuid(getuid());
46 if (!pw) {
47 fprintf(stderr, "Error: cannot retrieve user account information\n");
48 return;
49 }
50
51 username = strdup(pw->pw_name);
52 if (!username)
53 errExit("strdup");
54 homedir = strdup(pw->pw_dir);
55 if (!homedir)
56 errExit("strdup");
57
58 // check access to .ssh directory
59 check_home_file(".ssh");
60
61 // check access to .gnupg directory
62 check_home_file(".gnupg");
63
64 // check access to Firefox browser directory
65 check_home_file(".mozilla");
66
67 // check access to Chromium browser directory
68 check_home_file(".config/chromium");
69
70 // check access to Debian Icedove directory
71 check_home_file(".icedove");
72
73 // check access to Thunderbird directory
74 check_home_file(".thunderbird");
75}
diff --git a/src/faudit/main.c b/src/faudit/main.c
deleted file mode 100644
index 57c709767..000000000
--- a/src/faudit/main.c
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21char *prog;
22
23int main(int argc, char **argv) {
24 // make test-arguments helper
25 if (getenv("FIREJAIL_TEST_ARGUMENTS")) {
26 printf("Arguments:\n");
27
28 int i;
29 for (i = 0; i < argc; i++) {
30 printf("#%s#\n", argv[i]);
31 }
32
33 return 0;
34 }
35
36
37 if (argc != 1) {
38 int i;
39
40 for (i = 1; i < argc; i++) {
41 if (strcmp(argv[i], "syscall") == 0) {
42 syscall_helper(argc, argv);
43 return 0;
44 }
45 }
46 return 1;
47 }
48
49 printf("\n---------------- Firejail Audit: the GOOD, the BAD and the UGLY ----------------\n");
50
51 // extract program name
52 prog = realpath(argv[0], NULL);
53 if (prog == NULL) {
54 prog = strdup("faudit");
55 if (!prog)
56 errExit("strdup");
57 }
58 printf("INFO: starting %s.\n", prog);
59
60
61 // check pid namespace
62 pid_test();
63 printf("\n");
64
65 // check seccomp
66 seccomp_test();
67 printf("\n");
68
69 // check capabilities
70 caps_test();
71 printf("\n");
72
73 // check some well-known problematic files and directories
74 files_test();
75 printf("\n");
76
77 // network
78 network_test();
79 printf("\n");
80
81 // dbus
82 dbus_test();
83 printf("\n");
84
85 // x11 test
86 x11_test();
87 printf("\n");
88
89 // /dev test
90 dev_test();
91 printf("\n");
92
93
94 free(prog);
95 printf("--------------------------------------------------------------------------------\n");
96
97 return 0;
98}
diff --git a/src/faudit/network.c b/src/faudit/network.c
deleted file mode 100644
index 797c15ba8..000000000
--- a/src/faudit/network.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21#include <sys/socket.h>
22#include <arpa/inet.h>
23#include <linux/netlink.h>
24#include <linux/rtnetlink.h>
25
26static void check_ssh(void) {
27 // open socket
28 int sock = socket(AF_INET, SOCK_STREAM, 0);
29 if (sock == -1) {
30 printf("GOOD: SSH server not available on localhost.\n");
31 return;
32 }
33
34 // connect to localhost
35 struct sockaddr_in server;
36 server.sin_addr.s_addr = inet_addr("127.0.0.1");
37 server.sin_family = AF_INET;
38 server.sin_port = htons(22);
39
40 if (connect(sock , (struct sockaddr *)&server , sizeof(server)) < 0)
41 printf("GOOD: SSH server not available on localhost.\n");
42 else {
43 printf("MAYBE: an SSH server is accessible on localhost. ");
44 printf("It could be a good idea to create a new network namespace using \"--net=none\" or \"--net=eth0\".\n");
45 }
46
47 close(sock);
48}
49
50static void check_http(void) {
51 // open socket
52 int sock = socket(AF_INET, SOCK_STREAM, 0);
53 if (sock == -1) {
54 printf("GOOD: HTTP server not available on localhost.\n");
55 return;
56 }
57
58 // connect to localhost
59 struct sockaddr_in server;
60 server.sin_addr.s_addr = inet_addr("127.0.0.1");
61 server.sin_family = AF_INET;
62 server.sin_port = htons(80);
63
64 if (connect(sock , (struct sockaddr *)&server , sizeof(server)) < 0)
65 printf("GOOD: HTTP server not available on localhost.\n");
66 else {
67 printf("MAYBE: an HTTP server is accessible on localhost. ");
68 printf("It could be a good idea to create a new network namespace using \"--net=none\" or \"--net=eth0\".\n");
69 }
70
71 close(sock);
72}
73
74void check_netlink(void) {
75 int sock = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, 0);
76 if (sock == -1) {
77 printf("GOOD: I cannot connect to netlink socket. Network utilities such as iproute2 will not work in the sandbox.\n");
78 return;
79 }
80
81 struct sockaddr_nl local;
82 memset(&local, 0, sizeof(local));
83 local.nl_family = AF_NETLINK;
84 local.nl_groups = 0; //subscriptions;
85
86 if (bind(sock, (struct sockaddr*)&local, sizeof(local)) < 0) {
87 printf("GOOD: I cannot connect to netlink socket. Network utilities such as iproute2 will not work in the sandbox.\n");
88 close(sock);
89 return;
90 }
91
92 close(sock);
93 printf("MAYBE: I can connect to netlink socket. Network utilities such as iproute2 will work fine in the sandbox. ");
94 printf("You can use \"--protocol\" to disable the socket.\n");
95}
96
97void network_test(void) {
98 check_ssh();
99 check_http();
100 check_netlink();
101}
diff --git a/src/faudit/pid.c b/src/faudit/pid.c
deleted file mode 100644
index 0aa2ddd44..000000000
--- a/src/faudit/pid.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21
22void pid_test(void) {
23 char *kern_proc[] = {
24 "kthreadd",
25 "ksoftirqd",
26 "kworker",
27 "rcu_sched",
28 "rcu_bh",
29 NULL // NULL terminated list
30 };
31 int i;
32
33 // look at the first 10 processes
34 int not_visible = 1;
35 for (i = 1; i <= 10; i++) {
36 struct stat s;
37 char *fname;
38 if (asprintf(&fname, "/proc/%d/comm", i) == -1)
39 errExit("asprintf");
40 if (stat(fname, &s) == -1) {
41 free(fname);
42 continue;
43 }
44
45 // open file
46 /* coverity[toctou] */
47 FILE *fp = fopen(fname, "r");
48 if (!fp) {
49 free(fname);
50 continue;
51 }
52
53 // read file
54 char buf[100];
55 if (fgets(buf, 10, fp) == NULL) {
56 fclose(fp);
57 free(fname);
58 continue;
59 }
60 not_visible = 0;
61
62 // clean /n
63 char *ptr;
64 if ((ptr = strchr(buf, '\n')) != NULL)
65 *ptr = '\0';
66
67 // check process name against the kernel list
68 int j = 0;
69 while (kern_proc[j] != NULL) {
70 if (strncmp(buf, kern_proc[j], strlen(kern_proc[j])) == 0) {
71 fclose(fp);
72 free(fname);
73 printf("BAD: Process %d is not running in a PID namespace. ", getpid());
74 printf("Are you sure you're running in a sandbox?\n");
75 return;
76 }
77 j++;
78 }
79
80 fclose(fp);
81 free(fname);
82 }
83
84 pid_t pid = getpid();
85 if (not_visible && pid > 100)
86 printf("BAD: Process %d is not running in a PID namespace.\n", pid);
87 else
88 printf("GOOD: process %d is running in a PID namespace.\n", pid);
89
90 // try to guess the type of container/sandbox
91 char *str = getenv("container");
92 if (str)
93 printf("INFO: container/sandbox %s.\n", str);
94 else {
95 str = getenv("SNAP");
96 if (str)
97 printf("INFO: this is a snap package\n");
98 }
99}
diff --git a/src/faudit/seccomp.c b/src/faudit/seccomp.c
deleted file mode 100644
index 2e9665fd9..000000000
--- a/src/faudit/seccomp.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21
22#define MAXBUF 4098
23static int extract_seccomp(int *val) {
24 FILE *fp = fopen("/proc/self/status", "r");
25 if (!fp)
26 return 1;
27
28 char buf[MAXBUF];
29 while (fgets(buf, MAXBUF, fp)) {
30 if (strncmp(buf, "Seccomp:\t", 8) == 0) {
31 char *ptr = buf + 8;
32 int tmp;
33 sscanf(ptr, "%d", &tmp);
34 *val = tmp;
35 fclose(fp);
36 return 0;
37 }
38 }
39
40 fclose(fp);
41 return 1;
42}
43
44void seccomp_test(void) {
45 int seccomp_status;
46 int rv = extract_seccomp(&seccomp_status);
47
48 if (rv) {
49 printf("INFO: cannot extract seccomp configuration on this platform.\n");
50 return;
51 }
52
53 if (seccomp_status == 0) {
54 printf("BAD: seccomp disabled. Use \"firejail --seccomp\" to enable it.\n");
55 }
56 else if (seccomp_status == 1)
57 printf("GOOD: seccomp strict mode - only read, write, _exit, and sigreturn are allowed.\n");
58 else if (seccomp_status == 2) {
59 printf("GOOD: seccomp BPF enabled.\n");
60
61 printf("checking syscalls: "); fflush(0);
62 printf("mount... "); fflush(0);
63 syscall_run("mount");
64
65 printf("umount2... "); fflush(0);
66 syscall_run("umount2");
67
68 printf("ptrace... "); fflush(0);
69 syscall_run("ptrace");
70
71 printf("swapon... "); fflush(0);
72 syscall_run("swapon");
73
74 printf("swapoff... "); fflush(0);
75 syscall_run("swapoff");
76
77 printf("init_module... "); fflush(0);
78 syscall_run("init_module");
79
80 printf("delete_module... "); fflush(0);
81 syscall_run("delete_module");
82
83 printf("chroot... "); fflush(0);
84 syscall_run("chroot");
85
86 printf("pivot_root... "); fflush(0);
87 syscall_run("pivot_root");
88
89#if defined(__i386__) || defined(__x86_64__)
90 printf("iopl... "); fflush(0);
91 syscall_run("iopl");
92
93 printf("ioperm... "); fflush(0);
94 syscall_run("ioperm");
95#endif
96 printf("\n");
97 }
98 else
99 fprintf(stderr, "Error: unrecognized seccomp mode\n");
100
101}
diff --git a/src/faudit/syscall.c b/src/faudit/syscall.c
deleted file mode 100644
index 9661f81e6..000000000
--- a/src/faudit/syscall.c
+++ /dev/null
@@ -1,105 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21#include <sys/ptrace.h>
22#include <sys/swap.h>
23#if defined(__i386__) || defined(__x86_64__)
24#include <sys/io.h>
25#endif
26#include <sys/wait.h>
27extern int init_module(void *module_image, unsigned long len,
28 const char *param_values);
29extern int finit_module(int fd, const char *param_values,
30 int flags);
31extern int delete_module(const char *name, int flags);
32extern int pivot_root(const char *new_root, const char *put_old);
33
34void syscall_helper(int argc, char **argv) {
35 (void) argc;
36
37 if (argc < 3)
38 return;
39
40 if (strcmp(argv[2], "mount") == 0) {
41 int rv = mount(NULL, NULL, NULL, 0, NULL);
42 (void) rv;
43 printf("\nUGLY: mount syscall permitted.\n");
44 }
45 else if (strcmp(argv[2], "umount2") == 0) {
46 umount2(NULL, 0);
47 printf("\nUGLY: umount2 syscall permitted.\n");
48 }
49 else if (strcmp(argv[2], "ptrace") == 0) {
50 ptrace(0, 0, NULL, NULL);
51 printf("\nUGLY: ptrace syscall permitted.\n");
52 }
53 else if (strcmp(argv[2], "swapon") == 0) {
54 swapon(NULL, 0);
55 printf("\nUGLY: swapon syscall permitted.\n");
56 }
57 else if (strcmp(argv[2], "swapoff") == 0) {
58 swapoff(NULL);
59 printf("\nUGLY: swapoff syscall permitted.\n");
60 }
61 else if (strcmp(argv[2], "init_module") == 0) {
62 init_module(NULL, 0, NULL);
63 printf("\nUGLY: init_module syscall permitted.\n");
64 }
65 else if (strcmp(argv[2], "delete_module") == 0) {
66 delete_module(NULL, 0);
67 printf("\nUGLY: delete_module syscall permitted.\n");
68 }
69 else if (strcmp(argv[2], "chroot") == 0) {
70 int rv = chroot("/blablabla-57281292");
71 (void) rv;
72 printf("\nUGLY: chroot syscall permitted.\n");
73 }
74 else if (strcmp(argv[2], "pivot_root") == 0) {
75 pivot_root(NULL, NULL);
76 printf("\nUGLY: pivot_root syscall permitted.\n");
77 }
78#if defined(__i386__) || defined(__x86_64__)
79 else if (strcmp(argv[2], "iopl") == 0) {
80 iopl(0L);
81 printf("\nUGLY: iopl syscall permitted.\n");
82 }
83 else if (strcmp(argv[2], "ioperm") == 0) {
84 ioperm(0, 0, 0);
85 printf("\nUGLY: ioperm syscall permitted.\n");
86 }
87#endif
88 exit(0);
89}
90
91void syscall_run(const char *name) {
92 assert(prog);
93
94 pid_t child = fork();
95 if (child < 0)
96 errExit("fork");
97 if (child == 0) {
98 execl(prog, prog, "syscall", name, NULL);
99 perror("execl");
100 _exit(1);
101 }
102
103 // wait for the child to finish
104 waitpid(child, NULL, 0);
105}
diff --git a/src/faudit/x11.c b/src/faudit/x11.c
deleted file mode 100644
index f0cc0eed4..000000000
--- a/src/faudit/x11.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "faudit.h"
21#include <sys/socket.h>
22#include <dirent.h>
23
24
25void x11_test(void) {
26 // check regular display 0 sockets
27 if (check_unix("/tmp/.X11-unix/X0") == 0)
28 printf("MAYBE: X11 socket /tmp/.X11-unix/X0 is available\n");
29
30 if (check_unix("@/tmp/.X11-unix/X0") == 0)
31 printf("MAYBE: X11 socket @/tmp/.X11-unix/X0 is available\n");
32
33 // check all unix sockets in /tmp/.X11-unix directory
34 DIR *dir;
35 if (!(dir = opendir("/tmp/.X11-unix"))) {
36 // sleep 2 seconds and try again
37 sleep(2);
38 if (!(dir = opendir("/tmp/.X11-unix"))) {
39 ;
40 }
41 }
42
43 if (dir == NULL)
44 printf("GOOD: cannot open /tmp/.X11-unix directory\n");
45 else {
46 struct dirent *entry;
47 while ((entry = readdir(dir)) != NULL) {
48 if (strcmp(entry->d_name, "X0") == 0)
49 continue;
50 if (strcmp(entry->d_name, ".") == 0)
51 continue;
52 if (strcmp(entry->d_name, "..") == 0)
53 continue;
54 char *name;
55 if (asprintf(&name, "/tmp/.X11-unix/%s", entry->d_name) == -1)
56 errExit("asprintf");
57 if (check_unix(name) == 0)
58 printf("MAYBE: X11 socket %s is available\n", name);
59 free(name);
60 }
61 closedir(dir);
62 }
63}
diff --git a/src/fbuilder/Makefile.in b/src/fbuilder/Makefile.in
index dd8e2ce6e..6eaee284b 100644
--- a/src/fbuilder/Makefile.in
+++ b/src/fbuilder/Makefile.in
@@ -1,45 +1,17 @@
1.PHONY: all
1all: fbuilder 2all: fbuilder
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8
9VERSION=@PACKAGE_VERSION@
10NAME=@PACKAGE_NAME@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
26HAVE_GCOV=@HAVE_GCOV@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28
29H_FILE_LIST = $(sort $(wildcard *.[h]))
30C_FILE_LIST = $(sort $(wildcard *.c))
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35 5
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
38 8
39fbuilder: $(OBJS) 9fbuilder: $(OBJS)
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS)
41 11
42clean:; rm -f *.o fbuilder *.gcov *.gcda *.gcno 12.PHONY: clean
13clean:; rm -fr *.o fbuilder *.gcov *.gcda *.gcno *.plist
43 14
15.PHONY: distclean
44distclean: clean 16distclean: clean
45 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/fbuilder/build_bin.c b/src/fbuilder/build_bin.c
index 31b6ba8e8..9577042c4 100644
--- a/src/fbuilder/build_bin.c
+++ b/src/fbuilder/build_bin.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -23,21 +23,21 @@ static FileDB *bin_out = NULL;
23 23
24static void process_bin(const char *fname) { 24static void process_bin(const char *fname) {
25 assert(fname); 25 assert(fname);
26 26
27 // process trace file 27 // process trace file
28 FILE *fp = fopen(fname, "r"); 28 FILE *fp = fopen(fname, "r");
29 if (!fp) { 29 if (!fp) {
30 fprintf(stderr, "Error: cannot open %s\n", fname); 30 fprintf(stderr, "Error: cannot open %s\n", fname);
31 exit(1); 31 exit(1);
32 } 32 }
33 33
34 char buf[MAX_BUF]; 34 char buf[MAX_BUF];
35 while (fgets(buf, MAX_BUF, fp)) { 35 while (fgets(buf, MAX_BUF, fp)) {
36 // remove \n 36 // remove \n
37 char *ptr = strchr(buf, '\n'); 37 char *ptr = strchr(buf, '\n');
38 if (ptr) 38 if (ptr)
39 *ptr = '\0'; 39 *ptr = '\0';
40 40
41 // parse line: 4:galculator:access /etc/fonts/conf.d:0 41 // parse line: 4:galculator:access /etc/fonts/conf.d:0
42 // number followed by : 42 // number followed by :
43 ptr = buf; 43 ptr = buf;
@@ -71,7 +71,7 @@ static void process_bin(const char *fname) {
71 else if (strncmp(ptr, "/usr/local/sbin/", 16) == 0) 71 else if (strncmp(ptr, "/usr/local/sbin/", 16) == 0)
72 ptr += 16; 72 ptr += 16;
73 else if (strncmp(ptr, "/usr/games/", 11) == 0) 73 else if (strncmp(ptr, "/usr/games/", 11) == 0)
74 ptr += 12; 74 ptr += 11;
75 else if (strncmp(ptr, "/usr/local/games/", 17) == 0) 75 else if (strncmp(ptr, "/usr/local/games/", 17) == 0)
76 ptr += 17; 76 ptr += 17;
77 else 77 else
@@ -83,24 +83,22 @@ static void process_bin(const char *fname) {
83 continue; 83 continue;
84 *ptr2 = '\0'; 84 *ptr2 = '\0';
85 85
86 // skip strace 86 // skip strace and firejail (in case we hit a symlink in /usr/local/bin)
87 if (strcmp(ptr, "strace") == 0) 87 if (strcmp(ptr, "strace") && strcmp(ptr, "firejail"))
88 continue; 88 bin_out = filedb_add(bin_out, ptr);
89
90 bin_out = filedb_add(bin_out, ptr);
91 } 89 }
92 90
93 fclose(fp); 91 fclose(fp);
94} 92}
95 93
96 94
97// process fname, fname.1, fname.2, fname.3, fname.4, fname.5 95// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
98void build_bin(const char *fname) { 96void build_bin(const char *fname, FILE *fp) {
99 assert(fname); 97 assert(fname);
100 98
101 // run fname 99 // run fname
102 process_bin(fname); 100 process_bin(fname);
103 101
104 // run all the rest 102 // run all the rest
105 struct stat s; 103 struct stat s;
106 int i; 104 int i;
@@ -114,12 +112,12 @@ void build_bin(const char *fname) {
114 } 112 }
115 113
116 if (bin_out) { 114 if (bin_out) {
117 printf("# private-bin "); 115 fprintf(fp, "private-bin ");
118 FileDB *ptr = bin_out; 116 FileDB *ptr = bin_out;
119 while (ptr) { 117 while (ptr) {
120 printf("%s,", ptr->fname); 118 fprintf(fp, "%s,", ptr->fname);
121 ptr = ptr->next; 119 ptr = ptr->next;
122 } 120 }
123 printf("\n"); 121 fprintf(fp, "\n");
124 } 122 }
125} 123}
diff --git a/src/fbuilder/build_fs.c b/src/fbuilder/build_fs.c
index dcd86e069..019c3ac5a 100644
--- a/src/fbuilder/build_fs.c
+++ b/src/fbuilder/build_fs.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,23 +25,23 @@ static void process_file(const char *fname, const char *dir, void (*callback)(ch
25 assert(fname); 25 assert(fname);
26 assert(dir); 26 assert(dir);
27 assert(callback); 27 assert(callback);
28 28
29 int dir_len = strlen(dir); 29 int dir_len = strlen(dir);
30 30
31 // process trace file 31 // process trace file
32 FILE *fp = fopen(fname, "r"); 32 FILE *fp = fopen(fname, "r");
33 if (!fp) { 33 if (!fp) {
34 fprintf(stderr, "Error: cannot open %s\n", fname); 34 fprintf(stderr, "Error: cannot open %s\n", fname);
35 exit(1); 35 exit(1);
36 } 36 }
37 37
38 char buf[MAX_BUF]; 38 char buf[MAX_BUF];
39 while (fgets(buf, MAX_BUF, fp)) { 39 while (fgets(buf, MAX_BUF, fp)) {
40 // remove \n 40 // remove \n
41 char *ptr = strchr(buf, '\n'); 41 char *ptr = strchr(buf, '\n');
42 if (ptr) 42 if (ptr)
43 *ptr = '\0'; 43 *ptr = '\0';
44 44
45 // parse line: 4:galculator:access /etc/fonts/conf.d:0 45 // parse line: 4:galculator:access /etc/fonts/conf.d:0
46 // number followed by : 46 // number followed by :
47 ptr = buf; 47 ptr = buf;
@@ -78,10 +78,10 @@ static void process_file(const char *fname, const char *dir, void (*callback)(ch
78 if (!ptr2) 78 if (!ptr2)
79 continue; 79 continue;
80 *ptr2 = '\0'; 80 *ptr2 = '\0';
81 81
82 callback(ptr); 82 callback(ptr);
83 } 83 }
84 84
85 fclose(fp); 85 fclose(fp);
86} 86}
87 87
@@ -90,10 +90,10 @@ static void process_files(const char *fname, const char *dir, void (*callback)(c
90 assert(fname); 90 assert(fname);
91 assert(dir); 91 assert(dir);
92 assert(callback); 92 assert(callback);
93 93
94 // run fname 94 // run fname
95 process_file(fname, dir, callback); 95 process_file(fname, dir, callback);
96 96
97 // run all the rest 97 // run all the rest
98 struct stat s; 98 struct stat s;
99 int i; 99 int i;
@@ -125,50 +125,110 @@ static void etc_callback(char *ptr) {
125 etc_out = filedb_add(etc_out, ptr); 125 etc_out = filedb_add(etc_out, ptr);
126} 126}
127 127
128void build_etc(const char *fname) { 128void build_etc(const char *fname, FILE *fp) {
129 assert(fname); 129 assert(fname);
130 130
131 process_files(fname, "/etc", etc_callback); 131 process_files(fname, "/etc", etc_callback);
132 132
133 printf("private-etc "); 133 fprintf(fp, "private-etc ");
134 if (etc_out == NULL) 134 if (etc_out == NULL)
135 printf("none\n"); 135 fprintf(fp, "none\n");
136 else { 136 else {
137 FileDB *ptr = etc_out; 137 FileDB *ptr = etc_out;
138 while (ptr) { 138 while (ptr) {
139 printf("%s,", ptr->fname); 139 fprintf(fp, "%s,", ptr->fname);
140 ptr = ptr->next; 140 ptr = ptr->next;
141 } 141 }
142 printf("\n"); 142 fprintf(fp, "\n");
143 } 143 }
144} 144}
145 145
146//******************************************* 146//*******************************************
147// var directory 147// var directory
148//******************************************* 148//*******************************************
149#if 0
150// todo: load the list from whitelist-var-common.inc
151static char *var_skip[] = {
152 "/var/lib/ca-certificates",
153 "/var/lib/dbus",
154 "/var/lib/menu-xdg",
155 "/var/lib/uim",
156 "/var/cache/fontconfig",
157 "/var/tmp",
158 "/var/run",
159 "/var/lock",
160 NULL
161};
162#endif
149static FileDB *var_out = NULL; 163static FileDB *var_out = NULL;
164static FileDB *var_skip = NULL;
150static void var_callback(char *ptr) { 165static void var_callback(char *ptr) {
151 if (strcmp(ptr, "/var/lib") == 0) 166 // extract the directory:
152 ; 167 assert(strncmp(ptr, "/var", 4) == 0);
153 else if (strcmp(ptr, "/var/cache") == 0) 168 char *p1 = ptr + 4;
154 ; 169 if (*p1 != '/')
155 else if (strncmp(ptr, "/var/lib/menu-xdg", 17) == 0) 170 return;
156 var_out = filedb_add(var_out, "/var/lib/menu-xdg"); 171 p1++;
157 else if (strncmp(ptr, "/var/cache/fontconfig", 21) == 0) 172
158 var_out = filedb_add(var_out, "/var/cache/fontconfig"); 173 if (*p1 == '/') // double '/'
159 else 174 p1++;
160 var_out = filedb_add(var_out, ptr); 175 if (*p1 == '\0')
176 return;
177
178 if (!filedb_find(var_skip, p1))
179 var_out = filedb_add(var_out, p1);
161} 180}
162 181
163void build_var(const char *fname) { 182void build_var(const char *fname, FILE *fp) {
164 assert(fname); 183 assert(fname);
165 184
185 var_skip = filedb_load_whitelist(var_skip, "whitelist-var-common.inc", "allow /var/");
166 process_files(fname, "/var", var_callback); 186 process_files(fname, "/var", var_callback);
167 187
168 if (var_out == NULL) 188 // always whitelist /var
169 printf("blacklist /var\n"); 189 if (var_out)
170 else 190 filedb_print(var_out, "allow /var/", fp);
171 filedb_print(var_out, "whitelist "); 191 fprintf(fp, "include whitelist-var-common.inc\n");
192}
193
194
195//*******************************************
196// usr/share directory
197//*******************************************
198static FileDB *share_out = NULL;
199static FileDB *share_skip = NULL;
200static void share_callback(char *ptr) {
201 // extract the directory:
202 assert(strncmp(ptr, "/usr/share", 10) == 0);
203 char *p1 = ptr + 10;
204 if (*p1 != '/')
205 return;
206 p1++;
207 if (*p1 == '/') // double '/'
208 p1++;
209 if (*p1 == '\0')
210 return;
211
212 // "/usr/share/bash-completion/bash_completion" becomes "/usr/share/bash-completion"
213 char *p2 = strchr(p1, '/');
214 if (p2)
215 *p2 = '\0';
216
217
218 if (!filedb_find(share_skip, p1))
219 share_out = filedb_add(share_out, p1);
220}
221
222void build_share(const char *fname, FILE *fp) {
223 assert(fname);
224
225 share_skip = filedb_load_whitelist(share_skip, "whitelist-usr-share-common.inc", "allow /usr/share/");
226 process_files(fname, "/usr/share", share_callback);
227
228 // always whitelist /usr/share
229 if (share_out)
230 filedb_print(share_out, "allow /usr/share/", fp);
231 fprintf(fp, "include whitelist-usr-share-common.inc\n");
172} 232}
173 233
174//******************************************* 234//*******************************************
@@ -176,24 +236,31 @@ void build_var(const char *fname) {
176//******************************************* 236//*******************************************
177static FileDB *tmp_out = NULL; 237static FileDB *tmp_out = NULL;
178static void tmp_callback(char *ptr) { 238static void tmp_callback(char *ptr) {
179 filedb_add(tmp_out, ptr); 239 // skip strace file
240 if (strncmp(ptr, "/tmp/firejail-strace", 20) == 0)
241 return;
242 if (strncmp(ptr, "/tmp/runtime-", 13) == 0)
243 return;
244 if (strcmp(ptr, "/tmp") == 0)
245 return;
246
247 tmp_out = filedb_add(tmp_out, ptr);
180} 248}
181 249
182void build_tmp(const char *fname) { 250void build_tmp(const char *fname, FILE *fp) {
183 assert(fname); 251 assert(fname);
184 252
185 process_files(fname, "/tmp", tmp_callback); 253 process_files(fname, "/tmp", tmp_callback);
186 254
187 if (tmp_out == NULL) 255 if (tmp_out == NULL)
188 printf("private-tmp\n"); 256 fprintf(fp, "private-tmp\n");
189 else { 257 else {
190 printf("\n"); 258 fprintf(fp, "#private-tmp\n");
191 printf("# private-tmp\n"); 259 fprintf(fp, "# File accessed in /tmp directory:\n");
192 printf("# File accessed in /tmp directory:\n"); 260 fprintf(fp, "# ");
193 printf("# ");
194 FileDB *ptr = tmp_out; 261 FileDB *ptr = tmp_out;
195 while (ptr) { 262 while (ptr) {
196 printf("%s,", ptr->fname); 263 fprintf(fp, "%s,", ptr->fname);
197 ptr = ptr->next; 264 ptr = ptr->next;
198 } 265 }
199 printf("\n"); 266 printf("\n");
@@ -204,40 +271,37 @@ void build_tmp(const char *fname) {
204// dev directory 271// dev directory
205//******************************************* 272//*******************************************
206static char *dev_skip[] = { 273static char *dev_skip[] = {
274 "/dev/stdin",
275 "/dev/stdout",
276 "/dev/stderr",
207 "/dev/zero", 277 "/dev/zero",
208 "/dev/null", 278 "/dev/null",
209 "/dev/full", 279 "/dev/full",
210 "/dev/random", 280 "/dev/random",
281 "/dev/srandom",
211 "/dev/urandom", 282 "/dev/urandom",
283 "/dev/sr0",
284 "/dev/cdrom",
285 "/dev/cdrw",
286 "/dev/dvd",
287 "/dev/dvdrw",
288 "/dev/fd",
289 "/dev/pts",
290 "/dev/ptmx",
291 "/dev/log",
292
293 "/dev/aload", // old ALSA devices, not covered in private-dev
294 "/dev/dsp", // old OSS device, deprecated
295
212 "/dev/tty", 296 "/dev/tty",
213 "/dev/snd", 297 "/dev/snd",
214 "/dev/dri", 298 "/dev/dri",
215 "/dev/pts", 299 "/dev/nvidia",
216 "/dev/nvidia0", 300 "/dev/video",
217 "/dev/nvidia1",
218 "/dev/nvidia2",
219 "/dev/nvidia3",
220 "/dev/nvidia4",
221 "/dev/nvidia5",
222 "/dev/nvidia6",
223 "/dev/nvidia7",
224 "/dev/nvidia8",
225 "/dev/nvidia9",
226 "/dev/nvidiactl",
227 "/dev/nvidia-modeset",
228 "/dev/nvidia-uvm",
229 "/dev/video0",
230 "/dev/video1",
231 "/dev/video2",
232 "/dev/video3",
233 "/dev/video4",
234 "/dev/video5",
235 "/dev/video6",
236 "/dev/video7",
237 "/dev/video8",
238 "/dev/video9",
239 "/dev/dvb", 301 "/dev/dvb",
240 "/dev/sr0", 302 "/dev/hidraw",
303 "/dev/usb",
304 "/dev/input",
241 NULL 305 NULL
242}; 306};
243 307
@@ -247,34 +311,32 @@ static void dev_callback(char *ptr) {
247 int i = 0; 311 int i = 0;
248 int found = 0; 312 int found = 0;
249 while (dev_skip[i]) { 313 while (dev_skip[i]) {
250 if (strcmp(ptr, dev_skip[i]) == 0) { 314 if (strncmp(ptr, dev_skip[i], strlen(dev_skip[i])) == 0) {
251 found = 1; 315 found = 1;
252 break; 316 break;
253 } 317 }
254 i++; 318 i++;
255 } 319 }
256 if (!found) 320 if (!found)
257 filedb_add(dev_out, ptr); 321 dev_out = filedb_add(dev_out, ptr);
258} 322}
259 323
260void build_dev(const char *fname) { 324void build_dev(const char *fname, FILE *fp) {
261 assert(fname); 325 assert(fname);
262 326
263 process_files(fname, "/tmp", tmp_callback); 327 process_files(fname, "/dev", dev_callback);
264 328
265 if (dev_out == NULL) 329 if (dev_out == NULL)
266 printf("private-dev\n"); 330 fprintf(fp, "private-dev\n");
267 else { 331 else {
268 printf("\n"); 332 fprintf(fp, "#private-dev\n");
269 printf("# private-dev\n"); 333 fprintf(fp, "# This is the list of devices accessed on top of regular private-dev devices:\n");
270 printf("# This is the list of devices accessed (on top of regular private-dev devices:\n"); 334 fprintf(fp, "# ");
271 printf("# ");
272 FileDB *ptr = dev_out; 335 FileDB *ptr = dev_out;
273 while (ptr) { 336 while (ptr) {
274 printf("%s,", ptr->fname); 337 fprintf(fp, "%s,", ptr->fname);
275 ptr = ptr->next; 338 ptr = ptr->next;
276 } 339 }
277 printf("\n"); 340 fprintf(fp, "\n");
278 } 341 }
279} 342}
280
diff --git a/src/fbuilder/build_home.c b/src/fbuilder/build_home.c
index 947f172d8..c85474779 100644
--- a/src/fbuilder/build_home.c
+++ b/src/fbuilder/build_home.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -23,49 +23,25 @@
23static FileDB *db_skip = NULL; 23static FileDB *db_skip = NULL;
24static FileDB *db_out = NULL; 24static FileDB *db_out = NULL;
25 25
26static void load_whitelist_common(void) {
27 FILE *fp = fopen("/etc/firejail/whitelist-common.inc", "r");
28 if (!fp) {
29 fprintf(stderr, "Error: cannot open whitelist-common.inc\n");
30 exit(1);
31 }
32
33 char buf[MAX_BUF];
34 while (fgets(buf, MAX_BUF, fp)) {
35 if (strncmp(buf, "whitelist ~/", 12) != 0)
36 continue;
37 char *fn = buf + 12;
38 char *ptr = strchr(buf, '\n');
39 if (!ptr)
40 continue;
41 *ptr = '\0';
42
43 // add the file to skip list
44 db_skip = filedb_add(db_skip, fn);
45 }
46
47 fclose(fp);
48}
49
50void process_home(const char *fname, char *home, int home_len) { 26void process_home(const char *fname, char *home, int home_len) {
51 assert(fname); 27 assert(fname);
52 assert(home); 28 assert(home);
53 assert(home_len); 29 assert(home_len);
54 30
55 // process trace file 31 // process trace file
56 FILE *fp = fopen(fname, "r"); 32 FILE *fp = fopen(fname, "r");
57 if (!fp) { 33 if (!fp) {
58 fprintf(stderr, "Error: cannot open %s\n", fname); 34 fprintf(stderr, "Error: cannot open %s\n", fname);
59 exit(1); 35 exit(1);
60 } 36 }
61 37
62 char buf[MAX_BUF]; 38 char buf[MAX_BUF];
63 while (fgets(buf, MAX_BUF, fp)) { 39 while (fgets(buf, MAX_BUF, fp)) {
64 // remove \n 40 // remove \n
65 char *ptr = strchr(buf, '\n'); 41 char *ptr = strchr(buf, '\n');
66 if (ptr) 42 if (ptr)
67 *ptr = '\0'; 43 *ptr = '\0';
68 44
69 // parse line: 4:galculator:access /etc/fonts/conf.d:0 45 // parse line: 4:galculator:access /etc/fonts/conf.d:0
70 // number followed by : 46 // number followed by :
71 ptr = buf; 47 ptr = buf;
@@ -92,6 +68,8 @@ void process_home(const char *fname, char *home, int home_len) {
92 ptr += 7; 68 ptr += 7;
93 else if (strncmp(ptr, "open /home", 10) == 0) 69 else if (strncmp(ptr, "open /home", 10) == 0)
94 ptr += 5; 70 ptr += 5;
71 else if (strncmp(ptr, "opendir /home", 13) == 0)
72 ptr += 8;
95 else 73 else
96 continue; 74 continue;
97 75
@@ -107,17 +85,17 @@ void process_home(const char *fname, char *home, int home_len) {
107 if (strcmp(ptr, home) == 0) 85 if (strcmp(ptr, home) == 0)
108 continue; 86 continue;
109 ptr += home_len + 1; 87 ptr += home_len + 1;
110 88
111 // skip files handled automatically by firejail 89 // skip files handled automatically by firejail
112 if (strcmp(ptr, ".Xauthority") == 0 || 90 if (strcmp(ptr, ".Xauthority") == 0 ||
113 strcmp(ptr, ".Xdefaults-debian") == 0 || 91 strcmp(ptr, ".Xdefaults-debian") == 0 ||
114 strncmp(ptr, ".config/pulse/", 13) == 0 || 92 strncmp(ptr, ".config/pulse/", 14) == 0 ||
115 strncmp(ptr, ".pulse/", 7) == 0 || 93 strncmp(ptr, ".pulse/", 7) == 0 ||
116 strncmp(ptr, ".bash_hist", 10) == 0 || 94 strncmp(ptr, ".bash_hist", 10) == 0 ||
117 strcmp(ptr, ".bashrc") == 0) 95 strcmp(ptr, ".bashrc") == 0)
118 continue; 96 continue;
119 97
120 98
121 // try to find the relevant directory for this file 99 // try to find the relevant directory for this file
122 char *dir = extract_dir(ptr); 100 char *dir = extract_dir(ptr);
123 char *toadd = (dir)? dir: ptr; 101 char *toadd = (dir)? dir: ptr;
@@ -141,7 +119,7 @@ void process_home(const char *fname, char *home, int home_len) {
141 } 119 }
142 120
143 // skip files and directories in whitelist-common.inc 121 // skip files and directories in whitelist-common.inc
144 if (filedb_find(db_skip, toadd)) { 122 if (strlen(toadd) == 0 || filedb_find(db_skip, toadd)) {
145 if (dir) 123 if (dir)
146 free(dir); 124 free(dir);
147 continue; 125 continue;
@@ -158,11 +136,11 @@ void process_home(const char *fname, char *home, int home_len) {
158 136
159 137
160// process fname, fname.1, fname.2, fname.3, fname.4, fname.5 138// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
161void build_home(const char *fname) { 139void build_home(const char *fname, FILE *fp) {
162 assert(fname); 140 assert(fname);
163 141
164 // load whitelist common 142 // load whitelist common
165 load_whitelist_common(); 143 db_skip = filedb_load_whitelist(db_skip, "whitelist-common.inc", "allow ${HOME}/");
166 144
167 // find user home directory 145 // find user home directory
168 struct passwd *pw = getpwuid(getuid()); 146 struct passwd *pw = getpwuid(getuid());
@@ -172,10 +150,10 @@ void build_home(const char *fname) {
172 if (!home) 150 if (!home)
173 errExit("getpwuid"); 151 errExit("getpwuid");
174 int home_len = strlen(home); 152 int home_len = strlen(home);
175 153
176 // run fname 154 // run fname
177 process_home(fname, home, home_len); 155 process_home(fname, home, home_len);
178 156
179 // run all the rest 157 // run all the rest
180 struct stat s; 158 struct stat s;
181 int i; 159 int i;
@@ -187,13 +165,13 @@ void build_home(const char *fname) {
187 process_home(newname, home, home_len); 165 process_home(newname, home, home_len);
188 free(newname); 166 free(newname);
189 } 167 }
190 168
191 // print the out list if any 169 // print the out list if any
192 if (db_out) { 170 if (db_out) {
193 filedb_print(db_out, "whitelist ~/"); 171 filedb_print(db_out, "allow ${HOME}/", fp);
194 printf("include /etc/firejail/whitelist-common.inc\n"); 172 fprintf(fp, "include whitelist-common.inc\n");
195 } 173 }
196 else 174 else
197 printf("private\n"); 175 fprintf(fp, "private\n");
198 176
199} \ No newline at end of file 177}
diff --git a/src/fbuilder/build_profile.c b/src/fbuilder/build_profile.c
index 0f71fe7ad..0b9a99739 100644
--- a/src/fbuilder/build_profile.c
+++ b/src/fbuilder/build_profile.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,72 +20,48 @@
20 20
21#include "fbuilder.h" 21#include "fbuilder.h"
22#include <sys/wait.h> 22#include <sys/wait.h>
23#include <fcntl.h>
24
25#define TRACE_OUTPUT "/tmp/firejail-trace"
26#define STRACE_OUTPUT "/tmp/firejail-strace"
27
28static char *cmdlist[] = {
29 "/usr/bin/firejail",
30 "--quiet",
31 "--output=" TRACE_OUTPUT,
32 "--noprofile",
33 "--caps.drop=all",
34 "--nonewprivs",
35 "--trace",
36 "--shell=none",
37 "/usr/bin/strace", // also used as a marker in build_profile()
38 "-c",
39 "-f",
40 "-o" STRACE_OUTPUT,
41};
42
43static void clear_tmp_files(void) {
44 unlink(STRACE_OUTPUT);
45 unlink(TRACE_OUTPUT);
46
47 // run all the rest
48 int i;
49 for (i = 1; i <= 5; i++) {
50 char *newname;
51 if (asprintf(&newname, "%s.%d", TRACE_OUTPUT, i) == -1)
52 errExit("asprintf");
53 unlink(newname);
54 free(newname);
55 }
56 23
57} 24#define TRACE_OUTPUT "/tmp/firejail-trace.XXXXXX"
25#define STRACE_OUTPUT "/tmp/firejail-strace.XXXXXX"
58 26
59void build_profile(int argc, char **argv, int index) { 27void build_profile(int argc, char **argv, int index, FILE *fp) {
60 // next index is the application name 28 // next index is the application name
61 if (index >= argc) { 29 if (index >= argc) {
62 fprintf(stderr, "Error: application name missing\n"); 30 fprintf(stderr, "Error: application name missing\n");
63 exit(1); 31 exit(1);
64 } 32 }
65 33
66 // clean /tmp files 34 char trace_output[] = "/tmp/firejail-trace.XXXXXX";
67 clear_tmp_files(); 35 int tfile = mkstemp(trace_output);
68 36 if(tfile == -1)
69 // detect strace 37 errExit("mkstemp");
70 int have_strace = 0; 38 close(tfile);
71 if (access("/usr/bin/strace", X_OK) == 0) 39
72 have_strace = 1; 40 char *output;
73 41 if(asprintf(&output,"--trace=%s",trace_output) == -1)
42 errExit("asprintf");
43
44 char *cmdlist[] = {
45 BINDIR "/firejail",
46 "--quiet",
47 "--noprofile",
48 "--caps.drop=all",
49 "--seccomp",
50 output,
51 "--shell=none",
52 };
53
74 // calculate command length 54 // calculate command length
75 int len = (int) sizeof(cmdlist) / sizeof(char*) + argc - index + 1; 55 unsigned len = (int) sizeof(cmdlist) / sizeof(char*) + argc - index + 1;
76 if (arg_debug) 56 if (arg_debug)
77 printf("command len %d + %d + 1\n", (int) (sizeof(cmdlist) / sizeof(char*)), argc - index); 57 printf("command len %d + %d + 1\n", (int) (sizeof(cmdlist) / sizeof(char*)), argc - index);
78 char *cmd[len]; 58 char *cmd[len];
79 cmd[0] = cmdlist[0]; // explicit assignemnt to clean scan-build error 59 cmd[0] = cmdlist[0]; // explicit assignment to clean scan-build error
80 60
81 // build command 61 // build command
82 int i = 0; 62 unsigned i = 0;
83 for (i = 0; i < (int) sizeof(cmdlist) / sizeof(char*); i++) { 63 for (i = 0; i < (int) sizeof(cmdlist) / sizeof(char*); i++)
84 // skip strace if not installed
85 if (have_strace == 0 && strcmp(cmdlist[i], "/usr/bin/strace") == 0)
86 break;
87 cmd[i] = cmdlist[i]; 64 cmd[i] = cmdlist[i];
88 }
89 65
90 int i2 = index; 66 int i2 = index;
91 for (; i < (len - 1); i++, i2++) 67 for (; i < (len - 1); i++, i2++)
@@ -95,9 +71,9 @@ void build_profile(int argc, char **argv, int index) {
95 71
96 if (arg_debug) { 72 if (arg_debug) {
97 for (i = 0; i < len; i++) 73 for (i = 0; i < len; i++)
98 printf("\t%s\n", cmd[i]); 74 printf("%s%s\n", (i)?"\t":"", cmd[i]);
99 } 75 }
100 76
101 // fork and execute 77 // fork and execute
102 pid_t child = fork(); 78 pid_t child = fork();
103 if (child == -1) 79 if (child == -1)
@@ -108,59 +84,88 @@ void build_profile(int argc, char **argv, int index) {
108 (void) rv; 84 (void) rv;
109 errExit("execv"); 85 errExit("execv");
110 } 86 }
111 87
112 // wait for all processes to finish 88 // wait for all processes to finish
113 int status; 89 int status;
114 if (waitpid(child, &status, 0) != child) 90 if (waitpid(child, &status, 0) != child)
115 errExit("waitpid"); 91 errExit("waitpid");
116 92
117 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { 93 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
118 printf("\n\n\n"); 94 if (fp == stdout)
119 printf("############################################\n"); 95 printf("--- Built profile beings after this line ---\n");
120 printf("# %s profile\n", argv[index]); 96 fprintf(fp, "# Save this file as \"application.profile\" (change \"application\" with the\n");
121 printf("############################################\n"); 97 fprintf(fp, "# program name) in ~/.config/firejail directory. Firejail will find it\n");
122 printf("# Persistent global definitions\n"); 98 fprintf(fp, "# automatically every time you sandbox your application.\n#\n");
123 printf("# include /etc/firejail/globals.local\n"); 99 fprintf(fp, "# Run \"firejail application\" to test it. In the file there are\n");
124 printf("\n"); 100 fprintf(fp, "# some other commands you can try. Enable them by removing the \"#\".\n\n");
125 101
126 printf("### basic blacklisting\n"); 102 fprintf(fp, "# Firejail profile for %s\n", argv[index]);
127 printf("include /etc/firejail/disable-common.inc\n"); 103 fprintf(fp, "# Persistent local customizations\n");
128 printf("# include /etc/firejail/disable-devel.inc\n"); 104 fprintf(fp, "#include %s.local\n", argv[index]);
129 printf("include /etc/firejail/disable-passwdmgr.inc\n"); 105 fprintf(fp, "# Persistent global definitions\n");
130 printf("# include /etc/firejail/disable-programs.inc\n"); 106 fprintf(fp, "#include globals.local\n");
131 printf("\n"); 107 fprintf(fp, "\n");
132 108
133 printf("### home directory whitelisting\n"); 109 fprintf(fp, "### Basic Blacklisting ###\n");
134 build_home(TRACE_OUTPUT); 110 fprintf(fp, "### Enable as many of them as you can! A very important one is\n");
135 printf("\n"); 111 fprintf(fp, "### \"disable-exec.inc\". This will make among other things your home\n");
136 112 fprintf(fp, "### and /tmp directories non-executable.\n");
137 printf("### filesystem\n"); 113 fprintf(fp, "include disable-common.inc\t# dangerous directories like ~/.ssh and ~/.gnupg\n");
138 build_tmp(TRACE_OUTPUT); 114 fprintf(fp, "#include disable-devel.inc\t# development tools such as gcc and gdb\n");
139 build_dev(TRACE_OUTPUT); 115 fprintf(fp, "#include disable-exec.inc\t# non-executable directories such as /var, /tmp, and /home\n");
140 build_etc(TRACE_OUTPUT); 116 fprintf(fp, "#include disable-interpreters.inc\t# perl, python, lua etc.\n");
141 build_var(TRACE_OUTPUT); 117 fprintf(fp, "include disable-programs.inc\t# user configuration for programs such as firefox, vlc etc.\n");
142 build_bin(TRACE_OUTPUT); 118 fprintf(fp, "#include disable-shell.inc\t# sh, bash, zsh etc.\n");
143 printf("\n"); 119 fprintf(fp, "#include disable-xdg.inc\t# standard user directories: Documents, Pictures, Videos, Music\n");
144 120 fprintf(fp, "\n");
145 printf("### security filters\n"); 121
146 printf("caps.drop all\n"); 122 fprintf(fp, "### Home Directory Whitelisting ###\n");
147 printf("nonewprivs\n"); 123 fprintf(fp, "### If something goes wrong, this section is the first one to comment out.\n");
148 printf("seccomp\n"); 124 fprintf(fp, "### Instead, you'll have to relay on the basic blacklisting above.\n");
149 if (have_strace) 125 build_home(trace_output, fp);
150 build_seccomp(STRACE_OUTPUT); 126 fprintf(fp, "\n");
151 else { 127
152 printf("# If you install strace on your system, Firejail will also create a\n"); 128 fprintf(fp, "### Filesystem Whitelisting ###\n");
153 printf("# whitelisted seccomp filter.\n"); 129 build_share(trace_output, fp);
154 } 130 //todo: include whitelist-runuser-common.inc
155 printf("\n"); 131 build_var(trace_output, fp);
156 132 fprintf(fp, "\n");
157 printf("### network\n"); 133
158 build_protocol(TRACE_OUTPUT); 134 fprintf(fp, "#apparmor\t# if you have AppArmor running, try this one!\n");
159 printf("\n"); 135 fprintf(fp, "caps.drop all\n");
160 136 fprintf(fp, "ipc-namespace\n");
161 printf("### environment\n"); 137 fprintf(fp, "netfilter\n");
162 printf("shell none\n"); 138 fprintf(fp, "#no3d\t# disable 3D acceleration\n");
139 fprintf(fp, "#nodvd\t# disable DVD and CD devices\n");
140 fprintf(fp, "#nogroups\t# disable supplementary user groups\n");
141 fprintf(fp, "#noinput\t# disable input devices\n");
142 fprintf(fp, "nonewprivs\n");
143 fprintf(fp, "noroot\n");
144 fprintf(fp, "#notv\t# disable DVB TV devices\n");
145 fprintf(fp, "#nou2f\t# disable U2F devices\n");
146 fprintf(fp, "#novideo\t# disable video capture devices\n");
147 build_protocol(trace_output, fp);
148 fprintf(fp, "seccomp\n");
149 fprintf(fp, "shell none\n");
150 fprintf(fp, "tracelog\n");
151 fprintf(fp, "\n");
152
153 fprintf(fp, "#disable-mnt\t# no access to /mnt, /media, /run/mount and /run/media\n");
154 build_bin(trace_output, fp);
155 fprintf(fp, "#private-cache\t# run with an empty ~/.cache directory\n");
156 build_dev(trace_output, fp);
157 build_etc(trace_output, fp);
158 fprintf(fp, "#private-lib\n");
159 build_tmp(trace_output, fp);
160 fprintf(fp, "\n");
161
162 fprintf(fp, "#dbus-user none\n");
163 fprintf(fp, "#dbus-system none\n");
164 fprintf(fp, "\n");
165 fprintf(fp, "#memory-deny-write-execute\n");
163 166
167 if (!arg_debug)
168 unlink(trace_output);
164 } 169 }
165 else { 170 else {
166 fprintf(stderr, "Error: cannot run the sandbox\n"); 171 fprintf(stderr, "Error: cannot run the sandbox\n");
diff --git a/src/fbuilder/build_seccomp.c b/src/fbuilder/build_seccomp.c
index 18a767518..daf8d63ac 100644
--- a/src/fbuilder/build_seccomp.c
+++ b/src/fbuilder/build_seccomp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,25 +20,27 @@
20 20
21#include "fbuilder.h" 21#include "fbuilder.h"
22 22
23void build_seccomp(const char *fname) { 23#if 0
24void build_seccomp(const char *fname, FILE *fp) {
24 assert(fname); 25 assert(fname);
25 26 assert(fp);
26 FILE *fp = fopen(fname, "r"); 27
27 if (!fp) { 28 FILE *fp2 = fopen(fname, "r");
29 if (!fp2) {
28 fprintf(stderr, "Error: cannot open %s\n", fname); 30 fprintf(stderr, "Error: cannot open %s\n", fname);
29 exit(1); 31 exit(1);
30 } 32 }
31 33
32 char buf[MAX_BUF]; 34 char buf[MAX_BUF];
33 int line = 1; 35 int line = 1;
34 int position = 0; 36 int position = 0;
35 int cnt = 0; 37 int cnt = 0;
36 while (fgets(buf, MAX_BUF, fp)) { 38 while (fgets(buf, MAX_BUF, fp2)) {
37 // remove \n 39 // remove \n
38 char *ptr = strchr(buf, '\n'); 40 char *ptr = strchr(buf, '\n');
39 if (ptr) 41 if (ptr)
40 *ptr = '\0'; 42 *ptr = '\0';
41 43
42 // first line: 44 // first line:
43 //% time seconds usecs/call calls errors syscall 45 //% time seconds usecs/call calls errors syscall
44 if (line == 1) { 46 if (line == 1) {
@@ -60,49 +62,51 @@ void build_seccomp(const char *fname) {
60 // get out on the next "----" line 62 // get out on the next "----" line
61 if (*buf == '-') 63 if (*buf == '-')
62 break; 64 break;
63 65
64 if (line == 3) 66 if (line == 3)
65 printf("# seccomp.keep %s", buf + position); 67 fprintf(fp, "# seccomp.keep %s", buf + position);
66 else 68 else
67 printf(",%s", buf + position); 69 fprintf(fp, ",%s", buf + position);
68 cnt++; 70 cnt++;
69 } 71 }
70 line++; 72 line++;
71 } 73 }
72 printf("\n"); 74 fprintf(fp, "\n");
73 printf("# %d syscalls total\n", cnt); 75 fprintf(fp, "# %d syscalls total\n", cnt);
74 printf("# Probably you will need to add more syscalls to seccomp.keep. Look for\n"); 76 fprintf(fp, "# Probably you will need to add more syscalls to seccomp.keep. Look for\n");
75 printf("# seccomp errors in /var/log/syslog or /var/log/audit/audit.log while\n"); 77 fprintf(fp, "# seccomp errors in /var/log/syslog or /var/log/audit/audit.log while\n");
76 printf("# running your sandbox.\n"); 78 fprintf(fp, "# running your sandbox.\n");
77 79
78 fclose(fp); 80 fclose(fp2);
79} 81}
82#endif
80 83
81//*************************************** 84//***************************************
82// protocol 85// protocol
83//*************************************** 86//***************************************
84int unix_s = 0; 87static int unix_s = 0;
85int inet = 0; 88static int inet = 0;
86int inet6 = 0; 89static int inet6 = 0;
87int netlink = 0; 90static int netlink = 0;
88int packet = 0; 91static int packet = 0;
92static int bluetooth = 0;
89static void process_protocol(const char *fname) { 93static void process_protocol(const char *fname) {
90 assert(fname); 94 assert(fname);
91 95
92 // process trace file 96 // process trace file
93 FILE *fp = fopen(fname, "r"); 97 FILE *fp = fopen(fname, "r");
94 if (!fp) { 98 if (!fp) {
95 fprintf(stderr, "Error: cannot open %s\n", fname); 99 fprintf(stderr, "Error: cannot open %s\n", fname);
96 exit(1); 100 exit(1);
97 } 101 }
98 102
99 char buf[MAX_BUF]; 103 char buf[MAX_BUF];
100 while (fgets(buf, MAX_BUF, fp)) { 104 while (fgets(buf, MAX_BUF, fp)) {
101 // remove \n 105 // remove \n
102 char *ptr = strchr(buf, '\n'); 106 char *ptr = strchr(buf, '\n');
103 if (ptr) 107 if (ptr)
104 *ptr = '\0'; 108 *ptr = '\0';
105 109
106 // parse line: 4:galculator:access /etc/fonts/conf.d:0 110 // parse line: 4:galculator:access /etc/fonts/conf.d:0
107 // number followed by : 111 // number followed by :
108 ptr = buf; 112 ptr = buf;
@@ -130,23 +134,25 @@ static void process_protocol(const char *fname) {
130 inet = 1; 134 inet = 1;
131 else if (strncmp(ptr, "AF_INET6 ", 9) == 0) 135 else if (strncmp(ptr, "AF_INET6 ", 9) == 0)
132 inet6 = 1; 136 inet6 = 1;
133 else if (strncmp(ptr, "AF_NETLINK ", 9) == 0) 137 else if (strncmp(ptr, "AF_NETLINK ", 11) == 0)
134 netlink = 1; 138 netlink = 1;
135 else if (strncmp(ptr, "AF_PACKET ", 9) == 0) 139 else if (strncmp(ptr, "AF_PACKET ", 10) == 0)
136 packet = 1; 140 packet = 1;
141 else if (strncmp(ptr, "AF_BLUETOOTH ", 13) == 0)
142 bluetooth = 1;
137 } 143 }
138 144
139 fclose(fp); 145 fclose(fp);
140} 146}
141 147
142 148
143// process fname, fname.1, fname.2, fname.3, fname.4, fname.5 149// process fname, fname.1, fname.2, fname.3, fname.4, fname.5
144void build_protocol(const char *fname) { 150void build_protocol(const char *fname, FILE *fp) {
145 assert(fname); 151 assert(fname);
146 152
147 // run fname 153 // run fname
148 process_protocol(fname); 154 process_protocol(fname);
149 155
150 // run all the rest 156 // run all the rest
151 struct stat s; 157 struct stat s;
152 int i; 158 int i;
@@ -158,34 +164,33 @@ void build_protocol(const char *fname) {
158 process_protocol(newname); 164 process_protocol(newname);
159 free(newname); 165 free(newname);
160 } 166 }
161 167
162 int net = 0; 168 int net = 0;
163 if (unix_s || inet || inet6 || netlink || packet) { 169 if (unix_s || inet || inet6 || netlink || packet || bluetooth) {
164 printf("protocol "); 170 fprintf(fp, "protocol ");
165 if (unix_s) 171 if (unix_s)
166 printf("unix,"); 172 fprintf(fp, "unix,");
167 if (inet) { 173 if (inet || inet6) {
168 printf("inet,"); 174 fprintf(fp, "inet,inet6,");
169 net = 1;
170 }
171 if (inet6) {
172 printf("inet6,");
173 net = 1; 175 net = 1;
174 } 176 }
175 if (netlink) 177 if (netlink)
176 printf("netlink,"); 178 fprintf(fp, "netlink,");
177 if (packet) { 179 if (packet) {
178 printf("packet"); 180 fprintf(fp, "packet,");
179 net = 1; 181 net = 1;
180 } 182 }
181 printf("\n"); 183 if (bluetooth) {
184 fprintf(fp, "bluetooth");
185 net = 1;
186 }
187 fprintf(fp, "\n");
182 } 188 }
183 189
184 if (net == 0) 190 if (net == 0)
185 printf("net none\n"); 191 fprintf(fp, "net none\n");
186 else { 192 else {
187 printf("# net eth0\n"); 193 fprintf(fp, "# net eth0\n");
188 printf("netfilter\n"); 194 fprintf(fp, "netfilter\n");
189 } 195 }
190} 196}
191
diff --git a/src/fbuilder/fbuilder.h b/src/fbuilder/fbuilder.h
index c448f3e06..08dd35e10 100644
--- a/src/fbuilder/fbuilder.h
+++ b/src/fbuilder/fbuilder.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,30 +25,32 @@
25#include <pwd.h> 25#include <pwd.h>
26#include <sys/types.h> 26#include <sys/types.h>
27#include <sys/stat.h> 27#include <sys/stat.h>
28 28#include <fcntl.h>
29
29 30
30#define MAX_BUF 4096 31#define MAX_BUF 4096
31// main.c 32// main.c
32extern int arg_debug; 33extern int arg_debug;
33 34
34// build_profile.c 35// build_profile.c
35void build_profile(int argc, char **argv, int index); 36void build_profile(int argc, char **argv, int index, FILE *fp);
36 37
37// build_seccomp.c 38// build_seccomp.c
38void build_seccomp(const char *fname); 39void build_seccomp(const char *fname, FILE *fp);
39void build_protocol(const char *fname); 40void build_protocol(const char *fname, FILE *fp);
40 41
41// build_fs.c 42// build_fs.c
42void build_etc(const char *fname); 43void build_etc(const char *fname, FILE *fp);
43void build_var(const char *fname); 44void build_var(const char *fname, FILE *fp);
44void build_tmp(const char *fname); 45void build_tmp(const char *fname, FILE *fp);
45void build_dev(const char *fname); 46void build_dev(const char *fname, FILE *fp);
47void build_share(const char *fname, FILE *fp);
46 48
47// build_bin.c 49// build_bin.c
48void build_bin(const char *fname); 50void build_bin(const char *fname, FILE *fp);
49 51
50// build_home.c 52// build_home.c
51void build_home(const char *fname); 53void build_home(const char *fname, FILE *fp);
52 54
53// utils.c 55// utils.c
54int is_dir(const char *fname); 56int is_dir(const char *fname);
@@ -63,6 +65,7 @@ typedef struct filedb_t {
63 65
64FileDB *filedb_add(FileDB *head, const char *fname); 66FileDB *filedb_add(FileDB *head, const char *fname);
65FileDB *filedb_find(FileDB *head, const char *fname); 67FileDB *filedb_find(FileDB *head, const char *fname);
66void filedb_print(FileDB *head, const char *prefix); 68void filedb_print(FileDB *head, const char *prefix, FILE *fp);
69FileDB *filedb_load_whitelist(FileDB *head, const char *fname, const char *prefix);
67 70
68#endif \ No newline at end of file 71#endif
diff --git a/src/fbuilder/filedb.c b/src/fbuilder/filedb.c
index a76fbc961..94a226cb7 100644
--- a/src/fbuilder/filedb.c
+++ b/src/fbuilder/filedb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,18 +20,20 @@
20 20
21#include "fbuilder.h" 21#include "fbuilder.h"
22 22
23// find exact name or an exact name in a parent directory
23FileDB *filedb_find(FileDB *head, const char *fname) { 24FileDB *filedb_find(FileDB *head, const char *fname) {
25 assert(fname);
24 FileDB *ptr = head; 26 FileDB *ptr = head;
25 int found = 0; 27 int found = 0;
26 int len = strlen(fname); 28 int len = strlen(fname);
27 29
28 while (ptr) { 30 while (ptr) {
29 // exact name 31 // exact name
30 if (strcmp(fname, ptr->fname) == 0) { 32 if (strcmp(fname, ptr->fname) == 0) {
31 found = 1; 33 found = 1;
32 break; 34 break;
33 } 35 }
34 36
35 // parent directory in the list 37 // parent directory in the list
36 if (len > ptr->len && 38 if (len > ptr->len &&
37 fname[ptr->len] == '/' && 39 fname[ptr->len] == '/' &&
@@ -42,20 +44,22 @@ FileDB *filedb_find(FileDB *head, const char *fname) {
42 44
43 ptr = ptr->next; 45 ptr = ptr->next;
44 } 46 }
45 47
46 if (found) 48 if (found)
47 return ptr; 49 return ptr;
48 50
49 return NULL; 51 return NULL;
50} 52}
51 53
52FileDB *filedb_add(FileDB *head, const char *fname) { 54FileDB *filedb_add(FileDB *head, const char *fname) {
53 assert(fname); 55 assert(fname);
54 56
57 // todo: support fnames such as ${RUNUSER}/.mutter-Xwaylandauth.*
58
55 // don't add it if it is already there or if the parent directory is already in the list 59 // don't add it if it is already there or if the parent directory is already in the list
56 if (filedb_find(head, fname)) 60 if (filedb_find(head, fname))
57 return head; 61 return head;
58 62
59 // add a new entry 63 // add a new entry
60 FileDB *entry = malloc(sizeof(FileDB)); 64 FileDB *entry = malloc(sizeof(FileDB));
61 if (!entry) 65 if (!entry)
@@ -69,11 +73,53 @@ FileDB *filedb_add(FileDB *head, const char *fname) {
69 return entry; 73 return entry;
70}; 74};
71 75
72void filedb_print(FileDB *head, const char *prefix) { 76void filedb_print(FileDB *head, const char *prefix, FILE *fp) {
77 assert(head);
78 assert(prefix);
79
73 FileDB *ptr = head; 80 FileDB *ptr = head;
74 while (ptr) { 81 while (ptr) {
75 printf("%s%s\n", prefix, ptr->fname); 82 if (fp)
83 fprintf(fp, "%s%s\n", prefix, ptr->fname);
84 else
85 printf("%s%s\n", prefix, ptr->fname);
76 ptr = ptr->next; 86 ptr = ptr->next;
77 } 87 }
78} 88}
79 89
90FileDB *filedb_load_whitelist(FileDB *head, const char *fname, const char *prefix) {
91 assert(fname);
92 assert(prefix);
93 int len = strlen(prefix);
94 char *f;
95 if (asprintf(&f, "%s/%s", SYSCONFDIR, fname) == -1)
96 errExit("asprintf");
97 FILE *fp = fopen(f, "r");
98 if (!fp) {
99 fprintf(stderr, "Error: cannot open whitelist-common.inc\n");
100 free(f);
101 exit(1);
102 }
103
104 char buf[MAX_BUF];
105 while (fgets(buf, MAX_BUF, fp)) {
106 if (strncmp(buf, prefix, len) != 0)
107 continue;
108
109 char *fn = buf + len;
110 char *ptr = strchr(buf, '\n');
111 if (!ptr)
112 continue;
113 *ptr = '\0';
114
115 // add the file to skip list
116 head = filedb_add(head, fn);
117 }
118
119 fclose(fp);
120 free(f);
121//printf("***************************************************\n");
122//filedb_print(head, prefix, NULL);
123//printf("***************************************************\n");
124 return head;
125}
diff --git a/src/fbuilder/main.c b/src/fbuilder/main.c
index 83217ef98..6c9fc507c 100644
--- a/src/fbuilder/main.c
+++ b/src/fbuilder/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -22,7 +22,7 @@ int arg_debug = 0;
22 22
23static void usage(void) { 23static void usage(void) {
24 printf("Firejail profile builder\n"); 24 printf("Firejail profile builder\n");
25 printf("Usage: firejail [--debug] --build program-and-arguments\n"); 25 printf("Usage: firejail [--debug] --build[=profile-file] program-and-arguments\n");
26} 26}
27 27
28int main(int argc, char **argv) { 28int main(int argc, char **argv) {
@@ -38,7 +38,9 @@ printf("\n");
38 38
39 int i; 39 int i;
40 int prog_index = 0; 40 int prog_index = 0;
41 41 FILE *fp = stdout;
42 char *prof_file = NULL;
43
42 // parse arguments and extract program index 44 // parse arguments and extract program index
43 for (i = 1; i < argc; i++) { 45 for (i = 1; i < argc; i++) {
44 if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-?") ==0) { 46 if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-?") ==0) {
@@ -49,9 +51,30 @@ printf("\n");
49 arg_debug = 1; 51 arg_debug = 1;
50 else if (strcmp(argv[i], "--build") == 0) 52 else if (strcmp(argv[i], "--build") == 0)
51 ; // do nothing, this is passed down from firejail 53 ; // do nothing, this is passed down from firejail
54 else if (strncmp(argv[i], "--build=", 8) == 0) {
55 // this option is only supported for non-root users
56 if (getuid() == 0) {
57 fprintf(stderr, "Error fbuild: --build=profile-name is not supported for root user.\n");
58 exit(1);
59 }
60
61 // don't run if the file exists
62 if (access(argv[i] + 8, F_OK) == 0) {
63 fprintf(stderr, "Error: the profile file already exists. Please use a different file name.\n");
64 exit(1);
65 }
66
67 // check file access
68 fp = fopen(argv[i] + 8, "w");
69 if (!fp) {
70 fprintf(stderr, "Error: cannot open profile file.\n");
71 exit(1);
72 }
73 prof_file = argv[i] + 8;
74 }
52 else { 75 else {
53 if (*argv[i] == '-') { 76 if (*argv[i] == '-') {
54 fprintf(stderr, "Error fbuilder: invalid program\n"); 77 fprintf(stderr, "Error: invalid program\n");
55 usage(); 78 usage();
56 exit(1); 79 exit(1);
57 } 80 }
@@ -59,13 +82,20 @@ printf("\n");
59 break; 82 break;
60 } 83 }
61 } 84 }
62 85
63 if (prog_index == 0) { 86 if (prog_index == 0) {
64 fprintf(stderr, "Error fbuilder: program and arguments required\n"); 87 fprintf(stderr, "Error : program and arguments required\n");
65 usage(); 88 usage();
89 if (prof_file) {
90 fclose(fp);
91 int rv = unlink(prof_file);
92 (void) rv;
93 }
66 exit(1); 94 exit(1);
67 } 95 }
68 96
69 build_profile(argc, argv, prog_index); 97 build_profile(argc, argv, prog_index, fp);
98 if (prof_file)
99 fclose(fp);
70 return 0; 100 return 0;
71} 101}
diff --git a/src/fbuilder/utils.c b/src/fbuilder/utils.c
index 902290899..52493f470 100644
--- a/src/fbuilder/utils.c
+++ b/src/fbuilder/utils.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -56,17 +56,17 @@ char *extract_dir(char *fname) {
56 assert(fname); 56 assert(fname);
57 if (is_dir(fname)) 57 if (is_dir(fname))
58 return NULL; 58 return NULL;
59 59
60 char *name = strdup(fname); 60 char *name = strdup(fname);
61 if (!name) 61 if (!name)
62 errExit("strdup"); 62 errExit("strdup");
63 63
64 char *ptr = strrchr(name, '/'); 64 char *ptr = strrchr(name, '/');
65 if (!ptr) { 65 if (!ptr) {
66 free(name); 66 free(name);
67 return NULL; 67 return NULL;
68 } 68 }
69 *ptr = '\0'; 69 *ptr = '\0';
70 70
71 return name; 71 return name;
72} 72}
diff --git a/src/fcopy/Makefile.in b/src/fcopy/Makefile.in
index ad08f543e..e19f5d3b5 100644
--- a/src/fcopy/Makefile.in
+++ b/src/fcopy/Makefile.in
@@ -1,45 +1,17 @@
1.PHONY: all
1all: fcopy 2all: fcopy
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8
9VERSION=@PACKAGE_VERSION@
10NAME=@PACKAGE_NAME@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
26HAVE_GCOV=@HAVE_GCOV@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28
29H_FILE_LIST = $(sort $(wildcard *.[h]))
30C_FILE_LIST = $(sort $(wildcard *.c))
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35 5
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
38 8
39fcopy: $(OBJS) 9fcopy: $(OBJS) ../lib/common.o
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o $(LIBS) $(EXTRA_LDFLAGS)
41 11
42clean:; rm -f *.o fcopy *.gcov *.gcda *.gcno 12.PHONY: clean
13clean:; rm -fr *.o fcopy *.gcov *.gcda *.gcno *.plist
43 14
15.PHONY: distclean
44distclean: clean 16distclean: clean
45 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/fcopy/main.c b/src/fcopy/main.c
index e7b4ffa8a..31810de9a 100644
--- a/src/fcopy/main.c
+++ b/src/fcopy/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,28 +19,97 @@
19 */ 19 */
20 20
21#include "../include/common.h" 21#include "../include/common.h"
22#include <fcntl.h>
23#include <ftw.h> 22#include <ftw.h>
24#include <errno.h> 23#include <errno.h>
25#include <pwd.h> 24#include <pwd.h>
26 25
26#include <fcntl.h>
27#ifndef O_PATH
28#define O_PATH 010000000
29#endif
30
31#if HAVE_SELINUX
32#include <sys/stat.h>
33#include <sys/types.h>
34
35#include <selinux/context.h>
36#include <selinux/label.h>
37#include <selinux/selinux.h>
38#endif
39
27int arg_quiet = 0; 40int arg_quiet = 0;
41int arg_debug = 0;
28static int arg_follow_link = 0; 42static int arg_follow_link = 0;
29 43
30#define COPY_LIMIT (500 * 1024 *1024) 44static unsigned long copy_limit = 500 * 1024 * 1024; // 500 MB
45static unsigned long size_cnt = 0;
31static int size_limit_reached = 0; 46static int size_limit_reached = 0;
32static unsigned file_cnt = 0; 47static unsigned file_cnt = 0;
33static unsigned size_cnt = 0;
34 48
35static char *outpath = NULL; 49static char *outpath = NULL;
36static char *inpath = NULL; 50static char *inpath = NULL;
37 51
52#if HAVE_SELINUX
53static struct selabel_handle *label_hnd = NULL;
54static int selinux_enabled = -1;
55#endif
56
57// copy from firejail/selinux.c
58static void selinux_relabel_path(const char *path, const char *inside_path) {
59 assert(path);
60 assert(inside_path);
61#if HAVE_SELINUX
62 char procfs_path[64];
63 char *fcon = NULL;
64 int fd;
65 struct stat st;
66
67 if (selinux_enabled == -1)
68 selinux_enabled = is_selinux_enabled();
69
70 if (!selinux_enabled)
71 return;
72
73 if (!label_hnd)
74 label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
75
76 if (!label_hnd)
77 errExit("selabel_open");
78
79 /* Open the file as O_PATH, to pin it while we determine and adjust the label */
80 fd = open(path, O_NOFOLLOW|O_CLOEXEC|O_PATH);
81 if (fd < 0)
82 return;
83 if (fstat(fd, &st) < 0)
84 goto close;
85
86 if (selabel_lookup_raw(label_hnd, &fcon, inside_path, st.st_mode) == 0) {
87 sprintf(procfs_path, "/proc/self/fd/%i", fd);
88 if (arg_debug)
89 printf("Relabeling %s as %s (%s)\n", path, inside_path, fcon);
90
91 setfilecon_raw(procfs_path, fcon);
92 }
93 freecon(fcon);
94 close:
95 close(fd);
96#else
97 (void) path;
98 (void) inside_path;
99#endif
100}
101
38// modified version of the function from util.c 102// modified version of the function from util.c
39static void copy_file(const char *srcname, const char *destname, mode_t mode, uid_t uid, gid_t gid) { 103static void copy_file(const char *srcname, const char *destname, mode_t mode, uid_t uid, gid_t gid) {
40 assert(srcname); 104 assert(srcname);
41 assert(destname); 105 assert(destname);
42 mode &= 07777; 106 mode &= 07777;
43 107
108 // don't copy the file if it is already there
109 struct stat s;
110 if (stat(destname, &s) == 0)
111 return;
112
44 // open source 113 // open source
45 int src = open(srcname, O_RDONLY); 114 int src = open(srcname, O_RDONLY);
46 if (src < 0) { 115 if (src < 0) {
@@ -50,7 +119,7 @@ static void copy_file(const char *srcname, const char *destname, mode_t mode, ui
50 } 119 }
51 120
52 // open destination 121 // open destination
53 int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, 0755); 122 int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR);
54 if (dst < 0) { 123 if (dst < 0) {
55 if (!arg_quiet) 124 if (!arg_quiet)
56 fprintf(stderr, "Warning fcopy: cannot open %s, file not copied\n", destname); 125 fprintf(stderr, "Warning fcopy: cannot open %s, file not copied\n", destname);
@@ -71,7 +140,8 @@ static void copy_file(const char *srcname, const char *destname, mode_t mode, ui
71 done += rv; 140 done += rv;
72 } 141 }
73 } 142 }
74 fflush(0); 143 if (len < 0)
144 goto errexit;
75 145
76 if (fchown(dst, uid, gid) == -1) 146 if (fchown(dst, uid, gid) == -1)
77 goto errexit; 147 goto errexit;
@@ -81,6 +151,8 @@ static void copy_file(const char *srcname, const char *destname, mode_t mode, ui
81 close(src); 151 close(src);
82 close(dst); 152 close(dst);
83 153
154 selinux_relabel_path(destname, srcname);
155
84 return; 156 return;
85 157
86errexit: 158errexit:
@@ -108,15 +180,68 @@ static void mkdir_attr(const char *fname, mode_t mode, uid_t uid, gid_t gid) {
108 } 180 }
109} 181}
110 182
183static char *proc_pid_to_self(const char *target) {
184 assert(target);
185 char *use_target = 0;
186 char *proc_pid = 0;
187
188 if (!(use_target = realpath(target, NULL)))
189 goto done;
190
191 // target is under /proc/<PID>?
192 static const char proc[] = "/proc/";
193 if (strncmp(use_target, proc, sizeof(proc) - 1))
194 goto done;
195
196 int digit = use_target[sizeof(proc) - 1];
197 if (digit < '1' || digit > '9')
198 goto done;
199
200 // check where /proc/self points to
201 static const char proc_self[] = "/proc/self";
202 if (!(proc_pid = realpath(proc_self, NULL)))
203 goto done;
204
205 // redirect /proc/PID/xxx -> /proc/self/XXX
206 size_t pfix = strlen(proc_pid);
207 if (strncmp(use_target, proc_pid, pfix))
208 goto done;
209
210 if (use_target[pfix] != 0 && use_target[pfix] != '/')
211 goto done;
212
213 char *tmp;
214 if (asprintf(&tmp, "%s%s", proc_self, use_target + pfix) != -1) {
215 if (arg_debug)
216 fprintf(stderr, "SYMLINK %s\n --> %s\n", use_target, tmp);
217 free(use_target);
218 use_target = tmp;
219 }
220 else
221 errExit("asprintf");
222
223done:
224 if (proc_pid)
225 free(proc_pid);
226 return use_target;
227}
111 228
112void copy_link(const char *target, const char *linkpath, mode_t mode, uid_t uid, gid_t gid) { 229void copy_link(const char *target, const char *linkpath, mode_t mode, uid_t uid, gid_t gid) {
113 (void) mode; 230 (void) mode;
114 (void) uid; 231 (void) uid;
115 (void) gid; 232 (void) gid;
116 char *rp = realpath(target, NULL); 233
234 // if the link is already there, don't create it
235 struct stat s;
236 if (lstat(linkpath, &s) == 0)
237 return;
238
239 char *rp = proc_pid_to_self(target);
117 if (rp) { 240 if (rp) {
118 if (symlink(rp, linkpath) == -1) 241 if (symlink(rp, linkpath) == -1) {
242 free(rp);
119 goto errout; 243 goto errout;
244 }
120 free(rp); 245 free(rp);
121 } 246 }
122 else 247 else
@@ -129,6 +254,7 @@ errout:
129} 254}
130 255
131 256
257
132static int first = 1; 258static int first = 1;
133static int fs_copydir(const char *infname, const struct stat *st, int ftype, struct FTW *sftw) { 259static int fs_copydir(const char *infname, const struct stat *st, int ftype, struct FTW *sftw) {
134 (void) st; 260 (void) st;
@@ -154,27 +280,24 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str
154 first = 0; 280 first = 0;
155 else if (!arg_quiet) 281 else if (!arg_quiet)
156 fprintf(stderr, "Warning fcopy: skipping %s, file already present\n", infname); 282 fprintf(stderr, "Warning fcopy: skipping %s, file already present\n", infname);
157 free(outfname); 283 goto out;
158 return 0;
159 } 284 }
160 285
161 // extract mode and ownership 286 // extract mode and ownership
162 if (stat(infname, &s) != 0) { 287 if (stat(infname, &s) != 0) {
163 if (!arg_quiet) 288 if (!arg_quiet)
164 fprintf(stderr, "Warning fcopy: skipping %s, cannot find inode\n", infname); 289 fprintf(stderr, "Warning fcopy: skipping %s, cannot find inode\n", infname);
165 free(outfname); 290 goto out;
166 return 0;
167 } 291 }
168 uid_t uid = s.st_uid; 292 uid_t uid = s.st_uid;
169 gid_t gid = s.st_gid; 293 gid_t gid = s.st_gid;
170 mode_t mode = s.st_mode; 294 mode_t mode = s.st_mode;
171 295
172 // recalculate size 296 // recalculate size
173 if ((s.st_size + size_cnt) > COPY_LIMIT) { 297 if ((s.st_size + size_cnt) > copy_limit) {
174 fprintf(stderr, "Error fcopy: size limit of %dMB reached\n", (COPY_LIMIT / 1024) / 1024); 298 fprintf(stderr, "Error fcopy: size limit of %lu MB reached\n", (copy_limit / 1024) / 1024);
175 size_limit_reached = 1; 299 size_limit_reached = 1;
176 free(outfname); 300 goto out;
177 return 0;
178 } 301 }
179 302
180 file_cnt++; 303 file_cnt++;
@@ -189,7 +312,8 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str
189 else if (ftype == FTW_SL) { 312 else if (ftype == FTW_SL) {
190 copy_link(infname, outfname, mode, uid, gid); 313 copy_link(infname, outfname, mode, uid, gid);
191 } 314 }
192 315out:
316 free(outfname);
193 return(0); 317 return(0);
194} 318}
195 319
@@ -204,7 +328,7 @@ static char *check(const char *src) {
204 // /run/systemd/resolve/resolv.conf; this file is owned by systemd-resolve user 328 // /run/systemd/resolve/resolv.conf; this file is owned by systemd-resolve user
205 // checking gid will fail for files with a larger group such as /usr/bin/mutt_dotlock 329 // checking gid will fail for files with a larger group such as /usr/bin/mutt_dotlock
206 uid_t user = getuid(); 330 uid_t user = getuid();
207 if (user == 0 && strcmp(rsrc, "/run/systemd/resolve/resolv.conf") == 0) { 331 if (user == 0 && strncmp(rsrc, "/run/systemd/resolve/", 21) == 0) {
208 // check user systemd-resolve 332 // check user systemd-resolve
209 struct passwd *p = getpwnam("systemd-resolve"); 333 struct passwd *p = getpwnam("systemd-resolve");
210 if (!p) 334 if (!p)
@@ -222,7 +346,8 @@ static char *check(const char *src) {
222 return rsrc; // normal exit from the function 346 return rsrc; // normal exit from the function
223 347
224errexit: 348errexit:
225 fprintf(stderr, "Error fcopy: invalid file %s\n", src); 349 free(rsrc);
350 fprintf(stderr, "Error fcopy: invalid ownership for file %s\n", src);
226 exit(1); 351 exit(1);
227} 352}
228 353
@@ -316,6 +441,9 @@ int main(int argc, char **argv) {
316 char *quiet = getenv("FIREJAIL_QUIET"); 441 char *quiet = getenv("FIREJAIL_QUIET");
317 if (quiet && strcmp(quiet, "yes") == 0) 442 if (quiet && strcmp(quiet, "yes") == 0)
318 arg_quiet = 1; 443 arg_quiet = 1;
444 char *debug = getenv("FIREJAIL_DEBUG");
445 if (debug && strcmp(debug, "yes") == 0)
446 arg_debug = 1;
319 447
320 char *src; 448 char *src;
321 char *dest; 449 char *dest;
@@ -336,25 +464,21 @@ int main(int argc, char **argv) {
336 exit(1); 464 exit(1);
337 } 465 }
338 466
339 // trim trailing chars 467 warn_dumpable();
340 if (src[strlen(src) - 1] == '/')
341 src[strlen(src) - 1] = '\0';
342 if (dest[strlen(dest) - 1] == '/')
343 dest[strlen(dest) - 1] = '\0';
344 468
345 // check the two files; remove ending / 469 // check the two files; remove ending /
346 int len = strlen(src); 470 size_t len = strlen(src);
347 if (src[len - 1] == '/') 471 while (len > 1 && src[len - 1] == '/')
348 src[len - 1] = '\0'; 472 src[--len] = '\0';
349 if (strcspn(src, "\\*&!?\"'<>%^(){}[];,") != (size_t)len) { 473 if (strcspn(src, "\\*&!?\"'<>%^(){}[];,") != len) {
350 fprintf(stderr, "Error fcopy: invalid source file name %s\n", src); 474 fprintf(stderr, "Error fcopy: invalid source file name %s\n", src);
351 exit(1); 475 exit(1);
352 } 476 }
353 477
354 len = strlen(dest); 478 len = strlen(dest);
355 if (dest[len - 1] == '/') 479 while (len > 1 && dest[len - 1] == '/')
356 dest[len - 1] = '\0'; 480 dest[--len] = '\0';
357 if (strcspn(dest, "\\*&!?\"'<>%^(){}[];,~") != (size_t)len) { 481 if (strcspn(dest, "\\*&!?\"'<>%^(){}[];,~") != len) {
358 fprintf(stderr, "Error fcopy: invalid dest file name %s\n", dest); 482 fprintf(stderr, "Error fcopy: invalid dest file name %s\n", dest);
359 exit(1); 483 exit(1);
360 } 484 }
@@ -370,6 +494,14 @@ int main(int argc, char **argv) {
370 exit(1); 494 exit(1);
371 } 495 }
372 496
497 // extract copy limit size from env variable, if any
498 char *cl = getenv("FIREJAIL_FILE_COPY_LIMIT");
499 if (cl) {
500 copy_limit = strtoul(cl, NULL, 10) * 1024 * 1024;
501 if (arg_debug)
502 printf("file copy limit %lu bytes\n", copy_limit);
503 }
504
373 // copy files 505 // copy files
374 if ((arg_follow_link ? stat : lstat)(src, &s) == -1) { 506 if ((arg_follow_link ? stat : lstat)(src, &s) == -1) {
375 fprintf(stderr, "Error fcopy: src %s: %s\n", src, strerror(errno)); 507 fprintf(stderr, "Error fcopy: src %s: %s\n", src, strerror(errno));
diff --git a/src/fgit/fgit-install.sh b/src/fgit/fgit-install.sh
index 1f710c688..262b6f112 100755
--- a/src/fgit/fgit-install.sh
+++ b/src/fgit/fgit-install.sh
@@ -1,4 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2020 Firejail Authors
4# License GPL v2
5#
2# Purpose: Fetch, compile, and install firejail from GitHub source. Package-manager agnostic. 6# Purpose: Fetch, compile, and install firejail from GitHub source. Package-manager agnostic.
3# 7#
4 8
diff --git a/src/fgit/fgit-uninstall.sh b/src/fgit/fgit-uninstall.sh
index bc7cc9563..d40f90320 100644
--- a/src/fgit/fgit-uninstall.sh
+++ b/src/fgit/fgit-uninstall.sh
@@ -1,4 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2# This file is part of Firejail project
3# Copyright (C) 2014-2020 Firejail Authors
4# License GPL v2
5#
2# Purpose: Fetch, compile, and install firejail from GitHub source. Package-manager agnostic. 6# Purpose: Fetch, compile, and install firejail from GitHub source. Package-manager agnostic.
3# 7#
4 8
diff --git a/src/fids/Makefile.in b/src/fids/Makefile.in
new file mode 100644
index 000000000..5530bcee2
--- /dev/null
+++ b/src/fids/Makefile.in
@@ -0,0 +1,18 @@
1.PHONY: all
2all: fids
3
4include ../common.mk
5
6%.o : %.c $(H_FILE_LIST) ../include/common.h
7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
8
9#fseccomp: $(OBJS) ../lib/common.o ../lib/errno.o ../lib/syscall.o
10fids: $(OBJS)
11 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS)
12
13.PHONY: clean
14clean:; rm -fr *.o fids *.gcov *.gcda *.gcno *.plist
15
16.PHONY: distclean
17distclean: clean
18 rm -fr Makefile
diff --git a/src/fids/blake2b.c b/src/fids/blake2b.c
new file mode 100644
index 000000000..f2aa5ae66
--- /dev/null
+++ b/src/fids/blake2b.c
@@ -0,0 +1,176 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21/* A simple unkeyed BLAKE2b Implementation based on the official reference
22 * from https://github.com/BLAKE2/BLAKE2.
23 *
24 * The original code was released under CC0 1.0 Universal license (Creative Commons),
25 * a public domain license.
26 */
27
28#include "fids.h"
29
30// little-endian vs big-endian is irrelevant since the checksum is calculated and checked on the same computer.
31static inline uint64_t load64( const void *src ) {
32 uint64_t w;
33 memcpy( &w, src, sizeof( w ) );
34 return w;
35}
36
37// mixing function
38#define ROTR64(x, y) (((x) >> (y)) ^ ((x) << (64 - (y))))
39#define G(a, b, c, d, x, y) { \
40 v[a] = v[a] + v[b] + x; \
41 v[d] = ROTR64(v[d] ^ v[a], 32); \
42 v[c] = v[c] + v[d]; \
43 v[b] = ROTR64(v[b] ^ v[c], 24); \
44 v[a] = v[a] + v[b] + y; \
45 v[d] = ROTR64(v[d] ^ v[a], 16); \
46 v[c] = v[c] + v[d]; \
47 v[b] = ROTR64(v[b] ^ v[c], 63); }
48
49// init vector
50static const uint64_t iv[8] = {
51 0x6A09E667F3BCC908, 0xBB67AE8584CAA73B,
52 0x3C6EF372FE94F82B, 0xA54FF53A5F1D36F1,
53 0x510E527FADE682D1, 0x9B05688C2B3E6C1F,
54 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179
55};
56
57
58const uint8_t sigma[12][16] = {
59 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
60 { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
61 { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
62 { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 },
63 { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 },
64 { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 },
65 { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 },
66 { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 },
67 { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 },
68 { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 },
69 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
70 { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
71};
72
73// blake2b context
74typedef struct {
75 uint8_t b[128]; // input buffer
76 uint64_t h[8]; // chained state
77 uint64_t t[2]; // total number of bytes
78 size_t c; // pointer for b[]
79 size_t outlen; // digest size
80} CTX;
81
82// compress function
83static void compress(CTX *ctx, int last) {
84 uint64_t m[16];
85 uint64_t v[16];
86 size_t i;
87
88 for (i = 0; i < 16; i++)
89 m[i] = load64(&ctx->b[8 * i]);
90
91 for (i = 0; i < 8; i++) {
92 v[i] = ctx->h[i];
93 v[i + 8] = iv[i];
94 }
95
96 v[12] ^= ctx->t[0];
97 v[13] ^= ctx->t[1];
98 if (last)
99 v[14] = ~v[14];
100
101 for (i = 0; i < 12; i++) {
102 G( 0, 4, 8, 12, m[sigma[i][ 0]], m[sigma[i][ 1]]);
103 G( 1, 5, 9, 13, m[sigma[i][ 2]], m[sigma[i][ 3]]);
104 G( 2, 6, 10, 14, m[sigma[i][ 4]], m[sigma[i][ 5]]);
105 G( 3, 7, 11, 15, m[sigma[i][ 6]], m[sigma[i][ 7]]);
106 G( 0, 5, 10, 15, m[sigma[i][ 8]], m[sigma[i][ 9]]);
107 G( 1, 6, 11, 12, m[sigma[i][10]], m[sigma[i][11]]);
108 G( 2, 7, 8, 13, m[sigma[i][12]], m[sigma[i][13]]);
109 G( 3, 4, 9, 14, m[sigma[i][14]], m[sigma[i][15]]);
110 }
111
112 for( i = 0; i < 8; ++i )
113 ctx->h[i] ^= v[i] ^ v[i + 8];
114}
115
116static int init(CTX *ctx, size_t outlen) { // (keylen=0: no key)
117 size_t i;
118
119 if (outlen == 0 || outlen > 64)
120 return -1;
121
122 for (i = 0; i < 8; i++)
123 ctx->h[i] = iv[i];
124 ctx->h[0] ^= 0x01010000 ^ outlen;
125
126 ctx->t[0] = 0;
127 ctx->t[1] = 0;
128 ctx->c = 0;
129 ctx->outlen = outlen;
130
131 return 0;
132}
133
134static void update(CTX *ctx, const void *in, size_t inlen) {
135 size_t i;
136
137 for (i = 0; i < inlen; i++) {
138 if (ctx->c == 128) {
139 ctx->t[0] += ctx->c;
140 if (ctx->t[0] < ctx->c)
141 ctx->t[1]++;
142 compress(ctx, 0);
143 ctx->c = 0;
144 }
145 ctx->b[ctx->c++] = ((const uint8_t *) in)[i];
146 }
147}
148
149static void final(CTX *ctx, void *out) {
150 size_t i;
151
152 ctx->t[0] += ctx->c;
153 if (ctx->t[0] < ctx->c)
154 ctx->t[1]++;
155
156 while (ctx->c < 128)
157 ctx->b[ctx->c++] = 0;
158 compress(ctx, 1);
159
160 for (i = 0; i < ctx->outlen; i++) {
161 ((uint8_t *) out)[i] =
162 (ctx->h[i >> 3] >> (8 * (i & 7))) & 0xFF;
163 }
164}
165
166// public function
167int blake2b(void *out, size_t outlen, const void *in, size_t inlen) {
168 CTX ctx;
169
170 if (init(&ctx, outlen))
171 return -1;
172 update(&ctx, in, inlen);
173 final(&ctx, out);
174
175 return 0;
176}
diff --git a/src/fids/config b/src/fids/config
new file mode 100644
index 000000000..c18c97260
--- /dev/null
+++ b/src/fids/config
@@ -0,0 +1,16 @@
1/bin
2/sbin
3/usr/bin
4/usr/sbin
5/usr/games
6/opt
7/usr/share/ca-certificates
8
9
10/home/netblue/.bashrc
11/home/netblue/.config/firejail
12/home/netblue/.config/autostart
13/home/netblue/Desktop/*.desktop
14/home/netblue/.ssh
15/home/netblue/.gnupg
16
diff --git a/src/fids/db.c b/src/fids/db.c
new file mode 100644
index 000000000..35caf7eeb
--- /dev/null
+++ b/src/fids/db.c
@@ -0,0 +1,158 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include"fids.h"
21
22typedef struct db_t {
23 struct db_t *next;
24 char *fname;
25 char *checksum;
26 char *mode;
27 int checked;
28} DB;
29
30#define MAXBUF 4096
31static DB *database[HASH_MAX] = {NULL};
32
33// djb2 hash function by Dan Bernstein
34static unsigned hash(const char *str) {
35 unsigned long hash = 5381;
36 int c;
37
38 while ((c = *str++) != '\0')
39 hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
40
41 return hash & (HASH_MAX - 1);
42}
43
44#if 0
45// for testing the hash table
46static void db_print(void) {
47 int i;
48 for (i = 0; i < HASH_MAX; i++) {
49 int cnt = 0;
50 DB *ptr = database[i];
51 while (ptr) {
52 cnt++;
53 ptr = ptr->next;
54 }
55 printf("%d ", cnt);
56 fflush(0);
57 }
58 printf("\n");
59}
60#endif
61
62static void db_add(const char *fname, const char *checksum, const char *mode) {
63 DB *ptr = malloc(sizeof(DB));
64 if (!ptr)
65 errExit("malloc");
66 ptr->fname = strdup(fname);
67 ptr->checksum = strdup(checksum);
68 ptr->mode = strdup(mode);
69 ptr->checked = 0;
70 if (!ptr->fname || !ptr->checksum || !ptr->mode)
71 errExit("strdup");
72
73 unsigned h = hash(fname);
74 ptr->next = database[h];
75 database[h] = ptr;
76}
77
78void db_check(const char *fname, const char *checksum, const char *mode) {
79 assert(fname);
80 assert(checksum);
81 assert(mode);
82
83 unsigned h =hash(fname);
84 DB *ptr = database[h];
85 while (ptr) {
86 if (strcmp(fname, ptr->fname) == 0) {
87 ptr->checked = 1;
88 break;
89 }
90 ptr = ptr->next;
91 }
92
93 if (ptr ) {
94 if (strcmp(checksum, ptr->checksum)) {
95 f_modified++;
96 fprintf(stderr, "\nWarning: modified %s\n", fname);
97 }
98 if (strcmp(mode, ptr->mode)) {
99 f_permissions++;
100 fprintf(stderr, "\nWarning: permissions %s: old %s, new %s\n",
101 fname, ptr->mode, mode);
102 }
103 }
104 else {
105 f_new++;
106 fprintf(stderr, "\nWarning: new file %s\n", fname);
107 }
108}
109
110void db_missing(void) {
111 int i;
112 for (i = 0; i < HASH_MAX; i++) {
113 DB *ptr = database[i];
114 while (ptr) {
115 if (!ptr->checked) {
116 f_removed++;
117 fprintf(stderr, "Warning: removed %s\n", ptr->fname);
118 }
119 ptr = ptr->next;
120 }
121 }
122}
123
124// return 0 if ok, 1 if error
125int db_init(void) {
126 char buf[MAXBUF];
127 while(fgets(buf, MAXBUF, stdin)) {
128 // split - tab separated
129
130 char *mode = buf;
131 char *ptr = strchr(buf, '\t');
132 if (!ptr)
133 goto errexit;
134 *ptr = '\0';
135
136 char *checksum = ptr + 1;
137 ptr = strchr(checksum, '\t');
138 if (!ptr)
139 goto errexit;
140 *ptr = '\0';
141
142 char *fname = ptr + 1;
143 ptr = strchr(fname, '\n');
144 if (!ptr)
145 goto errexit;
146 *ptr = '\0';
147
148 db_add(fname, checksum, mode);
149 }
150// db_print();
151
152 return 0;
153
154errexit:
155 fprintf(stderr, "Error fids: database corrupted\n");
156 exit(1);
157}
158
diff --git a/src/fids/db_exclude.c b/src/fids/db_exclude.c
new file mode 100644
index 000000000..994e6f9df
--- /dev/null
+++ b/src/fids/db_exclude.c
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include"fids.h"
21
22typedef struct db_exclude_t {
23 struct db_exclude_t *next;
24 char *fname;
25 int len;
26} DB_EXCLUDE;
27static DB_EXCLUDE *database = NULL;
28
29void db_exclude_add(const char *fname) {
30 assert(fname);
31
32 DB_EXCLUDE *ptr = malloc(sizeof(DB_EXCLUDE));
33 if (!ptr)
34 errExit("malloc");
35
36 ptr->fname = strdup(fname);
37 if (!ptr->fname)
38 errExit("strdup");
39 ptr->len = strlen(fname);
40 ptr->next = database;
41 database = ptr;
42}
43
44int db_exclude_check(const char *fname) {
45 assert(fname);
46
47 DB_EXCLUDE *ptr = database;
48 while (ptr != NULL) {
49 if (strncmp(fname, ptr->fname, ptr->len) == 0)
50 return 1;
51 ptr = ptr->next;
52 }
53
54 return 0;
55}
56
diff --git a/src/fids/fids.h b/src/fids/fids.h
new file mode 100644
index 000000000..a2e2886fe
--- /dev/null
+++ b/src/fids/fids.h
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#ifndef FIDS_H
21#define FIDS_H
22
23#include "../include/common.h"
24
25// main.c
26#define MAX_DIR_LEVEL 20 // max directory tree depth
27#define MAX_INCLUDE_LEVEL 10 // max include level for config files
28extern int f_scanned;
29extern int f_modified;
30extern int f_new;
31extern int f_removed;
32extern int f_permissions;
33
34// db.c
35#define HASH_MAX 2048 // power of 2
36int db_init(void);
37void db_check(const char *fname, const char *checksum, const char *mode);
38void db_missing(void);
39
40// db_exclude.c
41void db_exclude_add(const char *fname);
42int db_exclude_check(const char *fname);
43
44
45// blake2b.c
46//#define KEY_SIZE 128 // key size in bytes
47#define KEY_SIZE 256
48//#define KEY_SIZE 512
49int blake2b(void *out, size_t outlen, const void *in, size_t inlen);
50
51#endif \ No newline at end of file
diff --git a/src/fids/main.c b/src/fids/main.c
new file mode 100644
index 000000000..c899b55e1
--- /dev/null
+++ b/src/fids/main.c
@@ -0,0 +1,371 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fids.h"
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <unistd.h>
24#include <fcntl.h>
25#include <sys/mman.h>
26#include <dirent.h>
27#include <glob.h>
28
29#define MAXBUF 4096
30
31static int dir_level = 1;
32static int include_level = 0;
33int arg_init = 0;
34int arg_check = 0;
35char *arg_homedir = NULL;
36char *arg_dbfile = NULL;
37
38int f_scanned = 0;
39int f_modified = 0;
40int f_new = 0;
41int f_removed = 0;
42int f_permissions = 0;
43
44
45
46static inline int is_dir(const char *fname) {
47 assert(fname);
48
49 struct stat s;
50 if (stat(fname, &s) == 0) {
51 if (S_ISDIR(s.st_mode))
52 return 1;
53 }
54 return 0;
55}
56
57static inline int is_link(const char *fname) {
58 assert(fname);
59
60 char c;
61 ssize_t rv = readlink(fname, &c, 1);
62 return (rv != -1);
63}
64
65// mode is an array of 10 chars or more
66static inline void file_mode(const char *fname, char *mode) {
67 assert(fname);
68 assert(mode);
69
70 struct stat s;
71 if (stat(fname, &s)) {
72 *mode = '\0';
73 return;
74 }
75
76 sprintf(mode, (s.st_mode & S_IRUSR) ? "r" : "-");
77 sprintf(mode + 1, (s.st_mode & S_IWUSR) ? "w" : "-");
78 sprintf(mode + 2, (s.st_mode & S_IXUSR) ? "x" : "-");
79 sprintf(mode + 3, (s.st_mode & S_IRGRP) ? "r" : "-");
80 sprintf(mode + 4, (s.st_mode & S_IWGRP) ? "w" : "-");
81 sprintf(mode + 5, (s.st_mode & S_IXGRP) ? "x" : "-");
82 sprintf(mode + 6, (s.st_mode & S_IROTH) ? "r" : "-");
83 sprintf(mode + 7, (s.st_mode & S_IWOTH) ? "w" : "-");
84 sprintf(mode + 8, (s.st_mode & S_IXOTH) ? "x" : "-");
85}
86
87
88static void file_checksum(const char *fname) {
89 assert(fname);
90
91 int fd = open(fname, O_RDONLY);
92 if (fd == -1)
93 return;
94
95 off_t size = lseek(fd, 0, SEEK_END);
96 if (size < 0) {
97 close(fd);
98 return;
99 }
100
101 char *content = "empty";
102 int mmapped = 0;
103 if (size == 0) {
104 // empty files don't mmap - use "empty" string as the file content
105 size = 6; // strlen("empty") + 1
106 }
107 else {
108 content = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
109 close(fd);
110 mmapped = 1;
111 }
112
113 unsigned char checksum[KEY_SIZE / 8];
114 blake2b(checksum, sizeof(checksum), content, size);
115 if (mmapped)
116 munmap(content, size);
117
118 // calculate blake2 checksum
119 char str_checksum[(KEY_SIZE / 8) * 2 + 1];
120 int long unsigned i;
121 char *ptr = str_checksum;
122 for (i = 0; i < sizeof(checksum); i++, ptr += 2)
123 sprintf(ptr, "%02x", (unsigned char ) checksum[i]);
124
125 // build permissions string
126 char mode[10];
127 file_mode(fname, mode);
128
129 if (arg_init)
130 printf("%s\t%s\t%s\n", mode, str_checksum, fname);
131 else if (arg_check)
132 db_check(fname, str_checksum, mode);
133 else
134 assert(0);
135
136 f_scanned++;
137 if (f_scanned % 500 == 0)
138 fprintf(stderr, "%d ", f_scanned);
139 fflush(0);
140}
141
142void list_directory(const char *fname) {
143 assert(fname);
144 if (dir_level > MAX_DIR_LEVEL) {
145 fprintf(stderr, "Warning fids: maximum depth level exceeded for %s\n", fname);
146 return;
147 }
148
149 if (db_exclude_check(fname))
150 return;
151
152 if (is_link(fname))
153 return;
154
155 if (!is_dir(fname)) {
156 file_checksum(fname);
157 return;
158 }
159
160 DIR *dir;
161 struct dirent *entry;
162
163 if (!(dir = opendir(fname)))
164 return;
165
166 dir_level++;
167 while ((entry = readdir(dir)) != NULL) {
168 if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
169 continue;
170 char *path;
171 if (asprintf(&path, "%s/%s", fname, entry->d_name) == -1)
172 errExit("asprintf");
173 list_directory(path);
174 free(path);
175 }
176 closedir(dir);
177 dir_level--;
178}
179
180void globbing(const char *fname) {
181 assert(fname);
182
183 // filter top directory
184 if (strcmp(fname, "/") == 0)
185 return;
186
187 glob_t globbuf;
188 int globerr = glob(fname, GLOB_NOCHECK | GLOB_NOSORT | GLOB_PERIOD, NULL, &globbuf);
189 if (globerr) {
190 fprintf(stderr, "Error fids: failed to glob pattern %s\n", fname);
191 exit(1);
192 }
193
194 long unsigned i;
195 for (i = 0; i < globbuf.gl_pathc; i++) {
196 char *path = globbuf.gl_pathv[i];
197 assert(path);
198
199 list_directory(path);
200 }
201
202 globfree(&globbuf);
203}
204
205static void process_config(const char *fname) {
206 assert(fname);
207
208 if (++include_level >= MAX_INCLUDE_LEVEL) {
209 fprintf(stderr, "Error ids: maximum include level for config files exceeded\n");
210 exit(1);
211 }
212
213 // make sure the file is owned by root
214 struct stat s;
215 if (stat(fname, &s)) {
216 if (include_level == 1) {
217 fprintf(stderr, "Error ids: config file not found\n");
218 exit(1);
219 }
220 return;
221 }
222 if (s.st_uid || s.st_gid) {
223 fprintf(stderr, "Error ids: config file not owned by root\n");
224 exit(1);
225 }
226
227 fprintf(stderr, "Loading %s config file\n", fname);
228 FILE *fp = fopen(fname, "r");
229 if (!fp) {
230 fprintf(stderr, "Error fids: cannot open config file %s\n", fname);
231 exit(1);
232 }
233
234 char buf[MAXBUF];
235 int line = 0;
236 while (fgets(buf, MAXBUF, fp)) {
237 line++;
238
239 // trim \n
240 char *ptr = strchr(buf, '\n');
241 if (ptr)
242 *ptr = '\0';
243
244 // comments
245 ptr = strchr(buf, '#');
246 if (ptr)
247 *ptr = '\0';
248
249 // empty space
250 ptr = buf;
251 while (*ptr == ' ' || *ptr == '\t')
252 ptr++;
253 char *start = ptr;
254
255 // empty line
256 if (*start == '\0')
257 continue;
258
259 // trailing spaces
260 ptr = start + strlen(start);
261 ptr--;
262 while (*ptr == ' ' || *ptr == '\t')
263 *ptr-- = '\0';
264
265 // replace ${HOME}
266 if (strncmp(start, "include", 7) == 0) {
267 ptr = start + 7;
268 if ((*ptr != ' ' && *ptr != '\t') || *ptr == '\0') {
269 fprintf(stderr, "Error fids: invalid line %d in %s\n", line, fname);
270 exit(1);
271 }
272 while (*ptr == ' ' || *ptr == '\t')
273 ptr++;
274
275 if (*ptr == '/')
276 process_config(ptr);
277 else {
278 // assume the file is in /etc/firejail
279 char *tmp;
280 if (asprintf(&tmp, "/etc/firejail/%s", ptr) == -1)
281 errExit("asprintf");
282 process_config(tmp);
283 free(tmp);
284 }
285 }
286 else if (*start == '!') {
287 // exclude file or dir
288 start++;
289 if (strncmp(start, "${HOME}", 7))
290 db_exclude_add(start);
291 else {
292 char *fname;
293 if (asprintf(&fname, "%s%s", arg_homedir, start + 7) == -1)
294 errExit("asprintf");
295 db_exclude_add(fname);
296 free(fname);
297 }
298 }
299 else if (strncmp(start, "${HOME}", 7))
300 globbing(start);
301 else {
302 char *fname;
303 if (asprintf(&fname, "%s%s", arg_homedir, start + 7) == -1)
304 errExit("asprintf");
305 globbing(fname);
306 free(fname);
307 }
308 }
309
310 fclose(fp);
311 include_level--;
312}
313
314
315
316void usage(void) {
317 printf("Usage: fids [--help|-h|-?] --init|--check homedir\n");
318}
319
320int main(int argc, char **argv) {
321 int i;
322 for (i = 1; i < argc; i++) {
323 if (strcmp(argv[i], "-h") == 0 ||
324 strcmp(argv[i], "-?") == 0 ||
325 strcmp(argv[i], "--help") == 0) {
326 usage();
327 return 0;
328 }
329 else if (strcmp(argv[i], "--init") == 0)
330 arg_init = 1;
331 else if (strcmp(argv[i], "--check") == 0)
332 arg_check = 1;
333 else if (strncmp(argv[i], "--", 2) == 0) {
334 fprintf(stderr, "Error fids: invalid argument %s\n", argv[i]);
335 exit(1);
336 }
337 }
338
339 if (argc != 3) {
340 fprintf(stderr, "Error fids: invalid number of arguments\n");
341 exit(1);
342 }
343 arg_homedir = argv[2];
344
345 int op = arg_check + arg_init;
346 if (op == 0 || op == 2) {
347 fprintf(stderr, "Error fids: use either --init or --check\n");
348 exit(1);
349 }
350
351 if (arg_init) {
352 process_config(SYSCONFDIR"/ids.config");
353 fprintf(stderr, "\n%d files scanned\n", f_scanned);
354 fprintf(stderr, "IDS database initialized\n");
355 }
356 else if (arg_check) {
357 if (db_init()) {
358 fprintf(stderr, "Error: IDS database not initialized, please run \"firejail --ids-init\"\n");
359 exit(1);
360 }
361
362 process_config(SYSCONFDIR"/ids.config");
363 fprintf(stderr, "\n%d files scanned: modified %d, permissions %d, new %d, removed %d\n",
364 f_scanned, f_modified, f_permissions, f_new, f_removed);
365 db_missing();
366 }
367 else
368 assert(0);
369
370 return 0;
371}
diff --git a/src/firecfg/Makefile.in b/src/firecfg/Makefile.in
index 0b2b03275..43329be46 100644
--- a/src/firecfg/Makefile.in
+++ b/src/firecfg/Makefile.in
@@ -1,40 +1,17 @@
1.PHONY: all
1all: firecfg 2all: firecfg
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8 5
9VERSION=@PACKAGE_VERSION@ 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/firejail_user.h ../include/pid.h
10NAME=@PACKAGE_NAME@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_GCOV=@HAVE_GCOV@
21EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
22 8
9firecfg: $(OBJS) ../lib/common.o ../lib/firejail_user.o
10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/firejail_user.o $(LIBS) $(EXTRA_LDFLAGS)
23 11
24H_FILE_LIST = $(sort $(wildcard *.[h])) 12.PHONY: clean
25C_FILE_LIST = $(sort $(wildcard *.c)) 13clean:; rm -fr *.o firecfg *.gcov *.gcda *.gcno *.plist
26OBJS = $(C_FILE_LIST:.c=.o)
27BINOBJS = $(foreach file, $(OBJS), $file)
28CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_SECCOMP) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
29LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
30
31%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/libnetlink.h ../include/pid.h
32 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
33
34firecfg: $(OBJS) ../lib/common.o
35 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o $(LIBS) $(EXTRA_LDFLAGS)
36
37clean:; rm -f *.o firecfg firecfg.1 firecfg.1.gz *.gcov *.gcda *.gcno
38 14
15.PHONY: distclean
39distclean: clean 16distclean: clean
40 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/firecfg/desktop_files.c b/src/firecfg/desktop_files.c
index c1d456147..06b0a117f 100644
--- a/src/firecfg/desktop_files.c
+++ b/src/firecfg/desktop_files.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -41,7 +41,7 @@ static int check_profile(const char *name, const char *homedir) {
41 printf("found %s\n", profname2); 41 printf("found %s\n", profname2);
42 rv = 1; 42 rv = 1;
43 } 43 }
44 44
45 free(profname1); 45 free(profname1);
46 free(profname2); 46 free(profname2);
47 return rv; 47 return rv;
@@ -56,28 +56,34 @@ static int have_profile(const char *filename, const char *homedir) {
56 if (arg_debug) 56 if (arg_debug)
57 printf("checking profile for %s\n", filename); 57 printf("checking profile for %s\n", filename);
58 58
59 // we get strange names here, such as .org.gnom.gedit.desktop, com.uploadedlobster.peek.desktop, 59 // we get strange names here, such as .org.gnome.gedit.desktop, com.uploadedlobster.peek.desktop,
60 // or io.github.Pithos.desktop; extract the word before .desktop 60 // or io.github.Pithos.desktop; extract the word before .desktop
61 61 // TODO: implement proper fix for #2624 (names like org.gnome.Logs.desktop fall thru
62 // the 'last word' logic and don't get installed to ~/.local/share/applications
63
62 char *tmpfname = strdup(filename); 64 char *tmpfname = strdup(filename);
63 if (!tmpfname) 65 if (!tmpfname)
64 errExit("strdup"); 66 errExit("strdup");
65 67
66 // check .desktop extension 68 // check .desktop extension
67 int len = strlen(tmpfname); 69 int len = strlen(tmpfname);
68 if (len <= 8) 70 if (len <= 8) {
71 free(tmpfname);
69 return 0; 72 return 0;
70 if (strcmp(tmpfname + len - 8, ".desktop")) 73 }
74 if (strcmp(tmpfname + len - 8, ".desktop")) {
75 free(tmpfname);
71 return 0; 76 return 0;
77 }
72 tmpfname[len - 8] = '\0'; 78 tmpfname[len - 8] = '\0';
73 79
74 // extract last word 80 // extract last word
75 char *last_word = strrchr(tmpfname, '.'); 81 char *last_word = strrchr(tmpfname, '.');
76 if (last_word) 82 if (last_word)
77 last_word++; 83 last_word++;
78 else 84 else
79 last_word = tmpfname; 85 last_word = tmpfname;
80 86
81 // try lowercase 87 // try lowercase
82 last_word[0] = tolower(last_word[0]); 88 last_word[0] = tolower(last_word[0]);
83 int rv = check_profile(last_word, homedir); 89 int rv = check_profile(last_word, homedir);
@@ -85,7 +91,7 @@ static int have_profile(const char *filename, const char *homedir) {
85 free(tmpfname); 91 free(tmpfname);
86 return rv; 92 return rv;
87 } 93 }
88 94
89 // try uppercase 95 // try uppercase
90 last_word[0] = toupper(last_word[0]); 96 last_word[0] = toupper(last_word[0]);
91 rv = check_profile(last_word, homedir); 97 rv = check_profile(last_word, homedir);
@@ -108,12 +114,27 @@ void fix_desktop_files(char *homedir) {
108 char *user_apps_dir; 114 char *user_apps_dir;
109 if (asprintf(&user_apps_dir, "%s/.local/share/applications", homedir) == -1) 115 if (asprintf(&user_apps_dir, "%s/.local/share/applications", homedir) == -1)
110 errExit("asprintf"); 116 errExit("asprintf");
117 printf("\nFixing desktop files in %s\n", user_apps_dir);
111 if (stat(user_apps_dir, &sb) == -1) { 118 if (stat(user_apps_dir, &sb) == -1) {
112 int rv = mkdir(user_apps_dir, 0700); 119 char *tmp;
120 if (asprintf(&tmp, "%s/.local", homedir) == -1)
121 errExit("asprintf");
122 int rv = mkdir(tmp, 0755);
123 (void) rv;
124 free(tmp);
125
126 if (asprintf(&tmp, "%s/.local/share", homedir) == -1)
127 errExit("asprintf");
128 rv = mkdir(tmp, 0755);
129 (void) rv;
130 free(tmp);
131
132 rv = mkdir(user_apps_dir, 0700);
113 if (rv) { 133 if (rv) {
114 fprintf(stderr, "Error: cannot create ~/.local/application directory\n");
115 perror("mkdir"); 134 perror("mkdir");
116 exit(1); 135 fprintf(stderr, "Warning: cannot create ~/.local/share/application directory, desktop files fixing skipped...\n");
136 free(user_apps_dir);
137 return;
117 } 138 }
118 rv = chmod(user_apps_dir, 0700); 139 rv = chmod(user_apps_dir, 0700);
119 (void) rv; 140 (void) rv;
@@ -121,16 +142,15 @@ void fix_desktop_files(char *homedir) {
121 142
122 // source 143 // source
123 DIR *dir = opendir("/usr/share/applications"); 144 DIR *dir = opendir("/usr/share/applications");
124 if (!dir) { 145 if (!dir || chdir("/usr/share/applications")) {
125 perror("Error: cannot open /usr/share/applications directory"); 146 perror("opendir");
126 exit(1); 147 fprintf(stderr, "Warning: cannot access /usr/share/applications directory, desktop files fixing skipped...\n");
127 } 148 free(user_apps_dir);
128 if (chdir("/usr/share/applications")) { 149 if (dir)
129 perror("Error: cannot chdir to /usr/share/applications"); 150 closedir(dir);
130 exit(1); 151 return;
131 } 152 }
132 153
133 printf("\nFixing desktop files in %s\n", user_apps_dir);
134 // copy 154 // copy
135 struct dirent *entry; 155 struct dirent *entry;
136 while ((entry = readdir(dir)) != NULL) { 156 while ((entry = readdir(dir)) != NULL) {
@@ -151,8 +171,6 @@ void fix_desktop_files(char *homedir) {
151 // skip links 171 // skip links
152 if (is_link(filename)) 172 if (is_link(filename))
153 continue; 173 continue;
154 if (stat(filename, &sb) == -1)
155 errExit("stat");
156 174
157 // no profile in /etc/firejail, no desktop file fixing 175 // no profile in /etc/firejail, no desktop file fixing
158 if (!have_profile(filename, homedir)) 176 if (!have_profile(filename, homedir))
@@ -161,23 +179,35 @@ void fix_desktop_files(char *homedir) {
161 //**************************************************** 179 //****************************************************
162 // load the file in memory and do some basic checking 180 // load the file in memory and do some basic checking
163 //**************************************************** 181 //****************************************************
164 /* coverity[toctou] */ 182 FILE *fp = fopen(filename, "r");
165 int fd = open(filename, O_RDONLY); 183 if (!fp) {
166 if (fd == -1) { 184 fprintf(stderr, "Warning: cannot open /usr/share/applications/%s\n", filename);
167 fprintf(stderr, "Error: cannot open /usr/share/applications/%s\n", filename);
168 continue; 185 continue;
169 } 186 }
170 187
171 char *buf = mmap(NULL, sb.st_size + 1, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); 188 fseek(fp, 0, SEEK_END);
172 if (buf == MAP_FAILED) 189 long size = ftell(fp);
173 errExit("mmap"); 190 if (size == -1)
174 close(fd); 191 errExit("ftell");
192 fseek(fp, 0, SEEK_SET);
193 char *buf = malloc(size + 1);
194 if (!buf)
195 errExit("malloc");
196
197 size_t loaded = fread(buf, size, 1, fp);
198 fclose(fp);
199 if (loaded != 1) {
200 fprintf(stderr, "Warning: cannot read /usr/share/applications/%s\n", filename);
201 free(buf);
202 continue;
203 }
204 buf[size] = '\0';
175 205
176 // check format 206 // check format
177 if (strstr(buf, "[Desktop Entry]\n") == NULL) { 207 if (strstr(buf, "[Desktop Entry]\n") == NULL) {
178 if (arg_debug) 208 if (arg_debug)
179 printf(" %s - skipped: wrong format?\n", filename); 209 printf(" %s - skipped: wrong format?\n", filename);
180 munmap(buf, sb.st_size + 1); 210 free(buf);
181 continue; 211 continue;
182 } 212 }
183 213
@@ -186,7 +216,7 @@ void fix_desktop_files(char *homedir) {
186 if (!ptr || strlen(ptr) < 7) { 216 if (!ptr || strlen(ptr) < 7) {
187 if (arg_debug) 217 if (arg_debug)
188 printf(" %s - skipped: wrong format?\n", filename); 218 printf(" %s - skipped: wrong format?\n", filename);
189 munmap(buf, sb.st_size + 1); 219 free(buf);
190 continue; 220 continue;
191 } 221 }
192 222
@@ -195,11 +225,11 @@ void fix_desktop_files(char *homedir) {
195 if (execname[0] == '"') { 225 if (execname[0] == '"') {
196 if (arg_debug) 226 if (arg_debug)
197 printf(" %s - skipped: path quoting unsupported\n", filename); 227 printf(" %s - skipped: path quoting unsupported\n", filename);
198 munmap(buf, sb.st_size + 1); 228 free(buf);
199 continue; 229 continue;
200 } 230 }
201 231
202 // try to decide if we need to covert this file 232 // try to decide if we need to convert this file
203 char *change_exec = NULL; 233 char *change_exec = NULL;
204 int change_dbus = 0; 234 int change_dbus = 0;
205 235
@@ -228,13 +258,10 @@ void fix_desktop_files(char *homedir) {
228 } 258 }
229 } 259 }
230 } 260 }
231 261
232 if (change_exec == NULL && change_dbus == 0) { 262 free(buf);
233 munmap(buf, sb.st_size + 1); 263 if (change_exec == NULL && change_dbus == 0)
234 continue; 264 continue;
235 }
236
237 munmap(buf, sb.st_size + 1);
238 265
239 //**************************************************** 266 //****************************************************
240 // generate output file 267 // generate output file
@@ -245,19 +272,25 @@ void fix_desktop_files(char *homedir) {
245 272
246 if (stat(outname, &sb) == 0) { 273 if (stat(outname, &sb) == 0) {
247 printf(" %s skipped: file exists\n", filename); 274 printf(" %s skipped: file exists\n", filename);
275 if (change_exec)
276 free(change_exec);
248 continue; 277 continue;
249 } 278 }
250 279
251 FILE *fpin = fopen(filename, "r"); 280 FILE *fpin = fopen(filename, "r");
252 if (!fpin) { 281 if (!fpin) {
253 fprintf(stderr, "Error: cannot open /usr/share/applications/%s\n", filename); 282 fprintf(stderr, "Warning: cannot open /usr/share/applications/%s\n", filename);
283 if (change_exec)
284 free(change_exec);
254 continue; 285 continue;
255 } 286 }
256 287
257 FILE *fpout = fopen(outname, "w"); 288 FILE *fpout = fopen(outname, "w");
258 if (!fpout) { 289 if (!fpout) {
259 fprintf(stderr, "Error: cannot open ~/.local/share/applications/%s\n", outname); 290 fprintf(stderr, "Warning: cannot open ~/.local/share/applications/%s\n", outname);
260 fclose(fpin); 291 fclose(fpin);
292 if (change_exec)
293 free(change_exec);
261 continue; 294 continue;
262 } 295 }
263 fprintf(fpout, "# converted by firecfg\n"); 296 fprintf(fpout, "# converted by firecfg\n");
@@ -277,9 +310,9 @@ void fix_desktop_files(char *homedir) {
277 fprintf(fpout, "Exec=%s\n", change_exec); 310 fprintf(fpout, "Exec=%s\n", change_exec);
278 } 311 }
279 else 312 else
280 fprintf(fpout, "%s", fbuf); 313 fprintf(fpout, "%s", fbuf);
281 } 314 }
282 315
283 if (change_exec) 316 if (change_exec)
284 free(change_exec); 317 free(change_exec);
285 fclose(fpin); 318 fclose(fpin);
@@ -291,5 +324,3 @@ void fix_desktop_files(char *homedir) {
291 closedir(dir); 324 closedir(dir);
292 free(user_apps_dir); 325 free(user_apps_dir);
293} 326}
294
295
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config
index 9baa6a6e4..698630180 100644
--- a/src/firecfg/firecfg.config
+++ b/src/firecfg/firecfg.config
@@ -1,161 +1,377 @@
1# /usr/lib/firejail/firecfg.config - firecfg utility configuration file 1# /usr/lib/firejail/firecfg.config - firecfg utility configuration file
2# This is the list of programs in alphabetical order handled by firecfg utility 2# This is the list of programs in alphabetical order handled by firecfg utility
3# 3#
4# Cryptocat is added but commented since isn't installed to a */bin... keep an eye on this
5#qemu-system-x86_64 4#qemu-system-x86_64
60ad 50ad
72048-qt 62048-qt
7Books
8Builder
9Cheese
10Cryptocat
8Cyberfox 11Cyberfox
12Discord
13DiscordCanary
14Documents
9FossaMail 15FossaMail
16Fritzing
17Gitter
18JDownloader
19Logs
20Maelstrom
21Maps
10Mathematica 22Mathematica
11Natron 23Natron
24PCSX2
25PPSSPPQt
26PPSSPPSDL
27QMediathekView
28QOwnNotes
29Screenshot
12Telegram 30Telegram
13Viber 31Viber
14VirtualBox 32VirtualBox
15Wire 33XMind
16Xephyr 34Xephyr
35ZeGrapher
36abiword
17abrowser 37abrowser
38akonadi_control
18akregator 39akregator
40alacarte
41alpine
42alpinef
19amarok 43amarok
20amule 44amule
45amuled
21android-studio 46android-studio
47anydesk
22apktool 48apktool
49apostrophe
50# ar - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
23arch-audit 51arch-audit
52archaudit-report
24ardour4 53ardour4
25ardour5 54ardour5
26arduino 55arduino
56aria2c
27ark 57ark
28arm 58arm
29atom 59artha
30atom-beta 60assogiate
31atool 61asunder
62# atom
63# atom-beta
64# atool - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
32atril 65atril
66atril-previewer
67atril-thumbnailer
33audacious 68audacious
34audacity 69audacity
70audio-recorder
71authenticator
72authenticator-rs
73autokey-gtk
74autokey-qt
75autokey-run
76autokey-shell
77avidemux3_qt5
35aweather 78aweather
79ballbuster
36baloo_file 80baloo_file
81baloo_filemetadata_temp_extractor
82balsa
37baobab 83baobab
84barrier
85basilisk
86bcompare
87beaker
38bibletime 88bibletime
89bijiben
90bitcoin-qt
39bitlbee 91bitlbee
92bitwarden
40bleachbit 93bleachbit
41blender 94blender
95blender-2.8
42bless 96bless
97blobby
98blobwars
43bluefish 99bluefish
100bnox
44brackets 101brackets
45brasero 102brasero
46brave 103brave
104brave-browser
105brave-browser-beta
106brave-browser-dev
107brave-browser-nightly
108brave-browser-stable
109# bunzip2 - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
110# bzcat - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
111bzflag
112# bzip2 - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
47calibre 113calibre
48calligra 114calligra
49calligraauthor 115calligraauthor
50calligraconverter 116calligraconverter
51calligraflow 117calligraflow
118calligragemini
52calligraplan 119calligraplan
53calligraplanwork 120calligraplanwork
54calligrasheets 121calligrasheets
55calligrastage 122calligrastage
56calligrawords 123calligrawords
124cameramonitor
125cantata
57catfish 126catfish
127cawbird
128celluloid
129checkbashisms
130cheese
58cherrytree 131cherrytree
59chromium 132chromium
60chromium-browser 133chromium-browser
134chromium-browser-privacy
135chromium-freeworld
61cin 136cin
62cinelerra 137cinelerra
63clamdscan 138clamdscan
64clamdtop 139clamdtop
65clamscan 140clamscan
141clamtk
66claws-mail 142claws-mail
143clawsker
67clementine 144clementine
145clion
146clion-eap
147clipgrab
68clipit 148clipit
69cliqz 149cliqz
150clocks
70cmus 151cmus
152code
153code-oss
154cola
155colorful
156com.github.bleakgrey.tootle
157com.github.dahenson.agenda
158com.github.johnfactotum.Foliate
159com.github.phase1geo.minder
160com.gitlab.newsflash
71conkeror 161conkeror
72conky 162conky
163conplay
73corebird 164corebird
165coyim
166crawl
167crawl-tiles
168crow
169cryptocat
74cvlc 170cvlc
75cyberfox 171cyberfox
172d-feet
76darktable 173darktable
174dconf-editor
175ddgr
176ddgtk
77deadbeef 177deadbeef
78deluge 178deluge
179desktopeditors
180devhelp
79dex2jar 181dex2jar
80dia 182dia
183dig
81digikam 184digikam
82dillo 185dillo
83dino 186dino
187dino-im
188discord
189discord-canary
84display 190display
191display-im6.q16
192dnox
85dnscrypt-proxy 193dnscrypt-proxy
86dnsmasq 194dnsmasq
87dolphin 195dolphin-emu
88dooble 196dooble
89dooble-qt4 197dooble-qt4
90dosbox 198dosbox
91dragon 199dragon
200drawio
201drill
92dropbox 202dropbox
203easystroke
204ebook-convert
205ebook-edit
206ebook-meta
207ebook-polish
93ebook-viewer 208ebook-viewer
209electron-mail
210electrum
211element-desktop
94elinks 212elinks
95empathy 213empathy
214enchant
215enchant-2
216enchant-lsmod
217enchant-lsmod-2
218engrampa
219enox
220enpass
96eog 221eog
97eom 222eom
98epiphany 223ephemeral
224#epiphany - see #2995
225equalx
226et
99etr 227etr
100evince 228evince
101evolution 229evince-previewer
230evince-thumbnailer
231#evolution - see #3647
232exfalso
102exiftool 233exiftool
234falkon
103fbreader 235fbreader
236feedreader
104feh 237feh
105ffmpeg 238ferdi
239#ffmpeg
240ffmpegthumbnailer
241ffplay
242ffprobe
106file-roller 243file-roller
107filezilla 244filezilla
245firedragon
108firefox 246firefox
247firefox-beta
248firefox-developer-edition
109firefox-esr 249firefox-esr
110firefox-nightly 250firefox-nightly
251firefox-wayland
252firefox-x11
253five-or-more
254flacsplt
255flameshot
111flashpeak-slimjet 256flashpeak-slimjet
112flowblade 257flowblade
258font-manager
113fontforge 259fontforge
260fossamail
261four-in-a-row
262fractal
114franz 263franz
115freecad 264freecad
116freecadcmd 265freecadcmd
266freeciv
267freeciv-gtk3
268freeciv-mp-gtk3
269freecol
270freemind
271freeoffice-planmaker
272freeoffice-presentations
273freeoffice-textmaker
274freetube
117freshclam 275freshclam
276frogatto
118frozen-bubble 277frozen-bubble
278funnyboat
119gajim 279gajim
280gajim-history-manager
120galculator 281galculator
282gallery-dl
283gapplication
284gcalccmd
285gcloud
286gconf-editor
121geany 287geany
122geary 288geary
123gedit 289gedit
290geekbench
124geeqie 291geeqie
292gfeeds
125ghb 293ghb
294ghostwriter
126gimp 295gimp
296gimp-2.10
127gimp-2.8 297gimp-2.8
298gist
299gist-paste
300git-cola
128gitg 301gitg
302github-desktop
129gitter 303gitter
130gjs 304# gjs -- https://github.com/netblue30/firejail/issues/3333#issuecomment-612601102
305gl-117
306glaxium
131globaltime 307globaltime
308gmpc
132gnome-2048 309gnome-2048
133gnome-books 310gnome-books
311gnome-builder
134gnome-calculator 312gnome-calculator
313gnome-calendar
314gnome-character-map
315gnome-characters
135gnome-chess 316gnome-chess
136gnome-clocks 317gnome-clocks
137gnome-contacts 318gnome-contacts
138gnome-documents 319gnome-documents
139gnome-font-viewer 320gnome-font-viewer
321gnome-hexgl
322gnome-klotski
323gnome-latex
324gnome-logs
325gnome-mahjongg
140gnome-maps 326gnome-maps
327gnome-mines
141gnome-mplayer 328gnome-mplayer
329gnome-mpv
142gnome-music 330gnome-music
331gnome-nettool
332gnome-nibbles
333gnome-passwordsafe
143gnome-photos 334gnome-photos
335gnome-pomodoro
336gnome-recipes
337gnome-robots
338gnome-schedule
339gnome-screenshot
340gnome-sound-recorder
341gnome-sudoku
342gnome-system-log
343gnome-taquin
344gnome-tetravex
345gnome-todo
144gnome-twitch 346gnome-twitch
145gnome-weather 347gnome-weather
348gnote
349gnubik
350godot
146goobox 351goobox
147google-chrome 352google-chrome
148google-chrome-beta 353google-chrome-beta
149google-chrome-stable 354google-chrome-stable
150google-chrome-unstable 355google-chrome-unstable
151google-earth 356google-earth
357google-earth-pro
152google-play-music-desktop-player 358google-play-music-desktop-player
359googler
153gpa 360gpa
154gpicview 361gpicview
155gpredict 362gpredict
363gradio
364gramps
365gravity-beams-and-evaporating-stars
156gthumb 366gthumb
367gtk-pipe-viewer
368gtk-straw-viewer
369gtk-youtube-viewer
370gtk2-youtube-viewer
371gtk3-youtube-viewer
157guayadeque 372guayadeque
158gucharmap 373gucharmap
374gummi
159gwenview 375gwenview
160handbrake 376handbrake
161handbrake-gtk 377handbrake-gtk
@@ -163,43 +379,92 @@ hashcat
163hedgewars 379hedgewars
164hexchat 380hexchat
165highlight 381highlight
382hitori
383homebank
384host
166hugin 385hugin
386hyperrogue
387iagno
167icecat 388icecat
168icedove 389icedove
169iceweasel 390iceweasel
391idea
170idea.sh 392idea.sh
393ideaIC
171imagej 394imagej
172img2txt 395img2txt
396impressive
173inkscape 397inkscape
398inkview
174inox 399inox
400io.github.lainsce.Notejot
401ipcalc
402ipcalc-ng
175iridium 403iridium
176iridium-browser 404iridium-browser
177jd-gui 405jd-gui
406jdownloader
407jerry
178jitsi 408jitsi
409jitsi-meet-desktop
410jumpnbump
411jumpnbump-menu
179k3b 412k3b
413kaffeine
414kalgebra
415kalgebramobile
180karbon 416karbon
181kate 417kate
418kazam
182kcalc 419kcalc
420# kdeinit4
183kdenlive 421kdenlive
422kdiff3
184keepass 423keepass
185keepass2 424keepass2
186keepassx 425keepassx
187keepassx2 426keepassx2
188keepassxc 427keepassxc
428keepassxc-cli
429keepassxc-proxy
430# kfind
431kget
432kid3
433kid3-cli
434kid3-qt
189kino 435kino
436kiwix-desktop
437klatexformula
438klatexformula_cmdl
439klavaro
190kmail 440kmail
441kmplayer
191knotes 442knotes
192kodi 443kodi
193konversation 444konversation
445kopete
194krita 446krita
447# krunner
195ktorrent 448ktorrent
449ktouch
450kube
451# kwin_x11
196kwrite 452kwrite
197leafpad 453leafpad
198less 454# less - breaks man
455librecad
199libreoffice 456libreoffice
457librewolf
458librewolf-nightly
459lifeograph
200liferea 460liferea
461lightsoff
462lincity-ng
463links
464links2
201linphone 465linphone
202lmms 466lmms
467lobase
203localc 468localc
204lodraw 469lodraw
205loffice 470loffice
@@ -209,121 +474,365 @@ lollypop
209lomath 474lomath
210loweb 475loweb
211lowriter 476lowriter
477# lrunzip - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
478# lrz - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
479# lrzcat - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
480# lrzip - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
481# lrztar - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
482# lrzuntar - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
212luminance-hdr 483luminance-hdr
213lximage-qt 484lximage-qt
214lxmusic 485lxmusic
215lynx 486lynx
487lyx
216macrofusion 488macrofusion
489magicor
490man
491manaplus
492marker
493masterpdfeditor
494masterpdfeditor4
495masterpdfeditor5
217mate-calc 496mate-calc
218mate-calculator 497mate-calculator
219mate-color-select 498mate-color-select
220mate-dictionary 499mate-dictionary
221mathematica 500mathematica
501matrix-mirage
502mattermost-desktop
222mcabber 503mcabber
504mcomix
223mediainfo 505mediainfo
224mediathekview 506mediathekview
507megaglest
508megaglest_editor
225meld 509meld
510mencoder
511mendeleydesktop
512menulibre
513meteo-qt
514microsoft-edge
515microsoft-edge-beta
516microsoft-edge-dev
226midori 517midori
518min
519mindless
520minecraft-launcher
227minetest 521minetest
522minitube
523mirage
524mirrormagic
525mocp
228mousepad 526mousepad
527mp3splt
528mp3splt-gtk
529mp3wrap
530mpDris2
531mpg123
532mpg123-alsa
533mpg123-id3dump
534mpg123-jack
535mpg123-nas
536mpg123-openal
537mpg123-oss
538mpg123-portaudio
539mpg123-pulse
540mpg123-strip
541mpg123.bin
229mplayer 542mplayer
543mpsyt
230mpv 544mpv
545mrrescue
546ms-excel
547ms-office
548ms-onenote
549ms-outlook
550ms-powerpoint
551ms-skype
552ms-word
553mtpaint
554multimc
231multimc5 555multimc5
232mumble 556mumble
233mupdf 557mupdf
558mupdf-gl
559mupdf-x11
560mupdf-x11-curl
234mupen64plus 561mupen64plus
562muraster
235musescore 563musescore
564musictube
565musixmatch
566mutool
236mutt 567mutt
568mypaint
569mypaint-ora-thumbnailer
237natron 570natron
238nautilus 571ncdu
572ncdu2
573neochat
574neomutt
575netactview
576nethack
239netsurf 577netsurf
240neverball 578neverball
579neverputt
580newsbeuter
581newsboat
582newsflash
583nextcloud
584nextcloud-desktop
585nheko
586nicotine
587nitroshare
588nitroshare-cli
589nitroshare-nmh
590nitroshare-send
591nitroshare-ui
592nomacs
593nslookup
594nuclear
241nylas 595nylas
596nyx
242obs 597obs
598ocenaudio
243odt2txt 599odt2txt
600oggsplt
244okular 601okular
602onboard
603onionshare-gui
604ooffice
605ooviewdoc
245open-invaders 606open-invaders
607openarena
608openarena_ded
609opencity
610openclonk
611openmw
612openmw-launcher
613openoffice.org
246openshot 614openshot
247openshot-qt 615openshot-qt
616openttd
248opera 617opera
249opera-beta 618opera-beta
250orage 619orage
620ostrichriders
621otter-browser
622out123
251palemoon 623palemoon
624#pandoc
252parole 625parole
626patch
627pavucontrol
628pavucontrol-qt
629pcsxr
630pdfchain
253pdfmod 631pdfmod
254pdfsam 632pdfsam
255pdftotext 633pdftotext
256peek 634peek
635penguin-command
636photoflare
257picard 637picard
258pidgin 638pidgin
639pinball
640#ping - disabled until we fix #1912
259pingus 641pingus
260pinta 642pinta
643pioneer
644pipe-viewer
261pithos 645pithos
646pitivi
262pix 647pix
648planmaker18
649planmaker18free
650playonlinux
263pluma 651pluma
652plv
653pngquant
264polari 654polari
655ppsspp
656pragha
657presentations18
658presentations18free
659profanity
660psi
265psi-plus 661psi-plus
662pybitmessage
663# pycharm-community - FB note: may enable later
664# pycharm-professional
665# pzstd - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
266qbittorrent 666qbittorrent
667qcomicbook
267qemu-launcher 668qemu-launcher
669qgis
268qlipper 670qlipper
671qmmp
672qnapi
269qpdfview 673qpdfview
674qt-faststart
270qtox 675qtox
676quadrapassel
271quassel 677quassel
678quaternion
272quiterss 679quiterss
273qupzilla 680qupzilla
274qutebrowser 681qutebrowser
275rambox 682rambox
276ranger 683redeclipse
684rednotebook
685redshift
686regextester
277remmina 687remmina
278rhythmbox 688rhythmbox
689rhythmbox-client
279ricochet 690ricochet
691riot-desktop
280riot-web 692riot-web
693ripperx
281ristretto 694ristretto
282rocketchat 695rocketchat
283rtorrent 696rtorrent
697runenpass.sh
698sayonara
699scallion
700scorched3d
701scorchwentbonkers
284scribus 702scribus
285sdat2img 703sdat2img
704seahorse
705seahorse-adventures
706seahorse-daemon
707seahorse-tool
286seamonkey 708seamonkey
287seamonkey-bin 709seamonkey-bin
710secret-tool
711shellcheck
712shortwave
288shotcut 713shotcut
714shotwell
715signal-cli
716signal-desktop
289silentarmy 717silentarmy
290simple-scan 718simple-scan
719simplescreenrecorder
291simutrans 720simutrans
292skanlite 721skanlite
293skype
294skypeforlinux 722skypeforlinux
295slack 723slack
724slashem
296smplayer 725smplayer
726smtube
727smuxi-frontend-gnome
728snox
297soffice 729soffice
730sol
731sound-juicer
298soundconverter 732soundconverter
733spectacle
734spectral
299spotify 735spotify
300sqlitebrowser 736sqlitebrowser
301ssh 737ssh
302# ssh-agent - problems on Arch with Fish shell (#1568) 738# ssh-agent - problems on Arch with Fish shell (#1568)
739standardnotes-desktop
303start-tor-browser 740start-tor-browser
304steam 741steam
742steam-native
743steam-runtime
305stellarium 744stellarium
745straw-viewer
746strawberry
306strings 747strings
748studio.sh
749subdownloader
307supertux2 750supertux2
751supertuxkart
752surf
753sushi
754swell-foop
755sylpheed
308synfigstudio 756synfigstudio
757sysprof
758sysprof-cli
759tb-starter-wrapper
760teams
761teams-for-linux
309teamspeak3 762teamspeak3
763teeworlds
310telegram 764telegram
311telegram-desktop 765telegram-desktop
312terasology 766terasology
767textmaker18
768textmaker18free
313thunderbird 769thunderbird
770thunderbird-beta
771thunderbird-wayland
772tilp
773tor-browser
774tor-browser-ar
775tor-browser-ca
776tor-browser-cs
777tor-browser-da
778tor-browser-de
779tor-browser-el
314tor-browser-en 780tor-browser-en
781tor-browser-en-us
782tor-browser-es
783tor-browser-es-es
784tor-browser-fa
785tor-browser-fr
786tor-browser-ga-ie
787tor-browser-he
788tor-browser-hu
789tor-browser-id
790tor-browser-is
791tor-browser-it
792tor-browser-ja
793tor-browser-ka
794tor-browser-ko
795tor-browser-nb
796tor-browser-nl
797tor-browser-pl
798tor-browser-pt-br
799tor-browser-ru
800tor-browser-sv-se
801tor-browser-tr
802tor-browser-vi
803tor-browser-zh-cn
804tor-browser-zh-tw
805torbrowser-launcher
806torcs
315totem 807totem
316tracker 808tracker
809transgui
317transmission-cli 810transmission-cli
811transmission-create
812transmission-daemon
813transmission-edit
318transmission-gtk 814transmission-gtk
319transmission-qt 815transmission-qt
816transmission-remote
817transmission-remote-cli
818transmission-remote-gtk
320transmission-show 819transmission-show
820tremulous
821trojita
321truecraft 822truecraft
823tshark
824tutanota-desktop
322tuxguitar 825tuxguitar
826tvbrowser
827twitch
828udiskie
323uefitool 829uefitool
324uget-gtk 830uget-gtk
325unbound 831unbound
832unf
326unknown-horizons 833unknown-horizons
834# unzstd - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
835utox
327uudeview 836uudeview
328uzbl-browser 837uzbl-browser
329viewnior 838viewnior
@@ -331,39 +840,88 @@ viking
331virtualbox 840virtualbox
332vivaldi 841vivaldi
333vivaldi-beta 842vivaldi-beta
843vivaldi-snapshot
334vivaldi-stable 844vivaldi-stable
335vlc 845vlc
846vmware
847vmware-player
848vmware-workstation
849vscodium
850vulturesclaw
851vultureseye
336vym 852vym
337w3m 853w3m
854warmux
855warsow
338warzone2100 856warzone2100
339waterfox 857waterfox
858waterfox-classic
859waterfox-current
860webstorm
340weechat 861weechat
341weechat-curses 862weechat-curses
342wesnoth 863wesnoth
343wget 864wget
865whalebird
866whois
867widelands
344wine 868wine
345wire 869wire-desktop
346wireshark 870wireshark
347wireshark-gtk 871wireshark-gtk
348wireshark-qt 872wireshark-qt
873wordwarvi
874wpp
875wps
876wpspdf
877x2goclient
878xbill
879xcalc
349xchat 880xchat
350xed 881xed
351xfburn 882xfburn
352xfce4-dict 883xfce4-dict
884xfce4-mixer
353xfce4-notes 885xfce4-notes
886xfce4-screenshooter
354xiphos 887xiphos
888xlinks
889xlinks2
355xmms 890xmms
356xmr-stak-cpu 891xmr-stak
357xonotic 892xonotic
358xonotic-glx 893xonotic-glx
359xonotic-sdl 894xonotic-sdl
895xournal
896xournalpp
360xpdf 897xpdf
361xplayer 898xplayer
899xplayer-audio-preview
900xplayer-video-thumbnailer
362xpra 901xpra
363xreader 902xreader
903xreader-previewer
904xreader-thumbnailer
364xviewer 905xviewer
365yandex-browser 906yandex-browser
907yelp
908youtube
366youtube-dl 909youtube-dl
910youtube-dl-gui
911youtube-viewer
912youtubemusic-nativefier
913yt-dlp
914ytmdesktop
915zaproxy
367zart 916zart
368zathura 917zathura
918zeal
919zim
369zoom 920zoom
921# zpaq - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
922# zstd - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
923# zstdcat - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
924# zstdgrep - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
925# zstdless - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
926# zstdmt - disable until we fix CLI archivers for makepkg on Arch (see discussion in #3095)
927zulip
diff --git a/src/firecfg/firecfg.h b/src/firecfg/firecfg.h
index c4640feb8..15826cf37 100644
--- a/src/firecfg/firecfg.h
+++ b/src/firecfg/firecfg.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -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>
@@ -49,3 +51,4 @@ void sound(void);
49// desktop_files.c 51// desktop_files.c
50void fix_desktop_files(char *homedir); 52void fix_desktop_files(char *homedir);
51 53
54#endif
diff --git a/src/firecfg/main.c b/src/firecfg/main.c
index 1cdd39c1f..363000e15 100644
--- a/src/firecfg/main.c
+++ b/src/firecfg/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,47 +19,55 @@
19*/ 19*/
20 20
21#include "firecfg.h" 21#include "firecfg.h"
22#include "../include/firejail_user.h"
22int arg_debug = 0; 23int arg_debug = 0;
24char *arg_bindir = "/usr/local/bin";
25
26static char *usage_str =
27 "Firecfg is the desktop configuration utility for Firejail software. The utility\n"
28 "creates several symbolic links to firejail executable. This allows the user to\n"
29 "sandbox applications automatically, just by clicking on a regular desktop\n"
30 "menus and icons.\n\n"
31 "The symbolic links are placed in /usr/local/bin. For more information, see\n"
32 "DESKTOP INTEGRATION section in man 1 firejail.\n\n"
33 "Usage: firecfg [OPTIONS]\n\n"
34 " --add-users user [user] - add the users to Firejail user access database.\n\n"
35 " --bindir=directory - install in directory instead of /usr/local/bin.\n\n"
36 " --clean - remove all firejail symbolic links.\n\n"
37 " --debug - print debug messages.\n\n"
38 " --fix - fix .desktop files.\n\n"
39 " --fix-sound - create ~/.config/pulse/client.conf file.\n\n"
40 " --help, -? - this help screen.\n\n"
41 " --list - list all firejail symbolic links.\n\n"
42 " --version - print program version and exit.\n\n"
43 "Example:\n\n"
44 " $ sudo firecfg\n"
45 " /usr/local/bin/firefox created\n"
46 " /usr/local/bin/vlc created\n"
47 " [...]\n"
48 " $ firecfg --list\n"
49 " /usr/local/bin/firefox\n"
50 " /usr/local/bin/vlc\n"
51 " [...]\n"
52 " $ sudo firecfg --clean\n"
53 " /usr/local/bin/firefox removed\n"
54 " /usr/local/bin/vlc removed\n"
55 " [...]\n"
56 "\n"
57 "License GPL version 2 or later\n"
58 "Homepage: https://firejail.wordpress.com\n\n";
23 59
24static void usage(void) { 60static void usage(void) {
25 printf("firecfg - version %s\n\n", VERSION); 61 printf("firecfg - version %s\n\n", VERSION);
26 printf("Firecfg is the desktop configuration utility for Firejail software. The utility\n"); 62 puts(usage_str);
27 printf("creates several symbolic links to firejail executable. This allows the user to\n");
28 printf("sandbox applications automatically, just by clicking on a regular desktop\n");
29 printf("menus and icons.\n\n");
30 printf("The symbolic links are placed in /usr/local/bin. For more information, see\n");
31 printf("DESKTOP INTEGRATION section in man 1 firejail.\n\n");
32 printf("Usage: firecfg [OPTIONS]\n\n");
33 printf(" --clean - remove all firejail symbolic links.\n\n");
34 printf(" --debug - print debug messages.\n\n");
35 printf(" --fix - fix .desktop files.\n\n");
36 printf(" --fix-sound - create ~/.config/pulse/client.conf file.\n\n");
37 printf(" --help, -? - this help screen.\n\n");
38 printf(" --list - list all firejail symbolic links.\n\n");
39 printf(" --version - print program version and exit.\n\n");
40 printf("Example:\n\n");
41 printf(" $ sudo firecfg\n");
42 printf(" /usr/local/bin/firefox created\n");
43 printf(" /usr/local/bin/vlc created\n");
44 printf(" [...]\n");
45 printf(" $ firecfg --list\n");
46 printf(" /usr/local/bin/firefox\n");
47 printf(" /usr/local/bin/vlc\n");
48 printf(" [...]\n");
49 printf(" $ sudo firecfg --clean\n");
50 printf(" /usr/local/bin/firefox removed\n");
51 printf(" /usr/local/bin/vlc removed\n");
52 printf(" [...]\n");
53 printf("\n");
54 printf("License GPL version 2 or later\n");
55 printf("Homepage: http://firejail.wordpress.com\n\n");
56} 63}
57 64
58 65
59static void list(void) { 66static void list(void) {
60 DIR *dir = opendir("/usr/local/bin"); 67 DIR *dir = opendir(arg_bindir);
61 if (!dir) { 68 if (!dir) {
62 fprintf(stderr, "Error: cannot open /usr/local/bin directory\n"); 69 perror("opendir");
70 fprintf(stderr, "Error: cannot open %s directory\n", arg_bindir);
63 exit(1); 71 exit(1);
64 } 72 }
65 73
@@ -73,7 +81,7 @@ static void list(void) {
73 continue; 81 continue;
74 82
75 char *fullname; 83 char *fullname;
76 if (asprintf(&fullname, "/usr/local/bin/%s", entry->d_name) == -1) 84 if (asprintf(&fullname, "%s/%s", arg_bindir, entry->d_name) == -1)
77 errExit("asprintf"); 85 errExit("asprintf");
78 86
79 if (is_link(fullname)) { 87 if (is_link(fullname)) {
@@ -91,15 +99,13 @@ static void list(void) {
91 free(firejail_exec); 99 free(firejail_exec);
92} 100}
93 101
94static void clear(void) { 102static void clean(void) {
95 if (getuid() != 0) { 103 printf("Removing all firejail symlinks:\n");
96 fprintf(stderr, "Error: you need to be root to run this command\n");
97 exit(1);
98 }
99 104
100 DIR *dir = opendir("/usr/local/bin"); 105 DIR *dir = opendir(arg_bindir);
101 if (!dir) { 106 if (!dir) {
102 fprintf(stderr, "Error: cannot open /usr/local/bin directory\n"); 107 perror("opendir");
108 fprintf(stderr, "Error: cannot open %s directory\n", arg_bindir);
103 exit(1); 109 exit(1);
104 } 110 }
105 111
@@ -113,15 +119,21 @@ static void clear(void) {
113 continue; 119 continue;
114 120
115 char *fullname; 121 char *fullname;
116 if (asprintf(&fullname, "/usr/local/bin/%s", entry->d_name) == -1) 122 if (asprintf(&fullname, "%s/%s", arg_bindir, entry->d_name) == -1)
117 errExit("asprintf"); 123 errExit("asprintf");
118 124
119 if (is_link(fullname)) { 125 if (is_link(fullname)) {
120 char* fname = realpath(fullname, NULL); 126 char* fname = realpath(fullname, NULL);
121 if (fname) { 127 if (fname) {
122 if (strcmp(fname, firejail_exec) == 0) { 128 if (strcmp(fname, firejail_exec) == 0) {
123 printf("%s removed\n", fullname); 129 char *ptr = strrchr(fullname, '/');
124 unlink(fullname); 130 assert(ptr);
131 ptr++;
132 int rv = unlink(fullname);
133 if (rv)
134 fprintf(stderr, "Warning: cannot remove %s\n", fullname);
135 else
136 printf(" %s removed\n", ptr);
125 } 137 }
126 free(fname); 138 free(fname);
127 } 139 }
@@ -131,6 +143,7 @@ static void clear(void) {
131 143
132 closedir(dir); 144 closedir(dir);
133 free(firejail_exec); 145 free(firejail_exec);
146 printf("\n");
134} 147}
135 148
136static void set_file(const char *name, const char *firejail_exec) { 149static void set_file(const char *name, const char *firejail_exec) {
@@ -138,7 +151,7 @@ static void set_file(const char *name, const char *firejail_exec) {
138 return; 151 return;
139 152
140 char *fname; 153 char *fname;
141 if (asprintf(&fname, "/usr/local/bin/%s", name) == -1) 154 if (asprintf(&fname, "%s/%s", arg_bindir, name) == -1)
142 errExit("asprintf"); 155 errExit("asprintf");
143 156
144 struct stat s; 157 struct stat s;
@@ -151,6 +164,9 @@ static void set_file(const char *name, const char *firejail_exec) {
151 else 164 else
152 printf(" %s created\n", name); 165 printf(" %s created\n", name);
153 } 166 }
167 else {
168 fprintf(stderr, "Warning: cannot create %s - already exists! Skipping...\n", fname);
169 }
154 170
155 free(fname); 171 free(fname);
156} 172}
@@ -168,10 +184,11 @@ static void set_links_firecfg(void) {
168 // parse /usr/lib/firejail/firecfg.cfg file 184 // parse /usr/lib/firejail/firecfg.cfg file
169 FILE *fp = fopen(cfgfile, "r"); 185 FILE *fp = fopen(cfgfile, "r");
170 if (!fp) { 186 if (!fp) {
187 perror("fopen");
171 fprintf(stderr, "Error: cannot open %s\n", cfgfile); 188 fprintf(stderr, "Error: cannot open %s\n", cfgfile);
172 exit(1); 189 exit(1);
173 } 190 }
174 printf("Configuring symlinks in /usr/local/bin based on firecfg.config\n"); 191 printf("Configuring symlinks in %s based on firecfg.config\n", arg_bindir);
175 192
176 char buf[MAX_BUF]; 193 char buf[MAX_BUF];
177 int lineno = 0; 194 int lineno = 0;
@@ -229,11 +246,12 @@ static void set_links_homedir(const char *homedir) {
229 errExit("asprintf"); 246 errExit("asprintf");
230 247
231 // parse ~/.config/firejail/ directory 248 // parse ~/.config/firejail/ directory
232 printf("\nConfiguring symlinks in /usr/local/bin based on local firejail config directory\n"); 249 printf("\nConfiguring symlinks in %s based on local firejail config directory\n", arg_bindir);
233 250
234 DIR *dir = opendir(dirname); 251 DIR *dir = opendir(dirname);
235 if (!dir) { 252 if (!dir) {
236 fprintf(stderr, "Error: cannot open ~/.config/firejail directory\n"); 253 perror("opendir");
254 fprintf(stderr, "Error: cannot open %s directory\n", dirname);
237 free(dirname); 255 free(dirname);
238 return; 256 return;
239 } 257 }
@@ -265,9 +283,74 @@ static void set_links_homedir(const char *homedir) {
265 free(firejail_exec); 283 free(firejail_exec);
266} 284}
267 285
286static char *get_user(void) {
287 char *user = getenv("SUDO_USER");
288 if (!user) {
289 user = getpwuid(getuid())->pw_name;
290 if (!user) {
291 fprintf(stderr, "Error: cannot detect login user\n");
292 exit(1);
293 }
294 }
295
296 return user;
297}
298
299static char *get_homedir(const char *user, uid_t *uid, gid_t *gid) {
300 // find home directory
301 struct passwd *pw = getpwnam(user);
302 if (!pw)
303 goto errexit;
304
305 char *home = pw->pw_dir;
306 if (!home)
307 goto errexit;
308
309 *uid = pw->pw_uid;
310 *gid = pw->pw_gid;
311
312 return home;
313
314errexit:
315 fprintf(stderr, "Error: cannot find home directory for user %s\n", user);
316 exit(1);
317}
268 318
269int main(int argc, char **argv) { 319int main(int argc, char **argv) {
270 int i; 320 int i;
321 int bindir_set = 0;
322
323 // user setup
324 char *user = get_user();
325 assert(user);
326 uid_t uid;
327 gid_t gid;
328 char *home = get_homedir(user, &uid, &gid);
329
330
331 // check for --bindir
332 for (i = 1; i < argc; i++) {
333 if (strncmp(argv[i], "--bindir=", 9) == 0) {
334 if (strncmp(argv[i] + 9, "~/", 2) == 0) {
335 if (asprintf(&arg_bindir, "%s/%s", home, argv[i] + 11) == -1)
336 errExit("asprintf");
337 }
338 else
339 arg_bindir = argv[i] + 9;
340 bindir_set = 1;
341
342 // exit if the directory does not exist, or if we don't have access to it
343 if (access(arg_bindir, R_OK | W_OK | X_OK)) {
344 if (errno == EACCES)
345 fprintf(stderr, "Error: firecfg needs full permissions on directory %s\n", arg_bindir);
346 else {
347 perror("access");
348 fprintf(stderr, "Error: cannot access directory %s\n", arg_bindir);
349 }
350 exit(1);
351 }
352 }
353 }
271 354
272 for (i = 1; i < argc; i++) { 355 for (i = 1; i < argc; i++) {
273 // default options 356 // default options
@@ -283,19 +366,10 @@ int main(int argc, char **argv) {
283 return 0; 366 return 0;
284 } 367 }
285 else if (strcmp(argv[i], "--clean") == 0) { 368 else if (strcmp(argv[i], "--clean") == 0) {
286 clear(); 369 clean();
287 return 0; 370 return 0;
288 } 371 }
289 else if (strcmp(argv[i], "--fix") == 0) { 372 else if (strcmp(argv[i], "--fix") == 0) {
290 // find home directory
291 struct passwd *pw = getpwuid(getuid());
292 if (!pw) {
293 goto errexit;
294 }
295 char *home = pw->pw_dir;
296 if (!home) {
297 goto errexit;
298 }
299 fix_desktop_files(home); 373 fix_desktop_files(home);
300 return 0; 374 return 0;
301 } 375 }
@@ -307,21 +381,42 @@ int main(int argc, char **argv) {
307 sound(); 381 sound();
308 return 0; 382 return 0;
309 } 383 }
384 else if (strcmp(argv[i], "--add-users") == 0) {
385 int j;
386 if (getuid() != 0) {
387 fprintf(stderr, "Error: you need to be root to use this option\n");
388 exit(1);
389 }
390
391 // set umask, access database must be world-readable
392 umask(022);
393 for (j = i + 1; j < argc; j++) {
394 printf("Adding user %s to Firejail access database in %s/firejail.users\n", argv[j], SYSCONFDIR);
395 firejail_user_add(argv[j]);
396 }
397 return 0;
398 }
310 else { 399 else {
311 fprintf(stderr, "Error: invalid command line option\n"); 400 if (strncmp(argv[i], "--bindir=", 9) != 0) { // already handled
312 usage(); 401 fprintf(stderr, "Error: invalid command line option\n");
313 return 1; 402 usage();
403 return 1;
404 }
314 } 405 }
315 } 406 }
316 407
408 if (arg_debug)
409 printf("%s %d %d %d %d\n", user, getuid(), getgid(), geteuid(), getegid());
410
317 // set symlinks in /usr/local/bin 411 // set symlinks in /usr/local/bin
318 if (getuid() != 0) { 412 if (bindir_set == 0 && getuid() != 0) {
319 fprintf(stderr, "Error: cannot set the symbolic links in /usr/local/bin\n"); 413 fprintf(stderr, "Error: cannot set the symbolic links in %s\n", arg_bindir);
320 fprintf(stderr, "The proper way to run this command is \"sudo firecfg\".\n"); 414 fprintf(stderr, "The proper way to run this command is \"sudo firecfg\".\n");
321 return 1; 415 return 1;
322 } 416 }
323 else { 417 else if (bindir_set == 0) {
324 // create /usr/local directory if it doesn't exist (Solus distro) 418 // create /usr/local directory if it doesn't exist (Solus distro)
419 mode_t orig_umask = umask(022); // temporarily set the umask
325 struct stat s; 420 struct stat s;
326 if (stat("/usr/local", &s) != 0) { 421 if (stat("/usr/local", &s) != 0) {
327 printf("Creating /usr/local directory\n"); 422 printf("Creating /usr/local directory\n");
@@ -331,58 +426,69 @@ int main(int argc, char **argv) {
331 return 1; 426 return 1;
332 } 427 }
333 } 428 }
334 if (stat("/usr/local/bin", &s) != 0) { 429 if (stat(arg_bindir, &s) != 0) {
335 printf("Creating /usr/local directory\n"); 430 printf("Creating %s directory\n", arg_bindir);
336 int rv = mkdir("/usr/local/bin", 0755); 431 int rv = mkdir(arg_bindir, 0755);
337 if (rv != 0) { 432 if (rv != 0) {
338 fprintf(stderr, "Error: cannot create /usr/local/bin directory\n"); 433 fprintf(stderr, "Error: cannot create %s directory\n", arg_bindir);
339 return 1; 434 return 1;
340 } 435 }
341 } 436 }
437 umask(orig_umask);
342 } 438 }
343 set_links_firecfg();
344 439
440 // clear all symlinks
441 clean();
345 442
443 // set new symlinks based on /usr/lib/firejail/firecfg.cfg
444 set_links_firecfg();
346 445
347 // switch to the local user, and fix desktop files 446 if (getuid() == 0) {
348 char *user = getlogin(); 447 // add user to firejail access database - only for root
349 if (!user) { 448 printf("\nAdding user %s to Firejail access database in %s/firejail.users\n", user, SYSCONFDIR);
350 user = getenv("SUDO_USER"); 449 // temporarily set the umask, access database must be world-readable
351 if (!user) { 450 mode_t orig_umask = umask(022);
352 goto errexit; 451 firejail_user_add(user);
452 umask(orig_umask);
453
454#ifdef HAVE_APPARMOR
455 // enable firejail apparmor profile
456 struct stat s;
457 if (stat("/sbin/apparmor_parser", &s) == 0) {
458 char *cmd;
459
460 // SYSCONFDIR points to /etc/firejail, we have to go on level up (..)
461 printf("\nLoading AppArmor profile\n");
462 if (asprintf(&cmd, "/sbin/apparmor_parser -r /etc/apparmor.d/firejail-default %s/../apparmor.d/firejail-default", SYSCONFDIR) == -1)
463 errExit("asprintf");
464 int rv = system(cmd);
465 (void) rv;
466 free(cmd);
353 } 467 }
468#endif
354 } 469 }
355 470
356 if (user) {
357 // find home directory
358 struct passwd *pw = getpwnam(user);
359 if (!pw) {
360 goto errexit;
361 }
362 char *home = pw->pw_dir;
363 if (!home) {
364 goto errexit;
365 }
366 471
367 // running as root
368 set_links_homedir(home);
369 472
370 // drop permissions 473 // set new symlinks based on ~/.config/firejail directory
474 set_links_homedir(home);
475
476 // drop permissions
477 if (getuid() == 0) {
371 if (setgroups(0, NULL) < 0) 478 if (setgroups(0, NULL) < 0)
372 errExit("setgroups"); 479 errExit("setgroups");
373 // set uid/gid 480 if (setgid(gid) < 0)
374 if (setgid(pw->pw_gid) < 0)
375 errExit("setgid"); 481 errExit("setgid");
376 if (setuid(pw->pw_uid) < 0) 482 if (setuid(uid) < 0)
377 errExit("setuid"); 483 errExit("setuid");
378 if (arg_debug)
379 printf("%s %d %d %d %d\n", user, getuid(), getgid(), geteuid(), getegid());
380 fix_desktop_files(home);
381 } 484 }
382 485
383 return 0; 486 if (arg_debug)
487 printf("%s %d %d %d %d\n", user, getuid(), getgid(), geteuid(), getegid());
384 488
385errexit: 489 // if runs as regular user, fix .desktop files in ~/.local/share/applications directory
386 fprintf(stderr, "Error: cannot detect login user in order to set desktop files in ~/.local/share/applications\n"); 490 if (getuid() != 0)
387 return 1; 491 fix_desktop_files(home);
492
493 return 0;
388} 494}
diff --git a/src/firecfg/sound.c b/src/firecfg/sound.c
index 9dfb305cd..e3fcdbd83 100644
--- a/src/firecfg/sound.c
+++ b/src/firecfg/sound.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -41,10 +41,13 @@ void sound(void) {
41 char *fname; 41 char *fname;
42 if (asprintf(&fname, "%s/.config/pulse/client.conf", home) == -1) 42 if (asprintf(&fname, "%s/.config/pulse/client.conf", home) == -1)
43 errExit("asprintf"); 43 errExit("asprintf");
44 printf("Writing file %s\n", fname);
44 FILE *fpout = fopen(fname, "w"); 45 FILE *fpout = fopen(fname, "w");
45 free(fname); 46 if (!fpout) {
46 if (!fpout) 47 perror("fopen");
47 goto errexit; 48 goto errexit;
49 }
50 free(fname);
48 51
49 // copy default config 52 // copy default config
50 char buf[MAX_BUF]; 53 char buf[MAX_BUF];
@@ -62,4 +65,3 @@ errexit:
62 fprintf(stderr, "Error: cannot configure sound file\n"); 65 fprintf(stderr, "Error: cannot configure sound file\n");
63 exit(1); 66 exit(1);
64} 67}
65
diff --git a/src/firecfg/util.c b/src/firecfg/util.c
index 4520e75e8..14d90b549 100644
--- a/src/firecfg/util.c
+++ b/src/firecfg/util.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -58,9 +58,15 @@ int which(const char *program) {
58 // use path2 to count the entries 58 // use path2 to count the entries
59 char *ptr = strtok(path2, ":"); 59 char *ptr = strtok(path2, ":");
60 while (ptr) { 60 while (ptr) {
61 if (find(program, ptr)) { 61 // Ubuntu 18.04 is adding /snap/bin to PATH;
62 free(path2); 62 // they populate /snap/bin with symbolic links to /usr/bin/ programs;
63 return 1; 63 // most symlinked programs are not installed by default.
64 // Removing /snap/bin from our search
65 if (strcmp(ptr, "/snap/bin") != 0) {
66 if (find(program, ptr)) {
67 free(path2);
68 return 1;
69 }
64 } 70 }
65 ptr = strtok(NULL, ":"); 71 ptr = strtok(NULL, ":");
66 } 72 }
diff --git a/src/firejail/Makefile.in b/src/firejail/Makefile.in
index 146bf8242..793d2cdd1 100644
--- a/src/firejail/Makefile.in
+++ b/src/firejail/Makefile.in
@@ -1,45 +1,17 @@
1.PHONY: all
1all: firejail 2all: firejail
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8 5
9VERSION=@PACKAGE_VERSION@ 6%.o : %.c $(H_FILE_LIST) ../include/rundefs.h ../include/common.h ../include/ldd_utils.h ../include/euid_common.h ../include/pid.h ../include/seccomp.h ../include/syscall_i386.h ../include/syscall_x86_64.h ../include/firejail_user.h
10NAME=@PACKAGE_NAME@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25HAVE_GCOV=@HAVE_GCOV@
26HAVE_GIT_INSTALL=@HAVE_GIT_INSTALL@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28 8
29H_FILE_LIST = $(sort $(wildcard *.[h])) 9firejail: $(OBJS) ../lib/libnetlink.o ../lib/common.o ../lib/ldd_utils.o ../lib/firejail_user.o ../lib/errno.o ../lib/syscall.o
30C_FILE_LIST = $(sort $(wildcard *.c)) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/ldd_utils.o ../lib/firejail_user.o ../lib/errno.o ../lib/syscall.o $(LIBS) $(EXTRA_LDFLAGS)
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) $(HAVE_GIT_INSTALL) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35 11
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/euid_common.h ../include/pid.h ../include/seccomp.h ../include/syscall.h 12.PHONY: clean
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 13clean:; rm -fr *.o firejail *.gcov *.gcda *.gcno *.plist
38
39firejail: $(OBJS) ../lib/libnetlink.o ../lib/common.o
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o $(LIBS) $(EXTRA_LDFLAGS)
41
42clean:; rm -f *.o firejail firejail.1 firejail.1.gz *.gcov *.gcda *.gcno
43 14
15.PHONY: distclean
44distclean: clean 16distclean: clean
45 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/firejail/appimage.c b/src/firejail/appimage.c
index 0f7ab40ff..2266fa499 100644
--- a/src/firejail/appimage.c
+++ b/src/firejail/appimage.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,10 +17,11 @@
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// http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=770fe30a46a12b6fb6b63fbe1737654d28e84844 20// https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=770fe30a46a12b6fb6b63fbe1737654d28e84844
21// sudo mount -o loop krita-3.0-x86_64.appimage mnt 21// sudo mount -o loop krita-3.0-x86_64.appimage mnt
22 22
23#include "firejail.h" 23#include "firejail.h"
24#include "../include/gcov_wrapper.h"
24#include <sys/types.h> 25#include <sys/types.h>
25#include <sys/stat.h> 26#include <sys/stat.h>
26#include <sys/mount.h> 27#include <sys/mount.h>
@@ -29,7 +30,8 @@
29#include <errno.h> 30#include <errno.h>
30 31
31static char *devloop = NULL; // device file 32static char *devloop = NULL; // device file
32static char *mntdir = NULL; // mount point in /tmp directory 33static long unsigned size = 0; // offset into appimage file
34#define MAXBUF 4096
33 35
34#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h 36#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h
35static void err_loop(void) { 37static void err_loop(void) {
@@ -38,36 +40,66 @@ static void err_loop(void) {
38} 40}
39#endif 41#endif
40 42
43// return 1 if found
44int appimage_find_profile(const char *archive) {
45 assert(archive);
46 assert(strlen(archive));
47
48 // try to match the name of the archive with the list of programs in /usr/lib/firejail/firecfg.config
49 FILE *fp = fopen(LIBDIR "/firejail/firecfg.config", "r");
50 if (!fp) {
51 fprintf(stderr, "Error: cannot find %s, firejail is not correctly installed\n", LIBDIR "/firejail/firecfg.config");
52 exit(1);
53 }
54 char buf[MAXBUF];
55 while (fgets(buf, MAXBUF, fp)) {
56 if (*buf == '#')
57 continue;
58 char *ptr = strchr(buf, '\n');
59 if (ptr)
60 *ptr = '\0';
61 if (strcasestr(archive, buf)) {
62 fclose(fp);
63 return profile_find_firejail(buf, 1);
64 }
65 }
66
67 fclose(fp);
68 return 0;
69
70}
71
72
41void appimage_set(const char *appimage) { 73void appimage_set(const char *appimage) {
42 assert(appimage); 74 assert(appimage);
43 assert(devloop == NULL); // don't call this twice! 75 assert(devloop == NULL); // don't call this twice!
44 EUID_ASSERT(); 76 EUID_ASSERT();
45 77
46#ifdef LOOP_CTL_GET_FREE 78#ifdef LOOP_CTL_GET_FREE
47 // check appimage file 79 // open appimage file
48 invalid_filename(appimage); 80 invalid_filename(appimage, 0); // no globbing
49 if (access(appimage, R_OK) == -1) { 81 int ffd = open(appimage, O_RDONLY|O_CLOEXEC);
50 fprintf(stderr, "Error: cannot access AppImage file\n"); 82 if (ffd == -1) {
83 fprintf(stderr, "Error: cannot read AppImage file\n");
84 exit(1);
85 }
86 struct stat s;
87 if (fstat(ffd, &s) == -1)
88 errExit("fstat");
89 if (!S_ISREG(s.st_mode)) {
90 fprintf(stderr, "Error: invalid AppImage file\n");
51 exit(1); 91 exit(1);
52 } 92 }
53 93
54 // get appimage type and ELF size 94 // get appimage type and ELF size
55 // a value of 0 means we are dealing with a type1 appimage 95 // a value of 0 means we are dealing with a type1 appimage
56 long unsigned int size = appimage2_size(appimage); 96 size = appimage2_size(ffd);
57 if (arg_debug) 97 if (arg_debug)
58 printf("AppImage ELF size %lu\n", size); 98 printf("AppImage ELF size %lu\n", size);
59 99
60 // open appimage file
61 /* coverity[toctou] */
62 int ffd = open(appimage, O_RDONLY|O_CLOEXEC);
63 if (ffd == -1) {
64 fprintf(stderr, "Error: cannot open AppImage file\n");
65 exit(1);
66 }
67
68 // find or allocate a free loop device to use 100 // find or allocate a free loop device to use
69 EUID_ROOT(); 101 EUID_ROOT();
70 int cfd = open("/dev/loop-control", O_RDWR); 102 int cfd = open("/dev/loop-control", O_RDWR|O_CLOEXEC);
71 if (cfd == -1) 103 if (cfd == -1)
72 err_loop(); 104 err_loop();
73 int devnr = ioctl(cfd, LOOP_CTL_GET_FREE); 105 int devnr = ioctl(cfd, LOOP_CTL_GET_FREE);
@@ -77,7 +109,8 @@ void appimage_set(const char *appimage) {
77 if (asprintf(&devloop, "/dev/loop%d", devnr) == -1) 109 if (asprintf(&devloop, "/dev/loop%d", devnr) == -1)
78 errExit("asprintf"); 110 errExit("asprintf");
79 111
80 int lfd = open(devloop, O_RDONLY); 112 // associate loop device with appimage
113 int lfd = open(devloop, O_RDONLY|O_CLOEXEC);
81 if (lfd == -1) 114 if (lfd == -1)
82 err_loop(); 115 err_loop();
83 if (ioctl(lfd, LOOP_SET_FD, ffd) == -1) 116 if (ioctl(lfd, LOOP_SET_FD, ffd) == -1)
@@ -90,96 +123,64 @@ void appimage_set(const char *appimage) {
90 if (ioctl(lfd, LOOP_SET_STATUS64, &info) == -1) 123 if (ioctl(lfd, LOOP_SET_STATUS64, &info) == -1)
91 err_loop(); 124 err_loop();
92 } 125 }
93
94 close(lfd); 126 close(lfd);
95 close(ffd); 127 close(ffd);
96 EUID_USER(); 128 EUID_USER();
97 129
98 // creates appimage mount point perms 0700 130 // set environment
99 if (asprintf(&mntdir, "%s/.appimage-%u", RUN_FIREJAIL_APPIMAGE_DIR, getpid()) == -1) 131 char* abspath = realpath(appimage, NULL);
100 errExit("asprintf"); 132 if (abspath == NULL)
101 EUID_ROOT(); 133 errExit("Failed to obtain absolute path");
102 mkdir_attr(mntdir, 0700, getuid(), getgid()); 134 env_store_name_val("APPIMAGE", abspath, SETENV);
103 EUID_USER(); 135 free(abspath);
104
105 // mount
106 char *mode;
107 if (asprintf(&mode, "mode=700,uid=%d,gid=%d", getuid(), getgid()) == -1)
108 errExit("asprintf");
109 EUID_ROOT();
110
111 if (size == 0) {
112 if (mount(devloop, mntdir, "iso9660",MS_MGC_VAL|MS_RDONLY, mode) < 0)
113 errExit("mounting appimage");
114 }
115 else {
116 if (mount(devloop, mntdir, "squashfs",MS_MGC_VAL|MS_RDONLY, mode) < 0)
117 errExit("mounting appimage");
118 }
119 136
120 if (arg_debug) 137 env_store_name_val("APPDIR", RUN_FIREJAIL_APPIMAGE_DIR, SETENV);
121 printf("appimage mounted on %s\n", mntdir);
122 EUID_USER();
123 138
124 // set environment 139 if (size != 0)
125 if (setenv("APPIMAGE", appimage, 1) < 0) 140 env_store_name_val("ARGV0", appimage, SETENV);
126 errExit("setenv");
127 if (mntdir && setenv("APPDIR", mntdir, 1) < 0)
128 errExit("setenv");
129 141
130 // build new command line 142 if (cfg.cwd)
131 if (asprintf(&cfg.command_line, "%s/AppRun", mntdir) == -1) 143 env_store_name_val("OWD", cfg.cwd, SETENV);
132 errExit("asprintf");
133 144
134 free(mode);
135#ifdef HAVE_GCOV
136 __gcov_flush(); 145 __gcov_flush();
137#endif
138#else 146#else
139 fprintf(stderr, "Error: /dev/loop-control interface is not supported by your kernel\n"); 147 fprintf(stderr, "Error: /dev/loop-control interface is not supported by your kernel\n");
140 exit(1); 148 exit(1);
141#endif 149#endif
142} 150}
143 151
144void appimage_clear(void) { 152// mount appimage into sandbox file system
145 int rv; 153void appimage_mount(void) {
154 if (!devloop)
155 return;
146 156
147 EUID_ROOT(); 157 unsigned long flags = MS_MGC_VAL|MS_RDONLY;
148 if (mntdir) { 158 if (getuid())
149 int i; 159 flags |= MS_NODEV|MS_NOSUID;
150 int rv = 0;
151 for (i = 0; i < 5; i++) {
152 rv = umount2(mntdir, MNT_FORCE);
153 if (rv == 0) {
154 if (!arg_quiet)
155 printf("AppImage unmounted\n");
156
157 break;
158 }
159 if (rv == -1 && errno == EBUSY) {
160 fwarning("EBUSY error trying to unmount %s\n", mntdir);
161 sleep(2);
162 continue;
163 }
164
165 // rv = -1
166 if (!arg_quiet) {
167 fwarning("error trying to unmount %s\n", mntdir);
168 perror("umount");
169 }
170 }
171 160
172 if (rv == 0) { 161 if (size == 0) {
173 rmdir(mntdir); 162 fmessage("Mounting appimage type 1\n");
174 free(mntdir); 163 char *mode;
175 } 164 if (asprintf(&mode, "mode=700,uid=%d,gid=%d", getuid(), getgid()) == -1)
165 errExit("asprintf");
166 if (mount(devloop, RUN_FIREJAIL_APPIMAGE_DIR, "iso9660", flags, mode) < 0)
167 errExit("mounting appimage");
168 free(mode);
176 } 169 }
170 else {
171 fmessage("Mounting appimage type 2\n");
172 if (mount(devloop, RUN_FIREJAIL_APPIMAGE_DIR, "squashfs", flags, NULL) < 0)
173 errExit("mounting appimage");
174 }
175}
177 176
177void appimage_clear(void) {
178 EUID_ROOT();
178 if (devloop) { 179 if (devloop) {
179 int lfd = open(devloop, O_RDONLY); 180 int lfd = open(devloop, O_RDONLY|O_CLOEXEC);
180 if (lfd != -1) { 181 if (lfd != -1) {
181 rv = ioctl(lfd, LOOP_CLR_FD, 0); 182 if (ioctl(lfd, LOOP_CLR_FD, 0) != -1)
182 (void) rv; 183 fmessage("AppImage detached\n");
183 close(lfd); 184 close(lfd);
184 } 185 }
185 } 186 }
diff --git a/src/firejail/appimage_size.c b/src/firejail/appimage_size.c
index c750f9028..43ca501da 100644
--- a/src/firejail/appimage_size.c
+++ b/src/firejail/appimage_size.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,9 @@
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/* 20/*
21 This code borrows heavily from src/libappimage_shared/elf.c in libappimage
22 */
23/*
21Compile with: 24Compile with:
22gcc elfsize.c -o elfsize 25gcc elfsize.c -o elfsize
23Example: 26Example:
@@ -74,7 +77,10 @@ static uint64_t file64_to_cpu(uint64_t val) {
74// return 0 if error 77// return 0 if error
75static long unsigned int read_elf32(int fd) { 78static long unsigned int read_elf32(int fd) {
76 Elf32_Ehdr ehdr32; 79 Elf32_Ehdr ehdr32;
80 Elf32_Shdr shdr32;
81 off_t last_shdr_offset;
77 ssize_t ret; 82 ssize_t ret;
83 unsigned long sht_end, last_section_end;
78 84
79 ret = pread(fd, &ehdr32, sizeof(ehdr32), 0); 85 ret = pread(fd, &ehdr32, sizeof(ehdr32), 0);
80 if (ret < 0 || (size_t)ret != sizeof(ehdr)) 86 if (ret < 0 || (size_t)ret != sizeof(ehdr))
@@ -84,14 +90,25 @@ static long unsigned int read_elf32(int fd) {
84 ehdr.e_shentsize = file16_to_cpu(ehdr32.e_shentsize); 90 ehdr.e_shentsize = file16_to_cpu(ehdr32.e_shentsize);
85 ehdr.e_shnum = file16_to_cpu(ehdr32.e_shnum); 91 ehdr.e_shnum = file16_to_cpu(ehdr32.e_shnum);
86 92
87 return(ehdr.e_shoff + (ehdr.e_shentsize * ehdr.e_shnum)); 93 last_shdr_offset = ehdr.e_shoff + (ehdr.e_shentsize * (ehdr.e_shnum - 1));
94 ret = pread(fd, &shdr32, sizeof(shdr32), last_shdr_offset);
95 if (ret < 0 || (size_t)ret != sizeof(shdr32))
96 return 0;
97
98 /* ELF ends either with the table of section headers (SHT) or with a section. */
99 sht_end = ehdr.e_shoff + (ehdr.e_shentsize * ehdr.e_shnum);
100 last_section_end = file64_to_cpu(shdr32.sh_offset) + file64_to_cpu(shdr32.sh_size);
101 return sht_end > last_section_end ? sht_end : last_section_end;
88} 102}
89 103
90 104
91// return 0 if error 105// return 0 if error
92static long unsigned int read_elf64(int fd) { 106static long unsigned int read_elf64(int fd) {
93 Elf64_Ehdr ehdr64; 107 Elf64_Ehdr ehdr64;
108 Elf64_Shdr shdr64;
109 off_t last_shdr_offset;
94 ssize_t ret; 110 ssize_t ret;
111 unsigned long sht_end, last_section_end;
95 112
96 ret = pread(fd, &ehdr64, sizeof(ehdr64), 0); 113 ret = pread(fd, &ehdr64, sizeof(ehdr64), 0);
97 if (ret < 0 || (size_t)ret != sizeof(ehdr)) 114 if (ret < 0 || (size_t)ret != sizeof(ehdr))
@@ -101,33 +118,34 @@ static long unsigned int read_elf64(int fd) {
101 ehdr.e_shentsize = file16_to_cpu(ehdr64.e_shentsize); 118 ehdr.e_shentsize = file16_to_cpu(ehdr64.e_shentsize);
102 ehdr.e_shnum = file16_to_cpu(ehdr64.e_shnum); 119 ehdr.e_shnum = file16_to_cpu(ehdr64.e_shnum);
103 120
104 return(ehdr.e_shoff + (ehdr.e_shentsize * ehdr.e_shnum)); 121 last_shdr_offset = ehdr.e_shoff + (ehdr.e_shentsize * (ehdr.e_shnum - 1));
122 ret = pread(fd, &shdr64, sizeof(shdr64), last_shdr_offset);
123 if (ret < 0 || (size_t)ret != sizeof(shdr64))
124 return 0;
125
126 /* ELF ends either with the table of section headers (SHT) or with a section. */
127 sht_end = ehdr.e_shoff + (ehdr.e_shentsize * ehdr.e_shnum);
128 last_section_end = file64_to_cpu(shdr64.sh_offset) + file64_to_cpu(shdr64.sh_size);
129 return sht_end > last_section_end ? sht_end : last_section_end;
105} 130}
106 131
107 132
108// return 0 if error 133// return 0 if error
109// return 0 if this is not an appimgage2 file 134// return 0 if this is not an appimgage2 file
110long unsigned int appimage2_size(const char *fname) { 135long unsigned int appimage2_size(int fd) {
111/* TODO, FIXME: This assumes that the section header table (SHT) is
112the last part of the ELF. This is usually the case but
113it could also be that the last section is the last part
114of the ELF. This should be checked for.
115*/
116 ssize_t ret; 136 ssize_t ret;
117 int fd;
118 long unsigned int size = 0; 137 long unsigned int size = 0;
119 138
120 fd = open(fname, O_RDONLY);
121 if (fd < 0) 139 if (fd < 0)
122 return 0; 140 return 0;
123 141
124 ret = pread(fd, ehdr.e_ident, EI_NIDENT, 0); 142 ret = pread(fd, ehdr.e_ident, EI_NIDENT, 0);
125 if (ret != EI_NIDENT) 143 if (ret != EI_NIDENT)
126 goto getout; 144 return 0;
127 145
128 if ((ehdr.e_ident[EI_DATA] != ELFDATA2LSB) && 146 if ((ehdr.e_ident[EI_DATA] != ELFDATA2LSB) &&
129 (ehdr.e_ident[EI_DATA] != ELFDATA2MSB)) 147 (ehdr.e_ident[EI_DATA] != ELFDATA2MSB))
130 goto getout; 148 return 0;
131 149
132 if(ehdr.e_ident[EI_CLASS] == ELFCLASS32) { 150 if(ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
133 size = read_elf32(fd); 151 size = read_elf32(fd);
@@ -136,23 +154,19 @@ of the ELF. This should be checked for.
136 size = read_elf64(fd); 154 size = read_elf64(fd);
137 } 155 }
138 else { 156 else {
139 goto getout; 157 return 0;
140 } 158 }
141 if (size == 0) 159 if (size == 0)
142 goto getout; 160 return 0;
143 161
144 162
145 // look for a LZMA header at this location 163 // look for a LZMA header at this location
146 unsigned char buf[4]; 164 unsigned char buf[4];
147 ret = pread(fd, buf, 4, size); 165 ret = pread(fd, buf, 4, size);
148 if (ret != 4) { 166 if (ret != 4)
149 size = 0; 167 return 0;
150 goto getout;
151 }
152 if (memcmp(buf, "hsqs", 4) != 0) 168 if (memcmp(buf, "hsqs", 4) != 0)
153 size = 0; 169 return 0;
154 170
155getout:
156 close(fd);
157 return size; 171 return size;
158} 172}
diff --git a/src/firejail/arg-checking.txt b/src/firejail/arg-checking.txt
deleted file mode 100644
index cfed454f8..000000000
--- a/src/firejail/arg-checking.txt
+++ /dev/null
@@ -1,84 +0,0 @@
1arg checking:
2
31. --output=filename
4 - not supported in profiles
5 - checking no "..",
6 - checking no link,
7 - checking no dir,
8 - checking same permissions,
9 - checking no hard links
10 - unit test
11
122. --chroot=dirname
13 - not supported in profiles
14 - expand "~"
15 - checking no "..",
16 - checking is dir,
17 - checking no link
18 - checking directory structure
19 - unit test
20
213. --bind=dirname1,dirname2, --bind=filename1,filenam2
22 - supported in profiles
23 - accepted only when running as root
24 - checking string chars
25 - checking no ".."
26 - unit test non root
27
284. --tmpfs=dirname
29 - supported in profiles
30 - checking string chars
31 - checking no ".."
32 - unit test
33
345. --blacklist=filename, --blacklist=dirname
35 - supported in profiles
36 - checking string chars
37 - checking no ".."
38 - unit test
39
406. --read-only=filename, --read-only=dirname
41 - supported in profiles
42 - checking string chars
43 - checking no ".."
44 - unit test
45
467. --profile=filename
47 - check access as real GID/UID
48 - checking no dir
49 - checking no link
50 - checking no ".."
51 - unit test
52
538. --private=dirname
54 - supported in profiles
55 - expand "~"
56 - check is dir
57 - check no link
58 - checking no ".."
59 - check same owner
60 - unit test
61
629. --private-home=filelist
63 - supported in profiles
64 - checking no ".."
65 - checking file found
66 - checking same owner
67 - checking no link
68 - unit test
69
7010. --netfilter=filename
71 - supported in profiles
72 - check access as real GID/UID
73 - checking no dir
74 - checking no link
75 - checking no ".."
76 - unit test
77
7811. --shell=filename
79 - not supported in profiles
80 - check access as real GID/UID
81 - checking no dir
82 - checking no link
83 - checking no ".."
84 - unit test
diff --git a/src/firejail/arp.c b/src/firejail/arp.c
index ffbc56841..c259fc0ad 100644
--- a/src/firejail/arp.c
+++ b/src/firejail/arp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,6 +20,7 @@
20#include "firejail.h" 20#include "firejail.h"
21#include <sys/socket.h> 21#include <sys/socket.h>
22#include <sys/ioctl.h> 22#include <sys/ioctl.h>
23#include <sys/time.h>
23#include <linux/if_ether.h> //TCP/IP Protocol Suite for Linux 24#include <linux/if_ether.h> //TCP/IP Protocol Suite for Linux
24#include <net/if.h> 25#include <net/if.h>
25#include <netinet/in.h> 26#include <netinet/in.h>
@@ -45,7 +46,7 @@ typedef struct arp_hdr_t {
45void arp_announce(const char *dev, Bridge *br) { 46void arp_announce(const char *dev, Bridge *br) {
46 // RFC 5227 - using a source and destination IP address of the interface 47 // RFC 5227 - using a source and destination IP address of the interface
47 uint32_t srcaddr = br->ipsandbox; 48 uint32_t srcaddr = br->ipsandbox;
48 uint32_t destaddr = br->ipsandbox; 49 uint32_t destaddr = srcaddr;
49 50
50 if (strlen(dev) > IFNAMSIZ) { 51 if (strlen(dev) > IFNAMSIZ) {
51 fprintf(stderr, "Error: invalid network device name %s\n", dev); 52 fprintf(stderr, "Error: invalid network device name %s\n", dev);
@@ -66,7 +67,7 @@ void arp_announce(const char *dev, Bridge *br) {
66 // Find interface MAC address 67 // Find interface MAC address
67 struct ifreq ifr; 68 struct ifreq ifr;
68 memset(&ifr, 0, sizeof (ifr)); 69 memset(&ifr, 0, sizeof (ifr));
69 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 70 strncpy(ifr.ifr_name, dev, IFNAMSIZ - 1);
70 if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) 71 if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0)
71 errExit("ioctl"); 72 errExit("ioctl");
72 close(sock); 73 close(sock);
@@ -78,7 +79,7 @@ void arp_announce(const char *dev, Bridge *br) {
78 errExit("if_nametoindex"); 79 errExit("if_nametoindex");
79 addr.sll_family = AF_PACKET; 80 addr.sll_family = AF_PACKET;
80 memcpy (addr.sll_addr, ifr.ifr_hwaddr.sa_data, 6); 81 memcpy (addr.sll_addr, ifr.ifr_hwaddr.sa_data, 6);
81 addr.sll_halen = htons(6); 82 addr.sll_halen = ETH_ALEN;
82 83
83 // build the arp packet header 84 // build the arp packet header
84 ArpHdr hdr; 85 ArpHdr hdr;
@@ -105,8 +106,7 @@ void arp_announce(const char *dev, Bridge *br) {
105 if ((sock = socket(PF_PACKET, SOCK_RAW, htons (ETH_P_ALL))) < 0) 106 if ((sock = socket(PF_PACKET, SOCK_RAW, htons (ETH_P_ALL))) < 0)
106 errExit("socket"); 107 errExit("socket");
107 108
108 int len; 109 if (sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr)) <= 0)
109 if ((len = sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr))) <= 0)
110 errExit("send"); 110 errExit("send");
111 fflush(0); 111 fflush(0);
112 close(sock); 112 close(sock);
@@ -138,7 +138,7 @@ int arp_check(const char *dev, uint32_t destaddr) {
138 // Find interface MAC address 138 // Find interface MAC address
139 struct ifreq ifr; 139 struct ifreq ifr;
140 memset(&ifr, 0, sizeof (ifr)); 140 memset(&ifr, 0, sizeof (ifr));
141 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 141 strncpy(ifr.ifr_name, dev, IFNAMSIZ - 1);
142 if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) 142 if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0)
143 errExit("ioctl"); 143 errExit("ioctl");
144 close(sock); 144 close(sock);
@@ -150,7 +150,7 @@ int arp_check(const char *dev, uint32_t destaddr) {
150 errExit("if_nametoindex"); 150 errExit("if_nametoindex");
151 addr.sll_family = AF_PACKET; 151 addr.sll_family = AF_PACKET;
152 memcpy (addr.sll_addr, ifr.ifr_hwaddr.sa_data, 6); 152 memcpy (addr.sll_addr, ifr.ifr_hwaddr.sa_data, 6);
153 addr.sll_halen = htons(6); 153 addr.sll_halen = ETH_ALEN;
154 154
155 // build the arp packet header 155 // build the arp packet header
156 ArpHdr hdr; 156 ArpHdr hdr;
@@ -177,8 +177,7 @@ int arp_check(const char *dev, uint32_t destaddr) {
177 if ((sock = socket(PF_PACKET, SOCK_RAW, htons (ETH_P_ALL))) < 0) 177 if ((sock = socket(PF_PACKET, SOCK_RAW, htons (ETH_P_ALL))) < 0)
178 errExit("socket"); 178 errExit("socket");
179 179
180 int len; 180 if (sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr)) <= 0)
181 if ((len = sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr))) <= 0)
182 errExit("send"); 181 errExit("send");
183 fflush(0); 182 fflush(0);
184 183
@@ -190,9 +189,14 @@ int arp_check(const char *dev, uint32_t destaddr) {
190 FD_SET(sock, &fds); 189 FD_SET(sock, &fds);
191 int maxfd = sock; 190 int maxfd = sock;
192 struct timeval ts; 191 struct timeval ts;
193 ts.tv_sec = 0; // 0.5 seconds wait time 192 gettimeofday(&ts, NULL);
194 ts.tv_usec = 500000; 193 double timerend = ts.tv_sec + ts.tv_usec / 1000000.0 + 0.5;
195 while (1) { 194 while (1) {
195 gettimeofday(&ts, NULL);
196 double now = ts.tv_sec + ts.tv_usec / 1000000.0;
197 double timeout = timerend - now;
198 ts.tv_sec = timeout;
199 ts.tv_usec = (timeout - ts.tv_sec) * 1000000;
196 int nready = select(maxfd + 1, &fds, (fd_set *) 0, (fd_set *) 0, &ts); 200 int nready = select(maxfd + 1, &fds, (fd_set *) 0, (fd_set *) 0, &ts);
197 if (nready < 0) 201 if (nready < 0)
198 errExit("select"); 202 errExit("select");
@@ -201,10 +205,10 @@ int arp_check(const char *dev, uint32_t destaddr) {
201 close(sock); 205 close(sock);
202 return 0; 206 return 0;
203 } 207 }
204 if ((len = sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr))) <= 0) 208 if (sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr)) <= 0)
205 errExit("send"); 209 errExit("send");
206 ts.tv_sec = 0; // 0.5 seconds wait time 210 gettimeofday(&ts, NULL);
207 ts.tv_usec = 500000; 211 timerend = ts.tv_sec + ts.tv_usec / 1000000.0 + 0.5;
208 fflush(0); 212 fflush(0);
209 } 213 }
210 else { 214 else {
@@ -239,9 +243,7 @@ int arp_check(const char *dev, uint32_t destaddr) {
239 } 243 }
240 } 244 }
241 245
242 // it will never get here! 246 __builtin_unreachable();
243 close(sock);
244 return -1;
245} 247}
246 248
247// assign a random IP address and check it 249// assign a random IP address and check it
@@ -281,7 +283,7 @@ static uint32_t arp_random(const char *dev, Bridge *br) {
281 int i = 0; 283 int i = 0;
282 for (i = 0; i < 10; i++) { 284 for (i = 0; i < 10; i++) {
283 dest = start + ((uint32_t) rand()) % range; 285 dest = start + ((uint32_t) rand()) % range;
284 if (dest == ifip) // do not allow the interface address 286 if (dest == ifip || dest == cfg.defaultgw) // do not allow the interface address or the default gateway
285 continue; // try again 287 continue; // try again
286 288
287 // if we've made it up to here, we have a valid address 289 // if we've made it up to here, we have a valid address
@@ -329,7 +331,7 @@ static uint32_t arp_sequential(const char *dev, Bridge *br) {
329 331
330 // loop through addresses and stop as soon as you find an unused one 332 // loop through addresses and stop as soon as you find an unused one
331 while (dest <= last) { 333 while (dest <= last) {
332 if (dest == ifip) { 334 if (dest == ifip || dest == cfg.defaultgw) {
333 dest++; 335 dest++;
334 continue; 336 continue;
335 } 337 }
diff --git a/src/firejail/bandwidth.c b/src/firejail/bandwidth.c
index 24d027d54..a085f2c27 100644
--- a/src/firejail/bandwidth.c
+++ b/src/firejail/bandwidth.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -22,6 +22,7 @@
22#include <sys/types.h> 22#include <sys/types.h>
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <unistd.h> 24#include <unistd.h>
25#include <errno.h>
25#include <net/if.h> 26#include <net/if.h>
26#include "firejail.h" 27#include "firejail.h"
27 28
@@ -119,44 +120,21 @@ static void bandwidth_create_run_file(pid_t pid) {
119 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1) 120 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1)
120 errExit("asprintf"); 121 errExit("asprintf");
121 122
122 // if the file already exists, do nothing
123 struct stat s;
124 if (stat(fname, &s) == 0) {
125 free(fname);
126 return;
127 }
128
129 // create an empty file and set mod and ownership 123 // create an empty file and set mod and ownership
130 /* coverity[toctou] */ 124 // if the file already exists, do nothing
131 FILE *fp = fopen(fname, "w"); 125 FILE *fp = fopen(fname, "wxe");
132 if (fp) { 126 free(fname);
133 SET_PERMS_STREAM(fp, 0, 0, 0644); 127 if (!fp) {
134 fclose(fp); 128 if (errno == EEXIST)
135 } 129 return;
136 else {
137 fprintf(stderr, "Error: cannot create bandwidth file\n"); 130 fprintf(stderr, "Error: cannot create bandwidth file\n");
138 exit(1); 131 exit(1);
139 } 132 }
140 133
141 free(fname); 134 SET_PERMS_STREAM(fp, 0, 0, 0644);
142} 135 fclose(fp);
143
144// delete bandwidth file
145void bandwidth_del_run_file(pid_t pid) {
146 char *fname;
147 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1)
148 errExit("asprintf");
149 unlink(fname);
150 free(fname);
151} 136}
152 137
153void network_del_run_file(pid_t pid) {
154 char *fname;
155 if (asprintf(&fname, "%s/%d-netmap", RUN_FIREJAIL_NETWORK_DIR, (int) pid) == -1)
156 errExit("asprintf");
157 unlink(fname);
158 free(fname);
159}
160 138
161void network_set_run_file(pid_t pid) { 139void network_set_run_file(pid_t pid) {
162 char *fname; 140 char *fname;
@@ -164,7 +142,7 @@ void network_set_run_file(pid_t pid) {
164 errExit("asprintf"); 142 errExit("asprintf");
165 143
166 // create an empty file and set mod and ownership 144 // create an empty file and set mod and ownership
167 FILE *fp = fopen(fname, "w"); 145 FILE *fp = fopen(fname, "we");
168 if (fp) { 146 if (fp) {
169 if (cfg.bridge0.configured) 147 if (cfg.bridge0.configured)
170 fprintf(fp, "%s:%s\n", cfg.bridge0.dev, cfg.bridge0.devsandbox); 148 fprintf(fp, "%s:%s\n", cfg.bridge0.dev, cfg.bridge0.devsandbox);
@@ -194,7 +172,7 @@ static void read_bandwidth_file(pid_t pid) {
194 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1) 172 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1)
195 errExit("asprintf"); 173 errExit("asprintf");
196 174
197 FILE *fp = fopen(fname, "r"); 175 FILE *fp = fopen(fname, "re");
198 if (fp) { 176 if (fp) {
199 char buf[1024]; 177 char buf[1024];
200 while (fgets(buf, 1024,fp)) { 178 while (fgets(buf, 1024,fp)) {
@@ -230,7 +208,7 @@ static void write_bandwidth_file(pid_t pid) {
230 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1) 208 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1)
231 errExit("asprintf"); 209 errExit("asprintf");
232 210
233 FILE *fp = fopen(fname, "w"); 211 FILE *fp = fopen(fname, "we");
234 if (fp) { 212 if (fp) {
235 IFBW *ptr = ifbw; 213 IFBW *ptr = ifbw;
236 while (ptr) { 214 while (ptr) {
@@ -268,9 +246,8 @@ void bandwidth_remove(pid_t pid, const char *dev) {
268 } 246 }
269 247
270 // remove the file if there are no entries in the list 248 // remove the file if there are no entries in the list
271 if (ifbw == NULL) { 249 if (ifbw == NULL)
272 bandwidth_del_run_file(pid); 250 delete_bandwidth_run_file(pid);
273 }
274} 251}
275 252
276// add interface to run file 253// add interface to run file
@@ -313,54 +290,7 @@ void bandwidth_set(pid_t pid, const char *dev, int down, int up) {
313//*********************************** 290//***********************************
314void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, int up) { 291void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, int up) {
315 EUID_ASSERT(); 292 EUID_ASSERT();
316 //************************ 293 enter_network_namespace(pid);
317 // verify sandbox
318 //************************
319 EUID_ROOT();
320 char *comm = pid_proc_comm(pid);
321 EUID_USER();
322 if (!comm) {
323 fprintf(stderr, "Error: cannot find sandbox\n");
324 exit(1);
325 }
326
327 // check for firejail sandbox
328 if (strcmp(comm, "firejail") != 0) {
329 fprintf(stderr, "Error: cannot find sandbox\n");
330 exit(1);
331 }
332 free(comm);
333
334 // check network namespace
335 char *name;
336 if (asprintf(&name, "/run/firejail/network/%d-netmap", pid) == -1)
337 errExit("asprintf");
338 struct stat s;
339 if (stat(name, &s) == -1) {
340 fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n");
341 exit(1);
342 }
343
344 //************************
345 // join the network namespace
346 //************************
347 pid_t child;
348 if (find_child(pid, &child) == -1) {
349 fprintf(stderr, "Error: cannot join the network namespace\n");
350 exit(1);
351 }
352
353 EUID_ROOT();
354 if (join_namespace(child, "net")) {
355 fprintf(stderr, "Error: cannot join the network namespace\n");
356 exit(1);
357 }
358
359 // set run file
360 if (strcmp(command, "set") == 0)
361 bandwidth_set(pid, dev, down, up);
362 else if (strcmp(command, "clear") == 0)
363 bandwidth_remove(pid, dev);
364 294
365 //************************ 295 //************************
366 // build command 296 // build command
@@ -371,7 +301,7 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in
371 char *fname; 301 char *fname;
372 if (asprintf(&fname, "%s/%d-netmap", RUN_FIREJAIL_NETWORK_DIR, (int) pid) == -1) 302 if (asprintf(&fname, "%s/%d-netmap", RUN_FIREJAIL_NETWORK_DIR, (int) pid) == -1)
373 errExit("asprintf"); 303 errExit("asprintf");
374 FILE *fp = fopen(fname, "r"); 304 FILE *fp = fopen(fname, "re");
375 if (!fp) { 305 if (!fp) {
376 fprintf(stderr, "Error: cannot read network map file %s\n", fname); 306 fprintf(stderr, "Error: cannot read network map file %s\n", fname);
377 exit(1); 307 exit(1);
@@ -391,6 +321,15 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in
391 devname = strdup(buf + len + 1); 321 devname = strdup(buf + len + 1);
392 if (!devname) 322 if (!devname)
393 errExit("strdup"); 323 errExit("strdup");
324 // double-check device name
325 size_t i;
326 for (i = 0; devname[i]; i++) {
327 if (isalnum((unsigned char) devname[i]) == 0 &&
328 devname[i] != '-') {
329 fprintf(stderr, "Error: name of network device is invalid\n");
330 exit(1);
331 }
332 }
394 // check device in namespace 333 // check device in namespace
395 if (if_nametoindex(devname) == 0) { 334 if (if_nametoindex(devname) == 0) {
396 fprintf(stderr, "Error: cannot find network device %s\n", devname); 335 fprintf(stderr, "Error: cannot find network device %s\n", devname);
@@ -403,6 +342,23 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in
403 fclose(fp); 342 fclose(fp);
404 } 343 }
405 344
345 // set run file
346 if (strcmp(command, "set") == 0) {
347 if (devname == NULL) {
348 fprintf(stderr, "Error: cannot find a %s interface inside the sandbox\n", dev);
349 exit(1);
350 }
351 bandwidth_set(pid, devname, down, up);
352 }
353 else if (strcmp(command, "clear") == 0) {
354 if (devname == NULL) {
355 fprintf(stderr, "Error: cannot find a %s interface inside the sandbox\n", dev);
356 exit(1);
357 }
358 bandwidth_remove(pid, devname);
359 }
360 else assert(strcmp(command, "status") == 0);
361
406 // build fshaper.sh command 362 // build fshaper.sh command
407 char *cmd = NULL; 363 char *cmd = NULL;
408 if (devname) { 364 if (devname) {
@@ -423,26 +379,16 @@ void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, in
423 } 379 }
424 assert(cmd); 380 assert(cmd);
425 381
426 // wipe out environment variables
427 environ = NULL;
428
429 //************************ 382 //************************
430 // build command 383 // build command
431 //************************ 384 //************************
432 // elevate privileges
433 if (setreuid(0, 0))
434 errExit("setreuid");
435 if (setregid(0, 0))
436 errExit("setregid");
437
438 char *arg[4]; 385 char *arg[4];
439 arg[0] = "/bin/sh"; 386 arg[0] = "/bin/sh";
440 arg[1] = "-c"; 387 arg[1] = "-c";
441 arg[2] = cmd; 388 arg[2] = cmd;
442 arg[3] = NULL; 389 arg[3] = NULL;
443 clearenv(); 390 clearenv();
444 execvp(arg[0], arg); 391 sbox_exec_v(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, arg);
445 392
446 // it will never get here 393 // it will never get here!!
447 errExit("execvp");
448} 394}
diff --git a/src/firejail/caps.c b/src/firejail/caps.c
index 14f981a86..5e02b99c2 100644
--- a/src/firejail/caps.c
+++ b/src/firejail/caps.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -162,6 +162,21 @@ static CapsEntry capslist[] = {
162#else 162#else
163 {"audit_read", 37 }, 163 {"audit_read", 37 },
164#endif 164#endif
165#ifdef CAP_PERFMON
166 {"perfmon", CAP_PERFMON },
167#else
168 {"perfmon", 38 },
169#endif
170#ifdef CAP_BPF
171 {"bpf", CAP_BPF },
172#else
173 {"bpf", 39 },
174#endif
175#ifdef CAP_CHECKPOINT_RESTORE
176 {"checkpoint_restore", CAP_CHECKPOINT_RESTORE },
177#else
178 {"checkpoint_restore", 40 },
179#endif
165 180
166// 181//
167// end of generated code 182// end of generated code
@@ -374,7 +389,7 @@ static uint64_t extract_caps(int pid) {
374 errExit("asprintf"); 389 errExit("asprintf");
375 390
376 EUID_ROOT(); // grsecurity 391 EUID_ROOT(); // grsecurity
377 FILE *fp = fopen(file, "r"); 392 FILE *fp = fopen(file, "re");
378 EUID_USER(); // grsecurity 393 EUID_USER(); // grsecurity
379 if (!fp) 394 if (!fp)
380 goto errexit; 395 goto errexit;
@@ -401,29 +416,11 @@ errexit:
401void caps_print_filter(pid_t pid) { 416void caps_print_filter(pid_t pid) {
402 EUID_ASSERT(); 417 EUID_ASSERT();
403 418
404 // if the pid is that of a firejail process, use the pid of the first child process 419 // in case the pid is that of a firejail process, use the pid of the first child process
405 EUID_ROOT(); // grsecurity 420 pid = switch_to_child(pid);
406 char *comm = pid_proc_comm(pid);
407 EUID_USER(); // grsecurity
408 if (comm) {
409 if (strcmp(comm, "firejail") == 0) {
410 pid_t child;
411 if (find_child(pid, &child) == 0) {
412 pid = child;
413 }
414 }
415 free(comm);
416 }
417 421
418 // check privileges for non-root users 422 // exit if no permission to join the sandbox
419 uid_t uid = getuid(); 423 check_join_permission(pid);
420 if (uid != 0) {
421 uid_t sandbox_uid = pid_get_uid(pid);
422 if (uid != sandbox_uid) {
423 fprintf(stderr, "Error: permission denied.\n");
424 exit(1);
425 }
426 }
427 424
428 uint64_t caps = extract_caps(pid); 425 uint64_t caps = extract_caps(pid);
429 int i; 426 int i;
diff --git a/src/firejail/cgroup.c b/src/firejail/cgroup.c
index 70f07dd23..e7ffbca36 100644
--- a/src/firejail/cgroup.c
+++ b/src/firejail/cgroup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -26,7 +26,7 @@ void save_cgroup(void) {
26 if (cfg.cgroup == NULL) 26 if (cfg.cgroup == NULL)
27 return; 27 return;
28 28
29 FILE *fp = fopen(RUN_CGROUP_CFG, "w"); 29 FILE *fp = fopen(RUN_CGROUP_CFG, "wxe");
30 if (fp) { 30 if (fp) {
31 fprintf(fp, "%s", cfg.cgroup); 31 fprintf(fp, "%s", cfg.cgroup);
32 fflush(0); 32 fflush(0);
@@ -48,7 +48,7 @@ void load_cgroup(const char *fname) {
48 if (!fname) 48 if (!fname)
49 return; 49 return;
50 50
51 FILE *fp = fopen(fname, "r"); 51 FILE *fp = fopen(fname, "re");
52 if (fp) { 52 if (fp) {
53 char buf[MAXBUF]; 53 char buf[MAXBUF];
54 if (fgets(buf, MAXBUF, fp)) { 54 if (fgets(buf, MAXBUF, fp)) {
@@ -72,7 +72,7 @@ errout:
72void set_cgroup(const char *path) { 72void set_cgroup(const char *path) {
73 EUID_ASSERT(); 73 EUID_ASSERT();
74 74
75 invalid_filename(path); 75 invalid_filename(path, 0); // no globbing
76 76
77 // path starts with /sys/fs/cgroup 77 // path starts with /sys/fs/cgroup
78 if (strncmp(path, "/sys/fs/cgroup", 14) != 0) 78 if (strncmp(path, "/sys/fs/cgroup", 14) != 0)
@@ -91,19 +91,19 @@ void set_cgroup(const char *path) {
91 goto errout; 91 goto errout;
92 92
93 // tasks file exists 93 // tasks file exists
94 struct stat s; 94 FILE *fp = fopen(path, "ae");
95 if (stat(path, &s) == -1) 95 if (!fp)
96 goto errout; 96 goto errout;
97
98 // task file belongs to the user running the sandbox 97 // task file belongs to the user running the sandbox
98 int fd = fileno(fp);
99 if (fd == -1)
100 errExit("fileno");
101 struct stat s;
102 if (fstat(fd, &s) == -1)
103 errExit("fstat");
99 if (s.st_uid != getuid() && s.st_gid != getgid()) 104 if (s.st_uid != getuid() && s.st_gid != getgid())
100 goto errout2; 105 goto errout2;
101
102 // add the task to cgroup 106 // add the task to cgroup
103 /* coverity[toctou] */
104 FILE *fp = fopen(path, "a");
105 if (!fp)
106 goto errout;
107 pid_t pid = getpid(); 107 pid_t pid = getpid();
108 int rv = fprintf(fp, "%d\n", pid); 108 int rv = fprintf(fp, "%d\n", pid);
109 (void) rv; 109 (void) rv;
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c
index 7f371b299..06e6f0ccb 100644
--- a/src/firejail/checkcfg.c
+++ b/src/firejail/checkcfg.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,8 @@
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/seccomp.h"
22#include "../include/syscall.h"
21#include <sys/stat.h> 23#include <sys/stat.h>
22#include <linux/loop.h> 24#include <linux/loop.h>
23 25
@@ -31,6 +33,10 @@ char *xpra_extra_params = "";
31char *xvfb_screen = "800x600x24"; 33char *xvfb_screen = "800x600x24";
32char *xvfb_extra_params = ""; 34char *xvfb_extra_params = "";
33char *netfilter_default = NULL; 35char *netfilter_default = NULL;
36unsigned long join_timeout = 5000000; // microseconds
37char *config_seccomp_error_action_str = "EPERM";
38char *config_seccomp_filter_add = NULL;
39char **whitelist_reject_topdirs = NULL;
34 40
35int checkcfg(int val) { 41int checkcfg(int val) {
36 assert(val < CFG_MAX); 42 assert(val < CFG_MAX);
@@ -47,14 +53,15 @@ int checkcfg(int val) {
47 cfg_val[CFG_FORCE_NONEWPRIVS] = 0; 53 cfg_val[CFG_FORCE_NONEWPRIVS] = 0;
48 cfg_val[CFG_PRIVATE_BIN_NO_LOCAL] = 0; 54 cfg_val[CFG_PRIVATE_BIN_NO_LOCAL] = 0;
49 cfg_val[CFG_FIREJAIL_PROMPT] = 0; 55 cfg_val[CFG_FIREJAIL_PROMPT] = 0;
50 cfg_val[CFG_FOLLOW_SYMLINK_PRIVATE_BIN] = 0;
51 cfg_val[CFG_DISABLE_MNT] = 0; 56 cfg_val[CFG_DISABLE_MNT] = 0;
52 cfg_val[CFG_ARP_PROBES] = DEFAULT_ARP_PROBES; 57 cfg_val[CFG_ARP_PROBES] = DEFAULT_ARP_PROBES;
53 cfg_val[CFG_XPRA_ATTACH] = 0; 58 cfg_val[CFG_XPRA_ATTACH] = 0;
59 cfg_val[CFG_SECCOMP_ERROR_ACTION] = -1;
60 cfg_val[CFG_BROWSER_ALLOW_DRM] = 0;
54 61
55 // open configuration file 62 // open configuration file
56 const char *fname = SYSCONFDIR "/firejail.config"; 63 const char *fname = SYSCONFDIR "/firejail.config";
57 fp = fopen(fname, "r"); 64 fp = fopen(fname, "re");
58 if (!fp) { 65 if (!fp) {
59#ifdef HAVE_GLOBALCFG 66#ifdef HAVE_GLOBALCFG
60 fprintf(stderr, "Error: Firejail configuration file %s not found\n", fname); 67 fprintf(stderr, "Error: Firejail configuration file %s not found\n", fname);
@@ -72,137 +79,51 @@ int checkcfg(int val) {
72 if (*buf == '#' || *buf == '\n') 79 if (*buf == '#' || *buf == '\n')
73 continue; 80 continue;
74 81
82#define PARSE_YESNO(key, string) \
83 else if (strncmp(ptr, string " ", strlen(string)+1) == 0) { \
84 if (strcmp(ptr + strlen(string) + 1, "yes") == 0) \
85 cfg_val[key] = 1; \
86 else if (strcmp(ptr + strlen(string) + 1, "no") == 0) \
87 cfg_val[key] = 0; \
88 else \
89 goto errout; \
90 }
91
75 // parse line 92 // parse line
76 ptr = line_remove_spaces(buf); 93 ptr = line_remove_spaces(buf);
77 if (!ptr) 94 if (!ptr)
78 continue; 95 continue;
96 PARSE_YESNO(CFG_FILE_TRANSFER, "file-transfer")
97 PARSE_YESNO(CFG_DBUS, "dbus")
98 PARSE_YESNO(CFG_JOIN, "join")
99 PARSE_YESNO(CFG_X11, "x11")
100 PARSE_YESNO(CFG_APPARMOR, "apparmor")
101 PARSE_YESNO(CFG_BIND, "bind")
102 PARSE_YESNO(CFG_CGROUP, "cgroup")
103 PARSE_YESNO(CFG_NAME_CHANGE, "name-change")
104 PARSE_YESNO(CFG_USERNS, "userns")
105 PARSE_YESNO(CFG_CHROOT, "chroot")
106 PARSE_YESNO(CFG_FIREJAIL_PROMPT, "firejail-prompt")
107 PARSE_YESNO(CFG_FORCE_NONEWPRIVS, "force-nonewprivs")
108 PARSE_YESNO(CFG_SECCOMP, "seccomp")
109 PARSE_YESNO(CFG_NETWORK, "network")
110 PARSE_YESNO(CFG_RESTRICTED_NETWORK, "restricted-network")
111 PARSE_YESNO(CFG_XEPHYR_WINDOW_TITLE, "xephyr-window-title")
112 PARSE_YESNO(CFG_OVERLAYFS, "overlayfs")
113 PARSE_YESNO(CFG_PRIVATE_BIN, "private-bin")
114 PARSE_YESNO(CFG_PRIVATE_BIN_NO_LOCAL, "private-bin-no-local")
115 PARSE_YESNO(CFG_PRIVATE_CACHE, "private-cache")
116 PARSE_YESNO(CFG_PRIVATE_ETC, "private-etc")
117 PARSE_YESNO(CFG_PRIVATE_HOME, "private-home")
118 PARSE_YESNO(CFG_PRIVATE_LIB, "private-lib")
119 PARSE_YESNO(CFG_PRIVATE_OPT, "private-opt")
120 PARSE_YESNO(CFG_PRIVATE_SRV, "private-srv")
121 PARSE_YESNO(CFG_DISABLE_MNT, "disable-mnt")
122 PARSE_YESNO(CFG_XPRA_ATTACH, "xpra-attach")
123 PARSE_YESNO(CFG_BROWSER_DISABLE_U2F, "browser-disable-u2f")
124 PARSE_YESNO(CFG_BROWSER_ALLOW_DRM, "browser-allow-drm")
125#undef PARSE_YESNO
79 126
80 // file transfer
81 else if (strncmp(ptr, "file-transfer ", 14) == 0) {
82 if (strcmp(ptr + 14, "yes") == 0)
83 cfg_val[CFG_FILE_TRANSFER] = 1;
84 else if (strcmp(ptr + 14, "no") == 0)
85 cfg_val[CFG_FILE_TRANSFER] = 0;
86 else
87 goto errout;
88 }
89 // join
90 else if (strncmp(ptr, "join ", 5) == 0) {
91 if (strcmp(ptr + 5, "yes") == 0)
92 cfg_val[CFG_JOIN] = 1;
93 else if (strcmp(ptr + 5, "no") == 0)
94 cfg_val[CFG_JOIN] = 0;
95 else
96 goto errout;
97 }
98 // x11
99 else if (strncmp(ptr, "x11 ", 4) == 0) {
100 if (strcmp(ptr + 4, "yes") == 0)
101 cfg_val[CFG_X11] = 1;
102 else if (strcmp(ptr + 4, "no") == 0)
103 cfg_val[CFG_X11] = 0;
104 else
105 goto errout;
106 }
107 // bind
108 else if (strncmp(ptr, "bind ", 5) == 0) {
109 if (strcmp(ptr + 5, "yes") == 0)
110 cfg_val[CFG_BIND] = 1;
111 else if (strcmp(ptr + 5, "no") == 0)
112 cfg_val[CFG_BIND] = 0;
113 else
114 goto errout;
115 }
116 // user namespace
117 else if (strncmp(ptr, "userns ", 7) == 0) {
118 if (strcmp(ptr + 7, "yes") == 0)
119 cfg_val[CFG_USERNS] = 1;
120 else if (strcmp(ptr + 7, "no") == 0)
121 cfg_val[CFG_USERNS] = 0;
122 else
123 goto errout;
124 }
125 // chroot
126 else if (strncmp(ptr, "chroot ", 7) == 0) {
127 if (strcmp(ptr + 7, "yes") == 0)
128 cfg_val[CFG_CHROOT] = 1;
129 else if (strcmp(ptr + 7, "no") == 0)
130 cfg_val[CFG_CHROOT] = 0;
131 else
132 goto errout;
133 }
134 // prompt
135 else if (strncmp(ptr, "firejail-prompt ", 16) == 0) {
136 if (strcmp(ptr + 16, "yes") == 0)
137 cfg_val[CFG_FIREJAIL_PROMPT] = 1;
138 else if (strcmp(ptr + 16, "no") == 0)
139 cfg_val[CFG_FIREJAIL_PROMPT] = 0;
140 else
141 goto errout;
142 }
143 // follow symlink as user
144 else if (strncmp(ptr, "follow-symlink-as-user ", 23) == 0) {
145 if (strcmp(ptr + 23, "yes") == 0)
146 cfg_val[CFG_FOLLOW_SYMLINK_AS_USER] = 1;
147 else if (strcmp(ptr + 23, "no") == 0)
148 cfg_val[CFG_FOLLOW_SYMLINK_AS_USER] = 0;
149 else
150 goto errout;
151 }
152 // follow symlink in private-bin command
153 else if (strncmp(ptr, "follow-symlink-private-bin ", 27) == 0) {
154 if (strcmp(ptr + 27, "yes") == 0)
155 cfg_val[CFG_FOLLOW_SYMLINK_PRIVATE_BIN] = 1;
156 else if (strcmp(ptr + 27, "no") == 0)
157 cfg_val[CFG_FOLLOW_SYMLINK_PRIVATE_BIN] = 0;
158 else
159 goto errout;
160 }
161 // nonewprivs
162 else if (strncmp(ptr, "force-nonewprivs ", 17) == 0) {
163 if (strcmp(ptr + 17, "yes") == 0)
164 cfg_val[CFG_FORCE_NONEWPRIVS] = 1;
165 else if (strcmp(ptr + 17, "no") == 0)
166 cfg_val[CFG_FORCE_NONEWPRIVS] = 0;
167 else
168 goto errout;
169 }
170 // seccomp
171 else if (strncmp(ptr, "seccomp ", 8) == 0) {
172 if (strcmp(ptr + 8, "yes") == 0)
173 cfg_val[CFG_SECCOMP] = 1;
174 else if (strcmp(ptr + 8, "no") == 0)
175 cfg_val[CFG_SECCOMP] = 0;
176 else
177 goto errout;
178 }
179 // whitelist
180 else if (strncmp(ptr, "whitelist ", 10) == 0) {
181 if (strcmp(ptr + 10, "yes") == 0)
182 cfg_val[CFG_WHITELIST] = 1;
183 else if (strcmp(ptr + 10, "no") == 0)
184 cfg_val[CFG_WHITELIST] = 0;
185 else
186 goto errout;
187 }
188 // network
189 else if (strncmp(ptr, "network ", 8) == 0) {
190 if (strcmp(ptr + 8, "yes") == 0)
191 cfg_val[CFG_NETWORK] = 1;
192 else if (strcmp(ptr + 8, "no") == 0)
193 cfg_val[CFG_NETWORK] = 0;
194 else
195 goto errout;
196 }
197 // network
198 else if (strncmp(ptr, "restricted-network ", 19) == 0) {
199 if (strcmp(ptr + 19, "yes") == 0)
200 cfg_val[CFG_RESTRICTED_NETWORK] = 1;
201 else if (strcmp(ptr + 19, "no") == 0)
202 cfg_val[CFG_RESTRICTED_NETWORK] = 0;
203 else
204 goto errout;
205 }
206 // netfilter 127 // netfilter
207 else if (strncmp(ptr, "netfilter-default ", 18) == 0) { 128 else if (strncmp(ptr, "netfilter-default ", 18) == 0) {
208 char *fname = ptr + 18; 129 char *fname = ptr + 18;
@@ -213,8 +134,7 @@ int checkcfg(int val) {
213 *end = '\0'; 134 *end = '\0';
214 135
215 // is the file present? 136 // is the file present?
216 struct stat s; 137 if (access(fname, F_OK) == -1) {
217 if (stat(fname, &s) == -1) {
218 fprintf(stderr, "Error: netfilter-default file %s not available\n", fname); 138 fprintf(stderr, "Error: netfilter-default file %s not available\n", fname);
219 exit(1); 139 exit(1);
220 } 140 }
@@ -240,16 +160,6 @@ int checkcfg(int val) {
240 errExit("asprintf"); 160 errExit("asprintf");
241 } 161 }
242 162
243 // xephyr window title
244 else if (strncmp(ptr, "xephyr-window-title ", 20) == 0) {
245 if (strcmp(ptr + 20, "yes") == 0)
246 cfg_val[CFG_XEPHYR_WINDOW_TITLE] = 1;
247 else if (strcmp(ptr + 20, "no") == 0)
248 cfg_val[CFG_XEPHYR_WINDOW_TITLE] = 0;
249 else
250 goto errout;
251 }
252
253 // Xephyr command extra parameters 163 // Xephyr command extra parameters
254 else if (strncmp(ptr, "xephyr-extra-params ", 20) == 0) { 164 else if (strncmp(ptr, "xephyr-extra-params ", 20) == 0) {
255 if (*xephyr_extra_params != '\0') 165 if (*xephyr_extra_params != '\0')
@@ -269,7 +179,7 @@ int checkcfg(int val) {
269 } 179 }
270 180
271 // Xvfb screen size 181 // Xvfb screen size
272 else if (strncmp(ptr, "xvfb-screen ", 12) == 0) { 182 else if (strncmp(ptr, "xvfb-screen ", 12) == 0) {
273 // expecting three numbers separated by x's 183 // expecting three numbers separated by x's
274 unsigned int n1; 184 unsigned int n1;
275 unsigned int n2; 185 unsigned int n2;
@@ -299,63 +209,6 @@ int checkcfg(int val) {
299 else 209 else
300 goto errout; 210 goto errout;
301 } 211 }
302 // remount /proc and /sys
303 else if (strncmp(ptr, "remount-proc-sys ", 17) == 0) {
304 if (strcmp(ptr + 17, "yes") == 0)
305 cfg_val[CFG_REMOUNT_PROC_SYS] = 1;
306 else if (strcmp(ptr + 17, "no") == 0)
307 cfg_val[CFG_REMOUNT_PROC_SYS] = 0;
308 else
309 goto errout;
310 }
311 else if (strncmp(ptr, "overlayfs ", 10) == 0) {
312 if (strcmp(ptr + 10, "yes") == 0)
313 cfg_val[CFG_OVERLAYFS] = 1;
314 else if (strcmp(ptr + 10, "no") == 0)
315 cfg_val[CFG_OVERLAYFS] = 0;
316 else
317 goto errout;
318 }
319 else if (strncmp(ptr, "private-home ", 13) == 0) {
320 if (strcmp(ptr + 13, "yes") == 0)
321 cfg_val[CFG_PRIVATE_HOME] = 1;
322 else if (strcmp(ptr + 13, "no") == 0)
323 cfg_val[CFG_PRIVATE_HOME] = 0;
324 else
325 goto errout;
326 }
327 else if (strncmp(ptr, "private-lib ", 12) == 0) {
328 if (strcmp(ptr + 12, "yes") == 0)
329 cfg_val[CFG_PRIVATE_LIB] = 1;
330 else if (strcmp(ptr + 12, "no") == 0)
331 cfg_val[CFG_PRIVATE_LIB] = 0;
332 else
333 goto errout;
334 }
335 else if (strncmp(ptr, "chroot-desktop ", 15) == 0) {
336 if (strcmp(ptr + 15, "yes") == 0)
337 cfg_val[CFG_CHROOT_DESKTOP] = 1;
338 else if (strcmp(ptr + 15, "no") == 0)
339 cfg_val[CFG_CHROOT_DESKTOP] = 0;
340 else
341 goto errout;
342 }
343 else if (strncmp(ptr, "private-bin-no-local ", 21) == 0) {
344 if (strcmp(ptr + 21, "yes") == 0)
345 cfg_val[CFG_PRIVATE_BIN_NO_LOCAL] = 1;
346 else if (strcmp(ptr + 21, "no") == 0)
347 cfg_val[CFG_PRIVATE_BIN_NO_LOCAL] = 0;
348 else
349 goto errout;
350 }
351 else if (strncmp(ptr, "disable-mnt ", 12) == 0) {
352 if (strcmp(ptr + 12, "yes") == 0)
353 cfg_val[CFG_DISABLE_MNT] = 1;
354 else if (strcmp(ptr + 12, "no") == 0)
355 cfg_val[CFG_DISABLE_MNT] = 0;
356 else
357 goto errout;
358 }
359 // arp probes 212 // arp probes
360 else if (strncmp(ptr, "arp-probes ", 11) == 0) { 213 else if (strncmp(ptr, "arp-probes ", 11) == 0) {
361 int arp_probes = atoi(ptr + 11); 214 int arp_probes = atoi(ptr + 11);
@@ -363,18 +216,63 @@ int checkcfg(int val) {
363 goto errout; 216 goto errout;
364 cfg_val[CFG_ARP_PROBES] = arp_probes; 217 cfg_val[CFG_ARP_PROBES] = arp_probes;
365 } 218 }
366 // xpra-attach 219
367 else if (strncmp(ptr, "xpra-attach ", 12) == 0) { 220 // file copy limit
368 if (strcmp(ptr + 12, "yes") == 0) 221 else if (strncmp(ptr, "file-copy-limit ", 16) == 0)
369 cfg_val[CFG_XPRA_ATTACH] = 1; 222 env_store_name_val("FIREJAIL_FILE_COPY_LIMIT", ptr + 16, SETENV);
370 else if (strcmp(ptr + 12, "no") == 0) 223
371 cfg_val[CFG_XPRA_ATTACH] = 0; 224 // timeout for join option
372 else 225 else if (strncmp(ptr, "join-timeout ", 13) == 0)
373 goto errout; 226 join_timeout = strtoul(ptr + 13, NULL, 10) * 1000000; // seconds to microseconds
227
228 // add rules to default seccomp filter
229 else if (strncmp(ptr, "seccomp-filter-add ", 19) == 0)
230 config_seccomp_filter_add = seccomp_check_list(ptr + 19);
231
232 // seccomp error action
233 else if (strncmp(ptr, "seccomp-error-action ", 21) == 0) {
234 if (strcmp(ptr + 21, "kill") == 0)
235 cfg_val[CFG_SECCOMP_ERROR_ACTION] = SECCOMP_RET_KILL;
236 else if (strcmp(ptr + 21, "log") == 0)
237 cfg_val[CFG_SECCOMP_ERROR_ACTION] = SECCOMP_RET_LOG;
238 else {
239 cfg_val[CFG_SECCOMP_ERROR_ACTION] = errno_find_name(ptr + 21);
240 if (cfg_val[CFG_SECCOMP_ERROR_ACTION] == -1)
241 errExit("seccomp-error-action: unknown errno");
242 }
243 config_seccomp_error_action_str = strdup(ptr + 21);
244 if (!config_seccomp_error_action_str)
245 errExit("strdup");
246 }
247
248 else if (strncmp(ptr, "whitelist-disable-topdir ", 25) == 0) {
249 char *str = strdup(ptr + 25);
250 if (!str)
251 errExit("strdup");
252
253 size_t cnt = 0;
254 size_t sz = 4;
255 whitelist_reject_topdirs = malloc(sz * sizeof(char *));
256 if (!whitelist_reject_topdirs)
257 errExit("malloc");
258
259 char *tok = strtok(str, ",");
260 while (tok) {
261 whitelist_reject_topdirs[cnt++] = tok;
262 if (cnt >= sz) {
263 sz *= 2;
264 whitelist_reject_topdirs = realloc(whitelist_reject_topdirs, sz * sizeof(char *));
265 if (!whitelist_reject_topdirs)
266 errExit("realloc");
267 }
268 tok = strtok(NULL, ",");
269 }
270 whitelist_reject_topdirs[cnt] = NULL;
374 } 271 }
272
375 else 273 else
376 goto errout; 274 goto errout;
377 275
378 free(ptr); 276 free(ptr);
379 } 277 }
380 278
@@ -382,6 +280,13 @@ int checkcfg(int val) {
382 initialized = 1; 280 initialized = 1;
383 } 281 }
384 282
283
284 // merge CFG_RESTRICTED_NETWORK into CFG_NETWORK
285 if (val == CFG_NETWORK) {
286 if (cfg_val[CFG_RESTRICTED_NETWORK] && getuid() != 0)
287 return 0;
288 }
289
385 return cfg_val[val]; 290 return cfg_val[val];
386 291
387errout: 292errout:
@@ -396,24 +301,24 @@ errout:
396 301
397void print_compiletime_support(void) { 302void print_compiletime_support(void) {
398 printf("Compile time support:\n"); 303 printf("Compile time support:\n");
399 printf("\t- AppArmor support is %s\n", 304 printf("\t- always force nonewprivs support is %s\n",
400#ifdef HAVE_APPARMOR 305#ifdef HAVE_FORCE_NONEWPRIVS
401 "enabled" 306 "enabled"
402#else 307#else
403 "disabled" 308 "disabled"
404#endif 309#endif
405 ); 310 );
406 311
407 printf("\t- AppImage support is %s\n", 312 printf("\t- AppArmor support is %s\n",
408#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h 313#ifdef HAVE_APPARMOR
409 "enabled" 314 "enabled"
410#else 315#else
411 "disabled" 316 "disabled"
412#endif 317#endif
413 ); 318 );
414 319
415 printf("\t- bind support is %s\n", 320 printf("\t- AppImage support is %s\n",
416#ifdef HAVE_BIND 321#ifdef LOOP_CTL_GET_FREE // test for older kernels; this definition is found in /usr/include/linux/loop.h
417 "enabled" 322 "enabled"
418#else 323#else
419 "disabled" 324 "disabled"
@@ -428,8 +333,8 @@ void print_compiletime_support(void) {
428#endif 333#endif
429 ); 334 );
430 335
431 printf("\t- file and directory whitelisting support is %s\n", 336 printf("\t- D-BUS proxy support is %s\n",
432#ifdef HAVE_WHITELIST 337#ifdef HAVE_DBUSPROXY
433 "enabled" 338 "enabled"
434#else 339#else
435 "disabled" 340 "disabled"
@@ -444,8 +349,8 @@ void print_compiletime_support(void) {
444#endif 349#endif
445 ); 350 );
446 351
447 printf("\t- git install support is %s\n", 352 printf("\t- firetunnel support is %s\n",
448#ifdef HAVE_GIT_INSTALL 353#ifdef HAVE_FIRETUNNEL
449 "enabled" 354 "enabled"
450#else 355#else
451 "disabled" 356 "disabled"
@@ -460,10 +365,13 @@ void print_compiletime_support(void) {
460#endif 365#endif
461 ); 366 );
462 367
463#ifdef HAVE_NETWORK_RESTRICTED 368 printf("\t- output logging is %s\n",
464 printf("\t- networking features are available only to root user\n"); 369#ifdef HAVE_OUTPUT
370 "enabled"
371#else
372 "disabled"
465#endif 373#endif
466 374 );
467 printf("\t- overlayfs support is %s\n", 375 printf("\t- overlayfs support is %s\n",
468#ifdef HAVE_OVERLAYFS 376#ifdef HAVE_OVERLAYFS
469 "enabled" 377 "enabled"
@@ -480,8 +388,16 @@ void print_compiletime_support(void) {
480#endif 388#endif
481 ); 389 );
482 390
483 printf("\t- seccomp-bpf support is %s\n", 391 printf("\t- private-cache and tmpfs as user %s\n",
484#ifdef HAVE_SECCOMP 392#ifdef HAVE_USERTMPFS
393 "enabled"
394#else
395 "disabled"
396#endif
397 );
398
399 printf("\t- SELinux support is %s\n",
400#ifdef HAVE_SELINUX
485 "enabled" 401 "enabled"
486#else 402#else
487 "disabled" 403 "disabled"
@@ -504,4 +420,5 @@ void print_compiletime_support(void) {
504#endif 420#endif
505 ); 421 );
506 422
423
507} 424}
diff --git a/src/firejail/chroot.c b/src/firejail/chroot.c
new file mode 100644
index 000000000..37ec22117
--- /dev/null
+++ b/src/firejail/chroot.c
@@ -0,0 +1,310 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifdef HAVE_CHROOT
22#include "firejail.h"
23#include "../include/gcov_wrapper.h"
24#include <sys/mount.h>
25#include <sys/sendfile.h>
26#include <errno.h>
27
28#include <fcntl.h>
29#ifndef O_PATH
30#define O_PATH 010000000
31#endif
32
33// exit if error
34void fs_check_chroot_dir(void) {
35 EUID_ASSERT();
36 assert(cfg.chrootdir);
37 if (strstr(cfg.chrootdir, "..") ||
38 is_link(cfg.chrootdir))
39 goto errout;
40
41 // check chroot dirname exists, chrooting into the root directory is not allowed
42 char *rpath = realpath(cfg.chrootdir, NULL);
43 if (rpath == NULL || !is_dir(rpath) || strcmp(rpath, "/") == 0)
44 goto errout;
45
46 char *overlay;
47 if (asprintf(&overlay, "%s/.firejail", cfg.homedir) == -1)
48 errExit("asprintf");
49 if (strncmp(rpath, overlay, strlen(overlay)) == 0) {
50 fprintf(stderr, "Error: invalid chroot directory: no directories in %s are allowed\n", overlay);
51 exit(1);
52 }
53 free(overlay);
54
55 cfg.chrootdir = rpath;
56 return;
57
58errout:
59 fprintf(stderr, "Error: invalid chroot directory %s\n", cfg.chrootdir);
60 exit(1);
61}
62
63// copy /etc/resolv.conf or /etc/machine-id in chroot directory
64static void update_file(int parentfd, const char *relpath) {
65 assert(relpath && relpath[0] && relpath[0] != '/');
66
67 char *abspath;
68 if (asprintf(&abspath, "/%s", relpath) == -1)
69 errExit("asprintf");
70 int in = open(abspath, O_RDONLY|O_CLOEXEC);
71 free(abspath);
72 if (in == -1)
73 goto errout;
74
75 struct stat src;
76 if (fstat(in, &src) == -1)
77 errExit("fstat");
78 // try to detect if file has been bind mounted into the chroot
79 struct stat dst;
80 if (fstatat(parentfd, relpath, &dst, 0) == 0) {
81 if (src.st_dev == dst.st_dev && src.st_ino == dst.st_ino) {
82 close(in);
83 return;
84 }
85 }
86 if (arg_debug)
87 printf("Updating chroot /%s\n", relpath);
88 unlinkat(parentfd, relpath, 0);
89 int out = openat(parentfd, relpath, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
90 if (out == -1) {
91 close(in);
92 goto errout;
93 }
94 if (sendfile(out, in, NULL, src.st_size) == -1)
95 errExit("sendfile");
96 close(in);
97 close(out);
98 return;
99
100errout:
101 fwarning("chroot /%s not initialized\n", relpath);
102}
103
104// exit if error
105static void check_subdir(int parentfd, const char *subdir, int check_writable) {
106 assert(subdir && subdir[0] && subdir[0] != '/');
107 struct stat s;
108 if (fstatat(parentfd, subdir, &s, AT_SYMLINK_NOFOLLOW) != 0) {
109 fprintf(stderr, "Error: cannot find /%s in chroot directory\n", subdir);
110 exit(1);
111 }
112 if (!S_ISDIR(s.st_mode)) {
113 if (S_ISLNK(s.st_mode))
114 fprintf(stderr, "Error: chroot /%s is a symbolic link\n", subdir);
115 else
116 fprintf(stderr, "Error: chroot /%s is not a directory\n", subdir);
117 exit(1);
118 }
119 if (s.st_uid != 0) {
120 fprintf(stderr, "Error: chroot /%s should be owned by root\n", subdir);
121 exit(1);
122 }
123 if (check_writable && ((S_IWGRP|S_IWOTH) & s.st_mode) != 0) {
124 fprintf(stderr, "Error: only root user should be given write permission on chroot /%s\n", subdir);
125 exit(1);
126 }
127}
128
129// chroot into an existing directory; mount existing /dev and update /etc/resolv.conf
130void fs_chroot(const char *rootdir) {
131 assert(rootdir);
132
133 // fails if there is any symlink or if rootdir is not a directory
134 int parentfd = safer_openat(-1, rootdir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
135 if (parentfd == -1)
136 errExit("safer_openat");
137 // rootdir has to be owned by root and is not allowed to be generally writable,
138 // this also excludes /tmp and friends
139 struct stat s;
140 if (fstat(parentfd, &s) == -1)
141 errExit("fstat");
142 if (s.st_uid != 0) {
143 fprintf(stderr, "Error: chroot directory should be owned by root\n");
144 exit(1);
145 }
146 if (((S_IWGRP|S_IWOTH) & s.st_mode) != 0) {
147 fprintf(stderr, "Error: only root user should be given write permission on chroot directory\n");
148 exit(1);
149 }
150 // check chroot subdirectories; /tmp/.X11-unix and /run are treated separately
151 check_subdir(parentfd, "dev", 0);
152 check_subdir(parentfd, "etc", 1);
153 check_subdir(parentfd, "proc", 0);
154 check_subdir(parentfd, "tmp", 0);
155 check_subdir(parentfd, "var", 1);
156 check_subdir(parentfd, "var/tmp", 0);
157
158 // mount-bind a /dev in rootdir
159 if (arg_debug)
160 printf("Mounting /dev on chroot /dev\n");
161 // open chroot /dev to get a file descriptor,
162 // then use this descriptor as a mount target
163 int fd = openat(parentfd, "dev", O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
164 if (fd == -1)
165 errExit("open");
166 if (bind_mount_path_to_fd("/dev", fd))
167 errExit("mounting /dev");
168 close(fd);
169
170#ifdef HAVE_X11
171 // if users want this mount, they should set FIREJAIL_CHROOT_X11
172 if (env_get("FIREJAIL_X11") || env_get("FIREJAIL_CHROOT_X11")) {
173 if (arg_debug)
174 printf("Mounting /tmp/.X11-unix on chroot /tmp/.X11-unix\n");
175 struct stat s1, s2;
176 if (stat("/tmp", &s1) || lstat("/tmp/.X11-unix", &s2))
177 errExit("mounting /tmp/.X11-unix");
178 if ((s1.st_mode & S_ISVTX) != S_ISVTX) {
179 fprintf(stderr, "Error: sticky bit not set on /tmp directory\n");
180 exit(1);
181 }
182 if (s2.st_uid != 0) {
183 fprintf(stderr, "Error: /tmp/.X11-unix not owned by root user\n");
184 exit(1);
185 }
186
187 check_subdir(parentfd, "tmp/.X11-unix", 0);
188 fd = openat(parentfd, "tmp/.X11-unix", O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
189 if (fd == -1)
190 errExit("open");
191 if (bind_mount_path_to_fd("/tmp/.X11-unix", fd))
192 errExit("mounting /tmp/.X11-unix");
193 close(fd);
194 }
195#endif // HAVE_X11
196
197 // some older distros don't have a /run directory, create one by default
198 if (mkdirat(parentfd, "run", 0755) == -1 && errno != EEXIST)
199 errExit("mkdir");
200 check_subdir(parentfd, "run", 1);
201
202 // pulseaudio; only support for default directory /run/user/$UID/pulse
203 if (env_get("FIREJAIL_CHROOT_PULSE")) {
204 char *pulse;
205 if (asprintf(&pulse, "%s/run/user/%d/pulse", cfg.chrootdir, getuid()) == -1)
206 errExit("asprintf");
207 char *orig_pulse = pulse + strlen(cfg.chrootdir);
208
209 if (arg_debug)
210 printf("Mounting %s on chroot %s\n", orig_pulse, orig_pulse);
211 int src = safer_openat(-1, orig_pulse, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
212 if (src == -1) {
213 fprintf(stderr, "Error: cannot open %s\n", orig_pulse);
214 exit(1);
215 }
216 int dst = safer_openat(-1, pulse, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
217 if (dst == -1) {
218 fprintf(stderr, "Error: cannot open %s\n", pulse);
219 exit(1);
220 }
221 if (bind_mount_by_fd(src, dst))
222 errExit("mounting pulseaudio");
223 close(src);
224 close(dst);
225 free(pulse);
226
227 // update /etc/machine-id in chroot
228 update_file(parentfd, "etc/machine-id");
229 }
230
231 // create /run/firejail directory in chroot
232 if (mkdirat(parentfd, &RUN_FIREJAIL_DIR[1], 0755) == -1 && errno != EEXIST)
233 errExit("mkdir");
234 check_subdir(parentfd, &RUN_FIREJAIL_DIR[1], 1);
235
236 // create /run/firejail/lib directory in chroot
237 if (mkdirat(parentfd, &RUN_FIREJAIL_LIB_DIR[1], 0755) == -1 && errno != EEXIST)
238 errExit("mkdir");
239 check_subdir(parentfd, &RUN_FIREJAIL_LIB_DIR[1], 1);
240 // mount lib directory into the chroot
241 fd = openat(parentfd, &RUN_FIREJAIL_LIB_DIR[1], O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
242 if (fd == -1)
243 errExit("open");
244 if (bind_mount_path_to_fd(RUN_FIREJAIL_LIB_DIR, fd))
245 errExit("mount bind");
246 close(fd);
247
248 // create /run/firejail/mnt directory in chroot
249 if (mkdirat(parentfd, &RUN_MNT_DIR[1], 0755) == -1 && errno != EEXIST)
250 errExit("mkdir");
251 check_subdir(parentfd, &RUN_MNT_DIR[1], 1);
252 // mount the current mnt directory into the chroot
253 fd = openat(parentfd, &RUN_MNT_DIR[1], O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
254 if (fd == -1)
255 errExit("open");
256 if (bind_mount_path_to_fd(RUN_MNT_DIR, fd))
257 errExit("mount bind");
258 close(fd);
259
260 // update chroot resolv.conf
261 update_file(parentfd, "etc/resolv.conf");
262
263 __gcov_flush();
264
265 // create /run/firejail/mnt/oroot
266 char *oroot = RUN_OVERLAY_ROOT;
267 if (mkdir(oroot, 0755) == -1)
268 errExit("mkdir");
269 // mount the chroot dir on top of /run/firejail/mnt/oroot in order to reuse the apparmor rules for overlay
270 if (bind_mount_fd_to_path(parentfd, oroot))
271 errExit("mounting rootdir oroot");
272 close(parentfd);
273 // chroot into the new directory
274 if (arg_debug)
275 printf("Chrooting into %s\n", rootdir);
276 if (chroot(oroot) < 0)
277 errExit("chroot");
278
279 // mount a new proc filesystem
280 if (arg_debug)
281 printf("Mounting /proc filesystem representing the PID namespace\n");
282 if (mount("proc", "/proc", "proc", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0)
283 errExit("mounting /proc");
284
285 // create all other /run/firejail files and directories
286 preproc_build_firejail_dir();
287
288 // update /var directory in order to support multiple sandboxes running on the same root directory
289 // if (!arg_private_dev)
290 // fs_dev_shm();
291 fs_var_lock();
292 if (!arg_keep_var_tmp)
293 fs_var_tmp();
294 if (!arg_writable_var_log)
295 fs_var_log();
296
297 fs_var_lib();
298 fs_var_cache();
299 fs_var_utmp();
300 fs_machineid();
301
302 // don't leak user information
303 restrict_users();
304
305 // when starting as root, firejail config is not disabled;
306 if (getuid() != 0)
307 disable_config();
308}
309
310#endif // HAVE_CHROOT
diff --git a/src/firejail/cmdline.c b/src/firejail/cmdline.c
index 114173b6a..2fa68a55d 100644
--- a/src/firejail/cmdline.c
+++ b/src/firejail/cmdline.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -26,7 +26,7 @@
26#include <assert.h> 26#include <assert.h>
27#include <errno.h> 27#include <errno.h>
28 28
29static int cmdline_length(int argc, char **argv, int index) { 29static int cmdline_length(int argc, char **argv, int index, bool want_extra_quotes) {
30 assert(index != -1); 30 assert(index != -1);
31 31
32 unsigned i,j; 32 unsigned i,j;
@@ -46,10 +46,11 @@ static int cmdline_length(int argc, char **argv, int index) {
46 len += 3; 46 len += 3;
47 in_quotes = false; 47 in_quotes = false;
48 } else { 48 } else {
49 if (!in_quotes) 49 if (!in_quotes && want_extra_quotes)
50 len++; 50 len++;
51 len++; 51 len++;
52 in_quotes = true; 52 if (want_extra_quotes)
53 in_quotes = true;
53 } 54 }
54 } 55 }
55 if (in_quotes) { 56 if (in_quotes) {
@@ -64,7 +65,7 @@ static int cmdline_length(int argc, char **argv, int index) {
64 return len; 65 return len;
65} 66}
66 67
67static void quote_cmdline(char *command_line, char *window_title, int len, int argc, char **argv, int index) { 68static void quote_cmdline(char *command_line, char *window_title, int len, int argc, char **argv, int index, bool want_extra_quotes) {
68 assert(index != -1); 69 assert(index != -1);
69 70
70 unsigned i,j; 71 unsigned i,j;
@@ -77,7 +78,7 @@ static void quote_cmdline(char *command_line, char *window_title, int len, int a
77 78
78 // enclose args by single quotes, 79 // enclose args by single quotes,
79 // and since single quote can't be represented in single quoted text 80 // and since single quote can't be represented in single quoted text
80 // each occurence of it should be enclosed by double quotes 81 // each occurrence of it should be enclosed by double quotes
81 in_quotes = false; 82 in_quotes = false;
82 for (j = 0; j < strlen(argv[i + index]); j++) { 83 for (j = 0; j < strlen(argv[i + index]); j++) {
83 // single quote 84 // single quote
@@ -103,14 +104,15 @@ static void quote_cmdline(char *command_line, char *window_title, int len, int a
103 // anything other 104 // anything other
104 else 105 else
105 { 106 {
106 if (!in_quotes) { 107 if (!in_quotes && want_extra_quotes) {
107 // open quotes 108 // open quotes
108 ptr1[0] = '\''; 109 ptr1[0] = '\'';
109 ptr1++; 110 ptr1++;
110 } 111 }
111 ptr1[0] = argv[i + index][j]; 112 ptr1[0] = argv[i + index][j];
112 ptr1++; 113 ptr1++;
113 in_quotes = true; 114 if (want_extra_quotes)
115 in_quotes = true;
114 } 116 }
115 } 117 }
116 // close quotes 118 // close quotes
@@ -134,12 +136,12 @@ static void quote_cmdline(char *command_line, char *window_title, int len, int a
134 assert((unsigned) len == strlen(command_line)); 136 assert((unsigned) len == strlen(command_line));
135} 137}
136 138
137void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index) { 139void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index, bool want_extra_quotes) {
138 // index == -1 could happen if we have --shell=none and no program was specified 140 // index == -1 could happen if we have --shell=none and no program was specified
139 // the program should exit with an error before entering this function 141 // the program should exit with an error before entering this function
140 assert(index != -1); 142 assert(index != -1);
141 143
142 int len = cmdline_length(argc, argv, index); 144 int len = cmdline_length(argc, argv, index, want_extra_quotes);
143 if (len > ARG_MAX) { 145 if (len > ARG_MAX) {
144 errno = E2BIG; 146 errno = E2BIG;
145 errExit("cmdline_length"); 147 errExit("cmdline_length");
@@ -152,7 +154,7 @@ void build_cmdline(char **command_line, char **window_title, int argc, char **ar
152 if (!*window_title) 154 if (!*window_title)
153 errExit("malloc"); 155 errExit("malloc");
154 156
155 quote_cmdline(*command_line, *window_title, len, argc, argv, index); 157 quote_cmdline(*command_line, *window_title, len, argc, argv, index, want_extra_quotes);
156 158
157 if (arg_debug) 159 if (arg_debug)
158 printf("Building quoted command line: %s\n", *command_line); 160 printf("Building quoted command line: %s\n", *command_line);
@@ -161,30 +163,23 @@ void build_cmdline(char **command_line, char **window_title, int argc, char **ar
161 assert(*window_title); 163 assert(*window_title);
162} 164}
163 165
164void build_appimage_cmdline(char **command_line, char **window_title, int argc, char **argv, int index, char *apprun_path) { 166void build_appimage_cmdline(char **command_line, char **window_title, int argc, char **argv, int index, bool want_extra_quotes) {
165 // index == -1 could happen if we have --shell=none and no program was specified 167 // index == -1 could happen if we have --shell=none and no program was specified
166 // the program should exit with an error before entering this function 168 // the program should exit with an error before entering this function
167 assert(index != -1); 169 assert(index != -1);
168 170
169 if (arg_debug) 171 char *apprun_path = RUN_FIREJAIL_APPIMAGE_DIR "/AppRun";
170 printf("Building AppImage command line: %s\n", *command_line);
171
172 172
173 int len1 = cmdline_length(argc, argv, index); // length of argv w/o changes 173 int len1 = cmdline_length(argc, argv, index, want_extra_quotes); // length of argv w/o changes
174 int len2 = cmdline_length(1, &argv[index], 0); // apptest.AppImage 174 int len2 = cmdline_length(1, &argv[index], 0, want_extra_quotes); // apptest.AppImage
175 int len3 = cmdline_length(1, &apprun_path, 0); // /run/firejail/appimage/.appimage-23304/AppRun 175 int len3 = cmdline_length(1, &apprun_path, 0, want_extra_quotes); // /run/firejail/appimage/AppRun
176 int len4 = (len1 - len2 + len3) + 1; // apptest.AppImage is replaced by /path/to/AppRun 176 int len4 = (len1 - len2 + len3) + 1; // apptest.AppImage is replaced by /path/to/AppRun
177 177
178 if (len4 > ARG_MAX) { 178 if (len4 > ARG_MAX) {
179 errno = E2BIG; 179 errno = E2BIG;
180 errExit("cmdline_length"); 180 errExit("cmdline_length");
181 } 181 }
182 182
183 // save created apprun in cfg.command_line
184 char *tmp1 = strdup(*command_line);
185 if (!tmp1)
186 errExit("strdup");
187
188 // TODO: deal with extra allocated memory. 183 // TODO: deal with extra allocated memory.
189 char *command_line_tmp = malloc(len1 + len3 + 1); 184 char *command_line_tmp = malloc(len1 + len3 + 1);
190 if (!command_line_tmp) 185 if (!command_line_tmp)
@@ -194,18 +189,18 @@ void build_appimage_cmdline(char **command_line, char **window_title, int argc,
194 errExit("malloc"); 189 errExit("malloc");
195 190
196 // run default quote_cmdline 191 // run default quote_cmdline
197 quote_cmdline(command_line_tmp, *window_title, len1, argc, argv, index); 192 quote_cmdline(command_line_tmp, *window_title, len1, argc, argv, index, want_extra_quotes);
198 193
199 assert(command_line_tmp); 194 assert(command_line_tmp);
200 assert(*window_title); 195 assert(*window_title);
201 196
202 // 'fix' command_line now 197 // 'fix' command_line now
203 if (asprintf(command_line, "'%s' %s", tmp1, command_line_tmp + len2) == -1) 198 if (asprintf(command_line, "'%s' %s", apprun_path, command_line_tmp + len2) == -1)
204 errExit("asprintf"); 199 errExit("asprintf");
205 200
206 if (arg_debug) 201 if (arg_debug)
207 printf("AppImage quoted command line: %s\n", *command_line); 202 printf("AppImage quoted command line: %s\n", *command_line);
208 203
209 // free strdup 204 // free strdup
210 free(tmp1); 205 free(command_line_tmp);
211} 206}
diff --git a/src/firejail/cpu.c b/src/firejail/cpu.c
index 6b3fc063d..fe7258fb0 100644
--- a/src/firejail/cpu.c
+++ b/src/firejail/cpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -75,7 +75,7 @@ void save_cpu(void) {
75 if (cfg.cpus == 0) 75 if (cfg.cpus == 0)
76 return; 76 return;
77 77
78 FILE *fp = fopen(RUN_CPU_CFG, "w"); 78 FILE *fp = fopen(RUN_CPU_CFG, "wxe");
79 if (fp) { 79 if (fp) {
80 fprintf(fp, "%x\n", cfg.cpus); 80 fprintf(fp, "%x\n", cfg.cpus);
81 SET_PERMS_STREAM(fp, 0, 0, 0600); 81 SET_PERMS_STREAM(fp, 0, 0, 0600);
@@ -91,7 +91,7 @@ void load_cpu(const char *fname) {
91 if (!fname) 91 if (!fname)
92 return; 92 return;
93 93
94 FILE *fp = fopen(fname, "r"); 94 FILE *fp = fopen(fname, "re");
95 if (fp) { 95 if (fp) {
96 unsigned tmp; 96 unsigned tmp;
97 int rv = fscanf(fp, "%x", &tmp); 97 int rv = fscanf(fp, "%x", &tmp);
@@ -139,7 +139,7 @@ static void print_cpu(int pid) {
139 } 139 }
140 140
141 EUID_ROOT(); // grsecurity 141 EUID_ROOT(); // grsecurity
142 FILE *fp = fopen(file, "r"); 142 FILE *fp = fopen(file, "re");
143 EUID_USER(); // grsecurity 143 EUID_USER(); // grsecurity
144 if (!fp) { 144 if (!fp) {
145 printf(" Error: cannot open %s\n", file); 145 printf(" Error: cannot open %s\n", file);
@@ -162,31 +162,17 @@ static void print_cpu(int pid) {
162 free(file); 162 free(file);
163} 163}
164 164
165// allow any user to run --cpu.print
165void cpu_print_filter(pid_t pid) { 166void cpu_print_filter(pid_t pid) {
166 EUID_ASSERT(); 167 EUID_ASSERT();
167 168
168 // if the pid is that of a firejail process, use the pid of the first child process 169 // in case the pid is that of a firejail process, use the pid of the first child process
169 EUID_ROOT(); // grsecurity 170 pid = switch_to_child(pid);
170 char *comm = pid_proc_comm(pid);
171 EUID_USER(); // grsecurity
172 if (comm) {
173 if (strcmp(comm, "firejail") == 0) {
174 pid_t child;
175 if (find_child(pid, &child) == 0) {
176 pid = child;
177 }
178 }
179 free(comm);
180 }
181 171
182 // check privileges for non-root users 172 // now check if the pid belongs to a firejail sandbox
183 uid_t uid = getuid(); 173 if (is_ready_for_join(pid) == false) {
184 if (uid != 0) { 174 fprintf(stderr, "Error: no valid sandbox\n");
185 uid_t sandbox_uid = pid_get_uid(pid); 175 exit(1);
186 if (uid != sandbox_uid) {
187 fprintf(stderr, "Error: permission denied.\n");
188 exit(1);
189 }
190 } 176 }
191 177
192 print_cpu(pid); 178 print_cpu(pid);
diff --git a/src/firejail/dbus.c b/src/firejail/dbus.c
new file mode 100644
index 000000000..735ff54fa
--- /dev/null
+++ b/src/firejail/dbus.c
@@ -0,0 +1,548 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#ifdef HAVE_DBUSPROXY
21#include "firejail.h"
22#include <sys/mount.h>
23#include <sys/stat.h>
24#include <sys/types.h>
25#include <sys/wait.h>
26#include <errno.h>
27#include <unistd.h>
28#include <fcntl.h>
29#include <string.h>
30
31#ifndef O_PATH
32#define O_PATH 010000000
33#endif
34
35#define DBUS_SOCKET_PATH_PREFIX "unix:path="
36#define DBUS_USER_SOCKET_FORMAT "/run/user/%d/bus"
37#define DBUS_USER_SOCKET_FORMAT2 "/run/user/%d/dbus/user_bus_socket"
38#define DBUS_SYSTEM_SOCKET "/run/dbus/system_bus_socket"
39#define DBUS_SESSION_BUS_ADDRESS_ENV "DBUS_SESSION_BUS_ADDRESS"
40#define DBUS_SYSTEM_BUS_ADDRESS_ENV "DBUS_SYSTEM_BUS_ADDRESS"
41#define DBUS_USER_DIR_FORMAT RUN_FIREJAIL_DBUS_DIR "/%d"
42#define DBUS_USER_PROXY_SOCKET_FORMAT DBUS_USER_DIR_FORMAT "/%d-user"
43#define DBUS_SYSTEM_PROXY_SOCKET_FORMAT DBUS_USER_DIR_FORMAT "/%d-system"
44#define DBUS_MAX_NAME_LENGTH 255
45// moved to include/common.h - #define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy"
46
47static pid_t dbus_proxy_pid = 0;
48static int dbus_proxy_status_fd = -1;
49static char *dbus_user_proxy_socket = NULL;
50static char *dbus_system_proxy_socket = NULL;
51
52static int check_bus_or_interface_name(const char *name, int hyphens_allowed) {
53 unsigned long length = strlen(name);
54 if (length == 0 || length > DBUS_MAX_NAME_LENGTH)
55 return 0;
56 const char *p = name;
57 int segments = 1;
58 int in_segment = 0;
59 while (*p) {
60 int alpha = (*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z');
61 int digit = *p >= '0' && *p <= '9';
62 if (in_segment) {
63 if (*p == '.') {
64 ++segments;
65 in_segment = 0;
66 } else if (!alpha && !digit && *p != '_' && (!hyphens_allowed || *p != '-')) {
67 return 0;
68 }
69 }
70 else {
71 if (*p == '*') {
72 return *(p + 1) == '\0';
73 } else if (!alpha && *p != '_' && (!hyphens_allowed || *p != '-')) {
74 return 0;
75 }
76 in_segment = 1;
77 }
78 ++p;
79 }
80 return in_segment && segments >= 2;
81}
82
83static int check_object_path(const char *path) {
84 unsigned long length = strlen(path);
85 if (length == 0 || path[0] != '/')
86 return 0;
87 // The root path "/" is the only path allowed to have a trailing slash.
88 if (length == 1)
89 return 1;
90 const char *p = path + 1;
91 int segments = 1;
92 int in_segment = 0;
93 while (*p) {
94 int alpha = (*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z');
95 int digit = *p >= '0' && *p <= '9';
96 if (in_segment) {
97 if (*p == '/') {
98 ++segments;
99 in_segment = 0;
100 } else if (!alpha && !digit && *p != '_') {
101 return 0;
102 }
103 }
104 else {
105 if (*p == '*') {
106 return *(p + 1) == '\0';
107 } else if (!alpha && *p != '_') {
108 return 0;
109 }
110 in_segment = 1;
111 }
112 ++p;
113 }
114 return in_segment && segments >= 1;
115}
116
117int dbus_check_name(const char *name) {
118 return check_bus_or_interface_name(name, 1);
119}
120
121int dbus_check_call_rule(const char *rule) {
122 char buf[DBUS_MAX_NAME_LENGTH + 1];
123 char *name_end = strchr(rule, '=');
124 if (name_end == NULL)
125 return 0;
126 size_t name_length = (size_t) (name_end - rule);
127 if (name_length > DBUS_MAX_NAME_LENGTH)
128 return 0;
129 strncpy(buf, rule, (size_t) name_length);
130 buf[name_length] = '\0';
131 if (!dbus_check_name(buf))
132 return 0;
133 ++name_end;
134 char *interface_end = strchr(name_end, '@');
135 if (interface_end == NULL)
136 return check_bus_or_interface_name(name_end, 0);
137 size_t interface_length = (size_t) (interface_end - name_end);
138 if (interface_length > DBUS_MAX_NAME_LENGTH)
139 return 0;
140 if (interface_length > 0) {
141 strncpy(buf, name_end, interface_length);
142 buf[interface_length] = '\0';
143 if (!check_bus_or_interface_name(buf, 0))
144 return 0;
145 }
146 return check_object_path(interface_end + 1);
147}
148
149static void dbus_check_bus_profile(char const *prefix, DbusPolicy *policy) {
150 if (*policy == DBUS_POLICY_FILTER) {
151 struct stat s;
152 if (stat(XDG_DBUS_PROXY_PATH, &s) == -1) {
153 if (errno == ENOENT) {
154 fprintf(stderr,
155 "Warning: " XDG_DBUS_PROXY_PATH
156 " was not found, downgrading %s policy to allow.\n"
157 "To enable DBus filtering, install the xdg-dbus-proxy "
158 "program.\n", prefix);
159 *policy = DBUS_POLICY_ALLOW;
160 } else {
161 errExit("stat");
162 }
163 } else {
164 // No need to warn on profile entries.
165 return;
166 }
167 }
168
169 size_t prefix_length = strlen(prefix);
170 ProfileEntry *it = cfg.profile;
171 int num_matches = 0;
172 const char *first_match = NULL;
173 while (it) {
174 char *data = it->data;
175 it = it->next;
176 if (strncmp(prefix, data, prefix_length) == 0) {
177 ++num_matches;
178 if (first_match == NULL)
179 first_match = data;
180 }
181 }
182
183 if (num_matches > 0 && !arg_quiet) {
184 assert(first_match != NULL);
185 if (num_matches == 1) {
186 fprintf(stderr, "Ignoring \"%s\".\n", first_match);
187 } else if (num_matches == 2) {
188 fprintf(stderr, "Ignoring \"%s\" and 1 other %s filter rule.\n",
189 first_match, prefix);
190 } else {
191 fprintf(stderr, "Ignoring \"%s\" and %d other %s filter rules.\n",
192 first_match, num_matches - 1, prefix);
193 }
194 }
195}
196
197void dbus_check_profile(void) {
198 dbus_check_bus_profile("dbus-user", &arg_dbus_user);
199 dbus_check_bus_profile("dbus-system", &arg_dbus_system);
200}
201
202static void write_arg(int fd, char const *format, ...) {
203 va_list ap;
204 va_start(ap, format);
205 char *arg;
206 int length = vasprintf(&arg, format, ap);
207 va_end(ap);
208 if (length == -1)
209 errExit("vasprintf");
210 length++;
211 if (arg_debug)
212 printf("xdg-dbus-proxy arg: %s\n", arg);
213 if (write(fd, arg, (size_t) length) != (ssize_t) length)
214 errExit("write");
215 free(arg);
216}
217
218static void write_profile(int fd, char const *prefix) {
219 size_t prefix_length = strlen(prefix);
220 ProfileEntry *it = cfg.profile;
221 while (it) {
222 char *data = it->data;
223 it = it->next;
224 if (strncmp(prefix, data, prefix_length) != 0)
225 continue;
226 data += prefix_length;
227 int arg_length = 0;
228 while (data[arg_length] != '\0' && data[arg_length] != ' ')
229 arg_length++;
230 if (data[arg_length] != ' ')
231 continue;
232 write_arg(fd, "--%.*s=%s", arg_length, data, &data[arg_length + 1]);
233 }
234}
235
236static void dbus_create_user_dir(void) {
237 char *path;
238 if (asprintf(&path, DBUS_USER_DIR_FORMAT, (int) getuid()) == -1)
239 errExit("asprintf");
240 struct stat s;
241 mode_t mode = 0700;
242 uid_t uid = getuid();
243 gid_t gid = getgid();
244 if (stat(path, &s)) {
245 if (arg_debug)
246 printf("Creating %s directory for DBus proxy sockets\n", path);
247 if (mkdir(path, mode) == -1 && errno != EEXIST)
248 errExit("mkdir");
249 if (set_perms(path, uid, gid, mode))
250 errExit("set_perms");
251 ASSERT_PERMS(path, uid, gid, mode);
252 }
253 free(path);
254}
255
256static char *find_user_socket_by_format(char *format) {
257 char *dbus_user_socket;
258 if (asprintf(&dbus_user_socket, format, (int) getuid()) == -1)
259 errExit("asprintf");
260 struct stat s;
261 if (lstat(dbus_user_socket, &s) == -1)
262 goto fail;
263 if (!S_ISSOCK(s.st_mode))
264 goto fail;
265 return dbus_user_socket;
266 fail:
267 free(dbus_user_socket);
268 return NULL;
269}
270
271static char *find_user_socket(void) {
272 char *socket1 = find_user_socket_by_format(DBUS_USER_SOCKET_FORMAT);
273 if (socket1 != NULL)
274 return socket1;
275 char *socket2 = find_user_socket_by_format(DBUS_USER_SOCKET_FORMAT2);
276 if (socket2 != NULL)
277 return socket2;
278 fprintf(stderr, "DBus user socket was not found.\n");
279 exit(1);
280}
281
282void dbus_proxy_start(void) {
283 dbus_create_user_dir();
284
285 EUID_USER();
286
287 int status_pipe[2];
288 if (pipe(status_pipe) == -1)
289 errExit("pipe");
290 dbus_proxy_status_fd = status_pipe[0];
291
292 int args_pipe[2];
293 if (pipe(args_pipe) == -1)
294 errExit("pipe");
295
296 dbus_proxy_pid = fork();
297 if (dbus_proxy_pid == -1)
298 errExit("fork");
299 if (dbus_proxy_pid == 0) {
300 int i;
301 for (i = STDERR_FILENO + 1; i < FIREJAIL_MAX_FD; i++) {
302 if (i != status_pipe[1] && i != args_pipe[0])
303 close(i); // close open files
304 }
305 if (arg_dbus_log_file != NULL) {
306 int output_fd = creat(arg_dbus_log_file, 0666);
307 if (output_fd < 0)
308 errExit("creat");
309 if (output_fd != STDOUT_FILENO) {
310 if (dup2(output_fd, STDOUT_FILENO) != STDOUT_FILENO)
311 errExit("dup2");
312 close(output_fd);
313 }
314 }
315 close(STDIN_FILENO);
316 char *args[4] = {XDG_DBUS_PROXY_PATH, NULL, NULL, NULL};
317 if (asprintf(&args[1], "--fd=%d", status_pipe[1]) == -1
318 || asprintf(&args[2], "--args=%d", args_pipe[0]) == -1)
319 errExit("asprintf");
320 if (arg_debug)
321 printf("starting xdg-dbus-proxy\n");
322 sbox_exec_v(SBOX_USER | SBOX_SECCOMP | SBOX_CAPS_NONE | SBOX_KEEP_FDS, args);
323 } else {
324 if (close(status_pipe[1]) == -1 || close(args_pipe[0]) == -1)
325 errExit("close");
326
327 if (arg_dbus_user == DBUS_POLICY_FILTER) {
328 const char *user_env = env_get(DBUS_SESSION_BUS_ADDRESS_ENV);
329 if (user_env == NULL) {
330 char *dbus_user_socket = find_user_socket();
331 write_arg(args_pipe[1], DBUS_SOCKET_PATH_PREFIX "%s",
332 dbus_user_socket);
333 free(dbus_user_socket);
334 } else {
335 write_arg(args_pipe[1], "%s", user_env);
336 }
337 if (asprintf(&dbus_user_proxy_socket, DBUS_USER_PROXY_SOCKET_FORMAT,
338 (int) getuid(), (int) getpid()) == -1)
339 errExit("asprintf");
340 write_arg(args_pipe[1], "%s", dbus_user_proxy_socket);
341 if (arg_dbus_log_user) {
342 write_arg(args_pipe[1], "--log");
343 }
344 write_arg(args_pipe[1], "--filter");
345 write_profile(args_pipe[1], "dbus-user.");
346 }
347
348 if (arg_dbus_system == DBUS_POLICY_FILTER) {
349 const char *system_env = env_get(DBUS_SYSTEM_BUS_ADDRESS_ENV);
350 if (system_env == NULL) {
351 write_arg(args_pipe[1],
352 DBUS_SOCKET_PATH_PREFIX DBUS_SYSTEM_SOCKET);
353 } else {
354 write_arg(args_pipe[1], "%s", system_env);
355 }
356 if (asprintf(&dbus_system_proxy_socket, DBUS_SYSTEM_PROXY_SOCKET_FORMAT,
357 (int) getuid(), (int) getpid()) == -1)
358 errExit("asprintf");
359 write_arg(args_pipe[1], "%s", dbus_system_proxy_socket);
360 if (arg_dbus_log_system) {
361 write_arg(args_pipe[1], "--log");
362 }
363 write_arg(args_pipe[1], "--filter");
364 write_profile(args_pipe[1], "dbus-system.");
365 }
366
367 if (close(args_pipe[1]) == -1)
368 errExit("close");
369 char buf[1];
370 ssize_t read_bytes = read(status_pipe[0], buf, 1);
371 switch (read_bytes) {
372 case -1:
373 errExit("read");
374 break;
375 case 0:
376 fprintf(stderr, "xdg-dbus-proxy closed pipe unexpectedly\n");
377 // Wait for the subordinate process to write any errors to stderr and exit.
378 waitpid(dbus_proxy_pid, NULL, 0);
379 exit(-1);
380 break;
381 case 1:
382 if (arg_debug)
383 printf("xdg-dbus-proxy initialized\n");
384 break;
385 default:
386 assert(0);
387 }
388 }
389}
390
391void dbus_proxy_stop(void) {
392 if (dbus_proxy_pid == 0)
393 return;
394 assert(dbus_proxy_status_fd >= 0);
395 if (close(dbus_proxy_status_fd) == -1)
396 errExit("close");
397 int status;
398 if (waitpid(dbus_proxy_pid, &status, 0) == -1)
399 errExit("waitpid");
400 if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
401 fwarning("xdg-dbus-proxy returned %s\n", WEXITSTATUS(status));
402 dbus_proxy_pid = 0;
403 dbus_proxy_status_fd = -1;
404 if (dbus_user_proxy_socket != NULL) {
405 free(dbus_user_proxy_socket);
406 dbus_user_proxy_socket = NULL;
407 }
408 if (dbus_system_proxy_socket != NULL) {
409 free(dbus_system_proxy_socket);
410 dbus_system_proxy_socket = NULL;
411 }
412}
413
414static void socket_overlay(char *socket_path, char *proxy_path) {
415 int fd = safer_openat(-1, proxy_path, O_PATH | O_NOFOLLOW | O_CLOEXEC);
416 if (fd == -1)
417 errExit("opening DBus proxy socket");
418 struct stat s;
419 if (fstat(fd, &s) == -1)
420 errExit("fstat");
421 if (!S_ISSOCK(s.st_mode)) {
422 errno = ENOTSOCK;
423 errExit("mounting DBus proxy socket");
424 }
425 if (bind_mount_fd_to_path(fd, socket_path))
426 errExit("mount bind");
427 close(fd);
428}
429
430static const char *get_socket_env(const char *name) {
431 const char *value = env_get(name);
432 if (value == NULL)
433 return NULL;
434 if (strncmp(value, DBUS_SOCKET_PATH_PREFIX,
435 strlen(DBUS_SOCKET_PATH_PREFIX)) == 0)
436 return value + strlen(DBUS_SOCKET_PATH_PREFIX);
437 return NULL;
438}
439
440void dbus_set_session_bus_env(void) {
441 env_store_name_val(DBUS_SESSION_BUS_ADDRESS_ENV,
442 DBUS_SOCKET_PATH_PREFIX RUN_DBUS_USER_SOCKET, SETENV);
443}
444
445void dbus_set_system_bus_env(void) {
446 env_store_name_val(DBUS_SYSTEM_BUS_ADDRESS_ENV,
447 DBUS_SOCKET_PATH_PREFIX RUN_DBUS_SYSTEM_SOCKET, SETENV);
448}
449
450static void disable_socket_dir(void) {
451 struct stat s;
452 if (stat(RUN_FIREJAIL_DBUS_DIR, &s) == 0)
453 disable_file_or_dir(RUN_FIREJAIL_DBUS_DIR);
454}
455
456void dbus_apply_policy(void) {
457 EUID_ROOT();
458
459 if (arg_dbus_user == DBUS_POLICY_ALLOW && arg_dbus_system == DBUS_POLICY_ALLOW) {
460 disable_socket_dir();
461 return;
462 }
463
464 if (!checkcfg(CFG_DBUS)) {
465 disable_socket_dir();
466 fwarning("D-Bus handling is disabled in Firejail configuration file\n");
467 return;
468 }
469
470 create_empty_dir_as_root(RUN_DBUS_DIR, 0755);
471
472 if (arg_dbus_user != DBUS_POLICY_ALLOW) {
473 create_empty_file_as_root(RUN_DBUS_USER_SOCKET, 0600);
474
475 if (arg_dbus_user == DBUS_POLICY_FILTER) {
476 assert(dbus_user_proxy_socket != NULL);
477 socket_overlay(RUN_DBUS_USER_SOCKET, dbus_user_proxy_socket);
478 free(dbus_user_proxy_socket);
479 }
480
481 char *dbus_user_socket;
482 if (asprintf(&dbus_user_socket, DBUS_USER_SOCKET_FORMAT,
483 (int) getuid()) == -1)
484 errExit("asprintf");
485 disable_file_or_dir(dbus_user_socket);
486
487 char *dbus_user_socket2;
488 if (asprintf(&dbus_user_socket2, DBUS_USER_SOCKET_FORMAT2,
489 (int) getuid()) == -1)
490 errExit("asprintf");
491 disable_file_or_dir(dbus_user_socket2);
492
493 const char *user_env = get_socket_env(DBUS_SESSION_BUS_ADDRESS_ENV);
494 if (user_env != NULL && strcmp(user_env, dbus_user_socket) != 0 &&
495 strcmp(user_env, dbus_user_socket2) != 0)
496 disable_file_or_dir(user_env);
497
498 free(dbus_user_socket);
499 free(dbus_user_socket2);
500
501 dbus_set_session_bus_env();
502
503 // blacklist the dbus-launch user directory
504 char *path;
505 if (asprintf(&path, "%s/.dbus", cfg.homedir) == -1)
506 errExit("asprintf");
507 disable_file_or_dir(path);
508 free(path);
509 }
510
511 if (arg_dbus_system != DBUS_POLICY_ALLOW) {
512 create_empty_file_as_root(RUN_DBUS_SYSTEM_SOCKET, 0600);
513
514 if (arg_dbus_system == DBUS_POLICY_FILTER) {
515 assert(dbus_system_proxy_socket != NULL);
516 socket_overlay(RUN_DBUS_SYSTEM_SOCKET, dbus_system_proxy_socket);
517 free(dbus_system_proxy_socket);
518 }
519
520 disable_file_or_dir(DBUS_SYSTEM_SOCKET);
521
522 const char *system_env = get_socket_env(DBUS_SYSTEM_BUS_ADDRESS_ENV);
523 if (system_env != NULL && strcmp(system_env, DBUS_SYSTEM_SOCKET) != 0)
524 disable_file_or_dir(system_env);
525
526 dbus_set_system_bus_env();
527 }
528
529 // Only disable access to /run/firejail/dbus here, when the sockets have been bind-mounted.
530 disable_socket_dir();
531
532 // look for a possible abstract unix socket
533
534 // --net=none
535 if (arg_nonetwork)
536 return;
537
538 // --net=eth0
539 if (any_bridge_configured())
540 return;
541
542 // --protocol=unix
543 if (cfg.protocol && !strstr(cfg.protocol, "unix"))
544 return;
545
546 fwarning("An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.\n");
547}
548#endif // HAVE_DBUSPROXY
diff --git a/src/firejail/dhcp.c b/src/firejail/dhcp.c
new file mode 100644
index 000000000..ec482e2ea
--- /dev/null
+++ b/src/firejail/dhcp.c
@@ -0,0 +1,184 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20#include "firejail.h"
21#include <sys/stat.h>
22#include <sys/types.h>
23#include <sys/wait.h>
24#include <errno.h>
25#include <stddef.h>
26#include <stdio.h>
27#include <string.h>
28
29pid_t dhclient4_pid = 0;
30pid_t dhclient6_pid = 0;
31
32typedef struct {
33 char *version_arg;
34 char *pid_file;
35 char *leases_file;
36 uint8_t generate_duid;
37 char *duid_leases_file;
38 pid_t *pid;
39 ptrdiff_t arg_offset;
40} Dhclient;
41
42static const Dhclient dhclient4 = {
43 .version_arg = "-4",
44 .pid_file = RUN_DHCLIENT_4_PID_FILE,
45 .leases_file = RUN_DHCLIENT_4_LEASES_FILE,
46 .generate_duid = 1,
47 .pid = &dhclient4_pid,
48 .arg_offset = offsetof(Bridge, arg_ip_dhcp)
49};
50
51static const Dhclient dhclient6 = {
52 .version_arg = "-6",
53 .pid_file = RUN_DHCLIENT_6_PID_FILE,
54 .leases_file = RUN_DHCLIENT_6_LEASES_FILE,
55 .duid_leases_file = RUN_DHCLIENT_4_LEASES_FILE,
56 .pid = &dhclient6_pid,
57 .arg_offset = offsetof(Bridge, arg_ip6_dhcp)
58};
59
60static void dhcp_run_dhclient(char *dhclient_path, const Dhclient *client) {
61 char *argv[256] = {
62 dhclient_path,
63 client->version_arg,
64 "-pf", client->pid_file,
65 "-lf", client->leases_file,
66 };
67 int i = 6;
68 if (client->generate_duid)
69 argv[i++] = "-i";
70 if (client->duid_leases_file) {
71 argv[i++] = "-df";
72 argv[i++] = client->duid_leases_file;
73 }
74 if (arg_debug)
75 argv[i++] = "-v";
76 if (*(uint8_t *)((char *)&cfg.bridge0 + client->arg_offset))
77 argv[i++] = cfg.bridge0.devsandbox;
78 if (*(uint8_t *)((char *)&cfg.bridge1 + client->arg_offset))
79 argv[i++] = cfg.bridge1.devsandbox;
80 if (*(uint8_t *)((char *)&cfg.bridge2 + client->arg_offset))
81 argv[i++] = cfg.bridge2.devsandbox;
82 if (*(uint8_t *)((char *)&cfg.bridge3 + client->arg_offset))
83 argv[i++] = cfg.bridge3.devsandbox;
84
85 sbox_run_v(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_CAPS_NET_SERVICE | SBOX_SECCOMP, argv);
86}
87
88static pid_t dhcp_read_pidfile(const Dhclient *client) {
89 // We have to run dhclient as a forking daemon (not pass the -d option),
90 // because we want to be notified of a successful DHCP lease by the parent process exit.
91 int tries = 0;
92 pid_t found = 0;
93 while (found == 0 && tries < 10) {
94 if (tries >= 1)
95 usleep(100000);
96 FILE *pidfile = fopen(client->pid_file, "re");
97 if (pidfile) {
98 long pid;
99 if (fscanf(pidfile, "%ld", &pid) == 1)
100 found = (pid_t) pid;
101 fclose(pidfile);
102 }
103 ++tries;
104 }
105 if (found == 0) {
106 fprintf(stderr, "Error: Cannot get dhclient %s PID from %s\n",
107 client->version_arg, client->pid_file);
108 exit(1);
109 }
110 return found;
111}
112
113static void dhcp_start_dhclient(char *dhclient_path, const Dhclient *client) {
114 dhcp_run_dhclient(dhclient_path, client);
115 *(client->pid) = dhcp_read_pidfile(client);
116}
117
118static void dhcp_waitll(const char *ifname) {
119 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 3, PATH_FNET, "waitll", ifname);
120}
121
122static void dhcp_waitll_all() {
123 if (cfg.bridge0.arg_ip6_dhcp)
124 dhcp_waitll(cfg.bridge0.devsandbox);
125 if (cfg.bridge1.arg_ip6_dhcp)
126 dhcp_waitll(cfg.bridge1.devsandbox);
127 if (cfg.bridge2.arg_ip6_dhcp)
128 dhcp_waitll(cfg.bridge2.devsandbox);
129 if (cfg.bridge3.arg_ip6_dhcp)
130 dhcp_waitll(cfg.bridge3.devsandbox);
131}
132
133// Temporarily copy dhclient executable under /run/firejail/mnt and start it from there
134// in order to recognize it later in firemon and firetools
135void dhcp_store_exec(void) {
136 if (!any_dhcp())
137 return;
138
139 char *dhclient_path = "/sbin/dhclient";
140 struct stat s;
141 if (stat(dhclient_path, &s) == -1) {
142 dhclient_path = "/usr/sbin/dhclient";
143 if (stat(dhclient_path, &s) == -1) {
144 fprintf(stderr, "Error: dhclient was not found.\n");
145 exit(1);
146 }
147 }
148
149 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 4, PATH_FCOPY, "--follow-link", dhclient_path, RUN_MNT_DIR);
150}
151
152void dhcp_start(void) {
153 if (!any_dhcp())
154 return;
155
156 char *dhclient_path = RUN_MNT_DIR "/dhclient";
157 struct stat s;
158 if (stat(dhclient_path, &s) == -1) {
159 fprintf(stderr, "Error: %s was not found.\n", dhclient_path);
160 exit(1);
161 }
162
163 EUID_ROOT();
164 if (mkdir(RUN_DHCLIENT_DIR, 0700))
165 errExit("mkdir");
166
167 if (any_ip_dhcp()) {
168 dhcp_start_dhclient(dhclient_path, &dhclient4);
169 if (arg_debug)
170 printf("Running dhclient -4 in the background as pid %ld\n", (long) dhclient4_pid);
171 }
172 if (any_ip6_dhcp()) {
173 dhcp_waitll_all();
174 dhcp_start_dhclient(dhclient_path, &dhclient6);
175 if (arg_debug)
176 printf("Running dhclient -6 in the background as pid %ld\n", (long) dhclient6_pid);
177 if (dhclient4_pid == dhclient6_pid) {
178 fprintf(stderr, "Error: dhclient -4 and -6 have the same PID: %ld\n", (long) dhclient4_pid);
179 exit(1);
180 }
181 }
182
183 unlink(dhclient_path);
184}
diff --git a/src/firejail/env.c b/src/firejail/env.c
index b2e4c17f3..ad16de037 100644
--- a/src/firejail/env.c
+++ b/src/firejail/env.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,8 +25,8 @@
25 25
26typedef struct env_t { 26typedef struct env_t {
27 struct env_t *next; 27 struct env_t *next;
28 char *name; 28 const char *name;
29 char *value; 29 const char *value;
30 ENV_OP op; 30 ENV_OP op;
31} Env; 31} Env;
32static Env *envlist = NULL; 32static Env *envlist = NULL;
@@ -52,17 +52,14 @@ static void env_add(Env *env) {
52 52
53// load IBUS env variables 53// load IBUS env variables
54void env_ibus_load(void) { 54void env_ibus_load(void) {
55 EUID_ASSERT();
56
55 // check ~/.config/ibus/bus directory 57 // check ~/.config/ibus/bus directory
56 char *dirname; 58 char *dirname;
57 if (asprintf(&dirname, "%s/.config/ibus/bus", cfg.homedir) == -1) 59 if (asprintf(&dirname, "%s/.config/ibus/bus", cfg.homedir) == -1)
58 errExit("asprintf"); 60 errExit("asprintf");
59 61
60 struct stat s;
61 if (stat(dirname, &s) == -1)
62 return;
63
64 // find the file 62 // find the file
65 /* coverity[toctou] */
66 DIR *dir = opendir(dirname); 63 DIR *dir = opendir(dirname);
67 if (!dir) { 64 if (!dir) {
68 free(dirname); 65 free(dirname);
@@ -82,7 +79,7 @@ void env_ibus_load(void) {
82 char *fname; 79 char *fname;
83 if (asprintf(&fname, "%s/%s", dirname, entry->d_name) == -1) 80 if (asprintf(&fname, "%s/%s", dirname, entry->d_name) == -1)
84 errExit("asprintf"); 81 errExit("asprintf");
85 FILE *fp = fopen(fname, "r"); 82 FILE *fp = fopen(fname, "re");
86 free(fname); 83 free(fname);
87 if (!fp) 84 if (!fp)
88 continue; 85 continue;
@@ -101,9 +98,7 @@ void env_ibus_load(void) {
101 *ptr = '\0'; 98 *ptr = '\0';
102 if (arg_debug) 99 if (arg_debug)
103 printf("%s\n", buf); 100 printf("%s\n", buf);
104 EUID_USER();
105 env_store(buf, SETENV); 101 env_store(buf, SETENV);
106 EUID_ROOT();
107 } 102 }
108 103
109 fclose(fp); 104 fclose(fp);
@@ -116,43 +111,50 @@ void env_ibus_load(void) {
116 111
117// default sandbox env variables 112// default sandbox env variables
118void env_defaults(void) { 113void env_defaults(void) {
119 // fix qt 4.8 114 // Qt fixes
120 if (setenv("QT_X11_NO_MITSHM", "1", 1) < 0) 115 env_store_name_val("QT_X11_NO_MITSHM", "1", SETENV);
121 errExit("setenv"); 116 env_store_name_val("QML_DISABLE_DISK_CACHE", "1", SETENV);
122// if (setenv("MOZ_NO_REMOTE, "1", 1) < 0) 117// env_store_name_val("QTWEBENGINE_DISABLE_SANDBOX", "1", SETENV);
123// errExit("setenv"); 118// env_store_name_val("MOZ_NO_REMOTE, "1", SETENV);
124 if (setenv("container", "firejail", 1) < 0) // LXC sets container=lxc, 119 env_store_name_val("container", "firejail", SETENV); // LXC sets container=lxc,
125 errExit("setenv");
126 if (!cfg.shell) 120 if (!cfg.shell)
127 cfg.shell = guess_shell(); 121 cfg.shell = guess_shell();
128 if (cfg.shell && setenv("SHELL", cfg.shell, 1) < 0) 122 if (cfg.shell)
129 errExit("setenv"); 123 env_store_name_val("SHELL", cfg.shell, SETENV);
124
125 // spawn KIO slaves inside the sandbox
126 env_store_name_val("KDE_FORK_SLAVES", "1", SETENV);
130 127
131 // set prompt color to green 128 // set prompt color to green
132 int set_prompt = 0; 129 int set_prompt = 0;
133 if (checkcfg(CFG_FIREJAIL_PROMPT)) 130 if (checkcfg(CFG_FIREJAIL_PROMPT))
134 set_prompt = 1; 131 set_prompt = 1;
135 else { // check FIREJAIL_PROMPT="yes" environment variable 132 else { // check FIREJAIL_PROMPT="yes" environment variable
136 char *prompt = getenv("FIREJAIL_PROMPT"); 133 const char *prompt = env_get("FIREJAIL_PROMPT");
137 if (prompt && strcmp(prompt, "yes") == 0) 134 if (prompt && strcmp(prompt, "yes") == 0)
138 set_prompt = 1; 135 set_prompt = 1;
139 } 136 }
140 137
141 if (set_prompt) { 138 if (set_prompt)
142 //export PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] ' 139 //export PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] '
143 if (setenv("PROMPT_COMMAND", "export PS1=\"\\[\\e[1;32m\\][\\u@\\h \\W]\\$\\[\\e[0m\\] \"", 1) < 0) 140 env_store_name_val("PROMPT_COMMAND", "export PS1=\"\\[\\e[1;32m\\][\\u@\\h \\W]\\$\\[\\e[0m\\] \"", SETENV);
144 errExit("setenv"); 141 else
145 } 142 // remove PROMPT_COMMAND
143 env_store_name_val("PROMPT_COMMAND", ":", SETENV); // unsetenv() will not work here, bash still picks it up from somewhere
146 144
147 // set the window title 145 // set the window title
148 if (!arg_quiet) 146 if (!arg_quiet && isatty(STDOUT_FILENO))
149 printf("\033]0;firejail %s\007", cfg.window_title); 147 printf("\033]0;firejail %s\007", cfg.window_title);
148
149 // pass --quiet as an environment variable, in case the command calls further firejailed commands
150 if (arg_quiet)
151 env_store_name_val("FIREJAIL_QUIET", "yes", SETENV);
152
150 fflush(0); 153 fflush(0);
151} 154}
152 155
153// parse and store the environment setting 156// parse and store the environment setting
154void env_store(const char *str, ENV_OP op) { 157void env_store(const char *str, ENV_OP op) {
155 EUID_ASSERT();
156 assert(str); 158 assert(str);
157 159
158 // some basic checking 160 // some basic checking
@@ -163,8 +165,7 @@ void env_store(const char *str, ENV_OP op) {
163 if (!ptr) 165 if (!ptr)
164 goto errexit; 166 goto errexit;
165 ptr++; 167 ptr++;
166 if (*ptr == '\0') 168 op = SETENV;
167 goto errexit;
168 } 169 }
169 170
170 // build list entry 171 // build list entry
@@ -192,8 +193,40 @@ errexit:
192 exit(1); 193 exit(1);
193} 194}
194 195
196void env_store_name_val(const char *name, const char *val, ENV_OP op) {
197 assert(name);
198
199 // some basic checking
200 if (*name == '\0')
201 goto errexit;
202
203 // build list entry
204 Env *env = calloc(1, sizeof(Env));
205 if (!env)
206 errExit("calloc");
207
208 env->name = strdup(name);
209 if (env->name == NULL)
210 errExit("strdup");
211
212 if (op == SETENV) {
213 env->value = strdup(val);
214 if (env->value == NULL)
215 errExit("strdup");
216 }
217 env->op = op;
218
219 // add entry to the list
220 env_add(env);
221 return;
222
223errexit:
224 fprintf(stderr, "Error: invalid --env setting\n");
225 exit(1);
226}
227
195// set env variables in the new sandbox process 228// set env variables in the new sandbox process
196void env_apply(void) { 229void env_apply_all(void) {
197 Env *env = envlist; 230 Env *env = envlist;
198 231
199 while (env) { 232 while (env) {
@@ -207,3 +240,85 @@ void env_apply(void) {
207 env = env->next; 240 env = env->next;
208 } 241 }
209} 242}
243
244// get env variable
245const char *env_get(const char *name) {
246 Env *env = envlist;
247 const char *r = NULL;
248
249 while (env) {
250 if (strcmp(env->name, name) == 0) {
251 if (env->op == SETENV)
252 r = env->value;
253 else if (env->op == RMENV)
254 r = NULL;
255 }
256 env = env->next;
257 }
258 return r;
259}
260
261static const char * const env_whitelist[] = {
262 "LANG",
263 "LANGUAGE",
264 "LC_MESSAGES",
265 // "PATH",
266 "DISPLAY" // required by X11
267};
268
269static const char * const env_whitelist_sbox[] = {
270 "FIREJAIL_DEBUG",
271 "FIREJAIL_FILE_COPY_LIMIT",
272 "FIREJAIL_PLUGIN",
273 "FIREJAIL_QUIET",
274 "FIREJAIL_SECCOMP_ERROR_ACTION",
275 "FIREJAIL_TEST_ARGUMENTS",
276 "FIREJAIL_TRACEFILE"
277};
278
279static void env_apply_list(const char * const *list, unsigned int num_items) {
280 Env *env = envlist;
281
282 while (env) {
283 if (env->op == SETENV) {
284 for (unsigned int i = 0; i < num_items; i++)
285 if (strcmp(env->name, list[i]) == 0) {
286 // sanity check for whitelisted environment variables
287 if (strlen(env->name) + strlen(env->value) >= MAX_ENV_LEN) {
288 fprintf(stderr, "Error: too long environment variable %s, please use --rmenv\n", env->name);
289 exit(1);
290 }
291
292 //fprintf(stderr, "whitelisted env var %s=%s\n", env->name, env->value);
293 if (setenv(env->name, env->value, 1) < 0)
294 errExit("setenv");
295 break;
296 }
297 } else if (env->op == RMENV)
298 unsetenv(env->name);
299
300 env = env->next;
301 }
302}
303
304// Filter env variables in main firejail process. All variables will
305// be reapplied for the sandboxed app by env_apply_all().
306void env_apply_whitelist(void) {
307 int r;
308
309 r = clearenv();
310 if (r != 0)
311 errExit("clearenv");
312
313 env_apply_list(env_whitelist, ARRAY_SIZE(env_whitelist));
314
315 // hardcoding PATH
316 if (setenv("PATH", "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin", 1) < 0)
317 errExit("setenv");
318}
319
320// Filter env variables for a sbox app
321void env_apply_whitelist_sbox(void) {
322 env_apply_whitelist();
323 env_apply_list(env_whitelist_sbox, ARRAY_SIZE(env_whitelist_sbox));
324}
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h
index bea195f36..2a7d88575 100644
--- a/src/firejail/firejail.h
+++ b/src/firejail/firejail.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -21,86 +21,19 @@
21#define FIREJAIL_H 21#define FIREJAIL_H
22#include "../include/common.h" 22#include "../include/common.h"
23#include "../include/euid_common.h" 23#include "../include/euid_common.h"
24#include "../include/rundefs.h"
24#include <stdarg.h> 25#include <stdarg.h>
26#include <sys/stat.h>
25 27
26// debug restricted shell 28// debug restricted shell
27//#define DEBUG_RESTRICTED_SHELL 29//#define DEBUG_RESTRICTED_SHELL
28 30
29// filesystem
30#define RUN_FIREJAIL_BASEDIR "/run"
31#define RUN_FIREJAIL_DIR "/run/firejail"
32#define RUN_FIREJAIL_APPIMAGE_DIR "/run/firejail/appimage"
33#define RUN_FIREJAIL_NAME_DIR "/run/firejail/name"
34#define RUN_FIREJAIL_X11_DIR "/run/firejail/x11"
35#define RUN_FIREJAIL_NETWORK_DIR "/run/firejail/network"
36#define RUN_FIREJAIL_BANDWIDTH_DIR "/run/firejail/bandwidth"
37#define RUN_FIREJAIL_PROFILE_DIR "/run/firejail/profile"
38#define RUN_NETWORK_LOCK_FILE "/run/firejail/firejail.lock"
39#define RUN_RO_DIR "/run/firejail/firejail.ro.dir"
40#define RUN_RO_FILE "/run/firejail/firejail.ro.file"
41#define RUN_MNT_DIR "/run/firejail/mnt" // a tmpfs is mounted on this directory before any of the files below are created
42#define RUN_CGROUP_CFG "/run/firejail/mnt/cgroup"
43#define RUN_CPU_CFG "/run/firejail/mnt/cpu"
44#define RUN_GROUPS_CFG "/run/firejail/mnt/groups"
45#define RUN_PROTOCOL_CFG "/run/firejail/mnt/protocol"
46#define RUN_HOME_DIR "/run/firejail/mnt/home"
47#define RUN_ETC_DIR "/run/firejail/mnt/etc"
48#define RUN_OPT_DIR "/run/firejail/mnt/opt"
49#define RUN_SRV_DIR "/run/firejail/mnt/srv"
50#define RUN_BIN_DIR "/run/firejail/mnt/bin"
51#define RUN_PULSE_DIR "/run/firejail/mnt/pulse"
52#define RUN_LIB_DIR "/run/firejail/mnt/lib"
53#define RUN_LIB_FILE "/run/firejail/mnt/libfiles"
54#define RUN_LIB_BIN "/run/firejail/mnt/binfiles"
55
56#define RUN_SECCOMP_PROTOCOL "/run/firejail/mnt/seccomp.protocol" // protocol filter
57#define RUN_SECCOMP_CFG "/run/firejail/mnt/seccomp" // configured filter
58#define RUN_SECCOMP_64 "/run/firejail/mnt/seccomp.64" // 64bit arch filter installed on 32bit architectures
59#define RUN_SECCOMP_32 "/run/firejail/mnt/seccomp.32" // 32bit arch filter installed on 64bit architectures
60#define RUN_SECCOMP_MDWX "/run/firejail/mnt/seccomp.mdwx" // filter for memory-deny-write-execute
61#define RUN_SECCOMP_BLOCK_SECONDARY "/run/firejail/mnt/seccomp.block_secondary" // secondary arch blocking filter
62#define RUN_SECCOMP_POSTEXEC "/run/firejail/mnt/seccomp.postexec" // filter for post-exec library
63#define PATH_SECCOMP_DEFAULT (LIBDIR "/firejail/seccomp") // default filter built during make
64#define PATH_SECCOMP_DEFAULT_DEBUG (LIBDIR "/firejail/seccomp.debug") // default filter built during make
65#define PATH_SECCOMP_64 (LIBDIR "/firejail/seccomp.64") // 64bit arch filter built during make
66#define PATH_SECCOMP_32 (LIBDIR "/firejail/seccomp.32") // 32bit arch filter built during make
67#define PATH_SECCOMP_MDWX (LIBDIR "/firejail/seccomp.mdwx") // filter for memory-deny-write-execute built during make
68#define PATH_SECCOMP_BLOCK_SECONDARY (LIBDIR "/firejail/seccomp.block_secondary") // secondary arch blocking filter built during make
69
70
71#define RUN_DEV_DIR "/run/firejail/mnt/dev"
72#define RUN_DEVLOG_FILE "/run/firejail/mnt/devlog"
73
74#define RUN_WHITELIST_X11_DIR "/run/firejail/mnt/orig-x11"
75#define RUN_WHITELIST_HOME_DIR "/run/firejail/mnt/orig-home" // default home directory masking
76#define RUN_WHITELIST_HOME_USER_DIR "/run/firejail/mnt/orig-home-user" // home directory whitelisting
77#define RUN_WHITELIST_TMP_DIR "/run/firejail/mnt/orig-tmp"
78#define RUN_WHITELIST_MEDIA_DIR "/run/firejail/mnt/orig-media"
79#define RUN_WHITELIST_MNT_DIR "/run/firejail/mnt/orig-mnt"
80#define RUN_WHITELIST_VAR_DIR "/run/firejail/mnt/orig-var"
81#define RUN_WHITELIST_DEV_DIR "/run/firejail/mnt/orig-dev"
82#define RUN_WHITELIST_OPT_DIR "/run/firejail/mnt/orig-opt"
83#define RUN_WHITELIST_SRV_DIR "/run/firejail/mnt/orig-srv"
84
85#define RUN_XAUTHORITY_FILE "/run/firejail/mnt/.Xauthority"
86#define RUN_XAUTHORITY_SEC_FILE "/run/firejail/mnt/sec.Xauthority"
87#define RUN_ASOUNDRC_FILE "/run/firejail/mnt/.asoundrc"
88#define RUN_HOSTNAME_FILE "/run/firejail/mnt/hostname"
89#define RUN_HOSTS_FILE "/run/firejail/mnt/hosts"
90#define RUN_RESOLVCONF_FILE "/run/firejail/mnt/resolv.conf"
91#define RUN_MACHINEID "/run/firejail/mnt/machine-id"
92#define RUN_LDPRELOAD_FILE "/run/firejail/mnt/ld.so.preload"
93#define RUN_UTMP_FILE "/run/firejail/mnt/utmp"
94#define RUN_PASSWD_FILE "/run/firejail/mnt/passwd"
95#define RUN_GROUP_FILE "/run/firejail/mnt/group"
96#define RUN_FSLOGGER_FILE "/run/firejail/mnt/fslogger"
97
98 31
99 32
100// profiles 33// profiles
101#define DEFAULT_USER_PROFILE "default" 34#define DEFAULT_USER_PROFILE "default"
102#define DEFAULT_ROOT_PROFILE "server" 35#define DEFAULT_ROOT_PROFILE "server"
103#define MAX_INCLUDE_LEVEL 6 // include levels in profile files 36#define MAX_INCLUDE_LEVEL 16 // include levels in profile files
104 37
105 38
106#define ASSERT_PERMS(file, uid, gid, mode) \ 39#define ASSERT_PERMS(file, uid, gid, mode) \
@@ -112,6 +45,15 @@
112 assert(s.st_gid == gid);\ 45 assert(s.st_gid == gid);\
113 assert((s.st_mode & 07777) == (mode));\ 46 assert((s.st_mode & 07777) == (mode));\
114 } while (0) 47 } while (0)
48#define ASSERT_PERMS_AS_USER(file, uid, gid, mode) \
49 do { \
50 assert(file);\
51 struct stat s;\
52 if (stat_as_user(file, &s) == -1) errExit("stat");\
53 assert(s.st_uid == uid);\
54 assert(s.st_gid == gid);\
55 assert((s.st_mode & 07777) == (mode));\
56 } while (0)
115#define ASSERT_PERMS_FD(fd, uid, gid, mode) \ 57#define ASSERT_PERMS_FD(fd, uid, gid, mode) \
116 do { \ 58 do { \
117 struct stat s;\ 59 struct stat s;\
@@ -148,6 +90,8 @@
148 (void) rv;\ 90 (void) rv;\
149 } while (0) 91 } while (0)
150 92
93#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
94
151// main.c 95// main.c
152typedef struct bridge_t { 96typedef struct bridge_t {
153 // on the host 97 // on the host
@@ -162,6 +106,7 @@ typedef struct bridge_t {
162 // inside the sandbox 106 // inside the sandbox
163 char *devsandbox; // name of the device inside the sandbox 107 char *devsandbox; // name of the device inside the sandbox
164 uint32_t ipsandbox; // ip address inside the sandbox 108 uint32_t ipsandbox; // ip address inside the sandbox
109 uint32_t masksandbox; // network mask inside the sandbox
165 char *ip6sandbox; // ipv6 address inside the sandbox 110 char *ip6sandbox; // ipv6 address inside the sandbox
166 uint8_t macsandbox[6]; // mac address inside the sandbox 111 uint8_t macsandbox[6]; // mac address inside the sandbox
167 uint32_t iprange_start;// iprange arp scan start range 112 uint32_t iprange_start;// iprange arp scan start range
@@ -169,6 +114,8 @@ typedef struct bridge_t {
169 114
170 // flags 115 // flags
171 uint8_t arg_ip_none; // --ip=none 116 uint8_t arg_ip_none; // --ip=none
117 uint8_t arg_ip_dhcp;
118 uint8_t arg_ip6_dhcp;
172 uint8_t macvlan; // set by --net=eth0 (or eth1, ...); reset by --net=br0 (or br1, ...) 119 uint8_t macvlan; // set by --net=eth0 (or eth1, ...); reset by --net=br0 (or br1, ...)
173 uint8_t configured; 120 uint8_t configured;
174 uint8_t scan; // set by --scan 121 uint8_t scan; // set by --scan
@@ -184,21 +131,23 @@ typedef struct interface_t {
184 uint8_t configured; 131 uint8_t configured;
185} Interface; 132} Interface;
186 133
134typedef struct topdir_t {
135 char *path;
136 int fd;
137} TopDir;
138
187typedef struct profile_entry_t { 139typedef struct profile_entry_t {
188 struct profile_entry_t *next; 140 struct profile_entry_t *next;
189 char *data; // command 141 char *data; // command
190 142
191 // whitelist command parameters 143 // whitelist command parameters
192 char *link; // link name - set if the file is a link 144 struct wparam_t {
193 unsigned home_dir:1; // whitelist in /home/user directory 145 char *file; // resolved file path
194 unsigned tmp_dir:1; // whitelist in /tmp directory 146 char *link; // link path
195 unsigned media_dir:1; // whitelist in /media directory 147 TopDir *top; // top level directory
196 unsigned mnt_dir:1; // whitelist in /mnt directory 148 } *wparam;
197 unsigned var_dir:1; // whitelist in /var directory 149
198 unsigned dev_dir:1; // whitelist in /dev directory 150} ProfileEntry;
199 unsigned opt_dir:1; // whitelist in /opt directory
200 unsigned srv_dir:1; // whitelist in /srv directory
201}ProfileEntry;
202 151
203typedef struct config_t { 152typedef struct config_t {
204 // user data 153 // user data
@@ -207,6 +156,8 @@ typedef struct config_t {
207 156
208 // filesystem 157 // filesystem
209 ProfileEntry *profile; 158 ProfileEntry *profile;
159 ProfileEntry *profile_rebuild_etc; // blacklist files in /etc directory used by fs_rebuild_etc()
160
210#define MAX_PROFILE_IGNORE 32 161#define MAX_PROFILE_IGNORE 32
211 char *profile_ignore[MAX_PROFILE_IGNORE]; 162 char *profile_ignore[MAX_PROFILE_IGNORE];
212 char *chrootdir; // chroot directory 163 char *chrootdir; // chroot directory
@@ -216,10 +167,10 @@ typedef struct config_t {
216 char *opt_private_keep; // keep list for private opt directory 167 char *opt_private_keep; // keep list for private opt directory
217 char *srv_private_keep; // keep list for private srv directory 168 char *srv_private_keep; // keep list for private srv directory
218 char *bin_private_keep; // keep list for private bin directory 169 char *bin_private_keep; // keep list for private bin directory
170 char *bin_private_lib; // executable list sent by private-bin to private-lib
219 char *lib_private_keep; // keep list for private bin directory 171 char *lib_private_keep; // keep list for private bin directory
220 char *cwd; // current working directory 172 char *cwd; // current working directory
221 char *overlay_dir; 173 char *overlay_dir;
222 char *private_template; // template dir for tmpfs home
223 174
224 // networking 175 // networking
225 char *name; // sandbox name 176 char *name; // sandbox name
@@ -234,28 +185,32 @@ typedef struct config_t {
234 Interface interface1; 185 Interface interface1;
235 Interface interface2; 186 Interface interface2;
236 Interface interface3; 187 Interface interface3;
237 uint32_t dns1; // up to 3 IP addresses for dns servers 188 char *dns1; // up to 4 IP (v4/v6) addresses for dns servers
238 uint32_t dns2; 189 char *dns2;
239 uint32_t dns3; 190 char *dns3;
191 char *dns4;
240 192
241 // seccomp 193 // seccomp
242 char *seccomp_list;// optional seccomp list on top of default filter 194 char *seccomp_list, *seccomp_list32; // optional seccomp list on top of default filter
243 char *seccomp_list_drop; // seccomp drop list 195 char *seccomp_list_drop, *seccomp_list_drop32; // seccomp drop list
244 char *seccomp_list_keep; // seccomp keep list 196 char *seccomp_list_keep, *seccomp_list_keep32; // seccomp keep list
245 char *protocol; // protocol list 197 char *protocol; // protocol list
198 char *seccomp_error_action; // error action: kill, log or errno
246 199
247 // rlimits 200 // rlimits
201 long long unsigned rlimit_cpu;
248 long long unsigned rlimit_nofile; 202 long long unsigned rlimit_nofile;
249 long long unsigned rlimit_nproc; 203 long long unsigned rlimit_nproc;
250 long long unsigned rlimit_fsize; 204 long long unsigned rlimit_fsize;
251 long long unsigned rlimit_sigpending; 205 long long unsigned rlimit_sigpending;
206 long long unsigned rlimit_as;
207 unsigned timeout; // maximum time elapsed before killing the sandbox
252 208
253 // cpu affinity, nice and control groups 209 // cpu affinity, nice and control groups
254 uint32_t cpus; 210 uint32_t cpus;
255 int nice; 211 int nice;
256 char *cgroup; 212 char *cgroup;
257 213
258
259 // command line 214 // command line
260 char *command_line; 215 char *command_line;
261 char *window_title; 216 char *window_title;
@@ -293,15 +248,31 @@ static inline int any_interface_configured(void) {
293 else 248 else
294 return 0; 249 return 0;
295} 250}
296void clear_run_files(pid_t pid); 251
252static inline int any_ip_dhcp(void) {
253 if (cfg.bridge0.arg_ip_dhcp || cfg.bridge1.arg_ip_dhcp || cfg.bridge2.arg_ip_dhcp || cfg.bridge3.arg_ip_dhcp)
254 return 1;
255 else
256 return 0;
257}
258
259static inline int any_ip6_dhcp(void) {
260 if (cfg.bridge0.arg_ip6_dhcp || cfg.bridge1.arg_ip6_dhcp || cfg.bridge2.arg_ip6_dhcp || cfg.bridge3.arg_ip6_dhcp)
261 return 1;
262 else
263 return 0;
264}
265
266static inline int any_dhcp(void) {
267 return any_ip_dhcp() || any_ip6_dhcp();
268}
297 269
298extern int arg_private; // mount private /home 270extern int arg_private; // mount private /home
299extern int arg_private_template; // private /home template 271extern int arg_private_cache; // private home/.cache
300extern int arg_allow_private_blacklist; // blacklist things in private directories
301extern int arg_debug; // print debug messages 272extern int arg_debug; // print debug messages
302extern int arg_debug_check_filename; // print debug messages for filename checking
303extern int arg_debug_blacklists; // print debug messages for blacklists 273extern int arg_debug_blacklists; // print debug messages for blacklists
304extern int arg_debug_whitelists; // print debug messages for whitelists 274extern int arg_debug_whitelists; // print debug messages for whitelists
275extern int arg_debug_private_lib; // print debug messages for private-lib
305extern int arg_nonetwork; // --net=none 276extern int arg_nonetwork; // --net=none
306extern int arg_command; // -c 277extern int arg_command; // -c
307extern int arg_overlay; // overlay option 278extern int arg_overlay; // overlay option
@@ -309,6 +280,7 @@ extern int arg_overlay_keep; // place overlay diff in a known directory
309extern int arg_overlay_reuse; // allow the reuse of overlays 280extern int arg_overlay_reuse; // allow the reuse of overlays
310 281
311extern int arg_seccomp; // enable default seccomp filter 282extern int arg_seccomp; // enable default seccomp filter
283extern int arg_seccomp32; // enable default seccomp filter for 32 bit arch
312extern int arg_seccomp_postexec; // need postexec ld.preload library? 284extern int arg_seccomp_postexec; // need postexec ld.preload library?
313extern int arg_seccomp_block_secondary; // block any secondary architectures 285extern int arg_seccomp_block_secondary; // block any secondary architectures
314 286
@@ -319,11 +291,14 @@ extern int arg_caps_keep; // keep list
319extern char *arg_caps_list; // optional caps list 291extern char *arg_caps_list; // optional caps list
320 292
321extern int arg_trace; // syscall tracing support 293extern int arg_trace; // syscall tracing support
294extern char *arg_tracefile; // syscall tracing file
322extern int arg_tracelog; // blacklist tracing support 295extern int arg_tracelog; // blacklist tracing support
296extern int arg_rlimit_cpu; // rlimit cpu
323extern int arg_rlimit_nofile; // rlimit nofile 297extern int arg_rlimit_nofile; // rlimit nofile
324extern int arg_rlimit_nproc; // rlimit nproc 298extern int arg_rlimit_nproc; // rlimit nproc
325extern int arg_rlimit_fsize; // rlimit fsize 299extern int arg_rlimit_fsize; // rlimit fsize
326extern int arg_rlimit_sigpending;// rlimit sigpending 300extern int arg_rlimit_sigpending;// rlimit sigpending
301extern int arg_rlimit_as; //rlimit as
327extern int arg_nogroups; // disable supplementary groups 302extern int arg_nogroups; // disable supplementary groups
328extern int arg_nonewprivs; // set the NO_NEW_PRIVS prctl 303extern int arg_nonewprivs; // set the NO_NEW_PRIVS prctl
329extern int arg_noroot; // create a new user namespace and disable root user 304extern int arg_noroot; // create a new user namespace and disable root user
@@ -335,14 +310,16 @@ extern char *arg_netns; // "ip netns"-created network namespace to use
335extern int arg_doubledash; // double dash 310extern int arg_doubledash; // double dash
336extern int arg_shell_none; // run the program directly without a shell 311extern int arg_shell_none; // run the program directly without a shell
337extern int arg_private_dev; // private dev directory 312extern int arg_private_dev; // private dev directory
313extern int arg_keep_dev_shm; // preserve /dev/shm
338extern int arg_private_etc; // private etc directory 314extern int arg_private_etc; // private etc directory
339extern int arg_private_opt; // private opt directory 315extern int arg_private_opt; // private opt directory
340extern int arg_private_srv; // private srv directory 316extern int arg_private_srv; // private srv directory
341extern int arg_private_bin; // private bin directory 317extern int arg_private_bin; // private bin directory
342extern int arg_private_tmp; // private tmp directory 318extern int arg_private_tmp; // private tmp directory
343extern int arg_private_lib; // private lib directory 319extern int arg_private_lib; // private lib directory
320extern int arg_private_cwd; // private working directory
344extern int arg_scan; // arp-scan all interfaces 321extern int arg_scan; // arp-scan all interfaces
345extern int arg_whitelist; // whitelist commad 322extern int arg_whitelist; // whitelist command
346extern int arg_nosound; // disable sound 323extern int arg_nosound; // disable sound
347extern int arg_novideo; //disable video devices in /dev 324extern int arg_novideo; //disable video devices in /dev
348extern int arg_no3d; // disable 3d hardware acceleration 325extern int arg_no3d; // disable 3d hardware acceleration
@@ -352,16 +329,16 @@ extern int arg_join_filesystem; // join only the mount namespace
352extern int arg_nice; // nice value configured 329extern int arg_nice; // nice value configured
353extern int arg_ipc; // enable ipc namespace 330extern int arg_ipc; // enable ipc namespace
354extern int arg_writable_etc; // writable etc 331extern int arg_writable_etc; // writable etc
332extern int arg_keep_config_pulse; // disable automatic ~/.config/pulse init
355extern int arg_writable_var; // writable var 333extern int arg_writable_var; // writable var
334extern int arg_keep_var_tmp; // don't overwrite /var/tmp
356extern int arg_writable_run_user; // writable /run/user 335extern int arg_writable_run_user; // writable /run/user
357extern int arg_writable_var_log; // writable /var/log 336extern int arg_writable_var_log; // writable /var/log
358extern int arg_appimage; // appimage 337extern int arg_appimage; // appimage
359extern int arg_audit; // audit
360extern char *arg_audit_prog; // audit
361extern int arg_apparmor; // apparmor 338extern int arg_apparmor; // apparmor
362extern int arg_allow_debuggers; // allow debuggers 339extern int arg_allow_debuggers; // allow debuggers
363extern int arg_x11_block; // block X11 340extern int arg_x11_block; // block X11
364extern int arg_x11_xorg; // use X11 security extention 341extern int arg_x11_xorg; // use X11 security extension
365extern int arg_allusers; // all user home directories visible 342extern int arg_allusers; // all user home directories visible
366extern int arg_machineid; // preserve /etc/machine-id 343extern int arg_machineid; // preserve /etc/machine-id
367extern int arg_disable_mnt; // disable /mnt and /media 344extern int arg_disable_mnt; // disable /mnt and /media
@@ -369,35 +346,53 @@ extern int arg_noprofile; // use default.profile if none other found/specified
369extern int arg_memory_deny_write_execute; // block writable and executable memory 346extern int arg_memory_deny_write_execute; // block writable and executable memory
370extern int arg_notv; // --notv 347extern int arg_notv; // --notv
371extern int arg_nodvd; // --nodvd 348extern int arg_nodvd; // --nodvd
349extern int arg_nou2f; // --nou2f
350extern int arg_noinput; // --noinput
351extern int arg_deterministic_exit_code; // always exit with first child's exit status
352
353typedef enum {
354 DBUS_POLICY_ALLOW, // Allow unrestricted access to the bus
355 DBUS_POLICY_FILTER, // Filter with xdg-dbus-proxy
356 DBUS_POLICY_BLOCK // Block access
357} DbusPolicy;
358extern DbusPolicy arg_dbus_user; // --dbus-user
359extern DbusPolicy arg_dbus_system; // --dbus-system
360extern int arg_dbus_log_user;
361extern int arg_dbus_log_system;
362extern const char *arg_dbus_log_file;
372 363
373extern int login_shell; 364extern int login_shell;
374extern int parent_to_child_fds[2]; 365extern int parent_to_child_fds[2];
375extern int child_to_parent_fds[2]; 366extern int child_to_parent_fds[2];
376extern pid_t sandbox_pid; 367extern pid_t sandbox_pid;
368extern mode_t orig_umask;
377extern unsigned long long start_timestamp; 369extern unsigned long long start_timestamp;
378 370
379#define MAX_ARGS 128 // maximum number of command arguments (argc) 371#define MAX_ARGS 128 // maximum number of command arguments (argc)
372#define MAX_ARG_LEN (PATH_MAX + 32) // --foobar=PATH
380extern char *fullargv[MAX_ARGS]; 373extern char *fullargv[MAX_ARGS];
381extern int fullargc; 374extern int fullargc;
382 375
383// main.c 376// main.c
384void set_x11_file(pid_t pid, int display);
385void check_user_namespace(void); 377void check_user_namespace(void);
386char *guess_shell(void); 378char *guess_shell(void);
387 379
388// sandbox.c 380// sandbox.c
381#define SANDBOX_DONE '1'
389int sandbox(void* sandbox_arg); 382int sandbox(void* sandbox_arg);
390void start_application(int no_sandbox); 383void start_application(int no_sandbox, int fd, char *set_sandbox_status) __attribute__((noreturn));
384void set_apparmor(void);
391 385
392// network_main.c 386// network_main.c
393void net_configure_bridge(Bridge *br, char *dev_name);
394void net_configure_sandbox_ip(Bridge *br); 387void net_configure_sandbox_ip(Bridge *br);
395void net_configure_veth_pair(Bridge *br, const char *ifname, pid_t child); 388void net_configure_veth_pair(Bridge *br, const char *ifname, pid_t child);
396void net_check_cfg(void); 389void net_check_cfg(void);
397void net_dns_print(pid_t pid); 390void net_dns_print(pid_t pid) __attribute__((noreturn));
398void network_main(pid_t child); 391void network_main(pid_t child);
392void net_print(pid_t pid);
399 393
400// network.c 394// network.c
395int check_ip46_address(const char *addr);
401void net_if_up(const char *ifname); 396void net_if_up(const char *ifname);
402void net_if_down(const char *ifname); 397void net_if_down(const char *ifname);
403void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu); 398void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu);
@@ -415,27 +410,44 @@ void preproc_mount_mnt_dir(void);
415void preproc_clean_run(void); 410void preproc_clean_run(void);
416 411
417// fs.c 412// fs.c
418// blacklist files or directoies by mounting empty files on top of them 413typedef enum {
414 BLACKLIST_FILE,
415 BLACKLIST_NOLOG,
416 MOUNT_READONLY,
417 MOUNT_TMPFS,
418 MOUNT_NOEXEC,
419 MOUNT_RDWR,
420 MOUNT_RDWR_NOCHECK, // no check of ownership
421 OPERATION_MAX
422} OPERATION;
423
424// blacklist files or directories by mounting empty files on top of them
419void fs_blacklist(void); 425void fs_blacklist(void);
420// remount a directory read-only 426// mount a writable tmpfs
421void fs_rdonly(const char *dir); 427void fs_tmpfs(const char *dir, unsigned check_owner);
422// remount a directory noexec, nodev and nosuid 428// remount noexec/nodev/nosuid or read-only or read-write
423void fs_noexec(const char *dir); 429void fs_remount(const char *dir, OPERATION op, int rec);
424// mount /proc and /sys directories 430// mount /proc and /sys directories
425void fs_proc_sys_dev_boot(void); 431void fs_proc_sys_dev_boot(void);
432// blacklist firejail configuration and runtime directories
433void disable_config(void);
426// build a basic read-only filesystem 434// build a basic read-only filesystem
427void fs_basic_fs(void); 435void fs_basic_fs(void);
428// mount overlayfs on top of / directory 436// mount overlayfs on top of / directory
429char *fs_check_overlay_dir(const char *subdirname, int allow_reuse); 437char *fs_check_overlay_dir(const char *subdirname, int allow_reuse);
430void fs_overlayfs(void); 438void fs_overlayfs(void);
431// chroot into an existing directory; mount exiting /dev and update /etc/resolv.conf
432void fs_chroot(const char *rootdir);
433void fs_check_chroot_dir(const char *rootdir);
434void fs_private_tmp(void); 439void fs_private_tmp(void);
440void fs_private_cache(void);
441void fs_mnt(const int enforce);
442
443// chroot.c
444// chroot into an existing directory; mount existing /dev and update /etc/resolv.conf
445void fs_check_chroot_dir(void);
446void fs_chroot(const char *rootdir);
435 447
436// profile.c 448// profile.c
437// find and read the profile specified by name from dir directory 449// find and read the profile specified by name from dir directory
438int profile_find(const char *name, const char *dir); 450int profile_find_firejail(const char *name, int add_ext);
439// read a profile file 451// read a profile file
440void profile_read(const char *fname); 452void profile_read(const char *fname);
441// check profile line; if line == 0, this was generated from a command line option 453// check profile line; if line == 0, this was generated from a command line option
@@ -444,19 +456,24 @@ void profile_read(const char *fname);
444int profile_check_line(char *ptr, int lineno, const char *fname); 456int profile_check_line(char *ptr, int lineno, const char *fname);
445// add a profile entry in cfg.profile list; use str to populate the list 457// add a profile entry in cfg.profile list; use str to populate the list
446void profile_add(char *str); 458void profile_add(char *str);
447void fs_mnt(void); 459void profile_add_ignore(const char *str);
460char *profile_list_normalize(char *list);
461char *profile_list_compress(char *list);
462void profile_list_augment(char **list, const char *items);
448 463
449// list.c 464// list.c
450void list(void); 465void list(void);
451void tree(void); 466void tree(void);
452void top(void); 467void top(void);
453void netstats(void);
454 468
455// usage.c 469// usage.c
456void usage(void); 470void usage(void);
457 471
458// join.c 472// join.c
459void join(pid_t pid, int argc, char **argv, int index); 473void join(pid_t pid, int argc, char **argv, int index) __attribute__((noreturn));
474bool is_ready_for_join(const pid_t pid);
475void check_join_permission(pid_t pid);
476pid_t switch_to_child(pid_t pid);
460 477
461// shutdown.c 478// shutdown.c
462void shut(pid_t pid); 479void shut(pid_t pid);
@@ -471,8 +488,19 @@ int arp_check(const char *dev, uint32_t destaddr);
471// assign an IP address using arp scanning 488// assign an IP address using arp scanning
472uint32_t arp_assign(const char *dev, Bridge *br); 489uint32_t arp_assign(const char *dev, Bridge *br);
473 490
491// macros.c
492char *expand_macros(const char *path);
493char *resolve_macro(const char *name);
494void invalid_filename(const char *fname, int globbing);
495int is_macro(const char *name);
496int macro_id(const char *name);
497
498
474// util.c 499// util.c
500void errLogExit(char* fmt, ...) __attribute__((noreturn));
475void fwarning(char* fmt, ...); 501void fwarning(char* fmt, ...);
502void fmessage(char* fmt, ...);
503long long unsigned parse_arg_size(char *str);
476void drop_privs(int nogroups); 504void drop_privs(int nogroups);
477int mkpath_as_root(const char* path); 505int mkpath_as_root(const char* path);
478void extract_command_name(int index, char **argv); 506void extract_command_name(int index, char **argv);
@@ -480,32 +508,63 @@ void logsignal(int s);
480void logmsg(const char *msg); 508void logmsg(const char *msg);
481void logargs(int argc, char **argv) ; 509void logargs(int argc, char **argv) ;
482void logerr(const char *msg); 510void logerr(const char *msg);
511void set_nice(int inc);
483int copy_file(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode); 512int copy_file(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode);
484void copy_file_as_user(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode); 513void copy_file_as_user(const char *srcname, const char *destname, mode_t mode);
485void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode); 514void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode);
486void touch_file_as_user(const char *fname, uid_t uid, gid_t gid, mode_t mode); 515void touch_file_as_user(const char *fname, mode_t mode);
487int is_dir(const char *fname); 516int is_dir(const char *fname);
488int is_link(const char *fname); 517int is_link(const char *fname);
518char *realpath_as_user(const char *fname);
519int stat_as_user(const char *fname, struct stat *s);
520int lstat_as_user(const char *fname, struct stat *s);
521void trim_trailing_slash_or_dot(char *path);
489char *line_remove_spaces(const char *buf); 522char *line_remove_spaces(const char *buf);
490char *split_comma(char *str); 523char *split_comma(char *str);
524char *clean_pathname(const char *path);
491void check_unsigned(const char *str, const char *msg); 525void check_unsigned(const char *str, const char *msg);
492int find_child(pid_t parent, pid_t *child); 526int find_child(pid_t parent, pid_t *child);
493void check_private_dir(void); 527void check_private_dir(void);
494void update_map(char *mapping, char *map_file); 528void update_map(char *mapping, char *map_file);
495void wait_for_other(int fd); 529void wait_for_other(int fd);
496void notify_other(int fd); 530void notify_other(int fd);
497char *expand_home(const char *path, const char* homedir);
498const char *gnu_basename(const char *path);
499uid_t pid_get_uid(pid_t pid); 531uid_t pid_get_uid(pid_t pid);
500void invalid_filename(const char *fname);
501uid_t get_group_id(const char *group); 532uid_t get_group_id(const char *group);
502int remove_directory(const char *path); 533int remove_overlay_directory(void);
503void flush_stdin(void); 534void flush_stdin(void);
535int create_empty_dir_as_user(const char *dir, mode_t mode);
504void create_empty_dir_as_root(const char *dir, mode_t mode); 536void create_empty_dir_as_root(const char *dir, mode_t mode);
505void create_empty_file_as_root(const char *dir, mode_t mode); 537void create_empty_file_as_root(const char *dir, mode_t mode);
506int set_perms(const char *fname, uid_t uid, gid_t gid, mode_t mode); 538int set_perms(const char *fname, uid_t uid, gid_t gid, mode_t mode);
507void mkdir_attr(const char *fname, mode_t mode, uid_t uid, gid_t gid); 539void mkdir_attr(const char *fname, mode_t mode, uid_t uid, gid_t gid);
508char *read_text_file_or_exit(const char *fname); 540unsigned extract_timeout(const char *str);
541void disable_file_or_dir(const char *fname);
542void disable_file_path(const char *path, const char *file);
543int safer_openat(int dirfd, const char *path, int flags);
544int remount_by_fd(int dst, unsigned long mountflags);
545int bind_mount_by_fd(int src, int dst);
546int bind_mount_path_to_fd(const char *srcname, int dst);
547int bind_mount_fd_to_path(int src, const char *destname);
548int has_handler(pid_t pid, int signal);
549void enter_network_namespace(pid_t pid);
550int read_pid(const char *name, pid_t *pid);
551pid_t require_pid(const char *name);
552void check_homedir(const char *dir);
553
554// Get info regarding the last kernel mount operation from /proc/self/mountinfo
555// The return value points to a static area, and will be overwritten by subsequent calls.
556// The function does an exit(1) if anything goes wrong.
557typedef struct {
558 int mountid; // id of the mount
559 char *fsname; // the pathname of the directory in the filesystem which forms the root of this mount
560 char *dir; // mount destination
561 char *fstype; // filesystem type
562} MountData;
563
564// mountinfo.c
565MountData *get_last_mount(void);
566int get_mount_id(const char *path);
567char **build_mount_array(const int mount_id, const char *path);
509 568
510// fs_var.c 569// fs_var.c
511void fs_var_log(void); // mounting /var/log 570void fs_var_log(void); // mounting /var/log
@@ -525,18 +584,18 @@ void fs_dev_disable_3d(void);
525void fs_dev_disable_video(void); 584void fs_dev_disable_video(void);
526void fs_dev_disable_tv(void); 585void fs_dev_disable_tv(void);
527void fs_dev_disable_dvd(void); 586void fs_dev_disable_dvd(void);
587void fs_dev_disable_u2f(void);
588void fs_dev_disable_input(void);
528 589
529// fs_home.c 590// fs_home.c
530// private mode (--private) 591// private mode (--private)
531void fs_private(void); 592void fs_private(void);
532// private mode (--private=homedir) 593// private mode (--private=homedir)
533void fs_private_homedir(void); 594void fs_private_homedir(void);
534// private template (--private-template=templatedir)
535void fs_private_template(void);
536// check new private home directory (--private= option) - exit if it fails 595// check new private home directory (--private= option) - exit if it fails
537void fs_check_private_dir(void); 596void fs_check_private_dir(void);
538// check new private template home directory (--private-template= option) exit if it fails 597// check new private working directory (--private-cwd= option) - exit if it fails
539void fs_check_private_template(void); 598void fs_check_private_cwd(const char *dir);
540void fs_private_home_list(void); 599void fs_private_home_list(void);
541 600
542 601
@@ -544,11 +603,13 @@ void fs_private_home_list(void);
544char *seccomp_check_list(const char *str); 603char *seccomp_check_list(const char *str);
545int seccomp_install_filters(void); 604int seccomp_install_filters(void);
546int seccomp_load(const char *fname); 605int seccomp_load(const char *fname);
547int seccomp_filter_drop(void); 606int seccomp_filter_drop(bool native);
548int seccomp_filter_keep(void); 607int seccomp_filter_keep(bool native);
549void seccomp_print_filter(pid_t pid); 608int seccomp_filter_mdwx(bool native);
609void seccomp_print_filter(pid_t pid) __attribute__((noreturn));
550 610
551// caps.c 611// caps.c
612void seccomp_load_file_list(void);
552int caps_default_filter(void); 613int caps_default_filter(void);
553void caps_print(void); 614void caps_print(void);
554void caps_drop_all(void); 615void caps_drop_all(void);
@@ -556,19 +617,16 @@ void caps_set(uint64_t caps);
556void caps_check_list(const char *clist, void (*callback)(int)); 617void caps_check_list(const char *clist, void (*callback)(int));
557void caps_drop_list(const char *clist); 618void caps_drop_list(const char *clist);
558void caps_keep_list(const char *clist); 619void caps_keep_list(const char *clist);
559void caps_print_filter(pid_t pid); 620void caps_print_filter(pid_t pid) __attribute__((noreturn));
560void caps_drop_dac_override(void); 621void caps_drop_dac_override(void);
561 622
562// syscall.c
563const char *syscall_find_nr(int nr);
564
565// fs_trace.c 623// fs_trace.c
566void fs_trace_preload(void); 624void fs_trace_preload(void);
625void fs_tracefile(void);
567void fs_trace(void); 626void fs_trace(void);
568 627
569// fs_hostname.c 628// fs_hostname.c
570void fs_hostname(const char *hostname); 629void fs_hostname(const char *hostname);
571void fs_resolvconf(void);
572char *fs_check_hosts_file(const char *fname); 630char *fs_check_hosts_file(const char *fname);
573void fs_store_hosts_file(void); 631void fs_store_hosts_file(void);
574void fs_mount_hosts_file(void); 632void fs_mount_hosts_file(void);
@@ -581,7 +639,7 @@ void read_cpu_list(const char *str);
581void set_cpu_affinity(void); 639void set_cpu_affinity(void);
582void load_cpu(const char *fname); 640void load_cpu(const char *fname);
583void save_cpu(void); 641void save_cpu(void);
584void cpu_print_filter(pid_t pid); 642void cpu_print_filter(pid_t pid) __attribute__((noreturn));
585 643
586// cgroup.c 644// cgroup.c
587void save_cgroup(void); 645void save_cgroup(void);
@@ -595,6 +653,7 @@ void check_output(int argc, char **argv);
595void check_netfilter_file(const char *fname); 653void check_netfilter_file(const char *fname);
596void netfilter(const char *fname); 654void netfilter(const char *fname);
597void netfilter6(const char *fname); 655void netfilter6(const char *fname);
656void netfilter_print(pid_t pid, int ipv6);
598 657
599// netns.c 658// netns.c
600void check_netns(const char *nsname); 659void check_netns(const char *nsname);
@@ -602,20 +661,23 @@ void netns(const char *nsname);
602void netns_mounts(const char *nsname); 661void netns_mounts(const char *nsname);
603 662
604// bandwidth.c 663// bandwidth.c
605void bandwidth_del_run_file(pid_t pid); 664void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, int up) __attribute__((noreturn));
606void bandwidth_pid(pid_t pid, const char *command, const char *dev, int down, int up);
607void network_del_run_file(pid_t pid);
608void network_set_run_file(pid_t pid); 665void network_set_run_file(pid_t pid);
609 666
610// fs_etc.c 667// fs_etc.c
611void fs_machineid(void); 668void fs_machineid(void);
669void fs_private_dir_copy(const char *private_dir, const char *private_run_dir, const char *private_list);
670void fs_private_dir_mount(const char *private_dir, const char *private_run_dir);
612void fs_private_dir_list(const char *private_dir, const char *private_run_dir, const char *private_list); 671void fs_private_dir_list(const char *private_dir, const char *private_run_dir, const char *private_list);
672void fs_rebuild_etc(void);
613 673
614// no_sandbox.c 674// no_sandbox.c
615int check_namespace_virt(void); 675int check_namespace_virt(void);
616int check_kernel_procs(void); 676int check_kernel_procs(void);
617void run_no_sandbox(int argc, char **argv); 677void run_no_sandbox(int argc, char **argv) __attribute__((noreturn));
618 678
679#define MAX_ENVS 256 // some sane maximum number of environment variables
680#define MAX_ENV_LEN (PATH_MAX + 32) // FOOBAR=SOME_PATH, only applied to Firejail's own sandboxed apps
619// env.c 681// env.c
620typedef enum { 682typedef enum {
621 SETENV = 0, 683 SETENV = 0,
@@ -623,19 +685,17 @@ typedef enum {
623} ENV_OP; 685} ENV_OP;
624 686
625void env_store(const char *str, ENV_OP op); 687void env_store(const char *str, ENV_OP op);
626void env_apply(void); 688void env_store_name_val(const char *name, const char *val, ENV_OP op);
689void env_apply_all(void);
690void env_apply_whitelist(void);
691void env_apply_whitelist_sbox(void);
627void env_defaults(void); 692void env_defaults(void);
693const char *env_get(const char *name);
628void env_ibus_load(void); 694void env_ibus_load(void);
629 695
630// fs_whitelist.c 696// fs_whitelist.c
631void fs_whitelist(void); 697void fs_whitelist(void);
632 698
633// errno.c
634int errno_highest_nr(void);
635int errno_find_name(const char *name);
636char *errno_find_nr(int nr);
637void errno_print(void);
638
639// pulseaudio.c 699// pulseaudio.c
640void pulseaudio_init(void); 700void pulseaudio_init(void);
641void pulseaudio_disable(void); 701void pulseaudio_disable(void);
@@ -649,7 +709,7 @@ void fs_private_lib(void);
649// protocol.c 709// protocol.c
650void protocol_filter_save(void); 710void protocol_filter_save(void);
651void protocol_filter_load(const char *fname); 711void protocol_filter_load(const char *fname);
652void protocol_print_filter(pid_t pid); 712void protocol_print_filter(pid_t pid) __attribute__((noreturn));
653 713
654// restrict_users.c 714// restrict_users.c
655void restrict_users(void); 715void restrict_users(void);
@@ -661,10 +721,10 @@ void fs_logger2int(const char *msg1, int d);
661void fs_logger3(const char *msg1, const char *msg2, const char *msg3); 721void fs_logger3(const char *msg1, const char *msg2, const char *msg3);
662void fs_logger_print(void); 722void fs_logger_print(void);
663void fs_logger_change_owner(void); 723void fs_logger_change_owner(void);
664void fs_logger_print_log(pid_t pid); 724void fs_logger_print_log(pid_t pid) __attribute__((noreturn));
665 725
666// run_symlink.c 726// run_symlink.c
667void run_symlink(int argc, char **argv); 727void run_symlink(int argc, char **argv, int run_as_is);
668 728
669// paths.c 729// paths.c
670char **build_paths(void); 730char **build_paths(void);
@@ -687,20 +747,24 @@ void fs_mkfile(const char *name);
687 747
688void fs_x11(void); 748void fs_x11(void);
689int x11_display(void); 749int x11_display(void);
690void x11_start(int argc, char **argv); 750void x11_start(int argc, char **argv) __attribute__((noreturn));
691void x11_start_xpra(int argc, char **argv); 751void x11_start_xpra(int argc, char **argv) __attribute__((noreturn));
692void x11_start_xephyr(int argc, char **argv); 752void x11_start_xephyr(int argc, char **argv) __attribute__((noreturn));
693void x11_block(void); 753void x11_block(void);
694void x11_start_xvfb(int argc, char **argv); 754void x11_start_xvfb(int argc, char **argv) __attribute__((noreturn));
755void x11_xorg(void);
695 756
696// ls.c 757// ls.c
697enum { 758enum {
698 SANDBOX_FS_LS = 0, 759 SANDBOX_FS_LS = 0,
760 SANDBOX_FS_CAT,
699 SANDBOX_FS_GET, 761 SANDBOX_FS_GET,
700 SANDBOX_FS_PUT, 762 SANDBOX_FS_PUT,
701 SANDBOX_FS_MAX // this should always be the last entry 763 SANDBOX_FS_MAX // this should always be the last entry
702}; 764};
703void sandboxfs(int op, pid_t pid, const char *path1, const char *path2); 765void ls(const char *path);
766void cat(const char *path);
767void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) __attribute__((noreturn));
704 768
705// checkcfg.c 769// checkcfg.c
706#define DEFAULT_ARP_PROBES 2 770#define DEFAULT_ARP_PROBES 2
@@ -714,21 +778,29 @@ enum {
714 CFG_NETWORK, 778 CFG_NETWORK,
715 CFG_RESTRICTED_NETWORK, 779 CFG_RESTRICTED_NETWORK,
716 CFG_FORCE_NONEWPRIVS, 780 CFG_FORCE_NONEWPRIVS,
717 CFG_WHITELIST,
718 CFG_XEPHYR_WINDOW_TITLE, 781 CFG_XEPHYR_WINDOW_TITLE,
719 CFG_REMOUNT_PROC_SYS,
720 CFG_OVERLAYFS, 782 CFG_OVERLAYFS,
721 CFG_CHROOT_DESKTOP, 783 CFG_PRIVATE_BIN,
722 CFG_PRIVATE_HOME,
723 CFG_PRIVATE_BIN_NO_LOCAL, 784 CFG_PRIVATE_BIN_NO_LOCAL,
785 CFG_PRIVATE_CACHE,
786 CFG_PRIVATE_ETC,
787 CFG_PRIVATE_HOME,
788 CFG_PRIVATE_LIB,
789 CFG_PRIVATE_OPT,
790 CFG_PRIVATE_SRV,
724 CFG_FIREJAIL_PROMPT, 791 CFG_FIREJAIL_PROMPT,
725 CFG_FOLLOW_SYMLINK_AS_USER,
726 CFG_FOLLOW_SYMLINK_PRIVATE_BIN,
727 CFG_DISABLE_MNT, 792 CFG_DISABLE_MNT,
728 CFG_JOIN, 793 CFG_JOIN,
729 CFG_ARP_PROBES, 794 CFG_ARP_PROBES,
730 CFG_XPRA_ATTACH, 795 CFG_XPRA_ATTACH,
731 CFG_PRIVATE_LIB, 796 CFG_BROWSER_DISABLE_U2F,
797 CFG_BROWSER_ALLOW_DRM,
798 CFG_APPARMOR,
799 CFG_DBUS,
800 CFG_CGROUP,
801 CFG_NAME_CHANGE,
802 CFG_SECCOMP_ERROR_ACTION,
803 // CFG_FILE_COPY_LIMIT - file copy limit handled using setenv/getenv
732 CFG_MAX // this should always be the last entry 804 CFG_MAX // this should always be the last entry
733}; 805};
734extern char *xephyr_screen; 806extern char *xephyr_screen;
@@ -737,31 +809,53 @@ extern char *xpra_extra_params;
737extern char *xvfb_screen; 809extern char *xvfb_screen;
738extern char *xvfb_extra_params; 810extern char *xvfb_extra_params;
739extern char *netfilter_default; 811extern char *netfilter_default;
812extern unsigned long join_timeout;
813extern char *config_seccomp_error_action_str;
814extern char *config_seccomp_filter_add;
815extern char **whitelist_reject_topdirs;
816
740int checkcfg(int val); 817int checkcfg(int val);
741void print_compiletime_support(void); 818void print_compiletime_support(void);
742void x11_xorg(void);
743 819
744// appimage.c 820// appimage.c
821int appimage_find_profile(const char *archive);
745void appimage_set(const char *appimage_path); 822void appimage_set(const char *appimage_path);
823void appimage_mount(void);
746void appimage_clear(void); 824void appimage_clear(void);
747const char *appimage_getdir(void);
748 825
749// appimage_size.c 826// appimage_size.c
750long unsigned int appimage2_size(const char *fname); 827long unsigned int appimage2_size(int fd);
751 828
752// cmdline.c 829// cmdline.c
753void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index); 830void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index, bool want_extra_quotes);
754void build_appimage_cmdline(char **command_line, char **window_title, int argc, char **argv, int index, char *apprun_path); 831void build_appimage_cmdline(char **command_line, char **window_title, int argc, char **argv, int index, bool want_extra_quotes);
755 832
756// sbox.c 833// sbox.c
757// programs 834// programs
758#define PATH_FNET (LIBDIR "/firejail/fnet") 835#define PATH_FNET_MAIN (LIBDIR "/firejail/fnet") // when called from main thread
836#define PATH_FNET (RUN_FIREJAIL_LIB_DIR "/fnet") // when called from sandbox thread
837
838#define PATH_FNETFILTER (RUN_FIREJAIL_LIB_DIR "/fnetfilter")
839
759#define PATH_FIREMON (PREFIX "/bin/firemon") 840#define PATH_FIREMON (PREFIX "/bin/firemon")
760#define PATH_FIREJAIL (PREFIX "/bin/firejail") 841#define PATH_FIREJAIL (PREFIX "/bin/firejail")
761#define PATH_FSECCOMP (LIBDIR "/firejail/fseccomp") 842
762#define PATH_FCOPY (LIBDIR "/firejail/fcopy") 843#define PATH_FSECCOMP_MAIN (LIBDIR "/firejail/fseccomp") // when called from main thread
844#define PATH_FSECCOMP ( RUN_FIREJAIL_LIB_DIR "/fseccomp") // when called from sandbox thread
845
846// FSEC_PRINT is run outside of sandbox by --seccomp.print
847// it is also run from inside the sandbox by --debug; in this case we do an access(filename, X_OK) test first
848#define PATH_FSEC_PRINT (LIBDIR "/firejail/fsec-print")
849
850#define PATH_FSEC_OPTIMIZE (RUN_FIREJAIL_LIB_DIR "/fsec-optimize")
851
852#define PATH_FCOPY (RUN_FIREJAIL_LIB_DIR "/fcopy")
853
763#define SBOX_STDIN_FILE "/run/firejail/mnt/sbox_stdin" 854#define SBOX_STDIN_FILE "/run/firejail/mnt/sbox_stdin"
764#define PATH_FLDD (LIBDIR "/firejail/fldd") 855
856#define PATH_FLDD (RUN_FIREJAIL_LIB_DIR "/fldd")
857
858#define PATH_FIDS (LIBDIR "/firejail/fids")
765 859
766// bitmapped filters for sbox_run 860// bitmapped filters for sbox_run
767#define SBOX_ROOT (1 << 0) // run the sandbox as root 861#define SBOX_ROOT (1 << 0) // run the sandbox as root
@@ -771,13 +865,43 @@ void build_appimage_cmdline(char **command_line, char **window_title, int argc,
771#define SBOX_CAPS_NETWORK (1 << 4) // caps filter for programs running network programs 865#define SBOX_CAPS_NETWORK (1 << 4) // caps filter for programs running network programs
772#define SBOX_ALLOW_STDIN (1 << 5) // don't close stdin 866#define SBOX_ALLOW_STDIN (1 << 5) // don't close stdin
773#define SBOX_STDIN_FROM_FILE (1 << 6) // open file and redirect it to stdin 867#define SBOX_STDIN_FROM_FILE (1 << 6) // open file and redirect it to stdin
868#define SBOX_CAPS_HIDEPID (1 << 7) // hidepid caps filter for running firemon
869#define SBOX_CAPS_NET_SERVICE (1 << 8) // caps filter for programs running network services
870#define SBOX_KEEP_FDS (1 << 9) // keep file descriptors open
871#define FIREJAIL_MAX_FD 20 // getdtablesize() is overkill for a firejail process
774 872
775// run sbox 873// run sbox
776int sbox_run(unsigned filter, int num, ...); 874int sbox_run(unsigned filter, int num, ...);
777 875int sbox_run_v(unsigned filter, char * const arg[]);
778 876void sbox_exec_v(unsigned filter, char * const arg[]) __attribute__((noreturn));
779// git.c 877
780void git_install(); 878// run_files.c
781void git_uninstall(); 879void delete_run_files(pid_t pid);
880void delete_bandwidth_run_file(pid_t pid);
881void set_name_run_file(pid_t pid);
882void set_x11_run_file(pid_t pid, int display);
883void set_profile_run_file(pid_t pid, const char *fname);
884
885// dbus.c
886int dbus_check_name(const char *name);
887int dbus_check_call_rule(const char *name);
888void dbus_check_profile(void);
889void dbus_proxy_start(void);
890void dbus_proxy_stop(void);
891void dbus_set_session_bus_env(void);
892void dbus_set_system_bus_env(void);
893void dbus_apply_policy(void);
894
895// dhcp.c
896extern pid_t dhclient4_pid;
897extern pid_t dhclient6_pid;
898void dhcp_store_exec(void);
899void dhcp_start(void);
900
901// selinux.c
902void selinux_relabel_path(const char *path, const char *inside_path);
903
904// ids.c
905void run_ids(int argc, char **argv);
782 906
783#endif 907#endif
diff --git a/src/firejail/fs.c b/src/firejail/fs.c
index 0a6f40959..dd4c2139d 100644
--- a/src/firejail/fs.c
+++ b/src/firejail/fs.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,7 @@
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/gcov_wrapper.h"
21#include <sys/mount.h> 22#include <sys/mount.h>
22#include <sys/stat.h> 23#include <sys/stat.h>
23#include <sys/statvfs.h> 24#include <sys/statvfs.h>
@@ -26,36 +27,38 @@
26#include <fnmatch.h> 27#include <fnmatch.h>
27#include <glob.h> 28#include <glob.h>
28#include <dirent.h> 29#include <dirent.h>
29#include <fcntl.h>
30#include <errno.h> 30#include <errno.h>
31 31
32static void fs_rdwr(const char *dir); 32#include <fcntl.h>
33#ifndef O_PATH
34#define O_PATH 010000000
35#endif
33 36
37#define MAX_BUF 4096
38#define EMPTY_STRING ("")
39// check noblacklist statements not matched by a proper blacklist in disable-*.inc files
40//#define TEST_NO_BLACKLIST_MATCHING
34 41
35 42
36//*********************************************** 43//***********************************************
37// process profile file 44// process profile file
38//*********************************************** 45//***********************************************
39typedef enum { 46static void fs_remount_rec(const char *dir, OPERATION op);
40 BLACKLIST_FILE, 47
41 BLACKLIST_NOLOG, 48static char *opstr[] = {
42 MOUNT_READONLY, 49 [BLACKLIST_FILE] = "blacklist",
43 MOUNT_TMPFS, 50 [BLACKLIST_NOLOG] = "blacklist-nolog",
44 MOUNT_NOEXEC, 51 [MOUNT_READONLY] = "read-only",
45 MOUNT_RDWR, 52 [MOUNT_TMPFS] = "tmpfs",
46 OPERATION_MAX 53 [MOUNT_NOEXEC] = "noexec",
47} OPERATION; 54 [MOUNT_RDWR] = "read-write",
48 55 [MOUNT_RDWR_NOCHECK] = "read-write",
49typedef enum { 56};
50 UNSUCCESSFUL,
51 SUCCESSFUL
52} LAST_DISABLE_OPERATION;
53LAST_DISABLE_OPERATION last_disable = UNSUCCESSFUL;
54 57
55static void disable_file(OPERATION op, const char *filename) { 58static void disable_file(OPERATION op, const char *filename) {
56 assert(filename); 59 assert(filename);
57 assert(op <OPERATION_MAX); 60 assert(op <OPERATION_MAX);
58 last_disable = UNSUCCESSFUL; 61 EUID_ASSERT();
59 62
60 // Resolve all symlinks 63 // Resolve all symlinks
61 char* fname = realpath(filename, NULL); 64 char* fname = realpath(filename, NULL);
@@ -63,20 +66,24 @@ static void disable_file(OPERATION op, const char *filename) {
63 return; 66 return;
64 } 67 }
65 if (fname == NULL && errno == EACCES) { 68 if (fname == NULL && errno == EACCES) {
66 if (arg_debug) 69 // realpath and stat functions will fail on FUSE filesystems
67 printf("Debug: no access to file %s, forcing mount\n", filename);
68 // realpath and stat funtions will fail on FUSE filesystems
69 // they don't seem to like a uid of 0 70 // they don't seem to like a uid of 0
70 // force mounting 71 // force mounting
71 int rv = mount(RUN_RO_DIR, filename, "none", MS_BIND, "mode=400,gid=0"); 72 int fd = open(filename, O_PATH|O_CLOEXEC);
72 if (rv == 0) 73 if (fd < 0) {
73 last_disable = SUCCESSFUL; 74 if (arg_debug)
74 else { 75 printf("Warning (blacklisting): cannot open %s: %s\n", filename, strerror(errno));
75 rv = mount(RUN_RO_FILE, filename, "none", MS_BIND, "mode=400,gid=0"); 76 return;
76 if (rv == 0)
77 last_disable = SUCCESSFUL;
78 } 77 }
79 if (last_disable == SUCCESSFUL) { 78
79 EUID_ROOT();
80 int err = bind_mount_path_to_fd(RUN_RO_DIR, fd);
81 if (err != 0)
82 err = bind_mount_path_to_fd(RUN_RO_FILE, fd);
83 EUID_USER();
84 close(fd);
85
86 if (err == 0) {
80 if (arg_debug) 87 if (arg_debug)
81 printf("Disable %s\n", filename); 88 printf("Disable %s\n", filename);
82 if (op == BLACKLIST_FILE) 89 if (op == BLACKLIST_FILE)
@@ -84,21 +91,27 @@ static void disable_file(OPERATION op, const char *filename) {
84 else 91 else
85 fs_logger2("blacklist-nolog", filename); 92 fs_logger2("blacklist-nolog", filename);
86 } 93 }
87 else { 94 else if (arg_debug)
88 if (arg_debug) 95 printf("Warning (blacklisting): cannot mount on %s\n", filename);
89 printf("Warning (blacklisting): %s is an invalid file, skipping...\n", filename);
90 }
91 96
92 return; 97 return;
93 } 98 }
94 99
95 // if the file is not present, do nothing 100 // if the file is not present, do nothing
101 assert(fname);
96 struct stat s; 102 struct stat s;
97 if (fname == NULL) 103 if (stat(fname, &s) < 0) {
98 return;
99 if (stat(fname, &s) == -1) {
100 if (arg_debug) 104 if (arg_debug)
101 fwarning("%s does not exist, skipping...\n", fname); 105 printf("Warning (blacklisting): cannot access %s: %s\n", fname, strerror(errno));
106 free(fname);
107 return;
108 }
109
110 // check for firejail executable
111 // we might have a file found in ${PATH} pointing to /usr/bin/firejail
112 // blacklisting it here will end up breaking situations like user clicks on a link in Thunderbird
113 // and expects Firefox to open in the same sandbox
114 if (strcmp(BINDIR "/firejail", fname) == 0) {
102 free(fname); 115 free(fname);
103 return; 116 return;
104 } 117 }
@@ -126,56 +139,70 @@ static void disable_file(OPERATION op, const char *filename) {
126 printf(" - no logging\n"); 139 printf(" - no logging\n");
127 } 140 }
128 141
142 int fd = open(fname, O_PATH|O_CLOEXEC);
143 if (fd < 0) {
144 if (arg_debug)
145 printf("Warning (blacklisting): cannot open %s: %s\n", fname, strerror(errno));
146 free(fname);
147 return;
148 }
149 EUID_ROOT();
129 if (S_ISDIR(s.st_mode)) { 150 if (S_ISDIR(s.st_mode)) {
130 if (mount(RUN_RO_DIR, fname, "none", MS_BIND, "mode=400,gid=0") < 0) 151 if (bind_mount_path_to_fd(RUN_RO_DIR, fd) < 0)
131 errExit("disable file"); 152 errExit("disable file");
132 } 153 }
133 else { 154 else {
134 if (mount(RUN_RO_FILE, fname, "none", MS_BIND, "mode=400,gid=0") < 0) 155 if (bind_mount_path_to_fd(RUN_RO_FILE, fd) < 0)
135 errExit("disable file"); 156 errExit("disable file");
136 } 157 }
137 last_disable = SUCCESSFUL; 158 EUID_USER();
159 close(fd);
160
138 if (op == BLACKLIST_FILE) 161 if (op == BLACKLIST_FILE)
139 fs_logger2("blacklist", fname); 162 fs_logger2("blacklist", fname);
140 else 163 else
141 fs_logger2("blacklist-nolog", fname); 164 fs_logger2("blacklist-nolog", fname);
165
166 // files in /etc will be reprocessed during /etc rebuild
167 if (strncmp(fname, "/etc/", 5) == 0) {
168 ProfileEntry *prf = malloc(sizeof(ProfileEntry));
169 if (!prf)
170 errExit("malloc");
171 memset(prf, 0, sizeof(ProfileEntry));
172 prf->data = strdup(fname);
173 if (!prf->data)
174 errExit("strdup");
175 prf->next = cfg.profile_rebuild_etc;
176 cfg.profile_rebuild_etc = prf;
177 }
142 } 178 }
143 } 179 }
144 else if (op == MOUNT_READONLY) { 180 else if (op == MOUNT_READONLY || op == MOUNT_RDWR || op == MOUNT_NOEXEC) {
145 if (arg_debug) 181 fs_remount_rec(fname, op);
146 printf("Mounting read-only %s\n", fname);
147 fs_rdonly(fname);
148// todo: last_disable = SUCCESSFUL;
149 }
150 else if (op == MOUNT_RDWR) {
151 if (arg_debug)
152 printf("Mounting read-only %s\n", fname);
153 fs_rdwr(fname);
154// todo: last_disable = SUCCESSFUL;
155 }
156 else if (op == MOUNT_NOEXEC) {
157 if (arg_debug)
158 printf("Mounting noexec %s\n", fname);
159 fs_noexec(fname);
160// todo: last_disable = SUCCESSFUL;
161 } 182 }
162 else if (op == MOUNT_TMPFS) { 183 else if (op == MOUNT_TMPFS) {
163 if (S_ISDIR(s.st_mode)) { 184 if (!S_ISDIR(s.st_mode)) {
164 if (arg_debug)
165 printf("Mounting tmpfs on %s\n", fname);
166 // preserve owner and mode for the directory
167 if (mount("tmpfs", fname, "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME | MS_REC, 0) < 0)
168 errExit("mounting tmpfs");
169 /* coverity[toctou] */
170 if (chown(fname, s.st_uid, s.st_gid) == -1)
171 errExit("mounting tmpfs chown");
172 if (chmod(fname, s.st_mode) == -1)
173 errExit("mounting tmpfs chmod");
174 last_disable = SUCCESSFUL;
175 fs_logger2("tmpfs", fname);
176 }
177 else
178 fwarning("%s is not a directory; cannot mount a tmpfs on top of it.\n", fname); 185 fwarning("%s is not a directory; cannot mount a tmpfs on top of it.\n", fname);
186 free(fname);
187 return;
188 }
189
190 uid_t uid = getuid();
191 if (uid != 0) {
192 // only user owned directories in user home
193 if (s.st_uid != uid ||
194 strncmp(cfg.homedir, fname, strlen(cfg.homedir)) != 0 ||
195 fname[strlen(cfg.homedir)] != '/') {
196 fwarning("you are not allowed to mount a tmpfs on %s\n", fname);
197 free(fname);
198 return;
199 }
200 }
201
202 fs_tmpfs(fname, uid);
203 EUID_USER(); // fs_tmpfs returns with EUID 0
204
205 selinux_relabel_path(fname, fname);
179 } 206 }
180 else 207 else
181 assert(0); 208 assert(0);
@@ -183,9 +210,27 @@ static void disable_file(OPERATION op, const char *filename) {
183 free(fname); 210 free(fname);
184} 211}
185 212
213#ifdef TEST_NO_BLACKLIST_MATCHING
214static int nbcheck_start = 0;
215static size_t nbcheck_size = 0;
216static int *nbcheck = NULL;
217#endif
218
186// Treat pattern as a shell glob pattern and blacklist matching files 219// Treat pattern as a shell glob pattern and blacklist matching files
187static void globbing(OPERATION op, const char *pattern, const char *noblacklist[], size_t noblacklist_len) { 220static void globbing(OPERATION op, const char *pattern, const char *noblacklist[], size_t noblacklist_len) {
188 assert(pattern); 221 assert(pattern);
222 EUID_ASSERT();
223
224#ifdef TEST_NO_BLACKLIST_MATCHING
225 if (nbcheck_start == 0) {
226 nbcheck_start = 1;
227 nbcheck_size = noblacklist_len;
228 nbcheck = malloc(sizeof(int) * noblacklist_len);
229 if (nbcheck == NULL)
230 errExit("malloc");
231 memset(nbcheck, 0, sizeof(int) * noblacklist_len);
232 }
233#endif
189 234
190 glob_t globbuf; 235 glob_t globbuf;
191 // Profiles contain blacklists for files that might not exist on a user's machine. 236 // Profiles contain blacklists for files that might not exist on a user's machine.
@@ -206,28 +251,26 @@ static void globbing(OPERATION op, const char *pattern, const char *noblacklist[
206 continue; 251 continue;
207 // noblacklist is expected to be short in normal cases, so stupid and correct brute force is okay 252 // noblacklist is expected to be short in normal cases, so stupid and correct brute force is okay
208 bool okay_to_blacklist = true; 253 bool okay_to_blacklist = true;
209 for (j = 0; j < noblacklist_len; j++) { 254 if (op == BLACKLIST_FILE || op == BLACKLIST_NOLOG) {
210 int result = fnmatch(noblacklist[j], path, FNM_PATHNAME); 255 for (j = 0; j < noblacklist_len; j++) {
211 if (result == FNM_NOMATCH) 256 int result = fnmatch(noblacklist[j], path, FNM_PATHNAME);
212 continue; 257 if (result == FNM_NOMATCH)
213 else if (result == 0) { 258 continue;
214 okay_to_blacklist = false; 259 else if (result == 0) {
215 break; 260 okay_to_blacklist = false;
216 } 261#ifdef TEST_NO_BLACKLIST_MATCHING
217 else { 262 if (j < nbcheck_size) // noblacklist checking
218 fprintf(stderr, "Error: failed to compare path %s with pattern %s\n", path, noblacklist[j]); 263 nbcheck[j] = 1;
219 exit(1); 264#endif
265 break;
266 }
267 else {
268 fprintf(stderr, "Error: failed to compare path %s with pattern %s\n", path, noblacklist[j]);
269 exit(1);
270 }
220 } 271 }
221 } 272 }
222 273
223 // We don't usually need to blacklist things in private home directories
224 if (okay_to_blacklist
225 && cfg.homedir
226 && arg_private
227 && (!arg_allow_private_blacklist)
228 && (strncmp(path, cfg.homedir, strlen(cfg.homedir)) == 0))
229 okay_to_blacklist = false;
230
231 if (okay_to_blacklist) 274 if (okay_to_blacklist)
232 disable_file(op, path); 275 disable_file(op, path);
233 else if (arg_debug) 276 else if (arg_debug)
@@ -239,8 +282,6 @@ static void globbing(OPERATION op, const char *pattern, const char *noblacklist[
239 282
240// blacklist files or directories by mounting empty files on top of them 283// blacklist files or directories by mounting empty files on top of them
241void fs_blacklist(void) { 284void fs_blacklist(void) {
242 char *homedir = cfg.homedir;
243 assert(homedir);
244 ProfileEntry *entry = cfg.profile; 285 ProfileEntry *entry = cfg.profile;
245 if (!entry) 286 if (!entry)
246 return; 287 return;
@@ -252,6 +293,7 @@ void fs_blacklist(void) {
252 if (noblacklist == NULL) 293 if (noblacklist == NULL)
253 errExit("failed allocating memory for noblacklist entries"); 294 errExit("failed allocating memory for noblacklist entries");
254 295
296 EUID_USER();
255 while (entry) { 297 while (entry) {
256 OPERATION op = OPERATION_MAX; 298 OPERATION op = OPERATION_MAX;
257 char *ptr; 299 char *ptr;
@@ -259,6 +301,7 @@ void fs_blacklist(void) {
259 // whitelist commands handled by fs_whitelist() 301 // whitelist commands handled by fs_whitelist()
260 if (strncmp(entry->data, "whitelist ", 10) == 0 || 302 if (strncmp(entry->data, "whitelist ", 10) == 0 ||
261 strncmp(entry->data, "nowhitelist ", 12) == 0 || 303 strncmp(entry->data, "nowhitelist ", 12) == 0 ||
304 strncmp(entry->data, "dbus-", 5) == 0 ||
262 *entry->data == '\0') { 305 *entry->data == '\0') {
263 entry = entry->next; 306 entry = entry->next;
264 continue; 307 continue;
@@ -281,11 +324,13 @@ void fs_blacklist(void) {
281 if (arg_debug) 324 if (arg_debug)
282 printf("Mount-bind %s on top of %s\n", dname1, dname2); 325 printf("Mount-bind %s on top of %s\n", dname1, dname2);
283 // preserve dname2 mode and ownership 326 // preserve dname2 mode and ownership
327 // EUID_ROOT(); - option not accessible to non-root users
284 if (mount(dname1, dname2, NULL, MS_BIND|MS_REC, NULL) < 0) 328 if (mount(dname1, dname2, NULL, MS_BIND|MS_REC, NULL) < 0)
285 errExit("mount bind"); 329 errExit("mount bind");
286 /* coverity[toctou] */ 330 /* coverity[toctou] */
287 if (set_perms(dname2, s.st_uid, s.st_gid,s.st_mode)) 331 if (set_perms(dname2, s.st_uid, s.st_gid,s.st_mode))
288 errExit("set_perms"); 332 errExit("set_perms");
333 // EUID_USER();
289 334
290 entry = entry->next; 335 entry = entry->next;
291 continue; 336 continue;
@@ -317,7 +362,7 @@ void fs_blacklist(void) {
317 enames = calloc(2, sizeof(char *)); 362 enames = calloc(2, sizeof(char *));
318 if (!enames) 363 if (!enames)
319 errExit("calloc"); 364 errExit("calloc");
320 enames[0] = expand_home(entry->data + 12, homedir); 365 enames[0] = expand_macros(entry->data + 12);
321 assert(enames[1] == 0); 366 assert(enames[1] == 0);
322 } 367 }
323 368
@@ -363,16 +408,12 @@ void fs_blacklist(void) {
363 op = MOUNT_TMPFS; 408 op = MOUNT_TMPFS;
364 } 409 }
365 else if (strncmp(entry->data, "mkdir ", 6) == 0) { 410 else if (strncmp(entry->data, "mkdir ", 6) == 0) {
366 EUID_USER();
367 fs_mkdir(entry->data + 6); 411 fs_mkdir(entry->data + 6);
368 EUID_ROOT();
369 entry = entry->next; 412 entry = entry->next;
370 continue; 413 continue;
371 } 414 }
372 else if (strncmp(entry->data, "mkfile ", 7) == 0) { 415 else if (strncmp(entry->data, "mkfile ", 7) == 0) {
373 EUID_USER();
374 fs_mkfile(entry->data + 7); 416 fs_mkfile(entry->data + 7);
375 EUID_ROOT();
376 entry = entry->next; 417 entry = entry->next;
377 continue; 418 continue;
378 } 419 }
@@ -383,7 +424,7 @@ void fs_blacklist(void) {
383 } 424 }
384 425
385 // replace home macro in blacklist array 426 // replace home macro in blacklist array
386 char *new_name = expand_home(ptr, homedir); 427 char *new_name = expand_macros(ptr);
387 ptr = new_name; 428 ptr = new_name;
388 429
389 // expand path macro - look for the file in /usr/local/bin, /usr/local/sbin, /bin, /usr/bin, /sbin and /usr/sbin directories 430 // expand path macro - look for the file in /usr/local/bin, /usr/local/sbin, /bin, /usr/bin, /sbin and /usr/sbin directories
@@ -411,133 +452,305 @@ void fs_blacklist(void) {
411 } 452 }
412 453
413 size_t i; 454 size_t i;
414 for (i = 0; i < noblacklist_c; i++) free(noblacklist[i]); 455#ifdef TEST_NO_BLACKLIST_MATCHING
415 free(noblacklist); 456 // noblacklist checking
416} 457 for (i = 0; i < nbcheck_size; i++)
417 458 if (!arg_quiet && !nbcheck[i])
418static int get_mount_flags(const char *path, unsigned long *flags) { 459 printf("TESTING warning: noblacklist %s not matched by a proper blacklist command in disable*.inc\n",
419 struct statvfs buf; 460 noblacklist[i]);
461
462 // free memory
463 if (nbcheck) {
464 free(nbcheck);
465 nbcheck = NULL;
466 nbcheck_size = 0;
467 }
468#endif
469 for (i = 0; i < noblacklist_c; i++)
470 free(noblacklist[i]);
471 free(noblacklist);
420 472
421 if (statvfs(path, &buf) < 0) 473 EUID_ROOT();
422 return -errno;
423 *flags = buf.f_flag;
424 return 0;
425} 474}
426 475
427//*********************************************** 476//***********************************************
428// mount namespace 477// mount namespace
429//*********************************************** 478//***********************************************
430 479
431// remount a directory read-only 480// mount a writable tmpfs on directory; requires a resolved path
432void fs_rdonly(const char *dir) { 481void fs_tmpfs(const char *dir, unsigned check_owner) {
482 EUID_USER();
433 assert(dir); 483 assert(dir);
434 // check directory exists 484 if (arg_debug)
485 printf("Mounting tmpfs on %s, check owner: %s\n", dir, (check_owner)? "yes": "no");
486 // get a file descriptor for dir, fails if there is any symlink
487 int fd = safer_openat(-1, dir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
488 if (fd == -1)
489 errExit("while opening directory");
435 struct stat s; 490 struct stat s;
436 int rv = stat(dir, &s); 491 if (fstat(fd, &s) == -1)
437 if (rv == 0) { 492 errExit("fstat");
438 unsigned long flags = 0; 493 if (check_owner && s.st_uid != getuid()) {
439 get_mount_flags(dir, &flags); 494 fprintf(stderr, "Error: cannot mount tmpfs on %s: not owned by the current user\n", dir);
440 if ((flags & MS_RDONLY) == MS_RDONLY) 495 exit(1);
441 return;
442 flags |= MS_RDONLY;
443 // mount --bind /bin /bin
444 // mount --bind -o remount,ro /bin
445 if (mount(dir, dir, NULL, MS_BIND|MS_REC, NULL) < 0 ||
446 mount(NULL, dir, NULL, flags|MS_BIND|MS_REMOUNT|MS_REC, NULL) < 0)
447 errExit("mount read-only");
448 fs_logger2("read-only", dir);
449 } 496 }
497 // preserve ownership, mode
498 char *options;
499 if (asprintf(&options, "mode=%o,uid=%u,gid=%u", s.st_mode & 07777, s.st_uid, s.st_gid) == -1)
500 errExit("asprintf");
501 // preserve mount flags, but remove read-only flag
502 struct statvfs buf;
503 if (fstatvfs(fd, &buf) == -1)
504 errExit("fstatvfs");
505 unsigned long flags = buf.f_flag & ~(MS_RDONLY|MS_BIND|MS_REMOUNT);
506 // mount via the symbolic link in /proc/self/fd
507 EUID_ROOT();
508 char *proc;
509 if (asprintf(&proc, "/proc/self/fd/%d", fd) == -1)
510 errExit("asprintf");
511 if (mount("tmpfs", proc, "tmpfs", flags|MS_NOSUID|MS_NODEV, options) < 0)
512 errExit("mounting tmpfs");
513 // check the last mount operation
514 MountData *mdata = get_last_mount();
515 if (strcmp(mdata->fstype, "tmpfs") != 0 || strcmp(mdata->dir, dir) != 0)
516 errLogExit("invalid tmpfs mount");
517 fs_logger2("tmpfs", dir);
518 free(options);
519 free(proc);
520 close(fd);
450} 521}
451 522
452static void fs_rdwr(const char *dir) { 523// remount path, preserving other mount flags; requires a resolved path
453 assert(dir); 524static void fs_remount_simple(const char *path, OPERATION op) {
454 // check directory exists 525 EUID_ASSERT();
526 assert(path);
527
528 // open path without following symbolic links
529 int fd = safer_openat(-1, path, O_PATH|O_NOFOLLOW|O_CLOEXEC);
530 if (fd < 0)
531 goto out;
532
455 struct stat s; 533 struct stat s;
456 int rv = stat(dir, &s); 534 if (fstat(fd, &s) < 0) {
457 if (rv == 0) { 535 // fstat can fail with EACCES if path is a FUSE mount,
458 // if the file is outside /home directory, allow only root user 536 // mounted without 'allow_root' or 'allow_other'
459 uid_t u = getuid(); 537 if (errno != EACCES)
460 if (u != 0 && s.st_uid != u) { 538 errExit("fstat");
461 fwarning("you are not allowed to change %s to read-write\n", dir); 539 close(fd);
540 goto out;
541 }
542 // get mount flags
543 struct statvfs buf;
544 if (fstatvfs(fd, &buf) < 0) {
545 close(fd);
546 goto out;
547 }
548 unsigned long flags = buf.f_flag;
549
550 // read-write option
551 if (op == MOUNT_RDWR || op == MOUNT_RDWR_NOCHECK) {
552 // nothing to do if there is no read-only flag
553 if ((flags & MS_RDONLY) == 0) {
554 close(fd);
462 return; 555 return;
463 } 556 }
464 557 // allow only user owned directories, except the user is root
465 // mount --bind /bin /bin 558 if (op != MOUNT_RDWR_NOCHECK && getuid() != 0 && s.st_uid != getuid()) {
466 // mount --bind -o remount,rw /bin 559 fwarning("you are not allowed to change %s to read-write\n", path);
467 unsigned long flags = 0; 560 close(fd);
468 get_mount_flags(dir, &flags);
469 if ((flags & MS_RDONLY) == 0)
470 return; 561 return;
562 }
471 flags &= ~MS_RDONLY; 563 flags &= ~MS_RDONLY;
472 if (mount(dir, dir, NULL, MS_BIND|MS_REC, NULL) < 0 ||
473 mount(NULL, dir, NULL, flags|MS_BIND|MS_REMOUNT|MS_REC, NULL) < 0)
474 errExit("mount read-write");
475 fs_logger2("read-write", dir);
476 } 564 }
565 // noexec option
566 else if (op == MOUNT_NOEXEC) {
567 // nothing to do if path is mounted noexec already
568 if ((flags & (MS_NOEXEC|MS_NODEV|MS_NOSUID)) == (MS_NOEXEC|MS_NODEV|MS_NOSUID)) {
569 close(fd);
570 return;
571 }
572 flags |= MS_NOEXEC|MS_NODEV|MS_NOSUID;
573 }
574 // read-only option
575 else if (op == MOUNT_READONLY) {
576 // nothing to do if path is mounted read-only already
577 if ((flags & MS_RDONLY) == MS_RDONLY) {
578 close(fd);
579 return;
580 }
581 flags |= MS_RDONLY;
582 }
583 else
584 assert(0);
585
586 if (arg_debug)
587 printf("Mounting %s %s\n", opstr[op], path);
588
589 // make path a mount point:
590 // mount --bind path path
591 EUID_ROOT();
592 int err = bind_mount_by_fd(fd, fd);
593 EUID_USER();
594 if (err) {
595 close(fd);
596 goto out;
597 }
598
599 // remount the mount point
600 // need to open path again
601 int fd2 = safer_openat(-1, path, O_PATH|O_NOFOLLOW|O_CLOEXEC);
602 close(fd); // earliest timepoint to close fd
603 if (fd2 < 0)
604 goto out;
605
606 // device and inode number should be the same
607 struct stat s2;
608 if (fstat(fd2, &s2) < 0)
609 errExit("fstat");
610 if (s.st_dev != s2.st_dev || s.st_ino != s2.st_ino)
611 errLogExit("invalid %s mount", opstr[op]);
612
613 EUID_ROOT();
614 err = remount_by_fd(fd2, flags);
615 EUID_USER();
616 close(fd2);
617 if (err)
618 goto out;
619
620 // run a sanity check on /proc/self/mountinfo and confirm that target of the last
621 // mount operation was path; if there are other mount points contained inside path,
622 // one of those will show up as target of the last mount operation instead
623 MountData *mptr = get_last_mount();
624 size_t len = strlen(path);
625 if ((strncmp(mptr->dir, path, len) != 0 ||
626 (*(mptr->dir + len) != '\0' && *(mptr->dir + len) != '/'))
627 && strcmp(path, "/") != 0) // support read-only=/
628 errLogExit("invalid %s mount", opstr[op]);
629
630 fs_logger2(opstr[op], path);
631 return;
632
633out:
634 fwarning("not remounting %s\n", path);
477} 635}
478 636
479void fs_noexec(const char *dir) { 637// remount recursively; requires a resolved path
638static void fs_remount_rec(const char *dir, OPERATION op) {
639 EUID_ASSERT();
480 assert(dir); 640 assert(dir);
481 // check directory exists 641
482 struct stat s; 642 struct stat s;
483 int rv = stat(dir, &s); 643 if (stat(dir, &s) != 0)
484 if (rv == 0) { 644 return;
485 // mount --bind /bin /bin 645 if (!S_ISDIR(s.st_mode)) {
486 // mount --bind -o remount,ro /bin 646 // no need to search in /proc/self/mountinfo for submounts if not a directory
487 unsigned long flags = 0; 647 fs_remount_simple(dir, op);
488 get_mount_flags(dir, &flags); 648 return;
489 if ((flags & (MS_NOEXEC|MS_NODEV|MS_NOSUID)) == (MS_NOEXEC|MS_NODEV|MS_NOSUID)) 649 }
490 return; 650 // get mount point of the directory
491 flags |= MS_NOEXEC|MS_NODEV|MS_NOSUID; 651 int mountid = get_mount_id(dir);
492 if (mount(dir, dir, NULL, MS_BIND|MS_REC, NULL) < 0 || 652 if (mountid == -1)
493 mount(NULL, dir, NULL, flags|MS_BIND|MS_REMOUNT|MS_REC, NULL) < 0) 653 return;
494 errExit("mount noexec"); 654 if (mountid == -2) {
495 fs_logger2("noexec", dir); 655 // falling back to a simple remount on old kernels
656 static int mount_warning = 0;
657 if (!mount_warning) {
658 fwarning("read-only, read-write and noexec options are not applied recursively\n");
659 mount_warning = 1;
660 }
661 fs_remount_simple(dir, op);
662 return;
663 }
664 // build array with all mount points that need to get remounted
665 char **arr = build_mount_array(mountid, dir);
666 assert(arr);
667 // remount
668 char **tmp = arr;
669 while (*tmp) {
670 fs_remount_simple(*tmp, op);
671 free(*tmp++);
672 }
673 free(arr);
674}
675
676// resolve a path and remount it
677void fs_remount(const char *path, OPERATION op, int rec) {
678 assert(path);
679
680 int called_as_root = 0;
681 if (geteuid() == 0)
682 called_as_root = 1;
683
684 if (called_as_root)
685 EUID_USER();
686
687 char *rpath = realpath(path, NULL);
688 if (rpath) {
689 if (rec)
690 fs_remount_rec(rpath, op);
691 else
692 fs_remount_simple(rpath, op);
693 free(rpath);
496 } 694 }
695
696 if (called_as_root)
697 EUID_ROOT();
497} 698}
498 699
499// Disable /mnt, /media, /run/mount and /run/media access 700// Disable /mnt, /media, /run/mount and /run/media access
500void fs_mnt(void) { 701void fs_mnt(const int enforce) {
501 disable_file(BLACKLIST_FILE, "/mnt"); 702 EUID_USER();
502 disable_file(BLACKLIST_FILE, "/media"); 703 if (enforce) {
503 disable_file(BLACKLIST_FILE, "/run/mount"); 704 // disable-mnt set in firejail.config
504 disable_file(BLACKLIST_FILE, "//run/media"); 705 // overriding with noblacklist is not possible in this case
706 disable_file(BLACKLIST_FILE, "/mnt");
707 disable_file(BLACKLIST_FILE, "/media");
708 disable_file(BLACKLIST_FILE, "/run/mount");
709 disable_file(BLACKLIST_FILE, "/run/media");
710 }
711 else {
712 profile_add("blacklist /mnt");
713 profile_add("blacklist /media");
714 profile_add("blacklist /run/mount");
715 profile_add("blacklist /run/media");
716 }
717 EUID_ROOT();
505} 718}
506 719
507 720
508// mount /proc and /sys directories 721// mount /proc and /sys directories
509void fs_proc_sys_dev_boot(void) { 722void fs_proc_sys_dev_boot(void) {
510 if (arg_debug)
511 printf("Remounting /proc and /proc/sys filesystems\n");
512 if (mount("proc", "/proc", "proc", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0)
513 errExit("mounting /proc");
514 fs_logger("remount /proc");
515 723
516 // remount /proc/sys readonly 724 // remount /proc/sys readonly
725 if (arg_debug)
726 printf("Mounting read-only /proc/sys\n");
517 if (mount("/proc/sys", "/proc/sys", NULL, MS_BIND | MS_REC, NULL) < 0 || 727 if (mount("/proc/sys", "/proc/sys", NULL, MS_BIND | MS_REC, NULL) < 0 ||
518 mount(NULL, "/proc/sys", NULL, MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0) 728 mount(NULL, "/proc/sys", NULL, MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0)
519 errExit("mounting /proc/sys"); 729 errExit("mounting /proc/sys");
520 fs_logger("read-only /proc/sys"); 730 fs_logger("read-only /proc/sys");
521 731
522
523 /* Mount a version of /sys that describes the network namespace */ 732 /* Mount a version of /sys that describes the network namespace */
524 if (arg_debug) 733 if (arg_debug)
525 printf("Remounting /sys directory\n"); 734 printf("Remounting /sys directory\n");
526 if (umount2("/sys", MNT_DETACH) < 0) 735 // sysfs not yet mounted in overlays, so don't try to unmount it
527 fwarning("failed to unmount /sys\n"); 736 // expect that unmounting /sys fails in a chroot, no need to print a warning in that case
737 if (!arg_overlay) {
738 if (umount2("/sys", MNT_DETACH) < 0 && !cfg.chrootdir)
739 fwarning("failed to unmount /sys\n");
740 }
528 if (mount("sysfs", "/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REC, NULL) < 0) 741 if (mount("sysfs", "/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REC, NULL) < 0)
529 fwarning("failed to mount /sys\n"); 742 fwarning("failed to mount /sys\n");
530 else 743 else
531 fs_logger("remount /sys"); 744 fs_logger("remount /sys");
532 745
746 EUID_USER();
747
533 disable_file(BLACKLIST_FILE, "/sys/firmware"); 748 disable_file(BLACKLIST_FILE, "/sys/firmware");
534 disable_file(BLACKLIST_FILE, "/sys/hypervisor"); 749 disable_file(BLACKLIST_FILE, "/sys/hypervisor");
535 { // allow user access to /sys/fs if "--noblacklist=/sys/fs" is present on the command line 750 { // allow user access to some directories in /sys/ by specifying 'noblacklist' option
536 EUID_USER();
537 profile_add("blacklist /sys/fs"); 751 profile_add("blacklist /sys/fs");
538 EUID_ROOT(); 752 profile_add("blacklist /sys/module");
539 } 753 }
540 disable_file(BLACKLIST_FILE, "/sys/module");
541 disable_file(BLACKLIST_FILE, "/sys/power"); 754 disable_file(BLACKLIST_FILE, "/sys/power");
542 disable_file(BLACKLIST_FILE, "/sys/kernel/debug"); 755 disable_file(BLACKLIST_FILE, "/sys/kernel/debug");
543 disable_file(BLACKLIST_FILE, "/sys/kernel/vmcoreinfo"); 756 disable_file(BLACKLIST_FILE, "/sys/kernel/vmcoreinfo");
@@ -556,7 +769,8 @@ void fs_proc_sys_dev_boot(void) {
556 // various /proc files 769 // various /proc files
557 disable_file(BLACKLIST_FILE, "/proc/irq"); 770 disable_file(BLACKLIST_FILE, "/proc/irq");
558 disable_file(BLACKLIST_FILE, "/proc/bus"); 771 disable_file(BLACKLIST_FILE, "/proc/bus");
559 disable_file(BLACKLIST_FILE, "/proc/config.gz"); 772 // move /proc/config.gz to disable-common.inc
773 //disable_file(BLACKLIST_FILE, "/proc/config.gz");
560 disable_file(BLACKLIST_FILE, "/proc/sched_debug"); 774 disable_file(BLACKLIST_FILE, "/proc/sched_debug");
561 disable_file(BLACKLIST_FILE, "/proc/timer_list"); 775 disable_file(BLACKLIST_FILE, "/proc/timer_list");
562 disable_file(BLACKLIST_FILE, "/proc/timer_stats"); 776 disable_file(BLACKLIST_FILE, "/proc/timer_stats");
@@ -579,12 +793,8 @@ void fs_proc_sys_dev_boot(void) {
579 // disable /dev/port 793 // disable /dev/port
580 disable_file(BLACKLIST_FILE, "/dev/port"); 794 disable_file(BLACKLIST_FILE, "/dev/port");
581 795
582
583
584 // disable various ipc sockets in /run/user 796 // disable various ipc sockets in /run/user
585 if (!arg_writable_run_user) { 797 if (!arg_writable_run_user) {
586 struct stat s;
587
588 char *fname; 798 char *fname;
589 if (asprintf(&fname, "/run/user/%d", getuid()) == -1) 799 if (asprintf(&fname, "/run/user/%d", getuid()) == -1)
590 errExit("asprintf"); 800 errExit("asprintf");
@@ -593,20 +803,18 @@ void fs_proc_sys_dev_boot(void) {
593 char *fnamegpg; 803 char *fnamegpg;
594 if (asprintf(&fnamegpg, "/run/user/%d/gnupg", getuid()) == -1) 804 if (asprintf(&fnamegpg, "/run/user/%d/gnupg", getuid()) == -1)
595 errExit("asprintf"); 805 errExit("asprintf");
596 if (stat(fnamegpg, &s) == -1) 806 if (create_empty_dir_as_user(fnamegpg, 0700))
597 mkdir_attr(fnamegpg, 0700, getuid(), getgid()); 807 fs_logger2("create", fnamegpg);
598 if (stat(fnamegpg, &s) == 0) 808 disable_file(BLACKLIST_FILE, fnamegpg);
599 disable_file(BLACKLIST_FILE, fnamegpg);
600 free(fnamegpg); 809 free(fnamegpg);
601 810
602 // disable /run/user/{uid}/systemd 811 // disable /run/user/{uid}/systemd
603 char *fnamesysd; 812 char *fnamesysd;
604 if (asprintf(&fnamesysd, "/run/user/%d/systemd", getuid()) == -1) 813 if (asprintf(&fnamesysd, "/run/user/%d/systemd", getuid()) == -1)
605 errExit("asprintf"); 814 errExit("asprintf");
606 if (stat(fnamesysd, &s) == -1) 815 if (create_empty_dir_as_user(fnamesysd, 0755))
607 mkdir_attr(fnamesysd, 0755, getuid(), getgid()); 816 fs_logger2("create", fnamesysd);
608 if (stat(fnamesysd, &s) == 0) 817 disable_file(BLACKLIST_FILE, fnamesysd);
609 disable_file(BLACKLIST_FILE, fnamesysd);
610 free(fnamesysd); 818 free(fnamesysd);
611 } 819 }
612 free(fname); 820 free(fname);
@@ -617,28 +825,26 @@ void fs_proc_sys_dev_boot(void) {
617 disable_file(BLACKLIST_FILE, "/dev/kmsg"); 825 disable_file(BLACKLIST_FILE, "/dev/kmsg");
618 disable_file(BLACKLIST_FILE, "/proc/kmsg"); 826 disable_file(BLACKLIST_FILE, "/proc/kmsg");
619 } 827 }
620}
621 828
622// disable firejail configuration in /etc/firejail and in ~/.config/firejail 829 EUID_ROOT();
623static void disable_config(void) { 830}
624 struct stat s;
625 831
832// disable firejail configuration in ~/.config/firejail
833void disable_config(void) {
834 EUID_USER();
626 char *fname; 835 char *fname;
627 if (asprintf(&fname, "%s/.config/firejail", cfg.homedir) == -1) 836 if (asprintf(&fname, "%s/.config/firejail", cfg.homedir) == -1)
628 errExit("asprintf"); 837 errExit("asprintf");
629 if (stat(fname, &s) == 0) 838 disable_file(BLACKLIST_FILE, fname);
630 disable_file(BLACKLIST_FILE, fname);
631 free(fname); 839 free(fname);
632 840
633 // disable run time information 841 // disable run time information
634 if (stat(RUN_FIREJAIL_NETWORK_DIR, &s) == 0) 842 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_NETWORK_DIR);
635 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_NETWORK_DIR); 843 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_BANDWIDTH_DIR);
636 if (stat(RUN_FIREJAIL_BANDWIDTH_DIR, &s) == 0) 844 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_NAME_DIR);
637 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_BANDWIDTH_DIR); 845 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_PROFILE_DIR);
638 if (stat(RUN_FIREJAIL_NAME_DIR, &s) == 0) 846 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_X11_DIR);
639 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_NAME_DIR); 847 EUID_ROOT();
640 if (stat(RUN_FIREJAIL_X11_DIR, &s) == 0)
641 disable_file(BLACKLIST_FILE, RUN_FIREJAIL_X11_DIR);
642} 848}
643 849
644 850
@@ -646,36 +852,42 @@ static void disable_config(void) {
646void fs_basic_fs(void) { 852void fs_basic_fs(void) {
647 uid_t uid = getuid(); 853 uid_t uid = getuid();
648 854
855 // mount a new proc filesystem
856 if (arg_debug)
857 printf("Mounting /proc filesystem representing the PID namespace\n");
858 if (mount("proc", "/proc", "proc", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0)
859 errExit("mounting /proc");
860
861 EUID_USER();
649 if (arg_debug) 862 if (arg_debug)
650 printf("Mounting read-only /bin, /sbin, /lib, /lib32, /lib64, /usr"); 863 printf("Basic read-only filesystem:\n");
651 if (!arg_writable_etc) { 864 if (!arg_writable_etc) {
652 fs_rdonly("/etc"); 865 fs_remount("/etc", MOUNT_READONLY, 1);
653 if (uid) 866 if (uid)
654 fs_noexec("/etc"); 867 fs_remount("/etc", MOUNT_NOEXEC, 1);
655 if (arg_debug) printf(", /etc");
656 } 868 }
657 if (!arg_writable_var) { 869 if (!arg_writable_var) {
658 fs_rdonly("/var"); 870 fs_remount("/var", MOUNT_READONLY, 1);
659 if (uid) 871 if (uid)
660 fs_noexec("/var"); 872 fs_remount("/var", MOUNT_NOEXEC, 1);
661 if (arg_debug) printf(", /var");
662 } 873 }
663 if (arg_debug) printf("\n"); 874 fs_remount("/usr", MOUNT_READONLY, 1);
664 fs_rdonly("/bin"); 875 fs_remount("/bin", MOUNT_READONLY, 1);
665 fs_rdonly("/sbin"); 876 fs_remount("/sbin", MOUNT_READONLY, 1);
666 fs_rdonly("/lib"); 877 fs_remount("/lib", MOUNT_READONLY, 1);
667 fs_rdonly("/lib64"); 878 fs_remount("/lib64", MOUNT_READONLY, 1);
668 fs_rdonly("/lib32"); 879 fs_remount("/lib32", MOUNT_READONLY, 1);
669 fs_rdonly("/libx32"); 880 fs_remount("/libx32", MOUNT_READONLY, 1);
670 fs_rdonly("/usr"); 881 EUID_ROOT();
671 882
672 // update /var directory in order to support multiple sandboxes running on the same root directory 883 // update /var directory in order to support multiple sandboxes running on the same root directory
673 fs_var_lock(); 884 fs_var_lock();
674 fs_var_tmp(); 885 if (!arg_keep_var_tmp)
886 fs_var_tmp();
675 if (!arg_writable_var_log) 887 if (!arg_writable_var_log)
676 fs_var_log(); 888 fs_var_log();
677 else 889 else
678 fs_rdwr("/var/log"); 890 fs_remount("/var/log", MOUNT_RDWR_NOCHECK, 0);
679 891
680 fs_var_lib(); 892 fs_var_lib();
681 fs_var_cache(); 893 fs_var_cache();
@@ -686,8 +898,6 @@ void fs_basic_fs(void) {
686 restrict_users(); 898 restrict_users();
687 899
688 // when starting as root, firejail config is not disabled; 900 // when starting as root, firejail config is not disabled;
689 // this mode could be used to install and test new software by chaining
690 // firejail sandboxes (firejail --force)
691 if (uid) 901 if (uid)
692 disable_config(); 902 disable_config();
693} 903}
@@ -696,57 +906,54 @@ void fs_basic_fs(void) {
696 906
697#ifdef HAVE_OVERLAYFS 907#ifdef HAVE_OVERLAYFS
698char *fs_check_overlay_dir(const char *subdirname, int allow_reuse) { 908char *fs_check_overlay_dir(const char *subdirname, int allow_reuse) {
909 assert(subdirname);
910 EUID_ASSERT();
699 struct stat s; 911 struct stat s;
700 char *dirname; 912 char *dirname;
701 913
702 // create ~/.firejail directory
703 if (asprintf(&dirname, "%s/.firejail", cfg.homedir) == -1) 914 if (asprintf(&dirname, "%s/.firejail", cfg.homedir) == -1)
704 errExit("asprintf"); 915 errExit("asprintf");
705 916 // check if ~/.firejail already exists
706 if (is_link(dirname)) { 917 if (lstat(dirname, &s) == 0) {
707 fprintf(stderr, "Error: invalid ~/.firejail directory\n"); 918 if (!S_ISDIR(s.st_mode)) {
708 exit(1); 919 if (S_ISLNK(s.st_mode))
709 } 920 fprintf(stderr, "Error: %s is a symbolic link\n", dirname);
710 if (stat(dirname, &s) == -1) { 921 else
711 // create directory 922 fprintf(stderr, "Error: %s is not a directory\n", dirname);
712 pid_t child = fork(); 923 exit(1);
713 if (child < 0)
714 errExit("fork");
715 if (child == 0) {
716 // drop privileges
717 drop_privs(0);
718
719 // create directory
720 if (mkdir(dirname, 0700))
721 errExit("mkdir");
722 if (chmod(dirname, 0700) == -1)
723 errExit("chmod");
724 ASSERT_PERMS(dirname, getuid(), getgid(), 0700);
725 _exit(0);
726 } 924 }
727 // wait for the child to finish 925 if (s.st_uid != getuid()) {
728 waitpid(child, NULL, 0); 926 fprintf(stderr, "Error: %s is not owned by the current user\n", dirname);
729 if (stat(dirname, &s) == -1) {
730 fprintf(stderr, "Error: cannot create ~/.firejail directory\n");
731 exit(1); 927 exit(1);
732 } 928 }
733 } 929 }
734 else if (s.st_uid != getuid()) { 930 else {
735 fprintf(stderr, "Error: invalid ~/.firejail directory\n"); 931 // create ~/.firejail directory
736 exit(1); 932 create_empty_dir_as_user(dirname, 0700);
933 if (stat(dirname, &s) == -1) {
934 fprintf(stderr, "Error: cannot create directory %s\n", dirname);
935 exit(1);
936 }
737 } 937 }
738 free(dirname); 938 free(dirname);
739 939
740 // check overlay directory 940 // check overlay directory
741 if (asprintf(&dirname, "%s/.firejail/%s", cfg.homedir, subdirname) == -1) 941 if (asprintf(&dirname, "%s/.firejail/%s", cfg.homedir, subdirname) == -1)
742 errExit("asprintf"); 942 errExit("asprintf");
743 if (is_link(dirname)) { 943 if (lstat(dirname, &s) == 0) {
744 fprintf(stderr, "Error: overlay directory is a symbolic link\n"); 944 if (!S_ISDIR(s.st_mode)) {
745 exit(1); 945 if (S_ISLNK(s.st_mode))
746 } 946 fprintf(stderr, "Error: %s is a symbolic link\n", dirname);
747 if (allow_reuse == 0) { 947 else
748 if (stat(dirname, &s) == 0) { 948 fprintf(stderr, "Error: %s is not a directory\n", dirname);
749 fprintf(stderr, "Error: overlay directory already exists: %s\n", dirname); 949 exit(1);
950 }
951 if (s.st_uid != 0) {
952 fprintf(stderr, "Error: overlay directory %s is not owned by the root user\n", dirname);
953 exit(1);
954 }
955 if (allow_reuse == 0) {
956 fprintf(stderr, "Error: overlay directory exists, but reuse is not allowed\n");
750 exit(1); 957 exit(1);
751 } 958 }
752 } 959 }
@@ -783,9 +990,11 @@ char *fs_check_overlay_dir(const char *subdirname, int allow_reuse) {
783// # umount /root/overlay/root 990// # umount /root/overlay/root
784 991
785 992
786// to do: fix the code below; also, it might work without /dev; impose seccomp/caps filters when not root 993// to do: fix the code below; also, it might work without /dev, but consider keeping /dev/shm; add locking mechanism for overlay-clean
787#include <sys/utsname.h> 994#include <sys/utsname.h>
788void fs_overlayfs(void) { 995void fs_overlayfs(void) {
996 struct stat s;
997
789 // check kernel version 998 // check kernel version
790 struct utsname u; 999 struct utsname u;
791 int rv = uname(&u); 1000 int rv = uname(&u);
@@ -808,54 +1017,88 @@ void fs_overlayfs(void) {
808 if (major == 3 && minor < 18) 1017 if (major == 3 && minor < 18)
809 oldkernel = 1; 1018 oldkernel = 1;
810 1019
811 char *oroot; 1020 // mounting an overlayfs on top of / seems to be broken for kernels > 4.19
812 if(asprintf(&oroot, "%s/oroot", RUN_MNT_DIR) == -1) 1021 // we disable overlayfs for now, pending fixing
813 errExit("asprintf"); 1022 if (major >= 4 &&minor >= 19) {
1023 fprintf(stderr, "Error: OverlayFS disabled for Linux kernels 4.19 and newer, pending fixing.\n");
1024 exit(1);
1025 }
1026
1027 char *oroot = RUN_OVERLAY_ROOT;
814 mkdir_attr(oroot, 0755, 0, 0); 1028 mkdir_attr(oroot, 0755, 0, 0);
815 1029
816 struct stat s; 1030 // set base for working and diff directories
817 char *basedir = RUN_MNT_DIR; 1031 char *basedir = RUN_MNT_DIR;
1032 int basefd = -1;
1033
818 if (arg_overlay_keep) { 1034 if (arg_overlay_keep) {
819 // set base for working and diff directories
820 basedir = cfg.overlay_dir; 1035 basedir = cfg.overlay_dir;
821 1036 assert(basedir);
822 // does the overlay exist? 1037 // get a file descriptor for ~/.firejail, fails if there is any symlink
823 if (stat(basedir, &s) == 0) { 1038 char *firejail;
824 if (arg_overlay_reuse == 0) { 1039 if (asprintf(&firejail, "%s/.firejail", cfg.homedir) == -1)
825 fprintf(stderr, "Error: overlay directory exists, but reuse is not allowed\n"); 1040 errExit("asprintf");
826 exit(1); 1041 int fd = safer_openat(-1, firejail, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
827 } 1042 if (fd == -1)
828 } 1043 errExit("safer_openat");
829 else { 1044 free(firejail);
830 /* coverity[toctou] */ 1045 // create basedir if it doesn't exist
831 if (mkdir(basedir, 0755) != 0) { 1046 // the new directory will be owned by root
832 fprintf(stderr, "Error: cannot create overlay directory\n"); 1047 const char *dirname = gnu_basename(basedir);
833 exit(1); 1048 if (mkdirat(fd, dirname, 0755) == -1 && errno != EEXIST) {
834 } 1049 perror("mkdir");
1050 fprintf(stderr, "Error: cannot create overlay directory %s\n", basedir);
1051 exit(1);
835 } 1052 }
1053 // open basedir
1054 basefd = openat(fd, dirname, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
1055 close(fd);
1056 }
1057 else {
1058 basefd = open(basedir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
1059 }
1060 if (basefd == -1) {
1061 perror("open");
1062 fprintf(stderr, "Error: cannot open overlay directory %s\n", basedir);
1063 exit(1);
836 } 1064 }
837 1065
838 char *odiff; 1066 // confirm once more base is owned by root
839 if(asprintf(&odiff, "%s/odiff", basedir) == -1) 1067 if (fstat(basefd, &s) == -1)
840 errExit("asprintf"); 1068 errExit("fstat");
1069 if (s.st_uid != 0) {
1070 fprintf(stderr, "Error: overlay directory %s is not owned by the root user\n", basedir);
1071 exit(1);
1072 }
1073 // confirm permissions of base are 0755
1074 if (((S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) & s.st_mode) != (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) {
1075 fprintf(stderr, "Error: invalid permissions on overlay directory %s\n", basedir);
1076 exit(1);
1077 }
841 1078
1079 // create diff and work directories inside base
842 // no need to check arg_overlay_reuse 1080 // no need to check arg_overlay_reuse
843 if (stat(odiff, &s) != 0) { 1081 char *odiff;
844 mkdir_attr(odiff, 0755, 0, 0); 1082 if (asprintf(&odiff, "%s/odiff", basedir) == -1)
1083 errExit("asprintf");
1084 // the new directory will be owned by root
1085 if (mkdirat(basefd, "odiff", 0755) == -1 && errno != EEXIST) {
1086 perror("mkdir");
1087 fprintf(stderr, "Error: cannot create overlay directory %s\n", odiff);
1088 exit(1);
845 } 1089 }
846 else if (set_perms(odiff, 0, 0, 0755)) 1090 ASSERT_PERMS(odiff, 0, 0, 0755);
847 errExit("set_perms");
848 1091
849 char *owork; 1092 char *owork;
850 if(asprintf(&owork, "%s/owork", basedir) == -1) 1093 if (asprintf(&owork, "%s/owork", basedir) == -1)
851 errExit("asprintf"); 1094 errExit("asprintf");
852 1095 // the new directory will be owned by root
853 // no need to check arg_overlay_reuse 1096 if (mkdirat(basefd, "owork", 0755) == -1 && errno != EEXIST) {
854 if (stat(owork, &s) != 0) { 1097 perror("mkdir");
855 mkdir_attr(owork, 0755, 0, 0); 1098 fprintf(stderr, "Error: cannot create overlay directory %s\n", owork);
1099 exit(1);
856 } 1100 }
857 else if (set_perms(owork, 0, 0, 0755)) 1101 ASSERT_PERMS(owork, 0, 0, 0755);
858 errExit("chown");
859 1102
860 // mount overlayfs 1103 // mount overlayfs
861 if (arg_debug) 1104 if (arg_debug)
@@ -874,8 +1117,10 @@ void fs_overlayfs(void) {
874 else { // kernel 3.18 or newer 1117 else { // kernel 3.18 or newer
875 if (asprintf(&option, "lowerdir=/,upperdir=%s,workdir=%s", odiff, owork) == -1) 1118 if (asprintf(&option, "lowerdir=/,upperdir=%s,workdir=%s", odiff, owork) == -1)
876 errExit("asprintf"); 1119 errExit("asprintf");
877 if (mount("overlay", oroot, "overlay", MS_MGC_VAL, option) < 0) 1120 if (mount("overlay", oroot, "overlay", MS_MGC_VAL, option) < 0) {
1121 fprintf(stderr, "Debug: running on kernel version %d.%d\n", major, minor);
878 errExit("mounting overlayfs"); 1122 errExit("mounting overlayfs");
1123 }
879 1124
880 //*************************** 1125 //***************************
881 // issue #263 start code 1126 // issue #263 start code
@@ -895,52 +1140,58 @@ void fs_overlayfs(void) {
895 1140
896 // BEFORE NEXT, WE NEED TO TEST IF /home has any contents or do we need to mount it? 1141 // BEFORE NEXT, WE NEED TO TEST IF /home has any contents or do we need to mount it?
897 // must create var for oroot/cfg.homedir 1142 // must create var for oroot/cfg.homedir
898 if (asprintf(&overlayhome,"%s%s",oroot,cfg.homedir) == -1) 1143 if (asprintf(&overlayhome, "%s%s", oroot, cfg.homedir) == -1)
899 errExit("asprintf"); 1144 errExit("asprintf");
900 if (arg_debug) printf ("DEBUG: overlayhome var holds ##%s##\n",overlayhome); 1145 if (arg_debug) printf ("DEBUG: overlayhome var holds ##%s##\n", overlayhome);
901 1146
902 // if no homedir in overlay -- create another overlay for /home 1147 // if no homedir in overlay -- create another overlay for /home
903 if (stat(overlayhome, &s) == -1) { 1148 if (stat(cfg.homedir, &s) == 0 && stat(overlayhome, &s) == -1) {
904
905 if(asprintf(&hroot, "%s/oroot/home", RUN_MNT_DIR) == -1)
906 errExit("asprintf");
907
908 if(asprintf(&hdiff, "%s/hdiff", basedir) == -1)
909 errExit("asprintf");
910 1149
911 // no need to check arg_overlay_reuse 1150 // no need to check arg_overlay_reuse
912 if (stat(hdiff, &s) != 0) { 1151 if (asprintf(&hdiff, "%s/hdiff", basedir) == -1)
913 mkdir_attr(hdiff, S_IRWXU | S_IRWXG | S_IRWXO, 0, 0);
914 }
915 else if (set_perms(hdiff, 0, 0, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH))
916 errExit("set_perms");
917
918 if(asprintf(&hwork, "%s/hwork", basedir) == -1)
919 errExit("asprintf"); 1152 errExit("asprintf");
1153 // the new directory will be owned by root
1154 if (mkdirat(basefd, "hdiff", 0755) == -1 && errno != EEXIST) {
1155 perror("mkdir");
1156 fprintf(stderr, "Error: cannot create overlay directory %s\n", hdiff);
1157 exit(1);
1158 }
1159 ASSERT_PERMS(hdiff, 0, 0, 0755);
920 1160
921 // no need to check arg_overlay_reuse 1161 // no need to check arg_overlay_reuse
922 if (stat(hwork, &s) != 0) { 1162 if (asprintf(&hwork, "%s/hwork", basedir) == -1)
923 mkdir_attr(hwork, S_IRWXU | S_IRWXG | S_IRWXO, 0, 0); 1163 errExit("asprintf");
1164 // the new directory will be owned by root
1165 if (mkdirat(basefd, "hwork", 0755) == -1 && errno != EEXIST) {
1166 perror("mkdir");
1167 fprintf(stderr, "Error: cannot create overlay directory %s\n", hwork);
1168 exit(1);
924 } 1169 }
925 else if (set_perms(hwork, 0, 0, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) 1170 ASSERT_PERMS(hwork, 0, 0, 0755);
926 errExit("set_perms");
927 1171
928 // no homedir in overlay so now mount another overlay for /home 1172 // no homedir in overlay so now mount another overlay for /home
1173 if (asprintf(&hroot, "%s/home", oroot) == -1)
1174 errExit("asprintf");
929 if (asprintf(&option, "lowerdir=/home,upperdir=%s,workdir=%s", hdiff, hwork) == -1) 1175 if (asprintf(&option, "lowerdir=/home,upperdir=%s,workdir=%s", hdiff, hwork) == -1)
930 errExit("asprintf"); 1176 errExit("asprintf");
931 if (mount("overlay", hroot, "overlay", MS_MGC_VAL, option) < 0) 1177 if (mount("overlay", hroot, "overlay", MS_MGC_VAL, option) < 0)
932 errExit("mounting overlayfs for mounted home directory"); 1178 errExit("mounting overlayfs for mounted home directory");
933 1179
934 printf("OverlayFS for /home configured in %s directory\n", basedir); 1180 printf("OverlayFS for /home configured in %s directory\n", basedir);
1181 free(hroot);
1182 free(hdiff);
1183 free(hwork);
1184
935 } // stat(overlayhome) 1185 } // stat(overlayhome)
936 free(overlayhome); 1186 free(overlayhome);
937 } 1187 }
938 // issue #263 end code 1188 // issue #263 end code
939 //*************************** 1189 //***************************
940 } 1190 }
941 if (!arg_quiet) 1191 fmessage("OverlayFS configured in %s directory\n", basedir);
942 printf("OverlayFS configured in %s directory\n", basedir); 1192 close(basefd);
943 1193
1194 // /dev, /run and /tmp are not covered by the overlay
944 // mount-bind dev directory 1195 // mount-bind dev directory
945 if (arg_debug) 1196 if (arg_debug)
946 printf("Mounting /dev\n"); 1197 printf("Mounting /dev\n");
@@ -961,37 +1212,36 @@ void fs_overlayfs(void) {
961 errExit("mounting /run"); 1212 errExit("mounting /run");
962 fs_logger("whitelist /run"); 1213 fs_logger("whitelist /run");
963 1214
964 // mount-bind /tmp/.X11-unix directory 1215 // mount-bind tmp directory
965 if (stat("/tmp/.X11-unix", &s) == 0) { 1216 if (arg_debug)
966 if (arg_debug) 1217 printf("Mounting /tmp\n");
967 printf("Mounting /tmp/.X11-unix\n"); 1218 char *tmp;
968 char *x11; 1219 if (asprintf(&tmp, "%s/tmp", oroot) == -1)
969 if (asprintf(&x11, "%s/tmp/.X11-unix", oroot) == -1) 1220 errExit("asprintf");
970 errExit("asprintf"); 1221 if (mount("/tmp", tmp, NULL, MS_BIND|MS_REC, NULL) < 0)
971 if (mount("/tmp/.X11-unix", x11, NULL, MS_BIND|MS_REC, NULL) < 0) 1222 errExit("mounting /tmp");
972 fwarning("cannot mount /tmp/.X11-unix in overlay\n"); 1223 fs_logger("whitelist /tmp");
973 else
974 fs_logger("whitelist /tmp/.X11-unix");
975 free(x11);
976 }
977 1224
978 // chroot in the new filesystem 1225 // chroot in the new filesystem
979#ifdef HAVE_GCOV
980 __gcov_flush(); 1226 __gcov_flush();
981#endif 1227
982 if (chroot(oroot) == -1) 1228 if (chroot(oroot) == -1)
983 errExit("chroot"); 1229 errExit("chroot");
984 1230
1231 // mount a new proc filesystem
1232 if (arg_debug)
1233 printf("Mounting /proc filesystem representing the PID namespace\n");
1234 if (mount("proc", "/proc", "proc", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0)
1235 errExit("mounting /proc");
1236
985 // update /var directory in order to support multiple sandboxes running on the same root directory 1237 // update /var directory in order to support multiple sandboxes running on the same root directory
986// if (!arg_private_dev) 1238// if (!arg_private_dev)
987// fs_dev_shm(); 1239// fs_dev_shm();
988 fs_var_lock(); 1240 fs_var_lock();
989 fs_var_tmp(); 1241 if (!arg_keep_var_tmp)
1242 fs_var_tmp();
990 if (!arg_writable_var_log) 1243 if (!arg_writable_var_log)
991 fs_var_log(); 1244 fs_var_log();
992 else
993 fs_rdwr("/var/log");
994
995 fs_var_lib(); 1245 fs_var_lib();
996 fs_var_cache(); 1246 fs_var_cache();
997 fs_var_utmp(); 1247 fs_var_utmp();
@@ -1001,260 +1251,34 @@ void fs_overlayfs(void) {
1001 restrict_users(); 1251 restrict_users();
1002 1252
1003 // when starting as root, firejail config is not disabled; 1253 // when starting as root, firejail config is not disabled;
1004 // this mode could be used to install and test new software by chaining
1005 // firejail sandboxes (firejail --force)
1006 if (getuid() != 0) 1254 if (getuid() != 0)
1007 disable_config(); 1255 disable_config();
1008 1256
1009 // cleanup and exit 1257 // cleanup and exit
1010 free(option); 1258 free(option);
1011 free(oroot);
1012 free(odiff); 1259 free(odiff);
1260 free(owork);
1261 free(dev);
1262 free(run);
1263 free(tmp);
1013} 1264}
1014#endif 1265#endif
1015 1266
1016 1267// this function is called from sandbox.c before blacklist/whitelist functions
1017#ifdef HAVE_CHROOT 1268void fs_private_tmp(void) {
1018// return 1 if error
1019void fs_check_chroot_dir(const char *rootdir) {
1020 EUID_ASSERT(); 1269 EUID_ASSERT();
1021 assert(rootdir);
1022 struct stat s;
1023 char *name;
1024
1025 if (strcmp(rootdir, "/tmp") == 0 || strcmp(rootdir, "/var/tmp") == 0) {
1026 fprintf(stderr, "Error: invalid chroot directory\n");
1027 exit(1);
1028 }
1029
1030 // rootdir has to be owned by root
1031 if (stat(rootdir, &s) != 0) {
1032 fprintf(stderr, "Error: cannot find chroot directory\n");
1033 exit(1);
1034 }
1035 if (s.st_uid != 0) {
1036 fprintf(stderr, "Error: chroot directory should be owned by root\n");
1037 exit(1);
1038 }
1039
1040 // check /dev
1041 if (asprintf(&name, "%s/dev", rootdir) == -1)
1042 errExit("asprintf");
1043 if (stat(name, &s) == -1) {
1044 fprintf(stderr, "Error: cannot find /dev in chroot directory\n");
1045 exit(1);
1046 }
1047 if (s.st_uid != 0) {
1048 fprintf(stderr, "Error: chroot /dev directory should be owned by root\n");
1049 exit(1);
1050 }
1051 free(name);
1052
1053 // check /var/tmp
1054 if (asprintf(&name, "%s/var/tmp", rootdir) == -1)
1055 errExit("asprintf");
1056 if (stat(name, &s) == -1) {
1057 fprintf(stderr, "Error: cannot find /var/tmp in chroot directory\n");
1058 exit(1);
1059 }
1060 if (s.st_uid != 0) {
1061 fprintf(stderr, "Error: chroot /var/tmp directory should be owned by root\n");
1062 exit(1);
1063 }
1064 free(name);
1065
1066 // check /proc
1067 if (asprintf(&name, "%s/proc", rootdir) == -1)
1068 errExit("asprintf");
1069 if (stat(name, &s) == -1) {
1070 fprintf(stderr, "Error: cannot find /proc in chroot directory\n");
1071 exit(1);
1072 }
1073 if (s.st_uid != 0) {
1074 fprintf(stderr, "Error: chroot /proc directory should be owned by root\n");
1075 exit(1);
1076 }
1077 free(name);
1078
1079 // check /tmp
1080 if (asprintf(&name, "%s/tmp", rootdir) == -1)
1081 errExit("asprintf");
1082 if (stat(name, &s) == -1) {
1083 fprintf(stderr, "Error: cannot find /tmp in chroot directory\n");
1084 exit(1);
1085 }
1086 if (s.st_uid != 0) {
1087 fprintf(stderr, "Error: chroot /tmp directory should be owned by root\n");
1088 exit(1);
1089 }
1090 free(name);
1091
1092 // check /etc
1093 if (asprintf(&name, "%s/etc", rootdir) == -1)
1094 errExit("asprintf");
1095 if (stat(name, &s) == -1) {
1096 fprintf(stderr, "Error: cannot find /etc in chroot directory\n");
1097 exit(1);
1098 }
1099 if (s.st_uid != 0) {
1100 fprintf(stderr, "Error: chroot /etc directory should be owned by root\n");
1101 exit(1);
1102 }
1103 free(name);
1104
1105 // check /etc/resolv.conf
1106 if (asprintf(&name, "%s/etc/resolv.conf", rootdir) == -1)
1107 errExit("asprintf");
1108 if (stat(name, &s) == 0) {
1109 if (s.st_uid != 0) {
1110 fprintf(stderr, "Error: chroot /etc/resolv.conf should be owned by root\n");
1111 exit(1);
1112 }
1113 }
1114 else {
1115 fprintf(stderr, "Error: chroot /etc/resolv.conf not found\n");
1116 exit(1);
1117 }
1118 // on Arch /etc/resolv.conf could be a symlink to /run/systemd/resolve/resolv.conf
1119 // on Ubuntu 17.04 /etc/resolv.conf could be a symlink to /run/resolveconf/resolv.conf
1120 if (is_link(name)) {
1121 // check the link points in chroot
1122 char *rname = realpath(name, NULL);
1123 if (!rname || strncmp(rname, rootdir, strlen(rootdir)) != 0) {
1124 fprintf(stderr, "Error: chroot /etc/resolv.conf is pointing outside chroot\n");
1125 exit(1);
1126 }
1127 }
1128 free(name);
1129
1130 // check x11 socket directory
1131 if (getenv("FIREJAIL_X11")) {
1132 char *name;
1133 if (asprintf(&name, "%s/tmp/.X11-unix", rootdir) == -1)
1134 errExit("asprintf");
1135 if (stat(name, &s) == -1) {
1136 fprintf(stderr, "Error: cannot find /tmp/.X11-unix in chroot directory\n");
1137 exit(1);
1138 }
1139 if (s.st_uid != 0) {
1140 fprintf(stderr, "Error: chroot /tmp/.X11-unix directory should be owned by root\n");
1141 exit(1);
1142 }
1143 free(name);
1144 }
1145}
1146
1147// chroot into an existing directory; mount exiting /dev and update /etc/resolv.conf
1148void fs_chroot(const char *rootdir) {
1149 assert(rootdir);
1150
1151 if (checkcfg(CFG_CHROOT_DESKTOP)) {
1152 // mount-bind a /dev in rootdir
1153 char *newdev;
1154 if (asprintf(&newdev, "%s/dev", rootdir) == -1)
1155 errExit("asprintf");
1156 if (arg_debug)
1157 printf("Mounting /dev on %s\n", newdev);
1158 if (mount("/dev", newdev, NULL, MS_BIND|MS_REC, NULL) < 0)
1159 errExit("mounting /dev");
1160 free(newdev);
1161
1162 // x11
1163 if (getenv("FIREJAIL_X11")) {
1164 char *newx11;
1165 if (asprintf(&newx11, "%s/tmp/.X11-unix", rootdir) == -1)
1166 errExit("asprintf");
1167 if (arg_debug)
1168 printf("Mounting /tmp/.X11-unix on %s\n", newx11);
1169 if (mount("/tmp/.X11-unix", newx11, NULL, MS_BIND|MS_REC, NULL) < 0)
1170 errExit("mounting /tmp/.X11-unix");
1171 free(newx11);
1172 }
1173
1174 // some older distros don't have a /run directory
1175 // create one by default
1176 // create /run/firejail directory in chroot
1177 char *rundir;
1178 if (asprintf(&rundir, "%s/run", rootdir) == -1)
1179 errExit("asprintf");
1180 if (is_link(rundir)) {
1181 fprintf(stderr, "Error: invalid run directory inside chroot\n");
1182 exit(1);
1183 }
1184 create_empty_dir_as_root(rundir, 0755);
1185 free(rundir);
1186 if (asprintf(&rundir, "%s/run/firejail", rootdir) == -1)
1187 errExit("asprintf");
1188 create_empty_dir_as_root(rundir, 0755);
1189 free(rundir);
1190
1191 // create /run/firejail/mnt directory in chroot and mount the current one
1192 if (asprintf(&rundir, "%s%s", rootdir, RUN_MNT_DIR) == -1)
1193 errExit("asprintf");
1194 create_empty_dir_as_root(rundir, 0755);
1195 if (mount(RUN_MNT_DIR, rundir, NULL, MS_BIND|MS_REC, NULL) < 0)
1196 errExit("mount bind");
1197
1198 // copy /etc/resolv.conf in chroot directory
1199 char *fname;
1200 if (asprintf(&fname, "%s/etc/resolv.conf", rootdir) == -1)
1201 errExit("asprintf");
1202 if (arg_debug)
1203 printf("Updating /etc/resolv.conf in %s\n", fname);
1204 if (copy_file("/etc/resolv.conf", fname, 0, 0, 0644) == -1) // root needed
1205 fwarning("/etc/resolv.conf not initialized\n");
1206 }
1207
1208 // chroot into the new directory
1209#ifdef HAVE_GCOV
1210 __gcov_flush();
1211#endif
1212 if (arg_debug) 1270 if (arg_debug)
1213 printf("Chrooting into %s\n", rootdir); 1271 printf("Generate private-tmp whitelist commands\n");
1214 if (chroot(rootdir) < 0)
1215 errExit("chroot");
1216
1217 // create all other /run/firejail files and directories
1218 preproc_build_firejail_dir();
1219
1220 if (checkcfg(CFG_CHROOT_DESKTOP)) {
1221 // update /var directory in order to support multiple sandboxes running on the same root directory
1222// if (!arg_private_dev)
1223// fs_dev_shm();
1224 fs_var_lock();
1225 fs_var_tmp();
1226 if (!arg_writable_var_log)
1227 fs_var_log();
1228 else
1229 fs_rdwr("/var/log");
1230
1231 fs_var_lib();
1232 fs_var_cache();
1233 fs_var_utmp();
1234 fs_machineid();
1235 1272
1236 // don't leak user information
1237 restrict_users();
1238
1239 // when starting as root, firejail config is not disabled;
1240 // this mode could be used to install and test new software by chaining
1241 // firejail sandboxes (firejail --force)
1242 if (getuid() != 0)
1243 disable_config();
1244 }
1245}
1246#endif
1247
1248// this function is called from sandbox.c before blacklist/whitelist functions
1249void fs_private_tmp(void) {
1250 // check XAUTHORITY file, KDE keeps it under /tmp 1273 // check XAUTHORITY file, KDE keeps it under /tmp
1251 char *xauth = getenv("XAUTHORITY"); 1274 const char *xauth = env_get("XAUTHORITY");
1252 if (xauth) { 1275 if (xauth) {
1253 char *rp = realpath(xauth, NULL); 1276 char *rp = realpath(xauth, NULL);
1254 if (rp && strncmp(rp, "/tmp/", 5) == 0) { 1277 if (rp && strncmp(rp, "/tmp/", 5) == 0) {
1255 char *cmd; 1278 char *cmd;
1256 if (asprintf(&cmd, "whitelist %s", rp) == -1) 1279 if (asprintf(&cmd, "whitelist %s", rp) == -1)
1257 errExit("asprintf"); 1280 errExit("asprintf");
1281 profile_check_line(cmd, 0, NULL);
1258 profile_add(cmd); // profile_add does not duplicate the string 1282 profile_add(cmd); // profile_add does not duplicate the string
1259 } 1283 }
1260 if (rp) 1284 if (rp)
@@ -1263,6 +1287,11 @@ void fs_private_tmp(void) {
1263 1287
1264 // whitelist x11 directory 1288 // whitelist x11 directory
1265 profile_add("whitelist /tmp/.X11-unix"); 1289 profile_add("whitelist /tmp/.X11-unix");
1290 // read-only x11 directory
1291 profile_add("read-only /tmp/.X11-unix");
1292
1293 // whitelist sndio directory
1294 profile_add("whitelist /tmp/sndio");
1266 1295
1267 // whitelist any pulse* file in /tmp directory 1296 // whitelist any pulse* file in /tmp directory
1268 // some distros use PulseAudio sockets under /tmp instead of the socket in /urn/user 1297 // some distros use PulseAudio sockets under /tmp instead of the socket in /urn/user
@@ -1281,10 +1310,9 @@ void fs_private_tmp(void) {
1281 char *cmd; 1310 char *cmd;
1282 if (asprintf(&cmd, "whitelist /tmp/%s", entry->d_name) == -1) 1311 if (asprintf(&cmd, "whitelist /tmp/%s", entry->d_name) == -1)
1283 errExit("asprintf"); 1312 errExit("asprintf");
1313 profile_check_line(cmd, 0, NULL);
1284 profile_add(cmd); // profile_add does not duplicate the string 1314 profile_add(cmd); // profile_add does not duplicate the string
1285 } 1315 }
1286 } 1316 }
1287 closedir(dir); 1317 closedir(dir);
1288
1289
1290} 1318}
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c
index 9aa227caf..61398f12b 100644
--- a/src/firejail/fs_bin.c
+++ b/src/firejail/fs_bin.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -23,6 +23,9 @@
23#include <sys/types.h> 23#include <sys/types.h>
24#include <sys/wait.h> 24#include <sys/wait.h>
25#include <unistd.h> 25#include <unistd.h>
26#include <glob.h>
27
28static int prog_cnt = 0;
26 29
27static char *paths[] = { 30static char *paths[] = {
28 "/usr/local/bin", 31 "/usr/local/bin",
@@ -39,7 +42,6 @@ static char *paths[] = {
39// return 1 if found, 0 if not found 42// return 1 if found, 0 if not found
40static char *check_dir_or_file(const char *name) { 43static char *check_dir_or_file(const char *name) {
41 assert(name); 44 assert(name);
42
43 struct stat s; 45 struct stat s;
44 char *fname = NULL; 46 char *fname = NULL;
45 47
@@ -98,17 +100,24 @@ static char *check_dir_or_file(const char *name) {
98static int valid_full_path_file(const char *name) { 100static int valid_full_path_file(const char *name) {
99 assert(name); 101 assert(name);
100 102
101 char *full_name = realpath(name, NULL); 103 if (*name != '/')
102 if (!full_name) 104 return 0;
103 goto errexit; 105 if (strstr(name, ".."))
104 char *fname = strrchr(full_name, '/'); 106 return 0;
105 if (!fname)
106 goto errexit;
107 if (*(++fname) == '\0')
108 goto errexit;
109 107
108 // do we have a file?
109 struct stat s;
110 if (stat(name, &s) == -1)
111 return 0;
112 // directories not allowed
113 if (S_ISDIR(s.st_mode))
114 return 0;
115 // checking access
116 if (access(name, X_OK) == -1)
117 return 0;
118
119 // check standard paths
110 int i = 0; 120 int i = 0;
111 int found = 0;
112 while (paths[i]) { 121 while (paths[i]) {
113 // private-bin-no-local can be disabled in /etc/firejail/firejail.config 122 // private-bin-no-local can be disabled in /etc/firejail/firejail.config
114 if (checkcfg(CFG_PRIVATE_BIN_NO_LOCAL) && strstr(paths[i], "local/")) { 123 if (checkcfg(CFG_PRIVATE_BIN_NO_LOCAL) && strstr(paths[i], "local/")) {
@@ -116,54 +125,48 @@ static int valid_full_path_file(const char *name) {
116 continue; 125 continue;
117 } 126 }
118 127
119 // check file 128 int len = strlen(paths[i]);
120 char *full_name2; 129 if (strncmp(name, paths[i], len) == 0 && name[len] == '/' && name[len + 1] != '\0')
121 if (asprintf(&full_name2, "%s/%s", paths[i], fname) == -1) 130 return 1;
122 errExit("asprintf");
123
124 if (strcmp(full_name, full_name2) == 0) {
125 free(full_name2);
126 found = 1;
127 break;
128 }
129
130 free(full_name2);
131 i++; 131 i++;
132 } 132 }
133
134 if (!found)
135 goto errexit;
136
137 free(full_name);
138 return 1;
139
140errexit:
141 if (arg_debug) 133 if (arg_debug)
142 fwarning("file %s not found\n", name); 134 printf("file %s not found\n", name);
143 if (full_name)
144 free(full_name);
145 return 0; 135 return 0;
146} 136}
147 137
148static void duplicate(char *fname, FILE *fplist) { 138static void report_duplication(const char *fname) {
139 // report the file on all bin paths
140 int i = 0;
141 while (paths[i]) {
142 char *p;
143 if (asprintf(&p, "%s/%s", paths[i], fname) == -1)
144 errExit("asprintf");
145 fs_logger2("clone", p);
146 free(p);
147 i++;
148 }
149}
150
151static void duplicate(char *fname) {
152 assert(fname);
153
149 if (*fname == '~' || strstr(fname, "..")) { 154 if (*fname == '~' || strstr(fname, "..")) {
150 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", fname); 155 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", fname);
151 exit(1); 156 exit(1);
152 } 157 }
153 invalid_filename(fname); 158 invalid_filename(fname, 0); // no globbing
154 159
155 char *full_path; 160 char *full_path;
156 if (*fname == '/') { 161 if (*fname == '/') {
157 // If the absolute filename is indicated, directly use it. This 162 // If the absolute filename is indicated, directly use it. This
158 // is required for the following three cases: 163 // is required for the following cases:
159 // - if user's $PATH order is not the same as the above 164 // - if user's $PATH order is not the same as the above
160 // paths[] variable order 165 // paths[] variable order
161 // - if for example /usr/bin/which is a symlink to /bin/which, 166 if (!valid_full_path_file(fname)) {
162 // because in this case the result is a symlink pointing to 167 fwarning("invalid private-bin path %s\n", fname);
163 // itself due to the file name being the same.
164
165 if (!valid_full_path_file(fname))
166 return; 168 return;
169 }
167 170
168 full_path = strdup(fname); 171 full_path = strdup(fname);
169 if (!full_path) 172 if (!full_path)
@@ -179,35 +182,97 @@ static void duplicate(char *fname, FILE *fplist) {
179 errExit("asprintf"); 182 errExit("asprintf");
180 } 183 }
181 184
182 if (fplist) 185 // add to private-lib list
183 fprintf(fplist, "%s\n", full_path); 186 if (cfg.bin_private_lib == NULL) {
184 187 if (asprintf(&cfg.bin_private_lib, "%s,%s",fname, full_path) == -1)
185 // copy the file 188 errExit("asprintf");
186 if (checkcfg(CFG_FOLLOW_SYMLINK_PRIVATE_BIN)) 189 }
187 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 4, PATH_FCOPY, "--follow-link", full_path, RUN_BIN_DIR);
188 else { 190 else {
189 // if full_path is simlink, and the link is in our path, copy both 191 char *tmp;
190 if (is_link(full_path)) { 192 if (asprintf(&tmp, "%s,%s,%s", cfg.bin_private_lib, fname, full_path) == -1)
191 char *actual_path = realpath(full_path, NULL); 193 errExit("asprintf");
192 if (actual_path) { 194 free(cfg.bin_private_lib);
193 if (valid_full_path_file(actual_path)) 195 cfg.bin_private_lib = tmp;
194 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 3, PATH_FCOPY, actual_path, RUN_BIN_DIR); 196 }
195 free(actual_path); 197
198 // if full_path is symlink, and the link is in our path, copy both the file and the symlink
199 if (is_link(full_path)) {
200 char *actual_path = realpath(full_path, NULL);
201 if (actual_path) {
202 if (valid_full_path_file(actual_path)) {
203 // solving problems such as /bin/sh -> /bin/dash
204 // copy the real file pointed by symlink
205 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 3, PATH_FCOPY, actual_path, RUN_BIN_DIR);
206 prog_cnt++;
207 char *f = strrchr(actual_path, '/');
208 if (f && *(++f) !='\0')
209 report_duplication(f);
196 } 210 }
211 free(actual_path);
197 } 212 }
198
199 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 3, PATH_FCOPY, full_path, RUN_BIN_DIR);
200 } 213 }
201 214
202 fs_logger2("clone", fname); 215 // copy a file or a symlink
216 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 3, PATH_FCOPY, full_path, RUN_BIN_DIR);
217 prog_cnt++;
203 free(full_path); 218 free(full_path);
219 report_duplication(fname);
204} 220}
205 221
222static void globbing(char *fname) {
223 assert(fname);
224
225 // go directly to duplicate() if no globbing char is present - see man 7 glob
226 if (strrchr(fname, '*') == NULL &&
227 strrchr(fname, '[') == NULL &&
228 strrchr(fname, '?') == NULL)
229 return duplicate(fname);
230
231 // loop through paths[]
232 int i = 0;
233 while (paths[i]) {
234 // private-bin-no-local can be disabled in /etc/firejail/firejail.config
235 if (checkcfg(CFG_PRIVATE_BIN_NO_LOCAL) && strstr(paths[i], "local/")) {
236 i++;
237 continue;
238 }
239
240 // check file
241 char *pattern;
242 if (asprintf(&pattern, "%s/%s", paths[i], fname) == -1)
243 errExit("asprintf");
244
245 // globbing
246 glob_t globbuf;
247 int globerr = glob(pattern, GLOB_NOCHECK | GLOB_NOSORT | GLOB_PERIOD, NULL, &globbuf);
248 if (globerr) {
249 fprintf(stderr, "Error: failed to glob private-bin pattern %s\n", pattern);
250 exit(1);
251 }
252
253 size_t j;
254 for (j = 0; j < globbuf.gl_pathc; j++) {
255 assert(globbuf.gl_pathv[j]);
256 // testing for GLOB_NOCHECK - no pattern matched returns the original pattern
257 if (strcmp(globbuf.gl_pathv[j], pattern) == 0)
258 continue;
259
260 duplicate(globbuf.gl_pathv[j]);
261 }
262
263 globfree(&globbuf);
264 free(pattern);
265 i++;
266 }
267}
206 268
207void fs_private_bin_list(void) { 269void fs_private_bin_list(void) {
208 char *private_list = cfg.bin_private_keep; 270 char *private_list = cfg.bin_private_keep;
209 assert(private_list); 271 assert(private_list);
210 272
273 // start timetrace
274 timetrace_start();
275
211 // create /run/firejail/mnt/bin directory 276 // create /run/firejail/mnt/bin directory
212 mkdir_attr(RUN_BIN_DIR, 0755, 0, 0); 277 mkdir_attr(RUN_BIN_DIR, 0755, 0, 0);
213 278
@@ -219,22 +284,16 @@ void fs_private_bin_list(void) {
219 if (!dlist) 284 if (!dlist)
220 errExit("strdup"); 285 errExit("strdup");
221 286
222 // save a list of private-bin files in order to bring in private-libs later
223 FILE *fplist = NULL;
224 if (arg_private_lib) {
225 fplist = fopen(RUN_LIB_BIN, "w");
226 if (!fplist)
227 errExit("fopen");
228 }
229
230 char *ptr = strtok(dlist, ","); 287 char *ptr = strtok(dlist, ",");
231 duplicate(ptr, fplist); 288 if (!ptr) {
289 fprintf(stderr, "Error: invalid private-bin argument\n");
290 exit(1);
291 }
292 globbing(ptr);
232 while ((ptr = strtok(NULL, ",")) != NULL) 293 while ((ptr = strtok(NULL, ",")) != NULL)
233 duplicate(ptr, fplist); 294 globbing(ptr);
234 free(dlist); 295 free(dlist);
235 fs_logger_print(); 296 fs_logger_print();
236 if (fplist)
237 fclose(fplist);
238 297
239 // mount-bind 298 // mount-bind
240 int i = 0; 299 int i = 0;
@@ -250,4 +309,6 @@ void fs_private_bin_list(void) {
250 } 309 }
251 i++; 310 i++;
252 } 311 }
312 selinux_relabel_path(RUN_BIN_DIR, "/bin");
313 fmessage("%d %s installed in %0.2f ms\n", prog_cnt, (prog_cnt == 1)? "program": "programs", timetrace_end());
253} 314}
diff --git a/src/firejail/fs_dev.c b/src/firejail/fs_dev.c
index 0dbbb65a0..8cc3ecc62 100644
--- a/src/firejail/fs_dev.c
+++ b/src/firejail/fs_dev.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,6 +25,7 @@
25#include <dirent.h> 25#include <dirent.h>
26#include <fcntl.h> 26#include <fcntl.h>
27#include <pwd.h> 27#include <pwd.h>
28#include <errno.h>
28#ifndef _BSD_SOURCE 29#ifndef _BSD_SOURCE
29#define _BSD_SOURCE 30#define _BSD_SOURCE
30#endif 31#endif
@@ -39,6 +40,8 @@ typedef enum {
39 DEV_VIDEO, 40 DEV_VIDEO,
40 DEV_TV, 41 DEV_TV,
41 DEV_DVD, 42 DEV_DVD,
43 DEV_U2F,
44 DEV_INPUT
42} DEV_TYPE; 45} DEV_TYPE;
43 46
44 47
@@ -76,6 +79,18 @@ static DevEntry dev[] = {
76 {"/dev/video9", RUN_DEV_DIR "/video9", DEV_VIDEO}, 79 {"/dev/video9", RUN_DEV_DIR "/video9", DEV_VIDEO},
77 {"/dev/dvb", RUN_DEV_DIR "/dvb", DEV_TV}, // DVB (Digital Video Broadcasting) - TV device 80 {"/dev/dvb", RUN_DEV_DIR "/dvb", DEV_TV}, // DVB (Digital Video Broadcasting) - TV device
78 {"/dev/sr0", RUN_DEV_DIR "/sr0", DEV_DVD}, // for DVD and audio CD players 81 {"/dev/sr0", RUN_DEV_DIR "/sr0", DEV_DVD}, // for DVD and audio CD players
82 {"/dev/hidraw0", RUN_DEV_DIR "/hidraw0", DEV_U2F},
83 {"/dev/hidraw1", RUN_DEV_DIR "/hidraw1", DEV_U2F},
84 {"/dev/hidraw2", RUN_DEV_DIR "/hidraw2", DEV_U2F},
85 {"/dev/hidraw3", RUN_DEV_DIR "/hidraw3", DEV_U2F},
86 {"/dev/hidraw4", RUN_DEV_DIR "/hidraw4", DEV_U2F},
87 {"/dev/hidraw5", RUN_DEV_DIR "/hidraw5", DEV_U2F},
88 {"/dev/hidraw6", RUN_DEV_DIR "/hidraw6", DEV_U2F},
89 {"/dev/hidraw7", RUN_DEV_DIR "/hidraw7", DEV_U2F},
90 {"/dev/hidraw8", RUN_DEV_DIR "/hidraw8", DEV_U2F},
91 {"/dev/hidraw9", RUN_DEV_DIR "/hidraw9", DEV_U2F},
92 {"/dev/usb", RUN_DEV_DIR "/usb", DEV_U2F}, // USB devices such as Yubikey, U2F
93 {"/dev/input", RUN_DEV_DIR "/input", DEV_INPUT},
79 {NULL, NULL, DEV_NONE} 94 {NULL, NULL, DEV_NONE}
80}; 95};
81 96
@@ -84,14 +99,15 @@ static void deventry_mount(void) {
84 while (dev[i].dev_fname != NULL) { 99 while (dev[i].dev_fname != NULL) {
85 struct stat s; 100 struct stat s;
86 if (stat(dev[i].run_fname, &s) == 0) { 101 if (stat(dev[i].run_fname, &s) == 0) {
87
88 // check device type and subsystem configuration 102 // check device type and subsystem configuration
89 if ((dev[i].type == DEV_SOUND && arg_nosound == 0) || 103 if ((dev[i].type == DEV_SOUND && arg_nosound == 0) ||
90 (dev[i].type == DEV_3D && arg_no3d == 0) || 104 (dev[i].type == DEV_3D && arg_no3d == 0) ||
91 (dev[i].type == DEV_VIDEO && arg_novideo == 0) || 105 (dev[i].type == DEV_VIDEO && arg_novideo == 0) ||
92 (dev[i].type == DEV_TV && arg_notv == 0) || 106 (dev[i].type == DEV_TV && arg_notv == 0) ||
93 (dev[i].type == DEV_DVD && arg_nodvd == 0)) { 107 (dev[i].type == DEV_DVD && arg_nodvd == 0) ||
94 108 (dev[i].type == DEV_U2F && arg_nou2f == 0) ||
109 (dev[i].type == DEV_INPUT && arg_noinput == 0)) {
110
95 int dir = is_dir(dev[i].run_fname); 111 int dir = is_dir(dev[i].run_fname);
96 if (arg_debug) 112 if (arg_debug)
97 printf("mounting %s %s\n", dev[i].run_fname, (dir)? "directory": "file"); 113 printf("mounting %s %s\n", dev[i].run_fname, (dir)? "directory": "file");
@@ -106,14 +122,14 @@ static void deventry_mount(void) {
106 i++; 122 i++;
107 continue; 123 continue;
108 } 124 }
109 FILE *fp = fopen(dev[i].dev_fname, "w"); 125 FILE *fp = fopen(dev[i].dev_fname, "we");
110 if (fp) { 126 if (fp) {
111 fprintf(fp, "\n"); 127 fprintf(fp, "\n");
112 SET_PERMS_STREAM(fp, s.st_uid, s.st_gid, s.st_mode); 128 SET_PERMS_STREAM(fp, s.st_uid, s.st_gid, s.st_mode);
113 fclose(fp); 129 fclose(fp);
114 } 130 }
115 } 131 }
116 132
117 if (mount(dev[i].run_fname, dev[i].dev_fname, NULL, MS_BIND|MS_REC, NULL) < 0) 133 if (mount(dev[i].run_fname, dev[i].dev_fname, NULL, MS_BIND|MS_REC, NULL) < 0)
118 errExit("mounting dev file"); 134 errExit("mounting dev file");
119 fs_logger2("whitelist", dev[i].dev_fname); 135 fs_logger2("whitelist", dev[i].dev_fname);
@@ -125,32 +141,69 @@ static void deventry_mount(void) {
125} 141}
126 142
127static void create_char_dev(const char *path, mode_t mode, int major, int minor) { 143static void create_char_dev(const char *path, mode_t mode, int major, int minor) {
128 dev_t dev = makedev(major, minor); 144 dev_t device = makedev(major, minor);
129 if (mknod(path, S_IFCHR | mode, dev) == -1) 145 if (mknod(path, S_IFCHR | mode, device) == -1)
130 goto errexit; 146 goto errexit;
131 if (chmod(path, mode) < 0) 147 if (chmod(path, mode) < 0)
132 goto errexit; 148 goto errexit;
133 ASSERT_PERMS(path, 0, 0, mode); 149 ASSERT_PERMS(path, 0, 0, mode);
150 fs_logger2("create", path);
134 151
135 return; 152 return;
136 153
137errexit: 154errexit:
138 fprintf(stderr, "Error: cannot create %s device\n", path); 155 fprintf(stderr, "Error: cannot create %s device: %s\n", path, strerror(errno));
139 exit(1); 156 exit(1);
140} 157}
141 158
142static void create_link(const char *oldpath, const char *newpath) { 159static void create_link(const char *oldpath, const char *newpath) {
143 if (symlink(oldpath, newpath) == -1) 160 if (symlink(oldpath, newpath) == -1) {
144 goto errexit; 161 fprintf(stderr, "Error: cannot create %s device\n", newpath);
145 if (chown(newpath, 0, 0) < 0) 162 exit(1);
146 goto errexit; 163 }
164 fs_logger2("create", newpath);
147 return; 165 return;
166}
167
168static void empty_dev_shm(void) {
169 // create an empty /dev/shm directory
170 mkdir_attr("/dev/shm", 01777, 0, 0);
171 selinux_relabel_path("/dev/shm", "/dev/shm");
172 fs_logger("mkdir /dev/shm");
173 fs_logger("create /dev/shm");
174}
175
176static void mount_dev_shm(void) {
177 mkdir_attr("/dev/shm", 01777, 0, 0);
178 int rv = mount(RUN_DEV_DIR "/shm", "/dev/shm", "none", MS_BIND, "mode=01777,gid=0");
179 if (rv == -1) {
180 fwarning("cannot mount the old /dev/shm in private-dev\n");
181 dbg_test_dir(RUN_DEV_DIR "/shm");
182 empty_dev_shm();
183 return;
184 }
185}
186
187static void process_dev_shm(void) {
188 // Jack audio keeps an Unix socket under (/dev/shm/jack_default_1000_0 or /dev/shm/jack/...)
189 // looking for jack socket
190 EUID_USER();
191 glob_t globbuf;
192 int globerr = glob(RUN_DEV_DIR "/shm/jack*", GLOB_NOSORT, NULL, &globbuf);
193 EUID_ROOT();
194 if (globerr && !arg_keep_dev_shm) {
195 empty_dev_shm();
196 return;
197 }
198 globfree(&globbuf);
199
200 // if we got here, it means we have a jack server installed
201 // mount-bind the old /dev/shm
202 mount_dev_shm();
148 203
149errexit:
150 fprintf(stderr, "Error: cannot create %s device\n", newpath);
151 exit(1);
152} 204}
153 205
206
154void fs_private_dev(void){ 207void fs_private_dev(void){
155 // install a new /dev directory 208 // install a new /dev directory
156 if (arg_debug) 209 if (arg_debug)
@@ -167,7 +220,7 @@ void fs_private_dev(void){
167 struct stat s; 220 struct stat s;
168 if (stat("/dev/log", &s) == 0) { 221 if (stat("/dev/log", &s) == 0) {
169 have_devlog = 1; 222 have_devlog = 1;
170 FILE *fp = fopen(RUN_DEVLOG_FILE, "w"); 223 FILE *fp = fopen(RUN_DEVLOG_FILE, "we");
171 if (!fp) 224 if (!fp)
172 have_devlog = 0; 225 have_devlog = 0;
173 else { 226 else {
@@ -179,7 +232,7 @@ void fs_private_dev(void){
179 } 232 }
180 233
181 // mount tmpfs on top of /dev 234 // mount tmpfs on top of /dev
182 if (mount("tmpfs", "/dev", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 235 if (mount("tmpfs", "/dev", "tmpfs", MS_NOSUID | MS_STRICTATIME, "mode=755,gid=0") < 0)
183 errExit("mounting /dev"); 236 errExit("mounting /dev");
184 fs_logger("tmpfs /dev"); 237 fs_logger("tmpfs /dev");
185 238
@@ -188,7 +241,7 @@ void fs_private_dev(void){
188 241
189 // bring back /dev/log 242 // bring back /dev/log
190 if (have_devlog) { 243 if (have_devlog) {
191 FILE *fp = fopen("/dev/log", "w"); 244 FILE *fp = fopen("/dev/log", "we");
192 if (fp) { 245 if (fp) {
193 fprintf(fp, "\n"); 246 fprintf(fp, "\n");
194 fclose(fp); 247 fclose(fp);
@@ -196,15 +249,17 @@ void fs_private_dev(void){
196 errExit("mounting /dev/log"); 249 errExit("mounting /dev/log");
197 fs_logger("clone /dev/log"); 250 fs_logger("clone /dev/log");
198 } 251 }
252 if (mount(RUN_RO_FILE, RUN_DEVLOG_FILE, "none", MS_BIND, "mode=400,gid=0") < 0)
253 errExit("blacklisting " RUN_DEVLOG_FILE);
199 } 254 }
200 if (mount(RUN_RO_DIR, RUN_DEV_DIR, "none", MS_BIND, "mode=400,gid=0") < 0)
201 errExit("disable run dev directory");
202 255
203 // create /dev/shm 256 // bring forward the current /dev/shm directory if necessary
204 if (arg_debug) 257 if (arg_debug)
205 printf("Create /dev/shm directory\n"); 258 printf("Process /dev/shm directory\n");
206 mkdir_attr("/dev/shm", 01777, 0, 0); 259 process_dev_shm();
207 fs_logger("mkdir /dev/shm"); 260
261 if (mount(RUN_RO_DIR, RUN_DEV_DIR, "none", MS_BIND, "mode=400,gid=0") < 0)
262 errExit("disable run dev directory");
208 263
209 // create default devices 264 // create default devices
210 create_char_dev("/dev/zero", 0666, 1, 5); // mknod -m 666 /dev/zero c 1 5 265 create_char_dev("/dev/zero", 0666, 1, 5); // mknod -m 666 /dev/zero c 1 5
@@ -227,9 +282,13 @@ void fs_private_dev(void){
227 // pseudo-terminal 282 // pseudo-terminal
228 mkdir_attr("/dev/pts", 0755, 0, 0); 283 mkdir_attr("/dev/pts", 0755, 0, 0);
229 fs_logger("mkdir /dev/pts"); 284 fs_logger("mkdir /dev/pts");
285 selinux_relabel_path("/dev/pts", "/dev/pts");
286 fs_logger("create /dev/pts");
230 create_char_dev("/dev/pts/ptmx", 0666, 5, 2); //"mknod -m 666 /dev/pts/ptmx c 5 2"); 287 create_char_dev("/dev/pts/ptmx", 0666, 5, 2); //"mknod -m 666 /dev/pts/ptmx c 5 2");
288 selinux_relabel_path("/dev/pts/ptmx", "/dev/pts/ptmx");
231 fs_logger("mknod /dev/pts/ptmx"); 289 fs_logger("mknod /dev/pts/ptmx");
232 create_link("/dev/pts/ptmx", "/dev/ptmx"); 290 create_link("/dev/pts/ptmx", "/dev/ptmx");
291 selinux_relabel_path("/dev/ptmx", "/dev/ptmx");
233 292
234// code before github issue #351 293// code before github issue #351
235 // mount -vt devpts -o newinstance -o ptmxmode=0666 devpts //dev/pts 294 // mount -vt devpts -o newinstance -o ptmxmode=0666 devpts //dev/pts
@@ -247,13 +306,11 @@ void fs_private_dev(void){
247 free(data); 306 free(data);
248 fs_logger("clone /dev/pts"); 307 fs_logger("clone /dev/pts");
249 308
250#if 0
251 // stdin, stdout, stderr 309 // stdin, stdout, stderr
252 create_link("/proc/self/fd", "/dev/fd"); 310 create_link("/proc/self/fd", "/dev/fd");
253 create_link("/proc/self/fd/0", "/dev/stdin"); 311 create_link("/proc/self/fd/0", "/dev/stdin");
254 create_link("/proc/self/fd/1", "/dev/stdout"); 312 create_link("/proc/self/fd/1", "/dev/stdout");
255 create_link("/proc/self/fd/2", "/dev/stderr"); 313 create_link("/proc/self/fd/2", "/dev/stderr");
256#endif
257 314
258 // symlinks for DVD/CD players 315 // symlinks for DVD/CD players
259 if (stat("/dev/sr0", &s) == 0) { 316 if (stat("/dev/sr0", &s) == 0) {
@@ -264,101 +321,81 @@ void fs_private_dev(void){
264 } 321 }
265} 322}
266 323
324void fs_dev_disable_sound(void) {
325 unsigned i = 0;
326 while (dev[i].dev_fname != NULL) {
327 if (dev[i].type == DEV_SOUND)
328 disable_file_or_dir(dev[i].dev_fname);
329 i++;
330 }
267 331
268#if 0 332 // disable all jack sockets in /dev/shm
269void fs_dev_shm(void) { 333 glob_t globbuf;
270 uid_t uid = getuid(); // set a new shm only if we started as root 334 int globerr = glob("/dev/shm/jack*", GLOB_NOSORT, NULL, &globbuf);
271 if (uid) 335 if (globerr)
272 return; 336 return;
273 337
274 if (is_dir("/dev/shm")) { 338 for (i = 0; i < globbuf.gl_pathc; i++) {
275 if (arg_debug) 339 char *path = globbuf.gl_pathv[i];
276 printf("Mounting tmpfs on /dev/shm\n"); 340 assert(path);
277 if (mount("tmpfs", "/dev/shm", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=1777,gid=0") < 0) 341 if (is_link(path)) {
278 errExit("mounting /dev/shm"); 342 fwarning("skipping nosound for %s because it is a symbolic link\n", path);
279 fs_logger("tmpfs /dev/shm"); 343 continue;
280 }
281 else {
282 char *lnk = realpath("/dev/shm", NULL);
283 if (lnk) {
284 if (!is_dir(lnk)) {
285 // create directory
286 mkdir_attr(lnk, 01777, 0, 0);
287 }
288 if (arg_debug)
289 printf("Mounting tmpfs on %s on behalf of /dev/shm\n", lnk);
290 if (mount("tmpfs", lnk, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=1777,gid=0") < 0)
291 errExit("mounting /var/tmp");
292 fs_logger2("tmpfs", lnk);
293 free(lnk);
294 } 344 }
295 else { 345 disable_file_or_dir(path);
296 fwarning("/dev/shm not mounted\n");
297 dbg_test_dir("/dev/shm");
298 }
299
300 } 346 }
347 globfree(&globbuf);
301} 348}
302#endif
303 349
304static void disable_file_or_dir(const char *fname) { 350void fs_dev_disable_video(void) {
305 if (arg_debug) 351 int i = 0;
306 printf("disable %s\n", fname); 352 while (dev[i].dev_fname != NULL) {
307 struct stat s; 353 if (dev[i].type == DEV_VIDEO)
308 if (stat(fname, &s) != -1) { 354 disable_file_or_dir(dev[i].dev_fname);
309 if (is_dir(fname)) { 355 i++;
310 if (mount(RUN_RO_DIR, fname, "none", MS_BIND, "mode=400,gid=0") < 0)
311 errExit("disable directory");
312 }
313 else {
314 if (mount(RUN_RO_FILE, fname, "none", MS_BIND, "mode=400,gid=0") < 0)
315 errExit("disable file");
316 }
317 } 356 }
318 fs_logger2("blacklist", fname);
319
320} 357}
321 358
322void fs_dev_disable_sound(void) { 359void fs_dev_disable_3d(void) {
323 int i = 0; 360 int i = 0;
324 while (dev[i].dev_fname != NULL) { 361 while (dev[i].dev_fname != NULL) {
325 if (dev[i].type == DEV_SOUND) 362 if (dev[i].type == DEV_3D)
326 disable_file_or_dir(dev[i].dev_fname); 363 disable_file_or_dir(dev[i].dev_fname);
327 i++; 364 i++;
328 } 365 }
329} 366}
330 367
331void fs_dev_disable_video(void) { 368void fs_dev_disable_tv(void) {
332 int i = 0; 369 int i = 0;
333 while (dev[i].dev_fname != NULL) { 370 while (dev[i].dev_fname != NULL) {
334 if (dev[i].type == DEV_VIDEO) 371 if (dev[i].type == DEV_TV)
335 disable_file_or_dir(dev[i].dev_fname); 372 disable_file_or_dir(dev[i].dev_fname);
336 i++; 373 i++;
337 } 374 }
338} 375}
339 376
340void fs_dev_disable_3d(void) { 377void fs_dev_disable_dvd(void) {
341 int i = 0; 378 int i = 0;
342 while (dev[i].dev_fname != NULL) { 379 while (dev[i].dev_fname != NULL) {
343 if (dev[i].type == DEV_3D) 380 if (dev[i].type == DEV_DVD)
344 disable_file_or_dir(dev[i].dev_fname); 381 disable_file_or_dir(dev[i].dev_fname);
345 i++; 382 i++;
346 } 383 }
347} 384}
348 385
349void fs_dev_disable_tv(void) { 386void fs_dev_disable_u2f(void) {
350 int i = 0; 387 int i = 0;
351 while (dev[i].dev_fname != NULL) { 388 while (dev[i].dev_fname != NULL) {
352 if (dev[i].type == DEV_TV) 389 if (dev[i].type == DEV_U2F)
353 disable_file_or_dir(dev[i].dev_fname); 390 disable_file_or_dir(dev[i].dev_fname);
354 i++; 391 i++;
355 } 392 }
356} 393}
357 394
358void fs_dev_disable_dvd(void) { 395void fs_dev_disable_input(void) {
359 int i = 0; 396 int i = 0;
360 while (dev[i].dev_fname != NULL) { 397 while (dev[i].dev_fname != NULL) {
361 if (dev[i].type == DEV_DVD) 398 if (dev[i].type == DEV_INPUT)
362 disable_file_or_dir(dev[i].dev_fname); 399 disable_file_or_dir(dev[i].dev_fname);
363 i++; 400 i++;
364 } 401 }
diff --git a/src/firejail/fs_etc.c b/src/firejail/fs_etc.c
index b0835d50b..76054b485 100644
--- a/src/firejail/fs_etc.c
+++ b/src/firejail/fs_etc.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,11 +18,13 @@
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#include "firejail.h" 20#include "firejail.h"
21#include <errno.h>
21#include <sys/mount.h> 22#include <sys/mount.h>
22#include <sys/stat.h> 23#include <sys/stat.h>
23#include <sys/types.h> 24#include <sys/types.h>
24#include <time.h> 25#include <time.h>
25#include <unistd.h> 26#include <unistd.h>
27#include <dirent.h>
26 28
27// spoof /etc/machine_id 29// spoof /etc/machine_id
28void fs_machineid(void) { 30void fs_machineid(void) {
@@ -51,7 +53,7 @@ void fs_machineid(void) {
51 mid.u8[8] = (mid.u8[8] & 0x3F) | 0x80; 53 mid.u8[8] = (mid.u8[8] & 0x3F) | 0x80;
52 54
53 // write it in a file 55 // write it in a file
54 FILE *fp = fopen(RUN_MACHINEID, "w"); 56 FILE *fp = fopen(RUN_MACHINEID, "we");
55 if (!fp) 57 if (!fp)
56 errExit("fopen"); 58 errExit("fopen");
57 fprintf(fp, "%08x%08x%08x%08x\n", mid.u32[0], mid.u32[1], mid.u32[2], mid.u32[3]); 59 fprintf(fp, "%08x%08x%08x%08x\n", mid.u32[0], mid.u32[1], mid.u32[2], mid.u32[3]);
@@ -59,6 +61,7 @@ void fs_machineid(void) {
59 if (set_perms(RUN_MACHINEID, 0, 0, 0444)) 61 if (set_perms(RUN_MACHINEID, 0, 0, 0444))
60 errExit("set_perms"); 62 errExit("set_perms");
61 63
64 selinux_relabel_path(RUN_MACHINEID, "/etc/machine-id");
62 65
63 struct stat s; 66 struct stat s;
64 if (stat("/etc/machine-id", &s) == 0) { 67 if (stat("/etc/machine-id", &s) == 0) {
@@ -74,6 +77,44 @@ void fs_machineid(void) {
74 } 77 }
75} 78}
76 79
80// Duplicate directory structure from src to dst by creating empty directories.
81// The paths _must_ be identical after their respective prefixes.
82// When finished, dst will point to the target directory. That is, if
83// it starts out pointing to a file, it will instead be truncated so
84// that it contains the parent directory instead.
85static void build_dirs(char *src, char *dst, size_t src_prefix_len, size_t dst_prefix_len) {
86 char *p = src + src_prefix_len + 1;
87 char *q = dst + dst_prefix_len + 1;
88 char *r = dst + dst_prefix_len;
89 struct stat s;
90 bool last = false;
91 *r = '\0';
92 for (; !last; p++, q++) {
93 if (*p == '\0') {
94 last = true;
95 }
96 if (*p == '\0' || (*p == '/' && *(p - 1) != '/')) {
97 // We found a new component of our src path.
98 // Null-terminate it temporarily here so that we can work
99 // with it.
100 *p = '\0';
101 if (stat(src, &s) == 0 && S_ISDIR(s.st_mode)) {
102 // Null-terminate the dst path and undo its previous
103 // termination.
104 *q = '\0';
105 *r = '/';
106 r = q;
107 create_empty_dir_as_root(dst, s.st_mode);
108 }
109 if (!last) {
110 // If we're not at the final terminating null, restore
111 // the slash so that we can continue our traversal.
112 *p = '/';
113 }
114 }
115 }
116}
117
77// return 0 if file not found, 1 if found 118// return 0 if file not found, 1 if found
78static int check_dir_or_file(const char *fname) { 119static int check_dir_or_file(const char *fname) {
79 assert(fname); 120 assert(fname);
@@ -99,11 +140,13 @@ errexit:
99} 140}
100 141
101static void duplicate(const char *fname, const char *private_dir, const char *private_run_dir) { 142static void duplicate(const char *fname, const char *private_dir, const char *private_run_dir) {
102 if (*fname == '~' || *fname == '/' || strstr(fname, "..")) { 143 assert(fname);
144
145 if (*fname == '~' || *fname == '/' || strncmp(fname, "..", 2) == 0) {
103 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", fname); 146 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", fname);
104 exit(1); 147 exit(1);
105 } 148 }
106 invalid_filename(fname); 149 invalid_filename(fname, 0); // no globbing
107 150
108 char *src; 151 char *src;
109 if (asprintf(&src, "%s/%s", private_dir, fname) == -1) 152 if (asprintf(&src, "%s/%s", private_dir, fname) == -1)
@@ -115,33 +158,37 @@ static void duplicate(const char *fname, const char *private_dir, const char *pr
115 } 158 }
116 159
117 if (arg_debug) 160 if (arg_debug)
118 printf("copying %s to private %s\n", src, private_dir); 161 printf("Copying %s to private %s\n", src, private_dir);
119 162
120 struct stat s; 163 char *dst;
121 if (stat(src, &s) == 0 && S_ISDIR(s.st_mode)) { 164 if (asprintf(&dst, "%s/%s", private_run_dir, fname) == -1)
122 // create the directory in RUN_ETC_DIR 165 errExit("asprintf");
123 char *dirname;
124 if (asprintf(&dirname, "%s/%s", private_run_dir, fname) == -1)
125 errExit("asprintf");
126 create_empty_dir_as_root(dirname, s.st_mode);
127 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 3, PATH_FCOPY, src, dirname);
128 free(dirname);
129 }
130 else
131 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 3, PATH_FCOPY, src, private_run_dir);
132 166
167 build_dirs(src, dst, strlen(private_dir), strlen(private_run_dir));
168 sbox_run(SBOX_ROOT | SBOX_SECCOMP, 3, PATH_FCOPY, src, dst);
169
170 free(dst);
133 fs_logger2("clone", src); 171 fs_logger2("clone", src);
134 free(src); 172 free(src);
135} 173}
136 174
137 175
138void fs_private_dir_list(const char *private_dir, const char *private_run_dir, const char *private_list) { 176void fs_private_dir_copy(const char *private_dir, const char *private_run_dir, const char *private_list) {
139 assert(private_dir); 177 assert(private_dir);
140 assert(private_run_dir); 178 assert(private_run_dir);
141 assert(private_list); 179 assert(private_list);
142 180
181 // nothing to do if directory does not exist
182 struct stat s;
183 if (stat(private_dir, &s) == -1) {
184 if (arg_debug)
185 printf("Cannot find %s: %s\n", private_dir, strerror(errno));
186 return;
187 }
188
143 // create /run/firejail/mnt/etc directory 189 // create /run/firejail/mnt/etc directory
144 mkdir_attr(private_run_dir, 0755, 0, 0); 190 mkdir_attr(private_run_dir, 0755, 0, 0);
191 selinux_relabel_path(private_run_dir, private_dir);
145 fs_logger2("tmpfs", private_dir); 192 fs_logger2("tmpfs", private_dir);
146 193
147 fs_logger_print(); // save the current log 194 fs_logger_print(); // save the current log
@@ -160,6 +207,10 @@ void fs_private_dir_list(const char *private_dir, const char *private_run_dir, c
160 207
161 208
162 char *ptr = strtok(dlist, ","); 209 char *ptr = strtok(dlist, ",");
210 if (!ptr) {
211 fprintf(stderr, "Error: invalid private %s argument\n", private_dir);
212 exit(1);
213 }
163 duplicate(ptr, private_dir, private_run_dir); 214 duplicate(ptr, private_dir, private_run_dir);
164 215
165 while ((ptr = strtok(NULL, ",")) != NULL) 216 while ((ptr = strtok(NULL, ",")) != NULL)
@@ -167,10 +218,161 @@ void fs_private_dir_list(const char *private_dir, const char *private_run_dir, c
167 free(dlist); 218 free(dlist);
168 fs_logger_print(); 219 fs_logger_print();
169 } 220 }
221}
222
223void fs_private_dir_mount(const char *private_dir, const char *private_run_dir) {
224 assert(private_dir);
225 assert(private_run_dir);
170 226
171 if (arg_debug) 227 if (arg_debug)
172 printf("Mount-bind %s on top of %s\n", private_run_dir, private_dir); 228 printf("Mount-bind %s on top of %s\n", private_run_dir, private_dir);
229
230 // nothing to do if directory does not exist
231 struct stat s;
232 if (stat(private_dir, &s) == -1) {
233 if (arg_debug)
234 printf("Cannot find %s: %s\n", private_dir, strerror(errno));
235 return;
236 }
237
173 if (mount(private_run_dir, private_dir, NULL, MS_BIND|MS_REC, NULL) < 0) 238 if (mount(private_run_dir, private_dir, NULL, MS_BIND|MS_REC, NULL) < 0)
174 errExit("mount bind"); 239 errExit("mount bind");
175 fs_logger2("mount", private_dir); 240 fs_logger2("mount", private_dir);
241
242 // mask private_run_dir (who knows if there are writable paths, and it is mounted exec)
243 if (mount("tmpfs", private_run_dir, "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
244 errExit("mounting tmpfs");
245 fs_logger2("tmpfs", private_run_dir);
246}
247
248void fs_private_dir_list(const char *private_dir, const char *private_run_dir, const char *private_list) {
249 timetrace_start();
250 fs_private_dir_copy(private_dir, private_run_dir, private_list);
251 fs_private_dir_mount(private_dir, private_run_dir);
252 fmessage("Private %s installed in %0.2f ms\n", private_dir, timetrace_end());
253}
254
255void fs_rebuild_etc(void) {
256 int have_dhcp = 1;
257 if (cfg.dns1 == NULL && !any_dhcp())
258 have_dhcp = 0;
259
260 if (arg_debug)
261 printf("rebuilding /etc directory\n");
262 if (mkdir(RUN_DNS_ETC, 0755))
263 errExit("mkdir");
264 selinux_relabel_path(RUN_DNS_ETC, "/etc");
265 fs_logger("tmpfs /etc");
266
267 DIR *dir = opendir("/etc");
268 if (!dir)
269 errExit("opendir");
270
271 struct stat s;
272 struct dirent *entry;
273 while ((entry = readdir(dir))) {
274 if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
275 continue;
276
277 // skip files in cfg.profile_rebuild_etc list
278 // these files are already blacklisted
279 {
280 ProfileEntry *prf = cfg.profile_rebuild_etc;
281 int found = 0;
282 while (prf) {
283 if (strcmp(entry->d_name, prf->data + 5) == 0) { // 5 is strlen("/etc/")
284 found = 1;
285 break;
286 }
287 prf = prf->next;
288 }
289 if (found)
290 continue;
291 }
292
293 // for resolv.conf we might have to create a brand new file later
294 if (have_dhcp &&
295 (strcmp(entry->d_name, "resolv.conf") == 0 ||
296 strcmp(entry->d_name, "resolv.conf.dhclient-new") == 0))
297 continue;
298// printf("linking %s\n", entry->d_name);
299
300 char *src;
301 if (asprintf(&src, "/etc/%s", entry->d_name) == -1)
302 errExit("asprintf");
303 if (stat(src, &s) != 0) {
304 free(src);
305 continue;
306 }
307
308 char *dest;
309 if (asprintf(&dest, "%s/%s", RUN_DNS_ETC, entry->d_name) == -1)
310 errExit("asprintf");
311
312 int symlink_done = 0;
313 if (is_link(src)) {
314 char *rp =realpath(src, NULL);
315 if (rp == NULL) {
316 free(src);
317 free(dest);
318 continue;
319 }
320 if (symlink(rp, dest))
321 errExit("symlink");
322 else
323 symlink_done = 1;
324 }
325 else if (S_ISDIR(s.st_mode))
326 create_empty_dir_as_root(dest, s.st_mode);
327 else
328 create_empty_file_as_root(dest, s.st_mode);
329
330 // bind-mount src on top of dest
331 if (!symlink_done) {
332 if (mount(src, dest, NULL, MS_BIND|MS_REC, NULL) < 0)
333 errExit("mount bind mirroring /etc");
334 }
335 fs_logger2("clone", src);
336
337 free(src);
338 free(dest);
339 }
340 closedir(dir);
341
342 // mount bind our private etc directory on top of /etc
343 if (arg_debug)
344 printf("Mount-bind %s on top of /etc\n", RUN_DNS_ETC);
345 if (mount(RUN_DNS_ETC, "/etc", NULL, MS_BIND|MS_REC, NULL) < 0)
346 errExit("mount bind mirroring /etc");
347 fs_logger("mount /etc");
348
349 if (have_dhcp == 0)
350 return;
351
352 if (arg_debug)
353 printf("Creating a new /etc/resolv.conf file\n");
354 FILE *fp = fopen("/etc/resolv.conf", "wxe");
355 if (!fp) {
356 fprintf(stderr, "Error: cannot create /etc/resolv.conf file\n");
357 exit(1);
358 }
359
360 if (cfg.dns1) {
361 if (any_dhcp())
362 fwarning("network setup uses DHCP, nameservers will likely be overwritten\n");
363 fprintf(fp, "nameserver %s\n", cfg.dns1);
364 }
365 if (cfg.dns2)
366 fprintf(fp, "nameserver %s\n", cfg.dns2);
367 if (cfg.dns3)
368 fprintf(fp, "nameserver %s\n", cfg.dns3);
369 if (cfg.dns4)
370 fprintf(fp, "nameserver %s\n", cfg.dns4);
371
372 // mode and owner
373 SET_PERMS_STREAM(fp, 0, 0, 0644);
374
375 fclose(fp);
376
377 fs_logger("create /etc/resolv.conf");
176} 378}
diff --git a/src/firejail/fs_home.c b/src/firejail/fs_home.c
index 9e3678c33..0ed476063 100644
--- a/src/firejail/fs_home.c
+++ b/src/firejail/fs_home.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,9 +20,7 @@
20#include "firejail.h" 20#include "firejail.h"
21#include <sys/mount.h> 21#include <sys/mount.h>
22#include <linux/limits.h> 22#include <linux/limits.h>
23#include <glob.h>
24#include <dirent.h> 23#include <dirent.h>
25#include <fcntl.h>
26#include <errno.h> 24#include <errno.h>
27#include <sys/stat.h> 25#include <sys/stat.h>
28#include <sys/types.h> 26#include <sys/types.h>
@@ -31,148 +29,182 @@
31#include <grp.h> 29#include <grp.h>
32//#include <ftw.h> 30//#include <ftw.h>
33 31
34static void skel(const char *homedir, uid_t u, gid_t g) { 32#include <fcntl.h>
35 char *fname; 33#ifndef O_PATH
34#define O_PATH 010000000
35#endif
36
37static void skel(const char *homedir) {
38 EUID_ASSERT();
36 39
37 // zsh 40 // zsh
38 if (!arg_shell_none && (strcmp(cfg.shell,"/usr/bin/zsh") == 0 || strcmp(cfg.shell,"/bin/zsh") == 0)) { 41 if (!arg_shell_none && (strcmp(cfg.shell,"/usr/bin/zsh") == 0 || strcmp(cfg.shell,"/bin/zsh") == 0)) {
39 // copy skel files 42 // copy skel files
43 char *fname;
40 if (asprintf(&fname, "%s/.zshrc", homedir) == -1) 44 if (asprintf(&fname, "%s/.zshrc", homedir) == -1)
41 errExit("asprintf"); 45 errExit("asprintf");
42 struct stat s;
43 // don't copy it if we already have the file 46 // don't copy it if we already have the file
44 if (stat(fname, &s) == 0) 47 if (access(fname, F_OK) == 0)
45 return; 48 return;
46 if (is_link(fname)) { // stat on dangling symlinks fails, try again using lstat 49 if (is_link(fname)) { // access(3) on dangling symlinks fails, try again using lstat
47 fprintf(stderr, "Error: invalid %s file\n", fname); 50 fprintf(stderr, "Error: invalid %s file\n", fname);
48 exit(1); 51 exit(1);
49 } 52 }
50 if (stat("/etc/skel/.zshrc", &s) == 0) { 53 if (access("/etc/skel/.zshrc", R_OK) == 0) {
51 copy_file_as_user("/etc/skel/.zshrc", fname, u, g, 0644); // regular user 54 copy_file_as_user("/etc/skel/.zshrc", fname, 0644); // regular user
52 fs_logger("clone /etc/skel/.zshrc"); 55 fs_logger("clone /etc/skel/.zshrc");
56 fs_logger2("clone", fname);
53 } 57 }
54 else { 58 else {
55 touch_file_as_user(fname, u, g, 0644); 59 touch_file_as_user(fname, 0644);
56 fs_logger2("touch", fname); 60 fs_logger2("touch", fname);
57 } 61 }
62 selinux_relabel_path(fname, fname);
58 free(fname); 63 free(fname);
59 } 64 }
60 // csh 65 // csh
61 else if (!arg_shell_none && strcmp(cfg.shell,"/bin/csh") == 0) { 66 else if (!arg_shell_none && strcmp(cfg.shell,"/bin/csh") == 0) {
62 // copy skel files 67 // copy skel files
68 char *fname;
63 if (asprintf(&fname, "%s/.cshrc", homedir) == -1) 69 if (asprintf(&fname, "%s/.cshrc", homedir) == -1)
64 errExit("asprintf"); 70 errExit("asprintf");
65 struct stat s;
66
67 // don't copy it if we already have the file 71 // don't copy it if we already have the file
68 if (stat(fname, &s) == 0) 72 if (access(fname, F_OK) == 0)
69 return; 73 return;
70 if (is_link(fname)) { // stat on dangling symlinks fails, try again using lstat 74 if (is_link(fname)) { // access(3) on dangling symlinks fails, try again using lstat
71 fprintf(stderr, "Error: invalid %s file\n", fname); 75 fprintf(stderr, "Error: invalid %s file\n", fname);
72 exit(1); 76 exit(1);
73 } 77 }
74 if (stat("/etc/skel/.cshrc", &s) == 0) { 78 if (access("/etc/skel/.cshrc", R_OK) == 0) {
75 copy_file_as_user("/etc/skel/.cshrc", fname, u, g, 0644); // regular user 79 copy_file_as_user("/etc/skel/.cshrc", fname, 0644); // regular user
76 fs_logger("clone /etc/skel/.cshrc"); 80 fs_logger("clone /etc/skel/.cshrc");
81 fs_logger2("clone", fname);
77 } 82 }
78 else { 83 else {
79 touch_file_as_user(fname, u, g, 0644); 84 touch_file_as_user(fname, 0644);
80 fs_logger2("touch", fname); 85 fs_logger2("touch", fname);
81 } 86 }
87 selinux_relabel_path(fname, fname);
82 free(fname); 88 free(fname);
83 } 89 }
84 // bash etc. 90 // bash etc.
85 else { 91 else {
86 // copy skel files 92 // copy skel files
93 char *fname;
87 if (asprintf(&fname, "%s/.bashrc", homedir) == -1) 94 if (asprintf(&fname, "%s/.bashrc", homedir) == -1)
88 errExit("asprintf"); 95 errExit("asprintf");
89 struct stat s;
90 // don't copy it if we already have the file 96 // don't copy it if we already have the file
91 if (stat(fname, &s) == 0) 97 if (access(fname, F_OK) == 0)
92 return; 98 return;
93 if (is_link(fname)) { // stat on dangling symlinks fails, try again using lstat 99 if (is_link(fname)) { // access(3) on dangling symlinks fails, try again using lstat
94 fprintf(stderr, "Error: invalid %s file\n", fname); 100 fprintf(stderr, "Error: invalid %s file\n", fname);
95 exit(1); 101 exit(1);
96 } 102 }
97 if (stat("/etc/skel/.bashrc", &s) == 0) { 103 if (access("/etc/skel/.bashrc", R_OK) == 0) {
98 copy_file_as_user("/etc/skel/.bashrc", fname, u, g, 0644); // regular user 104 copy_file_as_user("/etc/skel/.bashrc", fname, 0644); // regular user
99 fs_logger("clone /etc/skel/.bashrc"); 105 fs_logger("clone /etc/skel/.bashrc");
106 fs_logger2("clone", fname);
100 } 107 }
108 selinux_relabel_path(fname, fname);
101 free(fname); 109 free(fname);
102 } 110 }
103} 111}
104 112
105static int store_xauthority(void) { 113static int store_xauthority(void) {
114 EUID_ASSERT();
115 if (arg_x11_block)
116 return 0;
117
106 // put a copy of .Xauthority in XAUTHORITY_FILE 118 // put a copy of .Xauthority in XAUTHORITY_FILE
107 char *src;
108 char *dest = RUN_XAUTHORITY_FILE; 119 char *dest = RUN_XAUTHORITY_FILE;
109 // create an empty file as root, and change ownership to user 120 char *src;
110 FILE *fp = fopen(dest, "w");
111 if (fp) {
112 fprintf(fp, "\n");
113 SET_PERMS_STREAM(fp, getuid(), getgid(), 0600);
114 fclose(fp);
115 }
116
117 if (asprintf(&src, "%s/.Xauthority", cfg.homedir) == -1) 121 if (asprintf(&src, "%s/.Xauthority", cfg.homedir) == -1)
118 errExit("asprintf"); 122 errExit("asprintf");
119 123
120 struct stat s; 124 struct stat s;
121 if (stat(src, &s) == 0) { 125 if (lstat(src, &s) == 0) {
122 if (is_link(src)) { 126 if (S_ISLNK(s.st_mode)) {
123 fwarning("invalid .Xauthority file\n"); 127 fwarning("invalid .Xauthority file\n");
128 free(src);
124 return 0; 129 return 0;
125 } 130 }
126 131
127 copy_file_as_user(src, dest, getuid(), getgid(), 0600); // regular user 132 // create an empty file as root, and change ownership to user
133 EUID_ROOT();
134 FILE *fp = fopen(dest, "we");
135 if (fp) {
136 fprintf(fp, "\n");
137 SET_PERMS_STREAM(fp, getuid(), getgid(), 0600);
138 fclose(fp);
139 }
140 else
141 errExit("fopen");
142 EUID_USER();
143
144 copy_file_as_user(src, dest, 0600); // regular user
145 selinux_relabel_path(dest, src);
128 fs_logger2("clone", dest); 146 fs_logger2("clone", dest);
147 free(src);
129 return 1; // file copied 148 return 1; // file copied
130 } 149 }
131 150
151 free(src);
132 return 0; 152 return 0;
133} 153}
134 154
135static int store_asoundrc(void) { 155static int store_asoundrc(void) {
136 // put a copy of .Xauthority in XAUTHORITY_FILE 156 EUID_ASSERT();
137 char *src; 157 if (arg_nosound)
138 char *dest = RUN_ASOUNDRC_FILE; 158 return 0;
139 // create an empty file as root, and change ownership to user
140 FILE *fp = fopen(dest, "w");
141 if (fp) {
142 fprintf(fp, "\n");
143 SET_PERMS_STREAM(fp, getuid(), getgid(), 0644);
144 fclose(fp);
145 }
146 159
160 // put a copy of .asoundrc in ASOUNDRC_FILE
161 char *dest = RUN_ASOUNDRC_FILE;
162 char *src;
147 if (asprintf(&src, "%s/.asoundrc", cfg.homedir) == -1) 163 if (asprintf(&src, "%s/.asoundrc", cfg.homedir) == -1)
148 errExit("asprintf"); 164 errExit("asprintf");
149 165
150 struct stat s; 166 struct stat s;
151 if (stat(src, &s) == 0) { 167 if (lstat(src, &s) == 0) {
152 if (is_link(src)) { 168 if (S_ISLNK(s.st_mode)) {
153 // make sure the real path of the file is inside the home directory 169 // make sure the real path of the file is inside the home directory
154 /* coverity[toctou] */ 170 /* coverity[toctou] */
155 char* rp = realpath(src, NULL); 171 char *rp = realpath(src, NULL);
156 if (!rp) { 172 if (!rp) {
157 fprintf(stderr, "Error: Cannot access %s\n", src); 173 fprintf(stderr, "Error: Cannot access %s\n", src);
158 exit(1); 174 exit(1);
159 } 175 }
160 if (strncmp(rp, cfg.homedir, strlen(cfg.homedir)) != 0) { 176 if (strncmp(rp, cfg.homedir, strlen(cfg.homedir)) != 0 || rp[strlen(cfg.homedir)] != '/') {
161 fprintf(stderr, "Error: .asoundrc is a symbolic link pointing to a file outside home directory\n"); 177 fprintf(stderr, "Error: .asoundrc is a symbolic link pointing to a file outside home directory\n");
162 exit(1); 178 exit(1);
163 } 179 }
164 free(rp); 180 free(rp);
165 } 181 }
166 182
167 copy_file_as_user(src, dest, getuid(), getgid(), 0644); // regular user 183 // create an empty file as root, and change ownership to user
184 EUID_ROOT();
185 FILE *fp = fopen(dest, "we");
186 if (fp) {
187 fprintf(fp, "\n");
188 SET_PERMS_STREAM(fp, getuid(), getgid(), 0644);
189 fclose(fp);
190 }
191 else
192 errExit("fopen");
193 EUID_USER();
194
195 copy_file_as_user(src, dest, 0644); // regular user
168 fs_logger2("clone", dest); 196 fs_logger2("clone", dest);
197 selinux_relabel_path(dest, src);
198 free(src);
169 return 1; // file copied 199 return 1; // file copied
170 } 200 }
171 201
202 free(src);
172 return 0; 203 return 0;
173} 204}
174 205
175static void copy_xauthority(void) { 206static void copy_xauthority(void) {
207 EUID_ASSERT();
176 // copy XAUTHORITY_FILE in the new home directory 208 // copy XAUTHORITY_FILE in the new home directory
177 char *src = RUN_XAUTHORITY_FILE ; 209 char *src = RUN_XAUTHORITY_FILE ;
178 char *dest; 210 char *dest;
@@ -185,15 +217,19 @@ static void copy_xauthority(void) {
185 exit(1); 217 exit(1);
186 } 218 }
187 219
188 copy_file_as_user(src, dest, getuid(), getgid(), S_IRUSR | S_IWUSR); // regular user 220 copy_file_as_user(src, dest, S_IRUSR | S_IWUSR); // regular user
189 fs_logger2("clone", dest); 221 fs_logger2("clone", dest);
222 selinux_relabel_path(dest, dest);
223 free(dest);
190 224
191 // delete the temporary file 225 EUID_ROOT();
192 unlink(src); 226 unlink(src); // delete the temporary file
227 EUID_USER();
193} 228}
194 229
195static void copy_asoundrc(void) { 230static void copy_asoundrc(void) {
196 // copy XAUTHORITY_FILE in the new home directory 231 EUID_ASSERT();
232 // copy ASOUNDRC_FILE in the new home directory
197 char *src = RUN_ASOUNDRC_FILE ; 233 char *src = RUN_ASOUNDRC_FILE ;
198 char *dest; 234 char *dest;
199 if (asprintf(&dest, "%s/.asoundrc", cfg.homedir) == -1) 235 if (asprintf(&dest, "%s/.asoundrc", cfg.homedir) == -1)
@@ -205,11 +241,14 @@ static void copy_asoundrc(void) {
205 exit(1); 241 exit(1);
206 } 242 }
207 243
208 copy_file_as_user(src, dest, getuid(), getgid(), S_IRUSR | S_IWUSR); // regular user 244 copy_file_as_user(src, dest, S_IRUSR | S_IWUSR); // regular user
209 fs_logger2("clone", dest); 245 fs_logger2("clone", dest);
246 selinux_relabel_path(dest, dest);
247 free(dest);
210 248
211 // delete the temporary file 249 EUID_ROOT();
212 unlink(src); 250 unlink(src); // delete the temporary file
251 EUID_USER();
213} 252}
214 253
215// private mode (--private=homedir): 254// private mode (--private=homedir):
@@ -222,45 +261,86 @@ void fs_private_homedir(void) {
222 char *private_homedir = cfg.home_private; 261 char *private_homedir = cfg.home_private;
223 assert(homedir); 262 assert(homedir);
224 assert(private_homedir); 263 assert(private_homedir);
264 EUID_ASSERT();
265
266 uid_t u = getuid();
267 // gid_t g = getgid();
225 268
226 int xflag = store_xauthority(); 269 int xflag = store_xauthority();
227 int aflag = store_asoundrc(); 270 int aflag = store_asoundrc();
228 271
229 uid_t u = getuid();
230 gid_t g = getgid();
231
232 // mount bind private_homedir on top of homedir 272 // mount bind private_homedir on top of homedir
233 if (arg_debug) 273 if (arg_debug)
234 printf("Mount-bind %s on top of %s\n", private_homedir, homedir); 274 printf("Mount-bind %s on top of %s\n", private_homedir, homedir);
235 if (mount(private_homedir, homedir, NULL, MS_NOSUID | MS_NODEV | MS_BIND | MS_REC, NULL) < 0) 275 // get file descriptors for homedir and private_homedir, fails if there is any symlink
276 int src = safer_openat(-1, private_homedir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
277 if (src == -1)
278 errExit("opening private directory");
279 int dst = safer_openat(-1, homedir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
280 if (dst == -1)
281 errExit("opening home directory");
282 // both mount source and target should be owned by the user
283 struct stat s;
284 if (fstat(src, &s) == -1)
285 errExit("fstat");
286 if (s.st_uid != u) {
287 fprintf(stderr, "Error: private directory is not owned by the current user\n");
288 exit(1);
289 }
290 if ((S_IRWXU & s.st_mode) != S_IRWXU)
291 fwarning("no full permissions on private directory\n");
292 if (fstat(dst, &s) == -1)
293 errExit("fstat");
294 if (s.st_uid != u) {
295 fprintf(stderr, "Error: cannot mount private directory:\n"
296 "Home directory is not owned by the current user\n");
297 exit(1);
298 }
299 // mount via the links in /proc/self/fd
300 EUID_ROOT();
301 if (bind_mount_by_fd(src, dst))
236 errExit("mount bind"); 302 errExit("mount bind");
237 fs_logger3("mount-bind", private_homedir, cfg.homedir); 303 EUID_USER();
238 fs_logger2("whitelist", cfg.homedir); 304
305 // check /proc/self/mountinfo to confirm the mount is ok
306 MountData *mptr = get_last_mount();
307 size_t len = strlen(homedir);
308 if (strncmp(mptr->dir, homedir, len) != 0 ||
309 (*(mptr->dir + len) != '\0' && *(mptr->dir + len) != '/'))
310 errLogExit("invalid private mount");
311
312 close(src);
313 close(dst);
314 fs_logger3("mount-bind", private_homedir, homedir);
315 fs_logger2("whitelist", homedir);
239// preserve mode and ownership 316// preserve mode and ownership
240// if (chown(homedir, s.st_uid, s.st_gid) == -1) 317// if (chown(homedir, s.st_uid, s.st_gid) == -1)
241// errExit("mount-bind chown"); 318// errExit("mount-bind chown");
242// if (chmod(homedir, s.st_mode) == -1) 319// if (chmod(homedir, s.st_mode) == -1)
243// errExit("mount-bind chmod"); 320// errExit("mount-bind chmod");
244 321
322 EUID_ROOT();
245 if (u != 0) { 323 if (u != 0) {
246 // mask /root 324 // mask /root
247 if (arg_debug) 325 if (arg_debug)
248 printf("Mounting a new /root directory\n"); 326 printf("Mounting a new /root directory\n");
249 if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME | MS_REC, "mode=700,gid=0") < 0) 327 if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME, "mode=700,gid=0") < 0)
250 errExit("mounting home directory"); 328 errExit("mounting /root directory");
329 selinux_relabel_path("/root", "/root");
251 fs_logger("tmpfs /root"); 330 fs_logger("tmpfs /root");
252 } 331 }
253 else { 332 if (u == 0 && !arg_allusers) {
254 // mask /home 333 // mask /home
255 if (arg_debug) 334 if (arg_debug)
256 printf("Mounting a new /home directory\n"); 335 printf("Mounting a new /home directory\n");
257 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 336 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME, "mode=755,gid=0") < 0)
258 errExit("mounting home directory"); 337 errExit("mounting /home directory");
338 selinux_relabel_path("/home", "/home");
259 fs_logger("tmpfs /home"); 339 fs_logger("tmpfs /home");
260 } 340 }
341 EUID_USER();
261 342
262 343 skel(homedir);
263 skel(homedir, u, g);
264 if (xflag) 344 if (xflag)
265 copy_xauthority(); 345 copy_xauthority();
266 if (aflag) 346 if (aflag)
@@ -275,87 +355,94 @@ void fs_private_homedir(void) {
275void fs_private(void) { 355void fs_private(void) {
276 char *homedir = cfg.homedir; 356 char *homedir = cfg.homedir;
277 assert(homedir); 357 assert(homedir);
358 EUID_ASSERT();
359
278 uid_t u = getuid(); 360 uid_t u = getuid();
279 gid_t g = getgid(); 361 gid_t g = getgid();
280 362
281 int xflag = store_xauthority(); 363 int xflag = store_xauthority();
282 int aflag = store_asoundrc(); 364 int aflag = store_asoundrc();
283 365
284 // mask /home 366 EUID_ROOT();
285 if (arg_debug)
286 printf("Mounting a new /home directory\n");
287 if (u == 0 && arg_allusers) // allow --allusers when starting the sandbox as root
288 ;
289 else {
290 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
291 errExit("mounting home directory");
292 fs_logger("tmpfs /home");
293 }
294
295 // mask /root 367 // mask /root
296 if (arg_debug) 368 if (arg_debug)
297 printf("Mounting a new /root directory\n"); 369 printf("Mounting a new /root directory\n");
298 if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME | MS_REC, "mode=700,gid=0") < 0) 370 if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME, "mode=700,gid=0") < 0)
299 errExit("mounting root directory"); 371 errExit("mounting /root directory");
372 selinux_relabel_path("/root", "/root");
300 fs_logger("tmpfs /root"); 373 fs_logger("tmpfs /root");
301 374
302 if (u != 0) { 375 // mask /home
303 // create /home/user 376 if (!arg_allusers) {
304 if (arg_debug) 377 if (arg_debug)
305 printf("Create a new user directory\n"); 378 printf("Mounting a new /home directory\n");
306 if (mkdir(homedir, S_IRWXU) == -1) { 379 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_STRICTATIME, "mode=755,gid=0") < 0)
307 if (mkpath_as_root(homedir) == -1) 380 errExit("mounting /home directory");
308 errExit("mkpath"); 381 selinux_relabel_path("/home", "/home");
309 if (mkdir(homedir, S_IRWXU) == -1 && errno != EEXIST) 382 fs_logger("tmpfs /home");
310 errExit("mkdir"); 383 }
384
385 if (u != 0) {
386 if (!arg_allusers && strncmp(homedir, "/home/", 6) == 0) {
387 // create new empty /home/user directory
388 if (arg_debug)
389 printf("Create a new user directory\n");
390 if (mkdir(homedir, S_IRWXU) == -1) {
391 if (mkpath_as_root(homedir) == -1)
392 errExit("mkpath");
393 if (mkdir(homedir, S_IRWXU) == -1)
394 errExit("mkdir");
395 }
396 if (chown(homedir, u, g) < 0)
397 errExit("chown");
398
399 fs_logger2("mkdir", homedir);
400 fs_logger2("tmpfs", homedir);
311 } 401 }
312 if (chown(homedir, u, g) < 0) 402 else
313 errExit("chown"); 403 // mask user home directory
314 fs_logger2("mkdir", homedir); 404 // the directory should be owned by the current user
405 fs_tmpfs(homedir, 1);
406
407 selinux_relabel_path(homedir, homedir);
315 } 408 }
409 EUID_USER();
316 410
317 skel(homedir, u, g); 411 skel(homedir);
318 if (xflag) 412 if (xflag)
319 copy_xauthority(); 413 copy_xauthority();
320 if (aflag) 414 if (aflag)
321 copy_asoundrc(); 415 copy_asoundrc();
322
323} 416}
324 417
325// check new private home directory (--private= option) - exit if it fails 418// check new private home directory (--private= option) - exit if it fails
326void fs_check_private_dir(void) { 419void fs_check_private_dir(void) {
327 EUID_ASSERT(); 420 EUID_ASSERT();
328 invalid_filename(cfg.home_private); 421 invalid_filename(cfg.home_private, 0); // no globbing
329 422
330 // Expand the home directory 423 // Expand the home directory
331 char *tmp = expand_home(cfg.home_private, cfg.homedir); 424 char *tmp = expand_macros(cfg.home_private);
332 cfg.home_private = realpath(tmp, NULL); 425 cfg.home_private = realpath(tmp, NULL);
333 free(tmp); 426 free(tmp);
334 427
335 if (!cfg.home_private 428 if (!cfg.home_private
336 || !is_dir(cfg.home_private) 429 || !is_dir(cfg.home_private)) {
337 || is_link(cfg.home_private)
338 || strstr(cfg.home_private, "..")) {
339 fprintf(stderr, "Error: invalid private directory\n"); 430 fprintf(stderr, "Error: invalid private directory\n");
340 exit(1); 431 exit(1);
341 } 432 }
433}
342 434
343 // check home directory and chroot home directory have the same owner 435// check new private working directory (--private-cwd= option) - exit if it fails
344 struct stat s2; 436void fs_check_private_cwd(const char *dir) {
345 int rv = stat(cfg.home_private, &s2); 437 EUID_ASSERT();
346 if (rv < 0) { 438 invalid_filename(dir, 0); // no globbing
347 fprintf(stderr, "Error: cannot find %s directory\n", cfg.home_private);
348 exit(1);
349 }
350 439
351 struct stat s1; 440 // Expand the working directory
352 rv = stat(cfg.homedir, &s1); 441 cfg.cwd = expand_macros(dir);
353 if (rv < 0) { 442
354 fprintf(stderr, "Error: cannot find %s directory, full path name required\n", cfg.homedir); 443 // realpath/is_dir not used because path may not exist outside of jail
355 exit(1); 444 if (strstr(cfg.cwd, "..")) {
356 } 445 fprintf(stderr, "Error: invalid private working directory\n");
357 if (s1.st_uid != s2.st_uid) {
358 printf("Error: --private directory should be owned by the current user\n");
359 exit(1); 446 exit(1);
360 } 447 }
361} 448}
@@ -364,15 +451,16 @@ void fs_check_private_dir(void) {
364// --private-home 451// --private-home
365//*********************************************************************************** 452//***********************************************************************************
366static char *check_dir_or_file(const char *name) { 453static char *check_dir_or_file(const char *name) {
454 EUID_ASSERT();
367 assert(name); 455 assert(name);
368 456
369 // basic checks 457 // basic checks
370 invalid_filename(name); 458 invalid_filename(name, 0); // no globbing
371 if (arg_debug) 459 if (arg_debug)
372 printf("Private home: checking %s\n", name); 460 printf("Private home: checking %s\n", name);
373 461
374 // expand home directory 462 // expand home directory
375 char *fname = expand_home(name, cfg.homedir); 463 char *fname = expand_macros(name);
376 assert(fname); 464 assert(fname);
377 465
378 // If it doesn't start with '/', it must be relative to homedir 466 // If it doesn't start with '/', it must be relative to homedir
@@ -387,6 +475,8 @@ static char *check_dir_or_file(const char *name) {
387 // we allow only files in user home directory or symbolic links to files or directories owned by the user 475 // we allow only files in user home directory or symbolic links to files or directories owned by the user
388 struct stat s; 476 struct stat s;
389 if (lstat(fname, &s) == 0 && S_ISLNK(s.st_mode)) { 477 if (lstat(fname, &s) == 0 && S_ISLNK(s.st_mode)) {
478 if (strncmp(fname, cfg.homedir, strlen(cfg.homedir)) != 0 || fname[strlen(cfg.homedir)] != '/')
479 goto errexit;
390 if (stat(fname, &s) == 0) { 480 if (stat(fname, &s) == 0) {
391 if (s.st_uid != getuid()) { 481 if (s.st_uid != getuid()) {
392 fprintf(stderr, "Error: symbolic link %s to file or directory not owned by the user\n", fname); 482 fprintf(stderr, "Error: symbolic link %s to file or directory not owned by the user\n", fname);
@@ -394,37 +484,35 @@ static char *check_dir_or_file(const char *name) {
394 } 484 }
395 return fname; 485 return fname;
396 } 486 }
397 else { 487 else // dangling link
398 fprintf(stderr, "Error: invalid file %s\n", name); 488 goto errexit;
399 exit(1);
400 }
401 } 489 }
402 else { 490 else {
403 // check the file is in user home directory, a full home directory is not allowed 491 // check the file is in user home directory
404 char *rname = realpath(fname, NULL); 492 char *rname = realpath(fname, NULL);
405 if (!rname || 493 if (!rname || strncmp(rname, cfg.homedir, strlen(cfg.homedir)) != 0)
406 strncmp(rname, cfg.homedir, strlen(cfg.homedir)) != 0 || 494 goto errexit;
407 strcmp(rname, cfg.homedir) == 0) { 495 // a full home directory is not allowed
408 fprintf(stderr, "Error: invalid file %s\n", name);
409 exit(1);
410 }
411
412 // only top files and directories in user home are allowed
413 char *ptr = rname + strlen(cfg.homedir); 496 char *ptr = rname + strlen(cfg.homedir);
414 assert(*ptr != '\0'); 497 if (*ptr != '/')
498 goto errexit;
499 // only top files and directories in user home are allowed
415 ptr = strchr(++ptr, '/'); 500 ptr = strchr(++ptr, '/');
416 if (ptr) { 501 if (ptr) {
417 if (*ptr != '\0') { 502 fprintf(stderr, "Error: only top files and directories in user home are allowed\n");
418 fprintf(stderr, "Error: only top files and directories in user home are allowed\n"); 503 exit(1);
419 exit(1);
420 }
421 } 504 }
422 free(fname); 505 free(fname);
423 return rname; 506 return rname;
424 } 507 }
508
509errexit:
510 fprintf(stderr, "Error: invalid file %s\n", name);
511 exit(1);
425} 512}
426 513
427static void duplicate(char *name) { 514static void duplicate(char *name) {
515 EUID_ASSERT();
428 char *fname = check_dir_or_file(name); 516 char *fname = check_dir_or_file(name);
429 517
430 if (arg_debug) 518 if (arg_debug)
@@ -438,14 +526,14 @@ static void duplicate(char *name) {
438 } 526 }
439 else if (S_ISDIR(s.st_mode)) { 527 else if (S_ISDIR(s.st_mode)) {
440 // create the directory in RUN_HOME_DIR 528 // create the directory in RUN_HOME_DIR
441 char *name; 529 char *path;
442 char *ptr = strrchr(fname, '/'); 530 char *ptr = strrchr(fname, '/');
443 ptr++; 531 ptr++;
444 if (asprintf(&name, "%s/%s", RUN_HOME_DIR, ptr) == -1) 532 if (asprintf(&path, "%s/%s", RUN_HOME_DIR, ptr) == -1)
445 errExit("asprintf"); 533 errExit("asprintf");
446 mkdir_attr(name, 0755, getuid(), getgid()); 534 create_empty_dir_as_user(path, 0755);
447 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FCOPY, fname, name); 535 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FCOPY, fname, path);
448 free(name); 536 free(path);
449 } 537 }
450 else 538 else
451 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FCOPY, fname, RUN_HOME_DIR); 539 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FCOPY, fname, RUN_HOME_DIR);
@@ -466,26 +554,36 @@ void fs_private_home_list(void) {
466 char *private_list = cfg.home_private_keep; 554 char *private_list = cfg.home_private_keep;
467 assert(homedir); 555 assert(homedir);
468 assert(private_list); 556 assert(private_list);
557 EUID_ASSERT();
469 558
470 int xflag = store_xauthority(); 559 timetrace_start();
471 int aflag = store_asoundrc();
472 560
473 uid_t uid = getuid(); 561 uid_t uid = getuid();
474 gid_t gid = getgid(); 562 gid_t gid = getgid();
475 563
564 int xflag = store_xauthority();
565 int aflag = store_asoundrc();
566
476 // create /run/firejail/mnt/home directory 567 // create /run/firejail/mnt/home directory
568 EUID_ROOT();
477 mkdir_attr(RUN_HOME_DIR, 0755, uid, gid); 569 mkdir_attr(RUN_HOME_DIR, 0755, uid, gid);
570 selinux_relabel_path(RUN_HOME_DIR, homedir);
571
478 fs_logger_print(); // save the current log 572 fs_logger_print(); // save the current log
573 EUID_USER();
479 574
575 // copy the list of files in the new home directory
480 if (arg_debug) 576 if (arg_debug)
481 printf("Copying files in the new home:\n"); 577 printf("Copying files in the new home:\n");
482
483 // copy the list of files in the new home directory
484 char *dlist = strdup(cfg.home_private_keep); 578 char *dlist = strdup(cfg.home_private_keep);
485 if (!dlist) 579 if (!dlist)
486 errExit("strdup"); 580 errExit("strdup");
487 581
488 char *ptr = strtok(dlist, ","); 582 char *ptr = strtok(dlist, ",");
583 if (!ptr) {
584 fprintf(stderr, "Error: invalid private-home argument\n");
585 exit(1);
586 }
489 duplicate(ptr); 587 duplicate(ptr);
490 while ((ptr = strtok(NULL, ",")) != NULL) 588 while ((ptr = strtok(NULL, ",")) != NULL)
491 duplicate(ptr); 589 duplicate(ptr);
@@ -496,27 +594,62 @@ void fs_private_home_list(void) {
496 if (arg_debug) 594 if (arg_debug)
497 printf("Mount-bind %s on top of %s\n", RUN_HOME_DIR, homedir); 595 printf("Mount-bind %s on top of %s\n", RUN_HOME_DIR, homedir);
498 596
499 if (mount(RUN_HOME_DIR, homedir, NULL, MS_BIND|MS_REC, NULL) < 0) 597 int fd = safer_openat(-1, homedir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
598 if (fd == -1)
599 errExit("opening home directory");
600 // home directory should be owned by the user
601 struct stat s;
602 if (fstat(fd, &s) == -1)
603 errExit("fstat");
604 if (s.st_uid != uid) {
605 fprintf(stderr, "Error: cannot mount private directory:\n"
606 "Home directory is not owned by the current user\n");
607 exit(1);
608 }
609 // mount using the file descriptor
610 EUID_ROOT();
611 if (bind_mount_path_to_fd(RUN_HOME_DIR, fd))
500 errExit("mount bind"); 612 errExit("mount bind");
613 EUID_USER();
614 close(fd);
501 615
616 // check /proc/self/mountinfo to confirm the mount is ok
617 MountData *mptr = get_last_mount();
618 if (strcmp(mptr->dir, homedir) != 0 || strcmp(mptr->fstype, "tmpfs") != 0)
619 errLogExit("invalid private-home mount");
620 fs_logger2("tmpfs", homedir);
621
622 EUID_ROOT();
502 if (uid != 0) { 623 if (uid != 0) {
503 // mask /root 624 // mask /root
504 if (arg_debug) 625 if (arg_debug)
505 printf("Mounting a new /root directory\n"); 626 printf("Mounting a new /root directory\n");
506 if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=700,gid=0") < 0) 627 if (mount("tmpfs", "/root", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=700,gid=0") < 0)
507 errExit("mounting home directory"); 628 errExit("mounting /root directory");
629 selinux_relabel_path("/root", "/root");
630 fs_logger("tmpfs /root");
508 } 631 }
509 else { 632 if (uid == 0 && !arg_allusers) {
510 // mask /home 633 // mask /home
511 if (arg_debug) 634 if (arg_debug)
512 printf("Mounting a new /home directory\n"); 635 printf("Mounting a new /home directory\n");
513 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 636 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
514 errExit("mounting home directory"); 637 errExit("mounting /home directory");
638 selinux_relabel_path("/home", "/home");
639 fs_logger("tmpfs /home");
515 } 640 }
516 641
517 skel(homedir, uid, gid); 642 // mask RUN_HOME_DIR, it is writable and not noexec
643 if (mount("tmpfs", RUN_HOME_DIR, "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
644 errExit("mounting tmpfs");
645 EUID_USER();
646
647 skel(homedir);
518 if (xflag) 648 if (xflag)
519 copy_xauthority(); 649 copy_xauthority();
520 if (aflag) 650 if (aflag)
521 copy_asoundrc(); 651 copy_asoundrc();
652
653 if (!arg_quiet)
654 fprintf(stderr, "Home directory installed in %0.2f ms\n", timetrace_end());
522} 655}
diff --git a/src/firejail/fs_hostname.c b/src/firejail/fs_hostname.c
index b22870713..7d320e90b 100644
--- a/src/firejail/fs_hostname.c
+++ b/src/firejail/fs_hostname.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -47,11 +47,11 @@ void fs_hostname(const char *hostname) {
47 printf("Creating a new /etc/hosts file\n"); 47 printf("Creating a new /etc/hosts file\n");
48 // copy /etc/host into our new file, and modify it on the fly 48 // copy /etc/host into our new file, and modify it on the fly
49 /* coverity[toctou] */ 49 /* coverity[toctou] */
50 FILE *fp1 = fopen("/etc/hosts", "r"); 50 FILE *fp1 = fopen("/etc/hosts", "re");
51 if (!fp1) 51 if (!fp1)
52 goto errexit; 52 goto errexit;
53 53
54 FILE *fp2 = fopen(RUN_HOSTS_FILE, "w"); 54 FILE *fp2 = fopen(RUN_HOSTS_FILE, "we");
55 if (!fp2) { 55 if (!fp2) {
56 fclose(fp1); 56 fclose(fp1);
57 goto errexit; 57 goto errexit;
@@ -88,49 +88,10 @@ errexit:
88 exit(1); 88 exit(1);
89} 89}
90 90
91void fs_resolvconf(void) {
92 if (cfg.dns1 == 0)
93 return;
94
95 struct stat s;
96
97 // create a new /etc/hostname
98 if (stat("/etc/resolv.conf", &s) == 0) {
99 if (arg_debug)
100 printf("Creating a new /etc/resolv.conf file\n");
101 FILE *fp = fopen(RUN_RESOLVCONF_FILE, "w");
102 if (!fp) {
103 fprintf(stderr, "Error: cannot create %s\n", RUN_RESOLVCONF_FILE);
104 exit(1);
105 }
106
107 if (cfg.dns1)
108 fprintf(fp, "nameserver %d.%d.%d.%d\n", PRINT_IP(cfg.dns1));
109 if (cfg.dns2)
110 fprintf(fp, "nameserver %d.%d.%d.%d\n", PRINT_IP(cfg.dns2));
111 if (cfg.dns3)
112 fprintf(fp, "nameserver %d.%d.%d.%d\n", PRINT_IP(cfg.dns3));
113
114 // mode and owner
115 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
116
117 fclose(fp);
118
119 // bind-mount the file on top of /etc/hostname
120 if (mount(RUN_RESOLVCONF_FILE, "/etc/resolv.conf", NULL, MS_BIND|MS_REC, NULL) < 0)
121 errExit("mount bind /etc/resolv.conf");
122 fs_logger("create /etc/resolv.conf");
123 }
124 else {
125 fprintf(stderr, "Error: cannot set DNS servers, /etc/resolv.conf file is missing\n");
126 exit(1);
127 }
128}
129
130char *fs_check_hosts_file(const char *fname) { 91char *fs_check_hosts_file(const char *fname) {
131 assert(fname); 92 assert(fname);
132 invalid_filename(fname); 93 invalid_filename(fname, 0); // no globbing
133 char *rv = expand_home(fname, cfg.homedir); 94 char *rv = expand_macros(fname);
134 95
135 // the user has read access to the file 96 // the user has read access to the file
136 if (access(rv, R_OK)) 97 if (access(rv, R_OK))
diff --git a/src/firejail/fs_lib.c b/src/firejail/fs_lib.c
index abd7cee1a..9d7a17cf3 100644
--- a/src/firejail/fs_lib.c
+++ b/src/firejail/fs_lib.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -16,58 +16,211 @@
16 * You should have received a copy of the GNU General Public License along 16 * You should have received a copy of the GNU General Public License along
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/ldd_utils.h"
21#include <sys/mount.h> 22#include <sys/mount.h>
22#include <sys/stat.h> 23#include <sys/stat.h>
23#include <sys/types.h> 24#include <sys/types.h>
24#include <unistd.h> 25#include <unistd.h>
25#include <dirent.h> 26#include <fcntl.h>
26 27#include <errno.h>
28#include <glob.h>
27#define MAXBUF 4096 29#define MAXBUF 4096
28 30
29static const char * const lib_paths[] = { 31extern void fslib_install_stdc(void);
30 "/lib", 32extern void fslib_install_firejail(void);
31 "/lib/x86_64-linux-gnu", 33extern void fslib_install_system(void);
34
35static int lib_cnt = 0;
36static int dir_cnt = 0;
37
38static const char *masked_lib_dirs[] = {
39 "/usr/lib64",
32 "/lib64", 40 "/lib64",
33 "/usr/lib", 41 "/usr/lib",
34 "/usr/lib/x86_64-linux-gnu", 42 "/lib",
35 LIBDIR, 43 "/usr/local/lib64",
36 "/usr/local/lib", 44 "/usr/local/lib",
37 NULL 45 NULL,
38}; // Note: this array is duplicated in src/fldd/main.c 46};
39 47
40static void duplicate(const char *fname, const char *private_run_dir) { 48// return 1 if the file is in masked_lib_dirs[]
49static int valid_full_path(const char *full_path) {
50 if (strstr(full_path, ".."))
51 return 0;
52
53 int i = 0;
54 while (masked_lib_dirs[i]) {
55 size_t len = strlen(masked_lib_dirs[i]);
56 if (strncmp(full_path, masked_lib_dirs[i], len) == 0 &&
57 full_path[len] == '/')
58 return 1;
59 i++;
60 }
61 return 0;
62}
63
64char *find_in_path(const char *program) {
65 EUID_ASSERT();
41 if (arg_debug) 66 if (arg_debug)
42 printf("copying %s to private %s\n", fname, private_run_dir); 67 printf("Searching $PATH for %s\n", program);
68
69 char self[MAXBUF];
70 ssize_t len = readlink("/proc/self/exe", self, MAXBUF - 1);
71 if (len < 0)
72 errExit("readlink");
73 self[len] = '\0';
74
75 const char *path = env_get("PATH");
76 if (!path)
77 return NULL;
78
79 char *dup = strdup(path);
80 if (!dup)
81 errExit("strdup");
82 char *tok = strtok(dup, ":");
83 while (tok) {
84 char *fname;
85 if (asprintf(&fname, "%s/%s", tok, program) == -1)
86 errExit("asprintf");
43 87
44 // copy only root-owned files 88 if (arg_debug)
45 struct stat s; 89 printf("trying #%s#\n", fname);
46 if (stat(fname, &s) == 0 && s.st_uid == 0) 90 struct stat s;
47 sbox_run(SBOX_ROOT| SBOX_SECCOMP, 4, PATH_FCOPY, "--follow-link", fname, private_run_dir); 91 if (stat(fname, &s) == 0) {
92 // but skip links created by firecfg
93 char *rp = realpath(fname, NULL);
94 if (!rp)
95 errExit("realpath");
96 if (strcmp(self, rp) != 0) {
97 free(rp);
98 free(dup);
99 return fname;
100 }
101 free(rp);
102 }
103 free(fname);
104 tok = strtok(NULL, ":");
105 }
106
107 free(dup);
108 return NULL;
109}
110
111static char *build_dest_dir(const char *full_path) {
112 assert(full_path);
113 if (strstr(full_path, "/x86_64-linux-gnu/"))
114 return RUN_LIB_DIR "/x86_64-linux-gnu";
115 return RUN_LIB_DIR;
116}
117
118// return name of mount target in allocated memory
119static char *build_dest_name(const char *full_path) {
120 assert(full_path);
121 char *fname = strrchr(full_path, '/');
122 assert(fname);
123 fname++;
124 // no trailing slash or dot
125 assert(fname[0] != '\0' && (fname[0] != '.' || fname[1] != '\0'));
126
127 char *dest;
128 if (asprintf(&dest, "%s/%s", build_dest_dir(full_path), fname) == -1)
129 errExit("asprintf");
130 return dest;
48} 131}
49 132
133static void fslib_mount_dir(const char *full_path) {
134 // create new directory and mount the original on top of it
135 char *dest = build_dest_name(full_path);
136 if (mkdir(dest, 0755) == -1) {
137 if (errno == EEXIST) { // directory has been mounted already, nothing to do
138 free(dest);
139 return;
140 }
141 errExit("mkdir");
142 }
143
144 if (arg_debug || arg_debug_private_lib)
145 printf(" mounting %s on %s\n", full_path, dest);
146 // if full_path is a symbolic link, mount will follow it
147 if (mount(full_path, dest, NULL, MS_BIND|MS_REC, NULL) < 0)
148 errExit("mount bind");
149 free(dest);
150 dir_cnt++;
151}
152
153static void fslib_mount_file(const char *full_path) {
154 // create new file and mount the original on top of it
155 char *dest = build_dest_name(full_path);
156 int fd = open(dest, O_RDONLY|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR | S_IWUSR);
157 if (fd == -1) {
158 if (errno == EEXIST) { // file has been mounted already, nothing to do
159 free(dest);
160 return;
161 }
162 errExit("open");
163 }
164 close(fd);
165
166 if (arg_debug || arg_debug_private_lib)
167 printf(" mounting %s on %s\n", full_path, dest);
168 // if full_path is a symbolic link, mount will follow it
169 if (mount(full_path, dest, NULL, MS_BIND, NULL) < 0)
170 errExit("mount bind");
171 free(dest);
172 lib_cnt++;
173}
174
175void fslib_mount(const char *full_path) {
176 assert(full_path);
177 struct stat s;
178
179 if (*full_path == '\0' ||
180 !valid_full_path(full_path) ||
181 stat_as_user(full_path, &s) != 0 ||
182 s.st_uid != 0)
183 return;
184
185 if (S_ISDIR(s.st_mode))
186 fslib_mount_dir(full_path);
187 else if (S_ISREG(s.st_mode) && is_lib_64(full_path))
188 fslib_mount_file(full_path);
189}
50 190
51// requires full path for lib 191// requires full path for lib
52static void copy_libs(const char *lib, const char *private_run_dir, const char *output_file) { 192// it could be a library or an executable
193// lib is not copied, only libraries used by it
194void fslib_mount_libs(const char *full_path, unsigned user) {
195 assert(full_path);
53 // if library/executable does not exist or the user does not have read access to it 196 // if library/executable does not exist or the user does not have read access to it
54 // print a warning and exit the function. 197 // print a warning and exit the function.
55 if (access(lib, R_OK)) { 198 if (user && access(full_path, R_OK)) {
56 fwarning("cannot find %s for private-lib, skipping...\n", lib); 199 if (arg_debug || arg_debug_private_lib)
200 printf("Cannot read %s, skipping...\n", full_path);
57 return; 201 return;
58 } 202 }
59 203
204 if (arg_debug || arg_debug_private_lib)
205 printf(" fslib_mount_libs %s\n", full_path);
60 // create an empty RUN_LIB_FILE and allow the user to write to it 206 // create an empty RUN_LIB_FILE and allow the user to write to it
61 unlink(output_file); // in case is there 207 unlink(RUN_LIB_FILE); // in case is there
62 create_empty_file_as_root(output_file, 0644); 208 create_empty_file_as_root(RUN_LIB_FILE, 0644);
63 if (chown(output_file, getuid(), getgid())) 209 if (user && chown(RUN_LIB_FILE, getuid(), getgid()))
64 errExit("chown"); 210 errExit("chown");
65 211
66 // run fldd to extact the list of file 212 // run fldd to extract the list of files
67 sbox_run(SBOX_USER | SBOX_SECCOMP | SBOX_CAPS_NONE, 3, PATH_FLDD, lib, output_file); 213 if (arg_debug || arg_debug_private_lib)
68 214 printf(" running fldd %s as %s\n", full_path, user ? "user" : "root");
215 unsigned mask;
216 if (user)
217 mask = SBOX_USER;
218 else
219 mask = SBOX_ROOT;
220 sbox_run(mask | SBOX_SECCOMP | SBOX_CAPS_NONE, 3, PATH_FLDD, full_path, RUN_LIB_FILE);
221
69 // open the list of libraries and install them on by one 222 // open the list of libraries and install them on by one
70 FILE *fp = fopen(output_file, "r"); 223 FILE *fp = fopen(RUN_LIB_FILE, "re");
71 if (!fp) 224 if (!fp)
72 errExit("fopen"); 225 errExit("fopen");
73 226
@@ -77,141 +230,145 @@ static void copy_libs(const char *lib, const char *private_run_dir, const char *
77 char *ptr = strchr(buf, '\n'); 230 char *ptr = strchr(buf, '\n');
78 if (ptr) 231 if (ptr)
79 *ptr = '\0'; 232 *ptr = '\0';
80 duplicate(buf, private_run_dir); 233
234 trim_trailing_slash_or_dot(buf);
235 fslib_mount(buf);
81 } 236 }
82 fclose(fp); 237 fclose(fp);
238 unlink(RUN_LIB_FILE);
83} 239}
84 240
85static void copy_directory(const char *full_path, const char *dir_name, const char *private_run_dir) { 241// fname should be a full path at this point
86 char *dest; 242static void load_library(const char *fname) {
87 if (asprintf(&dest, "%s/%s", private_run_dir, dir_name) == -1) 243 assert(fname);
88 errExit("asprintf"); 244 assert(*fname == '/');
89 245
90 // do nothing if the directory is already there 246 // existing file owned by root
91 struct stat s; 247 struct stat s;
92 if (stat(dest, &s) == 0) { 248 if (stat_as_user(fname, &s) == 0 && s.st_uid == 0) {
93 free(dest); 249 // load directories, regular 64 bit libraries, and 64 bit executables
94 return; 250 if (S_ISDIR(s.st_mode))
251 fslib_mount(fname);
252 else if (S_ISREG(s.st_mode) && is_lib_64(fname)) {
253 if (strstr(fname, ".so") ||
254 access(fname, X_OK) != 0) // don't duplicate executables, just install the libraries
255 fslib_mount(fname);
256
257 fslib_mount_libs(fname, 1); // parse as user
258 }
95 } 259 }
96
97 // create new directory and mount the original on top of it
98 mkdir_attr(dest, 0755, 0, 0);
99
100 if (mount(full_path, dest, NULL, MS_BIND|MS_REC, NULL) < 0 ||
101 mount(NULL, dest, NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NODEV|MS_REC, NULL) < 0)
102 errExit("mount bind");
103 fs_logger2("clone", full_path);
104 fs_logger2("mount", full_path);
105 free(dest);
106} 260}
107 261
108// return 1 if the file is valid 262static void install_list_entry(const char *lib) {
109static char *valid_file(const char *lib) { 263 assert(lib);
264
110 // filename check 265 // filename check
111 int len = strlen(lib); 266 int len = strlen(lib);
112 if (strcspn(lib, "\\&!?\"'<>%^(){}[];,*") != (size_t)len || 267 if (strcspn(lib, "\\&!?\"'<>%^(){}[];,") != (size_t)len ||
113 strstr(lib, "..")) { 268 strstr(lib, "..")) {
114 fprintf(stderr, "Error: \"%s\" is an invalid library\n", lib); 269 fprintf(stderr, "Error: \"%s\" is an invalid library\n", lib);
115 exit(1); 270 exit(1);
116 } 271 }
117 272
273 // if this is a full path, use it as is
274 if (*lib == '/')
275 return load_library(lib);
276
277
118 // find the library 278 // find the library
119 int i; 279 int i;
120 for (i = 0; lib_paths[i]; i++) { 280 for (i = 0; default_lib_paths[i]; i++) {
121 char *fname; 281 char *fname = NULL;
122 if (asprintf(&fname, "%s/%s", lib_paths[i], lib) == -1) 282 if (asprintf(&fname, "%s/%s", default_lib_paths[i], lib) == -1)
123 errExit("asprintf"); 283 errExit("asprintf");
124 284
125 // existing file owned by root 285#define DO_GLOBBING
126 struct stat s; 286#ifdef DO_GLOBBING
127 if (stat(fname, &s) == 0 && s.st_uid == 0) { 287 // globbing
128 return fname; 288 EUID_USER();
289 glob_t globbuf;
290 int globerr = glob(fname, GLOB_NOCHECK | GLOB_NOSORT | GLOB_PERIOD, NULL, &globbuf);
291 if (globerr) {
292 fprintf(stderr, "Error: failed to glob private-lib pattern %s\n", fname);
293 exit(1);
129 } 294 }
295 EUID_ROOT();
296 size_t j;
297 for (j = 0; j < globbuf.gl_pathc; j++) {
298 assert(globbuf.gl_pathv[j]);
299//printf("glob %s\n", globbuf.gl_pathv[j]);
300 // GLOB_NOCHECK - no pattern matched returns the original pattern; try to load it anyway
301
302 // foobar/* expands to foobar/. and foobar/..
303 const char *base = gnu_basename(globbuf.gl_pathv[j]);
304 if (strcmp(base, ".") == 0 || strcmp(base, "..") == 0)
305 continue;
306 load_library(globbuf.gl_pathv[j]);
307 }
308
309 globfree(&globbuf);
310#else
311 load_library(fname);
312#endif
130 free(fname); 313 free(fname);
131 } 314 }
132 315
133 fwarning("%s library not found, skipping...\n", lib); 316// fwarning("%s library not found, skipping...\n", lib);
134 return NULL; 317 return;
135} 318}
136 319
137// standard libc libraries based on Debian's libc6 package 320void fslib_install_list(const char *lib_list) {
138// selinux seems to be linked in most command line utilities 321 assert(lib_list);
139// locale (/usr/lib/locale) - without it, the program will default to "C" locale 322 if (arg_debug || arg_debug_private_lib)
140typedef struct liblist_t { 323 printf(" fslib_install_list %s\n", lib_list);
141 const char *name;
142 int len;
143} LibList;
144
145static LibList libc_list[] = {
146// { "locale", 0 }, hardcoded!
147 { "libselinux.so.", 0 },
148 { "ld-linux-x86-64.so.", 0 },
149 { "libanl.so.", 0 },
150 { "libc.so.", 0 },
151 { "libcidn.so.", 0 },
152 { "libcrypt.so.", 0 },
153 { "libdl.so.", 0 },
154 { "libm.so.", 0 },
155 { "libmemusage.so", 0 },
156 { "libmvec.so.", 0 },
157 { "libnsl.so.", 0 },
158 { "libnss_compat.so.", 0 },
159 { "libnss_dns.so.", 0 },
160 { "libnss_files.so.", 0 },
161 { "libnss_hesiod.so.", 0 },
162 { "libnss_nisplus.so.", 0 },
163 { "libnss_nis.so.", 0 },
164 { "libpthread.so.", 0 },
165 { "libresolv.so.", 0 },
166 { "librt.so.", 0 },
167 { "libthread_db.so.", 0 },
168 { "libutil.so.", 0 },
169 { NULL, 0}
170};
171 324
172static int find(const char *name) { 325 char *dlist = strdup(lib_list);
173 assert(name); 326 if (!dlist)
327 errExit("strdup");
174 328
175 int i = 0; 329 char *ptr = strtok(dlist, ",");
176 while (libc_list[i].name) { 330 if (!ptr) {
177 if (libc_list[i].len == 0) 331 fprintf(stderr, "Error: invalid private-lib argument\n");
178 libc_list[i].len = strlen(libc_list[i].name); 332 exit(1);
179 if (strncmp(name, libc_list[i].name, libc_list[i].len) == 0)
180 return 1;
181 i++;
182 } 333 }
183 return 0; 334 trim_trailing_slash_or_dot(ptr);
335 install_list_entry(ptr);
336
337 while ((ptr = strtok(NULL, ",")) != NULL) {
338 trim_trailing_slash_or_dot(ptr);
339 install_list_entry(ptr);
340 }
341 free(dlist);
342 fs_logger_print();
184} 343}
185 344
186// compare the files in dirname against liblist above 345static void mount_directories(void) {
187static void walk_directory(const char *dirname, const char *destdir) { 346 fs_remount(RUN_LIB_DIR, MOUNT_READONLY, 1); // should be redundant except for RUN_LIB_DIR itself
188 assert(dirname);
189 assert(destdir);
190 347
191 DIR *dir = opendir(dirname); 348 int i = 0;
192 if (dir) { 349 while (masked_lib_dirs[i]) {
193 struct dirent *entry; 350 if (is_dir(masked_lib_dirs[i])) {
194 while ((entry = readdir(dir)) != NULL) { 351 if (arg_debug || arg_debug_private_lib)
195 if (strcmp(entry->d_name, ".") == 0) 352 printf("Mount-bind %s on top of %s\n", RUN_LIB_DIR, masked_lib_dirs[i]);
196 continue; 353 if (mount(RUN_LIB_DIR, masked_lib_dirs[i], NULL, MS_BIND|MS_REC, NULL) < 0)
197 if (strcmp(entry->d_name, "..") == 0) 354 errExit("mount bind");
198 continue; 355 fs_logger2("tmpfs", masked_lib_dirs[i]);
199 356 fs_logger2("mount", masked_lib_dirs[i]);
200 if (find(entry->d_name)) {
201 char *fname;
202 if (asprintf(&fname, "%s/%s", dirname, entry->d_name) == -1)
203 errExit("asprintf");
204
205 if (is_dir(fname))
206 copy_directory(fname, entry->d_name, RUN_LIB_DIR);
207 else
208 duplicate(fname, destdir);
209 }
210 } 357 }
211 closedir(dir); 358 i++;
359 }
360
361 // for amd64 only - we'll deal with i386 later
362 if (is_dir("/lib32")) {
363 if (mount(RUN_RO_DIR, "/lib32", "none", MS_BIND, "mode=400,gid=0") < 0)
364 errExit("disable file");
365 fs_logger("blacklist-nolog /lib32");
366 }
367 if (is_dir("/libx32")) {
368 if (mount(RUN_RO_DIR, "/libx32", "none", MS_BIND, "mode=400,gid=0") < 0)
369 errExit("disable file");
370 fs_logger("blacklist-nolog /libx32");
212 } 371 }
213 else
214 fprintf(stderr, "Error: cannot open %s in order to set --private-lib\n", dirname);
215} 372}
216 373
217void fs_private_lib(void) { 374void fs_private_lib(void) {
@@ -219,130 +376,80 @@ void fs_private_lib(void) {
219 fwarning("private-lib feature is currently available only on amd64 platforms\n"); 376 fwarning("private-lib feature is currently available only on amd64 platforms\n");
220 return; 377 return;
221#endif 378#endif
222
223 char *private_list = cfg.lib_private_keep; 379 char *private_list = cfg.lib_private_keep;
224 if (arg_debug) 380 if (arg_debug || arg_debug_private_lib)
225 printf("Starting private-lib processing: program %s, shell %s\n", 381 printf("Starting private-lib processing: program %s, shell %s\n",
226 (cfg.original_program_index > 0)? cfg.original_argv[cfg.original_program_index]: "none", 382 (cfg.original_program_index > 0)? cfg.original_argv[cfg.original_program_index]: "none",
227 (arg_shell_none)? "none": cfg.shell); 383 (arg_shell_none)? "none": cfg.shell);
228 384
229 // create /run/firejail/mnt/lib directory 385 // create /run/firejail/mnt/lib directory
230 mkdir_attr(RUN_LIB_DIR, 0755, 0, 0); 386 mkdir_attr(RUN_LIB_DIR, 0755, 0, 0);
387 selinux_relabel_path(RUN_LIB_DIR, "/usr/lib");
231 388
232 struct stat s; 389 // install standard C libraries
233 if (stat("/lib/x86_64-linux-gnu", &s) == 0) { 390 if (arg_debug || arg_debug_private_lib)
234 mkdir_attr(RUN_LIB_DIR "/x86_64-linux-gnu", 0755, 0, 0); 391 printf("Installing standard C library\n");
235 walk_directory("/lib/x86_64-linux-gnu", RUN_LIB_DIR "/x86_64-linux-gnu"); 392 fslib_install_stdc();
236 } 393
237 if (stat("/usr/lib/locale", &s) == 0) 394 // install other libraries needed by firejail
238 copy_directory("/usr/lib/locale", "locale", RUN_LIB_DIR); 395 if (arg_debug || arg_debug_private_lib)
396 printf("Installing Firejail libraries\n");
397 fslib_install_firejail();
398
399 // start timetrace
400 timetrace_start();
239 401
240 // copy the libs in the new lib directory for the main exe 402 // copy the libs in the new lib directory for the main exe
241 if (cfg.original_program_index > 0) 403 if (cfg.original_program_index > 0) {
242 copy_libs(cfg.original_argv[cfg.original_program_index], RUN_LIB_DIR, RUN_LIB_FILE); 404 if (arg_debug || arg_debug_private_lib)
405 printf("Installing sandboxed program libraries\n");
406
407 if (strchr(cfg.original_argv[cfg.original_program_index], '/'))
408 fslib_install_list(cfg.original_argv[cfg.original_program_index]);
409 else { // search executable in $PATH
410 EUID_USER();
411 char *fname = find_in_path(cfg.original_argv[cfg.original_program_index]);
412 EUID_ROOT();
413 if (fname) {
414 fslib_install_list(fname);
415 free(fname);
416 }
417 }
418 }
243 419
244 // for the shell 420 // for the shell
245 if (!arg_shell_none) { 421 if (!arg_shell_none) {
246 copy_libs(cfg.shell, RUN_LIB_DIR, RUN_LIB_FILE); 422 if (arg_debug || arg_debug_private_lib)
247 // a shell is useless without ls command 423 printf("Installing shell libraries\n");
248 copy_libs("/bin/ls", RUN_LIB_DIR, RUN_LIB_FILE); 424
425 fslib_install_list(cfg.shell);
426 // a shell is useless without some basic commands
427 fslib_install_list("/bin/ls,/bin/cat,/bin/mv,/bin/rm");
249 } 428 }
250 429
251 // for the listed libs 430 // for the listed libs and directories
252 if (private_list && *private_list != '\0') { 431 if (private_list && *private_list != '\0') {
253 if (arg_debug) 432 if (arg_debug || arg_debug_private_lib)
254 printf("Copying extra files (%s) in the new lib directory:\n", private_list); 433 printf("Processing private-lib files\n");
255 434 fslib_install_list(private_list);
256 char *dlist = strdup(private_list);
257 if (!dlist)
258 errExit("strdup");
259
260 char *ptr = strtok(dlist, ",");
261 char *lib = valid_file(ptr);
262 if (lib) {
263 if (is_dir(lib))
264 copy_directory(lib, ptr, RUN_LIB_DIR);
265 else {
266 duplicate(lib, RUN_LIB_DIR);
267 copy_libs(lib, RUN_LIB_DIR, RUN_LIB_FILE);
268 }
269 free(lib);
270 }
271
272 while ((ptr = strtok(NULL, ",")) != NULL) {
273 lib = valid_file(ptr);
274 if (lib) {
275 if (is_dir(lib))
276 copy_directory(lib, ptr, RUN_LIB_DIR);
277 else {
278 duplicate(lib, RUN_LIB_DIR);
279 copy_libs(lib, RUN_LIB_DIR, RUN_LIB_FILE);
280 }
281 free(lib);
282 }
283 }
284 free(dlist);
285 fs_logger_print();
286 } 435 }
287 436
288 // for private-bin files 437 // for private-bin files
289 if (arg_private_bin) { 438 if (arg_private_bin && cfg.bin_private_lib && *cfg.bin_private_lib != '\0') {
290 FILE *fp = fopen(RUN_LIB_BIN, "r"); 439 if (arg_debug || arg_debug_private_lib)
291 if (fp) { 440 printf("Processing private-bin files\n");
292 char buf[MAXBUF]; 441 fslib_install_list(cfg.bin_private_lib);
293 while (fgets(buf, MAXBUF, fp)) {
294 // remove \n
295 char *ptr = strchr(buf, '\n');
296 if (ptr)
297 *ptr = '\0';
298 copy_libs(buf, RUN_LIB_DIR, RUN_LIB_FILE);
299 }
300 }
301 fclose(fp);
302 } 442 }
443 fmessage("Program libraries installed in %0.2f ms\n", timetrace_end());
303 444
304 // for our trace and tracelog libs 445 // install the rest of the system libraries
305 if (arg_trace) 446 if (arg_debug || arg_debug_private_lib)
306 duplicate(LIBDIR "/firejail/libtrace.so", RUN_LIB_DIR); 447 printf("Installing system libraries\n");
307 else if (arg_tracelog) 448 fslib_install_system();
308 duplicate(LIBDIR "/firejail/libtracelog.so", RUN_LIB_DIR);
309 449
310 if (arg_debug) 450 fmessage("Installed %d %s and %d %s\n", lib_cnt, (lib_cnt == 1)? "library": "libraries",
311 printf("Mount-bind %s on top of /lib /lib64 /usr/lib\n", RUN_LIB_DIR); 451 dir_cnt, (dir_cnt == 1)? "directory": "directories");
312
313 if (is_dir("/lib")) {
314 if (mount(RUN_LIB_DIR, "/lib", NULL, MS_BIND|MS_REC, NULL) < 0 ||
315 mount(NULL, "/lib", NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NODEV|MS_REC, NULL) < 0)
316 errExit("mount bind");
317 fs_logger2("tmpfs", "/lib");
318 fs_logger("mount /lib");
319 }
320
321 if (is_dir("/lib64")) {
322 if (mount(RUN_LIB_DIR, "/lib64", NULL, MS_BIND|MS_REC, NULL) < 0 ||
323 mount(NULL, "/lib64", NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NODEV|MS_REC, NULL) < 0)
324 errExit("mount bind");
325 fs_logger2("tmpfs", "/lib64");
326 fs_logger("mount /lib64");
327 }
328
329 if (is_dir("/usr/lib")) {
330 if (mount(RUN_LIB_DIR, "/usr/lib", NULL, MS_BIND|MS_REC, NULL) < 0 ||
331 mount(NULL, "/usr/lib", NULL, MS_BIND|MS_REMOUNT|MS_NOSUID|MS_NODEV|MS_REC, NULL) < 0)
332 errExit("mount bind");
333 fs_logger2("tmpfs", "/usr/lib");
334 fs_logger("mount /usr/lib");
335 }
336 452
337 // for amd64 only - we'll deal with i386 later 453 // mount lib filesystem
338 if (is_dir("/lib32")) { 454 mount_directories();
339 if (mount(RUN_RO_DIR, "/lib32", "none", MS_BIND, "mode=400,gid=0") < 0)
340 errExit("disable file");
341 fs_logger("blacklist-nolog /lib32");
342 }
343 if (is_dir("/libx32")) {
344 if (mount(RUN_RO_DIR, "/libx32", "none", MS_BIND, "mode=400,gid=0") < 0)
345 errExit("disable file");
346 fs_logger("blacklist-nolog /libx32");
347 }
348} 455}
diff --git a/src/firejail/fs_lib2.c b/src/firejail/fs_lib2.c
new file mode 100644
index 000000000..c69bf7c98
--- /dev/null
+++ b/src/firejail/fs_lib2.c
@@ -0,0 +1,356 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "firejail.h"
21#include <dirent.h>
22#include <sys/stat.h>
23
24extern void fslib_mount_libs(const char *full_path, unsigned user);
25extern void fslib_mount(const char *full_path);
26
27//***************************************************************
28// Standard C library
29//***************************************************************
30// standard libc libraries based on Debian's libc6 package
31// selinux seems to be linked in most command line utilities
32// libpcre2 is a dependency of selinux
33// locale (/usr/lib/locale) - without it, the program will default to "C" locale
34typedef struct liblist_t {
35 const char *name;
36 int len;
37} LibList;
38
39static LibList libc_list[] = {
40 { "libselinux.so.", 0 },
41 { "libpcre2-8.so.", 0 },
42 { "libapparmor.so.", 0},
43 { "ld-linux-x86-64.so.", 0 },
44 { "libanl.so.", 0 },
45 { "libc.so.", 0 },
46 { "libcidn.so.", 0 },
47 { "libcrypt.so.", 0 },
48 { "libdl.so.", 0 },
49 { "libm.so.", 0 },
50 { "libmemusage.so", 0 },
51 { "libmvec.so.", 0 },
52 { "libnsl.so.", 0 },
53 { "libnss_compat.so.", 0 },
54 { "libnss_dns.so.", 0 },
55 { "libnss_files.so.", 0 },
56 { "libnss_hesiod.so.", 0 },
57 { "libnss_nisplus.so.", 0 },
58 { "libnss_nis.so.", 0 },
59 { "libpthread.so.", 0 },
60 { "libresolv.so.", 0 },
61 { "librt.so.", 0 },
62 { "libthread_db.so.", 0 },
63 { "libutil.so.", 0 },
64 { NULL, 0}
65};
66
67static int find_libc_list(const char *name) {
68 assert(name);
69
70 int i = 0;
71 while (libc_list[i].name) {
72 if (libc_list[i].len == 0)
73 libc_list[i].len = strlen(libc_list[i].name);
74 if (strncmp(name, libc_list[i].name, libc_list[i].len) == 0)
75 return 1;
76 i++;
77 }
78 return 0;
79}
80
81// compare the files in dirname against liblist above
82static void stdc(const char *dirname) {
83 assert(dirname);
84
85 DIR *dir = opendir(dirname);
86 if (dir) {
87 struct dirent *entry;
88 while ((entry = readdir(dir)) != NULL) {
89 if (strcmp(entry->d_name, ".") == 0)
90 continue;
91 if (strcmp(entry->d_name, "..") == 0)
92 continue;
93
94 if (find_libc_list(entry->d_name)) {
95 char *fname;
96 if (asprintf(&fname, "%s/%s", dirname, entry->d_name) == -1)
97 errExit("asprintf");
98
99 fslib_mount(fname);
100 free(fname);
101 }
102 }
103 closedir(dir);
104 }
105}
106
107void fslib_install_stdc(void) {
108 // install standard C libraries
109 timetrace_start();
110 struct stat s;
111 if (stat("/lib/x86_64-linux-gnu", &s) == 0) { // Debian & friends
112 mkdir_attr(RUN_LIB_DIR "/x86_64-linux-gnu", 0755, 0, 0);
113 selinux_relabel_path(RUN_LIB_DIR "/x86_64-linux-gnu", "/lib/x86_64-linux-gnu");
114 stdc("/lib/x86_64-linux-gnu");
115 }
116
117 stdc("/lib64"); // CentOS, Fedora, Arch, ld-linux.so in Debian & friends
118
119 // install locale
120 if (stat("/usr/lib/locale", &s) == 0)
121 fslib_mount("/usr/lib/locale");
122
123 fmessage("Standard C library installed in %0.2f ms\n", timetrace_end());
124}
125
126//***************************************************************
127// Firejail libraries
128//***************************************************************
129
130static void fdir(void) {
131 // firejail directory itself
132 fslib_mount(LIBDIR "/firejail");
133
134 // executables and libraries from firejail directory
135 static const char * const fbin[] = {
136 PATH_FCOPY, // currently sufficient to find all needed libraries
137 // PATH_FSECCOMP,
138 // PATH_FSEC_OPTIMIZE,
139 // PATH_FSEC_PRINT,
140 // RUN_FIREJAIL_LIB_DIR "/libtrace.so",
141 // RUN_FIREJAIL_LIB_DIR "/libtracelog.so",
142 // RUN_FIREJAIL_LIB_DIR "/libpostexecseccomp.so",
143 NULL,
144 };
145
146 // need to parse as root user, unprivileged users have no read permission on executables
147 int i;
148 for (i = 0; fbin[i]; i++)
149 fslib_mount_libs(fbin[i], 0);
150}
151
152void fslib_install_firejail(void) {
153 timetrace_start();
154 // bring in firejail executable libraries, in case we are redirected here
155 // by a firejail symlink from /usr/local/bin/firejail
156 fslib_mount_libs(PATH_FIREJAIL, 1); // parse as user
157
158 // bring in firejail directory
159 fdir();
160
161 // bring in dhclient libraries
162 if (any_dhcp())
163 fslib_mount_libs(RUN_MNT_DIR "/dhclient", 1); // parse as user
164
165 // bring in xauth libraries
166 if (arg_x11_xorg)
167 fslib_mount_libs("/usr/bin/xauth", 1); // parse as user
168
169 fmessage("Firejail libraries installed in %0.2f ms\n", timetrace_end());
170}
171
172//***************************************************************
173// various system libraries
174//***************************************************************
175
176// look for library in the new filesystem, and install one or two more directories, dir1 and dir2
177typedef struct syslib_t {
178 const char *library; // look in the system for this library
179 int len; // length of library string, 0 by default
180 int found; // library found, 0 by default
181 const char *dir1; // directory to install
182 const char *dir2; // directory to install
183 const char *message; // message to print on the screen
184} SysLib;
185
186SysLib syslibs[] = {
187#if 0
188 {
189 "", // library
190 0, 0, // len and found flag
191 "", // dir1
192 "", // dir2
193 "" // message
194 },
195#endif
196 { // pixmaps - libraries used by GTK to display application menu icons
197 "libgdk_pixbuf-2.0", // library
198 0, 0, // len and found flag
199 "gdk-pixbuf-2.0", // dir1
200 "", // dir2
201 "GdkPixbuf" // message
202 },
203 { // GTK2
204 "libgtk-x11-2.0", // library
205 0, 0, // len and found flag
206 "gtk-2.0", // dir1
207 "libgtk2.0-0", // dir2
208 "GTK2" // message
209 },
210 { // GTK3
211 "libgtk-3", // library
212 0, 0, // len and found flag
213 "gtk-3.0", // dir1
214 "libgtk-3-0", // dir2
215 "GTK3" // message
216 },
217 { // Pango - text internationalization, found on older GTK2-based systems
218 "libpango", // library
219 0, 0, // len and found flag
220 "pango", // dir1
221 "", // dir2
222 "Pango" // message
223 },
224 { // Library for handling GObject introspection data on GTK systems
225 "libgirepository-1.0", // library
226 0, 0, // len and found flag
227 "girepository-1.0", // dir1
228 "", // dir2
229 "GIRepository" // message
230 },
231 { // GIO
232 "libgio", // library
233 0, 0, // len and found flag
234 "gio", // dir1
235 "", // dir2
236 "GIO" // message
237 },
238 { // Enchant speller
239 "libenchant.so.", // library
240 0, 0, // len and found flag
241 "enchant", // dir1
242 "", // dir2
243 "Enchant (speller)" // message
244 },
245 { // Qt5 - lots of problems on Arch Linux, Qt5 version 5.9.1 - disabled in all apps profiles
246 "libQt5", // library
247 0, 0, // len and found flag
248 "qt5", // dir1
249 "gdk-pixbuf-2.0", // dir2
250 "Qt5, GdkPixbuf" // message
251 },
252 { // Qt4
253 "libQtCore", // library
254 0, 0, // len and found flag
255 "qt4", // dir1
256 "gdk-pixbuf-2.0", // dir2
257 "Qt4" // message
258 },
259
260 { // NULL terminated list
261 NULL, // library
262 0, 0, // len and found flag
263 "", // dir1
264 "", // dir2
265 "" // message
266 }
267};
268
269void fslib_install_system(void) {
270 // look for installed libraries
271 DIR *dir = opendir(RUN_LIB_DIR "/x86_64-linux-gnu");
272 if (!dir)
273 dir = opendir(RUN_LIB_DIR);
274
275 if (dir) {
276 struct dirent *entry;
277 while ((entry = readdir(dir)) != NULL) {
278 if (strcmp(entry->d_name, ".") == 0)
279 continue;
280 if (strcmp(entry->d_name, "..") == 0)
281 continue;
282
283 SysLib *ptr = &syslibs[0];
284 while (ptr->library) {
285 if (ptr->len == 0)
286 ptr->len = strlen(ptr->library);
287
288 if (strncmp(entry->d_name, ptr->library, ptr->len) == 0) {
289 ptr->found = 1;
290 break;
291 }
292
293 ptr++;
294 }
295
296 }
297 closedir(dir);
298 }
299 else
300 assert(0);
301
302 // install required directories
303 SysLib *ptr = &syslibs[0];
304 while (ptr->library) {
305 if (ptr->found) {
306 assert(*ptr->message != '\0');
307 timetrace_start();
308
309 // bring in all libraries
310 assert(ptr->dir1);
311 char *name;
312 // Debian & friends
313 if (asprintf(&name, "/usr/lib/x86_64-linux-gnu/%s", ptr->dir1) == -1)
314 errExit("asprintf");
315 if (access(name, R_OK) == 0) {
316 fslib_mount_libs(name, 1); // parse as user
317 fslib_mount(name);
318 }
319 else {
320 free(name);
321 // CentOS, Fedora, Arch
322 if (asprintf(&name, "/usr/lib64/%s", ptr->dir1) == -1)
323 errExit("asprintf");
324 if (access(name, R_OK) == 0) {
325 fslib_mount_libs(name, 1); // parse as user
326 fslib_mount(name);
327 }
328 }
329 free(name);
330
331 if (*ptr->dir2 != '\0') {
332 // Debian & friends
333 if (asprintf(&name, "/usr/lib/x86_64-linux-gnu/%s", ptr->dir2) == -1)
334 errExit("asprintf");
335 if (access(name, R_OK) == 0) {
336 fslib_mount_libs(name, 1); // parse as user
337 fslib_mount(name);
338 }
339 else {
340 free(name);
341 // CentOS, Fedora, Arch
342 if (asprintf(&name, "/usr/lib64/%s", ptr->dir2) == -1)
343 errExit("asprintf");
344 if (access(name, R_OK) == 0) {
345 fslib_mount_libs(name, 1); // parse as user
346 fslib_mount(name);
347 }
348 }
349 free(name);
350 }
351
352 fmessage("%s installed in %0.2f ms\n", ptr->message, timetrace_end());
353 }
354 ptr++;
355 }
356}
diff --git a/src/firejail/fs_logger.c b/src/firejail/fs_logger.c
index 354e720a1..604e297b1 100644
--- a/src/firejail/fs_logger.c
+++ b/src/firejail/fs_logger.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -92,7 +92,7 @@ void fs_logger_print(void) {
92 if (!head) 92 if (!head)
93 return; 93 return;
94 94
95 FILE *fp = fopen(RUN_FSLOGGER_FILE, "a"); 95 FILE *fp = fopen(RUN_FSLOGGER_FILE, "ae");
96 if (!fp) { 96 if (!fp) {
97 perror("fopen"); 97 perror("fopen");
98 return; 98 return;
@@ -120,29 +120,11 @@ void fs_logger_change_owner(void) {
120void fs_logger_print_log(pid_t pid) { 120void fs_logger_print_log(pid_t pid) {
121 EUID_ASSERT(); 121 EUID_ASSERT();
122 122
123 // if the pid is that of a firejail process, use the pid of the first child process 123 // in case the pid is that of a firejail process, use the pid of the first child process
124 EUID_ROOT(); 124 pid = switch_to_child(pid);
125 char *comm = pid_proc_comm(pid);
126 EUID_USER();
127 if (comm) {
128 if (strcmp(comm, "firejail") == 0) {
129 pid_t child;
130 if (find_child(pid, &child) == 0) {
131 pid = child;
132 }
133 }
134 free(comm);
135 }
136 125
137 // check privileges for non-root users 126 // exit if no permission to join the sandbox
138 uid_t uid = getuid(); 127 check_join_permission(pid);
139 if (uid != 0) {
140 uid_t sandbox_uid = pid_get_uid(pid);
141 if (uid != sandbox_uid) {
142 fprintf(stderr, "Error: permission denied\n");
143 exit(1);
144 }
145 }
146 128
147 // print RUN_FSLOGGER_FILE 129 // print RUN_FSLOGGER_FILE
148 char *fname; 130 char *fname;
@@ -150,24 +132,16 @@ void fs_logger_print_log(pid_t pid) {
150 errExit("asprintf"); 132 errExit("asprintf");
151 133
152 EUID_ROOT(); 134 EUID_ROOT();
153 struct stat s; 135 FILE *fp = fopen(fname, "re");
154 if (stat(fname, &s) == -1) { 136 free(fname);
155 fprintf(stderr, "Error: Cannot access filesystem log\n");
156 exit(1);
157 }
158
159 /* coverity[toctou] */
160 FILE *fp = fopen(fname, "r");
161 if (!fp) { 137 if (!fp) {
162 fprintf(stderr, "Error: Cannot open filesystem log\n"); 138 fprintf(stderr, "Error: Cannot open filesystem log\n");
163 exit(1); 139 exit(1);
164 } 140 }
165
166 char buf[MAXBUF]; 141 char buf[MAXBUF];
167 while (fgets(buf, MAXBUF, fp)) 142 while (fgets(buf, MAXBUF, fp))
168 printf("%s", buf); 143 printf("%s", buf);
169 fclose(fp); 144 fclose(fp);
170 free(fname);
171 145
172 exit(0); 146 exit(0);
173} 147}
diff --git a/src/firejail/fs_mkdir.c b/src/firejail/fs_mkdir.c
index 20ffe825a..4983db0a0 100644
--- a/src/firejail/fs_mkdir.c
+++ b/src/firejail/fs_mkdir.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,7 @@
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/gcov_wrapper.h"
21#include <sys/types.h> 22#include <sys/types.h>
22#include <sys/stat.h> 23#include <sys/stat.h>
23#include <unistd.h> 24#include <unistd.h>
@@ -25,12 +26,27 @@
25#include <sys/wait.h> 26#include <sys/wait.h>
26#include <string.h> 27#include <string.h>
27 28
29static void check(const char *fname) {
30 // manufacture /run/user directory
31 char *runuser;
32 if (asprintf(&runuser, "/run/user/%d/", getuid()) == -1)
33 errExit("asprintf");
34
35 if (strncmp(fname, cfg.homedir, strlen(cfg.homedir)) != 0 &&
36 strncmp(fname, "/tmp", 4) != 0 &&
37 strncmp(fname, runuser, strlen(runuser)) != 0) {
38 fprintf(stderr, "Error: only files or directories in user home, /tmp, or /run/user/<UID> are supported by mkdir\n");
39 exit(1);
40 }
41 free(runuser);
42}
43
28static void mkdir_recursive(char *path) { 44static void mkdir_recursive(char *path) {
29 char *subdir = NULL; 45 char *subdir = NULL;
30 struct stat s; 46 struct stat s;
31 47
32 if (chdir("/")) { 48 if (chdir("/")) {
33 fprintf(stderr, "Error: can't chdir to /"); 49 fprintf(stderr, "Error: can't chdir to /\n");
34 return; 50 return;
35 } 51 }
36 52
@@ -47,7 +63,7 @@ static void mkdir_recursive(char *path) {
47 return; 63 return;
48 } 64 }
49 if (chdir(subdir)) { 65 if (chdir(subdir)) {
50 fprintf(stderr, "Error: can't chdir to %s", subdir); 66 fprintf(stderr, "Error: can't chdir to %s\n", subdir);
51 return; 67 return;
52 } 68 }
53 69
@@ -59,13 +75,9 @@ void fs_mkdir(const char *name) {
59 EUID_ASSERT(); 75 EUID_ASSERT();
60 76
61 // check directory name 77 // check directory name
62 invalid_filename(name); 78 invalid_filename(name, 0); // no globbing
63 char *expanded = expand_home(name, cfg.homedir); 79 char *expanded = expand_macros(name);
64 if (strncmp(expanded, cfg.homedir, strlen(cfg.homedir)) != 0 && 80 check(expanded); // will exit if wrong path
65 strncmp(expanded, "/tmp", 4) != 0) {
66 fprintf(stderr, "Error: only directories in user home or /tmp are supported by mkdir\n");
67 exit(1);
68 }
69 81
70 struct stat s; 82 struct stat s;
71 if (stat(expanded, &s) == 0) { 83 if (stat(expanded, &s) == 0) {
@@ -83,9 +95,9 @@ void fs_mkdir(const char *name) {
83 95
84 // create directory 96 // create directory
85 mkdir_recursive(expanded); 97 mkdir_recursive(expanded);
86#ifdef HAVE_GCOV 98
87 __gcov_flush(); 99 __gcov_flush();
88#endif 100
89 _exit(0); 101 _exit(0);
90 } 102 }
91 // wait for the child to finish 103 // wait for the child to finish
@@ -99,13 +111,9 @@ void fs_mkfile(const char *name) {
99 EUID_ASSERT(); 111 EUID_ASSERT();
100 112
101 // check file name 113 // check file name
102 invalid_filename(name); 114 invalid_filename(name, 0); // no globbing
103 char *expanded = expand_home(name, cfg.homedir); 115 char *expanded = expand_macros(name);
104 if (strncmp(expanded, cfg.homedir, strlen(cfg.homedir)) != 0 && 116 check(expanded); // will exit if wrong path
105 strncmp(expanded, "/tmp", 4) != 0) {
106 fprintf(stderr, "Error: only files in user home or /tmp are supported by mkfile\n");
107 exit(1);
108 }
109 117
110 struct stat s; 118 struct stat s;
111 if (stat(expanded, &s) == 0) { 119 if (stat(expanded, &s) == 0) {
@@ -114,7 +122,7 @@ void fs_mkfile(const char *name) {
114 } 122 }
115 123
116 // create file 124 // create file
117 touch_file_as_user(expanded, getuid(), getgid(), 0600); 125 touch_file_as_user(expanded, 0600);
118 126
119doexit: 127doexit:
120 free(expanded); 128 free(expanded);
diff --git a/src/firejail/fs_trace.c b/src/firejail/fs_trace.c
index c87d29b5c..475a391ec 100644
--- a/src/firejail/fs_trace.c
+++ b/src/firejail/fs_trace.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -33,8 +33,7 @@ void fs_trace_preload(void) {
33 if (stat("/etc/ld.so.preload", &s)) { 33 if (stat("/etc/ld.so.preload", &s)) {
34 if (arg_debug) 34 if (arg_debug)
35 printf("Creating an empty /etc/ld.so.preload file\n"); 35 printf("Creating an empty /etc/ld.so.preload file\n");
36 /* coverity[toctou] */ 36 FILE *fp = fopen("/etc/ld.so.preload", "wxe");
37 FILE *fp = fopen("/etc/ld.so.preload", "w");
38 if (!fp) 37 if (!fp)
39 errExit("fopen"); 38 errExit("fopen");
40 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH); 39 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
@@ -43,30 +42,62 @@ void fs_trace_preload(void) {
43 } 42 }
44} 43}
45 44
45void fs_tracefile(void) {
46 // create a bind mounted trace logfile that the sandbox can see
47 if (arg_debug)
48 printf("Creating an empty trace log file: %s\n", arg_tracefile);
49 EUID_USER();
50 int fd = open(arg_tracefile, O_CREAT|O_WRONLY|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
51 if (fd == -1) {
52 perror("open");
53 fprintf(stderr, "Error: cannot open trace log file %s for writing\n", arg_tracefile);
54 exit(1);
55 }
56 struct stat s;
57 if (fstat(fd, &s) == -1)
58 errExit("fstat");
59 if (!S_ISREG(s.st_mode)) {
60 fprintf(stderr, "Error: cannot write trace log: %s is no regular file\n", arg_tracefile);
61 exit(1);
62 }
63 if (ftruncate(fd, 0) == -1)
64 errExit("ftruncate");
65 EUID_ROOT();
66 FILE *fp = fopen(RUN_TRACE_FILE, "we");
67 if (!fp)
68 errExit("fopen " RUN_TRACE_FILE);
69 fclose(fp);
70 fs_logger2("touch", arg_tracefile);
71 // mount using the symbolic link in /proc/self/fd
72 if (arg_debug)
73 printf("Bind mount %s to %s\n", arg_tracefile, RUN_TRACE_FILE);
74 if (bind_mount_fd_to_path(fd, RUN_TRACE_FILE))
75 errExit("mount bind " RUN_TRACE_FILE);
76 close(fd);
77 // now that RUN_TRACE_FILE is user-writable, mount it noexec
78 fs_remount(RUN_TRACE_FILE, MOUNT_NOEXEC, 0);
79}
80
46void fs_trace(void) { 81void fs_trace(void) {
47 // create the new ld.so.preload file and mount-bind it 82 // create the new ld.so.preload file and mount-bind it
48 if (arg_debug) 83 if (arg_debug)
49 printf("Create the new ld.so.preload file\n"); 84 printf("Create the new ld.so.preload file\n");
50 85
51 FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); 86 FILE *fp = fopen(RUN_LDPRELOAD_FILE, "we");
52 if (!fp) 87 if (!fp)
53 errExit("fopen"); 88 errExit("fopen");
54 const char *prefix = LIBDIR "/firejail"; 89 const char *prefix = RUN_FIREJAIL_LIB_DIR;
55 if (arg_private_lib)
56 prefix = RUN_LIB_DIR;
57 90
58 if (arg_trace) { 91 if (arg_trace) {
59 fprintf(fp, "%s/libtrace.so\n", prefix); 92 fprintf(fp, "%s/libtrace.so\n", prefix);
60 } 93 }
61 else if (arg_tracelog) { 94 else if (arg_tracelog) {
62 fprintf(fp, "%s/libtracelog.so\n", prefix); 95 fprintf(fp, "%s/libtracelog.so\n", prefix);
63 if (!arg_quiet) 96 fmessage("Blacklist violations are logged to syslog\n");
64 printf("Blacklist violations are logged to syslog\n");
65 } 97 }
66 if (arg_seccomp_postexec) { 98 if (arg_seccomp_postexec) {
67 fprintf(fp, "%s/libpostexecseccomp.so\n", prefix); 99 fprintf(fp, "%s/libpostexecseccomp.so\n", prefix);
68 if (!arg_quiet) 100 fmessage("Post-exec seccomp protector enabled\n");
69 printf("Post-exec seccomp protector enabled\n");
70 } 101 }
71 102
72 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH); 103 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c
index 11e9eabf5..20e262d80 100644
--- a/src/firejail/fs_var.c
+++ b/src/firejail/fs_var.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -118,7 +118,7 @@ void fs_var_log(void) {
118 // mount a tmpfs on top of /var/log 118 // mount a tmpfs on top of /var/log
119 if (arg_debug) 119 if (arg_debug)
120 printf("Mounting tmpfs on /var/log\n"); 120 printf("Mounting tmpfs on /var/log\n");
121 if (mount("tmpfs", "/var/log", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 121 if (mount("tmpfs", "/var/log", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
122 errExit("mounting /var/log"); 122 errExit("mounting /var/log");
123 fs_logger("tmpfs /var/log"); 123 fs_logger("tmpfs /var/log");
124 124
@@ -127,7 +127,7 @@ void fs_var_log(void) {
127 127
128 // create an empty /var/log/wtmp file 128 // create an empty /var/log/wtmp file
129 /* coverity[toctou] */ 129 /* coverity[toctou] */
130 FILE *fp = fopen("/var/log/wtmp", "w"); 130 FILE *fp = fopen("/var/log/wtmp", "wxe");
131 if (fp) { 131 if (fp) {
132 SET_PERMS_STREAM(fp, 0, wtmp_group, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH); 132 SET_PERMS_STREAM(fp, 0, wtmp_group, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH);
133 fclose(fp); 133 fclose(fp);
@@ -135,7 +135,7 @@ void fs_var_log(void) {
135 fs_logger("touch /var/log/wtmp"); 135 fs_logger("touch /var/log/wtmp");
136 136
137 // create an empty /var/log/btmp file 137 // create an empty /var/log/btmp file
138 fp = fopen("/var/log/btmp", "w"); 138 fp = fopen("/var/log/btmp", "wxe");
139 if (fp) { 139 if (fp) {
140 SET_PERMS_STREAM(fp, 0, wtmp_group, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP); 140 SET_PERMS_STREAM(fp, 0, wtmp_group, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP);
141 fclose(fp); 141 fclose(fp);
@@ -153,13 +153,12 @@ void fs_var_lib(void) {
153 if (stat("/var/lib/dhcp", &s) == 0) { 153 if (stat("/var/lib/dhcp", &s) == 0) {
154 if (arg_debug) 154 if (arg_debug)
155 printf("Mounting tmpfs on /var/lib/dhcp\n"); 155 printf("Mounting tmpfs on /var/lib/dhcp\n");
156 if (mount("tmpfs", "/var/lib/dhcp", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 156 if (mount("tmpfs", "/var/lib/dhcp", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
157 errExit("mounting /var/lib/dhcp"); 157 errExit("mounting /var/lib/dhcp");
158 fs_logger("tmpfs /var/lib/dhcp"); 158 fs_logger("tmpfs /var/lib/dhcp");
159 159
160 // isc dhcp server requires a /var/lib/dhcp/dhcpd.leases file 160 // isc dhcp server requires a /var/lib/dhcp/dhcpd.leases file
161 FILE *fp = fopen("/var/lib/dhcp/dhcpd.leases", "w"); 161 FILE *fp = fopen("/var/lib/dhcp/dhcpd.leases", "wxe");
162
163 if (fp) { 162 if (fp) {
164 fprintf(fp, "\n"); 163 fprintf(fp, "\n");
165 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); 164 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
@@ -172,7 +171,7 @@ void fs_var_lib(void) {
172 if (stat("/var/lib/nginx", &s) == 0) { 171 if (stat("/var/lib/nginx", &s) == 0) {
173 if (arg_debug) 172 if (arg_debug)
174 printf("Mounting tmpfs on /var/lib/nginx\n"); 173 printf("Mounting tmpfs on /var/lib/nginx\n");
175 if (mount("tmpfs", "/var/lib/nginx", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 174 if (mount("tmpfs", "/var/lib/nginx", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
176 errExit("mounting /var/lib/nginx"); 175 errExit("mounting /var/lib/nginx");
177 fs_logger("tmpfs /var/lib/nginx"); 176 fs_logger("tmpfs /var/lib/nginx");
178 } 177 }
@@ -181,7 +180,7 @@ void fs_var_lib(void) {
181 if (stat("/var/lib/snmp", &s) == 0) { 180 if (stat("/var/lib/snmp", &s) == 0) {
182 if (arg_debug) 181 if (arg_debug)
183 printf("Mounting tmpfs on /var/lib/snmp\n"); 182 printf("Mounting tmpfs on /var/lib/snmp\n");
184 if (mount("tmpfs", "/var/lib/snmp", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 183 if (mount("tmpfs", "/var/lib/snmp", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
185 errExit("mounting /var/lib/snmp"); 184 errExit("mounting /var/lib/snmp");
186 fs_logger("tmpfs /var/lib/snmp"); 185 fs_logger("tmpfs /var/lib/snmp");
187 } 186 }
@@ -190,7 +189,7 @@ void fs_var_lib(void) {
190 if (stat("/var/lib/sudo", &s) == 0) { 189 if (stat("/var/lib/sudo", &s) == 0) {
191 if (arg_debug) 190 if (arg_debug)
192 printf("Mounting tmpfs on /var/lib/sudo\n"); 191 printf("Mounting tmpfs on /var/lib/sudo\n");
193 if (mount("tmpfs", "/var/lib/sudo", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 192 if (mount("tmpfs", "/var/lib/sudo", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
194 errExit("mounting /var/lib/sudo"); 193 errExit("mounting /var/lib/sudo");
195 fs_logger("tmpfs /var/lib/sudo"); 194 fs_logger("tmpfs /var/lib/sudo");
196 } 195 }
@@ -202,7 +201,7 @@ void fs_var_cache(void) {
202 if (stat("/var/cache/apache2", &s) == 0) { 201 if (stat("/var/cache/apache2", &s) == 0) {
203 if (arg_debug) 202 if (arg_debug)
204 printf("Mounting tmpfs on /var/cache/apache2\n"); 203 printf("Mounting tmpfs on /var/cache/apache2\n");
205 if (mount("tmpfs", "/var/cache/apache2", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 204 if (mount("tmpfs", "/var/cache/apache2", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
206 errExit("mounting /var/cache/apache2"); 205 errExit("mounting /var/cache/apache2");
207 fs_logger("tmpfs /var/cache/apache2"); 206 fs_logger("tmpfs /var/cache/apache2");
208 } 207 }
@@ -210,7 +209,7 @@ void fs_var_cache(void) {
210 if (stat("/var/cache/lighttpd", &s) == 0) { 209 if (stat("/var/cache/lighttpd", &s) == 0) {
211 if (arg_debug) 210 if (arg_debug)
212 printf("Mounting tmpfs on /var/cache/lighttpd\n"); 211 printf("Mounting tmpfs on /var/cache/lighttpd\n");
213 if (mount("tmpfs", "/var/cache/lighttpd", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 212 if (mount("tmpfs", "/var/cache/lighttpd", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
214 errExit("mounting /var/cache/lighttpd"); 213 errExit("mounting /var/cache/lighttpd");
215 fs_logger("tmpfs /var/cache/lighttpd"); 214 fs_logger("tmpfs /var/cache/lighttpd");
216 215
@@ -223,9 +222,11 @@ void fs_var_cache(void) {
223 } 222 }
224 223
225 mkdir_attr("/var/cache/lighttpd/compress", 0755, uid, gid); 224 mkdir_attr("/var/cache/lighttpd/compress", 0755, uid, gid);
225 selinux_relabel_path("/var/cache/lighttpd/compress", "/var/cache/lighttpd/compress");
226 fs_logger("mkdir /var/cache/lighttpd/compress"); 226 fs_logger("mkdir /var/cache/lighttpd/compress");
227 227
228 mkdir_attr("/var/cache/lighttpd/uploads", 0755, uid, gid); 228 mkdir_attr("/var/cache/lighttpd/uploads", 0755, uid, gid);
229 selinux_relabel_path("/var/cache/lighttpd/uploads", "/var/cache/lighttpd/uploads");
229 fs_logger("/var/cache/lighttpd/uploads"); 230 fs_logger("/var/cache/lighttpd/uploads");
230 } 231 }
231} 232}
@@ -250,28 +251,13 @@ void fs_var_lock(void) {
250 if (is_dir("/var/lock")) { 251 if (is_dir("/var/lock")) {
251 if (arg_debug) 252 if (arg_debug)
252 printf("Mounting tmpfs on /var/lock\n"); 253 printf("Mounting tmpfs on /var/lock\n");
253 if (mount("tmpfs", "/var/lock", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=1777,gid=0") < 0) 254 if (mount("tmpfs", "/var/lock", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=1777,gid=0") < 0)
254 errExit("mounting /lock"); 255 errExit("mounting /lock");
255 fs_logger("tmpfs /var/lock"); 256 fs_logger("tmpfs /var/lock");
256 } 257 }
257 else { 258 else {
258 char *lnk = realpath("/var/lock", NULL); 259 fwarning("/var/lock not mounted\n");
259 if (lnk) { 260 dbg_test_dir("/var/lock");
260 if (!is_dir(lnk)) {
261 // create directory
262 mkdir_attr(lnk, S_IRWXU|S_IRWXG|S_IRWXO, 0, 0);
263 }
264 if (arg_debug)
265 printf("Mounting tmpfs on %s on behalf of /var/lock\n", lnk);
266 if (mount("tmpfs", lnk, "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=1777,gid=0") < 0)
267 errExit("mounting /var/lock");
268 free(lnk);
269 fs_logger("tmpfs /var/lock");
270 }
271 else {
272 fwarning("/var/lock not mounted\n");
273 dbg_test_dir("/var/lock");
274 }
275 } 261 }
276} 262}
277 263
@@ -281,7 +267,7 @@ void fs_var_tmp(void) {
281 if (!is_link("/var/tmp")) { 267 if (!is_link("/var/tmp")) {
282 if (arg_debug) 268 if (arg_debug)
283 printf("Mounting tmpfs on /var/tmp\n"); 269 printf("Mounting tmpfs on /var/tmp\n");
284 if (mount("tmpfs", "/var/tmp", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=1777,gid=0") < 0) 270 if (mount("tmpfs", "/var/tmp", "tmpfs", MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME, "mode=1777,gid=0") < 0)
285 errExit("mounting /var/tmp"); 271 errExit("mounting /var/tmp");
286 fs_logger("tmpfs /var/tmp"); 272 fs_logger("tmpfs /var/tmp");
287 } 273 }
@@ -300,7 +286,7 @@ void fs_var_utmp(void) {
300 if (stat(UTMP_FILE, &s) == 0) 286 if (stat(UTMP_FILE, &s) == 0)
301 utmp_group = s.st_gid; 287 utmp_group = s.st_gid;
302 else { 288 else {
303 fwarning("cannot find /var/run/utmp\n"); 289 fwarning("cannot find %s\n", UTMP_FILE);
304 return; 290 return;
305 } 291 }
306 292
@@ -309,7 +295,7 @@ void fs_var_utmp(void) {
309 printf("Create the new utmp file\n"); 295 printf("Create the new utmp file\n");
310 296
311 /* coverity[toctou] */ 297 /* coverity[toctou] */
312 FILE *fp = fopen(RUN_UTMP_FILE, "w"); 298 FILE *fp = fopen(RUN_UTMP_FILE, "we");
313 if (!fp) 299 if (!fp)
314 errExit("fopen"); 300 errExit("fopen");
315 301
@@ -336,5 +322,9 @@ void fs_var_utmp(void) {
336 printf("Mount the new utmp file\n"); 322 printf("Mount the new utmp file\n");
337 if (mount(RUN_UTMP_FILE, UTMP_FILE, NULL, MS_BIND|MS_NOSUID|MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0) 323 if (mount(RUN_UTMP_FILE, UTMP_FILE, NULL, MS_BIND|MS_NOSUID|MS_NOEXEC | MS_NODEV | MS_REC, NULL) < 0)
338 errExit("mount bind utmp"); 324 errExit("mount bind utmp");
339 fs_logger("create /var/run/utmp"); 325 fs_logger2("create", UTMP_FILE);
326
327 // blacklist RUN_UTMP_FILE
328 if (mount(RUN_RO_FILE, RUN_UTMP_FILE, NULL, MS_BIND, "mode=400,gid=0") < 0)
329 errExit("mount bind");
340} 330}
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c
index 6e766f996..943f275de 100644
--- a/src/firejail/fs_whitelist.c
+++ b/src/firejail/fs_whitelist.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -16,323 +16,527 @@
16 * You should have received a copy of the GNU General Public License along 16 * You should have received a copy of the GNU General Public License along
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#include "firejail.h" 20#include "firejail.h"
21#include <sys/mount.h> 21#include <sys/mount.h>
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <linux/limits.h>
24#include <fnmatch.h> 23#include <fnmatch.h>
25#include <glob.h> 24#include <glob.h>
26#include <dirent.h>
27#include <fcntl.h>
28#include <errno.h> 25#include <errno.h>
29 26
30static char *dentry[] = { 27#include <fcntl.h>
31 "Downloads", 28#ifndef O_PATH
32 "Загрузки", 29#define O_PATH 010000000
33 "Téléchargement", 30#endif
34 NULL
35};
36
37#define EMPTY_STRING ("")
38#define MAXBUF 4098
39static char *resolve_downloads(int nowhitelist_flag) {
40 char *fname;
41 struct stat s;
42 31
43 // try a well known download directory name 32#define TOP_MAX 64 // maximum number of top level directories
44 int i = 0;
45 while (dentry[i] != NULL) {
46 if (asprintf(&fname, "%s/%s", cfg.homedir, dentry[i]) == -1)
47 errExit("asprintf");
48 33
49 if (stat(fname, &s) == 0) { 34// mountinfo functionality test;
50 if (arg_debug || arg_debug_whitelists) 35// 1. enable TEST_MOUNTINFO definition
51 printf("Downloads directory resolved as \"%s\"\n", fname); 36// 2. run firejail --whitelist=/any/directory
37//#define TEST_MOUNTINFO
52 38
53 char *rv; 39static size_t homedir_len = 0; // cache length of homedir string
54 if (nowhitelist_flag) { 40static size_t runuser_len = 0; // cache length of runuser string
55 if (asprintf(&rv, "nowhitelist ~/%s", dentry[i]) == -1) 41static char *runuser = NULL;
56 errExit("asprintf"); 42
57 } 43
58 else { 44
59 if (asprintf(&rv, "whitelist ~/%s", dentry[i]) == -1) 45static void whitelist_error(const char *path) {
60 errExit("asprintf"); 46 assert(path);
47
48 fprintf(stderr, "Error: invalid whitelist path %s\n", path);
49 exit(1);
50}
51
52static int whitelist_mkpath(const char* path, mode_t mode) {
53 // work on a copy of the path
54 char *dup = strdup(path);
55 if (!dup)
56 errExit("strdup");
57
58 // only create leading directories, don't create the file
59 char *p = strrchr(dup, '/');
60 assert(p);
61 *p = '\0';
62
63 int parentfd = open("/", O_PATH|O_DIRECTORY|O_CLOEXEC);
64 if (parentfd == -1)
65 errExit("open");
66
67 // traverse the path, return -1 if a symlink is encountered
68 int fd = -1;
69 int done = 0;
70 char *tok = strtok(dup, "/");
71 assert(tok);
72 while (tok) {
73 // create the directory if necessary
74 if (mkdirat(parentfd, tok, mode) == -1) {
75 if (errno != EEXIST) {
76 if (arg_debug || arg_debug_whitelists)
77 perror("mkdir");
78 close(parentfd);
79 free(dup);
80 return -1;
61 } 81 }
62 free(fname);
63 return rv;
64 } 82 }
65 free(fname); 83 else
66 i++; 84 done = 1;
85 // open the directory
86 fd = openat(parentfd, tok, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
87 if (fd == -1) {
88 if (arg_debug || arg_debug_whitelists)
89 perror("open");
90 close(parentfd);
91 free(dup);
92 return -1;
93 }
94 // move on to next path segment
95 close(parentfd);
96 parentfd = fd;
97 tok = strtok(NULL, "/");
67 } 98 }
68 99
69 // try a name form ~/.config/user-dirs.dirs 100 if (done)
70 if (asprintf(&fname, "%s/.config/user-dirs.dirs", cfg.homedir) == -1) 101 fs_logger2("mkpath", path);
71 errExit("asprintf"); 102
72 FILE *fp = fopen(fname, "r"); 103 free(dup);
73 if (!fp) { 104 return fd;
74 free(fname); 105}
75 return NULL; 106
107static void whitelist_file(int dirfd, const char *relpath, const char *path) {
108 assert(relpath && path);
109
110 // open mount source, using a file descriptor that refers to the
111 // top level directory
112 // as the top level directory was opened before mounting the tmpfs
113 // we still have full access to all directory contents
114 // take care to not follow symbolic links (dirfd was obtained without
115 // following a link, too)
116 int fd = safer_openat(dirfd, relpath, O_PATH|O_NOFOLLOW|O_CLOEXEC);
117 if (fd == -1) {
118 if (arg_debug || arg_debug_whitelists)
119 printf("Debug %d: skip whitelist %s\n", __LINE__, path);
120 return;
121 }
122 struct stat s;
123 if (fstat(fd, &s) == -1)
124 errExit("fstat");
125 if (S_ISLNK(s.st_mode)) {
126 if (arg_debug || arg_debug_whitelists)
127 printf("Debug %d: skip whitelist %s\n", __LINE__, path);
128 close(fd);
129 return;
130 }
131
132 // create mount target as root, except if inside home or run/user/$UID directory
133 int userprivs = 0;
134 if ((strncmp(path, cfg.homedir, homedir_len) == 0 && path[homedir_len] == '/') ||
135 (strncmp(path, runuser, runuser_len) == 0 && path[runuser_len] == '/')) {
136 EUID_USER();
137 userprivs = 1;
76 } 138 }
77 free(fname);
78 139
79 // extract downloads directory 140 // create path of the mount target
80 char buf[MAXBUF]; 141 int fd2 = whitelist_mkpath(path, 0755);
81 while (fgets(buf, MAXBUF, fp)) { 142 if (fd2 == -1) {
82 char *ptr = buf; 143 // something went wrong during path creation or a symlink was found;
144 // if there is a symlink somewhere in the path of the mount target,
145 // assume the file is whitelisted already
146 if (arg_debug || arg_debug_whitelists)
147 printf("Debug %d: skip whitelist %s\n", __LINE__, path);
148 close(fd);
149 if (userprivs)
150 EUID_ROOT();
151 return;
152 }
83 153
84 // skip blanks 154 // get file name of the mount target
85 while (*ptr == ' ' || *ptr == '\t') 155 const char *file = gnu_basename(path);
86 ptr++;
87 if (*ptr == '\0' || *ptr == '\n' || *ptr == '#')
88 continue;
89 156
90 if (strncmp(ptr, "XDG_DOWNLOAD_DIR=\"$HOME/", 24) == 0) { 157 // create mount target itself and open it, a symlink is rejected
91 char *ptr1 = ptr + 24; 158 int fd3 = -1;
92 char *ptr2 = strchr(ptr1, '"'); 159 if (S_ISDIR(s.st_mode)) {
93 if (ptr2) { 160 // directory foo can exist already:
94 fclose(fp); 161 // firejail --whitelist=~/foo/bar --whitelist=~/foo
95 *ptr2 = '\0'; 162 if (mkdirat(fd2, file, 0755) == -1 && errno != EEXIST) {
96 if (arg_debug || arg_debug_whitelists) 163 if (arg_debug || arg_debug_whitelists) {
97 printf("extracted %s from ~/.config/user-dirs.dirs\n", ptr1); 164 perror("mkdir");
98 if (strlen(ptr1) != 0) { 165 printf("Debug %d: skip whitelist %s\n", __LINE__, path);
99 if (arg_debug || arg_debug_whitelists)
100 printf("Downloads directory resolved as \"%s\"\n", ptr1);
101
102 if (asprintf(&fname, "%s/%s", cfg.homedir, ptr1) == -1)
103 errExit("asprintf");
104
105 if (stat(fname, &s) == -1) {
106 free(fname);
107 goto errout;
108 }
109
110 char *rv;
111 if (nowhitelist_flag) {
112 if (asprintf(&rv, "nowhitelist ~/%s", ptr + 24) == -1)
113 errExit("asprintf");
114 }
115 else {
116 if (asprintf(&rv, "whitelist ~/%s", ptr + 24) == -1)
117 errExit("asprintf");
118 }
119 return rv;
120 }
121 else
122 goto errout;
123 } 166 }
167 close(fd);
168 close(fd2);
169 if (userprivs)
170 EUID_ROOT();
171 return;
124 } 172 }
173 fd3 = openat(fd2, file, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
125 } 174 }
175 else
176 // create an empty file, fails with EEXIST if it is whitelisted already:
177 // firejail --whitelist=/foo --whitelist=/foo/bar
178 fd3 = openat(fd2, file, O_RDONLY|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR|S_IWUSR);
126 179
127 fclose(fp); 180 if (fd3 == -1) {
128 return NULL; 181 if (errno != EEXIST && (arg_debug || arg_debug_whitelists)) {
129 182 perror("open");
130errout: 183 printf("Debug %d: skip whitelist %s\n", __LINE__, path);
131 if (!arg_private) { 184 }
132 fprintf(stderr, "***\n"); 185 close(fd);
133 fprintf(stderr, "*** Error: Downloads directory was not found in user home.\n"); 186 close(fd2);
134 fprintf(stderr, "*** \tAny files saved by the program, will be lost when the sandbox is closed.\n"); 187 if (userprivs)
135 fprintf(stderr, "***\n"); 188 EUID_ROOT();
189 return;
136 } 190 }
137 191
138 return NULL; 192 close(fd2);
193 if (userprivs)
194 EUID_ROOT();
195
196 if (arg_debug || arg_debug_whitelists)
197 printf("Whitelisting %s\n", path);
198 if (bind_mount_by_fd(fd, fd3))
199 errExit("mount bind");
200 // check the last mount operation
201 MountData *mptr = get_last_mount(); // will do exit(1) if the mount cannot be found
202#ifdef TEST_MOUNTINFO
203 printf("TEST_MOUNTINFO\n");
204 mptr->dir = "foo";
205#endif
206 // confirm the file was mounted on the right target
207 // strcmp does not work here, because mptr->dir can be a child mount
208 size_t path_len = strlen(path);
209 if (strncmp(mptr->dir, path, path_len) != 0 ||
210 (*(mptr->dir + path_len) != '\0' && *(mptr->dir + path_len) != '/'))
211 errLogExit("invalid whitelist mount");
212 // No mounts are allowed on top level directories. A destination such as "/etc" is very bad!
213 // - there should be more than one '/' char in dest string
214 if (mptr->dir == strrchr(mptr->dir, '/'))
215 errLogExit("invalid whitelist mount");
216 close(fd);
217 close(fd3);
218 fs_logger2("whitelist", path);
139} 219}
140 220
141static int mkpath(const char* path, mode_t mode) { 221static void whitelist_symlink(const char *link, const char *target) {
142 assert(path && *path); 222 assert(link && target);
143 223
144 mode |= 0111; 224 // create files as root, except if inside home or run/user/$UID directory
225 int userprivs = 0;
226 if ((strncmp(link, cfg.homedir, homedir_len) == 0 && link[homedir_len] == '/') ||
227 (strncmp(link, runuser, runuser_len) == 0 && link[runuser_len] == '/')) {
228 EUID_USER();
229 userprivs = 1;
230 }
145 231
146 // create directories with uid/gid as root or as current user if inside home directory 232 int fd = whitelist_mkpath(link, 0755);
147 uid_t uid = getuid(); 233 if (fd == -1) {
148 gid_t gid = getgid(); 234 if (arg_debug || arg_debug_whitelists)
149 if (strncmp(path, cfg.homedir, strlen(cfg.homedir)) != 0) { 235 printf("Debug %d: cannot create symbolic link %s\n", __LINE__, link);
150 uid = 0; 236 if (userprivs)
151 gid = 0; 237 EUID_ROOT();
238 return;
152 } 239 }
153 240
154 // work on a copy of the path 241 // get file name of symlink
155 char *file_path = strdup(path); 242 const char *file = gnu_basename(link);
156 if (!file_path)
157 errExit("strdup");
158 243
159 char* p; 244 // create the link
160 int done = 0; 245 if (symlinkat(target, fd, file) == -1) {
161 for (p=strchr(file_path+1, '/'); p; p=strchr(p+1, '/')) { 246 if (arg_debug || arg_debug_whitelists) {
162 *p='\0'; 247 perror("symlink");
163 if (mkdir(file_path, mode)==-1) { 248 printf("Debug %d: cannot create symbolic link %s\n", __LINE__, link);
164 if (errno != EEXIST) {
165 *p='/';
166 free(file_path);
167 return -1;
168 }
169 } 249 }
170 else {
171 if (set_perms(file_path, uid, gid, mode))
172 errExit("set_perms");
173 done = 1;
174 }
175
176 *p='/';
177 } 250 }
178 if (done) 251 else if (arg_debug || arg_debug_whitelists)
179 fs_logger2("mkpath", path); 252 printf("Created symbolic link %s -> %s\n", link, target);
180 253
181 free(file_path); 254 close(fd);
182 return 0; 255 if (userprivs)
256 EUID_ROOT();
183} 257}
184 258
185static void whitelist_path(ProfileEntry *entry) { 259static void globbing(const char *pattern) {
186 assert(entry); 260 EUID_ASSERT();
187 char *path = entry->data + 10; 261 assert(pattern);
188 assert(path);
189 const char *fname;
190 char *wfile = NULL;
191
192 if (entry->home_dir) {
193 if (strncmp(path, cfg.homedir, strlen(cfg.homedir)) == 0) {
194 fname = path + strlen(cfg.homedir);
195 if (*fname == '\0')
196 goto errexit;
197 }
198 else
199 fname = path;
200 262
201 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_HOME_USER_DIR, fname) == -1) 263 // globbing
202 errExit("asprintf"); 264 glob_t globbuf;
265 int globerr = glob(pattern, GLOB_NOCHECK | GLOB_NOSORT | GLOB_PERIOD, NULL, &globbuf);
266 if (globerr) {
267 fprintf(stderr, "Error: failed to glob private-bin pattern %s\n", pattern);
268 exit(1);
203 } 269 }
204 else if (entry->tmp_dir) {
205 fname = path + 4; // strlen("/tmp")
206 if (*fname == '\0')
207 goto errexit;
208 270
209 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_TMP_DIR, fname) == -1) 271 size_t i;
210 errExit("asprintf"); 272 for (i = 0; i < globbuf.gl_pathc; i++) {
211 } 273 assert(globbuf.gl_pathv[i]);
212 else if (entry->media_dir) { 274 // testing for GLOB_NOCHECK - no pattern matched returns the original pattern
213 fname = path + 6; // strlen("/media") 275 if (strcmp(globbuf.gl_pathv[i], pattern) == 0)
214 if (*fname == '\0') 276 continue;
215 goto errexit; 277 // foo/* expands to foo/. and foo/..
278 const char *base = gnu_basename(globbuf.gl_pathv[i]);
279 if (strcmp(base, ".") == 0 ||
280 strcmp(base, "..") == 0)
281 continue;
216 282
217 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_MEDIA_DIR, fname) == -1) 283 // build the new profile command
284 char *newcmd;
285 if (asprintf(&newcmd, "whitelist %s", globbuf.gl_pathv[i]) == -1)
218 errExit("asprintf"); 286 errExit("asprintf");
287
288 // add the new profile command at the end of the list
289 if (arg_debug || arg_debug_whitelists)
290 printf("Adding new profile command: %s\n", newcmd);
291 profile_add(newcmd);
219 } 292 }
220 else if (entry->mnt_dir) {
221 fname = path + 4; // strlen("/mnt")
222 if (*fname == '\0')
223 goto errexit;
224 293
225 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_MNT_DIR, fname) == -1) 294 globfree(&globbuf);
226 errExit("asprintf"); 295}
296
297// mount tmpfs on all top level directories
298static void tmpfs_topdirs(const TopDir *topdirs) {
299 int tmpfs_home = 0;
300 int tmpfs_runuser = 0;
301
302 int i;
303 for (i = 0; i < TOP_MAX && topdirs[i].path; i++) {
304 // do nested top level directories last
305 // this way '--whitelist=nested_top_level_dir'
306 // yields the full, unmodified directory
307 // instead of the tmpfs
308 if (strcmp(topdirs[i].path, cfg.homedir) == 0) {
309 tmpfs_home = 1;
310 continue;
311 }
312 if (strcmp(topdirs[i].path, runuser) == 0) {
313 tmpfs_runuser = 1;
314 continue;
315 }
316
317 // special case /run
318 // open /run/firejail, so it can be restored right after mounting the tmpfs
319 int fd = -1;
320 if (strcmp(topdirs[i].path, "/run") == 0) {
321 fd = open(RUN_FIREJAIL_DIR, O_PATH|O_CLOEXEC);
322 if (fd == -1)
323 errExit("open");
324 }
325
326 // mount tmpfs
327 fs_tmpfs(topdirs[i].path, 0);
328 selinux_relabel_path(topdirs[i].path, topdirs[i].path);
329
330 // init tmpfs
331 if (strcmp(topdirs[i].path, "/run") == 0) {
332 // restore /run/firejail directory
333 if (mkdir(RUN_FIREJAIL_DIR, 0755) == -1)
334 errExit("mkdir");
335 if (bind_mount_fd_to_path(fd, RUN_FIREJAIL_DIR))
336 errExit("mount bind");
337 close(fd);
338 fs_logger2("whitelist", RUN_FIREJAIL_DIR);
339
340 // restore /run/user/$UID directory
341 // get path relative to /run
342 const char *rel = runuser + 5;
343 whitelist_file(topdirs[i].fd, rel, runuser);
344 }
345 else if (strcmp(topdirs[i].path, "/tmp") == 0) {
346 // fix pam-tmpdir (#2685)
347 const char *env = env_get("TMP");
348 if (env) {
349 char *pamtmpdir;
350 if (asprintf(&pamtmpdir, "/tmp/user/%u", getuid()) == -1)
351 errExit("asprintf");
352 if (strcmp(env, pamtmpdir) == 0) {
353 // create empty user-owned /tmp/user/$UID directory
354 mkdir_attr("/tmp/user", 0711, 0, 0);
355 selinux_relabel_path("/tmp/user", "/tmp/user");
356 fs_logger("mkdir /tmp/user");
357 mkdir_attr(pamtmpdir, 0700, getuid(), 0);
358 selinux_relabel_path(pamtmpdir, pamtmpdir);
359 fs_logger2("mkdir", pamtmpdir);
360 }
361 free(pamtmpdir);
362 }
363 }
364
365 // restore user home directory if it is masked by the tmpfs
366 // creates path owned by root
367 // does nothing if user home directory doesn't exist
368 size_t topdir_len = strlen(topdirs[i].path);
369 if (strncmp(topdirs[i].path, cfg.homedir, topdir_len) == 0 && cfg.homedir[topdir_len] == '/') {
370 // get path relative to top level directory
371 const char *rel = cfg.homedir + topdir_len + 1;
372 whitelist_file(topdirs[i].fd, rel, cfg.homedir);
373 }
227 } 374 }
228 else if (entry->var_dir) {
229 fname = path + 4; // strlen("/var")
230 if (*fname == '\0')
231 goto errexit;
232 375
233 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_VAR_DIR, fname) == -1) 376 // user home directory
234 errExit("asprintf"); 377 if (tmpfs_home) {
378 EUID_USER();
379 fs_private(); // checks owner if outside /home
380 EUID_ROOT();
235 } 381 }
236 else if (entry->dev_dir) {
237 fname = path + 4; // strlen("/dev")
238 if (*fname == '\0')
239 goto errexit;
240 382
241 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_DEV_DIR, fname) == -1) 383 // /run/user/$UID directory
242 errExit("asprintf"); 384 if (tmpfs_runuser) {
385 fs_tmpfs(runuser, 0);
386 selinux_relabel_path(runuser, runuser);
243 } 387 }
244 else if (entry->opt_dir) { 388}
245 fname = path + 4; // strlen("/opt")
246 if (*fname == '\0')
247 goto errexit;
248 389
249 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_OPT_DIR, fname) == -1) 390static int reject_topdir(const char *dir) {
250 errExit("asprintf"); 391 if (!whitelist_reject_topdirs)
392 return 0;
393
394 size_t i;
395 for (i = 0; whitelist_reject_topdirs[i]; i++) {
396 if (strcmp(dir, whitelist_reject_topdirs[i]) == 0)
397 return 1;
251 } 398 }
252 else if (entry->srv_dir) { 399 return 0;
253 fname = path + 4; // strlen("/srv") 400}
254 if (*fname == '\0')
255 goto errexit;
256 401
257 if (asprintf(&wfile, "%s/%s", RUN_WHITELIST_SRV_DIR, fname) == -1) 402// keep track of whitelist top level directories by adding them to an array
258 errExit("asprintf"); 403// open each directory
404static TopDir *add_topdir(const char *dir, TopDir *topdirs, const char *path) {
405 assert(dir && path);
406
407 // /proc and /sys are not allowed
408 if (strcmp(dir, "/") == 0 ||
409 strcmp(dir, "/proc") == 0 ||
410 strcmp(dir, "/sys") == 0)
411 whitelist_error(path);
412
413 // whitelisting home directory is disabled if --private option is present
414 if (arg_private && strcmp(dir, cfg.homedir) == 0) {
415 if (arg_debug || arg_debug_whitelists)
416 printf("Debug %d: skip %s - a private home dir is configured!\n", __LINE__, path);
417 return NULL;
259 } 418 }
260 // check if the file exists 419
420 // do nothing if directory doesn't exist
261 struct stat s; 421 struct stat s;
262 if (wfile && stat(wfile, &s) == 0) { 422 if (lstat(dir, &s) != 0) {
263 if (arg_debug || arg_debug_whitelists) 423 if (arg_debug || arg_debug_whitelists)
264 printf("Whitelisting %s\n", path); 424 printf("Cannot access whitelist top level directory %s: %s\n", dir, strerror(errno));
425 return NULL;
265 } 426 }
266 else { 427 // do nothing if directory is a link
267 return; 428 if (!S_ISDIR(s.st_mode)) {
429 if (S_ISLNK(s.st_mode)) {
430 fwarning("skipping whitelist %s because %s is a symbolic link\n", path, dir);
431 return NULL;
432 }
433 whitelist_error(path);
434 }
435 // do nothing if directory is disabled by administrator
436 if (reject_topdir(dir)) {
437 fmessage("Whitelist top level directory %s is disabled in Firejail configuration file\n", dir);
438 return NULL;
268 } 439 }
269 440
270 // create the path if necessary 441 // add directory to array
271 mkpath(path, s.st_mode); 442 if (arg_debug || arg_debug_whitelists)
272 fs_logger2("whitelist", path); 443 printf("Adding whitelist top level directory %s\n", dir);
273 444 static int cnt = 0;
274 // process directory 445 if (cnt >= TOP_MAX) {
275 if (S_ISDIR(s.st_mode)) { 446 fprintf(stderr, "Error: too many whitelist top level directories\n");
276 // create directory 447 exit(1);
277 int rv = mkdir(path, 0755);
278 (void) rv;
279 } 448 }
449 TopDir *rv = topdirs + cnt;
450 cnt++;
280 451
281 // process regular file 452 rv->path = strdup(dir);
282 else { 453 if (!rv->path)
283 if (access(path, R_OK)) { 454 errExit("strdup");
284 // create an empty file 455
285 FILE *fp = fopen(path, "w"); 456 // open the directory, don't follow symbolic links
286 if (!fp) { 457 rv->fd = safer_openat(-1, dir, O_PATH|O_NOFOLLOW|O_DIRECTORY|O_CLOEXEC);
287 fprintf(stderr, "Error: cannot create empty file in home directory\n"); 458 if (rv->fd == -1) {
288 exit(1); 459 fprintf(stderr, "Error: cannot open %s\n", dir);
289 } 460 exit(1);
290 // set file properties
291 SET_PERMS_STREAM(fp, s.st_uid, s.st_gid, s.st_mode);
292 fclose(fp);
293 }
294 else
295 return; // the file is already present
296 } 461 }
297 462
298 // mount 463 return rv;
299 if (mount(wfile, path, NULL, MS_BIND|MS_REC, NULL) < 0) 464}
300 errExit("mount bind");
301 465
302 free(wfile); 466static TopDir *have_topdir(const char *dir, TopDir *topdirs) {
303 return; 467 assert(dir);
304 468
305errexit: 469 int i;
306 fprintf(stderr, "Error: file %s is not in the whitelisted directory\n", path); 470 for (i = 0; i < TOP_MAX; i++) {
307 exit(1); 471 TopDir *rv = topdirs + i;
472 if (!rv->path)
473 break;
474 if (strcmp(dir, rv->path) == 0)
475 return rv;
476 }
477 return NULL;
308} 478}
309 479
480static char *extract_topdir(const char *path) {
481 assert(path);
482
483 char *dup = strdup(path);
484 if (!dup)
485 errExit("strdup");
486
487 // user home directory can be anywhere; disconnect user home
488 // whitelisting from top level directory whitelisting
489 // by treating user home as separate whitelist top level directory
490 if (strncmp(dup, cfg.homedir, homedir_len) == 0 && dup[homedir_len] == '/')
491 dup[homedir_len] = '\0';
492 // /run/user/$UID is treated as top level directory
493 else if (strncmp(dup, runuser, runuser_len) == 0 && dup[runuser_len] == '/')
494 dup[runuser_len] = '\0';
495 // whitelisting in /sys is not allowed, but /sys/module is an exception
496 // and is treated as top level directory here
497 else if (strncmp(dup, "/sys/module", 11) == 0 && dup[11] == '/')
498 dup[11] = '\0';
499 // treat /usr subdirectories as top level directories
500 else if (strncmp(dup, "/usr/", 5) == 0) {
501 char *p = strchr(dup+5, '/');
502 if (!p)
503 whitelist_error(path);
504 *p = '\0';
505 }
506 // all other top level directories
507 else {
508 assert(dup[0] == '/');
509 char *p = strchr(dup+1, '/');
510 if (!p)
511 whitelist_error(path);
512 *p = '\0';
513 }
514
515 return dup;
516}
310 517
311// whitelist for /home/user directory
312void fs_whitelist(void) { 518void fs_whitelist(void) {
313 char *homedir = cfg.homedir;
314 assert(homedir);
315 ProfileEntry *entry = cfg.profile; 519 ProfileEntry *entry = cfg.profile;
316 if (!entry) 520 if (!entry)
317 return; 521 return;
318 522
319 char *new_name = NULL; 523 if (asprintf(&runuser, "/run/user/%u", getuid()) == -1)
320 int home_dir = 0; // /home/user directory flag 524 errExit("asprintf");
321 int tmp_dir = 0; // /tmp directory flag 525 runuser_len = strlen(runuser);
322 int media_dir = 0; // /media directory flag 526 homedir_len = strlen(cfg.homedir);
323 int mnt_dir = 0; // /mnt directory flag
324 int var_dir = 0; // /var directory flag
325 int dev_dir = 0; // /dev directory flag
326 int opt_dir = 0; // /opt directory flag
327 int srv_dir = 0; // /srv directory flag
328 527
329 size_t nowhitelist_c = 0; 528 size_t nowhitelist_c = 0;
330 size_t nowhitelist_m = 32; 529 size_t nowhitelist_m = 32;
331 char **nowhitelist = calloc(nowhitelist_m, sizeof(*nowhitelist)); 530 char **nowhitelist = calloc(nowhitelist_m, sizeof(*nowhitelist));
332 if (nowhitelist == NULL) 531 if (nowhitelist == NULL)
333 errExit("failed allocating memory for nowhitelist entries"); 532 errExit("calloc");
533
534 TopDir *topdirs = calloc(TOP_MAX, sizeof(*topdirs));
535 if (topdirs == NULL)
536 errExit("calloc");
334 537
335 // verify whitelist files, extract symbolic links, etc. 538 // verify whitelist files, extract symbolic links, etc.
539 EUID_USER();
336 while (entry) { 540 while (entry) {
337 int nowhitelist_flag = 0; 541 int nowhitelist_flag = 0;
338 542
@@ -345,82 +549,108 @@ void fs_whitelist(void) {
345 entry = entry->next; 549 entry = entry->next;
346 continue; 550 continue;
347 } 551 }
348 char *dataptr = (nowhitelist_flag)? entry->data + 12: entry->data + 10; 552 if (arg_debug || arg_debug_whitelists)
349 553 printf("Debug %d: %s\n", __LINE__, entry->data);
350 // resolve ${DOWNLOADS} 554
351 if (strcmp(dataptr, "${DOWNLOADS}") == 0) { 555 const char *dataptr = (nowhitelist_flag)? entry->data + 12: entry->data + 10;
352 char *tmp = resolve_downloads(nowhitelist_flag); 556
353 if (tmp) { 557 // replace ~ into /home/username or resolve macro
354 entry->data = tmp; 558 char *expanded = expand_macros(dataptr);
355 dataptr = (nowhitelist_flag)? entry->data + 12: entry->data + 10; 559
356 } 560 // check if respolving the macro was successful
357 else { 561 if (is_macro(expanded) && macro_id(expanded) > -1) {
358 if (!nowhitelist_flag && !arg_quiet && !arg_private) { 562 if (!nowhitelist_flag && (have_topdir(cfg.homedir, topdirs) || add_topdir(cfg.homedir, topdirs, expanded)) && !arg_quiet) {
359 fprintf(stderr, "***\n"); 563 fprintf(stderr, "***\n");
360 fprintf(stderr, "*** Warning: cannot whitelist Downloads directory\n"); 564 fprintf(stderr, "*** Warning: cannot whitelist %s directory\n", expanded);
361 fprintf(stderr, "*** \tAny file saved will be lost when the sandbox is closed.\n"); 565 fprintf(stderr, "*** Any file saved in this directory will be lost when the sandbox is closed.\n");
362 fprintf(stderr, "*** \tPlease create a proper Downloads directory for your application.\n"); 566 fprintf(stderr, "***\n");
363 fprintf(stderr, "***\n");
364 }
365 entry->data = EMPTY_STRING;
366 continue;
367 } 567 }
568 entry = entry->next;
569 free(expanded);
570 continue;
368 } 571 }
369 572
370 // replace ~/ or ${HOME} into /home/username
371 new_name = expand_home(dataptr, cfg.homedir);
372 assert(new_name);
373 if (arg_debug || arg_debug_whitelists) 573 if (arg_debug || arg_debug_whitelists)
374 fprintf(stderr, "Debug %d: new_name #%s#, %s\n", __LINE__, new_name, (nowhitelist_flag)? "nowhitelist": "whitelist"); 574 printf("Debug %d: expanded: %s\n", __LINE__, expanded);
575
576 // path should be absolute at this point
577 if (expanded[0] != '/')
578 whitelist_error(expanded);
579
580 // sane pathname
581 char *new_name = clean_pathname(expanded);
582 free(expanded);
583
584 if (arg_debug || arg_debug_whitelists)
585 printf("Debug %d: new_name: %s\n", __LINE__, new_name);
586
587 if (strstr(new_name, ".."))
588 whitelist_error(new_name);
589
590 // /run/firejail is not allowed
591 if (strncmp(new_name, RUN_FIREJAIL_DIR, strlen(RUN_FIREJAIL_DIR)) == 0)
592 whitelist_error(new_name);
375 593
376 // valid path referenced to filesystem root 594 TopDir *current_top = NULL;
377 if (*new_name != '/') { 595 if (!nowhitelist_flag) {
596 // extract whitelist top level directory
597 char *dir = extract_topdir(new_name);
378 if (arg_debug || arg_debug_whitelists) 598 if (arg_debug || arg_debug_whitelists)
379 fprintf(stderr, "Debug %d: \n", __LINE__); 599 printf("Debug %d: dir: %s\n", __LINE__, dir);
380 goto errexit; 600
601 // check if this top level directory has been processed already
602 current_top = have_topdir(dir, topdirs);
603 if (!current_top) { // got new top level directory
604 current_top = add_topdir(dir, topdirs, new_name);
605 if (!current_top) { // skip this command, top level directory not valid
606 entry = entry->next;
607 free(new_name);
608 free(dir);
609 continue;
610 }
611 }
612 free(dir);
381 } 613 }
382 614
615 // extract resolved path of the file
616 // realpath function will fail with ENOENT if the file is not found or with EACCES if user has no permission
617 // special processing for /dev/fd, /dev/stdin, /dev/stdout and /dev/stderr
618 char *fname = NULL;
619 if (strcmp(new_name, "/dev/fd") == 0)
620 fname = strdup("/proc/self/fd");
621 else if (strcmp(new_name, "/dev/stdin") == 0)
622 fname = strdup("/proc/self/fd/0");
623 else if (strcmp(new_name, "/dev/stdout") == 0)
624 fname = strdup("/proc/self/fd/1");
625 else if (strcmp(new_name, "/dev/stderr") == 0)
626 fname = strdup("/proc/self/fd/2");
627 else
628 fname = realpath(new_name, NULL);
383 629
384 // extract the absolute path of the file
385 // realpath function will fail with ENOENT if the file is not found
386 char *fname = realpath(new_name, NULL);
387 if (!fname) { 630 if (!fname) {
388 // file not found, blank the entry in the list and continue
389 if (arg_debug || arg_debug_whitelists) { 631 if (arg_debug || arg_debug_whitelists) {
390 printf("Removed whitelist/nowhitelist path: %s\n", entry->data); 632 printf("Removed path: %s\n", entry->data);
391 printf("\texpanded: %s\n", new_name); 633 printf("\texpanded: %s\n", new_name);
392 printf("\treal path: (null)\n"); 634 printf("\trealpath: (null)\n");
393 printf("\t");fflush(0); 635 printf("\t%s\n", strerror(errno));
394 perror("realpath");
395 } 636 }
396 637
397 // if 1 the file was not found; mount an empty directory
398 if (!nowhitelist_flag) { 638 if (!nowhitelist_flag) {
399 if (strncmp(new_name, cfg.homedir, strlen(cfg.homedir)) == 0) { 639 // if this is not a real path, let's try globbing
400 if(!arg_private) 640 // push the new paths at the end of profile entry list
401 home_dir = 1; 641 // the new profile entries will be processed in this loop
402 } 642 // currently there is no globbing support for nowhitelist
403 else if (strncmp(new_name, "/tmp/", 5) == 0) 643 globbing(new_name);
404 tmp_dir = 1;
405 else if (strncmp(new_name, "/media/", 7) == 0)
406 media_dir = 1;
407 else if (strncmp(new_name, "/mnt/", 5) == 0)
408 mnt_dir = 1;
409 else if (strncmp(new_name, "/var/", 5) == 0)
410 var_dir = 1;
411 else if (strncmp(new_name, "/dev/", 5) == 0)
412 dev_dir = 1;
413 else if (strncmp(new_name, "/opt/", 5) == 0)
414 opt_dir = 1;
415 else if (strncmp(new_name, "/srv/", 5) == 0)
416 opt_dir = 1;
417 } 644 }
418 645
419 entry->data = EMPTY_STRING; 646 entry = entry->next;
647 free(new_name);
420 continue; 648 continue;
421 } 649 }
422 else if (arg_debug_whitelists) 650
423 printf("real path %s\n", fname); 651 // /run/firejail is not allowed
652 if (strncmp(fname, RUN_FIREJAIL_DIR, strlen(RUN_FIREJAIL_DIR)) == 0)
653 whitelist_error(fname);
424 654
425 if (nowhitelist_flag) { 655 if (nowhitelist_flag) {
426 // store the path in nowhitelist array 656 // store the path in nowhitelist array
@@ -434,111 +664,12 @@ void fs_whitelist(void) {
434 errExit("failed increasing memory for nowhitelist entries"); 664 errExit("failed increasing memory for nowhitelist entries");
435 } 665 }
436 nowhitelist[nowhitelist_c++] = fname; 666 nowhitelist[nowhitelist_c++] = fname;
437 entry->data = EMPTY_STRING; 667 entry = entry->next;
668 free(new_name);
438 continue; 669 continue;
439 } 670 }
440
441
442 // check for supported directories
443 if (strncmp(new_name, cfg.homedir, strlen(cfg.homedir)) == 0) {
444 // whitelisting home directory is disabled if --private option is present
445 if (arg_private) {
446 if (arg_debug || arg_debug_whitelists)
447 printf("\"%s\" disabled by --private\n", entry->data);
448
449 entry->data = EMPTY_STRING;
450 continue;
451 }
452
453 entry->home_dir = 1;
454 home_dir = 1;
455 if (arg_debug || arg_debug_whitelists)
456 fprintf(stderr, "Debug %d: fname #%s#, cfg.homedir #%s#\n",
457 __LINE__, fname, cfg.homedir);
458
459 // both path and absolute path are under /home
460 if (strncmp(fname, cfg.homedir, strlen(cfg.homedir)) != 0) {
461 if (checkcfg(CFG_FOLLOW_SYMLINK_AS_USER)) {
462 // check if the file is owned by the user
463 struct stat s;
464 if (stat(fname, &s) == 0 && s.st_uid != getuid())
465 goto errexit;
466 }
467 }
468 }
469 else if (strncmp(new_name, "/tmp/", 5) == 0) {
470 entry->tmp_dir = 1;
471 tmp_dir = 1;
472 // both path and absolute path are under /tmp
473 if (strncmp(fname, "/tmp/", 5) != 0) {
474 goto errexit;
475 }
476 }
477 else if (strncmp(new_name, "/media/", 7) == 0) {
478 entry->media_dir = 1;
479 media_dir = 1;
480 // both path and absolute path are under /media
481 if (strncmp(fname, "/media/", 7) != 0) {
482 goto errexit;
483 }
484 }
485 else if (strncmp(new_name, "/mnt/", 5) == 0) {
486 entry->mnt_dir = 1;
487 mnt_dir = 1;
488 // both path and absolute path are under /mnt
489 if (strncmp(fname, "/mnt/", 5) != 0) {
490 goto errexit;
491 }
492 }
493 else if (strncmp(new_name, "/var/", 5) == 0) {
494 entry->var_dir = 1;
495 var_dir = 1;
496 // both path and absolute path are under /var
497 // exceptions: /var/run and /var/lock
498 if (strcmp(new_name, "/var/run")== 0)
499 ;
500 else if (strcmp(new_name, "/var/lock")== 0)
501 ;
502 else if (strncmp(fname, "/var/", 5) != 0) {
503 goto errexit;
504 }
505 }
506 else if (strncmp(new_name, "/dev/", 5) == 0) {
507 entry->dev_dir = 1;
508 dev_dir = 1;
509
510 // special handling for /dev/shm
511 // on some platforms (Debian wheezy, Ubuntu 14.04), it is a symlink to /run/shm
512 if (strcmp(new_name, "/dev/shm") == 0 && strcmp(fname, "/run/shm") == 0);
513 else {
514 // both path and absolute path are under /dev
515 if (strncmp(fname, "/dev/", 5) != 0) {
516 goto errexit;
517 }
518 }
519 }
520 else if (strncmp(new_name, "/opt/", 5) == 0) {
521 entry->opt_dir = 1;
522 opt_dir = 1;
523 // both path and absolute path are under /dev
524 if (strncmp(fname, "/opt/", 5) != 0) {
525 goto errexit;
526 }
527 }
528 else if (strncmp(new_name, "/srv/", 5) == 0) {
529 entry->srv_dir = 1;
530 srv_dir = 1;
531 // both path and absolute path are under /srv
532 if (strncmp(fname, "/srv/", 5) != 0) {
533 goto errexit;
534 }
535 }
536 else { 671 else {
537 goto errexit; 672 // check if the path is in nowhitelist array
538 }
539
540 // check if the path is in nowhitelist array
541 if (nowhitelist_flag == 0) {
542 size_t i; 673 size_t i;
543 int found = 0; 674 int found = 0;
544 for (i = 0; i < nowhitelist_c; i++) { 675 for (i = 0; i < nowhitelist_c; i++) {
@@ -552,277 +683,80 @@ void fs_whitelist(void) {
552 if (found) { 683 if (found) {
553 if (arg_debug || arg_debug_whitelists) 684 if (arg_debug || arg_debug_whitelists)
554 printf("Skip nowhitelisted path %s\n", fname); 685 printf("Skip nowhitelisted path %s\n", fname);
555 entry->data = EMPTY_STRING; 686 entry = entry->next;
687 free(new_name);
556 free(fname); 688 free(fname);
557 continue; 689 continue;
558 } 690 }
559 } 691 }
560 692
561 // mark symbolic links 693 // attach whitelist parameters to profile entry
694 entry->wparam = calloc(1, sizeof(struct wparam_t));
695 if (!entry->wparam)
696 errExit("calloc");
697
698 assert(current_top);
699 entry->wparam->top = current_top;
700 entry->wparam->file = fname;
701
702 // mark link
562 if (is_link(new_name)) 703 if (is_link(new_name))
563 entry->link = new_name; 704 entry->wparam->link = new_name;
564 else { 705 else
565 free(new_name); 706 free(new_name);
566 new_name = NULL;
567 }
568 707
569 // change file name in entry->data
570 if (strcmp(fname, entry->data + 10) != 0) {
571 char *newdata;
572 if (asprintf(&newdata, "whitelist %s", fname) == -1)
573 errExit("asprintf");
574 entry->data = newdata;
575 if (arg_debug || arg_debug_whitelists)
576 printf("Replaced whitelist path: %s\n", entry->data);
577 }
578 free(fname);
579 entry = entry->next; 708 entry = entry->next;
580 } 709 }
581 710
582 // release nowhitelist memory 711 // release nowhitelist memory
583 assert(nowhitelist);
584 free(nowhitelist); 712 free(nowhitelist);
585 713
586 // /home/user 714 // mount tmpfs on all top level directories
587 if (home_dir) { 715 EUID_ROOT();
588 // keep a copy of real home dir in RUN_WHITELIST_HOME_USER_DIR 716 tmpfs_topdirs(topdirs);
589 mkdir_attr(RUN_WHITELIST_HOME_USER_DIR, 0755, getuid(), getgid());
590 if (mount(cfg.homedir, RUN_WHITELIST_HOME_USER_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
591 errExit("mount bind");
592
593 // mount a tmpfs and initialize /home/user
594 fs_private();
595 }
596
597 // /tmp mountpoint
598 if (tmp_dir) {
599 // keep a copy of real /tmp directory in
600 mkdir_attr(RUN_WHITELIST_TMP_DIR, 1777, 0, 0);
601 if (mount("/tmp", RUN_WHITELIST_TMP_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
602 errExit("mount bind");
603
604 // mount tmpfs on /tmp
605 if (arg_debug || arg_debug_whitelists)
606 printf("Mounting tmpfs on /tmp directory\n");
607 if (mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=1777,gid=0") < 0)
608 errExit("mounting tmpfs on /tmp");
609 fs_logger("tmpfs /tmp");
610 }
611
612 // /media mountpoint
613 if (media_dir) {
614 // some distros don't have a /media directory
615 struct stat s;
616 if (stat("/media", &s) == 0) {
617 // keep a copy of real /media directory in RUN_WHITELIST_MEDIA_DIR
618 mkdir_attr(RUN_WHITELIST_MEDIA_DIR, 0755, 0, 0);
619 if (mount("/media", RUN_WHITELIST_MEDIA_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
620 errExit("mount bind");
621
622 // mount tmpfs on /media
623 if (arg_debug || arg_debug_whitelists)
624 printf("Mounting tmpfs on /media directory\n");
625 if (mount("tmpfs", "/media", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
626 errExit("mounting tmpfs on /media");
627 fs_logger("tmpfs /media");
628 }
629 else
630 media_dir = 0;
631 }
632
633 // /mnt mountpoint
634 if (mnt_dir) {
635 // check if /mnt directory exists
636 struct stat s;
637 if (stat("/mnt", &s) == 0) {
638 // keep a copy of real /mnt directory in RUN_WHITELIST_MNT_DIR
639 mkdir_attr(RUN_WHITELIST_MNT_DIR, 0755, 0, 0);
640 if (mount("/mnt", RUN_WHITELIST_MNT_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
641 errExit("mount bind");
642
643 // mount tmpfs on /mnt
644 if (arg_debug || arg_debug_whitelists)
645 printf("Mounting tmpfs on /mnt directory\n");
646 if (mount("tmpfs", "/mnt", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
647 errExit("mounting tmpfs on /mnt");
648 fs_logger("tmpfs /mnt");
649 }
650 else
651 mnt_dir = 0;
652 }
653
654
655 // /var mountpoint
656 if (var_dir) {
657 // keep a copy of real /var directory in RUN_WHITELIST_VAR_DIR
658 mkdir_attr(RUN_WHITELIST_VAR_DIR, 0755, 0, 0);
659 if (mount("/var", RUN_WHITELIST_VAR_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
660 errExit("mount bind");
661
662 // mount tmpfs on /var
663 if (arg_debug || arg_debug_whitelists)
664 printf("Mounting tmpfs on /var directory\n");
665 if (mount("tmpfs", "/var", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
666 errExit("mounting tmpfs on /var");
667 fs_logger("tmpfs /var");
668 }
669
670 // /dev mountpoint
671 if (dev_dir) {
672 // keep a copy of real /dev directory in RUN_WHITELIST_DEV_DIR
673 mkdir_attr(RUN_WHITELIST_DEV_DIR, 0755, 0, 0);
674 if (mount("/dev", RUN_WHITELIST_DEV_DIR, NULL, MS_BIND|MS_REC, "mode=755,gid=0") < 0)
675 errExit("mount bind");
676
677 // mount tmpfs on /dev
678 if (arg_debug || arg_debug_whitelists)
679 printf("Mounting tmpfs on /dev directory\n");
680 if (mount("tmpfs", "/dev", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
681 errExit("mounting tmpfs on /dev");
682 fs_logger("tmpfs /dev");
683 }
684
685 // /opt mountpoint
686 if (opt_dir) {
687 // keep a copy of real /opt directory in RUN_WHITELIST_OPT_DIR
688 mkdir_attr(RUN_WHITELIST_OPT_DIR, 0755, 0, 0);
689 if (mount("/opt", RUN_WHITELIST_OPT_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
690 errExit("mount bind");
691
692 // mount tmpfs on /opt
693 if (arg_debug || arg_debug_whitelists)
694 printf("Mounting tmpfs on /opt directory\n");
695 if (mount("tmpfs", "/opt", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
696 errExit("mounting tmpfs on /opt");
697 fs_logger("tmpfs /opt");
698 }
699
700 // /srv mountpoint
701 if (srv_dir) {
702 // check if /srv directory exists
703 struct stat s;
704 if (stat("/srv", &s) == 0) {
705 // keep a copy of real /srv directory in RUN_WHITELIST_SRV_DIR
706 mkdir_attr(RUN_WHITELIST_SRV_DIR, 0755, 0, 0);
707 if (mount("/srv", RUN_WHITELIST_SRV_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
708 errExit("mount bind");
709
710 // mount tmpfs on /srv
711 if (arg_debug || arg_debug_whitelists)
712 printf("Mounting tmpfs on /srv directory\n");
713 if (mount("tmpfs", "/srv", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
714 errExit("mounting tmpfs on /srv");
715 fs_logger("tmpfs /srv");
716 }
717 else
718 srv_dir = 0;
719 }
720
721 717
722 // go through profile rules again, and interpret whitelist commands 718 // go through profile rules again, and interpret whitelist commands
723 entry = cfg.profile; 719 entry = cfg.profile;
724 while (entry) { 720 while (entry) {
725 // handle only whitelist commands 721 if (entry->wparam) {
726 if (strncmp(entry->data, "whitelist ", 10)) { 722 char *file = entry->wparam->file;
727 entry = entry->next; 723 char *link = entry->wparam->link;
728 continue; 724 const char *topdir = entry->wparam->top->path;
729 } 725 size_t topdir_len = strlen(topdir);
726 int dirfd = entry->wparam->top->fd;
727
728 // top level directories of link and file can differ
729 // whitelist the file only if it is in same top level directory
730 if (strncmp(file, topdir, topdir_len) == 0 && file[topdir_len] == '/') {
731 // get path relative to top level directory
732 const char *rel = file + topdir_len + 1;
730 733
731//printf("here %d#%s#\n", __LINE__, entry->data); 734 if (arg_debug || arg_debug_whitelists)
732 // whitelist the real file 735 printf("Debug %d: file: %s; dirfd: %d; topdir: %s; rel: %s\n", __LINE__, file, dirfd, topdir, rel);
733 if (strcmp(entry->data, "whitelist /run") == 0 && 736 whitelist_file(dirfd, rel, file);
734 (strcmp(entry->link, "/var/run") == 0 || strcmp(entry->link, "/var/lock") == 0)) { 737 }
735 int rv = symlink(entry->data + 10, entry->link);
736 if (rv)
737 fprintf(stderr, "Warning cannot create symbolic link %s\n", entry->link);
738 else if (arg_debug || arg_debug_whitelists)
739 printf("Created symbolic link %s -> %s\n", entry->link, entry->data + 10);
740 }
741 else {
742 whitelist_path(entry);
743 738
744 // create the link if any 739 // create the link if any
745 if (entry->link) { 740 if (link) {
746 // if the link is already there, do not bother 741 whitelist_symlink(link, file);
747 struct stat s; 742 free(link);
748 if (stat(entry->link, &s) != 0) {
749 // create the path if necessary
750 mkpath(entry->link, s.st_mode);
751
752 int rv = symlink(entry->data + 10, entry->link);
753 if (rv)
754 fprintf(stderr, "Warning cannot create symbolic link %s\n", entry->link);
755 else if (arg_debug || arg_debug_whitelists)
756 printf("Created symbolic link %s -> %s\n", entry->link, entry->data + 10);
757 }
758 } 743 }
744
745 free(file);
746 free(entry->wparam);
747 entry->wparam = NULL;
759 } 748 }
760 749
761 entry = entry->next; 750 entry = entry->next;
762 } 751 }
763 752
764 // mask the real home directory, currently mounted on RUN_WHITELIST_HOME_DIR 753 // release resources
765 if (home_dir) { 754 free(runuser);
766 if (mount("tmpfs", RUN_WHITELIST_HOME_USER_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
767 errExit("mount tmpfs");
768 fs_logger2("tmpfs", RUN_WHITELIST_HOME_USER_DIR);
769 }
770
771 // mask the real /tmp directory, currently mounted on RUN_WHITELIST_TMP_DIR
772 if (tmp_dir) {
773 if (mount("tmpfs", RUN_WHITELIST_TMP_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
774 errExit("mount tmpfs");
775 fs_logger2("tmpfs", RUN_WHITELIST_TMP_DIR);
776 }
777
778 // mask the real /var directory, currently mounted on RUN_WHITELIST_VAR_DIR
779 if (var_dir) {
780 if (mount("tmpfs", RUN_WHITELIST_VAR_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
781 errExit("mount tmpfs");
782 fs_logger2("tmpfs", RUN_WHITELIST_VAR_DIR);
783 }
784
785 // mask the real /opt directory, currently mounted on RUN_WHITELIST_OPT_DIR
786 if (opt_dir) {
787 if (mount("tmpfs", RUN_WHITELIST_OPT_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
788 errExit("mount tmpfs");
789 fs_logger2("tmpfs", RUN_WHITELIST_OPT_DIR);
790 }
791
792 // mask the real /dev directory, currently mounted on RUN_WHITELIST_DEV_DIR
793 if (dev_dir) {
794 if (mount("tmpfs", RUN_WHITELIST_DEV_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
795 errExit("mount tmpfs");
796 fs_logger2("tmpfs", RUN_WHITELIST_DEV_DIR);
797 }
798 755
799 // mask the real /media directory, currently mounted on RUN_WHITELIST_MEDIA_DIR 756 size_t i;
800 if (media_dir) { 757 for (i = 0; i < TOP_MAX && topdirs[i].path; i++) {
801 if (mount("tmpfs", RUN_WHITELIST_MEDIA_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 758 free(topdirs[i].path);
802 errExit("mount tmpfs"); 759 close(topdirs[i].fd);
803 fs_logger2("tmpfs", RUN_WHITELIST_MEDIA_DIR);
804 } 760 }
805 761 free(topdirs);
806 // mask the real /mnt directory, currently mounted on RUN_WHITELIST_MNT_DIR
807 if (mnt_dir) {
808 if (mount("tmpfs", RUN_WHITELIST_MNT_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
809 errExit("mount tmpfs");
810 fs_logger2("tmpfs", RUN_WHITELIST_MNT_DIR);
811 }
812
813 // mask the real /srv directory, currently mounted on RUN_WHITELIST_SRV_DIR
814 if (srv_dir) {
815 if (mount("tmpfs", RUN_WHITELIST_SRV_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
816 errExit("mount tmpfs");
817 fs_logger2("tmpfs", RUN_WHITELIST_SRV_DIR);
818 }
819
820 if (new_name)
821 free(new_name);
822
823 return;
824
825errexit:
826 fprintf(stderr, "Error: invalid whitelist path %s\n", new_name);
827 exit(1);
828} 762}
diff --git a/src/firejail/git.c b/src/firejail/git.c
deleted file mode 100644
index ae28f7ec1..000000000
--- a/src/firejail/git.c
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifdef HAVE_GIT_INSTALL
22
23#include "firejail.h"
24#include <sys/utsname.h>
25#include <sched.h>
26#include <sys/mount.h>
27
28// install a very simple mount namespace sandbox with a tmpfs on top of /tmp
29// and drop privileges
30static void sbox_ns(void) {
31 if (unshare(CLONE_NEWNS) < 0)
32 errExit("unshare");
33
34 // mount events are not forwarded between the host the sandbox
35 if (mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL) < 0) {
36 errExit("mount");
37 }
38
39 // mount a tmpfs on top of /tmp
40 if (mount(NULL, "/tmp", "tmpfs", 0, NULL) < 0)
41 errExit("mount");
42
43
44 // drop privileges
45 if (setgid(getgid()) < 0)
46 errExit("setgid/getgid");
47 if (setuid(getuid()) < 0)
48 errExit("setuid/getuid");
49 assert(getenv("LD_PRELOAD") == NULL);
50
51 printf("Running as "); fflush(0);
52 int rv = system("whoami");
53 (void) rv;
54 printf("/tmp directory: "); fflush(0);
55 rv = system("ls -l /tmp");
56 (void) rv;
57}
58
59
60void git_install(void) {
61 // redirect to "/usr/bin/firejail --noprofile --private-tmp /usr/lib/firejail/fgit-install.sh"
62 EUID_ASSERT();
63 EUID_ROOT();
64
65 // install a mount namespace with a tmpfs on top of /tmp
66 sbox_ns();
67
68 // run command
69 const char *cmd = LIBDIR "/firejail/fgit-install.sh";
70 int rv = system(cmd);
71 (void) rv;
72 exit(0);
73}
74
75void git_uninstall(void) {
76 // redirect to "/usr/bin/firejail --noprofile --private-tmp /usr/lib/firejail/fgit-install.sh"
77 EUID_ASSERT();
78 EUID_ROOT();
79
80 // install a mount namespace with a tmpfs on top of /tmp
81 sbox_ns();
82
83 // run command
84 const char *cmd = LIBDIR "/firejail/fgit-uninstall.sh";
85 int rv = system(cmd);
86 (void) rv;
87 exit(0);
88}
89
90#endif // HAVE_GIT_INSTALL
diff --git a/src/firejail/ids.c b/src/firejail/ids.c
new file mode 100644
index 000000000..59acdb1fe
--- /dev/null
+++ b/src/firejail/ids.c
@@ -0,0 +1,89 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20#include "firejail.h"
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <fcntl.h>
24
25
26static void ids_init(void) {
27 // store checksums as root in /var/lib/firejail/${USERNAME}.ids
28 char *fname;
29 if (asprintf(&fname, VARDIR"/%s.ids", cfg.username) == -1)
30 errExit("asprintf");
31
32 int rv = unlink(fname);
33 (void) rv;
34 int fd = open(fname, O_CREAT | O_TRUNC | O_WRONLY, 0600);
35 if (fd < 0) {
36 fprintf(stderr, "Error: cannot create %s\n", fname);
37 exit(1);
38 }
39
40 // redirect output
41 close(STDOUT_FILENO);
42 if (dup(fd) != STDOUT_FILENO)
43 errExit("dup");
44 close(fd);
45
46 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FIDS, "--init", cfg.homedir);
47}
48
49static void ids_check(void) {
50 // store checksums as root in /var/lib/firejail/${USERNAME}.ids
51 char *fname;
52 if (asprintf(&fname, VARDIR"/%s.ids", cfg.username) == -1)
53 errExit("asprintf");
54
55 int fd = open(fname, O_RDONLY);
56 if (fd < 0) {
57 fprintf(stderr, "Error: cannot open %s\n", fname);
58 exit(1);
59 }
60
61 // redirect input
62 close(STDIN_FILENO);
63 if (dup(fd) != STDIN_FILENO)
64 errExit("dup");
65 close(fd);
66
67 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP| SBOX_ALLOW_STDIN, 3, PATH_FIDS, "--check", cfg.homedir);
68}
69
70void run_ids(int argc, char **argv) {
71 if (argc != 2) {
72 fprintf(stderr, "Error: only one IDS command expected\n");
73 exit(1);
74 }
75
76 EUID_ROOT();
77 struct stat s;
78 if (stat(VARDIR, &s)) // /var/lib/firejail
79 create_empty_dir_as_root(VARDIR, 0700);
80
81 if (strcmp(argv[1], "--ids-init") == 0)
82 ids_init();
83 else if (strcmp(argv[1], "--ids-check") == 0)
84 ids_check();
85 else
86 fprintf(stderr, "Error: unrecognized IDS command\n");
87
88 exit(0);
89} \ No newline at end of file
diff --git a/src/firejail/join.c b/src/firejail/join.c
index 9f52d4565..a869f6b64 100644
--- a/src/firejail/join.c
+++ b/src/firejail/join.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,36 +20,95 @@
20#include "firejail.h" 20#include "firejail.h"
21#include <sys/stat.h> 21#include <sys/stat.h>
22#include <sys/wait.h> 22#include <sys/wait.h>
23#include <fcntl.h>
24#include <unistd.h> 23#include <unistd.h>
25#include <sys/prctl.h>
26#include <errno.h> 24#include <errno.h>
27 25
26#include <fcntl.h>
27#ifndef O_PATH
28#define O_PATH 010000000
29#endif
30
31#include <sys/prctl.h>
32#ifndef PR_SET_NO_NEW_PRIVS
33#define PR_SET_NO_NEW_PRIVS 38
34#endif
35
36#ifdef HAVE_APPARMOR
37#include <sys/apparmor.h>
38#endif
39
28static int apply_caps = 0; 40static int apply_caps = 0;
29static uint64_t caps = 0; 41static uint64_t caps = 0;
30static int apply_seccomp = 0;
31static unsigned display = 0; 42static unsigned display = 0;
32#define BUFLEN 4096 43#define BUFLEN 4096
33 44
34static void signal_handler(int sig){ 45static void signal_handler(int sig){
35 flush_stdin(); 46 flush_stdin();
36 47
37 exit(sig); 48 exit(128 + sig);
38} 49}
39 50
51static void install_handler(void) {
52 struct sigaction sga;
40 53
54 // handle SIGTERM
55 sigemptyset(&sga.sa_mask);
56 sga.sa_handler = signal_handler;
57 sga.sa_flags = 0;
58 sigaction(SIGTERM, &sga, NULL);
59}
60
61#ifdef HAVE_APPARMOR
62static void extract_apparmor(pid_t pid) {
63 if (checkcfg(CFG_APPARMOR)) {
64 EUID_USER();
65 if (aa_is_enabled() == 1) {
66 // get pid of next child process
67 pid_t child;
68 if (find_child(pid, &child) == 1)
69 child = pid; // no child, proceed with current pid
70
71 // get name of AppArmor profile
72 char *fname;
73 if (asprintf(&fname, "/proc/%d/attr/current", child) == -1)
74 errExit("asprintf");
75 EUID_ROOT();
76 int fd = open(fname, O_RDONLY|O_CLOEXEC);
77 EUID_USER();
78 free(fname);
79 if (fd == -1)
80 goto errexit;
81 char buf[BUFLEN];
82 ssize_t rv = read(fd, buf, sizeof(buf) - 1);
83 close(fd);
84 if (rv < 0)
85 goto errexit;
86 buf[rv] = '\0';
87 // process confined by Firejail's AppArmor policy?
88 if (strncmp(buf, "firejail-default", 16) == 0)
89 arg_apparmor = 1;
90 }
91 EUID_ROOT();
92 }
93 return;
94
95errexit:
96 fprintf(stderr, "Error: cannot read /proc file\n");
97 exit(1);
98}
99#endif // HAVE_APPARMOR
41 100
42static void extract_x11_display(pid_t pid) { 101static void extract_x11_display(pid_t pid) {
43 char *fname; 102 char *fname;
44 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_X11_DIR, pid) == -1) 103 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_X11_DIR, pid) == -1)
45 errExit("asprintf"); 104 errExit("asprintf");
46 105
47 FILE *fp = fopen(fname, "r"); 106 FILE *fp = fopen(fname, "re");
48 free(fname); 107 free(fname);
49 if (!fp) 108 if (!fp)
50 return; 109 return;
51 110
52 if (1 != fscanf(fp, "%d", &display)) { 111 if (1 != fscanf(fp, "%u", &display)) {
53 fprintf(stderr, "Error: cannot read X11 display file\n"); 112 fprintf(stderr, "Error: cannot read X11 display file\n");
54 fclose(fp); 113 fclose(fp);
55 return; 114 return;
@@ -64,7 +123,7 @@ static void extract_x11_display(pid_t pid) {
64 123
65 // store the display number for join process in /run/firejail/x11 124 // store the display number for join process in /run/firejail/x11
66 EUID_ROOT(); 125 EUID_ROOT();
67 set_x11_file(getpid(), display); 126 set_x11_run_file(getpid(), display);
68 EUID_USER(); 127 EUID_USER();
69} 128}
70 129
@@ -88,10 +147,7 @@ static void extract_command(int argc, char **argv, int index) {
88 } 147 }
89 148
90 // build command 149 // build command
91 build_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, index); 150 build_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, index, true);
92
93 if (arg_debug)
94 printf("Extracted command #%s#\n", cfg.command_line);
95} 151}
96 152
97static void extract_nogroups(pid_t pid) { 153static void extract_nogroups(pid_t pid) {
@@ -100,21 +156,40 @@ static void extract_nogroups(pid_t pid) {
100 errExit("asprintf"); 156 errExit("asprintf");
101 157
102 struct stat s; 158 struct stat s;
103 if (stat(fname, &s) == -1) 159 if (stat(fname, &s) == -1) {
160 free(fname);
104 return; 161 return;
162 }
105 163
106 arg_nogroups = 1; 164 arg_nogroups = 1;
107 free(fname); 165 free(fname);
108} 166}
109 167
168static void extract_nonewprivs(pid_t pid) {
169 char *fname;
170 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_NONEWPRIVS_CFG) == -1)
171 errExit("asprintf");
172
173 struct stat s;
174 if (stat(fname, &s) == -1) {
175 free(fname);
176 return;
177 }
178
179 arg_nonewprivs = 1;
180 free(fname);
181}
182
110static void extract_cpu(pid_t pid) { 183static void extract_cpu(pid_t pid) {
111 char *fname; 184 char *fname;
112 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_CPU_CFG) == -1) 185 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_CPU_CFG) == -1)
113 errExit("asprintf"); 186 errExit("asprintf");
114 187
115 struct stat s; 188 struct stat s;
116 if (stat(fname, &s) == -1) 189 if (stat(fname, &s) == -1) {
190 free(fname);
117 return; 191 return;
192 }
118 193
119 // there is a CPU_CFG file, load it! 194 // there is a CPU_CFG file, load it!
120 load_cpu(fname); 195 load_cpu(fname);
@@ -127,48 +202,53 @@ static void extract_cgroup(pid_t pid) {
127 errExit("asprintf"); 202 errExit("asprintf");
128 203
129 struct stat s; 204 struct stat s;
130 if (stat(fname, &s) == -1) 205 if (stat(fname, &s) == -1) {
206 free(fname);
131 return; 207 return;
208 }
132 209
133 // there is a cgroup file CGROUP_CFG, load it! 210 // there is a cgroup file CGROUP_CFG, load it!
134 load_cgroup(fname); 211 load_cgroup(fname);
135 free(fname); 212 free(fname);
136} 213}
137 214
138static void extract_caps_seccomp(pid_t pid) { 215static void extract_caps(pid_t pid) {
139 // open stat file 216 // open stat file
140 char *file; 217 char *file;
141 if (asprintf(&file, "/proc/%u/status", pid) == -1) { 218 if (asprintf(&file, "/proc/%u/status", pid) == -1) {
142 perror("asprintf"); 219 perror("asprintf");
143 exit(1); 220 exit(1);
144 } 221 }
145 FILE *fp = fopen(file, "r"); 222 FILE *fp = fopen(file, "re");
146 if (!fp) { 223 if (!fp)
147 free(file); 224 goto errexit;
148 fprintf(stderr, "Error: cannot open stat file for process %u\n", pid);
149 exit(1);
150 }
151 225
152 char buf[BUFLEN]; 226 char buf[BUFLEN];
153 while (fgets(buf, BUFLEN - 1, fp)) { 227 while (fgets(buf, BUFLEN - 1, fp)) {
154 if (strncmp(buf, "Seccomp:", 8) == 0) { 228 if (strncmp(buf, "CapBnd:", 7) == 0) {
155 char *ptr = buf + 8;
156 int val;
157 sscanf(ptr, "%d", &val);
158 if (val == 2)
159 apply_seccomp = 1;
160 break;
161 }
162 else if (strncmp(buf, "CapBnd:", 7) == 0) {
163 char *ptr = buf + 7; 229 char *ptr = buf + 7;
164 unsigned long long val; 230 unsigned long long val;
165 sscanf(ptr, "%llx", &val); 231 if (sscanf(ptr, "%llx", &val) != 1)
232 goto errexit;
166 apply_caps = 1; 233 apply_caps = 1;
167 caps = val; 234 caps = val;
168 } 235 }
236 else if (strncmp(buf, "NoNewPrivs:", 11) == 0) {
237 char *ptr = buf + 11;
238 int val;
239 if (sscanf(ptr, "%d", &val) != 1)
240 goto errexit;
241 if (val)
242 arg_nonewprivs = 1;
243 }
169 } 244 }
170 fclose(fp); 245 fclose(fp);
171 free(file); 246 free(file);
247 return;
248
249errexit:
250 fprintf(stderr, "Error: cannot read stat file for process %u\n", pid);
251 exit(1);
172} 252}
173 253
174static void extract_user_namespace(pid_t pid) { 254static void extract_user_namespace(pid_t pid) {
@@ -186,7 +266,7 @@ static void extract_user_namespace(pid_t pid) {
186 char *uidmap; 266 char *uidmap;
187 if (asprintf(&uidmap, "/proc/%u/uid_map", pid) == -1) 267 if (asprintf(&uidmap, "/proc/%u/uid_map", pid) == -1)
188 errExit("asprintf"); 268 errExit("asprintf");
189 FILE *fp = fopen(uidmap, "r"); 269 FILE *fp = fopen(uidmap, "re");
190 if (!fp) { 270 if (!fp) {
191 free(uidmap); 271 free(uidmap);
192 return; 272 return;
@@ -205,30 +285,80 @@ static void extract_user_namespace(pid_t pid) {
205 free(uidmap); 285 free(uidmap);
206} 286}
207 287
208void join(pid_t pid, int argc, char **argv, int index) { 288static void extract_umask(pid_t pid) {
289 char *fname;
290 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_UMASK_FILE) == -1)
291 errExit("asprintf");
292
293 FILE *fp = fopen(fname, "re");
294 free(fname);
295 if (!fp) {
296 fprintf(stderr, "Error: cannot open umask file\n");
297 exit(1);
298 }
299 if (fscanf(fp, "%3o", &orig_umask) != 1) {
300 fprintf(stderr, "Error: cannot read umask\n");
301 exit(1);
302 }
303 fclose(fp);
304}
305
306static int open_shell(void) {
209 EUID_ASSERT(); 307 EUID_ASSERT();
210 char *homedir = cfg.homedir; 308 assert(cfg.shell);
211 pid_t parent = pid;
212 309
213 extract_command(argc, argv, index); 310 if (arg_debug)
214 signal (SIGTERM, signal_handler); 311 printf("Opening shell %s\n", cfg.shell);
312 // file descriptor will leak if not opened with O_CLOEXEC !!
313 int fd = open(cfg.shell, O_PATH|O_CLOEXEC);
314 if (fd == -1) {
315 fprintf(stderr, "Error: cannot open shell %s\n", cfg.shell);
316 exit(1);
317 }
318 return fd;
319}
215 320
216 // if the pid is that of a firejail process, use the pid of the first child process 321// return false if the sandbox identified by pid is not fully set up yet or if
322// it is no firejail sandbox at all, return true if the sandbox is complete
323bool is_ready_for_join(const pid_t pid) {
324 EUID_ASSERT();
325 // check if a file /run/firejail/mnt/join exists
326 char *fname;
327 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_JOIN_FILE) == -1)
328 errExit("asprintf");
217 EUID_ROOT(); 329 EUID_ROOT();
218 char *comm = pid_proc_comm(pid); 330 int fd = open(fname, O_RDONLY|O_CLOEXEC);
219 EUID_USER(); 331 EUID_USER();
220 if (comm) { 332 free(fname);
221 if (strcmp(comm, "firejail") == 0) { 333 if (fd == -1)
222 pid_t child; 334 return false;
223 if (find_child(pid, &child) == 0) { 335 struct stat s;
224 pid = child; 336 if (fstat(fd, &s) == -1)
225 if (!arg_quiet) 337 errExit("fstat");
226 printf("Switching to pid %u, the first child process inside the sandbox\n", (unsigned) pid); 338 if (!S_ISREG(s.st_mode) || s.st_uid != 0 || s.st_size != 1) {
227 } 339 close(fd);
228 } 340 return false;
229 free(comm); 341 }
342 char status;
343 if (read(fd, &status, 1) == 1 && status == SANDBOX_DONE) {
344 close(fd);
345 return true;
230 } 346 }
347 close(fd);
348 return false;
349}
231 350
351#define SNOOZE 10000 // sleep interval in microseconds
352void check_join_permission(pid_t pid) {
353 // check if pid belongs to a fully set up firejail sandbox
354 unsigned long i;
355 for (i = SNOOZE; is_ready_for_join(pid) == false; i += SNOOZE) { // give sandbox some time to start up
356 if (i > join_timeout) {
357 fprintf(stderr, "Error: no valid sandbox\n");
358 exit(1);
359 }
360 usleep(SNOOZE);
361 }
232 // check privileges for non-root users 362 // check privileges for non-root users
233 uid_t uid = getuid(); 363 uid_t uid = getuid();
234 if (uid != 0) { 364 if (uid != 0) {
@@ -238,17 +368,65 @@ void join(pid_t pid, int argc, char **argv, int index) {
238 exit(1); 368 exit(1);
239 } 369 }
240 } 370 }
371}
372
373pid_t switch_to_child(pid_t pid) {
374 EUID_ASSERT();
375 EUID_ROOT();
376 pid_t rv = pid;
377 errno = 0;
378 char *comm = pid_proc_comm(pid);
379 if (!comm) {
380 if (errno == ENOENT)
381 fprintf(stderr, "Error: cannot find process with pid %d\n", pid);
382 else
383 fprintf(stderr, "Error: cannot read /proc file\n");
384 exit(1);
385 }
386 EUID_USER();
387
388 if (strcmp(comm, "firejail") == 0) {
389 if (find_child(pid, &rv) == 1) {
390 fprintf(stderr, "Error: no valid sandbox\n");
391 exit(1);
392 }
393 fmessage("Switching to pid %u, the first child process inside the sandbox\n", (unsigned) rv);
394 }
395 free(comm);
396 return rv;
397}
398
399
400
401void join(pid_t pid, int argc, char **argv, int index) {
402 EUID_ASSERT();
403
404 pid_t parent = pid;
405 // in case the pid is that of a firejail process, use the pid of the first child process
406 pid = switch_to_child(pid);
407
408 // exit if no permission to join the sandbox
409 check_join_permission(pid);
241 410
242 extract_x11_display(parent); 411 extract_x11_display(parent);
243 412
413 int shfd = -1;
414 if (!arg_shell_none)
415 shfd = open_shell();
416
244 EUID_ROOT(); 417 EUID_ROOT();
245 // in user mode set caps seccomp, cpu, cgroup, etc 418 // in user mode set caps seccomp, cpu, cgroup, etc
246 if (getuid() != 0) { 419 if (getuid() != 0) {
247 extract_caps_seccomp(pid); 420 extract_nonewprivs(pid); // redundant on Linux >= 4.10; duplicated in function extract_caps
421 extract_caps(pid);
248 extract_cpu(pid); 422 extract_cpu(pid);
249 extract_cgroup(pid); 423 extract_cgroup(pid);
250 extract_nogroups(pid); 424 extract_nogroups(pid);
251 extract_user_namespace(pid); 425 extract_user_namespace(pid);
426 extract_umask(pid);
427#ifdef HAVE_APPARMOR
428 extract_apparmor(pid);
429#endif
252 } 430 }
253 431
254 // set cgroup 432 // set cgroup
@@ -279,7 +457,7 @@ void join(pid_t pid, int argc, char **argv, int index) {
279 if (child == 0) { 457 if (child == 0) {
280 // drop discretionary access control capabilities for root sandboxes 458 // drop discretionary access control capabilities for root sandboxes
281 caps_drop_dac_override(); 459 caps_drop_dac_override();
282 460
283 // chroot into /proc/PID/root directory 461 // chroot into /proc/PID/root directory
284 char *rootdir; 462 char *rootdir;
285 if (asprintf(&rootdir, "/proc/%d/root", pid) == -1) 463 if (asprintf(&rootdir, "/proc/%d/root", pid) == -1)
@@ -292,37 +470,24 @@ void join(pid_t pid, int argc, char **argv, int index) {
292 printf("changing root to %s\n", rootdir); 470 printf("changing root to %s\n", rootdir);
293 } 471 }
294 472
295 prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); // kill the child in case the parent died 473 EUID_USER();
296 if (chdir("/") < 0) 474 if (chdir("/") < 0)
297 errExit("chdir"); 475 errExit("chdir");
298 if (homedir) { 476 if (cfg.homedir) {
299 struct stat s; 477 struct stat s;
300 if (stat(homedir, &s) == 0) { 478 if (stat(cfg.homedir, &s) == 0) {
301 /* coverity[toctou] */ 479 /* coverity[toctou] */
302 if (chdir(homedir) < 0) 480 if (chdir(cfg.homedir) < 0)
303 errExit("chdir"); 481 errExit("chdir");
304 } 482 }
305 } 483 }
306 484
307 // set cpu affinity
308 if (cfg.cpus) // not available for uid 0
309 set_cpu_affinity();
310
311 // set caps filter 485 // set caps filter
486 EUID_ROOT();
312 if (apply_caps == 1) // not available for uid 0 487 if (apply_caps == 1) // not available for uid 0
313 caps_set(caps); 488 caps_set(caps);
314#ifdef HAVE_SECCOMP
315 // read cfg.protocol from file
316 if (getuid() != 0) 489 if (getuid() != 0)
317 protocol_filter_load(RUN_PROTOCOL_CFG); 490 seccomp_load_file_list();
318 if (cfg.protocol) { // not available for uid 0
319 seccomp_load(RUN_SECCOMP_PROTOCOL); // install filter
320 }
321
322 // set seccomp filter
323 if (apply_seccomp == 1) // not available for uid 0
324 seccomp_load(RUN_SECCOMP_CFG);
325#endif
326 491
327 // mount user namespace or drop privileges 492 // mount user namespace or drop privileges
328 if (arg_noroot) { // not available for uid 0 493 if (arg_noroot) { // not available for uid 0
@@ -336,37 +501,15 @@ void join(pid_t pid, int argc, char **argv, int index) {
336 if (apply_caps == 1) // not available for uid 0 501 if (apply_caps == 1) // not available for uid 0
337 caps_set(caps); 502 caps_set(caps);
338 } 503 }
339 else
340 drop_privs(arg_nogroups); // nogroups not available for uid 0
341
342 504
343 // set nice 505 // set nonewprivs
344 if (arg_nice) { 506 if (arg_nonewprivs == 1) { // not available for uid 0
345 errno = 0; 507 int rv = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
346 int rv = nice(cfg.nice); 508 if (arg_debug && rv == 0)
347 (void) rv; 509 printf("NO_NEW_PRIVS set\n");
348 if (errno) {
349 fwarning("cannot set nice value\n");
350 errno = 0;
351 }
352 }
353
354 // set environment, add x11 display
355 env_defaults();
356 if (display) {
357 char *display_str;
358 if (asprintf(&display_str, ":%d", display) == -1)
359 errExit("asprintf");
360 setenv("DISPLAY", display_str, 1);
361 free(display_str);
362 }
363
364 if (cfg.command_line == NULL) {
365 assert(cfg.shell);
366 cfg.command_line = cfg.shell;
367 cfg.window_title = cfg.shell;
368 } 510 }
369 511
512 EUID_USER();
370 int cwd = 0; 513 int cwd = 0;
371 if (cfg.cwd) { 514 if (cfg.cwd) {
372 if (chdir(cfg.cwd) == 0) 515 if (chdir(cfg.cwd) == 0)
@@ -386,13 +529,84 @@ void join(pid_t pid, int argc, char **argv, int index) {
386 } 529 }
387 } 530 }
388 531
389 start_application(0); 532 // drop privileges
533 drop_privs(arg_nogroups);
534
535 // kill the child in case the parent died
536 prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
390 537
391 // it will never get here!!! 538#ifdef HAVE_APPARMOR
539 set_apparmor();
540#endif
541
542 extract_command(argc, argv, index);
543 if (cfg.command_line == NULL) {
544 assert(cfg.shell);
545 cfg.window_title = cfg.shell;
546 }
547 else if (arg_debug)
548 printf("Extracted command #%s#\n", cfg.command_line);
549
550 // set cpu affinity
551 if (cfg.cpus) // not available for uid 0
552 set_cpu_affinity();
553
554 // add x11 display
555 if (display) {
556 char *display_str;
557 if (asprintf(&display_str, ":%d", display) == -1)
558 errExit("asprintf");
559 env_store_name_val("DISPLAY", display_str, SETENV);
560 free(display_str);
561 }
562
563#ifdef HAVE_DBUSPROXY
564 // set D-Bus environment variables
565 struct stat s;
566 if (stat(RUN_DBUS_USER_SOCKET, &s) == 0)
567 dbus_set_session_bus_env();
568 if (stat(RUN_DBUS_SYSTEM_SOCKET, &s) == 0)
569 dbus_set_system_bus_env();
570#endif
571
572 // set nice and rlimits
573 if (arg_nice)
574 set_nice(cfg.nice);
575 set_rlimits();
576
577 start_application(0, shfd, NULL);
578
579 __builtin_unreachable();
392 } 580 }
581 EUID_USER();
582 if (shfd != -1)
583 close(shfd);
584
585 int status = 0;
586 //*****************************
587 // following code is signal-safe
588
589 install_handler();
393 590
394 // wait for the child to finish 591 // wait for the child to finish
395 waitpid(child, NULL, 0); 592 waitpid(child, &status, 0);
593
594 // restore default signal action
595 signal(SIGTERM, SIG_DFL);
596
597 // end of signal-safe code
598 //*****************************
599
600 if (WIFEXITED(status)) {
601 // if we had a proper exit, return that exit status
602 status = WEXITSTATUS(status);
603 } else if (WIFSIGNALED(status)) {
604 // distinguish fatal signals by adding 128
605 status = 128 + WTERMSIG(status);
606 } else {
607 status = -1;
608 }
609
396 flush_stdin(); 610 flush_stdin();
397 exit(0); 611 exit(status);
398} 612}
diff --git a/src/firejail/ls.c b/src/firejail/ls.c
index 7b994b835..70985ba9e 100644
--- a/src/firejail/ls.c
+++ b/src/firejail/ls.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,6 +19,7 @@
19*/ 19*/
20 20
21#include "firejail.h" 21#include "firejail.h"
22#include "../include/gcov_wrapper.h"
22#include <sys/types.h> 23#include <sys/types.h>
23#include <sys/stat.h> 24#include <sys/stat.h>
24#include <sys/wait.h> 25#include <sys/wait.h>
@@ -26,6 +27,7 @@
26#include <dirent.h> 27#include <dirent.h>
27#include <pwd.h> 28#include <pwd.h>
28#include <grp.h> 29#include <grp.h>
30#include <fcntl.h>
29//#include <dirent.h> 31//#include <dirent.h>
30//#include <stdio.h> 32//#include <stdio.h>
31//#include <stdlib.h> 33//#include <stdlib.h>
@@ -34,18 +36,12 @@
34static uid_t c_uid = 0; 36static uid_t c_uid = 0;
35static char *c_uid_name = NULL; 37static char *c_uid_name = NULL;
36 38
37static void print_file_or_dir(const char *path, const char *fname, int separator) { 39static void print_file_or_dir(const char *path, const char *fname) {
38 assert(fname); 40 assert(fname);
39 41
40 char *name; 42 char *name;
41 if (separator) { 43 if (asprintf(&name, "%s/%s", path, fname) == -1)
42 if (asprintf(&name, "%s/%s", path, fname) == -1) 44 errExit("asprintf");
43 errExit("asprintf");
44 }
45 else {
46 if (asprintf(&name, "%s%s", path, fname) == -1)
47 errExit("asprintf");
48 }
49 45
50 struct stat s; 46 struct stat s;
51 if (stat(name, &s) == -1) { 47 if (stat(name, &s) == -1) {
@@ -54,6 +50,7 @@ static void print_file_or_dir(const char *path, const char *fname, int separator
54 return; 50 return;
55 } 51 }
56 } 52 }
53 free(name);
57 54
58 // permissions 55 // permissions
59 if (S_ISLNK(s.st_mode)) 56 if (S_ISLNK(s.st_mode))
@@ -177,14 +174,83 @@ static void print_directory(const char *path) {
177 if (n < 0) 174 if (n < 0)
178 errExit("scandir"); 175 errExit("scandir");
179 else { 176 else {
180 for (i = 0; i < n; i++) { 177 for (i = 0; i < n; i++)
181 print_file_or_dir(path, namelist[i]->d_name, 0); 178 print_file_or_dir(path, namelist[i]->d_name);
179 // get rid of false psitive reported by GCC -fanalyze
180 for (i = 0; i < n; i++)
182 free(namelist[i]); 181 free(namelist[i]);
183 }
184 } 182 }
185 free(namelist); 183 free(namelist);
186} 184}
187 185
186void ls(const char *path) {
187 EUID_ASSERT();
188 assert(path);
189
190 char *rp = realpath(path, NULL);
191 if (!rp || access(rp, R_OK) == -1) {
192 fprintf(stderr, "Error: cannot access %s\n", path);
193 exit(1);
194 }
195 if (arg_debug)
196 printf("ls %s\n", rp);
197
198 // list directory contents
199 struct stat s;
200 if (stat(rp, &s) == -1) {
201 fprintf(stderr, "Error: cannot access %s\n", rp);
202 exit(1);
203 }
204 if (S_ISDIR(s.st_mode))
205 print_directory(rp);
206 else {
207 char *split = strrchr(rp, '/');
208 if (split) {
209 *split = '\0';
210 char *rp2 = split + 1;
211 if (arg_debug)
212 printf("path %s, file %s\n", rp, rp2);
213 print_file_or_dir(rp, rp2);
214 }
215 }
216 free(rp);
217}
218
219void cat(const char *path) {
220 EUID_ASSERT();
221 assert(path);
222
223 if (arg_debug)
224 printf("cat %s\n", path);
225 FILE *fp = fopen(path, "re");
226 if (!fp) {
227 fprintf(stderr, "Error: cannot read %s\n", path);
228 exit(1);
229 }
230 int fd = fileno(fp);
231 if (fd == -1)
232 errExit("fileno");
233 struct stat s;
234 if (fstat(fd, &s) == -1)
235 errExit("fstat");
236 if (!S_ISREG(s.st_mode)) {
237 fprintf(stderr, "Error: %s is not a regular file\n", path);
238 exit(1);
239 }
240 bool tty = isatty(STDOUT_FILENO);
241
242 int c;
243 while ((c = fgetc(fp)) != EOF) {
244 // file is untrusted
245 // replace control characters when printing to a terminal
246 if (tty && c != '\t' && c != '\n' && iscntrl((unsigned char) c))
247 c = '?';
248 fputc(c, stdout);
249 }
250 fflush(stdout);
251 fclose(fp);
252}
253
188char *expand_path(const char *path) { 254char *expand_path(const char *path) {
189 char *fname = NULL; 255 char *fname = NULL;
190 if (*path == '/') { 256 if (*path == '/') {
@@ -198,6 +264,10 @@ char *expand_path(const char *path) {
198 } 264 }
199 else { 265 else {
200 // assume the file is in current working directory 266 // assume the file is in current working directory
267 if (!cfg.cwd) {
268 fprintf(stderr, "Error: current working directory has been deleted\n");
269 exit(1);
270 }
201 if (asprintf(&fname, "%s/%s", cfg.cwd, path) == -1) 271 if (asprintf(&fname, "%s/%s", cfg.cwd, path) == -1)
202 errExit("asprintf"); 272 errExit("asprintf");
203 } 273 }
@@ -206,40 +276,58 @@ char *expand_path(const char *path) {
206 276
207void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) { 277void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
208 EUID_ASSERT(); 278 EUID_ASSERT();
279 assert(path1);
209 280
210 // if the pid is that of a firejail process, use the pid of the first child process 281 // in case the pid is that of a firejail process, use the pid of the first child process
211 EUID_ROOT(); 282 pid = switch_to_child(pid);
212 char *comm = pid_proc_comm(pid);
213 EUID_USER();
214 if (comm) {
215 if (strcmp(comm, "firejail") == 0) {
216 pid_t child;
217 if (find_child(pid, &child) == 0) {
218 pid = child;
219 }
220 }
221 free(comm);
222 }
223 283
224 // check privileges for non-root users 284 // exit if no permission to join the sandbox
225 uid_t uid = getuid(); 285 check_join_permission(pid);
226 if (uid != 0) {
227 uid_t sandbox_uid = pid_get_uid(pid);
228 if (uid != sandbox_uid) {
229 fprintf(stderr, "Error: permission denied.\n");
230 exit(1);
231 }
232 }
233 286
234 // expand paths 287 // expand paths
235 char *fname1 = expand_path(path1);; 288 char *fname1 = expand_path(path1);
236 char *fname2 = NULL; 289 char *fname2 = NULL;
237 if (path2 != NULL) { 290 if (path2 != NULL) {
238 fname2 = expand_path(path2); 291 fname2 = expand_path(path2);
239 } 292 }
240 if (arg_debug) { 293 if (arg_debug) {
241 printf("file1 %s\n", fname1); 294 printf("file1 %s\n", fname1);
242 printf("file2 %s\n", fname2); 295 printf("file2 %s\n", fname2 ? fname2 : "(null)");
296 }
297
298 // get file from sandbox and store it in the current directory
299 // implemented using --cat
300 if (op == SANDBOX_FS_GET) {
301 char *dest_fname = strrchr(fname1, '/');
302 if (!dest_fname || *(++dest_fname) == '\0') {
303 fprintf(stderr, "Error: invalid file name %s\n", fname1);
304 exit(1);
305 }
306 // create destination file if necessary
307 EUID_ASSERT();
308 int fd = open(dest_fname, O_WRONLY|O_CREAT|O_CLOEXEC, S_IRUSR | S_IWRITE);
309 if (fd == -1) {
310 fprintf(stderr, "Error: cannot open %s for writing\n", dest_fname);
311 exit(1);
312 }
313 struct stat s;
314 if (fstat(fd, &s) == -1)
315 errExit("fstat");
316 if (!S_ISREG(s.st_mode)) {
317 fprintf(stderr, "Error: %s is no regular file\n", dest_fname);
318 exit(1);
319 }
320 if (ftruncate(fd, 0) == -1)
321 errExit("ftruncate");
322 // go quiet - messages on stdout will corrupt the file
323 arg_debug = 0;
324 arg_quiet = 1;
325 // redirection
326 if (dup2(fd, STDOUT_FILENO) == -1)
327 errExit("dup2");
328 assert(fd != STDOUT_FILENO);
329 close(fd);
330 op = SANDBOX_FS_CAT;
243 } 331 }
244 332
245 // sandbox root directory 333 // sandbox root directory
@@ -247,7 +335,7 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
247 if (asprintf(&rootdir, "/proc/%d/root", pid) == -1) 335 if (asprintf(&rootdir, "/proc/%d/root", pid) == -1)
248 errExit("asprintf"); 336 errExit("asprintf");
249 337
250 if (op == SANDBOX_FS_LS) { 338 if (op == SANDBOX_FS_LS || op == SANDBOX_FS_CAT) {
251 EUID_ROOT(); 339 EUID_ROOT();
252 // chroot 340 // chroot
253 if (chroot(rootdir) < 0) 341 if (chroot(rootdir) < 0)
@@ -258,130 +346,12 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
258 // drop privileges 346 // drop privileges
259 drop_privs(0); 347 drop_privs(0);
260 348
261 // check access 349 if (op == SANDBOX_FS_LS)
262 if (access(fname1, R_OK) == -1) { 350 ls(fname1);
263 fprintf(stderr, "Error: Cannot access %s\n", fname1); 351 else
264 exit(1); 352 cat(fname1);
265 }
266 /* coverity[toctou] */
267 char *rp = realpath(fname1, NULL);
268 if (!rp) {
269 fprintf(stderr, "Error: Cannot access %s\n", fname1);
270 exit(1);
271 }
272 if (arg_debug)
273 printf("realpath %s\n", rp);
274
275 353
276 // list directory contents 354 __gcov_flush();
277 struct stat s;
278 if (stat(rp, &s) == -1) {
279 fprintf(stderr, "Error: Cannot access %s\n", rp);
280 exit(1);
281 }
282 if (S_ISDIR(s.st_mode)) {
283 char *dir;
284 if (asprintf(&dir, "%s/", rp) == -1)
285 errExit("asprintf");
286
287 print_directory(dir);
288 free(dir);
289 }
290 else {
291 char *split = strrchr(rp, '/');
292 if (split) {
293 *split = '\0';
294 char *rp2 = split + 1;
295 if (arg_debug)
296 printf("path %s, file %s\n", rp, rp2);
297 print_file_or_dir(rp, rp2, 1);
298 }
299 }
300 free(rp);
301 }
302
303 // get file from sandbox and store it in the current directory
304 else if (op == SANDBOX_FS_GET) {
305 char *src_fname =fname1;
306 char *dest_fname = strrchr(fname1, '/');
307 if (!dest_fname || *(++dest_fname) == '\0') {
308 fprintf(stderr, "Error: invalid file name %s\n", fname1);
309 exit(1);
310 }
311
312 EUID_ROOT();
313 if (arg_debug)
314 printf("copy %s to %s\n", src_fname, dest_fname);
315
316 // create a user-owned temporary file in /run/firejail directory
317 char tmp_fname[] = "/run/firejail/tmpget-XXXXXX";
318 int fd = mkstemp(tmp_fname);
319 if (fd != -1) {
320 SET_PERMS_FD(fd, getuid(), getgid(), 0600);
321 close(fd);
322 }
323
324 // copy the source file into the temporary file - we need to chroot
325 pid_t child = fork();
326 if (child < 0)
327 errExit("fork");
328 if (child == 0) {
329 // chroot
330 if (chroot(rootdir) < 0)
331 errExit("chroot");
332 if (chdir("/") < 0)
333 errExit("chdir");
334
335 // drop privileges
336 drop_privs(0);
337
338 // copy the file
339 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600)) // already a regular user
340 _exit(1);
341#ifdef HAVE_GCOV
342 __gcov_flush();
343#endif
344 _exit(0);
345 }
346
347 // wait for the child to finish
348 int status = 0;
349 waitpid(child, &status, 0);
350 if (WIFEXITED(status) && WEXITSTATUS(status) == 0);
351 else {
352 unlink(tmp_fname);
353 exit(1);
354 }
355
356 // copy the temporary file into the destionation file
357 child = fork();
358 if (child < 0)
359 errExit("fork");
360 if (child == 0) {
361 // drop privileges
362 drop_privs(0);
363
364 // copy the file
365 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600)) // already a regular user
366 _exit(1);
367#ifdef HAVE_GCOV
368 __gcov_flush();
369#endif
370 _exit(0);
371 }
372
373 // wait for the child to finish
374 status = 0;
375 waitpid(child, &status, 0);
376 if (WIFEXITED(status) && WEXITSTATUS(status) == 0);
377 else {
378 unlink(tmp_fname);
379 exit(1);
380 }
381
382 // remove the temporary file
383 unlink(tmp_fname);
384 EUID_USER();
385 } 355 }
386 // get file from host and store it in the sandbox 356 // get file from host and store it in the sandbox
387 else if (op == SANDBOX_FS_PUT && path2) { 357 else if (op == SANDBOX_FS_PUT && path2) {
@@ -413,9 +383,9 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
413 // copy the file 383 // copy the file
414 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600)) // already a regular user 384 if (copy_file(src_fname, tmp_fname, getuid(), getgid(), 0600)) // already a regular user
415 _exit(1); 385 _exit(1);
416#ifdef HAVE_GCOV 386
417 __gcov_flush(); 387 __gcov_flush();
418#endif 388
419 _exit(0); 389 _exit(0);
420 } 390 }
421 391
@@ -428,7 +398,7 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
428 exit(1); 398 exit(1);
429 } 399 }
430 400
431 // copy the temporary file into the destionation file 401 // copy the temporary file into the destination file
432 child = fork(); 402 child = fork();
433 if (child < 0) 403 if (child < 0)
434 errExit("fork"); 404 errExit("fork");
@@ -445,9 +415,9 @@ void sandboxfs(int op, pid_t pid, const char *path1, const char *path2) {
445 // copy the file 415 // copy the file
446 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600)) // already a regular user 416 if (copy_file(tmp_fname, dest_fname, getuid(), getgid(), 0600)) // already a regular user
447 _exit(1); 417 _exit(1);
448#ifdef HAVE_GCOV 418
449 __gcov_flush(); 419 __gcov_flush();
450#endif 420
451 _exit(0); 421 _exit(0);
452 } 422 }
453 423
diff --git a/src/firejail/macros.c b/src/firejail/macros.c
new file mode 100644
index 000000000..cd29d8f85
--- /dev/null
+++ b/src/firejail/macros.c
@@ -0,0 +1,325 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20#include "firejail.h"
21#include <sys/stat.h>
22#define MAXBUF 4098
23
24typedef struct macro_t {
25 char *name; // macro name
26 char *xdg; // xdg line in ~/.config/user-dirs.dirs
27#define MAX_TRANSLATIONS 3 // several translations in case ~/.config/user-dirs.dirs not found
28 char *translation[MAX_TRANSLATIONS];
29} Macro;
30
31Macro macro[] = {
32 {
33 "${DOWNLOADS}",
34 "XDG_DOWNLOAD_DIR=\"$HOME/",
35 { "Downloads", "Загрузки", "Téléchargement" }
36 },
37
38 {
39 "${MUSIC}",
40 "XDG_MUSIC_DIR=\"$HOME/",
41 {"Music", "Музыка", "Musique"}
42 },
43
44 {
45 "${VIDEOS}",
46 "XDG_VIDEOS_DIR=\"$HOME/",
47 {"Videos", "Видео", "Vidéos"}
48 },
49
50 {
51 "${PICTURES}",
52 "XDG_PICTURES_DIR=\"$HOME/",
53 {"Pictures", "Изображения", "Photos"}
54 },
55
56 {
57 "${DESKTOP}",
58 "XDG_DESKTOP_DIR=\"$HOME/",
59 {"Desktop", "Рабочий стол", "Bureau"}
60 },
61
62 {
63 "${DOCUMENTS}",
64 "XDG_DOCUMENTS_DIR=\"$HOME/",
65 {"Documents", "Документы", "Documents"}
66 },
67
68 { 0 }
69};
70
71// return -1 if not found
72int macro_id(const char *name) {
73 int i = 0;
74 while (macro[i].name != NULL) {
75 if (strcmp(name, macro[i].name) == 0)
76 return i;
77 i++;
78 }
79
80 return -1;
81}
82
83int is_macro(const char *name) {
84 assert(name);
85 int len = strlen(name);
86 if (len <= 4)
87 return 0;
88 if (*name == '$' && name[1] == '{' && name[len - 1] == '}')
89 return 1;
90 return 0;
91}
92
93// returns mallocated memory
94static char *resolve_xdg(const char *var) {
95 EUID_ASSERT();
96 char *fname;
97 struct stat s;
98 size_t length = strlen(var);
99
100 if (asprintf(&fname, "%s/.config/user-dirs.dirs", cfg.homedir) == -1)
101 errExit("asprintf");
102 FILE *fp = fopen(fname, "re");
103 if (!fp) {
104 free(fname);
105 return NULL;
106 }
107 free(fname);
108
109 char buf[MAXBUF];
110 while (fgets(buf, MAXBUF, fp)) {
111 char *ptr = buf;
112
113 // skip blanks
114 while (*ptr == ' ' || *ptr == '\t')
115 ptr++;
116 if (*ptr == '\0' || *ptr == '\n' || *ptr == '#')
117 continue;
118
119 if (strncmp(ptr, var, length) == 0) {
120 char *ptr1 = ptr + length;
121 char *ptr2 = strchr(ptr1, '"');
122 if (ptr2) {
123 fclose(fp);
124 *ptr2 = '\0';
125 if (strlen(ptr1) != 0) {
126 if (asprintf(&fname, "%s/%s", cfg.homedir, ptr1) == -1)
127 errExit("asprintf");
128
129 if (stat(fname, &s) == -1) {
130 free(fname);
131 return NULL;
132 }
133 free(fname);
134
135 char *rv = strdup(ptr1);
136 if (!rv)
137 errExit(ptr1);
138 return rv;
139 }
140 else
141 return NULL;
142 }
143 }
144 }
145
146 fclose(fp);
147 return NULL;
148}
149
150// returns mallocated memory
151static char *resolve_hardcoded(char *entries[]) {
152 EUID_ASSERT();
153 char *fname;
154 struct stat s;
155
156 int i = 0;
157 while (entries[i] != NULL) {
158 if (asprintf(&fname, "%s/%s", cfg.homedir, entries[i]) == -1)
159 errExit("asprintf");
160
161 if (stat(fname, &s) == 0) {
162 free(fname);
163 char *rv = strdup(entries[i]);
164 if (!rv)
165 errExit("strdup");
166 return rv;
167 }
168 free(fname);
169 i++;
170 }
171
172 return NULL;
173}
174
175// returns mallocated memory
176char *resolve_macro(const char *name) {
177 char *rv = NULL;
178 int id = macro_id(name);
179 if (id == -1)
180 return NULL;
181
182 rv = resolve_xdg(macro[id].xdg);
183 if (rv == NULL)
184 rv = resolve_hardcoded(macro[id].translation);
185 if (rv && arg_debug)
186 printf("Directory %s resolved as %s\n", name, rv);
187
188 return rv;
189}
190
191// This function takes a pathname supplied by the user and expands '~' and
192// '${HOME}' at the start, to refer to a path relative to the user's home
193// directory (supplied).
194// The return value is allocated using malloc and must be freed by the caller.
195// The function returns NULL if there are any errors.
196char *expand_macros(const char *path) {
197 assert(path);
198
199 int called_as_root = 0;
200
201 if(geteuid() == 0)
202 called_as_root = 1;
203
204 if(called_as_root) {
205 EUID_USER();
206 }
207
208 EUID_ASSERT();
209
210 // Replace home macro
211 char *new_name = NULL;
212 if (strncmp(path, "$HOME", 5) == 0) {
213 fprintf(stderr, "Error: $HOME is not allowed in profile files, please replace it with ${HOME}\n");
214 exit(1);
215 }
216 else if (strncmp(path, "${HOME}", 7) == 0) {
217 if (asprintf(&new_name, "%s%s", cfg.homedir, path + 7) == -1)
218 errExit("asprintf");
219 if(called_as_root)
220 EUID_ROOT();
221 return new_name;
222 }
223 else if (*path == '~') {
224 if (asprintf(&new_name, "%s%s", cfg.homedir, path + 1) == -1)
225 errExit("asprintf");
226 if(called_as_root)
227 EUID_ROOT();
228 return new_name;
229 }
230 else if (strncmp(path, "${CFG}", 6) == 0) {
231 if (asprintf(&new_name, "%s%s", SYSCONFDIR, path + 6) == -1)
232 errExit("asprintf");
233 if(called_as_root)
234 EUID_ROOT();
235 return new_name;
236 }
237 else if (strncmp(path, "${RUNUSER}", 10) == 0) {
238 if (asprintf(&new_name, "/run/user/%u%s", getuid(), path + 10) == -1)
239 errExit("asprintf");
240 if(called_as_root)
241 EUID_ROOT();
242 return new_name;
243 }
244 else {
245 char *directory = resolve_macro(path);
246 if (directory) {
247 if (asprintf(&new_name, "%s/%s", cfg.homedir, directory) == -1)
248 errExit("asprintf");
249 if(called_as_root)
250 EUID_ROOT();
251 free(directory);
252 return new_name;
253 }
254 }
255
256 char *rv = strdup(path);
257 if (!rv)
258 errExit("strdup");
259
260 if(called_as_root)
261 EUID_ROOT();
262
263 return rv;
264}
265
266// replace control characters with a '?'
267static char *fix_control_chars(const char *fname) {
268 assert(fname);
269
270 size_t len = strlen(fname);
271 char *rv = malloc(len + 1);
272 if (!rv)
273 errExit("malloc");
274
275 size_t i = 0;
276 while (fname[i] != '\0') {
277 if (iscntrl((unsigned char) fname[i]))
278 rv[i] = '?';
279 else
280 rv[i] = fname[i];
281 i++;
282 }
283 rv[i] = '\0';
284
285 return rv;
286}
287
288void invalid_filename(const char *fname, int globbing) {
289// EUID_ASSERT();
290 assert(fname);
291 const char *ptr = fname;
292
293 if (strncmp(ptr, "${HOME}", 7) == 0)
294 ptr = fname + 7;
295 else if (strncmp(ptr, "${PATH}", 7) == 0)
296 ptr = fname + 7;
297 else if (strncmp(ptr, "${RUNUSER}", 10) == 0)
298 ptr = fname + 10;
299 else {
300 int id = macro_id(fname);
301 if (id != -1)
302 return;
303 }
304
305 size_t i = 0;
306 while (ptr[i] != '\0') {
307 if (iscntrl((unsigned char) ptr[i])) {
308 char *new = fix_control_chars(fname);
309 fprintf(stderr, "Error: \"%s\" is an invalid filename: no control characters allowed\n", new);
310 exit(1);
311 }
312 i++;
313 }
314
315 char *reject;
316 if (globbing)
317 reject = "\\&!\"'<>%^{};,"; // file globbing ('*?[]') is allowed
318 else
319 reject = "\\&!?\"'<>%^{};,*[]";
320 char *c = strpbrk(ptr, reject);
321 if (c) {
322 fprintf(stderr, "Error: \"%s\" is an invalid filename: rejected character: \"%c\"\n", fname, *c);
323 exit(1);
324 }
325}
diff --git a/src/firejail/main.c b/src/firejail/main.c
index e83bc899f..81d148257 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,17 +19,20 @@
19 */ 19 */
20#include "firejail.h" 20#include "firejail.h"
21#include "../include/pid.h" 21#include "../include/pid.h"
22#include "../include/firejail_user.h"
23#include "../include/gcov_wrapper.h"
24#include "../include/syscall.h"
25#include "../include/seccomp.h"
22#define _GNU_SOURCE 26#define _GNU_SOURCE
23#include <sys/utsname.h> 27#include <sys/utsname.h>
24#include <sched.h> 28#include <sched.h>
25#include <sys/mount.h> 29#include <sys/mount.h>
26#include <sys/wait.h> 30#include <sys/wait.h>
27#include <sys/stat.h> 31#include <sys/stat.h>
28#include <fcntl.h>
29#include <dirent.h> 32#include <dirent.h>
30#include <pwd.h> 33#include <pwd.h>
31#include <errno.h> 34#include <errno.h>
32#include <limits.h> 35//#include <limits.h>
33#include <sys/file.h> 36#include <sys/file.h>
34#include <sys/prctl.h> 37#include <sys/prctl.h>
35#include <signal.h> 38#include <signal.h>
@@ -37,18 +40,34 @@
37#include <net/if.h> 40#include <net/if.h>
38#include <sys/utsname.h> 41#include <sys/utsname.h>
39 42
43#include <fcntl.h>
44#ifndef O_PATH
45#define O_PATH 010000000
46#endif
47
48#ifdef __ia64__
49/* clone(2) has a different interface on ia64, as it needs to know
50 the size of the stack */
51int __clone2(int (*fn)(void *),
52 void *child_stack_base, size_t stack_size,
53 int flags, void *arg, ...
54 /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ );
55#endif
56
40uid_t firejail_uid = 0; 57uid_t firejail_uid = 0;
41gid_t firejail_gid = 0; 58gid_t firejail_gid = 0;
42 59
43#define STACK_SIZE (1024 * 1024) 60#define STACK_SIZE (1024 * 1024)
44static char child_stack[STACK_SIZE]; // space for child's stack 61#define STACK_ALIGNMENT 16
62static char child_stack[STACK_SIZE] __attribute__((aligned(STACK_ALIGNMENT))); // space for child's stack
63
45Config cfg; // configuration 64Config cfg; // configuration
46int arg_private = 0; // mount private /home and /tmp directoryu 65int arg_private = 0; // mount private /home and /tmp directoryu
47int arg_private_template = 0; // mount private /home using a template 66int arg_private_cache = 0; // mount private home/.cache
48int arg_debug = 0; // print debug messages 67int arg_debug = 0; // print debug messages
49int arg_debug_check_filename = 0; // print debug messages for filename checking
50int arg_debug_blacklists = 0; // print debug messages for blacklists 68int arg_debug_blacklists = 0; // print debug messages for blacklists
51int arg_debug_whitelists = 0; // print debug messages for whitelists 69int arg_debug_whitelists = 0; // print debug messages for whitelists
70int arg_debug_private_lib = 0; // print debug messages for private-lib
52int arg_nonetwork = 0; // --net=none 71int arg_nonetwork = 0; // --net=none
53int arg_command = 0; // -c 72int arg_command = 0; // -c
54int arg_overlay = 0; // overlay option 73int arg_overlay = 0; // overlay option
@@ -56,8 +75,10 @@ int arg_overlay_keep = 0; // place overlay diff in a known directory
56int arg_overlay_reuse = 0; // allow the reuse of overlays 75int arg_overlay_reuse = 0; // allow the reuse of overlays
57 76
58int arg_seccomp = 0; // enable default seccomp filter 77int arg_seccomp = 0; // enable default seccomp filter
78int arg_seccomp32 = 0; // enable default seccomp filter for 32 bit arch
59int arg_seccomp_postexec = 0; // need postexec ld.preload library? 79int arg_seccomp_postexec = 0; // need postexec ld.preload library?
60int arg_seccomp_block_secondary = 0; // block any secondary architectures 80int arg_seccomp_block_secondary = 0; // block any secondary architectures
81int arg_seccomp_error_action = 0;
61 82
62int arg_caps_default_filter = 0; // enable default capabilities filter 83int arg_caps_default_filter = 0; // enable default capabilities filter
63int arg_caps_drop = 0; // drop list 84int arg_caps_drop = 0; // drop list
@@ -66,11 +87,14 @@ int arg_caps_keep = 0; // keep list
66char *arg_caps_list = NULL; // optional caps list 87char *arg_caps_list = NULL; // optional caps list
67 88
68int arg_trace = 0; // syscall tracing support 89int arg_trace = 0; // syscall tracing support
90char *arg_tracefile = NULL; // syscall tracing file
69int arg_tracelog = 0; // blacklist tracing support 91int arg_tracelog = 0; // blacklist tracing support
92int arg_rlimit_cpu = 0; // rlimit max cpu time
70int arg_rlimit_nofile = 0; // rlimit nofile 93int arg_rlimit_nofile = 0; // rlimit nofile
71int arg_rlimit_nproc = 0; // rlimit nproc 94int arg_rlimit_nproc = 0; // rlimit nproc
72int arg_rlimit_fsize = 0; // rlimit fsize 95int arg_rlimit_fsize = 0; // rlimit fsize
73int arg_rlimit_sigpending = 0; // rlimit fsize 96int arg_rlimit_sigpending = 0; // rlimit fsize
97int arg_rlimit_as = 0; // rlimit as
74int arg_nogroups = 0; // disable supplementary groups 98int arg_nogroups = 0; // disable supplementary groups
75int arg_nonewprivs = 0; // set the NO_NEW_PRIVS prctl 99int arg_nonewprivs = 0; // set the NO_NEW_PRIVS prctl
76int arg_noroot = 0; // create a new user namespace and disable root user 100int arg_noroot = 0; // create a new user namespace and disable root user
@@ -82,14 +106,16 @@ char *arg_netns = NULL; // "ip netns"-created network namespace to use
82int arg_doubledash = 0; // double dash 106int arg_doubledash = 0; // double dash
83int arg_shell_none = 0; // run the program directly without a shell 107int arg_shell_none = 0; // run the program directly without a shell
84int arg_private_dev = 0; // private dev directory 108int arg_private_dev = 0; // private dev directory
109int arg_keep_dev_shm = 0; // preserve /dev/shm
85int arg_private_etc = 0; // private etc directory 110int arg_private_etc = 0; // private etc directory
86int arg_private_opt = 0; // private opt directory 111int arg_private_opt = 0; // private opt directory
87int arg_private_srv = 0; // private srv directory 112int arg_private_srv = 0; // private srv directory
88int arg_private_bin = 0; // private bin directory 113int arg_private_bin = 0; // private bin directory
89int arg_private_tmp = 0; // private tmp directory 114int arg_private_tmp = 0; // private tmp directory
90int arg_private_lib = 0; // private lib directory 115int arg_private_lib = 0; // private lib directory
116int arg_private_cwd = 0; // private working directory
91int arg_scan = 0; // arp-scan all interfaces 117int arg_scan = 0; // arp-scan all interfaces
92int arg_whitelist = 0; // whitelist commad 118int arg_whitelist = 0; // whitelist command
93int arg_nosound = 0; // disable sound 119int arg_nosound = 0; // disable sound
94int arg_novideo = 0; //disable video devices in /dev 120int arg_novideo = 0; //disable video devices in /dev
95int arg_no3d; // disable 3d hardware acceleration 121int arg_no3d; // disable 3d hardware acceleration
@@ -99,16 +125,16 @@ int arg_join_filesystem = 0; // join only the mount namespace
99int arg_nice = 0; // nice value configured 125int arg_nice = 0; // nice value configured
100int arg_ipc = 0; // enable ipc namespace 126int arg_ipc = 0; // enable ipc namespace
101int arg_writable_etc = 0; // writable etc 127int arg_writable_etc = 0; // writable etc
128int arg_keep_config_pulse = 0; // disable automatic ~/.config/pulse init
102int arg_writable_var = 0; // writable var 129int arg_writable_var = 0; // writable var
130int arg_keep_var_tmp = 0; // don't overwrite /var/tmp
103int arg_writable_run_user = 0; // writable /run/user 131int arg_writable_run_user = 0; // writable /run/user
104int arg_writable_var_log = 0; // writable /var/log 132int arg_writable_var_log = 0; // writable /var/log
105int arg_appimage = 0; // appimage 133int arg_appimage = 0; // appimage
106int arg_audit = 0; // audit
107char *arg_audit_prog = NULL; // audit
108int arg_apparmor = 0; // apparmor 134int arg_apparmor = 0; // apparmor
109int arg_allow_debuggers = 0; // allow debuggers 135int arg_allow_debuggers = 0; // allow debuggers
110int arg_x11_block = 0; // block X11 136int arg_x11_block = 0; // block X11
111int arg_x11_xorg = 0; // use X11 security extention 137int arg_x11_xorg = 0; // use X11 security extension
112int arg_allusers = 0; // all user home directories visible 138int arg_allusers = 0; // all user home directories visible
113int arg_machineid = 0; // preserve /etc/machine-id 139int arg_machineid = 0; // preserve /etc/machine-id
114int arg_allow_private_blacklist = 0; // blacklist things in private directories 140int arg_allow_private_blacklist = 0; // blacklist things in private directories
@@ -117,9 +143,16 @@ int arg_noprofile = 0; // use default.profile if none other found/specified
117int arg_memory_deny_write_execute = 0; // block writable and executable memory 143int arg_memory_deny_write_execute = 0; // block writable and executable memory
118int arg_notv = 0; // --notv 144int arg_notv = 0; // --notv
119int arg_nodvd = 0; // --nodvd 145int arg_nodvd = 0; // --nodvd
146int arg_nou2f = 0; // --nou2f
147int arg_noinput = 0; // --noinput
148int arg_deterministic_exit_code = 0; // always exit with first child's exit status
149DbusPolicy arg_dbus_user = DBUS_POLICY_ALLOW; // --dbus-user
150DbusPolicy arg_dbus_system = DBUS_POLICY_ALLOW; // --dbus-system
151const char *arg_dbus_log_file = NULL;
152int arg_dbus_log_user = 0;
153int arg_dbus_log_system = 0;
120int login_shell = 0; 154int login_shell = 0;
121 155
122
123int parent_to_child_fds[2]; 156int parent_to_child_fds[2];
124int child_to_parent_fds[2]; 157int child_to_parent_fds[2];
125 158
@@ -127,84 +160,65 @@ char *fullargv[MAX_ARGS]; // expanded argv for restricted shell
127int fullargc = 0; 160int fullargc = 0;
128static pid_t child = 0; 161static pid_t child = 0;
129pid_t sandbox_pid; 162pid_t sandbox_pid;
130unsigned long long start_timestamp; 163mode_t orig_umask = 022;
131
132static void set_name_file(pid_t pid);
133static void delete_name_file(pid_t pid);
134static void delete_profile_file(pid_t pid);
135static void delete_x11_file(pid_t pid);
136
137void clear_run_files(pid_t pid) {
138 bandwidth_del_run_file(pid); // bandwidth file
139 network_del_run_file(pid); // network map file
140 delete_name_file(pid);
141 delete_profile_file(pid);
142 delete_x11_file(pid);
143}
144 164
145static void clear_atexit(void) { 165static void clear_atexit(void) {
146 EUID_ROOT(); 166 EUID_ROOT();
147 clear_run_files(getpid()); 167 delete_run_files(getpid());
148} 168}
149 169
150static void myexit(int rv) { 170static void myexit(int rv) {
151 logmsg("exiting..."); 171 logmsg("exiting...");
152 if (!arg_command && !arg_quiet) 172 if (!arg_command)
153 printf("\nParent is shutting down, bye...\n"); 173 fmessage("\nParent is shutting down, bye...\n");
154 174
155 175
156 // delete sandbox files in shared memory 176 // delete sandbox files in shared memory
177#ifdef HAVE_DBUSPROXY
178 dbus_proxy_stop();
179#endif
157 EUID_ROOT(); 180 EUID_ROOT();
158 clear_run_files(sandbox_pid); 181 delete_run_files(sandbox_pid);
159 appimage_clear(); 182 appimage_clear();
160 flush_stdin(); 183 flush_stdin();
161 exit(rv); 184 exit(rv);
162} 185}
163 186
164static void my_handler(int s){ 187static void my_handler(int s) {
165 EUID_ROOT(); 188 fmessage("\nParent received signal %d, shutting down the child process...\n", s);
166 if (!arg_quiet) {
167 printf("\nParent received signal %d, shutting down the child process...\n", s);
168 fflush(0);
169 }
170 logsignal(s); 189 logsignal(s);
171 kill(child, SIGTERM);
172 myexit(1);
173}
174
175static pid_t extract_pid(const char *name) {
176 EUID_ASSERT();
177 if (!name || strlen(name) == 0) {
178 fprintf(stderr, "Error: invalid sandbox name\n");
179 exit(1);
180 }
181 190
182 pid_t pid; 191 if (waitpid(child, NULL, WNOHANG) == 0) {
183 EUID_ROOT(); 192 // child is pid 1 of a pid namespace:
184 if (name2pid(name, &pid)) { 193 // signals are not delivered if there is no handler yet
185 fprintf(stderr, "Error: cannot find sandbox %s\n", name); 194 if (has_handler(child, s))
186 exit(1); 195 kill(child, s);
196 else
197 kill(child, SIGKILL);
198 waitpid(child, NULL, 0);
187 } 199 }
188 EUID_USER(); 200 myexit(128 + s);
189 return pid;
190} 201}
191 202
192 203static void install_handler(void) {
193static pid_t read_pid(const char *str) { 204 struct sigaction sga;
194 char *endptr; 205
195 errno = 0; 206 // block SIGTERM while handling SIGINT
196 long int pidtmp = strtol(str, &endptr, 10); 207 sigemptyset(&sga.sa_mask);
197 if ((errno == ERANGE && (pidtmp == LONG_MAX || pidtmp == LONG_MIN)) 208 sigaddset(&sga.sa_mask, SIGTERM);
198 || (errno != 0 && pidtmp == 0)) { 209 sga.sa_handler = my_handler;
199 return extract_pid(str); 210 sga.sa_flags = 0;
200 } 211 sigaction(SIGINT, &sga, NULL);
201 // endptr points to '\0' char in str if the entire string is valid 212
202 if (endptr == NULL || endptr[0]!='\0') { 213 // block SIGINT while handling SIGTERM
203 return extract_pid(str); 214 sigemptyset(&sga.sa_mask);
204 } 215 sigaddset(&sga.sa_mask, SIGINT);
205 return (pid_t)pidtmp; 216 sga.sa_handler = my_handler;
217 sga.sa_flags = 0;
218 sigaction(SIGTERM, &sga, NULL);
206} 219}
207 220
221
208// init configuration 222// init configuration
209static void init_cfg(int argc, char **argv) { 223static void init_cfg(int argc, char **argv) {
210 EUID_ASSERT(); 224 EUID_ASSERT();
@@ -227,23 +241,55 @@ static void init_cfg(int argc, char **argv) {
227 if (!cfg.username) 241 if (!cfg.username)
228 errExit("strdup"); 242 errExit("strdup");
229 243
230 // build home directory name 244 // check user database
231 cfg.homedir = NULL; 245 if (!firejail_user_check(cfg.username)) {
232 if (pw->pw_dir != NULL) { 246 fprintf(stderr, "Error: the user is not allowed to use Firejail.\n"
233 cfg.homedir = strdup(pw->pw_dir); 247 "Please add the user in %s/firejail.users file,\n"
234 if (!cfg.homedir) 248 "either by running \"sudo firecfg\", or by editing the file directly.\n"
235 errExit("strdup"); 249 "See \"man firejail-users\" for more details.\n\n", SYSCONFDIR);
250
251 // attempt to run the program as is
252 run_symlink(argc, argv, 1);
253 exit(1);
236 } 254 }
237 else { 255
256 cfg.cwd = getcwd(NULL, 0);
257 if (!cfg.cwd && errno != ENOENT)
258 errExit("getcwd");
259
260 // build home directory name
261 if (pw->pw_dir == NULL) {
238 fprintf(stderr, "Error: user %s doesn't have a user directory assigned\n", cfg.username); 262 fprintf(stderr, "Error: user %s doesn't have a user directory assigned\n", cfg.username);
239 exit(1); 263 exit(1);
240 } 264 }
241 cfg.cwd = getcwd(NULL, 0); 265 check_homedir(pw->pw_dir);
266 cfg.homedir = clean_pathname(pw->pw_dir);
242 267
243 // initialize random number generator 268 // initialize random number generator
244 sandbox_pid = getpid(); 269 sandbox_pid = getpid();
245 time_t t = time(NULL); 270 time_t t = time(NULL);
246 srand(t ^ sandbox_pid); 271 srand(t ^ sandbox_pid);
272
273 arg_seccomp_error_action = EPERM;
274 cfg.seccomp_error_action = "EPERM";
275}
276
277static void fix_single_std_fd(int fd, const char *file, int flags) {
278 struct stat s;
279 if (fstat(fd, &s) == -1 && errno == EBADF) {
280 // something is wrong with fd, probably it is not opened
281 int nfd = open(file, flags);
282 if (nfd != fd || fstat(fd, &s) != 0)
283 _exit(1); // no further attempts to fix the situation
284 }
285}
286
287// glibc does this automatically if Firejail was started by a regular user
288// run this for root user and as a fallback
289static void fix_std_streams(void) {
290 fix_single_std_fd(0, "/dev/full", O_RDONLY|O_NOFOLLOW);
291 fix_single_std_fd(1, "/dev/null", O_WRONLY|O_NOFOLLOW);
292 fix_single_std_fd(2, "/dev/null", O_WRONLY|O_NOFOLLOW);
247} 293}
248 294
249static void check_network(Bridge *br) { 295static void check_network(Bridge *br) {
@@ -253,7 +299,7 @@ static void check_network(Bridge *br) {
253 else if (br->ipsandbox) { // for macvlan check network range 299 else if (br->ipsandbox) { // for macvlan check network range
254 char *rv = in_netrange(br->ipsandbox, br->ip, br->mask); 300 char *rv = in_netrange(br->ipsandbox, br->ip, br->mask);
255 if (rv) { 301 if (rv) {
256 fprintf(stderr, "%s", rv); 302 fprintf(stderr, "%s\n", rv);
257 exit(1); 303 exit(1);
258 } 304 }
259 } 305 }
@@ -314,16 +360,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
314#ifdef HAVE_OVERLAYFS 360#ifdef HAVE_OVERLAYFS
315 else if (strcmp(argv[i], "--overlay-clean") == 0) { 361 else if (strcmp(argv[i], "--overlay-clean") == 0) {
316 if (checkcfg(CFG_OVERLAYFS)) { 362 if (checkcfg(CFG_OVERLAYFS)) {
317 char *path; 363 if (remove_overlay_directory()) {
318 if (asprintf(&path, "%s/.firejail", cfg.homedir) == -1) 364 fprintf(stderr, "Error: cannot remove overlay directory\n");
319 errExit("asprintf"); 365 exit(1);
320 EUID_ROOT(); 366 }
321 if (setreuid(0, 0) < 0 ||
322 setregid(0, 0) < 0)
323 errExit("setreuid/setregid");
324 errno = 0;
325 if (remove_directory(path))
326 errExit("remove_directory");
327 } 367 }
328 else 368 else
329 exit_err_feature("overlayfs"); 369 exit_err_feature("overlayfs");
@@ -419,21 +459,40 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
419 } 459 }
420 460
421 // extract pid or sandbox name 461 // extract pid or sandbox name
422 pid_t pid = read_pid(argv[i] + 12); 462 pid_t pid = require_pid(argv[i] + 12);
423 bandwidth_pid(pid, cmd, dev, down, up); 463 bandwidth_pid(pid, cmd, dev, down, up);
424 } 464 }
425 else 465 else
426 exit_err_feature("networking"); 466 exit_err_feature("networking");
427 exit(0); 467 exit(0);
428 } 468 }
469 else if (strncmp(argv[i], "--netfilter.print=", 18) == 0) {
470 // extract pid or sandbox name
471 pid_t pid = require_pid(argv[i] + 18);
472 netfilter_print(pid, 0);
473 exit(0);
474 }
475 else if (strncmp(argv[i], "--netfilter6.print=", 19) == 0) {
476 // extract pid or sandbox name
477 pid_t pid = require_pid(argv[i] + 19);
478 netfilter_print(pid, 1);
479 exit(0);
480 }
429#endif 481#endif
430 //************************************* 482 //*************************************
431 // independent commands - the program will exit! 483 // independent commands - the program will exit!
432 //************************************* 484 //*************************************
433#ifdef HAVE_SECCOMP
434 else if (strcmp(argv[i], "--debug-syscalls") == 0) { 485 else if (strcmp(argv[i], "--debug-syscalls") == 0) {
435 if (checkcfg(CFG_SECCOMP)) { 486 if (checkcfg(CFG_SECCOMP)) {
436 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP, "debug-syscalls"); 487 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP_MAIN, "debug-syscalls");
488 exit(rv);
489 }
490 else
491 exit_err_feature("seccomp");
492 }
493 else if (strcmp(argv[i], "--debug-syscalls32") == 0) {
494 if (checkcfg(CFG_SECCOMP)) {
495 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP_MAIN, "debug-syscalls32");
437 exit(rv); 496 exit(rv);
438 } 497 }
439 else 498 else
@@ -441,7 +500,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
441 } 500 }
442 else if (strcmp(argv[i], "--debug-errnos") == 0) { 501 else if (strcmp(argv[i], "--debug-errnos") == 0) {
443 if (checkcfg(CFG_SECCOMP)) { 502 if (checkcfg(CFG_SECCOMP)) {
444 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP, "debug-errnos"); 503 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP_MAIN, "debug-errnos");
445 exit(rv); 504 exit(rv);
446 } 505 }
447 else 506 else
@@ -451,7 +510,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
451 else if (strncmp(argv[i], "--seccomp.print=", 16) == 0) { 510 else if (strncmp(argv[i], "--seccomp.print=", 16) == 0) {
452 if (checkcfg(CFG_SECCOMP)) { 511 if (checkcfg(CFG_SECCOMP)) {
453 // print seccomp filter for a sandbox specified by pid or by name 512 // print seccomp filter for a sandbox specified by pid or by name
454 pid_t pid = read_pid(argv[i] + 16); 513 pid_t pid = require_pid(argv[i] + 16);
455 seccomp_print_filter(pid); 514 seccomp_print_filter(pid);
456 } 515 }
457 else 516 else
@@ -459,28 +518,27 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
459 exit(0); 518 exit(0);
460 } 519 }
461 else if (strcmp(argv[i], "--debug-protocols") == 0) { 520 else if (strcmp(argv[i], "--debug-protocols") == 0) {
462 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP, "debug-protocols"); 521 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSECCOMP_MAIN, "debug-protocols");
463 exit(rv); 522 exit(rv);
464 } 523 }
465 else if (strncmp(argv[i], "--protocol.print=", 17) == 0) { 524 else if (strncmp(argv[i], "--protocol.print=", 17) == 0) {
466 if (checkcfg(CFG_SECCOMP)) { 525 if (checkcfg(CFG_SECCOMP)) {
467 // print seccomp filter for a sandbox specified by pid or by name 526 // print seccomp filter for a sandbox specified by pid or by name
468 pid_t pid = read_pid(argv[i] + 17); 527 pid_t pid = require_pid(argv[i] + 17);
469 protocol_print_filter(pid); 528 protocol_print_filter(pid);
470 } 529 }
471 else 530 else
472 exit_err_feature("seccomp"); 531 exit_err_feature("seccomp");
473 exit(0); 532 exit(0);
474 } 533 }
475#endif
476 else if (strncmp(argv[i], "--profile.print=", 16) == 0) { 534 else if (strncmp(argv[i], "--profile.print=", 16) == 0) {
477 pid_t pid = read_pid(argv[i] + 16); 535 pid_t pid = require_pid(argv[i] + 16);
478 536
479 // print /run/firejail/profile/<PID> file 537 // print /run/firejail/profile/<PID> file
480 char *fname; 538 char *fname;
481 if (asprintf(&fname, RUN_FIREJAIL_PROFILE_DIR "/%d", pid) == -1) 539 if (asprintf(&fname, RUN_FIREJAIL_PROFILE_DIR "/%d", pid) == -1)
482 errExit("asprintf"); 540 errExit("asprintf");
483 FILE *fp = fopen(fname, "r"); 541 FILE *fp = fopen(fname, "re");
484 if (!fp) { 542 if (!fp) {
485 fprintf(stderr, "Error: sandbox %s not found\n", argv[i] + 16); 543 fprintf(stderr, "Error: sandbox %s not found\n", argv[i] + 16);
486 exit(1); 544 exit(1);
@@ -491,29 +549,39 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
491 printf("%s", buf); 549 printf("%s", buf);
492 fclose(fp); 550 fclose(fp);
493 exit(0); 551 exit(0);
494 552
495 } 553 }
496 else if (strncmp(argv[i], "--cpu.print=", 12) == 0) { 554 else if (strncmp(argv[i], "--cpu.print=", 12) == 0) {
497 // join sandbox by pid or by name 555 // join sandbox by pid or by name
498 pid_t pid = read_pid(argv[i] + 12); 556 pid_t pid = require_pid(argv[i] + 12);
499 cpu_print_filter(pid); 557 cpu_print_filter(pid);
500 exit(0); 558 exit(0);
501 } 559 }
560 else if (strncmp(argv[i], "--apparmor.print=", 17) == 0) {
561 // join sandbox by pid or by name
562 pid_t pid = require_pid(argv[i] + 17);
563 char *pidstr;
564 if (asprintf(&pidstr, "%u", pid) == -1)
565 errExit("asprintf");
566 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FIREMON, "--apparmor", pidstr);
567 free(pidstr);
568 exit(0);
569 }
502 else if (strncmp(argv[i], "--caps.print=", 13) == 0) { 570 else if (strncmp(argv[i], "--caps.print=", 13) == 0) {
503 // join sandbox by pid or by name 571 // join sandbox by pid or by name
504 pid_t pid = read_pid(argv[i] + 13); 572 pid_t pid = require_pid(argv[i] + 13);
505 caps_print_filter(pid); 573 caps_print_filter(pid);
506 exit(0); 574 exit(0);
507 } 575 }
508 else if (strncmp(argv[i], "--fs.print=", 11) == 0) { 576 else if (strncmp(argv[i], "--fs.print=", 11) == 0) {
509 // join sandbox by pid or by name 577 // join sandbox by pid or by name
510 pid_t pid = read_pid(argv[i] + 11); 578 pid_t pid = require_pid(argv[i] + 11);
511 fs_logger_print_log(pid); 579 fs_logger_print_log(pid);
512 exit(0); 580 exit(0);
513 } 581 }
514 else if (strncmp(argv[i], "--dns.print=", 12) == 0) { 582 else if (strncmp(argv[i], "--dns.print=", 12) == 0) {
515 // join sandbox by pid or by name 583 // join sandbox by pid or by name
516 pid_t pid = read_pid(argv[i] + 12); 584 pid_t pid = require_pid(argv[i] + 12);
517 net_dns_print(pid); 585 net_dns_print(pid);
518 exit(0); 586 exit(0);
519 } 587 }
@@ -523,21 +591,21 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
523 } 591 }
524 else if (strcmp(argv[i], "--list") == 0) { 592 else if (strcmp(argv[i], "--list") == 0) {
525 if (pid_hidepid()) 593 if (pid_hidepid())
526 sbox_run(SBOX_ROOT| SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FIREMON, "--list"); 594 sbox_run(SBOX_ROOT| SBOX_CAPS_HIDEPID | SBOX_SECCOMP, 2, PATH_FIREMON, "--list");
527 else 595 else
528 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FIREMON, "--list"); 596 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FIREMON, "--list");
529 exit(0); 597 exit(0);
530 } 598 }
531 else if (strcmp(argv[i], "--tree") == 0) { 599 else if (strcmp(argv[i], "--tree") == 0) {
532 if (pid_hidepid()) 600 if (pid_hidepid())
533 sbox_run(SBOX_ROOT | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FIREMON, "--tree"); 601 sbox_run(SBOX_ROOT | SBOX_CAPS_HIDEPID | SBOX_SECCOMP, 2, PATH_FIREMON, "--tree");
534 else 602 else
535 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FIREMON, "--tree"); 603 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FIREMON, "--tree");
536 exit(0); 604 exit(0);
537 } 605 }
538 else if (strcmp(argv[i], "--top") == 0) { 606 else if (strcmp(argv[i], "--top") == 0) {
539 if (pid_hidepid()) 607 if (pid_hidepid())
540 sbox_run(SBOX_ROOT | SBOX_CAPS_NONE | SBOX_SECCOMP | SBOX_ALLOW_STDIN, 608 sbox_run(SBOX_ROOT | SBOX_CAPS_HIDEPID | SBOX_SECCOMP | SBOX_ALLOW_STDIN,
541 2, PATH_FIREMON, "--top"); 609 2, PATH_FIREMON, "--top");
542 else 610 else
543 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP | SBOX_ALLOW_STDIN, 611 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP | SBOX_ALLOW_STDIN,
@@ -549,7 +617,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
549 if (checkcfg(CFG_NETWORK)) { 617 if (checkcfg(CFG_NETWORK)) {
550 struct stat s; 618 struct stat s;
551 if (stat("/proc/sys/kernel/grsecurity", &s) == 0 || pid_hidepid()) 619 if (stat("/proc/sys/kernel/grsecurity", &s) == 0 || pid_hidepid())
552 sbox_run(SBOX_ROOT | SBOX_CAPS_NONE | SBOX_SECCOMP | SBOX_ALLOW_STDIN, 620 sbox_run(SBOX_ROOT | SBOX_CAPS_HIDEPID | SBOX_SECCOMP | SBOX_ALLOW_STDIN,
553 2, PATH_FIREMON, "--netstats"); 621 2, PATH_FIREMON, "--netstats");
554 else 622 else
555 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP | SBOX_ALLOW_STDIN, 623 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP | SBOX_ALLOW_STDIN,
@@ -559,11 +627,25 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
559 else 627 else
560 exit_err_feature("networking"); 628 exit_err_feature("networking");
561 } 629 }
630 else if (strncmp(argv[i], "--net.print=", 12) == 0) {
631 if (checkcfg(CFG_NETWORK)) {
632 // extract pid or sandbox name
633 pid_t pid = require_pid(argv[i] + 12);
634 net_print(pid);
635 exit(0);
636 }
637 else
638 exit_err_feature("networking");
639 }
562#endif 640#endif
563#ifdef HAVE_FILE_TRANSFER 641#ifdef HAVE_FILE_TRANSFER
564 else if (strncmp(argv[i], "--get=", 6) == 0) { 642 else if (strncmp(argv[i], "--get=", 6) == 0) {
565 if (checkcfg(CFG_FILE_TRANSFER)) { 643 if (checkcfg(CFG_FILE_TRANSFER)) {
566 logargs(argc, argv); 644 logargs(argc, argv);
645 if (arg_private_cwd) {
646 fprintf(stderr, "Error: --get and --private-cwd options are mutually exclusive\n");
647 exit(1);
648 }
567 649
568 // verify path 650 // verify path
569 if ((i + 2) != argc) { 651 if ((i + 2) != argc) {
@@ -571,14 +653,14 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
571 exit(1); 653 exit(1);
572 } 654 }
573 char *path = argv[i + 1]; 655 char *path = argv[i + 1];
574 invalid_filename(path); 656 invalid_filename(path, 0); // no globbing
575 if (strstr(path, "..")) { 657 if (strstr(path, "..")) {
576 fprintf(stderr, "Error: invalid file name %s\n", path); 658 fprintf(stderr, "Error: invalid file name %s\n", path);
577 exit(1); 659 exit(1);
578 } 660 }
579 661
580 // get file 662 // get file
581 pid_t pid = read_pid(argv[i] + 6); 663 pid_t pid = require_pid(argv[i] + 6);
582 sandboxfs(SANDBOX_FS_GET, pid, path, NULL); 664 sandboxfs(SANDBOX_FS_GET, pid, path, NULL);
583 exit(0); 665 exit(0);
584 } 666 }
@@ -588,6 +670,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
588 else if (strncmp(argv[i], "--put=", 6) == 0) { 670 else if (strncmp(argv[i], "--put=", 6) == 0) {
589 if (checkcfg(CFG_FILE_TRANSFER)) { 671 if (checkcfg(CFG_FILE_TRANSFER)) {
590 logargs(argc, argv); 672 logargs(argc, argv);
673 if (arg_private_cwd) {
674 fprintf(stderr, "Error: --put and --private-cwd options are mutually exclusive\n");
675 exit(1);
676 }
591 677
592 // verify path 678 // verify path
593 if ((i + 3) != argc) { 679 if ((i + 3) != argc) {
@@ -595,20 +681,20 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
595 exit(1); 681 exit(1);
596 } 682 }
597 char *path1 = argv[i + 1]; 683 char *path1 = argv[i + 1];
598 invalid_filename(path1); 684 invalid_filename(path1, 0); // no globbing
599 if (strstr(path1, "..")) { 685 if (strstr(path1, "..")) {
600 fprintf(stderr, "Error: invalid file name %s\n", path1); 686 fprintf(stderr, "Error: invalid file name %s\n", path1);
601 exit(1); 687 exit(1);
602 } 688 }
603 char *path2 = argv[i + 2]; 689 char *path2 = argv[i + 2];
604 invalid_filename(path2); 690 invalid_filename(path2, 0); // no globbing
605 if (strstr(path2, "..")) { 691 if (strstr(path2, "..")) {
606 fprintf(stderr, "Error: invalid file name %s\n", path2); 692 fprintf(stderr, "Error: invalid file name %s\n", path2);
607 exit(1); 693 exit(1);
608 } 694 }
609 695
610 // get file 696 // get file
611 pid_t pid = read_pid(argv[i] + 6); 697 pid_t pid = require_pid(argv[i] + 6);
612 sandboxfs(SANDBOX_FS_PUT, pid, path1, path2); 698 sandboxfs(SANDBOX_FS_PUT, pid, path1, path2);
613 exit(0); 699 exit(0);
614 } 700 }
@@ -618,6 +704,10 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
618 else if (strncmp(argv[i], "--ls=", 5) == 0) { 704 else if (strncmp(argv[i], "--ls=", 5) == 0) {
619 if (checkcfg(CFG_FILE_TRANSFER)) { 705 if (checkcfg(CFG_FILE_TRANSFER)) {
620 logargs(argc, argv); 706 logargs(argc, argv);
707 if (arg_private_cwd) {
708 fprintf(stderr, "Error: --ls and --private-cwd options are mutually exclusive\n");
709 exit(1);
710 }
621 711
622 // verify path 712 // verify path
623 if ((i + 2) != argc) { 713 if ((i + 2) != argc) {
@@ -625,20 +715,51 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
625 exit(1); 715 exit(1);
626 } 716 }
627 char *path = argv[i + 1]; 717 char *path = argv[i + 1];
628 invalid_filename(path); 718 invalid_filename(path, 0); // no globbing
629 if (strstr(path, "..")) { 719 if (strstr(path, "..")) {
630 fprintf(stderr, "Error: invalid file name %s\n", path); 720 fprintf(stderr, "Error: invalid file name %s\n", path);
631 exit(1); 721 exit(1);
632 } 722 }
633 723
634 // list directory contents 724 // list directory contents
635 pid_t pid = read_pid(argv[i] + 5); 725 if (!arg_debug)
726 arg_quiet = 1;
727 pid_t pid = require_pid(argv[i] + 5);
636 sandboxfs(SANDBOX_FS_LS, pid, path, NULL); 728 sandboxfs(SANDBOX_FS_LS, pid, path, NULL);
637 exit(0); 729 exit(0);
638 } 730 }
639 else 731 else
640 exit_err_feature("file transfer"); 732 exit_err_feature("file transfer");
641 } 733 }
734 else if (strncmp(argv[i], "--cat=", 6) == 0) {
735 if (checkcfg(CFG_FILE_TRANSFER)) {
736 logargs(argc, argv);
737 if (arg_private_cwd) {
738 fprintf(stderr, "Error: --cat and --private-cwd options are mutually exclusive\n");
739 exit(1);
740 }
741
742 if ((i + 2) != argc) {
743 fprintf(stderr, "Error: invalid --cat option, path expected\n");
744 exit(1);
745 }
746 char *path = argv[i + 1];
747 invalid_filename(path, 0); // no globbing
748 if (strstr(path, "..")) {
749 fprintf(stderr, "Error: invalid file name %s\n", path);
750 exit(1);
751 }
752
753 // write file contents to stdout
754 if (!arg_debug)
755 arg_quiet = 1;
756 pid_t pid = require_pid(argv[i] + 6);
757 sandboxfs(SANDBOX_FS_CAT, pid, path, NULL);
758 exit(0);
759 }
760 else
761 exit_err_feature("file transfer");
762 }
642#endif 763#endif
643 else if (strncmp(argv[i], "--join=", 7) == 0) { 764 else if (strncmp(argv[i], "--join=", 7) == 0) {
644 if (checkcfg(CFG_JOIN) || getuid() == 0) { 765 if (checkcfg(CFG_JOIN) || getuid() == 0) {
@@ -656,7 +777,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
656 cfg.shell = guess_shell(); 777 cfg.shell = guess_shell();
657 778
658 // join sandbox by pid or by name 779 // join sandbox by pid or by name
659 pid_t pid = read_pid(argv[i] + 7); 780 pid_t pid = require_pid(argv[i] + 7);
660 join(pid, argc, argv, i + 1); 781 join(pid, argc, argv, i + 1);
661 exit(0); 782 exit(0);
662 } 783 }
@@ -667,28 +788,30 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
667 else if (strncmp(argv[i], "--join-or-start=", 16) == 0) { 788 else if (strncmp(argv[i], "--join-or-start=", 16) == 0) {
668 // NOTE: this is first part of option handler, 789 // NOTE: this is first part of option handler,
669 // sandbox name is set in other part 790 // sandbox name is set in other part
670 logargs(argc, argv); 791 if (checkcfg(CFG_JOIN) || getuid() == 0) {
792 logargs(argc, argv);
671 793
672 if (arg_shell_none) { 794 if (arg_shell_none) {
673 if (argc <= (i+1)) { 795 if (argc <= (i+1)) {
674 fprintf(stderr, "Error: --shell=none set, but no command specified\n"); 796 fprintf(stderr, "Error: --shell=none set, but no command specified\n");
675 exit(1); 797 exit(1);
798 }
799 cfg.original_program_index = i + 1;
676 } 800 }
677 cfg.original_program_index = i + 1;
678 }
679 801
680#if 0 // todo: redo it 802 // try to join by name only
681 // try to join by name only 803 pid_t pid;
682 pid_t pid; 804 if (!read_pid(argv[i] + 16, &pid)) {
683 if (!name2pid(argv[i] + 16, &pid)) { 805 if (!cfg.shell && !arg_shell_none)
684 if (!cfg.shell && !arg_shell_none) 806 cfg.shell = guess_shell();
685 cfg.shell = guess_shell();
686 807
687 join(pid, argc, argv, i + 1); 808 join(pid, argc, argv, i + 1);
688 exit(0); 809 exit(0);
810 }
811 // if there no such sandbox continue argument processing
689 } 812 }
690#endif 813 else
691 // if there no such sandbox continue argument processing 814 exit_err_feature("join");
692 } 815 }
693#ifdef HAVE_NETWORK 816#ifdef HAVE_NETWORK
694 else if (strncmp(argv[i], "--join-network=", 15) == 0) { 817 else if (strncmp(argv[i], "--join-network=", 15) == 0) {
@@ -704,7 +827,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
704 cfg.shell = guess_shell(); 827 cfg.shell = guess_shell();
705 828
706 // join sandbox by pid or by name 829 // join sandbox by pid or by name
707 pid_t pid = read_pid(argv[i] + 15); 830 pid_t pid = require_pid(argv[i] + 15);
708 join(pid, argc, argv, i + 1); 831 join(pid, argc, argv, i + 1);
709 } 832 }
710 else 833 else
@@ -724,7 +847,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
724 cfg.shell = guess_shell(); 847 cfg.shell = guess_shell();
725 848
726 // join sandbox by pid or by name 849 // join sandbox by pid or by name
727 pid_t pid = read_pid(argv[i] + 18); 850 pid_t pid = require_pid(argv[i] + 18);
728 join(pid, argc, argv, i + 1); 851 join(pid, argc, argv, i + 1);
729 exit(0); 852 exit(0);
730 } 853 }
@@ -732,111 +855,63 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
732 logargs(argc, argv); 855 logargs(argc, argv);
733 856
734 // shutdown sandbox by pid or by name 857 // shutdown sandbox by pid or by name
735 pid_t pid = read_pid(argv[i] + 11); 858 pid_t pid = require_pid(argv[i] + 11);
736 shut(pid); 859 shut(pid);
737 exit(0); 860 exit(0);
738 } 861 }
739 862
740} 863}
741 864
742static void set_name_file(pid_t pid) {
743 char *fname;
744 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_NAME_DIR, pid) == -1)
745 errExit("asprintf");
746
747 // the file is deleted first
748 FILE *fp = fopen(fname, "w");
749 if (!fp) {
750 fprintf(stderr, "Error: cannot create %s\n", fname);
751 exit(1);
752 }
753 fprintf(fp, "%s\n", cfg.name);
754
755 // mode and ownership
756 SET_PERMS_STREAM(fp, 0, 0, 0644);
757 fclose(fp);
758}
759
760static void delete_name_file(pid_t pid) {
761 char *fname;
762 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_NAME_DIR, pid) == -1)
763 errExit("asprintf");
764 int rv = unlink(fname);
765 (void) rv;
766 free(fname);
767}
768
769static void delete_profile_file(pid_t pid) {
770 char *fname;
771 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_PROFILE_DIR, pid) == -1)
772 errExit("asprintf");
773 int rv = unlink(fname);
774 (void) rv;
775 free(fname);
776}
777
778void set_x11_file(pid_t pid, int display) {
779 char *fname;
780 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_X11_DIR, pid) == -1)
781 errExit("asprintf");
782
783 // the file is deleted first
784 FILE *fp = fopen(fname, "w");
785 if (!fp) {
786 fprintf(stderr, "Error: cannot create %s\n", fname);
787 exit(1);
788 }
789 fprintf(fp, "%d\n", display);
790
791 // mode and ownership
792 SET_PERMS_STREAM(fp, 0, 0, 0644);
793 fclose(fp);
794}
795
796static void delete_x11_file(pid_t pid) {
797 char *fname;
798 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_X11_DIR, pid) == -1)
799 errExit("asprintf");
800 int rv = unlink(fname);
801 (void) rv;
802 free(fname);
803}
804
805char *guess_shell(void) { 865char *guess_shell(void) {
806 char *shell = NULL; 866 const char *shell;
807 struct stat s; 867 char *retval;
808 868
809 shell = getenv("SHELL"); 869 shell = env_get("SHELL");
810 if (shell) { 870 if (shell) {
811 // TODO: handle rogue shell variables? 871 invalid_filename(shell, 0); // no globbing
812 if (stat(shell, &s) == 0 && access(shell, R_OK) == 0) { 872 if (access(shell, X_OK) == 0 && !is_dir(shell) && strstr(shell, "..") == NULL &&
813 return shell; 873 strcmp(shell, PATH_FIREJAIL) != 0)
814 } 874 goto found;
815 } 875 }
816 876
817 // shells in order of preference 877 // shells in order of preference
818 char *shells[] = {"/bin/bash", "/bin/csh", "/usr/bin/zsh", "/bin/sh", "/bin/ash", NULL }; 878 static const char * const shells[] = {"/bin/bash", "/bin/csh", "/usr/bin/zsh", "/bin/sh", "/bin/ash", NULL };
819 879
820 int i = 0; 880 int i = 0;
821 while (shells[i] != NULL) { 881 while (shells[i] != NULL) {
822 // access call checks as real UID/GID, not as effective UID/GID 882 // access call checks as real UID/GID, not as effective UID/GID
823 if (stat(shells[i], &s) == 0 && access(shells[i], R_OK) == 0) { 883 if (access(shells[i], X_OK) == 0) {
824 shell = shells[i]; 884 shell = shells[i];
825 break; 885 goto found;
826 } 886 }
827 i++; 887 i++;
828 } 888 }
829 889
830 return shell; 890 return NULL;
891
892 found:
893 retval = strdup(shell);
894 if (!retval)
895 errExit("strdup");
896 return retval;
831} 897}
832 898
833static int check_arg(int argc, char **argv, const char *argument) { 899// return argument index
900static int check_arg(int argc, char **argv, const char *argument, int strict) {
834 int i; 901 int i;
835 int found = 0; 902 int found = 0;
836 for (i = 1; i < argc; i++) { 903 for (i = 1; i < argc; i++) {
837 if (strcmp(argv[i], argument) == 0) { 904 if (strict) {
838 found = 1; 905 if (strcmp(argv[i], argument) == 0) {
839 break; 906 found = i;
907 break;
908 }
909 }
910 else {
911 if (strncmp(argv[i], argument, strlen(argument)) == 0) {
912 found = i;
913 break;
914 }
840 } 915 }
841 916
842 // detect end of firejail params 917 // detect end of firejail params
@@ -851,14 +926,21 @@ static int check_arg(int argc, char **argv, const char *argument) {
851 926
852static void run_builder(int argc, char **argv) { 927static void run_builder(int argc, char **argv) {
853 EUID_ASSERT(); 928 EUID_ASSERT();
929 (void) argc;
854 930
855 // drop privileges 931 // drop privileges
856 if (setgid(getgid()) < 0) 932 if (setresgid(-1, getgid(), getgid()) != 0)
857 errExit("setgid/getgid"); 933 errExit("setresgid");
858 if (setuid(getuid()) < 0) 934 if (setresuid(-1, getuid(), getuid()) != 0)
859 errExit("setuid/getuid"); 935 errExit("setresuid");
936
937 assert(env_get("LD_PRELOAD") == NULL);
860 assert(getenv("LD_PRELOAD") == NULL); 938 assert(getenv("LD_PRELOAD") == NULL);
861 939 umask(orig_umask);
940
941 // restore original environment variables
942 env_apply_all();
943
862 argv[0] = LIBDIR "/firejail/fbuilder"; 944 argv[0] = LIBDIR "/firejail/fbuilder";
863 execvp(argv[0], argv); 945 execvp(argv[0], argv);
864 946
@@ -866,127 +948,161 @@ static void run_builder(int argc, char **argv) {
866 exit(1); 948 exit(1);
867} 949}
868 950
951void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) {
952 (void) fd;
953 (void) syscall;
954 (void) arg;
955 (void) ptrarg;
956 (void) native;
957}
958void filter_add_blacklist_override(int fd, int syscall, int arg, void *ptrarg, bool native) {
959 (void) fd;
960 (void) syscall;
961 (void) arg;
962 (void) ptrarg;
963 (void) native;
964}
965
966static int check_postexec(const char *list) {
967 char *prelist, *postlist;
968
969 if (list && list[0]) {
970 syscalls_in_list(list, "@default-keep", -1, &prelist, &postlist, true);
971 if (postlist)
972 return 1;
973 }
974 return 0;
975}
869 976
870//******************************************* 977//*******************************************
871// Main program 978// Main program
872//******************************************* 979//*******************************************
873int main(int argc, char **argv) { 980int main(int argc, char **argv, char **envp) {
874 int i; 981 int i;
875 int prog_index = -1; // index in argv where the program command starts 982 int prog_index = -1; // index in argv where the program command starts
876 int lockfd = -1; 983 int lockfd_network = -1;
984 int lockfd_directory = -1;
877 int option_cgroup = 0; 985 int option_cgroup = 0;
878 int option_force = 0;
879 int custom_profile = 0; // custom profile loaded 986 int custom_profile = 0; // custom profile loaded
880 char *custom_profile_dir = NULL; // custom profile directory 987 int arg_caps_cmdline = 0; // caps requested on command line (used to break out of --chroot)
988 char **ptr;
881 989
990 // sanitize the umask
991 orig_umask = umask(022);
882 992
883 atexit(clear_atexit); 993 // drop permissions by default and rise them when required
994 EUID_INIT();
995 EUID_USER();
884 996
885 // get starting timestamp 997 // check standard streams before opening any file
886 start_timestamp = getticks(); 998 fix_std_streams();
887 999
888 // build /run/firejail directory structure 1000 // argument count should be larger than 0
889 preproc_build_firejail_dir(); 1001 if (argc == 0 || !argv || strlen(argv[0]) == 0) {
890 preproc_clean_run(); 1002 fprintf(stderr, "Error: argv is invalid\n");
1003 exit(1);
1004 } else if (argc >= MAX_ARGS) {
1005 fprintf(stderr, "Error: too many arguments\n");
1006 exit(1);
1007 }
891 1008
892 if (check_arg(argc, argv, "--quiet")) 1009 // sanity check for arguments
893 arg_quiet = 1; 1010 for (i = 0; i < argc; i++) {
894 if (check_arg(argc, argv, "--allow-debuggers")) { 1011 if (*argv[i] == 0) {
895 // check kernel version 1012 fprintf(stderr, "Error: too short arguments\n");
896 struct utsname u;
897 int rv = uname(&u);
898 if (rv != 0)
899 errExit("uname");
900 int major;
901 int minor;
902 if (2 != sscanf(u.release, "%d.%d", &major, &minor)) {
903 fprintf(stderr, "Error: cannot extract Linux kernel version: %s\n", u.version);
904 exit(1); 1013 exit(1);
905 } 1014 }
906 if (major < 4 || (major == 4 && minor < 8)) { 1015 if (strlen(argv[i]) >= MAX_ARG_LEN) {
907 fprintf(stderr, "Error: --allow-debuggers is disabled on Linux kernels prior to 4.8. " 1016 fprintf(stderr, "Error: too long arguments\n");
908 "A bug in ptrace call allows a full bypass of the seccomp filter. "
909 "Your current kernel version is %d.%d.\n", major, minor);
910 exit(1); 1017 exit(1);
911 } 1018 }
1019 }
912 1020
913 arg_allow_debuggers = 1; 1021 // Stash environment variables
1022 for (i = 0, ptr = envp; ptr && *ptr && i < MAX_ENVS; i++, ptr++)
1023 env_store(*ptr, SETENV);
1024
1025 // sanity check for environment variables
1026 if (i >= MAX_ENVS) {
1027 fprintf(stderr, "Error: too many environment variables\n");
1028 exit(1);
914 } 1029 }
915 1030
916 // drop permissions by default and rise them when required 1031 // Reapply a minimal set of environment variables
917 EUID_INIT(); 1032 env_apply_whitelist();
918 EUID_USER();
919 1033
920#ifdef HAVE_GIT_INSTALL 1034 // process --quiet
921 // process git-install and git-uninstall 1035 const char *env_quiet = env_get("FIREJAIL_QUIET");
922 if (check_arg(argc, argv, "--git-install")) 1036 if (check_arg(argc, argv, "--quiet", 1) || (env_quiet && strcmp(env_quiet, "yes") == 0))
923 git_install(); // this function will not return 1037 arg_quiet = 1;
924 if (check_arg(argc, argv, "--git-uninstall")) 1038
925 git_uninstall(); // this function will not return 1039 // check if the user is allowed to use firejail
926#endif 1040 init_cfg(argc, argv);
1041
1042 // get starting timestamp
1043 timetrace_start();
927 1044
928 // profile builder
929 if (check_arg(argc, argv, "--build"))
930 run_builder(argc, argv); // this function will not return
931
932 // check argv[0] symlink wrapper if this is not a login shell 1045 // check argv[0] symlink wrapper if this is not a login shell
933 if (*argv[0] != '-') 1046 if (*argv[0] != '-')
934 run_symlink(argc, argv); // if symlink detected, this function will not return 1047 run_symlink(argc, argv, 0); // if symlink detected, this function will not return
935 1048
936 // check if we already have a sandbox running 1049 // check if we already have a sandbox running
937 // If LXC is detected, start firejail sandbox 1050 // If LXC is detected, start firejail sandbox
938 // otherwise try to detect a PID namespace by looking under /proc for specific kernel processes and: 1051 // otherwise try to detect a PID namespace by looking under /proc for specific kernel processes and:
939 // - if --force flag is set, start firejail sandbox 1052 // - start the application in a /bin/bash shell
940 // -- if --force flag is not set, start the application in a /bin/bash shell
941 if (check_namespace_virt() == 0) { 1053 if (check_namespace_virt() == 0) {
942 EUID_ROOT(); 1054 EUID_ROOT();
943 int rv = check_kernel_procs(); 1055 int rv = check_kernel_procs();
944 EUID_USER(); 1056 EUID_USER();
945 if (rv == 0) { 1057 if (rv == 0) {
946 // if --force option is passed to the program, disregard the existing sandbox 1058 if (check_arg(argc, argv, "--version", 1)) {
947 if (check_arg(argc, argv, "--force")) 1059 printf("firejail version %s\n", VERSION);
948 option_force = 1; 1060 exit(0);
949 else {
950 if (check_arg(argc, argv, "--version")) {
951 printf("firejail version %s\n", VERSION);
952 exit(0);
953 }
954
955 // start the program directly without sandboxing
956 run_no_sandbox(argc, argv);
957 // it will never get here!
958 assert(0);
959 } 1061 }
960 }
961 }
962 1062
963 // check root/suid 1063 // start the program directly without sandboxing
964 EUID_ROOT(); 1064 run_no_sandbox(argc, argv);
965 if (geteuid()) { 1065 __builtin_unreachable();
966 // only --version is supported without SUID support
967 if (check_arg(argc, argv, "--version")) {
968 printf("firejail version %s\n", VERSION);
969 exit(0);
970 } 1066 }
971
972 fprintf(stderr, "Error: cannot rise privileges\n");
973 exit(1);
974 } 1067 }
975 EUID_USER();
976 1068
977 // initialize globals 1069 // profile builder
978 init_cfg(argc, argv); 1070 if (check_arg(argc, argv, "--build", 0)) // supports both --build and --build=filename
1071 run_builder(argc, argv); // this function will not return
1072
1073 // intrusion detection system
1074 if (check_arg(argc, argv, "--ids-", 0)) // supports both --ids-init and --ids-check
1075 run_ids(argc, argv); // this function will not return
979 1076
980 // check firejail directories
981 EUID_ROOT(); 1077 EUID_ROOT();
982 bandwidth_del_run_file(sandbox_pid); 1078#ifndef HAVE_SUID
983 network_del_run_file(sandbox_pid); 1079 if (geteuid() != 0) {
984 delete_name_file(sandbox_pid); 1080 fprintf(stderr, "Error: Firejail needs to be SUID.\n");
985 delete_x11_file(sandbox_pid); 1081 fprintf(stderr, "Assuming firejail is installed in /usr/bin, execute the following command as root:\n");
1082 fprintf(stderr, " chmod u+s /usr/bin/firejail\n");
1083 }
1084#endif
986 1085
1086 // build /run/firejail directory structure
1087 preproc_build_firejail_dir();
1088 const char *container_name = env_get("container");
1089 if (!container_name || strcmp(container_name, "firejail")) {
1090 lockfd_directory = open(RUN_DIRECTORY_LOCK_FILE, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR);
1091 if (lockfd_directory != -1) {
1092 int rv = fchown(lockfd_directory, 0, 0);
1093 (void) rv;
1094 flock(lockfd_directory, LOCK_EX);
1095 }
1096 preproc_clean_run();
1097 flock(lockfd_directory, LOCK_UN);
1098 close(lockfd_directory);
1099 }
1100
1101 delete_run_files(getpid());
1102 atexit(clear_atexit);
987 EUID_USER(); 1103 EUID_USER();
988 1104
989 //check if the parent is sshd daemon 1105 // check if the parent is sshd daemon
990 int parent_sshd = 0; 1106 int parent_sshd = 0;
991 { 1107 {
992 pid_t ppid = getppid(); 1108 pid_t ppid = getppid();
@@ -1000,7 +1116,7 @@ int main(int argc, char **argv) {
1000 1116
1001#ifdef DEBUG_RESTRICTED_SHELL 1117#ifdef DEBUG_RESTRICTED_SHELL
1002 {EUID_ROOT(); 1118 {EUID_ROOT();
1003 FILE *fp = fopen("/firelog", "w"); 1119 FILE *fp = fopen("/firelog", "we");
1004 if (fp) { 1120 if (fp) {
1005 int i; 1121 int i;
1006 fprintf(fp, "argc %d: ", argc); 1122 fprintf(fp, "argc %d: ", argc);
@@ -1019,7 +1135,7 @@ int main(int argc, char **argv) {
1019 strncmp(argv[2], "scp ", 4) == 0) { 1135 strncmp(argv[2], "scp ", 4) == 0) {
1020#ifdef DEBUG_RESTRICTED_SHELL 1136#ifdef DEBUG_RESTRICTED_SHELL
1021 {EUID_ROOT(); 1137 {EUID_ROOT();
1022 FILE *fp = fopen("/firelog", "a"); 1138 FILE *fp = fopen("/firelog", "ae");
1023 if (fp) { 1139 if (fp) {
1024 fprintf(fp, "run without a sandbox\n"); 1140 fprintf(fp, "run without a sandbox\n");
1025 fclose(fp); 1141 fclose(fp);
@@ -1027,9 +1143,13 @@ int main(int argc, char **argv) {
1027 EUID_USER();} 1143 EUID_USER();}
1028#endif 1144#endif
1029 1145
1030 drop_privs(1); 1146 drop_privs(1);
1031 int rv = system(argv[2]); 1147 umask(orig_umask);
1032 exit(rv); 1148
1149 // restore original environment variables
1150 env_apply_all();
1151 int rv = system(argv[2]);
1152 exit(rv);
1033 } 1153 }
1034 } 1154 }
1035 } 1155 }
@@ -1037,8 +1157,10 @@ int main(int argc, char **argv) {
1037 free(comm); 1157 free(comm);
1038 } 1158 }
1039 } 1159 }
1160 EUID_ASSERT();
1040 1161
1041 // is this a login shell, or a command passed by sshd, insert command line options from /etc/firejail/login.users 1162 // is this a login shell, or a command passed by sshd,
1163 // insert command line options from /etc/firejail/login.users
1042 if (*argv[0] == '-' || parent_sshd) { 1164 if (*argv[0] == '-' || parent_sshd) {
1043 if (argc == 1) 1165 if (argc == 1)
1044 login_shell = 1; 1166 login_shell = 1;
@@ -1047,7 +1169,7 @@ int main(int argc, char **argv) {
1047 1169
1048#ifdef DEBUG_RESTRICTED_SHELL 1170#ifdef DEBUG_RESTRICTED_SHELL
1049 {EUID_ROOT(); 1171 {EUID_ROOT();
1050 FILE *fp = fopen("/firelog", "a"); 1172 FILE *fp = fopen("/firelog", "ae");
1051 if (fp) { 1173 if (fp) {
1052 fprintf(fp, "fullargc %d: ", fullargc); 1174 fprintf(fp, "fullargc %d: ", fullargc);
1053 int i; 1175 int i;
@@ -1069,7 +1191,7 @@ int main(int argc, char **argv) {
1069 1191
1070#ifdef DEBUG_RESTRICTED_SHELL 1192#ifdef DEBUG_RESTRICTED_SHELL
1071 {EUID_ROOT(); 1193 {EUID_ROOT();
1072 FILE *fp = fopen("/firelog", "a"); 1194 FILE *fp = fopen("/firelog", "ae");
1073 if (fp) { 1195 if (fp) {
1074 fprintf(fp, "argc %d: ", argc); 1196 fprintf(fp, "argc %d: ", argc);
1075 int i; 1197 int i;
@@ -1082,46 +1204,77 @@ int main(int argc, char **argv) {
1082#endif 1204#endif
1083 } 1205 }
1084 } 1206 }
1207#ifdef HAVE_OUTPUT
1085 else { 1208 else {
1086 // check --output option and execute it; 1209 // check --output option and execute it;
1087 check_output(argc, argv); // the function will not return if --output or --output-stderr option was found 1210 check_output(argc, argv); // the function will not return if --output or --output-stderr option was found
1088 } 1211 }
1212#endif
1213 EUID_ASSERT();
1089 1214
1215 // --ip=dhcp - we need access to /sbin and /usr/sbin directories in order to run ISC DHCP client (dhclient)
1216 // these paths are disabled in disable-common.inc
1217 if ((i = check_arg(argc, argv, "--ip", 0)) != 0) {
1218 if (strncmp(argv[i] + 4, "=dhcp", 5) == 0) {
1219 profile_add("noblacklist /sbin");
1220 profile_add("noblacklist /usr/sbin");
1221 }
1222 }
1090 1223
1091 // check for force-nonewprivs in /etc/firejail/firejail.config file 1224 // process allow-debuggers
1092 if (checkcfg(CFG_FORCE_NONEWPRIVS)) 1225 if (check_arg(argc, argv, "--allow-debuggers", 1)) {
1093 arg_nonewprivs = 1; 1226 // check kernel version
1227 struct utsname u;
1228 int rv = uname(&u);
1229 if (rv != 0)
1230 errExit("uname");
1231 int major;
1232 int minor;
1233 if (2 != sscanf(u.release, "%d.%d", &major, &minor)) {
1234 fprintf(stderr, "Error: cannot extract Linux kernel version: %s\n", u.version);
1235 exit(1);
1236 }
1237 if (major < 4 || (major == 4 && minor < 8)) {
1238 fprintf(stderr, "Error: --allow-debuggers is disabled on Linux kernels prior to 4.8. "
1239 "A bug in ptrace call allows a full bypass of the seccomp filter. "
1240 "Your current kernel version is %d.%d.\n", major, minor);
1241 exit(1);
1242 }
1094 1243
1095 if (arg_allow_debuggers) { 1244 arg_allow_debuggers = 1;
1096 char *cmd = strdup("noblacklist ${PATH}/strace"); 1245 char *cmd = strdup("noblacklist ${PATH}/strace");
1097 if (!cmd) 1246 if (!cmd)
1098 errExit("strdup"); 1247 errExit("strdup");
1099 profile_add(cmd); 1248 profile_add(cmd);
1100 } 1249 }
1101 1250
1251 // for appimages we need to remove "include disable-shell.inc from the profile
1252 // a --profile command can show up before --appimage
1253 if (check_arg(argc, argv, "--appimage", 1))
1254 arg_appimage = 1;
1255
1256 // check for force-nonewprivs in /etc/firejail/firejail.config file
1257 if (checkcfg(CFG_FORCE_NONEWPRIVS))
1258 arg_nonewprivs = 1;
1259
1102 // parse arguments 1260 // parse arguments
1103 for (i = 1; i < argc; i++) { 1261 for (i = 1; i < argc; i++) {
1104 run_cmd_and_exit(i, argc, argv); // will exit if the command is recognized 1262 run_cmd_and_exit(i, argc, argv); // will exit if the command is recognized
1105 1263
1106 if (strcmp(argv[i], "--debug") == 0) { 1264 if (strcmp(argv[i], "--debug") == 0) {
1107 if (!arg_quiet) { 1265 arg_debug = 1;
1108 arg_debug = 1; 1266 arg_quiet = 0;
1109 if (option_force)
1110 printf("Entering sandbox-in-sandbox mode\n");
1111 }
1112 } 1267 }
1113 else if (strcmp(argv[i], "--debug-check-filename") == 0)
1114 arg_debug_check_filename = 1;
1115 else if (strcmp(argv[i], "--debug-blacklists") == 0) 1268 else if (strcmp(argv[i], "--debug-blacklists") == 0)
1116 arg_debug_blacklists = 1; 1269 arg_debug_blacklists = 1;
1117 else if (strcmp(argv[i], "--debug-whitelists") == 0) 1270 else if (strcmp(argv[i], "--debug-whitelists") == 0)
1118 arg_debug_whitelists = 1; 1271 arg_debug_whitelists = 1;
1272 else if (strcmp(argv[i], "--debug-private-lib") == 0)
1273 arg_debug_private_lib = 1;
1119 else if (strcmp(argv[i], "--quiet") == 0) { 1274 else if (strcmp(argv[i], "--quiet") == 0) {
1120 arg_quiet = 1; 1275 if (!arg_debug)
1121 arg_debug = 0; 1276 arg_quiet = 1;
1122 } 1277 }
1123 else if (strcmp(argv[i], "--force") == 0)
1124 ;
1125 else if (strcmp(argv[i], "--allow-debuggers") == 0) { 1278 else if (strcmp(argv[i], "--allow-debuggers") == 0) {
1126 // already handled 1279 // already handled
1127 } 1280 }
@@ -1132,7 +1285,7 @@ int main(int argc, char **argv) {
1132 //************************************* 1285 //*************************************
1133 1286
1134#ifdef HAVE_X11 1287#ifdef HAVE_X11
1135 else if (strncmp(argv[i], "--xephyr-screen=", 14) == 0) { 1288 else if (strncmp(argv[i], "--xephyr-screen=", 16) == 0) {
1136 if (checkcfg(CFG_X11)) 1289 if (checkcfg(CFG_X11))
1137 ; // the processing is done directly in x11.c 1290 ; // the processing is done directly in x11.c
1138 else 1291 else
@@ -1146,18 +1299,12 @@ int main(int argc, char **argv) {
1146 else if (strcmp(argv[i], "--apparmor") == 0) 1299 else if (strcmp(argv[i], "--apparmor") == 0)
1147 arg_apparmor = 1; 1300 arg_apparmor = 1;
1148#endif 1301#endif
1149#ifdef HAVE_SECCOMP
1150 else if (strncmp(argv[i], "--protocol=", 11) == 0) { 1302 else if (strncmp(argv[i], "--protocol=", 11) == 0) {
1151 if (checkcfg(CFG_SECCOMP)) { 1303 if (checkcfg(CFG_SECCOMP)) {
1152 if (cfg.protocol) { 1304 const char *add = argv[i] + 11;
1153 fwarning("a protocol list is present, the new list \"%s\" will not be installed\n", argv[i] + 11); 1305 profile_list_augment(&cfg.protocol, add);
1154 } 1306 if (arg_debug)
1155 else { 1307 fprintf(stderr, "[option] combined protocol list: \"%s\"\n", cfg.protocol);
1156 // store list
1157 cfg.protocol = strdup(argv[i] + 11);
1158 if (!cfg.protocol)
1159 errExit("strdup");
1160 }
1161 } 1308 }
1162 else 1309 else
1163 exit_err_feature("seccomp"); 1310 exit_err_feature("seccomp");
@@ -1185,6 +1332,18 @@ int main(int argc, char **argv) {
1185 else 1332 else
1186 exit_err_feature("seccomp"); 1333 exit_err_feature("seccomp");
1187 } 1334 }
1335 else if (strncmp(argv[i], "--seccomp.32=", 13) == 0) {
1336 if (checkcfg(CFG_SECCOMP)) {
1337 if (arg_seccomp32) {
1338 fprintf(stderr, "Error: seccomp.32 already enabled\n");
1339 exit(1);
1340 }
1341 arg_seccomp32 = 1;
1342 cfg.seccomp_list32 = seccomp_check_list(argv[i] + 13);
1343 }
1344 else
1345 exit_err_feature("seccomp");
1346 }
1188 else if (strncmp(argv[i], "--seccomp.drop=", 15) == 0) { 1347 else if (strncmp(argv[i], "--seccomp.drop=", 15) == 0) {
1189 if (checkcfg(CFG_SECCOMP)) { 1348 if (checkcfg(CFG_SECCOMP)) {
1190 if (arg_seccomp) { 1349 if (arg_seccomp) {
@@ -1197,6 +1356,18 @@ int main(int argc, char **argv) {
1197 else 1356 else
1198 exit_err_feature("seccomp"); 1357 exit_err_feature("seccomp");
1199 } 1358 }
1359 else if (strncmp(argv[i], "--seccomp.32.drop=", 18) == 0) {
1360 if (checkcfg(CFG_SECCOMP)) {
1361 if (arg_seccomp32) {
1362 fprintf(stderr, "Error: seccomp.32 already enabled\n");
1363 exit(1);
1364 }
1365 arg_seccomp32 = 1;
1366 cfg.seccomp_list_drop32 = seccomp_check_list(argv[i] + 18);
1367 }
1368 else
1369 exit_err_feature("seccomp");
1370 }
1200 else if (strncmp(argv[i], "--seccomp.keep=", 15) == 0) { 1371 else if (strncmp(argv[i], "--seccomp.keep=", 15) == 0) {
1201 if (checkcfg(CFG_SECCOMP)) { 1372 if (checkcfg(CFG_SECCOMP)) {
1202 if (arg_seccomp) { 1373 if (arg_seccomp) {
@@ -1209,8 +1380,24 @@ int main(int argc, char **argv) {
1209 else 1380 else
1210 exit_err_feature("seccomp"); 1381 exit_err_feature("seccomp");
1211 } 1382 }
1383 else if (strncmp(argv[i], "--seccomp.32.keep=", 18) == 0) {
1384 if (checkcfg(CFG_SECCOMP)) {
1385 if (arg_seccomp32) {
1386 fprintf(stderr, "Error: seccomp.32 already enabled\n");
1387 exit(1);
1388 }
1389 arg_seccomp32 = 1;
1390 cfg.seccomp_list_keep32 = seccomp_check_list(argv[i] + 18);
1391 }
1392 else
1393 exit_err_feature("seccomp");
1394 }
1212 else if (strcmp(argv[i], "--seccomp.block-secondary") == 0) { 1395 else if (strcmp(argv[i], "--seccomp.block-secondary") == 0) {
1213 if (checkcfg(CFG_SECCOMP)) { 1396 if (checkcfg(CFG_SECCOMP)) {
1397 if (arg_seccomp32) {
1398 fprintf(stderr, "Error: seccomp.32 conflicts with block-secondary\n");
1399 exit(1);
1400 }
1214 arg_seccomp_block_secondary = 1; 1401 arg_seccomp_block_secondary = 1;
1215 } 1402 }
1216 else 1403 else
@@ -1222,9 +1409,32 @@ int main(int argc, char **argv) {
1222 else 1409 else
1223 exit_err_feature("seccomp"); 1410 exit_err_feature("seccomp");
1224 } 1411 }
1225#endif 1412 else if (strncmp(argv[i], "--seccomp-error-action=", 23) == 0) {
1226 else if (strcmp(argv[i], "--caps") == 0) 1413 if (checkcfg(CFG_SECCOMP)) {
1414 int config_seccomp_error_action = checkcfg(CFG_SECCOMP_ERROR_ACTION);
1415 if (config_seccomp_error_action == -1) {
1416 if (strcmp(argv[i] + 23, "kill") == 0)
1417 arg_seccomp_error_action = SECCOMP_RET_KILL;
1418 else if (strcmp(argv[i] + 23, "log") == 0)
1419 arg_seccomp_error_action = SECCOMP_RET_LOG;
1420 else {
1421 arg_seccomp_error_action = errno_find_name(argv[i] + 23);
1422 if (arg_seccomp_error_action == -1)
1423 errExit("seccomp-error-action: unknown errno");
1424 }
1425 cfg.seccomp_error_action = strdup(argv[i] + 23);
1426 if (!cfg.seccomp_error_action)
1427 errExit("strdup");
1428 } else
1429 exit_err_feature("seccomp-error-action");
1430
1431 } else
1432 exit_err_feature("seccomp");
1433 }
1434 else if (strcmp(argv[i], "--caps") == 0) {
1227 arg_caps_default_filter = 1; 1435 arg_caps_default_filter = 1;
1436 arg_caps_cmdline = 1;
1437 }
1228 else if (strcmp(argv[i], "--caps.drop=all") == 0) 1438 else if (strcmp(argv[i], "--caps.drop=all") == 0)
1229 arg_caps_drop_all = 1; 1439 arg_caps_drop_all = 1;
1230 else if (strncmp(argv[i], "--caps.drop=", 12) == 0) { 1440 else if (strncmp(argv[i], "--caps.drop=", 12) == 0) {
@@ -1234,6 +1444,7 @@ int main(int argc, char **argv) {
1234 errExit("strdup"); 1444 errExit("strdup");
1235 // verify caps list and exit if problems 1445 // verify caps list and exit if problems
1236 caps_check_list(arg_caps_list, NULL); 1446 caps_check_list(arg_caps_list, NULL);
1447 arg_caps_cmdline = 1;
1237 } 1448 }
1238 else if (strncmp(argv[i], "--caps.keep=", 12) == 0) { 1449 else if (strncmp(argv[i], "--caps.keep=", 12) == 0) {
1239 arg_caps_keep = 1; 1450 arg_caps_keep = 1;
@@ -1242,13 +1453,37 @@ int main(int argc, char **argv) {
1242 errExit("strdup"); 1453 errExit("strdup");
1243 // verify caps list and exit if problems 1454 // verify caps list and exit if problems
1244 caps_check_list(arg_caps_list, NULL); 1455 caps_check_list(arg_caps_list, NULL);
1456 arg_caps_cmdline = 1;
1245 } 1457 }
1246
1247
1248 else if (strcmp(argv[i], "--trace") == 0) 1458 else if (strcmp(argv[i], "--trace") == 0)
1249 arg_trace = 1; 1459 arg_trace = 1;
1460 else if (strncmp(argv[i], "--trace=", 8) == 0) {
1461 arg_trace = 1;
1462 arg_tracefile = argv[i] + 8;
1463 if (*arg_tracefile == '\0') {
1464 fprintf(stderr, "Error: invalid trace option\n");
1465 exit(1);
1466 }
1467 invalid_filename(arg_tracefile, 0); // no globbing
1468 if (strstr(arg_tracefile, "..")) {
1469 fprintf(stderr, "Error: invalid file name %s\n", arg_tracefile);
1470 exit(1);
1471 }
1472 // if the filename starts with ~, expand the home directory
1473 if (*arg_tracefile == '~') {
1474 char *tmp;
1475 if (asprintf(&tmp, "%s%s", cfg.homedir, arg_tracefile + 1) == -1)
1476 errExit("asprintf");
1477 arg_tracefile = tmp;
1478 }
1479 }
1250 else if (strcmp(argv[i], "--tracelog") == 0) 1480 else if (strcmp(argv[i], "--tracelog") == 0)
1251 arg_tracelog = 1; 1481 arg_tracelog = 1;
1482 else if (strncmp(argv[i], "--rlimit-cpu=", 13) == 0) {
1483 check_unsigned(argv[i] + 13, "Error: invalid rlimit");
1484 sscanf(argv[i] + 13, "%llu", &cfg.rlimit_cpu);
1485 arg_rlimit_cpu = 1;
1486 }
1252 else if (strncmp(argv[i], "--rlimit-nofile=", 16) == 0) { 1487 else if (strncmp(argv[i], "--rlimit-nofile=", 16) == 0) {
1253 check_unsigned(argv[i] + 16, "Error: invalid rlimit"); 1488 check_unsigned(argv[i] + 16, "Error: invalid rlimit");
1254 sscanf(argv[i] + 16, "%llu", &cfg.rlimit_nofile); 1489 sscanf(argv[i] + 16, "%llu", &cfg.rlimit_nofile);
@@ -1260,8 +1495,11 @@ int main(int argc, char **argv) {
1260 arg_rlimit_nproc = 1; 1495 arg_rlimit_nproc = 1;
1261 } 1496 }
1262 else if (strncmp(argv[i], "--rlimit-fsize=", 15) == 0) { 1497 else if (strncmp(argv[i], "--rlimit-fsize=", 15) == 0) {
1263 check_unsigned(argv[i] + 15, "Error: invalid rlimit"); 1498 cfg.rlimit_fsize = parse_arg_size(argv[i] + 15);
1264 sscanf(argv[i] + 15, "%llu", &cfg.rlimit_fsize); 1499 if (cfg.rlimit_fsize == 0) {
1500 perror("Error: invalid rlimit-fsize. Only use positive numbers and k, m or g suffix.");
1501 exit(1);
1502 }
1265 arg_rlimit_fsize = 1; 1503 arg_rlimit_fsize = 1;
1266 } 1504 }
1267 else if (strncmp(argv[i], "--rlimit-sigpending=", 20) == 0) { 1505 else if (strncmp(argv[i], "--rlimit-sigpending=", 20) == 0) {
@@ -1269,6 +1507,14 @@ int main(int argc, char **argv) {
1269 sscanf(argv[i] + 20, "%llu", &cfg.rlimit_sigpending); 1507 sscanf(argv[i] + 20, "%llu", &cfg.rlimit_sigpending);
1270 arg_rlimit_sigpending = 1; 1508 arg_rlimit_sigpending = 1;
1271 } 1509 }
1510 else if (strncmp(argv[i], "--rlimit-as=", 12) == 0) {
1511 cfg.rlimit_as = parse_arg_size(argv[i] + 12);
1512 if (cfg.rlimit_as == 0) {
1513 perror("Error: invalid rlimit-as. Only use positive numbers and k, m or g suffix.");
1514 exit(1);
1515 }
1516 arg_rlimit_as = 1;
1517 }
1272 else if (strncmp(argv[i], "--ipc-namespace", 15) == 0) 1518 else if (strncmp(argv[i], "--ipc-namespace", 15) == 0)
1273 arg_ipc = 1; 1519 arg_ipc = 1;
1274 else if (strncmp(argv[i], "--cpu=", 6) == 0) 1520 else if (strncmp(argv[i], "--cpu=", 6) == 0)
@@ -1280,16 +1526,20 @@ int main(int argc, char **argv) {
1280 arg_nice = 1; 1526 arg_nice = 1;
1281 } 1527 }
1282 else if (strncmp(argv[i], "--cgroup=", 9) == 0) { 1528 else if (strncmp(argv[i], "--cgroup=", 9) == 0) {
1283 if (option_cgroup) { 1529 if (checkcfg(CFG_CGROUP)) {
1284 fprintf(stderr, "Error: only a cgroup can be defined\n"); 1530 if (option_cgroup) {
1285 exit(1); 1531 fprintf(stderr, "Error: only a cgroup can be defined\n");
1286 } 1532 exit(1);
1533 }
1287 1534
1288 option_cgroup = 1; 1535 option_cgroup = 1;
1289 cfg.cgroup = strdup(argv[i] + 9); 1536 cfg.cgroup = strdup(argv[i] + 9);
1290 if (!cfg.cgroup) 1537 if (!cfg.cgroup)
1291 errExit("strdup"); 1538 errExit("strdup");
1292 set_cgroup(cfg.cgroup); 1539 set_cgroup(cfg.cgroup);
1540 }
1541 else
1542 exit_err_feature("cgroup");
1293 } 1543 }
1294 1544
1295 //************************************* 1545 //*************************************
@@ -1297,7 +1547,6 @@ int main(int argc, char **argv) {
1297 //************************************* 1547 //*************************************
1298 else if (strcmp(argv[i], "--allusers") == 0) 1548 else if (strcmp(argv[i], "--allusers") == 0)
1299 arg_allusers = 1; 1549 arg_allusers = 1;
1300#ifdef HAVE_BIND
1301 else if (strncmp(argv[i], "--bind=", 7) == 0) { 1550 else if (strncmp(argv[i], "--bind=", 7) == 0) {
1302 if (checkcfg(CFG_BIND)) { 1551 if (checkcfg(CFG_BIND)) {
1303 char *line; 1552 char *line;
@@ -1310,7 +1559,6 @@ int main(int argc, char **argv) {
1310 else 1559 else
1311 exit_err_feature("bind"); 1560 exit_err_feature("bind");
1312 } 1561 }
1313#endif
1314 else if (strncmp(argv[i], "--tmpfs=", 8) == 0) { 1562 else if (strncmp(argv[i], "--tmpfs=", 8) == 0) {
1315 char *line; 1563 char *line;
1316 if (asprintf(&line, "tmpfs %s", argv[i] + 8) == -1) 1564 if (asprintf(&line, "tmpfs %s", argv[i] + 8) == -1)
@@ -1319,6 +1567,8 @@ int main(int argc, char **argv) {
1319 profile_check_line(line, 0, NULL); // will exit if something wrong 1567 profile_check_line(line, 0, NULL); // will exit if something wrong
1320 profile_add(line); 1568 profile_add(line);
1321 } 1569 }
1570
1571 // blacklist/deny
1322 else if (strncmp(argv[i], "--blacklist=", 12) == 0) { 1572 else if (strncmp(argv[i], "--blacklist=", 12) == 0) {
1323 char *line; 1573 char *line;
1324 if (asprintf(&line, "blacklist %s", argv[i] + 12) == -1) 1574 if (asprintf(&line, "blacklist %s", argv[i] + 12) == -1)
@@ -1327,6 +1577,14 @@ int main(int argc, char **argv) {
1327 profile_check_line(line, 0, NULL); // will exit if something wrong 1577 profile_check_line(line, 0, NULL); // will exit if something wrong
1328 profile_add(line); 1578 profile_add(line);
1329 } 1579 }
1580 else if (strncmp(argv[i], "--deny=", 7) == 0) {
1581 char *line;
1582 if (asprintf(&line, "blacklist %s", argv[i] + 7) == -1)
1583 errExit("asprintf");
1584
1585 profile_check_line(line, 0, NULL); // will exit if something wrong
1586 profile_add(line);
1587 }
1330 else if (strncmp(argv[i], "--noblacklist=", 14) == 0) { 1588 else if (strncmp(argv[i], "--noblacklist=", 14) == 0) {
1331 char *line; 1589 char *line;
1332 if (asprintf(&line, "noblacklist %s", argv[i] + 14) == -1) 1590 if (asprintf(&line, "noblacklist %s", argv[i] + 14) == -1)
@@ -1335,19 +1593,31 @@ int main(int argc, char **argv) {
1335 profile_check_line(line, 0, NULL); // will exit if something wrong 1593 profile_check_line(line, 0, NULL); // will exit if something wrong
1336 profile_add(line); 1594 profile_add(line);
1337 } 1595 }
1596 else if (strncmp(argv[i], "--nodeny=", 9) == 0) {
1597 char *line;
1598 if (asprintf(&line, "noblacklist %s", argv[i] + 9) == -1)
1599 errExit("asprintf");
1600
1601 profile_check_line(line, 0, NULL); // will exit if something wrong
1602 profile_add(line);
1603 }
1338 1604
1339#ifdef HAVE_WHITELIST 1605 // whitelist
1340 else if (strncmp(argv[i], "--whitelist=", 12) == 0) { 1606 else if (strncmp(argv[i], "--whitelist=", 12) == 0) {
1341 if (checkcfg(CFG_WHITELIST)) { 1607 char *line;
1342 char *line; 1608 if (asprintf(&line, "whitelist %s", argv[i] + 12) == -1)
1343 if (asprintf(&line, "whitelist %s", argv[i] + 12) == -1) 1609 errExit("asprintf");
1344 errExit("asprintf");
1345 1610
1346 profile_check_line(line, 0, NULL); // will exit if something wrong 1611 profile_check_line(line, 0, NULL); // will exit if something wrong
1347 profile_add(line); 1612 profile_add(line);
1348 } 1613 }
1349 else 1614 else if (strncmp(argv[i], "--allow=", 8) == 0) {
1350 exit_err_feature("whitelist"); 1615 char *line;
1616 if (asprintf(&line, "whitelist %s", argv[i] + 8) == -1)
1617 errExit("asprintf");
1618
1619 profile_check_line(line, 0, NULL); // will exit if something wrong
1620 profile_add(line);
1351 } 1621 }
1352 else if (strncmp(argv[i], "--nowhitelist=", 14) == 0) { 1622 else if (strncmp(argv[i], "--nowhitelist=", 14) == 0) {
1353 char *line; 1623 char *line;
@@ -1357,8 +1627,36 @@ int main(int argc, char **argv) {
1357 profile_check_line(line, 0, NULL); // will exit if something wrong 1627 profile_check_line(line, 0, NULL); // will exit if something wrong
1358 profile_add(line); 1628 profile_add(line);
1359 } 1629 }
1360#endif 1630 else if (strncmp(argv[i], "--noallow=", 10) == 0) {
1631 char *line;
1632 if (asprintf(&line, "nowhitelist %s", argv[i] + 10) == -1)
1633 errExit("asprintf");
1361 1634
1635 profile_check_line(line, 0, NULL); // will exit if something wrong
1636 profile_add(line);
1637 }
1638
1639
1640 else if (strncmp(argv[i], "--mkdir=", 8) == 0) {
1641 char *line;
1642 if (asprintf(&line, "mkdir %s", argv[i] + 8) == -1)
1643 errExit("asprintf");
1644 /* Note: Applied both immediately in profile_check_line()
1645 * and later on via fs_blacklist().
1646 */
1647 profile_check_line(line, 0, NULL);
1648 profile_add(line);
1649 }
1650 else if (strncmp(argv[i], "--mkfile=", 9) == 0) {
1651 char *line;
1652 if (asprintf(&line, "mkfile %s", argv[i] + 9) == -1)
1653 errExit("asprintf");
1654 /* Note: Applied both immediately in profile_check_line()
1655 * and later on via fs_blacklist().
1656 */
1657 profile_check_line(line, 0, NULL);
1658 profile_add(line);
1659 }
1362 else if (strncmp(argv[i], "--read-only=", 12) == 0) { 1660 else if (strncmp(argv[i], "--read-only=", 12) == 0) {
1363 char *line; 1661 char *line;
1364 if (asprintf(&line, "read-only %s", argv[i] + 12) == -1) 1662 if (asprintf(&line, "read-only %s", argv[i] + 12) == -1)
@@ -1388,6 +1686,11 @@ int main(int argc, char **argv) {
1388#ifdef HAVE_OVERLAYFS 1686#ifdef HAVE_OVERLAYFS
1389 else if (strcmp(argv[i], "--overlay") == 0) { 1687 else if (strcmp(argv[i], "--overlay") == 0) {
1390 if (checkcfg(CFG_OVERLAYFS)) { 1688 if (checkcfg(CFG_OVERLAYFS)) {
1689 if (arg_overlay) {
1690 fprintf(stderr, "Error: only one overlay command is allowed\n");
1691 exit(1);
1692 }
1693
1391 if (cfg.chrootdir) { 1694 if (cfg.chrootdir) {
1392 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n"); 1695 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n");
1393 exit(1); 1696 exit(1);
@@ -1412,6 +1715,10 @@ int main(int argc, char **argv) {
1412 } 1715 }
1413 else if (strncmp(argv[i], "--overlay-named=", 16) == 0) { 1716 else if (strncmp(argv[i], "--overlay-named=", 16) == 0) {
1414 if (checkcfg(CFG_OVERLAYFS)) { 1717 if (checkcfg(CFG_OVERLAYFS)) {
1718 if (arg_overlay) {
1719 fprintf(stderr, "Error: only one overlay command is allowed\n");
1720 exit(1);
1721 }
1415 if (cfg.chrootdir) { 1722 if (cfg.chrootdir) {
1416 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n"); 1723 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n");
1417 exit(1); 1724 exit(1);
@@ -1432,7 +1739,7 @@ int main(int argc, char **argv) {
1432 } 1739 }
1433 1740
1434 // check name 1741 // check name
1435 invalid_filename(subdirname); 1742 invalid_filename(subdirname, 0); // no globbing
1436 if (strstr(subdirname, "..") || strstr(subdirname, "/")) { 1743 if (strstr(subdirname, "..") || strstr(subdirname, "/")) {
1437 fprintf(stderr, "Error: invalid overlay name\n"); 1744 fprintf(stderr, "Error: invalid overlay name\n");
1438 exit(1); 1745 exit(1);
@@ -1444,6 +1751,10 @@ int main(int argc, char **argv) {
1444 } 1751 }
1445 else if (strcmp(argv[i], "--overlay-tmpfs") == 0) { 1752 else if (strcmp(argv[i], "--overlay-tmpfs") == 0) {
1446 if (checkcfg(CFG_OVERLAYFS)) { 1753 if (checkcfg(CFG_OVERLAYFS)) {
1754 if (arg_overlay) {
1755 fprintf(stderr, "Error: only one overlay command is allowed\n");
1756 exit(1);
1757 }
1447 if (cfg.chrootdir) { 1758 if (cfg.chrootdir) {
1448 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n"); 1759 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n");
1449 exit(1); 1760 exit(1);
@@ -1459,39 +1770,105 @@ int main(int argc, char **argv) {
1459 exit_err_feature("overlayfs"); 1770 exit_err_feature("overlayfs");
1460 } 1771 }
1461#endif 1772#endif
1462 else if (strncmp(argv[i], "--profile=", 10) == 0) { 1773#ifdef HAVE_FIRETUNNEL
1463 // multiple profile files are allowed! 1774 else if (strcmp(argv[i], "--tunnel") == 0) {
1464 1775 // try to connect to the default client side of the tunnel
1465 if (arg_noprofile) { 1776 // if this fails, try the default server side of the tunnel
1466 fprintf(stderr, "Error: --noprofile and --profile options are mutually exclusive\n"); 1777 if (access("/run/firetunnel/ftc", R_OK) == 0)
1778 profile_read("/run/firetunnel/ftc");
1779 else if (access("/run/firetunnel/fts", R_OK) == 0)
1780 profile_read("/run/firetunnel/fts");
1781 else {
1782 fprintf(stderr, "Error: no default firetunnel found, please specify it using --tunnel=devname option\n");
1467 exit(1); 1783 exit(1);
1468 } 1784 }
1785 }
1786 else if (strncmp(argv[i], "--tunnel=", 9) == 0) {
1787 char *fname;
1469 1788
1470 char *ppath = expand_home(argv[i] + 10, cfg.homedir); 1789 if (asprintf(&fname, "/run/firetunnel/%s", argv[i] + 9) == -1)
1790 errExit("asprintf");
1791 invalid_filename(fname, 0); // no globbing
1792 if (access(fname, R_OK) == 0)
1793 profile_read(fname);
1794 else {
1795 fprintf(stderr, "Error: tunnel not found\n");
1796 exit(1);
1797 }
1798 }
1799#endif
1800 else if (strncmp(argv[i], "--include=", 10) == 0) {
1801 char *ppath = expand_macros(argv[i] + 10);
1471 if (!ppath) 1802 if (!ppath)
1472 errExit("strdup"); 1803 errExit("strdup");
1473 1804
1474 profile_read(ppath); 1805 char *ptr = ppath;
1475 custom_profile = 1; 1806 while (*ptr != '/' && *ptr != '\0')
1807 ptr++;
1808 if (*ptr == '\0') {
1809 if (access(ppath, R_OK)) {
1810 profile_read(ppath);
1811 }
1812 else {
1813 // ppath contains no '/' and is not a local file, assume it's a name
1814 int rv = profile_find_firejail(ppath, 0);
1815 if (!rv) {
1816 fprintf(stderr, "Error: no profile with name \"%s\" found.\n", ppath);
1817 exit(1);
1818 }
1819 }
1820 }
1821 else {
1822 // ppath contains a '/', assume it's a path
1823 profile_read(ppath);
1824 }
1825
1476 free(ppath); 1826 free(ppath);
1477 } 1827 }
1478 else if (strncmp(argv[i], "--profile-path=", 15) == 0) { 1828 else if (strncmp(argv[i], "--profile=", 10) == 0) {
1829 // multiple profile files are allowed!
1830
1479 if (arg_noprofile) { 1831 if (arg_noprofile) {
1480 fprintf(stderr, "Error: --noprofile and --profile-path options are mutually exclusive\n"); 1832 fprintf(stderr, "Error: --noprofile and --profile options are mutually exclusive\n");
1481 exit(1);
1482 }
1483 custom_profile_dir = expand_home(argv[i] + 15, cfg.homedir);
1484 invalid_filename(custom_profile_dir);
1485 if (!is_dir(custom_profile_dir) || is_link(custom_profile_dir) || strstr(custom_profile_dir, "..")) {
1486 fprintf(stderr, "Error: invalid profile path\n");
1487 exit(1); 1833 exit(1);
1488 } 1834 }
1489 1835
1490 // access call checks as real UID/GID, not as effective UID/GID 1836 char *ppath = expand_macros(argv[i] + 10);
1491 if (access(custom_profile_dir, R_OK)) { 1837 if (!ppath)
1492 fprintf(stderr, "Error: cannot access profile directory\n"); 1838 errExit("strdup");
1493 return 1; 1839
1840 // checking for strange chars in the file name, no globbing
1841 invalid_filename(ppath, 0);
1842
1843 if (*ppath == ':' || access(ppath, R_OK) || is_dir(ppath)) {
1844 int has_colon = (*ppath == ':');
1845 char *ptr = ppath;
1846 while (*ptr != '/' && *ptr != '.' && *ptr != '\0')
1847 ptr++;
1848 // profile path contains no / or . chars,
1849 // assume its a profile name
1850 if (*ptr != '\0') {
1851 fprintf(stderr, "Error: inaccessible profile file: %s\n", ppath);
1852 exit(1);
1853 }
1854
1855 // profile was not read in previously, try to see if
1856 // we were given a profile name.
1857 if (!profile_find_firejail(ppath + has_colon, 1)) {
1858 // do not fall through to default profile,
1859 // because the user should be notified that
1860 // given profile arg could not be used.
1861 fprintf(stderr, "Error: no profile with name \"%s\" found.\n", ppath);
1862 exit(1);
1863 }
1864 else
1865 custom_profile = 1;
1494 } 1866 }
1867 else {
1868 profile_read(ppath);
1869 custom_profile = 1;
1870 }
1871 free(ppath);
1495 } 1872 }
1496 else if (strcmp(argv[i], "--noprofile") == 0) { 1873 else if (strcmp(argv[i], "--noprofile") == 0) {
1497 if (custom_profile) { 1874 if (custom_profile) {
@@ -1499,31 +1876,15 @@ int main(int argc, char **argv) {
1499 exit(1); 1876 exit(1);
1500 } 1877 }
1501 arg_noprofile = 1; 1878 arg_noprofile = 1;
1879 // force keep-config-pulse in order to keep ~/.config/pulse as is
1880 arg_keep_config_pulse = 1;
1502 } 1881 }
1503 else if (strncmp(argv[i], "--ignore=", 9) == 0) { 1882 else if (strncmp(argv[i], "--ignore=", 9) == 0) {
1504 if (custom_profile) { 1883 if (custom_profile) {
1505 fprintf(stderr, "Error: please use --profile after --ignore\n"); 1884 fprintf(stderr, "Error: please use --profile after --ignore\n");
1506 exit(1); 1885 exit(1);
1507 } 1886 }
1508 1887 profile_add_ignore(argv[i] + 9);
1509 if (*(argv[i] + 9) == '\0') {
1510 fprintf(stderr, "Error: invalid ignore option\n");
1511 exit(1);
1512 }
1513
1514 // find an empty entry in profile_ignore array
1515 int j;
1516 for (j = 0; j < MAX_PROFILE_IGNORE; j++) {
1517 if (cfg.profile_ignore[j] == NULL)
1518 break;
1519 }
1520 if (j >= MAX_PROFILE_IGNORE) {
1521 fprintf(stderr, "Error: maximum %d --ignore options are permitted\n", MAX_PROFILE_IGNORE);
1522 exit(1);
1523 }
1524 // ... and configure it
1525 else
1526 cfg.profile_ignore[j] = argv[i] + 9;
1527 } 1888 }
1528#ifdef HAVE_CHROOT 1889#ifdef HAVE_CHROOT
1529 else if (strncmp(argv[i], "--chroot=", 9) == 0) { 1890 else if (strncmp(argv[i], "--chroot=", 9) == 0) {
@@ -1538,12 +1899,14 @@ int main(int argc, char **argv) {
1538 fprintf(stderr, "Error: --chroot option is not available on Grsecurity systems\n"); 1899 fprintf(stderr, "Error: --chroot option is not available on Grsecurity systems\n");
1539 exit(1); 1900 exit(1);
1540 } 1901 }
1541
1542
1543 invalid_filename(argv[i] + 9);
1544
1545 // extract chroot dirname 1902 // extract chroot dirname
1546 cfg.chrootdir = argv[i] + 9; 1903 cfg.chrootdir = argv[i] + 9;
1904 if (*cfg.chrootdir == '\0') {
1905 fprintf(stderr, "Error: invalid chroot option\n");
1906 exit(1);
1907 }
1908 invalid_filename(cfg.chrootdir, 0); // no globbing
1909
1547 // if the directory starts with ~, expand the home directory 1910 // if the directory starts with ~, expand the home directory
1548 if (*cfg.chrootdir == '~') { 1911 if (*cfg.chrootdir == '~') {
1549 char *tmp; 1912 char *tmp;
@@ -1551,23 +1914,8 @@ int main(int argc, char **argv) {
1551 errExit("asprintf"); 1914 errExit("asprintf");
1552 cfg.chrootdir = tmp; 1915 cfg.chrootdir = tmp;
1553 } 1916 }
1554 1917 // check chroot directory
1555 // check chroot dirname exists 1918 fs_check_chroot_dir();
1556 if (strstr(cfg.chrootdir, "..") || !is_dir(cfg.chrootdir) || is_link(cfg.chrootdir)) {
1557 fprintf(stderr, "Error: invalid directory %s\n", cfg.chrootdir);
1558 return 1;
1559 }
1560
1561 // don't allow "--chroot=/"
1562 char *rpath = realpath(cfg.chrootdir, NULL);
1563 if (rpath == NULL || strcmp(rpath, "/") == 0) {
1564 fprintf(stderr, "Error: invalid chroot directory\n");
1565 exit(1);
1566 }
1567 cfg.chrootdir = rpath;
1568
1569 // check chroot directory structure
1570 fs_check_chroot_dir(cfg.chrootdir);
1571 } 1919 }
1572 else 1920 else
1573 exit_err_feature("chroot"); 1921 exit_err_feature("chroot");
@@ -1580,9 +1928,15 @@ int main(int argc, char **argv) {
1580 } 1928 }
1581 arg_writable_etc = 1; 1929 arg_writable_etc = 1;
1582 } 1930 }
1931 else if (strcmp(argv[i], "--keep-config-pulse") == 0) {
1932 arg_keep_config_pulse = 1;
1933 }
1583 else if (strcmp(argv[i], "--writable-var") == 0) { 1934 else if (strcmp(argv[i], "--writable-var") == 0) {
1584 arg_writable_var = 1; 1935 arg_writable_var = 1;
1585 } 1936 }
1937 else if (strcmp(argv[i], "--keep-var-tmp") == 0) {
1938 arg_keep_var_tmp = 1;
1939 }
1586 else if (strcmp(argv[i], "--writable-run-user") == 0) { 1940 else if (strcmp(argv[i], "--writable-run-user") == 0) {
1587 arg_writable_run_user = 1; 1941 arg_writable_run_user = 1;
1588 } 1942 }
@@ -1592,9 +1946,6 @@ int main(int argc, char **argv) {
1592 else if (strcmp(argv[i], "--machine-id") == 0) { 1946 else if (strcmp(argv[i], "--machine-id") == 0) {
1593 arg_machineid = 1; 1947 arg_machineid = 1;
1594 } 1948 }
1595 else if (strcmp(argv[i], "--allow-private-blacklist") == 0) {
1596 arg_allow_private_blacklist = 1;
1597 }
1598 else if (strcmp(argv[i], "--private") == 0) { 1949 else if (strcmp(argv[i], "--private") == 0) {
1599 arg_private = 1; 1950 arg_private = 1;
1600 } 1951 }
@@ -1646,62 +1997,81 @@ int main(int argc, char **argv) {
1646 else if (strcmp(argv[i], "--private-dev") == 0) { 1997 else if (strcmp(argv[i], "--private-dev") == 0) {
1647 arg_private_dev = 1; 1998 arg_private_dev = 1;
1648 } 1999 }
2000 else if (strcmp(argv[i], "--keep-dev-shm") == 0) {
2001 arg_keep_dev_shm = 1;
2002 }
1649 else if (strncmp(argv[i], "--private-etc=", 14) == 0) { 2003 else if (strncmp(argv[i], "--private-etc=", 14) == 0) {
1650 if (arg_writable_etc) { 2004 if (checkcfg(CFG_PRIVATE_ETC)) {
1651 fprintf(stderr, "Error: --private-etc and --writable-etc are mutually exclusive\n"); 2005 if (arg_writable_etc) {
1652 exit(1); 2006 fprintf(stderr, "Error: --private-etc and --writable-etc are mutually exclusive\n");
1653 } 2007 exit(1);
2008 }
1654 2009
1655 // extract private etc list 2010 // extract private etc list
1656 if (*(argv[i] + 14) == '\0') { 2011 if (*(argv[i] + 14) == '\0') {
1657 fprintf(stderr, "Error: invalid private-etc option\n"); 2012 fprintf(stderr, "Error: invalid private-etc option\n");
1658 exit(1); 2013 exit(1);
2014 }
2015 if (cfg.etc_private_keep) {
2016 if ( asprintf(&cfg.etc_private_keep, "%s,%s", cfg.etc_private_keep, argv[i] + 14) < 0 )
2017 errExit("asprintf");
2018 } else
2019 cfg.etc_private_keep = argv[i] + 14;
2020 arg_private_etc = 1;
1659 } 2021 }
1660 if (cfg.etc_private_keep) { 2022 else
1661 if ( asprintf(&cfg.etc_private_keep, "%s,%s", cfg.etc_private_keep, argv[i] + 14) < 0 ) 2023 exit_err_feature("private-etc");
1662 errExit("asprintf");
1663 } else
1664 cfg.etc_private_keep = argv[i] + 14;
1665 arg_private_etc = 1;
1666 } 2024 }
1667 else if (strncmp(argv[i], "--private-opt=", 14) == 0) { 2025 else if (strncmp(argv[i], "--private-opt=", 14) == 0) {
1668 // extract private opt list 2026 if (checkcfg(CFG_PRIVATE_OPT)) {
1669 if (*(argv[i] + 14) == '\0') { 2027 // extract private opt list
1670 fprintf(stderr, "Error: invalid private-opt option\n"); 2028 if (*(argv[i] + 14) == '\0') {
1671 exit(1); 2029 fprintf(stderr, "Error: invalid private-opt option\n");
2030 exit(1);
2031 }
2032 if (cfg.opt_private_keep) {
2033 if ( asprintf(&cfg.opt_private_keep, "%s,%s", cfg.opt_private_keep, argv[i] + 14) < 0 )
2034 errExit("asprintf");
2035 } else
2036 cfg.opt_private_keep = argv[i] + 14;
2037 arg_private_opt = 1;
1672 } 2038 }
1673 if (cfg.opt_private_keep) { 2039 else
1674 if ( asprintf(&cfg.opt_private_keep, "%s,%s", cfg.opt_private_keep, argv[i] + 14) < 0 ) 2040 exit_err_feature("private-opt");
1675 errExit("asprintf");
1676 } else
1677 cfg.opt_private_keep = argv[i] + 14;
1678 arg_private_opt = 1;
1679 } 2041 }
1680 else if (strncmp(argv[i], "--private-srv=", 14) == 0) { 2042 else if (strncmp(argv[i], "--private-srv=", 14) == 0) {
1681 // extract private srv list 2043 if (checkcfg(CFG_PRIVATE_SRV)) {
1682 if (*(argv[i] + 14) == '\0') { 2044 // extract private srv list
1683 fprintf(stderr, "Error: invalid private-etc option\n"); 2045 if (*(argv[i] + 14) == '\0') {
1684 exit(1); 2046 fprintf(stderr, "Error: invalid private-srv option\n");
2047 exit(1);
2048 }
2049 if (cfg.srv_private_keep) {
2050 if ( asprintf(&cfg.srv_private_keep, "%s,%s", cfg.srv_private_keep, argv[i] + 14) < 0 )
2051 errExit("asprintf");
2052 } else
2053 cfg.srv_private_keep = argv[i] + 14;
2054 arg_private_srv = 1;
1685 } 2055 }
1686 if (cfg.srv_private_keep) { 2056 else
1687 if ( asprintf(&cfg.srv_private_keep, "%s,%s", cfg.srv_private_keep, argv[i] + 14) < 0 ) 2057 exit_err_feature("private-srv");
1688 errExit("asprintf");
1689 } else
1690 cfg.srv_private_keep = argv[i] + 14;
1691 arg_private_srv = 1;
1692 } 2058 }
1693 else if (strncmp(argv[i], "--private-bin=", 14) == 0) { 2059 else if (strncmp(argv[i], "--private-bin=", 14) == 0) {
1694 // extract private bin list 2060 if (checkcfg(CFG_PRIVATE_BIN)) {
1695 if (*(argv[i] + 14) == '\0') { 2061 // extract private bin list
1696 fprintf(stderr, "Error: invalid private-bin option\n"); 2062 if (*(argv[i] + 14) == '\0') {
1697 exit(1); 2063 fprintf(stderr, "Error: invalid private-bin option\n");
2064 exit(1);
2065 }
2066 if (cfg.bin_private_keep) {
2067 if ( asprintf(&cfg.bin_private_keep, "%s,%s", cfg.bin_private_keep, argv[i] + 14) < 0 )
2068 errExit("asprintf");
2069 } else
2070 cfg.bin_private_keep = argv[i] + 14;
2071 arg_private_bin = 1;
1698 } 2072 }
1699 if (cfg.bin_private_keep) { 2073 else
1700 if ( asprintf(&cfg.bin_private_keep, "%s,%s", cfg.bin_private_keep, argv[i] + 14) < 0 ) 2074 exit_err_feature("private-bin");
1701 errExit("asprintf");
1702 } else
1703 cfg.bin_private_keep = argv[i] + 14;
1704 arg_private_bin = 1;
1705 } 2075 }
1706 else if (strncmp(argv[i], "--private-lib", 13) == 0) { 2076 else if (strncmp(argv[i], "--private-lib", 13) == 0) {
1707 if (checkcfg(CFG_PRIVATE_LIB)) { 2077 if (checkcfg(CFG_PRIVATE_LIB)) {
@@ -1721,6 +2091,27 @@ int main(int argc, char **argv) {
1721 else if (strcmp(argv[i], "--private-tmp") == 0) { 2091 else if (strcmp(argv[i], "--private-tmp") == 0) {
1722 arg_private_tmp = 1; 2092 arg_private_tmp = 1;
1723 } 2093 }
2094#ifdef HAVE_USERTMPFS
2095 else if (strcmp(argv[i], "--private-cache") == 0) {
2096 if (checkcfg(CFG_PRIVATE_CACHE))
2097 arg_private_cache = 1;
2098 else
2099 exit_err_feature("private-cache");
2100 }
2101#endif
2102 else if (strcmp(argv[i], "--private-cwd") == 0) {
2103 cfg.cwd = NULL;
2104 arg_private_cwd = 1;
2105 }
2106 else if (strncmp(argv[i], "--private-cwd=", 14) == 0) {
2107 if (*(argv[i] + 14) == '\0') {
2108 fprintf(stderr, "Error: invalid private-cwd option\n");
2109 exit(1);
2110 }
2111
2112 fs_check_private_cwd(argv[i] + 14);
2113 arg_private_cwd = 1;
2114 }
1724 2115
1725 //************************************* 2116 //*************************************
1726 // hostname, etc 2117 // hostname, etc
@@ -1757,6 +2148,8 @@ int main(int argc, char **argv) {
1757 env_store(argv[i] + 8, RMENV); 2148 env_store(argv[i] + 8, RMENV);
1758 else if (strcmp(argv[i], "--nosound") == 0) 2149 else if (strcmp(argv[i], "--nosound") == 0)
1759 arg_nosound = 1; 2150 arg_nosound = 1;
2151 else if (strcmp(argv[i], "--noautopulse") == 0)
2152 arg_keep_config_pulse = 1;
1760 else if (strcmp(argv[i], "--novideo") == 0) 2153 else if (strcmp(argv[i], "--novideo") == 0)
1761 arg_novideo = 1; 2154 arg_novideo = 1;
1762 else if (strcmp(argv[i], "--no3d") == 0) 2155 else if (strcmp(argv[i], "--no3d") == 0)
@@ -1765,26 +2158,176 @@ int main(int argc, char **argv) {
1765 arg_notv = 1; 2158 arg_notv = 1;
1766 else if (strcmp(argv[i], "--nodvd") == 0) 2159 else if (strcmp(argv[i], "--nodvd") == 0)
1767 arg_nodvd = 1; 2160 arg_nodvd = 1;
2161 else if (strcmp(argv[i], "--nou2f") == 0)
2162 arg_nou2f = 1;
2163 else if (strcmp(argv[i], "--noinput") == 0)
2164 arg_noinput = 1;
2165 else if (strcmp(argv[i], "--nodbus") == 0) {
2166 arg_dbus_user = DBUS_POLICY_BLOCK;
2167 arg_dbus_system = DBUS_POLICY_BLOCK;
2168 }
1768 2169
1769 //************************************* 2170 //*************************************
1770 // network 2171 // D-BUS proxy
1771 //************************************* 2172 //*************************************
1772#ifdef HAVE_NETWORK 2173#ifdef HAVE_DBUSPROXY
1773 else if (strncmp(argv[i], "--interface=", 12) == 0) { 2174 else if (strncmp("--dbus-user=", argv[i], 12) == 0) {
1774 if (checkcfg(CFG_NETWORK)) { 2175 if (strcmp("filter", argv[i] + 12) == 0) {
1775#ifdef HAVE_NETWORK_RESTRICTED 2176 if (arg_dbus_user == DBUS_POLICY_BLOCK) {
1776 // compile time restricted networking 2177 fprintf(stderr, "Warning: Cannot relax --dbus-user policy, it is already set to block\n");
1777 if (getuid() != 0) { 2178 } else {
1778 fprintf(stderr, "Error: --interface is allowed only to root user\n"); 2179 arg_dbus_user = DBUS_POLICY_FILTER;
2180 }
2181 } else if (strcmp("none", argv[i] + 12) == 0) {
2182 if (arg_dbus_log_user) {
2183 fprintf(stderr, "Error: --dbus-user.log requires --dbus-user=filter\n");
1779 exit(1); 2184 exit(1);
1780 } 2185 }
1781#endif 2186 arg_dbus_user = DBUS_POLICY_BLOCK;
1782 // run time restricted networking 2187 } else {
1783 if (checkcfg(CFG_RESTRICTED_NETWORK) && getuid() != 0) { 2188 fprintf(stderr, "Unknown dbus-user policy: %s\n", argv[i] + 12);
1784 fprintf(stderr, "Error: --interface is allowed only to root user\n"); 2189 exit(1);
2190 }
2191 }
2192 else if (strncmp(argv[i], "--dbus-user.see=", 16) == 0) {
2193 char *line;
2194 if (asprintf(&line, "dbus-user.see %s", argv[i] + 16) == -1)
2195 errExit("asprintf");
2196
2197 profile_check_line(line, 0, NULL); // will exit if something wrong
2198 profile_add(line);
2199 }
2200 else if (strncmp(argv[i], "--dbus-user.talk=", 17) == 0) {
2201 char *line;
2202 if (asprintf(&line, "dbus-user.talk %s", argv[i] + 17) == -1)
2203 errExit("asprintf");
2204
2205 profile_check_line(line, 0, NULL); // will exit if something wrong
2206 profile_add(line);
2207 }
2208 else if (strncmp(argv[i], "--dbus-user.own=", 16) == 0) {
2209 char *line;
2210 if (asprintf(&line, "dbus-user.own %s", argv[i] + 16) == -1)
2211 errExit("asprintf");
2212
2213 profile_check_line(line, 0, NULL); // will exit if something wrong
2214 profile_add(line);
2215 }
2216 else if (strncmp(argv[i], "--dbus-user.call=", 17) == 0) {
2217 char *line;
2218 if (asprintf(&line, "dbus-user.call %s", argv[i] + 17) == -1)
2219 errExit("asprintf");
2220
2221 profile_check_line(line, 0, NULL); // will exit if something wrong
2222 profile_add(line);
2223 }
2224 else if (strncmp(argv[i], "--dbus-user.broadcast=", 22) == 0) {
2225 char *line;
2226 if (asprintf(&line, "dbus-user.broadcast %s", argv[i] + 22) == -1)
2227 errExit("asprintf");
2228
2229 profile_check_line(line, 0, NULL); // will exit if something wrong
2230 profile_add(line);
2231 }
2232 else if (strncmp("--dbus-system=", argv[i], 14) == 0) {
2233 if (strcmp("filter", argv[i] + 14) == 0) {
2234 if (arg_dbus_system == DBUS_POLICY_BLOCK) {
2235 fprintf(stderr, "Warning: Cannot relax --dbus-system policy, it is already set to block\n");
2236 } else {
2237 arg_dbus_system = DBUS_POLICY_FILTER;
2238 }
2239 } else if (strcmp("none", argv[i] + 14) == 0) {
2240 if (arg_dbus_log_system) {
2241 fprintf(stderr, "Error: --dbus-system.log requires --dbus-system=filter\n");
1785 exit(1); 2242 exit(1);
1786 } 2243 }
2244 arg_dbus_system = DBUS_POLICY_BLOCK;
2245 } else {
2246 fprintf(stderr, "Unknown dbus-system policy: %s\n", argv[i] + 14);
2247 exit(1);
2248 }
2249 }
2250 else if (strncmp(argv[i], "--dbus-system.see=", 18) == 0) {
2251 char *line;
2252 if (asprintf(&line, "dbus-system.see %s", argv[i] + 18) == -1)
2253 errExit("asprintf");
2254
2255 profile_check_line(line, 0, NULL); // will exit if something wrong
2256 profile_add(line);
2257 }
2258 else if (strncmp(argv[i], "--dbus-system.talk=", 19) == 0) {
2259 char *line;
2260 if (asprintf(&line, "dbus-system.talk %s", argv[i] + 19) == -1)
2261 errExit("asprintf");
2262
2263 profile_check_line(line, 0, NULL); // will exit if something wrong
2264 profile_add(line);
2265 }
2266 else if (strncmp(argv[i], "--dbus-system.own=", 18) == 0) {
2267 char *line;
2268 if (asprintf(&line, "dbus-system.own %s", argv[i] + 18) == -1)
2269 errExit("asprintf");
2270
2271 profile_check_line(line, 0, NULL); // will exit if something wrong
2272 profile_add(line);
2273 }
2274 else if (strncmp(argv[i], "--dbus-system.call=", 19) == 0) {
2275 char *line;
2276 if (asprintf(&line, "dbus-system.call %s", argv[i] + 19) == -1)
2277 errExit("asprintf");
2278
2279 profile_check_line(line, 0, NULL); // will exit if something wrong
2280 profile_add(line);
2281 }
2282 else if (strncmp(argv[i], "--dbus-system.broadcast=", 24) == 0) {
2283 char *line;
2284 if (asprintf(&line, "dbus-system.broadcast %s", argv[i] + 24) == -1)
2285 errExit("asprintf");
1787 2286
2287 profile_check_line(line, 0, NULL); // will exit if something wrong
2288 profile_add(line);
2289 }
2290 else if (strncmp(argv[i], "--dbus-log=", 11) == 0) {
2291 if (arg_dbus_log_file != NULL) {
2292 fprintf(stderr, "Error: --dbus-log option already specified\n");
2293 exit(1);
2294 }
2295 arg_dbus_log_file = argv[i] + 11;
2296 }
2297 else if (strcmp(argv[i], "--dbus-user.log") == 0) {
2298 if (arg_dbus_user != DBUS_POLICY_FILTER) {
2299 fprintf(stderr, "Error: --dbus-user.log requires --dbus-user=filter\n");
2300 exit(1);
2301 }
2302 arg_dbus_log_user = 1;
2303 }
2304 else if (strcmp(argv[i], "--dbus-system.log") == 0) {
2305 if (arg_dbus_system != DBUS_POLICY_FILTER) {
2306 fprintf(stderr, "Error: --dbus-system.log requires --dbus-system=filter\n");
2307 exit(1);
2308 }
2309 arg_dbus_log_system = 1;
2310 }
2311#endif
2312
2313 //*************************************
2314 // network
2315 //*************************************
2316 else if (strcmp(argv[i], "--net=none") == 0) {
2317 arg_nonetwork = 1;
2318 cfg.bridge0.configured = 0;
2319 cfg.bridge1.configured = 0;
2320 cfg.bridge2.configured = 0;
2321 cfg.bridge3.configured = 0;
2322 cfg.interface0.configured = 0;
2323 cfg.interface1.configured = 0;
2324 cfg.interface2.configured = 0;
2325 cfg.interface3.configured = 0;
2326 continue;
2327 }
2328#ifdef HAVE_NETWORK
2329 else if (strncmp(argv[i], "--interface=", 12) == 0) {
2330 if (checkcfg(CFG_NETWORK)) {
1788 // checks 2331 // checks
1789 if (arg_nonetwork) { 2332 if (arg_nonetwork) {
1790 fprintf(stderr, "Error: --network=none and --interface are incompatible\n"); 2333 fprintf(stderr, "Error: --network=none and --interface are incompatible\n");
@@ -1842,18 +2385,6 @@ int main(int argc, char **argv) {
1842 continue; 2385 continue;
1843 } 2386 }
1844 2387
1845#ifdef HAVE_NETWORK_RESTRICTED
1846 // compile time restricted networking
1847 if (getuid() != 0) {
1848 fprintf(stderr, "Error: only --net=none is allowed to non-root users\n");
1849 exit(1);
1850 }
1851#endif
1852 // run time restricted networking
1853 if (checkcfg(CFG_RESTRICTED_NETWORK) && getuid() != 0) {
1854 fprintf(stderr, "Error: only --net=none is allowed to non-root users\n");
1855 exit(1);
1856 }
1857 if (strcmp(argv[i] + 6, "lo") == 0) { 2388 if (strcmp(argv[i] + 6, "lo") == 0) {
1858 fprintf(stderr, "Error: cannot attach to lo device\n"); 2389 fprintf(stderr, "Error: cannot attach to lo device\n");
1859 exit(1); 2390 exit(1);
@@ -1872,7 +2403,8 @@ int main(int argc, char **argv) {
1872 fprintf(stderr, "Error: maximum 4 network devices are allowed\n"); 2403 fprintf(stderr, "Error: maximum 4 network devices are allowed\n");
1873 return 1; 2404 return 1;
1874 } 2405 }
1875 net_configure_bridge(br, argv[i] + 6); 2406 br->dev = argv[i] + 6;
2407 br->configured = 1;
1876 } 2408 }
1877 else 2409 else
1878 exit_err_feature("networking"); 2410 exit_err_feature("networking");
@@ -1937,10 +2469,6 @@ int main(int argc, char **argv) {
1937 fprintf(stderr, "Error: invalid IP range\n"); 2469 fprintf(stderr, "Error: invalid IP range\n");
1938 return 1; 2470 return 1;
1939 } 2471 }
1940 if (in_netrange(br->iprange_start, br->ip, br->mask) || in_netrange(br->iprange_end, br->ip, br->mask)) {
1941 fprintf(stderr, "Error: IP range addresses not in network range\n");
1942 return 1;
1943 }
1944 } 2472 }
1945 else 2473 else
1946 exit_err_feature("networking"); 2474 exit_err_feature("networking");
@@ -1963,6 +2491,13 @@ int main(int argc, char **argv) {
1963 fprintf(stderr, "Error: invalid MAC address\n"); 2491 fprintf(stderr, "Error: invalid MAC address\n");
1964 exit(1); 2492 exit(1);
1965 } 2493 }
2494
2495 // check multicast address
2496 if (br->macsandbox[0] & 1) {
2497 fprintf(stderr, "Error: invalid MAC address (multicast)\n");
2498 exit(1);
2499 }
2500
1966 } 2501 }
1967 else 2502 else
1968 exit_err_feature("networking"); 2503 exit_err_feature("networking");
@@ -2000,7 +2535,10 @@ int main(int argc, char **argv) {
2000 // configure this IP address for the last bridge defined 2535 // configure this IP address for the last bridge defined
2001 if (strcmp(argv[i] + 5, "none") == 0) 2536 if (strcmp(argv[i] + 5, "none") == 0)
2002 br->arg_ip_none = 1; 2537 br->arg_ip_none = 1;
2003 else { 2538 else if (strcmp(argv[i] + 5, "dhcp") == 0) {
2539 br->arg_ip_none = 1;
2540 br->arg_ip_dhcp = 1;
2541 } else {
2004 if (atoip(argv[i] + 5, &br->ipsandbox)) { 2542 if (atoip(argv[i] + 5, &br->ipsandbox)) {
2005 fprintf(stderr, "Error: invalid IP address\n"); 2543 fprintf(stderr, "Error: invalid IP address\n");
2006 exit(1); 2544 exit(1);
@@ -2011,6 +2549,28 @@ int main(int argc, char **argv) {
2011 exit_err_feature("networking"); 2549 exit_err_feature("networking");
2012 } 2550 }
2013 2551
2552 else if (strncmp(argv[i], "--netmask=", 10) == 0) {
2553 if (checkcfg(CFG_NETWORK)) {
2554 Bridge *br = last_bridge_configured();
2555 if (br == NULL) {
2556 fprintf(stderr, "Error: no network device configured\n");
2557 exit(1);
2558 }
2559 if (br->arg_ip_none || br->mask) {
2560 fprintf(stderr, "Error: cannot configure the network mask twice for the same interface\n");
2561 exit(1);
2562 }
2563
2564 // configure this network mask for the last bridge defined
2565 if (atoip(argv[i] + 10, &br->mask)) {
2566 fprintf(stderr, "Error: invalid network mask\n");
2567 exit(1);
2568 }
2569 }
2570 else
2571 exit_err_feature("networking");
2572 }
2573
2014 else if (strncmp(argv[i], "--ip6=", 6) == 0) { 2574 else if (strncmp(argv[i], "--ip6=", 6) == 0) {
2015 if (checkcfg(CFG_NETWORK)) { 2575 if (checkcfg(CFG_NETWORK)) {
2016 Bridge *br = last_bridge_configured(); 2576 Bridge *br = last_bridge_configured();
@@ -2018,18 +2578,24 @@ int main(int argc, char **argv) {
2018 fprintf(stderr, "Error: no network device configured\n"); 2578 fprintf(stderr, "Error: no network device configured\n");
2019 exit(1); 2579 exit(1);
2020 } 2580 }
2021 if (br->arg_ip_none || br->ip6sandbox) { 2581 if (br->arg_ip6_dhcp || br->ip6sandbox) {
2022 fprintf(stderr, "Error: cannot configure the IP address twice for the same interface\n"); 2582 fprintf(stderr, "Error: cannot configure the IP address twice for the same interface\n");
2023 exit(1); 2583 exit(1);
2024 } 2584 }
2025 2585
2026 // configure this IP address for the last bridge defined 2586 // configure this IP address for the last bridge defined
2027 // todo: verify ipv6 syntax 2587 if (strcmp(argv[i] + 6, "dhcp") == 0)
2028 br->ip6sandbox = argv[i] + 6; 2588 br->arg_ip6_dhcp = 1;
2029// if (atoip(argv[i] + 5, &br->ipsandbox)) { 2589 else {
2030// fprintf(stderr, "Error: invalid IP address\n"); 2590 if (check_ip46_address(argv[i] + 6) == 0) {
2031// exit(1); 2591 fprintf(stderr, "Error: invalid IPv6 address\n");
2032// } 2592 exit(1);
2593 }
2594
2595 br->ip6sandbox = strdup(argv[i] + 6);
2596 if (br->ip6sandbox == NULL)
2597 errExit("strdup");
2598 }
2033 } 2599 }
2034 else 2600 else
2035 exit_err_feature("networking"); 2601 exit_err_feature("networking");
@@ -2048,21 +2614,25 @@ int main(int argc, char **argv) {
2048 } 2614 }
2049#endif 2615#endif
2050 else if (strncmp(argv[i], "--dns=", 6) == 0) { 2616 else if (strncmp(argv[i], "--dns=", 6) == 0) {
2051 uint32_t dns; 2617 if (check_ip46_address(argv[i] + 6) == 0) {
2052 if (atoip(argv[i] + 6, &dns)) { 2618 fprintf(stderr, "Error: invalid DNS server IPv4 or IPv6 address\n");
2053 fprintf(stderr, "Error: invalid DNS server IP address\n"); 2619 exit(1);
2054 return 1;
2055 } 2620 }
2621 char *dns = strdup(argv[i] + 6);
2622 if (!dns)
2623 errExit("strdup");
2056 2624
2057 if (cfg.dns1 == 0) 2625 if (cfg.dns1 == NULL)
2058 cfg.dns1 = dns; 2626 cfg.dns1 = dns;
2059 else if (cfg.dns2 == 0) 2627 else if (cfg.dns2 == NULL)
2060 cfg.dns2 = dns; 2628 cfg.dns2 = dns;
2061 else if (cfg.dns3 == 0) 2629 else if (cfg.dns3 == NULL)
2062 cfg.dns3 = dns; 2630 cfg.dns3 = dns;
2631 else if (cfg.dns4 == NULL)
2632 cfg.dns4 = dns;
2063 else { 2633 else {
2064 fprintf(stderr, "Error: up to 3 DNS servers can be specified\n"); 2634 fwarning("Warning: up to 4 DNS servers can be specified, %s ignored\n", dns);
2065 return 1; 2635 free(dns);
2066 } 2636 }
2067 } 2637 }
2068 2638
@@ -2071,18 +2641,6 @@ int main(int argc, char **argv) {
2071 2641
2072#ifdef HAVE_NETWORK 2642#ifdef HAVE_NETWORK
2073 else if (strcmp(argv[i], "--netfilter") == 0) { 2643 else if (strcmp(argv[i], "--netfilter") == 0) {
2074#ifdef HAVE_NETWORK_RESTRICTED
2075 // compile time restricted networking
2076 if (getuid() != 0) {
2077 fprintf(stderr, "Error: --netfilter is only allowed for root\n");
2078 exit(1);
2079 }
2080#endif
2081 // run time restricted networking
2082 if (checkcfg(CFG_RESTRICTED_NETWORK) && getuid() != 0) {
2083 fprintf(stderr, "Error: --netfilter is only allowed for root\n");
2084 exit(1);
2085 }
2086 if (checkcfg(CFG_NETWORK)) { 2644 if (checkcfg(CFG_NETWORK)) {
2087 arg_netfilter = 1; 2645 arg_netfilter = 1;
2088 } 2646 }
@@ -2091,18 +2649,6 @@ int main(int argc, char **argv) {
2091 } 2649 }
2092 2650
2093 else if (strncmp(argv[i], "--netfilter=", 12) == 0) { 2651 else if (strncmp(argv[i], "--netfilter=", 12) == 0) {
2094#ifdef HAVE_NETWORK_RESTRICTED
2095 // compile time restricted networking
2096 if (getuid() != 0) {
2097 fprintf(stderr, "Error: --netfilter is only allowed for root\n");
2098 exit(1);
2099 }
2100#endif
2101 // run time restricted networking
2102 if (checkcfg(CFG_RESTRICTED_NETWORK) && getuid() != 0) {
2103 fprintf(stderr, "Error: --netfilter is only allowed for root\n");
2104 exit(1);
2105 }
2106 if (checkcfg(CFG_NETWORK)) { 2652 if (checkcfg(CFG_NETWORK)) {
2107 arg_netfilter = 1; 2653 arg_netfilter = 1;
2108 arg_netfilter_file = argv[i] + 12; 2654 arg_netfilter_file = argv[i] + 12;
@@ -2134,50 +2680,10 @@ int main(int argc, char **argv) {
2134 //************************************* 2680 //*************************************
2135 // command 2681 // command
2136 //************************************* 2682 //*************************************
2137 else if (strcmp(argv[i], "--audit") == 0) { 2683 else if (strncmp(argv[i], "--timeout=", 10) == 0)
2138 arg_audit_prog = LIBDIR "/firejail/faudit"; 2684 cfg.timeout = extract_timeout(argv[i] + 10);
2139 arg_audit = 1; 2685 else if (strcmp(argv[i], "--appimage") == 0) {
2140 } 2686 // already handled
2141 else if (strncmp(argv[i], "--audit=", 8) == 0) {
2142 if (strlen(argv[i] + 8) == 0) {
2143 fprintf(stderr, "Error: invalid audit program\n");
2144 exit(1);
2145 }
2146 arg_audit_prog = strdup(argv[i] + 8);
2147 if (!arg_audit_prog)
2148 errExit("strdup");
2149
2150 struct stat s;
2151 if (stat(arg_audit_prog, &s) != 0) {
2152 fprintf(stderr, "Error: cannot find the audit program %s\n", arg_audit_prog);
2153 exit(1);
2154 }
2155 arg_audit = 1;
2156 }
2157 else if (strcmp(argv[i], "--appimage") == 0)
2158 arg_appimage = 1;
2159 else if (strcmp(argv[i], "--csh") == 0) {
2160 if (arg_shell_none) {
2161
2162 fprintf(stderr, "Error: --shell=none was already specified.\n");
2163 return 1;
2164 }
2165 if (cfg.shell) {
2166 fprintf(stderr, "Error: only one default user shell can be specified\n");
2167 return 1;
2168 }
2169 cfg.shell = "/bin/csh";
2170 }
2171 else if (strcmp(argv[i], "--zsh") == 0) {
2172 if (arg_shell_none) {
2173 fprintf(stderr, "Error: --shell=none was already specified.\n");
2174 return 1;
2175 }
2176 if (cfg.shell) {
2177 fprintf(stderr, "Error: only one default user shell can be specified\n");
2178 return 1;
2179 }
2180 cfg.shell = "/bin/zsh";
2181 } 2687 }
2182 else if (strcmp(argv[i], "--shell=none") == 0) { 2688 else if (strcmp(argv[i], "--shell=none") == 0) {
2183 arg_shell_none = 1; 2689 arg_shell_none = 1;
@@ -2191,7 +2697,7 @@ int main(int argc, char **argv) {
2191 fprintf(stderr, "Error: --shell=none was already specified.\n"); 2697 fprintf(stderr, "Error: --shell=none was already specified.\n");
2192 return 1; 2698 return 1;
2193 } 2699 }
2194 invalid_filename(argv[i] + 8); 2700 invalid_filename(argv[i] + 8, 0); // no globbing
2195 2701
2196 if (cfg.shell) { 2702 if (cfg.shell) {
2197 fprintf(stderr, "Error: only one user shell can be specified\n"); 2703 fprintf(stderr, "Error: only one user shell can be specified\n");
@@ -2209,12 +2715,12 @@ int main(int argc, char **argv) {
2209 char *shellpath; 2715 char *shellpath;
2210 if (asprintf(&shellpath, "%s%s", cfg.chrootdir, cfg.shell) == -1) 2716 if (asprintf(&shellpath, "%s%s", cfg.chrootdir, cfg.shell) == -1)
2211 errExit("asprintf"); 2717 errExit("asprintf");
2212 if (access(shellpath, R_OK)) { 2718 if (access(shellpath, X_OK)) {
2213 fprintf(stderr, "Error: cannot access shell file in chroot\n"); 2719 fprintf(stderr, "Error: cannot access shell file in chroot\n");
2214 exit(1); 2720 exit(1);
2215 } 2721 }
2216 free(shellpath); 2722 free(shellpath);
2217 } else if (access(cfg.shell, R_OK)) { 2723 } else if (access(cfg.shell, X_OK)) {
2218 fprintf(stderr, "Error: cannot access shell file\n"); 2724 fprintf(stderr, "Error: cannot access shell file\n");
2219 exit(1); 2725 exit(1);
2220 } 2726 }
@@ -2250,27 +2756,21 @@ int main(int argc, char **argv) {
2250 return 1; 2756 return 1;
2251 } 2757 }
2252 } 2758 }
2253 else if (strcmp(argv[i], "--git-install") == 0 || 2759 else if (strcmp(argv[i], "--deterministic-exit-code") == 0) {
2254 strcmp(argv[i], "--git-uninstall") == 0) { 2760 arg_deterministic_exit_code = 1;
2255 fprintf(stderr, "This feature is not enabled in the current build\n");
2256 exit(1);
2257 } 2761 }
2258 2762 else {
2259 else if (strcmp(argv[i], "--") == 0) {
2260 // double dash - positional params to follow 2763 // double dash - positional params to follow
2261 arg_doubledash = 1; 2764 if (strcmp(argv[i], "--") == 0) {
2262 i++; 2765 arg_doubledash = 1;
2263 if (i >= argc) { 2766 i++;
2264 fprintf(stderr, "Error: program name not found\n"); 2767 if (i >= argc) {
2265 exit(1); 2768 fprintf(stderr, "Error: program name not found\n");
2769 exit(1);
2770 }
2266 } 2771 }
2267 extract_command_name(i, argv);
2268 prog_index = i;
2269 break;
2270 }
2271 else {
2272 // is this an invalid option? 2772 // is this an invalid option?
2273 if (*argv[i] == '-') { 2773 else if (*argv[i] == '-') {
2274 fprintf(stderr, "Error: invalid %s command line option\n", argv[i]); 2774 fprintf(stderr, "Error: invalid %s command line option\n", argv[i]);
2275 return 1; 2775 return 1;
2276 } 2776 }
@@ -2280,6 +2780,9 @@ int main(int argc, char **argv) {
2280 cfg.command_name = strdup(argv[i]); 2780 cfg.command_name = strdup(argv[i]);
2281 if (!cfg.command_name) 2781 if (!cfg.command_name)
2282 errExit("strdup"); 2782 errExit("strdup");
2783
2784 // disable shell=* for appimages
2785 arg_shell_none = 0;
2283 } 2786 }
2284 else 2787 else
2285 extract_command_name(i, argv); 2788 extract_command_name(i, argv);
@@ -2287,6 +2790,24 @@ int main(int argc, char **argv) {
2287 break; 2790 break;
2288 } 2791 }
2289 } 2792 }
2793 EUID_ASSERT();
2794
2795 // exit chroot, overlay and appimage sandboxes when caps are explicitly specified on command line
2796 if (getuid() != 0 && arg_caps_cmdline) {
2797 char *opt = NULL;
2798 if (arg_appimage)
2799 opt = "appimage";
2800 else if (arg_overlay)
2801 opt = "overlay";
2802 else if (cfg.chrootdir)
2803 opt = "chroot";
2804
2805 if (opt) {
2806 fprintf(stderr, "Error: all capabilities are dropped for %s by default.\n"
2807 "Please remove --caps options from the command line.\n", opt);
2808 exit(1);
2809 }
2810 }
2290 2811
2291 // prog_index could still be -1 if no program was specified 2812 // prog_index could still be -1 if no program was specified
2292 if (prog_index == -1 && arg_shell_none) { 2813 if (prog_index == -1 && arg_shell_none) {
@@ -2302,12 +2823,12 @@ int main(int argc, char **argv) {
2302 // check user namespace (--noroot) options 2823 // check user namespace (--noroot) options
2303 if (arg_noroot) { 2824 if (arg_noroot) {
2304 if (arg_overlay) { 2825 if (arg_overlay) {
2305 fprintf(stderr, "Error: --overlay and --noroot are mutually exclusive.\n"); 2826 fwarning("--overlay and --noroot are mutually exclusive, --noroot disabled...\n");
2306 exit(1); 2827 arg_noroot = 0;
2307 } 2828 }
2308 else if (cfg.chrootdir) { 2829 else if (cfg.chrootdir) {
2309 fprintf(stderr, "Error: --chroot and --noroot are mutually exclusive.\n"); 2830 fwarning("--chroot and --noroot are mutually exclusive, --noroot disabled...\n");
2310 exit(1); 2831 arg_noroot = 0;
2311 } 2832 }
2312 } 2833 }
2313 2834
@@ -2338,7 +2859,12 @@ int main(int argc, char **argv) {
2338 2859
2339 // build the sandbox command 2860 // build the sandbox command
2340 if (prog_index == -1 && cfg.shell) { 2861 if (prog_index == -1 && cfg.shell) {
2341 cfg.command_line = cfg.shell; 2862 assert(cfg.command_line == NULL); // runs cfg.shell
2863 if (arg_appimage) {
2864 fprintf(stderr, "Error: no appimage archive specified\n");
2865 exit(1);
2866 }
2867
2342 cfg.window_title = cfg.shell; 2868 cfg.window_title = cfg.shell;
2343 cfg.command_name = cfg.shell; 2869 cfg.command_name = cfg.shell;
2344 } 2870 }
@@ -2346,10 +2872,11 @@ int main(int argc, char **argv) {
2346 if (arg_debug) 2872 if (arg_debug)
2347 printf("Configuring appimage environment\n"); 2873 printf("Configuring appimage environment\n");
2348 appimage_set(cfg.command_name); 2874 appimage_set(cfg.command_name);
2349 build_appimage_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, prog_index, cfg.command_line); 2875 build_appimage_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, prog_index, true);
2350 } 2876 }
2351 else { 2877 else {
2352 build_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, prog_index); 2878 // Only add extra quotes if we were not launched by sshd.
2879 build_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, prog_index, !parent_sshd);
2353 } 2880 }
2354/* else { 2881/* else {
2355 fprintf(stderr, "Error: command must be specified when --shell=none used.\n"); 2882 fprintf(stderr, "Error: command must be specified when --shell=none used.\n");
@@ -2362,66 +2889,35 @@ int main(int argc, char **argv) {
2362 2889
2363 2890
2364 // load the profile 2891 // load the profile
2365 if (!arg_noprofile) { 2892 if (!arg_noprofile && !custom_profile) {
2366 if (!custom_profile) { 2893 if (arg_appimage) {
2367 // look for a profile in ~/.config/firejail directory 2894 custom_profile = appimage_find_profile(cfg.command_name);
2368 char *usercfgdir; 2895 // disable shell=* for appimages
2369 if (asprintf(&usercfgdir, "%s/.config/firejail", cfg.homedir) == -1) 2896 arg_shell_none = 0;
2370 errExit("asprintf");
2371 int rv = profile_find(cfg.command_name, usercfgdir);
2372 free(usercfgdir);
2373 custom_profile = rv;
2374 }
2375 if (!custom_profile) {
2376 // look for a user profile in /etc/firejail directory
2377 int rv;
2378 if (custom_profile_dir)
2379 rv = profile_find(cfg.command_name, custom_profile_dir);
2380 else
2381 rv = profile_find(cfg.command_name, SYSCONFDIR);
2382 custom_profile = rv;
2383 } 2897 }
2898 else
2899 custom_profile = profile_find_firejail(cfg.command_name, 1);
2384 } 2900 }
2385 2901
2386 // use default.profile as the default 2902 // use default.profile as the default
2387 if (!custom_profile && !arg_noprofile) { 2903 if (!custom_profile && !arg_noprofile) {
2388 if (cfg.chrootdir) { 2904 char *profile_name = DEFAULT_USER_PROFILE;
2389 fwarning("default profile disabled by --chroot option\n"); 2905 if (getuid() == 0)
2390 } 2906 profile_name = DEFAULT_ROOT_PROFILE;
2391// else if (arg_overlay) { 2907 if (arg_debug)
2392// fwarning("default profile disabled by --overlay option\n"); 2908 printf("Attempting to find %s.profile...\n", profile_name);
2393// }
2394 else {
2395 // try to load a default profile
2396 char *profile_name = DEFAULT_USER_PROFILE;
2397 if (getuid() == 0)
2398 profile_name = DEFAULT_ROOT_PROFILE;
2399 if (arg_debug)
2400 printf("Attempting to find %s.profile...\n", profile_name);
2401 2909
2402 // look for the profile in ~/.config/firejail directory 2910 custom_profile = profile_find_firejail(profile_name, 1);
2403 char *usercfgdir;
2404 if (asprintf(&usercfgdir, "%s/.config/firejail", cfg.homedir) == -1)
2405 errExit("asprintf");
2406 custom_profile = profile_find(profile_name, usercfgdir);
2407 free(usercfgdir);
2408 2911
2409 if (!custom_profile) { 2912 if (!custom_profile) {
2410 // look for the profile in /etc/firejail directory 2913 fprintf(stderr, "Error: no %s installed\n", profile_name);
2411 if (custom_profile_dir) 2914 exit(1);
2412 custom_profile = profile_find(profile_name, custom_profile_dir);
2413 else
2414 custom_profile = profile_find(profile_name, SYSCONFDIR);
2415 }
2416 if (!custom_profile) {
2417 fprintf(stderr, "Error: no default.profile installed\n");
2418 exit(1);
2419 }
2420
2421 if (custom_profile && !arg_quiet)
2422 printf("\n** Note: you can use --noprofile to disable %s.profile **\n\n", profile_name);
2423 } 2915 }
2916
2917 if (custom_profile)
2918 fmessage("\n** Note: you can use --noprofile to disable %s.profile **\n\n", profile_name);
2424 } 2919 }
2920 EUID_ASSERT();
2425 2921
2426 // block X11 sockets 2922 // block X11 sockets
2427 if (arg_x11_block) 2923 if (arg_x11_block)
@@ -2430,31 +2926,46 @@ int main(int argc, char **argv) {
2430 // check network configuration options - it will exit if anything went wrong 2926 // check network configuration options - it will exit if anything went wrong
2431 net_check_cfg(); 2927 net_check_cfg();
2432 2928
2929 // customization of default seccomp filter
2930 if (config_seccomp_filter_add) {
2931 if (arg_seccomp && !cfg.seccomp_list_keep && !cfg.seccomp_list_drop)
2932 profile_list_augment(&cfg.seccomp_list, config_seccomp_filter_add);
2933
2934 if (arg_seccomp32 && !cfg.seccomp_list_keep32 && !cfg.seccomp_list_drop32)
2935 profile_list_augment(&cfg.seccomp_list32, config_seccomp_filter_add);
2936 }
2937
2938 if (arg_seccomp)
2939 arg_seccomp_postexec = check_postexec(cfg.seccomp_list) || check_postexec(cfg.seccomp_list_drop);
2940
2941 bool need_preload = arg_trace || arg_tracelog || arg_seccomp_postexec;
2942 if (need_preload && (cfg.seccomp_list32 || cfg.seccomp_list_drop32 || cfg.seccomp_list_keep32))
2943 fwarning("preload libraries (trace, tracelog, postexecseccomp due to seccomp.drop=execve etc.) are incompatible with 32 bit filters\n");
2944
2433 // check and assign an IP address - for macvlan it will be done again in the sandbox! 2945 // check and assign an IP address - for macvlan it will be done again in the sandbox!
2434 if (any_bridge_configured()) { 2946 if (any_bridge_configured()) {
2435 EUID_ROOT(); 2947 EUID_ROOT();
2436 lockfd = open(RUN_NETWORK_LOCK_FILE, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); 2948 lockfd_network = open(RUN_NETWORK_LOCK_FILE, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR);
2437 if (lockfd != -1) { 2949 if (lockfd_network != -1) {
2438 int rv = fchown(lockfd, 0, 0); 2950 int rv = fchown(lockfd_network, 0, 0);
2439 (void) rv; 2951 (void) rv;
2440 flock(lockfd, LOCK_EX); 2952 flock(lockfd_network, LOCK_EX);
2441 } 2953 }
2442 2954
2443 check_network(&cfg.bridge0); 2955 if (cfg.bridge0.configured && cfg.bridge0.arg_ip_none == 0)
2444 check_network(&cfg.bridge1); 2956 check_network(&cfg.bridge0);
2445 check_network(&cfg.bridge2); 2957 if (cfg.bridge1.configured && cfg.bridge1.arg_ip_none == 0)
2446 check_network(&cfg.bridge3); 2958 check_network(&cfg.bridge1);
2959 if (cfg.bridge2.configured && cfg.bridge2.arg_ip_none == 0)
2960 check_network(&cfg.bridge2);
2961 if (cfg.bridge3.configured && cfg.bridge3.arg_ip_none == 0)
2962 check_network(&cfg.bridge3);
2447 2963
2448 // save network mapping in shared memory 2964 // save network mapping in shared memory
2449 network_set_run_file(sandbox_pid); 2965 network_set_run_file(sandbox_pid);
2450 EUID_USER(); 2966 EUID_USER();
2451 } 2967 }
2452 2968 EUID_ASSERT();
2453 // create the parent-child communication pipe
2454 if (pipe(parent_to_child_fds) < 0)
2455 errExit("pipe");
2456 if (pipe(child_to_parent_fds) < 0)
2457 errExit("pipe");
2458 2969
2459 if (arg_noroot && arg_overlay) { 2970 if (arg_noroot && arg_overlay) {
2460 fwarning("--overlay and --noroot are mutually exclusive, noroot disabled\n"); 2971 fwarning("--overlay and --noroot are mutually exclusive, noroot disabled\n");
@@ -2466,15 +2977,43 @@ int main(int argc, char **argv) {
2466 } 2977 }
2467 2978
2468 2979
2469 // set name file 2980 // set name and x11 run files
2470 EUID_ROOT(); 2981 EUID_ROOT();
2982 lockfd_directory = open(RUN_DIRECTORY_LOCK_FILE, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR);
2983 if (lockfd_directory != -1) {
2984 int rv = fchown(lockfd_directory, 0, 0);
2985 (void) rv;
2986 flock(lockfd_directory, LOCK_EX);
2987 }
2471 if (cfg.name) 2988 if (cfg.name)
2472 set_name_file(sandbox_pid); 2989 set_name_run_file(sandbox_pid);
2473 int display = x11_display(); 2990 int display = x11_display();
2474 if (display > 0) 2991 if (display > 0)
2475 set_x11_file(sandbox_pid, display); 2992 set_x11_run_file(sandbox_pid, display);
2993 if (lockfd_directory != -1) {
2994 flock(lockfd_directory, LOCK_UN);
2995 close(lockfd_directory);
2996 }
2476 EUID_USER(); 2997 EUID_USER();
2477 2998
2999#ifdef HAVE_DBUSPROXY
3000 if (checkcfg(CFG_DBUS)) {
3001 dbus_check_profile();
3002 if (arg_dbus_user == DBUS_POLICY_FILTER ||
3003 arg_dbus_system == DBUS_POLICY_FILTER) {
3004 EUID_ROOT();
3005 dbus_proxy_start();
3006 EUID_USER();
3007 }
3008 }
3009#endif
3010
3011 // create the parent-child communication pipe
3012 if (pipe2(parent_to_child_fds, O_CLOEXEC) < 0)
3013 errExit("pipe");
3014 if (pipe2(child_to_parent_fds, O_CLOEXEC) < 0)
3015 errExit("pipe");
3016
2478 // clone environment 3017 // clone environment
2479 int flags = CLONE_NEWNS | CLONE_NEWPID | CLONE_NEWUTS | SIGCHLD; 3018 int flags = CLONE_NEWNS | CLONE_NEWPID | CLONE_NEWUTS | SIGCHLD;
2480 3019
@@ -2492,17 +3031,26 @@ int main(int argc, char **argv) {
2492 else if (arg_debug) 3031 else if (arg_debug)
2493 printf("Using the local network stack\n"); 3032 printf("Using the local network stack\n");
2494 3033
3034 EUID_ASSERT();
2495 EUID_ROOT(); 3035 EUID_ROOT();
3036#ifdef __ia64__
3037 child = __clone2(sandbox,
3038 child_stack,
3039 STACK_SIZE,
3040 flags,
3041 NULL);
3042#else
2496 child = clone(sandbox, 3043 child = clone(sandbox,
2497 child_stack + STACK_SIZE, 3044 child_stack + STACK_SIZE,
2498 flags, 3045 flags,
2499 NULL); 3046 NULL);
3047#endif
2500 if (child == -1) 3048 if (child == -1)
2501 errExit("clone"); 3049 errExit("clone");
2502 EUID_USER(); 3050 EUID_USER();
2503 3051
2504 if (!arg_command && !arg_quiet) { 3052 if (!arg_command && !arg_quiet) {
2505 printf("Parent pid %u, child pid %u\n", sandbox_pid, child); 3053 fmessage("Parent pid %u, child pid %u\n", sandbox_pid, child);
2506 // print the path of the new log directory 3054 // print the path of the new log directory
2507 if (getuid() == 0) // only for root 3055 if (getuid() == 0) // only for root
2508 printf("The new log directory is /proc/%d/root/var/log\n", child); 3056 printf("The new log directory is /proc/%d/root/var/log\n", child);
@@ -2522,9 +3070,9 @@ int main(int argc, char **argv) {
2522 network_main(child); 3070 network_main(child);
2523 if (arg_debug) 3071 if (arg_debug)
2524 printf("Host network configured\n"); 3072 printf("Host network configured\n");
2525#ifdef HAVE_GCOV 3073
2526 __gcov_flush(); 3074 __gcov_flush();
2527#endif 3075
2528 _exit(0); 3076 _exit(0);
2529 } 3077 }
2530 3078
@@ -2532,6 +3080,7 @@ int main(int argc, char **argv) {
2532 waitpid(net_child, NULL, 0); 3080 waitpid(net_child, NULL, 0);
2533 EUID_USER(); 3081 EUID_USER();
2534 } 3082 }
3083 EUID_ASSERT();
2535 3084
2536 // close each end of the unused pipes 3085 // close each end of the unused pipes
2537 close(parent_to_child_fds[0]); 3086 close(parent_to_child_fds[0]);
@@ -2574,8 +3123,15 @@ int main(int argc, char **argv) {
2574 ptr += strlen(ptr); 3123 ptr += strlen(ptr);
2575 3124
2576 if (!arg_nogroups) { 3125 if (!arg_nogroups) {
3126 // add firejail group
3127 gid_t g = get_group_id("firejail");
3128 if (g) {
3129 sprintf(ptr, "%d %d 1\n", g, g);
3130 ptr += strlen(ptr);
3131 }
3132
2577 // add tty group 3133 // add tty group
2578 gid_t g = get_group_id("tty"); 3134 g = get_group_id("tty");
2579 if (g) { 3135 if (g) {
2580 sprintf(ptr, "%d %d 1\n", g, g); 3136 sprintf(ptr, "%d %d 1\n", g, g);
2581 ptr += strlen(ptr); 3137 ptr += strlen(ptr);
@@ -2607,45 +3163,66 @@ int main(int argc, char **argv) {
2607 EUID_USER(); 3163 EUID_USER();
2608 free(map_path); 3164 free(map_path);
2609 } 3165 }
3166 EUID_ASSERT();
2610 3167
2611 // notify child that UID/GID mapping is complete 3168 // notify child that UID/GID mapping is complete
2612 notify_other(parent_to_child_fds[1]); 3169 notify_other(parent_to_child_fds[1]);
2613 close(parent_to_child_fds[1]); 3170 close(parent_to_child_fds[1]);
2614 3171
2615 EUID_ROOT(); 3172 EUID_ROOT();
2616 if (lockfd != -1) { 3173 if (lockfd_network != -1) {
2617 flock(lockfd, LOCK_UN); 3174 flock(lockfd_network, LOCK_UN);
2618 close(lockfd); 3175 close(lockfd_network);
2619 } 3176 }
3177 EUID_USER();
3178
3179 int status = 0;
3180 //*****************************
3181 // following code is signal-safe
2620 3182
2621 // handle CTRL-C in parent 3183 // handle CTRL-C in parent
2622 signal (SIGINT, my_handler); 3184 install_handler();
2623 signal (SIGTERM, my_handler);
2624 3185
2625 // wait for the child to finish 3186 // wait for the child to finish
2626 EUID_USER();
2627 int status = 0;
2628 waitpid(child, &status, 0); 3187 waitpid(child, &status, 0);
2629 3188
3189 // restore default signal actions
3190 signal(SIGTERM, SIG_DFL);
3191 signal(SIGINT, SIG_DFL);
3192
3193 // end of signal-safe code
3194 //*****************************
3195
3196#if 0
3197// at this point the sandbox was closed and we are on our way out
3198// it would make sense to move this before waitpid above to free some memory
3199// crash for now as of issue #3662 from dhcp code
2630 // free globals 3200 // free globals
2631 if (cfg.profile) { 3201 if (cfg.profile) {
2632 ProfileEntry *prf = cfg.profile; 3202 ProfileEntry *prf = cfg.profile;
2633 while (prf != NULL) { 3203 while (prf != NULL) {
2634 ProfileEntry *next = prf->next; 3204 ProfileEntry *next = prf->next;
2635 free(prf->data); 3205printf("data #%s#\n", prf->data);
2636 free(prf->link); 3206 if (prf->data)
3207 free(prf->data);
3208printf("link #%s#\n", prf->link);
3209 if (prf->link)
3210 free(prf->link);
2637 free(prf); 3211 free(prf);
2638 prf = next; 3212 prf = next;
2639 } 3213 }
2640 } 3214 }
3215#endif
3216
2641 3217
2642 if (WIFEXITED(status)){ 3218 if (WIFEXITED(status)){
2643 myexit(WEXITSTATUS(status)); 3219 myexit(WEXITSTATUS(status));
2644 } else if (WIFSIGNALED(status)) { 3220 } else if (WIFSIGNALED(status)) {
2645 myexit(WTERMSIG(status)); 3221 // distinguish fatal signals by adding 128
3222 myexit(128 + WTERMSIG(status));
2646 } else { 3223 } else {
2647 myexit(0); 3224 myexit(1);
2648 } 3225 }
2649 3226
2650 return 0; 3227 return 1;
2651} 3228}
diff --git a/src/firejail/mountinfo.c b/src/firejail/mountinfo.c
new file mode 100644
index 000000000..64a94bd84
--- /dev/null
+++ b/src/firejail/mountinfo.c
@@ -0,0 +1,281 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "firejail.h"
22
23#include <fcntl.h>
24#ifndef O_PATH
25#define O_PATH 010000000
26#endif
27
28#define MAX_BUF 4096
29
30static char mbuf[MAX_BUF];
31static MountData mdata;
32
33
34// Convert octal escape sequence to decimal value
35static int read_oct(const char *path) {
36 int dec = 0;
37 int digit, i;
38 // there are always exactly three octal digits
39 for (i = 1; i < 4; i++) {
40 digit = *(path + i);
41 if (digit < '0' || digit > '7') {
42 fprintf(stderr, "Error: cannot read /proc/self/mountinfo\n");
43 exit(1);
44 }
45 dec = (dec << 3) + (digit - '0');
46 }
47 return dec;
48}
49
50// Restore empty spaces in pathnames extracted from /proc/self/mountinfo
51static void unmangle_path(char *path) {
52 char *p = strchr(path, '\\');
53 if (p && read_oct(p) == ' ') {
54 *p = ' ';
55 int i = 3;
56 do {
57 p++;
58 if (*(p + i) == '\\' && read_oct(p + i) == ' ') {
59 *p = ' ';
60 i += 3;
61 }
62 else
63 *p = *(p + i);
64 } while (*p);
65 }
66}
67
68// Parse a line from /proc/self/mountinfo,
69// the function does an exit(1) if anything goes wrong.
70static void parse_line(char *line, MountData *output) {
71 assert(line && output);
72 memset(output, 0, sizeof(*output));
73 // extract mount id, filesystem name, directory and filesystem types
74 // examples:
75 // 587 543 8:1 /tmp /etc rw,relatime master:1 - ext4 /dev/sda1 rw,errors=remount-ro,data=ordered
76 // output.mountid: 587
77 // output.fsname: /tmp
78 // output.dir: /etc
79 // output.fstype: ext4
80 // 585 564 0:76 / /home/netblue/.cache rw,nosuid,nodev - tmpfs tmpfs rw
81 // output.mountid: 585
82 // output.fsname: /
83 // output.dir: /home/netblue/.cache
84 // output.fstype: tmpfs
85
86 char *ptr = strtok(line, " ");
87 if (!ptr)
88 goto errexit;
89 if (ptr != line)
90 goto errexit;
91 output->mountid = atoi(ptr);
92 int cnt = 1;
93
94 while ((ptr = strtok(NULL, " ")) != NULL) {
95 cnt++;
96 if (cnt == 4)
97 output->fsname = ptr;
98 else if (cnt == 5) {
99 output->dir = ptr;
100 break;
101 }
102 }
103
104 ptr = strtok(NULL, "-");
105 if (!ptr)
106 goto errexit;
107
108 ptr = strtok(NULL, " ");
109 if (!ptr)
110 goto errexit;
111 output->fstype = ptr++;
112
113
114 if (output->mountid == 0 ||
115 output->fsname == NULL ||
116 output->dir == NULL ||
117 output->fstype == NULL)
118 goto errexit;
119
120 // restore empty spaces
121 unmangle_path(output->fsname);
122 unmangle_path(output->dir);
123
124 return;
125
126errexit:
127 fprintf(stderr, "Error: cannot read /proc/self/mountinfo\n");
128 exit(1);
129}
130
131// The return value points to a static area, and will be overwritten by subsequent calls.
132MountData *get_last_mount(void) {
133 // open /proc/self/mountinfo
134 FILE *fp = fopen("/proc/self/mountinfo", "re");
135 if (!fp) {
136 fprintf(stderr, "Error: cannot read /proc/self/mountinfo\n");
137 exit(1);
138 }
139
140 mbuf[0] = '\0';
141 // go to the last line
142 while (fgets(mbuf, MAX_BUF, fp));
143 fclose(fp);
144 if (arg_debug)
145 printf("%s", mbuf);
146
147 parse_line(mbuf, &mdata);
148
149 if (arg_debug)
150 printf("mountid=%d fsname=%s dir=%s fstype=%s\n", mdata.mountid, mdata.fsname, mdata.dir, mdata.fstype);
151 return &mdata;
152}
153
154// Extract the mount id from /proc/self/fdinfo and return it.
155int get_mount_id(const char *path) {
156 EUID_ASSERT();
157 assert(path);
158
159 int fd = open(path, O_PATH|O_CLOEXEC);
160 if (fd == -1)
161 return -1;
162
163 char *fdinfo;
164 if (asprintf(&fdinfo, "/proc/self/fdinfo/%d", fd) == -1)
165 errExit("asprintf");
166 EUID_ROOT();
167 FILE *fp = fopen(fdinfo, "re");
168 EUID_USER();
169 free(fdinfo);
170 if (!fp)
171 goto errexit;
172
173 // read the file
174 char buf[MAX_BUF];
175 if (fgets(buf, MAX_BUF, fp) == NULL)
176 goto errexit;
177 do {
178 if (strncmp(buf, "mnt_id:", 7) == 0) {
179 char *ptr = buf + 7;
180 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) {
181 ptr++;
182 }
183 if (*ptr == '\0')
184 goto errexit;
185 fclose(fp);
186 close(fd);
187 return atoi(ptr);
188 }
189 } while (fgets(buf, MAX_BUF, fp));
190
191 // fallback, kernels older than 3.15 don't expose the mount id in this place
192 fclose(fp);
193 close(fd);
194 return -2;
195
196errexit:
197 fprintf(stderr, "Error: cannot read proc file\n");
198 exit(1);
199}
200
201// Check /proc/self/mountinfo if path contains any mounts points.
202// Returns an array that can be iterated over for recursive remounting.
203char **build_mount_array(const int mount_id, const char *path) {
204 assert(path);
205
206 // open /proc/self/mountinfo
207 FILE *fp = fopen("/proc/self/mountinfo", "re");
208 if (!fp) {
209 fprintf(stderr, "Error: cannot read /proc/self/mountinfo\n");
210 exit(1);
211 }
212
213 // array to be returned
214 size_t cnt = 0;
215 size_t size = 32;
216 char **rv = malloc(size * sizeof(*rv));
217 if (!rv)
218 errExit("malloc");
219
220 // read /proc/self/mountinfo
221 size_t pathlen = strlen(path);
222 char buf[MAX_BUF];
223 MountData mntp;
224 int found = 0;
225
226 if (fgets(buf, MAX_BUF, fp) == NULL) {
227 fprintf(stderr, "Error: cannot read /proc/self/mountinfo\n");
228 exit(1);
229 }
230 do {
231 parse_line(buf, &mntp);
232 // find mount point with mount id
233 if (!found) {
234 if (mntp.mountid == mount_id) {
235 // give up if mount id has been reassigned,
236 // don't remount blacklisted path
237 if (strncmp(mntp.dir, path, strlen(mntp.dir)) ||
238 strstr(mntp.fsname, "firejail.ro.dir") ||
239 strstr(mntp.fsname, "firejail.ro.file"))
240 break;
241
242 rv[cnt] = strdup(path);
243 if (rv[cnt] == NULL)
244 errExit("strdup");
245 cnt++;
246 found = 1;
247 continue;
248 }
249 continue;
250 }
251 // from here on add all mount points below path,
252 // don't remount blacklisted paths
253 if (strncmp(mntp.dir, path, pathlen) == 0 &&
254 mntp.dir[pathlen] == '/' &&
255 strstr(mntp.fsname, "firejail.ro.dir") == NULL &&
256 strstr(mntp.fsname, "firejail.ro.file") == NULL) {
257
258 if (cnt == size) {
259 size *= 2;
260 rv = realloc(rv, size * sizeof(*rv));
261 if (!rv)
262 errExit("realloc");
263 }
264 rv[cnt] = strdup(mntp.dir);
265 if (rv[cnt] == NULL)
266 errExit("strdup");
267 cnt++;
268 }
269 } while (fgets(buf, MAX_BUF, fp));
270
271 if (cnt == size) {
272 size++;
273 rv = realloc(rv, size * sizeof(*rv));
274 if (!rv)
275 errExit("realloc");
276 }
277 rv[cnt] = NULL; // end of the array
278
279 fclose(fp);
280 return rv;
281}
diff --git a/src/firejail/netfilter.c b/src/firejail/netfilter.c
index 14b3b54a6..fc79dddec 100644
--- a/src/firejail/netfilter.c
+++ b/src/firejail/netfilter.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -24,36 +24,25 @@
24#include <sys/wait.h> 24#include <sys/wait.h>
25#include <fcntl.h> 25#include <fcntl.h>
26 26
27static char *client_filter =
28"*filter\n"
29":INPUT DROP [0:0]\n"
30":FORWARD DROP [0:0]\n"
31":OUTPUT ACCEPT [0:0]\n"
32"-A INPUT -i lo -j ACCEPT\n"
33"-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n"
34"# echo replay is handled by -m state RELATED/ESTABLISHED below\n"
35"#-A INPUT -p icmp --icmp-type echo-reply -j ACCEPT\n"
36"-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT\n"
37"-A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT\n"
38"-A INPUT -p icmp --icmp-type echo-request -j ACCEPT \n"
39"# disable STUN\n"
40"-A OUTPUT -p udp --dport 3478 -j DROP\n"
41"-A OUTPUT -p udp --dport 3479 -j DROP\n"
42"-A OUTPUT -p tcp --dport 3478 -j DROP\n"
43"-A OUTPUT -p tcp --dport 3479 -j DROP\n"
44"COMMIT\n";
45
46void check_netfilter_file(const char *fname) { 27void check_netfilter_file(const char *fname) {
47 EUID_ASSERT(); 28 EUID_ASSERT();
48 invalid_filename(fname);
49 29
50 if (is_dir(fname) || is_link(fname) || strstr(fname, "..") || access(fname, R_OK )) { 30 char *tmp = strdup(fname);
51 fprintf(stderr, "Error: invalid network filter file %s\n", fname); 31 if (!tmp)
32 errExit("strdup");
33 char *ptr = strchr(tmp, ',');
34 if (ptr)
35 *ptr = '\0';
36
37 invalid_filename(tmp, 0); // no globbing
38
39 if (is_dir(tmp) || is_link(tmp) || strstr(tmp, "..") || access(tmp, R_OK )) {
40 fprintf(stderr, "Error: invalid network filter file %s\n", tmp);
52 exit(1); 41 exit(1);
53 } 42 }
43 free(tmp);
54} 44}
55 45
56
57void netfilter(const char *fname) { 46void netfilter(const char *fname) {
58 // find iptables command 47 // find iptables command
59 struct stat s; 48 struct stat s;
@@ -72,41 +61,32 @@ void netfilter(const char *fname) {
72 return; 61 return;
73 } 62 }
74 63
75 // read filter
76 char *filter = client_filter;
77 int allocated = 0;
78 if (netfilter_default)
79 fname = netfilter_default;
80 if (fname) {
81 filter = read_text_file_or_exit(fname);
82 allocated = 1;
83 }
84
85 // create the filter file
86 FILE *fp = fopen(SBOX_STDIN_FILE, "w");
87 if (!fp) {
88 fprintf(stderr, "Error: cannot open %s\n", SBOX_STDIN_FILE);
89 exit(1);
90 }
91 fprintf(fp, "%s\n", filter);
92 fclose(fp);
93
94
95 // push filter
96 if (arg_debug) 64 if (arg_debug)
97 printf("Installing network filter:\n%s\n", filter); 65 printf("Installing firewall\n");
66
67 // create an empty user-owned SBOX_STDIN_FILE
68 create_empty_file_as_root(SBOX_STDIN_FILE, 0644);
69 if (set_perms(SBOX_STDIN_FILE, getuid(), getgid(), 0644))
70 errExit("set_perms");
71
72 if (fname == NULL) {
73 if (netfilter_default)
74 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FNETFILTER, netfilter_default, SBOX_STDIN_FILE);
75 else
76 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FNETFILTER, SBOX_STDIN_FILE);
77 }
78 else
79 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FNETFILTER, fname, SBOX_STDIN_FILE);
98 80
99 // first run of iptables on this platform installs a number of kernel modules such as ip_tables, x_tables, iptable_filter 81 // first run of iptables on this platform installs a number of kernel modules such as ip_tables, x_tables, iptable_filter
100 // we run this command with caps and seccomp disabled in order to allow the loading of these modules 82 // we run this command with caps and seccomp disabled in order to allow the loading of these modules
101 sbox_run(SBOX_ROOT /* | SBOX_CAPS_NETWORK | SBOX_SECCOMP*/ | SBOX_STDIN_FROM_FILE, 1, iptables_restore); 83 sbox_run(SBOX_ROOT | SBOX_STDIN_FROM_FILE, 1, iptables_restore);
102 unlink(SBOX_STDIN_FILE); 84 unlink(SBOX_STDIN_FILE);
103 85
104 // debug 86 // debug
105 if (arg_debug) 87 if (arg_debug)
106 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, iptables, "-vL"); 88 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, iptables, "-vL");
107 89
108 if (allocated)
109 free(filter);
110 return; 90 return;
111} 91}
112 92
@@ -131,29 +111,54 @@ void netfilter6(const char *fname) {
131 return; 111 return;
132 } 112 }
133 113
134 // create the filter file
135 char *filter = read_text_file_or_exit(fname);
136 FILE *fp = fopen(SBOX_STDIN_FILE, "w");
137 if (!fp) {
138 fprintf(stderr, "Error: cannot open %s\n", SBOX_STDIN_FILE);
139 exit(1);
140 }
141 fprintf(fp, "%s\n", filter);
142 fclose(fp);
143
144 // push filter
145 if (arg_debug) 114 if (arg_debug)
146 printf("Installing network filter:\n%s\n", filter); 115 printf("Installing IPv6 firewall\n");
116
117 // create an empty user-owned SBOX_STDIN_FILE
118 create_empty_file_as_root(SBOX_STDIN_FILE, 0644);
119 if (set_perms(SBOX_STDIN_FILE, getuid(), getgid(), 0644))
120 errExit("set_perms");
121
122 sbox_run(SBOX_USER| SBOX_CAPS_NONE | SBOX_SECCOMP, 3, PATH_FNETFILTER, fname, SBOX_STDIN_FILE);
147 123
148 // first run of iptables on this platform installs a number of kernel modules such as ip_tables, x_tables, iptable_filter 124 // first run of iptables on this platform installs a number of kernel modules such as ip_tables, x_tables, iptable_filter
149 // we run this command with caps and seccomp disabled in order to allow the loading of these modules 125 // we run this command with caps and seccomp disabled in order to allow the loading of these modules
150 sbox_run(SBOX_ROOT | /* SBOX_CAPS_NETWORK | SBOX_SECCOMP | */ SBOX_STDIN_FROM_FILE, 1, ip6tables_restore); 126 sbox_run(SBOX_ROOT | SBOX_STDIN_FROM_FILE, 1, ip6tables_restore);
151 unlink(SBOX_STDIN_FILE); 127 unlink(SBOX_STDIN_FILE);
152 128
153 // debug 129 // debug
154 if (arg_debug) 130 if (arg_debug)
155 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, ip6tables, "-vL"); 131 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, ip6tables, "-vL");
156 132
157 free(filter);
158 return; 133 return;
159} 134}
135
136void netfilter_print(pid_t pid, int ipv6) {
137 EUID_ASSERT();
138
139 enter_network_namespace(pid);
140
141 // find iptables executable
142 char *iptables = NULL;
143// char *iptables_restore = NULL;
144 struct stat s;
145 if (ipv6) {
146 if (stat("/sbin/ip6tables", &s) == 0)
147 iptables = "/sbin/ip6tables";
148 else if (stat("/usr/sbin/ip6tables", &s) == 0)
149 iptables = "/usr/sbin/ip6tables";
150 }
151 else {
152 if (stat("/sbin/iptables", &s) == 0)
153 iptables = "/sbin/iptables";
154 else if (stat("/usr/sbin/iptables", &s) == 0)
155 iptables = "/usr/sbin/iptables";
156 }
157
158 if (iptables == NULL) {
159 fprintf(stderr, "Error: iptables command not found\n");
160 exit(1);
161 }
162
163 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, iptables, "-vL");
164}
diff --git a/src/firejail/netns.c b/src/firejail/netns.c
index fdd108652..b5d6fb636 100644
--- a/src/firejail/netns.c
+++ b/src/firejail/netns.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2017 Firejail Authors 2 * Copyright (C) 2020-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -49,7 +49,7 @@ void check_netns(const char *nsname) {
49 fprintf(stderr, "Error: invalid netns name %s\n", nsname); 49 fprintf(stderr, "Error: invalid netns name %s\n", nsname);
50 exit(1); 50 exit(1);
51 } 51 }
52 invalid_filename(nsname); 52 invalid_filename(nsname, 0); // no globbing
53 char *control_file = netns_control_file(nsname); 53 char *control_file = netns_control_file(nsname);
54 54
55 EUID_ASSERT(); 55 EUID_ASSERT();
@@ -60,7 +60,7 @@ void check_netns(const char *nsname) {
60 nsname, control_file, strerror(errno)); 60 nsname, control_file, strerror(errno));
61 exit(1); 61 exit(1);
62 } 62 }
63 if (!S_ISREG(st.st_mode)) { 63 if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) {
64 fprintf(stderr, "Error: invalid netns '%s' (%s: not a regular file)\n", 64 fprintf(stderr, "Error: invalid netns '%s' (%s: not a regular file)\n",
65 nsname, control_file); 65 nsname, control_file);
66 exit(1); 66 exit(1);
diff --git a/src/firejail/network.c b/src/firejail/network.c
index f7ddef917..289e164c6 100644
--- a/src/firejail/network.c
+++ b/src/firejail/network.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -28,6 +28,40 @@
28#include <net/route.h> 28#include <net/route.h>
29#include <linux/if_bridge.h> 29#include <linux/if_bridge.h>
30 30
31// return 1 if addr is a IPv4 or IPv6 address
32int check_ip46_address(const char *addr) {
33 // check ipv4 address
34 uint32_t tmp;
35 if (atoip(addr, &tmp) == 0)
36 return 1;
37
38 // check ipv6 address
39 struct in6_addr result;
40
41 char *tmpstr = strdup(addr);
42 if (!tmpstr)
43 errExit("strdup");
44 char *ptr = strchr(tmpstr, '/');
45 if (ptr) {
46 *ptr = '\0';
47 ptr++;
48 int mask = atoi(ptr);
49 // check the network mask
50 if (mask < 0 || mask > 128) {
51 free(tmpstr);
52 return 0;
53 }
54 }
55 if (inet_pton(AF_INET6, tmpstr, &result) == 1) {
56 free(tmpstr);
57 return 1;
58 }
59
60 free(tmpstr);
61
62 // failed
63 return 0;
64}
31 65
32int net_get_mtu(const char *ifname) { 66int net_get_mtu(const char *ifname) {
33 int mtu = 0; 67 int mtu = 0;
@@ -44,7 +78,7 @@ int net_get_mtu(const char *ifname) {
44 78
45 memset(&ifr, 0, sizeof(ifr)); 79 memset(&ifr, 0, sizeof(ifr));
46 ifr.ifr_addr.sa_family = AF_INET; 80 ifr.ifr_addr.sa_family = AF_INET;
47 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 81 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
48 if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) == 0) 82 if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) == 0)
49 mtu = ifr.ifr_mtu; 83 mtu = ifr.ifr_mtu;
50 if (arg_debug) 84 if (arg_debug)
@@ -72,7 +106,7 @@ void net_set_mtu(const char *ifname, int mtu) {
72 106
73 memset(&ifr, 0, sizeof(ifr)); 107 memset(&ifr, 0, sizeof(ifr));
74 ifr.ifr_addr.sa_family = AF_INET; 108 ifr.ifr_addr.sa_family = AF_INET;
75 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 109 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
76 ifr.ifr_mtu = mtu; 110 ifr.ifr_mtu = mtu;
77 if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) != 0) 111 if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) != 0)
78 fwarning("cannot set mtu for interface %s\n", ifname); 112 fwarning("cannot set mtu for interface %s\n", ifname);
@@ -149,7 +183,6 @@ int net_add_route(uint32_t ip, uint32_t mask, uint32_t gw) {
149 int sock; 183 int sock;
150 struct rtentry route; 184 struct rtentry route;
151 struct sockaddr_in *addr; 185 struct sockaddr_in *addr;
152 int err = 0;
153 186
154 // create the socket 187 // create the socket
155 if((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) 188 if((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
@@ -171,7 +204,7 @@ int net_add_route(uint32_t ip, uint32_t mask, uint32_t gw) {
171 204
172 route.rt_flags = RTF_UP | RTF_GATEWAY; 205 route.rt_flags = RTF_UP | RTF_GATEWAY;
173 route.rt_metric = 0; 206 route.rt_metric = 0;
174 if ((err = ioctl(sock, SIOCADDRT, &route)) != 0) { 207 if (ioctl(sock, SIOCADDRT, &route) != 0) {
175 close(sock); 208 close(sock);
176 return -1; 209 return -1;
177 } 210 }
@@ -184,7 +217,7 @@ int net_add_route(uint32_t ip, uint32_t mask, uint32_t gw) {
184 217
185#define BUFSIZE 1024 218#define BUFSIZE 1024
186uint32_t network_get_defaultgw(void) { 219uint32_t network_get_defaultgw(void) {
187 FILE *fp = fopen("/proc/self/net/route", "r"); 220 FILE *fp = fopen("/proc/self/net/route", "re");
188 if (!fp) 221 if (!fp)
189 errExit("fopen"); 222 errExit("fopen");
190 223
@@ -195,7 +228,7 @@ uint32_t network_get_defaultgw(void) {
195 continue; 228 continue;
196 229
197 char *ptr = buf; 230 char *ptr = buf;
198 while (*ptr != ' ' && *ptr != '\t') 231 while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0')
199 ptr++; 232 ptr++;
200 while (*ptr == ' ' || *ptr == '\t') 233 while (*ptr == ' ' || *ptr == '\t')
201 ptr++; 234 ptr++;
@@ -235,7 +268,7 @@ int net_get_mac(const char *ifname, unsigned char mac[6]) {
235 errExit("socket"); 268 errExit("socket");
236 269
237 memset(&ifr, 0, sizeof(ifr)); 270 memset(&ifr, 0, sizeof(ifr));
238 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 271 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
239 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; 272 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
240 273
241 if (ioctl(sock, SIOCGIFHWADDR, &ifr) == -1) 274 if (ioctl(sock, SIOCGIFHWADDR, &ifr) == -1)
diff --git a/src/firejail/network.txt b/src/firejail/network.txt
deleted file mode 100644
index 75bdc346d..000000000
--- a/src/firejail/network.txt
+++ /dev/null
@@ -1,95 +0,0 @@
1struct Bridge {
2 char *dev; // bridge device name
3 uint32_t ip; // bridge device IP address
4 uint32_t mask; // bridge device mask
5 uint32_t ipsandbox // sandbox interface IP address
6}
7
8net_configure_bridge(br, device) {
9 br->dev = devname;
10 br->ip = extracted from kernel device - using net_get_if_addr() in network.c
11 br->mask = extracted from kernel device - using net_get_if_addr() in network.c
12 check available network range; /31 networks are not supported
13}
14
15net_configure_sandbox_ip(br) {
16 if br->ip_sandbox
17 check br->ipsandbox inside the bridge network
18 arp_check(br->ipsandbox) // send an arp req to check if anybody else is using this address
19 else
20 br->ipsandbox = arp_assign();
21}
22
23net_configure_veth_pair {
24 create a veth pair
25 place one interface end in the bridge
26 place the other end in the namespace of the child process
27}
28
29net_bridge_wait_ip {
30 arp_check br->ipsandbox address to come up
31 wait for not more than 5 seconds
32}
33
34main() {
35
36 foreach argv[i] {
37 if --net
38 br = next bridge available
39 net_configure_bridge(br, device name from argv[i]);
40 else if --ip
41 br = last bridge configured
42 br->ipsandbox = ip address extracted from argv[i]
43 else if --defaultgw
44 cfg.defaultgw = ip address extracted from argv[i]
45 }
46
47 net_check_cfg(); // check the validity of network configuration so far
48
49 if (any bridge configured) {
50 lock /var/lock/firejail.lock file
51 for each bridge
52 net_configure_sandbox_ip(br)
53 }
54
55 clone (new network namespace if any bridge configured or --net=none)
56
57 if (any bridge configured) {
58 for each bridge
59 net_configure_veth_pair
60 }
61
62 notify child init is done
63
64 if (any bridge configured) {
65 for each bridge
66 net_bridge_wait_ip
67 unlock /var/lock/firejail.lock file
68 }
69
70 wait on child
71 exit
72}
73
74
75******************************************************
76* macvlan notes
77******************************************************
78Configure a macvlan interface
79
80# ip link add virtual0 link eth0 type macvlan mode bridge
81(you can configure it with # ifconfig virtual0 192.168.1.52/24 up)
82
83Create a new network namespace and move the interface in the new network namespace
84
85# ip netns add dummy0
86# ip link set virtual0 netns dummy0
87
88Join the namespace and configure the interfaces
89
90# ip netns exec dummy0 bash
91# ifconfig lo up
92# ifconfig virtual0 192.168.1.52/24
93
94Investigate ipvlan interface - added to linux kernel 3.19
95https://github.com/torvalds/linux/blob/master/Documentation/networking/ipvlan.txt
diff --git a/src/firejail/network_main.c b/src/firejail/network_main.c
index 172395146..d3e75bbed 100644
--- a/src/firejail/network_main.c
+++ b/src/firejail/network_main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -24,14 +24,13 @@
24#include <unistd.h> 24#include <unistd.h>
25#include <net/if.h> 25#include <net/if.h>
26#include <stdarg.h> 26#include <stdarg.h>
27#include <sys/wait.h>
27 28
28// configure bridge structure 29// configure bridge structure
29// - extract ip address and mask from the bridge interface 30// - extract ip address and mask from the bridge interface
30void net_configure_bridge(Bridge *br, char *dev_name) { 31static void net_configure_bridge(Bridge *br) {
31 assert(br); 32 assert(br);
32 assert(dev_name); 33 assert(br->dev);
33
34 br->dev = dev_name;
35 34
36 // check the bridge device exists 35 // check the bridge device exists
37 char sysbridge[30 + strlen(br->dev)]; 36 char sysbridge[30 + strlen(br->dev)];
@@ -57,13 +56,13 @@ void net_configure_bridge(Bridge *br, char *dev_name) {
57 } 56 }
58 } 57 }
59 58
60 // allow unconfigured interfaces 59 int mtu = br->mtu; // preserve mtu value in case the user changed it with --mtu
61 if (net_get_if_addr(br->dev, &br->ip, &br->mask, br->mac, &br->mtu)) { 60 if (net_get_if_addr(br->dev, &br->ip, &br->mask, br->mac, &br->mtu))
61 // allow unconfigured interfaces
62 fwarning("the network interface %s is not configured\n", br->dev); 62 fwarning("the network interface %s is not configured\n", br->dev);
63 br->configured = 1; 63 if (mtu)
64 br->arg_ip_none = 1; 64 br->mtu = mtu;
65 return; 65
66 }
67 if (arg_debug) { 66 if (arg_debug) {
68 if (br->macvlan == 0) 67 if (br->macvlan == 0)
69 printf("Bridge device %s at %d.%d.%d.%d/%d\n", 68 printf("Bridge device %s at %d.%d.%d.%d/%d\n",
@@ -73,13 +72,40 @@ void net_configure_bridge(Bridge *br, char *dev_name) {
73 br->dev, PRINT_IP(br->ip), mask2bits(br->mask)); 72 br->dev, PRINT_IP(br->ip), mask2bits(br->mask));
74 } 73 }
75 74
76 uint32_t range = ~br->mask + 1; // the number of potential addresses 75 if (br->mask) {
77 // this software is not supported for /31 networks 76 uint32_t range = ~br->mask + 1; // the number of potential addresses
78 if (range < 4) { 77 // this software is not supported for /31 networks
79 fprintf(stderr, "Error: the software is not supported for /31 networks\n"); 78 if (range < 4) {
79 fprintf(stderr, "Error: the software is not supported for /31 networks\n");
80 exit(1);
81 }
82 }
83
84
85 // no interface network mask - no ip address will be configured
86 if (br->mask == 0)
87 goto err_no_ip;
88 // no interface ip - extract the network address from the address configured by the user
89 else if (br->ip == 0 && br->ipsandbox)
90 br->ip = br->ipsandbox & br->mask;
91 // no interface ip - extract the network address from the default gateway configured by the user
92 else if (br->ip == 0 && cfg.defaultgw)
93 br->ip = cfg.defaultgw & br->mask;
94 // no ip address will be configured
95 else if (br->ip == 0)
96 goto err_no_ip;
97
98 if ((br->iprange_start && in_netrange(br->iprange_start, br->ip, br->mask)) ||
99 (br->iprange_end && in_netrange(br->iprange_end, br->ip, br->mask))) {
100 fprintf(stderr, "Error: IP range addresses not in network range\n");
80 exit(1); 101 exit(1);
81 } 102 }
82 br->configured = 1; 103
104 return;
105
106err_no_ip:
107 br->arg_ip_none = 1;
108 fwarning("Not enough information to configure an IP address for\n interface --net=%s\n", br->dev);
83} 109}
84 110
85 111
@@ -94,7 +120,7 @@ void net_configure_sandbox_ip(Bridge *br) {
94 // check network range 120 // check network range
95 char *rv = in_netrange(br->ipsandbox, br->ip, br->mask); 121 char *rv = in_netrange(br->ipsandbox, br->ip, br->mask);
96 if (rv) { 122 if (rv) {
97 fprintf(stderr, "%s", rv); 123 fprintf(stderr, "%s\n", rv);
98 exit(1); 124 exit(1);
99 } 125 }
100 // send an ARP request and check if there is anybody on this IP address 126 // send an ARP request and check if there is anybody on this IP address
@@ -131,7 +157,7 @@ void net_configure_veth_pair(Bridge *br, const char *ifname, pid_t child) {
131 char *cstr; 157 char *cstr;
132 if (asprintf(&cstr, "%d", child) == -1) 158 if (asprintf(&cstr, "%d", child) == -1)
133 errExit("asprintf"); 159 errExit("asprintf");
134 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 7, PATH_FNET, "create", "veth", dev, ifname, br->dev, cstr); 160 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 7, PATH_FNET_MAIN, "create", "veth", dev, ifname, br->dev, cstr);
135 free(cstr); 161 free(cstr);
136 162
137 char *msg; 163 char *msg;
@@ -145,7 +171,6 @@ void net_configure_veth_pair(Bridge *br, const char *ifname, pid_t child) {
145// the default address should be in the range of at least on of the bridge devices 171// the default address should be in the range of at least on of the bridge devices
146void check_default_gw(uint32_t defaultgw) { 172void check_default_gw(uint32_t defaultgw) {
147 assert(defaultgw); 173 assert(defaultgw);
148
149 if (cfg.bridge0.configured) { 174 if (cfg.bridge0.configured) {
150 char *rv = in_netrange(defaultgw, cfg.bridge0.ip, cfg.bridge0.mask); 175 char *rv = in_netrange(defaultgw, cfg.bridge0.ip, cfg.bridge0.mask);
151 if (rv == 0) 176 if (rv == 0)
@@ -174,14 +199,22 @@ void check_default_gw(uint32_t defaultgw) {
174void net_check_cfg(void) { 199void net_check_cfg(void) {
175 EUID_ASSERT(); 200 EUID_ASSERT();
176 int net_configured = 0; 201 int net_configured = 0;
177 if (cfg.bridge0.configured) 202 if (cfg.bridge0.configured) {
203 net_configure_bridge(&cfg.bridge0);
178 net_configured++; 204 net_configured++;
179 if (cfg.bridge1.configured) 205 }
206 if (cfg.bridge1.configured) {
207 net_configure_bridge(&cfg.bridge1);
180 net_configured++; 208 net_configured++;
181 if (cfg.bridge2.configured) 209 }
210 if (cfg.bridge2.configured) {
211 net_configure_bridge(&cfg.bridge2);
182 net_configured++; 212 net_configured++;
183 if (cfg.bridge3.configured) 213 }
214 if (cfg.bridge3.configured) {
215 net_configure_bridge(&cfg.bridge3);
184 net_configured++; 216 net_configured++;
217 }
185 218
186 int if_configured = 0; 219 int if_configured = 0;
187 if (cfg.interface0.configured) 220 if (cfg.interface0.configured)
@@ -213,6 +246,10 @@ void net_check_cfg(void) {
213 if (cfg.defaultgw) 246 if (cfg.defaultgw)
214 check_default_gw(cfg.defaultgw); 247 check_default_gw(cfg.defaultgw);
215 else { 248 else {
249 // if the first network has no assigned address,
250 // do not try to set up a gateway, because it will fail
251 if (cfg.bridge0.arg_ip_none)
252 return;
216 // first network is a regular bridge 253 // first network is a regular bridge
217 if (cfg.bridge0.macvlan == 0) 254 if (cfg.bridge0.macvlan == 0)
218 cfg.defaultgw = cfg.bridge0.ip; 255 cfg.defaultgw = cfg.bridge0.ip;
@@ -236,38 +273,42 @@ void net_dns_print(pid_t pid) {
236 EUID_ASSERT(); 273 EUID_ASSERT();
237 // drop privileges - will not be able to read /etc/resolv.conf for --noroot option 274 // drop privileges - will not be able to read /etc/resolv.conf for --noroot option
238 275
239 // if the pid is that of a firejail process, use the pid of the first child process 276 // in case the pid is that of a firejail process, use the pid of the first child process
240 EUID_ROOT(); 277 pid = switch_to_child(pid);
241 char *comm = pid_proc_comm(pid);
242 EUID_USER();
243 if (comm) {
244 if (strcmp(comm, "firejail") == 0) {
245 pid_t child;
246 if (find_child(pid, &child) == 0) {
247 pid = child;
248 }
249 }
250 free(comm);
251 }
252 278
253 char *fname; 279 // exit if no permission to join the sandbox
254 EUID_ROOT(); 280 check_join_permission(pid);
255 if (asprintf(&fname, "/proc/%d/root/etc/resolv.conf", pid) == -1)
256 errExit("asprintf");
257 281
258 // access /etc/resolv.conf 282 EUID_ROOT();
259 FILE *fp = fopen(fname, "r"); 283 if (join_namespace(pid, "mnt"))
260 if (!fp) {
261 fprintf(stderr, "Error: cannot access /etc/resolv.conf\n");
262 exit(1); 284 exit(1);
285
286 pid_t child = fork();
287 if (child < 0)
288 errExit("fork");
289 if (child == 0) {
290 caps_drop_all();
291 if (chdir("/") < 0)
292 errExit("chdir");
293
294 // access /etc/resolv.conf
295 FILE *fp = fopen("/etc/resolv.conf", "re");
296 if (!fp) {
297 fprintf(stderr, "Error: cannot access /etc/resolv.conf\n");
298 exit(1);
299 }
300
301 char buf[MAXBUF];
302 while (fgets(buf, MAXBUF, fp))
303 printf("%s", buf);
304 printf("\n");
305 fclose(fp);
306 exit(0);
263 } 307 }
264 308
265 char buf[MAXBUF]; 309 // wait for the child to finish
266 while (fgets(buf, MAXBUF, fp)) 310 waitpid(child, NULL, 0);
267 printf("%s", buf); 311 flush_stdin();
268 printf("\n");
269 fclose(fp);
270 free(fname);
271 exit(0); 312 exit(0);
272} 313}
273 314
@@ -282,43 +323,50 @@ void network_main(pid_t child) {
282 net_configure_veth_pair(&cfg.bridge0, "eth0", child); 323 net_configure_veth_pair(&cfg.bridge0, "eth0", child);
283 } 324 }
284 else 325 else
285 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET, "create", "macvlan", cfg.bridge0.devsandbox, cfg.bridge0.dev, cstr); 326 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET_MAIN, "create", "macvlan", cfg.bridge0.devsandbox, cfg.bridge0.dev, cstr);
286 } 327 }
287 328
288 if (cfg.bridge1.configured) { 329 if (cfg.bridge1.configured) {
289 if (cfg.bridge1.macvlan == 0) 330 if (cfg.bridge1.macvlan == 0)
290 net_configure_veth_pair(&cfg.bridge1, "eth1", child); 331 net_configure_veth_pair(&cfg.bridge1, "eth1", child);
291 else 332 else
292 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET, "create", "macvlan", cfg.bridge1.devsandbox, cfg.bridge1.dev, cstr); 333 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET_MAIN, "create", "macvlan", cfg.bridge1.devsandbox, cfg.bridge1.dev, cstr);
293 } 334 }
294 335
295 if (cfg.bridge2.configured) { 336 if (cfg.bridge2.configured) {
296 if (cfg.bridge2.macvlan == 0) 337 if (cfg.bridge2.macvlan == 0)
297 net_configure_veth_pair(&cfg.bridge2, "eth2", child); 338 net_configure_veth_pair(&cfg.bridge2, "eth2", child);
298 else 339 else
299 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET, "create", "macvlan", cfg.bridge2.devsandbox, cfg.bridge2.dev, cstr); 340 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET_MAIN, "create", "macvlan", cfg.bridge2.devsandbox, cfg.bridge2.dev, cstr);
300 } 341 }
301 342
302 if (cfg.bridge3.configured) { 343 if (cfg.bridge3.configured) {
303 if (cfg.bridge3.macvlan == 0) 344 if (cfg.bridge3.macvlan == 0)
304 net_configure_veth_pair(&cfg.bridge3, "eth3", child); 345 net_configure_veth_pair(&cfg.bridge3, "eth3", child);
305 else 346 else
306 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET, "create", "macvlan", cfg.bridge3.devsandbox, cfg.bridge3.dev, cstr); 347 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 6, PATH_FNET_MAIN, "create", "macvlan", cfg.bridge3.devsandbox, cfg.bridge3.dev, cstr);
307 } 348 }
308 349
309 // move interfaces in sandbox 350 // move interfaces in sandbox
310 if (cfg.interface0.configured) { 351 if (cfg.interface0.configured) {
311 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET, "moveif", cfg.interface0.dev, cstr); 352 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET_MAIN, "moveif", cfg.interface0.dev, cstr);
312 } 353 }
313 if (cfg.interface1.configured) { 354 if (cfg.interface1.configured) {
314 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET, "moveif", cfg.interface1.dev, cstr); 355 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET_MAIN, "moveif", cfg.interface1.dev, cstr);
315 } 356 }
316 if (cfg.interface2.configured) { 357 if (cfg.interface2.configured) {
317 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET, "moveif", cfg.interface2.dev, cstr); 358 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET_MAIN, "moveif", cfg.interface2.dev, cstr);
318 } 359 }
319 if (cfg.interface3.configured) { 360 if (cfg.interface3.configured) {
320 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET, "moveif", cfg.interface3.dev, cstr); 361 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 4, PATH_FNET_MAIN, "moveif", cfg.interface3.dev, cstr);
321 } 362 }
322 363
323 free(cstr); 364 free(cstr);
324} 365}
366
367void net_print(pid_t pid) {
368 EUID_ASSERT();
369
370 enter_network_namespace(pid);
371 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, PATH_FNET_MAIN, "printif");
372}
diff --git a/src/firejail/no_sandbox.c b/src/firejail/no_sandbox.c
index 83737c73d..0e5562d90 100644
--- a/src/firejail/no_sandbox.c
+++ b/src/firejail/no_sandbox.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,6 +20,7 @@
20#include "firejail.h" 20#include "firejail.h"
21#include <sys/types.h> 21#include <sys/types.h>
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <errno.h>
23#include <unistd.h> 24#include <unistd.h>
24#include <grp.h> 25#include <grp.h>
25 26
@@ -41,13 +42,14 @@ int check_namespace_virt(void) {
41 EUID_ASSERT(); 42 EUID_ASSERT();
42 43
43 // check container environment variable 44 // check container environment variable
44 char *str = getenv("container"); 45 const char *str = env_get("container");
45 if (str && is_container(str)) 46 if (str && is_container(str))
46 return 1; 47 return 1;
47 48
48 // check PID 1 container environment variable 49 // check PID 1 container environment variable
49 EUID_ROOT(); 50 EUID_ROOT();
50 FILE *fp = fopen("/proc/1/environ", "r"); 51 FILE *fp = fopen("/proc/1/environ", "re");
52 EUID_USER();
51 if (fp) { 53 if (fp) {
52 int c = 0; 54 int c = 0;
53 while (c != EOF) { 55 while (c != EOF) {
@@ -68,7 +70,6 @@ int check_namespace_virt(void) {
68 // found it 70 // found it
69 if (is_container(buf + 10)) { 71 if (is_container(buf + 10)) {
70 fclose(fp); 72 fclose(fp);
71 EUID_USER();
72 return 1; 73 return 1;
73 } 74 }
74 } 75 }
@@ -78,7 +79,6 @@ int check_namespace_virt(void) {
78 fclose(fp); 79 fclose(fp);
79 } 80 }
80 81
81 EUID_USER();
82 return 0; 82 return 0;
83} 83}
84 84
@@ -89,7 +89,7 @@ int check_kernel_procs(void) {
89 // only user processes are available in /proc when running grsecurity 89 // only user processes are available in /proc when running grsecurity
90 // EUID_ASSERT(); 90 // EUID_ASSERT();
91 91
92 char *kern_proc[] = { 92 static char *kern_proc[] = {
93 "kthreadd", 93 "kthreadd",
94 "ksoftirqd", 94 "ksoftirqd",
95 "kworker", 95 "kworker",
@@ -105,20 +105,15 @@ int check_kernel_procs(void) {
105 // look at the first 10 processes 105 // look at the first 10 processes
106 // if a kernel process is found, return 1 106 // if a kernel process is found, return 1
107 for (i = 1; i <= 10; i++) { 107 for (i = 1; i <= 10; i++) {
108 struct stat s;
109 char *fname; 108 char *fname;
110 if (asprintf(&fname, "/proc/%d/comm", i) == -1) 109 if (asprintf(&fname, "/proc/%d/comm", i) == -1)
111 errExit("asprintf"); 110 errExit("asprintf");
112 if (stat(fname, &s) == -1) {
113 free(fname);
114 continue;
115 }
116 111
117 // open file 112 // open file
118 /* coverity[toctou] */ 113 FILE *fp = fopen(fname, "re");
119 FILE *fp = fopen(fname, "r");
120 if (!fp) { 114 if (!fp) {
121 fwarning("cannot open %s\n", fname); 115 if (errno != ENOENT)
116 fwarning("cannot open %s\n", fname);
122 free(fname); 117 free(fname);
123 continue; 118 continue;
124 } 119 }
@@ -161,41 +156,24 @@ int check_kernel_procs(void) {
161 156
162void run_no_sandbox(int argc, char **argv) { 157void run_no_sandbox(int argc, char **argv) {
163 EUID_ASSERT(); 158 EUID_ASSERT();
159 // drop privileges
160 if (setresgid(-1, getgid(), getgid()) != 0)
161 errExit("setresgid");
162 if (setresuid(-1, getuid(), getuid()) != 0)
163 errExit("setresuid");
164 164
165 // process limited subset of options 165 // process limited subset of options
166 // and find first non option arg:
167 // - first argument not starting with --,
168 // - whatever follows after -c (example: firejail -c ls)
169 int prog_index = 0;
166 int i; 170 int i;
167 for (i = 0; i < argc; i++) { 171 for (i = 1; i < argc; i++) {
168 if (strcmp(argv[i], "--debug") == 0) 172 if (strcmp(argv[i], "--debug") == 0)
169 arg_debug = 1; 173 arg_debug = 1;
170 else if (strcmp(argv[i], "--csh") == 0 || 174 else if (strncmp(argv[i], "--shell=", 8) == 0)
171 strcmp(argv[i], "--zsh") == 0 || 175 fwarning("shell-related command line options are disregarded\n");
172 strcmp(argv[i], "--shell=none") == 0 || 176 else if (strcmp(argv[i], "-c") == 0) {
173 strncmp(argv[i], "--shell=", 8) == 0)
174 fwarning("shell-related command line options are disregarded - using SHELL environment variable\n");
175 }
176
177 // use $SHELL to get shell used in sandbox
178 char *shell = getenv("SHELL");
179 if (shell && access(shell, R_OK) == 0)
180 cfg.shell = shell;
181
182 // guess shell otherwise
183 if (!cfg.shell) {
184 cfg.shell = guess_shell();
185 if (arg_debug)
186 printf("Autoselecting %s as shell\n", cfg.shell);
187 }
188 if (!cfg.shell) {
189 fprintf(stderr, "Error: unable to guess your shell, please set SHELL environment variable\n");
190 exit(1);
191 }
192
193 int prog_index = 0;
194 // find first non option arg:
195 // - first argument not starting wiht --,
196 // - whatever follows after -c (example: firejail -c ls)
197 for (i = 1; i < argc; i++) {
198 if (strcmp(argv[i], "-c") == 0) {
199 prog_index = i + 1; 177 prog_index = i + 1;
200 if (prog_index == argc) { 178 if (prog_index == argc) {
201 fprintf(stderr, "Error: option -c requires an argument\n"); 179 fprintf(stderr, "Error: option -c requires an argument\n");
@@ -204,36 +182,37 @@ void run_no_sandbox(int argc, char **argv) {
204 break; 182 break;
205 } 183 }
206 // check first argument not starting with -- 184 // check first argument not starting with --
207 if (strncmp(argv[i],"--",2) != 0) { 185 else if (strncmp(argv[i],"--",2) != 0) {
208 prog_index = i; 186 prog_index = i;
209 break; 187 break;
210 } 188 }
211 } 189 }
212 // if shell is /usr/bin/firejail, replace it with /bin/bash
213 if (strcmp(cfg.shell, PATH_FIREJAIL) == 0) {
214 cfg.shell = "/bin/bash";
215 prog_index = 0;
216 }
217 190
218 if (prog_index == 0) { 191 if (prog_index == 0) {
219 cfg.command_line = cfg.shell; 192 // got no command, require a shell and try to execute it
193 cfg.shell = guess_shell();
194 if (!cfg.shell) {
195 fprintf(stderr, "Error: unable to guess your shell, please set SHELL environment variable\n");
196 exit(1);
197 }
198
199 assert(cfg.command_line == NULL);
220 cfg.window_title = cfg.shell; 200 cfg.window_title = cfg.shell;
221 } else { 201 } else {
222 build_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, prog_index); 202 // this sandbox might not allow execution of a shell
203 // force --shell=none in order to not break firecfg symbolic links
204 arg_shell_none = 1;
205
206 build_cmdline(&cfg.command_line, &cfg.window_title, argc, argv, prog_index, true);
223 } 207 }
224 208
209 fwarning("an existing sandbox was detected. "
210 "%s will run without any additional sandboxing features\n", prog_index ? argv[prog_index] : cfg.shell);
211
225 cfg.original_argv = argv; 212 cfg.original_argv = argv;
226 cfg.original_program_index = prog_index; 213 cfg.original_program_index = prog_index;
227 214
228 char *command;
229 if (prog_index == 0)
230 command = cfg.shell;
231 else
232 command = argv[prog_index];
233 fwarning("an existing sandbox was detected. "
234 "%s will run without any additional sandboxing features\n", command);
235
236 arg_quiet = 1; 215 arg_quiet = 1;
237 216
238 start_application(1); 217 start_application(1, -1, NULL);
239} 218}
diff --git a/src/firejail/output.c b/src/firejail/output.c
index b99604ec4..ce10ab157 100644
--- a/src/firejail/output.c
+++ b/src/firejail/output.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -22,14 +22,21 @@
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <unistd.h> 23#include <unistd.h>
24 24
25#ifdef HAVE_OUTPUT
25void check_output(int argc, char **argv) { 26void check_output(int argc, char **argv) {
26 EUID_ASSERT(); 27 EUID_ASSERT();
27 28
28 int i; 29 int i;
29 int outindex = 0; 30 int outindex = 0;
30 int enable_stderr = 0; 31 int enable_stderr = 0;
31 32
32 for (i = 1; i < argc; i++) { 33 for (i = 1; i < argc; i++) {
34 if (strncmp(argv[i], "--", 2) != 0) {
35 return;
36 }
37 if (strcmp(argv[i], "--") == 0) {
38 return;
39 }
33 if (strncmp(argv[i], "--output=", 9) == 0) { 40 if (strncmp(argv[i], "--output=", 9) == 0) {
34 outindex = i; 41 outindex = i;
35 break; 42 break;
@@ -43,12 +50,20 @@ void check_output(int argc, char **argv) {
43 if (!outindex) 50 if (!outindex)
44 return; 51 return;
45 52
46
47 // check filename
48 drop_privs(0); 53 drop_privs(0);
49 char *outfile = argv[outindex]; 54 char *outfile = argv[outindex];
50 outfile += (enable_stderr)? 16:9; 55 outfile += (enable_stderr)? 16:9;
51 invalid_filename(outfile); 56
57 // check filename
58 invalid_filename(outfile, 0); // no globbing
59
60 // expand user home directory
61 if (outfile[0] == '~') {
62 char *full;
63 if (asprintf(&full, "%s%s", cfg.homedir, outfile + 1) == -1)
64 errExit("asprintf");
65 outfile = full;
66 }
52 67
53 // do not accept directories, links, and files with ".." 68 // do not accept directories, links, and files with ".."
54 if (strstr(outfile, "..") || is_link(outfile) || is_dir(outfile)) { 69 if (strstr(outfile, "..") || is_link(outfile) || is_dir(outfile)) {
@@ -71,39 +86,76 @@ void check_output(int argc, char **argv) {
71 } 86 }
72 } 87 }
73 88
74 // build the new command line 89 int pipefd[2];
75 int len = 0; 90 if (pipe(pipefd) == -1) {
76 for (i = 0; i < argc; i++) { 91 errExit("pipe");
77 len += strlen(argv[i]) + 1; // + ' '
78 } 92 }
79 len += 100 + strlen(LIBDIR) + strlen(outfile); // tee command 93
80 94 pid_t pid = fork();
81 char *cmd = malloc(len + 1); // + '\0' 95 if (pid == -1) {
82 if (!cmd) 96 errExit("fork");
83 errExit("malloc"); 97 } else if (pid == 0) {
84 98 /* child */
85 char *ptr = cmd; 99 if (dup2(pipefd[0], STDIN_FILENO) == -1) {
86 for (i = 0; i < argc; i++) { 100 errExit("dup2");
87 if (strncmp(argv[i], "--output=", 9) == 0) 101 }
88 continue; 102 close(pipefd[1]);
89 if (strncmp(argv[i], "--output-stderr=", 16) == 0) 103 if (pipefd[0] != STDIN_FILENO) {
90 continue; 104 close(pipefd[0]);
91 ptr += sprintf(ptr, "%s ", argv[i]); 105 }
106
107 // restore some environment variables
108 env_apply_whitelist_sbox();
109
110 char *args[3];
111 args[0] = LIBDIR "/firejail/ftee";
112 args[1] = outfile;
113 args[2] = NULL;
114 execv(args[0], args);
115 perror("execvp");
116 exit(1);
117 }
118
119 /* parent */
120 if (dup2(pipefd[1], STDOUT_FILENO) == -1) {
121 errExit("dup2");
122 }
123 if (enable_stderr && dup2(STDOUT_FILENO, STDERR_FILENO) == -1) {
124 errExit("dup2");
125 }
126 close(pipefd[0]);
127 if (pipefd[1] != STDOUT_FILENO) {
128 close(pipefd[1]);
92 } 129 }
93 130
94 if (enable_stderr) 131 char **args = calloc(argc + 1, sizeof(char *));
95 sprintf(ptr, "2>&1 | %s/firejail/ftee %s", LIBDIR, outfile); 132 if (!args) {
96 else 133 errExit("calloc");
97 sprintf(ptr, " | %s/firejail/ftee %s", LIBDIR, outfile); 134 }
98 135 bool found_separator = false;
99 // run command 136 /* copy argv into args, but drop --output(-stderr) arguments */
100 char *a[4]; 137 int j;
101 a[0] = "/bin/bash"; 138 for (i = 0, j = 0; i < argc; i++) {
102 a[1] = "-c"; 139 if (!found_separator && i > 0) {
103 a[2] = cmd; 140 if (strncmp(argv[i], "--output=", 9) == 0) {
104 a[3] = NULL; 141 continue;
105 execvp(a[0], a); 142 }
143 if (strncmp(argv[i], "--output-stderr=", 16) == 0) {
144 continue;
145 }
146 if (strncmp(argv[i], "--", 2) != 0 || strcmp(argv[i], "--") == 0) {
147 found_separator = true;
148 }
149 }
150 args[j++] = argv[i];
151 }
152
153 // restore original environment variables
154 env_apply_all();
155
156 execvp(args[0], args);
106 157
107 perror("execvp"); 158 perror("execvp");
108 exit(1); 159 exit(1);
109} 160}
161#endif
diff --git a/src/firejail/paths.c b/src/firejail/paths.c
index 454255717..d58a9d272 100644
--- a/src/firejail/paths.c
+++ b/src/firejail/paths.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -24,14 +24,15 @@ static char **paths = 0;
24static unsigned int path_cnt = 0; 24static unsigned int path_cnt = 0;
25static unsigned int longest_path_elt = 0; 25static unsigned int longest_path_elt = 0;
26 26
27static char *elt = NULL; // moved from inside init_paths in order to get rid of scan-build warning
27static void init_paths(void) { 28static void init_paths(void) {
28 char *path = getenv("PATH"); 29 const char *env_path = env_get("PATH");
29 char *p; 30 char *p;
30 if (!path) { 31 if (!env_path) {
31 path = "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"; 32 env_path = "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin";
32 setenv("PATH", path, 1); 33 env_store_name_val("PATH", env_path, SETENV);
33 } 34 }
34 path = strdup(path); 35 char *path = strdup(env_path);
35 if (!path) 36 if (!path)
36 errExit("strdup"); 37 errExit("strdup");
37 38
@@ -44,12 +45,12 @@ static void init_paths(void) {
44 paths = calloc(path_cnt, sizeof(char *)); 45 paths = calloc(path_cnt, sizeof(char *));
45 if (!paths) 46 if (!paths)
46 errExit("calloc"); 47 errExit("calloc");
48 memset(paths, 0, path_cnt * sizeof(char *)); // get rid of false positive error from GCC static analyzer
47 49
48 // fill in 'paths' with pointers to elements of 'path' 50 // fill in 'paths' with pointers to elements of 'path'
49 char *elt;
50 unsigned int i = 0, j; 51 unsigned int i = 0, j;
51 unsigned int len; 52 unsigned int len;
52 while ((elt = strsep(&path, ":")) != 0) { 53 while ((elt = strsep(&path, ":")) != NULL) {
53 // skip any entry that is not absolute 54 // skip any entry that is not absolute
54 if (elt[0] != '/') 55 if (elt[0] != '/')
55 goto skip; 56 goto skip;
@@ -73,7 +74,7 @@ static void init_paths(void) {
73 skip:; 74 skip:;
74 } 75 }
75 76
76 assert(paths[i] == 0); 77 assert(paths[i] == NULL);
77 // path_cnt may be too big now, if entries were skipped above 78 // path_cnt may be too big now, if entries were skipped above
78 path_cnt = i+1; 79 path_cnt = i+1;
79} 80}
@@ -135,7 +136,7 @@ int program_in_path(const char *program) {
135 // ('x' permission means something different for directories). 136 // ('x' permission means something different for directories).
136 // exec follows symlinks, so use stat, not lstat. 137 // exec follows symlinks, so use stat, not lstat.
137 struct stat st; 138 struct stat st;
138 if (stat(scratch, &st)) { 139 if (stat_as_user(scratch, &st)) {
139 perror(scratch); 140 perror(scratch);
140 exit(1); 141 exit(1);
141 } 142 }
diff --git a/src/firejail/preproc.c b/src/firejail/preproc.c
index 5039c6238..1aafd1ca2 100644
--- a/src/firejail/preproc.c
+++ b/src/firejail/preproc.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -58,10 +58,28 @@ void preproc_build_firejail_dir(void) {
58 create_empty_dir_as_root(RUN_FIREJAIL_X11_DIR, 0755); 58 create_empty_dir_as_root(RUN_FIREJAIL_X11_DIR, 0755);
59 } 59 }
60 60
61 if (stat(RUN_FIREJAIL_DBUS_DIR, &s)) {
62 create_empty_dir_as_root(RUN_FIREJAIL_DBUS_DIR, 0755);
63 if (arg_debug)
64 printf("Remounting the " RUN_FIREJAIL_DBUS_DIR
65 " directory as noexec\n");
66 if (mount(RUN_FIREJAIL_DBUS_DIR, RUN_FIREJAIL_DBUS_DIR, NULL,
67 MS_BIND, NULL) == -1)
68 errExit("mounting " RUN_FIREJAIL_DBUS_DIR);
69 if (mount(NULL, RUN_FIREJAIL_DBUS_DIR, NULL,
70 MS_REMOUNT | MS_BIND | MS_NOSUID | MS_NOEXEC | MS_NODEV,
71 "mode=755,gid=0") == -1)
72 errExit("remounting " RUN_FIREJAIL_DBUS_DIR);
73 }
74
61 if (stat(RUN_FIREJAIL_APPIMAGE_DIR, &s)) { 75 if (stat(RUN_FIREJAIL_APPIMAGE_DIR, &s)) {
62 create_empty_dir_as_root(RUN_FIREJAIL_APPIMAGE_DIR, 0755); 76 create_empty_dir_as_root(RUN_FIREJAIL_APPIMAGE_DIR, 0755);
63 } 77 }
64 78
79 if (stat(RUN_FIREJAIL_LIB_DIR, &s)) {
80 create_empty_dir_as_root(RUN_FIREJAIL_LIB_DIR, 0755);
81 }
82
65 if (stat(RUN_MNT_DIR, &s)) { 83 if (stat(RUN_MNT_DIR, &s)) {
66 create_empty_dir_as_root(RUN_MNT_DIR, 0755); 84 create_empty_dir_as_root(RUN_MNT_DIR, 0755);
67 } 85 }
@@ -76,26 +94,33 @@ void preproc_mount_mnt_dir(void) {
76 if (!tmpfs_mounted) { 94 if (!tmpfs_mounted) {
77 if (arg_debug) 95 if (arg_debug)
78 printf("Mounting tmpfs on %s directory\n", RUN_MNT_DIR); 96 printf("Mounting tmpfs on %s directory\n", RUN_MNT_DIR);
79 if (mount("tmpfs", RUN_MNT_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 97 if (mount("tmpfs", RUN_MNT_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME, "mode=755,gid=0") < 0)
80 errExit("mounting /run/firejail/mnt"); 98 errExit("mounting /run/firejail/mnt");
81 tmpfs_mounted = 1; 99 tmpfs_mounted = 1;
82 fs_logger2("tmpfs", RUN_MNT_DIR); 100 fs_logger2("tmpfs", RUN_MNT_DIR);
83 101
84#ifdef HAVE_SECCOMP 102 // open and mount trace file while there are no user-writable files in RUN_MNT_DIR
103 if (arg_tracefile)
104 fs_tracefile();
105
106 create_empty_dir_as_root(RUN_SECCOMP_DIR, 0755);
107
85 if (arg_seccomp_block_secondary) 108 if (arg_seccomp_block_secondary)
86 copy_file(PATH_SECCOMP_BLOCK_SECONDARY, RUN_SECCOMP_BLOCK_SECONDARY, getuid(), getgid(), 0644); // root needed 109 copy_file(PATH_SECCOMP_BLOCK_SECONDARY, RUN_SECCOMP_BLOCK_SECONDARY, getuid(), getgid(), 0644); // root needed
87 else { 110 else {
88 //copy default seccomp files 111 //copy default seccomp files
89 copy_file(PATH_SECCOMP_32, RUN_SECCOMP_32, getuid(), getgid(), 0644); // root needed 112 copy_file(PATH_SECCOMP_32, RUN_SECCOMP_32, getuid(), getgid(), 0644); // root needed
90 copy_file(PATH_SECCOMP_64, RUN_SECCOMP_64, getuid(), getgid(), 0644); // root needed
91 } 113 }
92 if (arg_allow_debuggers) 114 if (arg_allow_debuggers) {
93 copy_file(PATH_SECCOMP_DEFAULT_DEBUG, RUN_SECCOMP_CFG, getuid(), getgid(), 0644); // root needed 115 copy_file(PATH_SECCOMP_DEFAULT_DEBUG, RUN_SECCOMP_CFG, getuid(), getgid(), 0644); // root needed
94 else 116 copy_file(PATH_SECCOMP_DEBUG_32, RUN_SECCOMP_32, getuid(), getgid(), 0644); // root needed
117 } else
95 copy_file(PATH_SECCOMP_DEFAULT, RUN_SECCOMP_CFG, getuid(), getgid(), 0644); // root needed 118 copy_file(PATH_SECCOMP_DEFAULT, RUN_SECCOMP_CFG, getuid(), getgid(), 0644); // root needed
96 119
97 if (arg_memory_deny_write_execute) 120 if (arg_memory_deny_write_execute) {
98 copy_file(PATH_SECCOMP_MDWX, RUN_SECCOMP_MDWX, getuid(), getgid(), 0644); // root needed 121 copy_file(PATH_SECCOMP_MDWX, RUN_SECCOMP_MDWX, getuid(), getgid(), 0644); // root needed
122 copy_file(PATH_SECCOMP_MDWX_32, RUN_SECCOMP_MDWX_32, getuid(), getgid(), 0644); // root needed
123 }
99 // as root, create empty RUN_SECCOMP_PROTOCOL and RUN_SECCOMP_POSTEXEC files 124 // as root, create empty RUN_SECCOMP_PROTOCOL and RUN_SECCOMP_POSTEXEC files
100 create_empty_file_as_root(RUN_SECCOMP_PROTOCOL, 0644); 125 create_empty_file_as_root(RUN_SECCOMP_PROTOCOL, 0644);
101 if (set_perms(RUN_SECCOMP_PROTOCOL, getuid(), getgid(), 0644)) 126 if (set_perms(RUN_SECCOMP_PROTOCOL, getuid(), getgid(), 0644))
@@ -103,19 +128,48 @@ void preproc_mount_mnt_dir(void) {
103 create_empty_file_as_root(RUN_SECCOMP_POSTEXEC, 0644); 128 create_empty_file_as_root(RUN_SECCOMP_POSTEXEC, 0644);
104 if (set_perms(RUN_SECCOMP_POSTEXEC, getuid(), getgid(), 0644)) 129 if (set_perms(RUN_SECCOMP_POSTEXEC, getuid(), getgid(), 0644))
105 errExit("set_perms"); 130 errExit("set_perms");
106#endif 131 create_empty_file_as_root(RUN_SECCOMP_POSTEXEC_32, 0644);
132 if (set_perms(RUN_SECCOMP_POSTEXEC_32, getuid(), getgid(), 0644))
133 errExit("set_perms");
134 }
135}
136
137static void clean_dir(const char *name, int *pidarr, int start_pid, int max_pids) {
138 DIR *dir;
139 if (!(dir = opendir(name))) {
140 fwarning("cannot clean %s directory\n", name);
141 return; // we live to fight another day!
142 }
143
144 // clean leftover files
145 struct dirent *entry;
146 char *end;
147 while ((entry = readdir(dir)) != NULL) {
148 pid_t pid = strtol(entry->d_name, &end, 10);
149 pid %= max_pids;
150 if (end == entry->d_name || *end)
151 continue;
152
153 if (pid < start_pid)
154 continue;
155 if (pidarr[pid] == 0)
156 delete_run_files(pid);
107 } 157 }
158 closedir(dir);
108} 159}
109 160
161
110// clean run directory 162// clean run directory
111void preproc_clean_run(void) { 163void preproc_clean_run(void) {
112 int max_pids=32769; 164 int max_pids=32769;
113 int start_pid = 100; 165 int start_pid = 100;
114 // extract real max_pids 166 // extract real max_pids
115 FILE *fp = fopen("/proc/sys/kernel/pid_max", "r"); 167 FILE *fp = fopen("/proc/sys/kernel/pid_max", "re");
116 if (fp) { 168 if (fp) {
117 int val; 169 int val;
118 if (fscanf(fp, "%d", &val) == 1) { 170 if (fscanf(fp, "%d", &val) == 1) {
171 if (val > 4194304) // this is the max value supported on 64 bit Linux kernels
172 val = 4194304;
119 if (val >= max_pids) 173 if (val >= max_pids)
120 max_pids = val + 1; 174 max_pids = val + 1;
121 } 175 }
@@ -146,37 +200,16 @@ void preproc_clean_run(void) {
146 pid %= max_pids; 200 pid %= max_pids;
147 if (end == entry->d_name || *end) 201 if (end == entry->d_name || *end)
148 continue; 202 continue;
149 203
150 if (pid < start_pid) 204 if (pid < start_pid)
151 continue; 205 continue;
152 pidarr[pid] = 1; 206 pidarr[pid] = 1;
153 } 207 }
154 closedir(dir); 208 closedir(dir);
155 209
156 // open /run/firejail/profile directory 210 // clean profile and name directories
157 if (!(dir = opendir(RUN_FIREJAIL_PROFILE_DIR))) { 211 clean_dir(RUN_FIREJAIL_PROFILE_DIR, pidarr, start_pid, max_pids);
158 // sleep 2 seconds and try again 212 clean_dir(RUN_FIREJAIL_NAME_DIR, pidarr, start_pid, max_pids);
159 sleep(2);
160 if (!(dir = opendir(RUN_FIREJAIL_PROFILE_DIR))) {
161 fprintf(stderr, "Error: cannot open %s directory\n", RUN_FIREJAIL_PROFILE_DIR);
162 exit(1);
163 }
164 }
165
166 // read /run/firejail/profile directory and clean leftover files
167 while ((entry = readdir(dir)) != NULL) {
168 pid_t pid = strtol(entry->d_name, &end, 10);
169 pid %= max_pids;
170 if (end == entry->d_name || *end)
171 continue;
172
173 if (pid < start_pid)
174 continue;
175 if (pidarr[pid] == 0)
176 clear_run_files(pid);
177 }
178 closedir(dir);
179 213
180 free(pidarr); 214 free(pidarr);
181} 215}
182
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 6880bcaa7..059100fcb 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,33 +18,42 @@
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/gcov_wrapper.h"
22#include "../include/seccomp.h"
23#include "../include/syscall.h"
21#include <dirent.h> 24#include <dirent.h>
22#include <sys/stat.h> 25#include <sys/stat.h>
26
23extern char *xephyr_screen; 27extern char *xephyr_screen;
24 28
25#define MAX_READ 8192 // line buffer for profile files 29#define MAX_READ 8192 // line buffer for profile files
26 30
27// find and read the profile specified by name from dir directory 31// find and read the profile specified by name from dir directory
28int profile_find(const char *name, const char *dir) { 32// return 1 if a profile was found
33static int profile_find(const char *name, const char *dir, int add_ext) {
29 EUID_ASSERT(); 34 EUID_ASSERT();
30 assert(name); 35 assert(name);
31 assert(dir); 36 assert(dir);
32 37
33 int rv = 0; 38 int rv = 0;
34 DIR *dp; 39 DIR *dp;
35 char *pname; 40 char *pname = NULL;
36 if (asprintf(&pname, "%s.profile", name) == -1) 41 if (add_ext) {
37 errExit("asprintf"); 42 if (asprintf(&pname, "%s.profile", name) == -1)
43 errExit("asprintf");
44 else
45 name = pname;
46 }
38 47
39 dp = opendir (dir); 48 dp = opendir (dir);
40 if (dp != NULL) { 49 if (dp != NULL) {
41 struct dirent *ep; 50 struct dirent *ep;
42 while ((ep = readdir(dp)) != NULL) { 51 while ((ep = readdir(dp)) != NULL) {
43 if (strcmp(ep->d_name, pname) == 0) { 52 if (strcmp(ep->d_name, name) == 0) {
44 if (arg_debug) 53 if (arg_debug)
45 printf("Found %s profile in %s directory\n", name, dir); 54 printf("Found %s profile in %s directory\n", name, dir);
46 char *etcpname; 55 char *etcpname;
47 if (asprintf(&etcpname, "%s/%s", dir, pname) == -1) 56 if (asprintf(&etcpname, "%s/%s", dir, name) == -1)
48 errExit("asprintf"); 57 errExit("asprintf");
49 profile_read(etcpname); 58 profile_read(etcpname);
50 free(etcpname); 59 free(etcpname);
@@ -55,10 +64,27 @@ int profile_find(const char *name, const char *dir) {
55 (void) closedir (dp); 64 (void) closedir (dp);
56 } 65 }
57 66
58 free(pname); 67 if (pname)
68 free(pname);
59 return rv; 69 return rv;
60} 70}
61 71
72// search and read the profile specified by name from firejail directories
73// return 1 if a profile was found
74int profile_find_firejail(const char *name, int add_ext) {
75 // look for a profile in ~/.config/firejail directory
76 char *usercfgdir;
77 if (asprintf(&usercfgdir, "%s/.config/firejail", cfg.homedir) == -1)
78 errExit("asprintf");
79 int rv = profile_find(name, usercfgdir, add_ext);
80 free(usercfgdir);
81
82 if (!rv)
83 // look for a user profile in /etc/firejail directory
84 rv = profile_find(name, SYSCONFDIR, add_ext);
85
86 return rv;
87}
62 88
63//*************************************************** 89//***************************************************
64// run-time profiles 90// run-time profiles
@@ -69,13 +95,7 @@ static void warning_feature_disabled(const char *feature) {
69} 95}
70 96
71 97
72 98static int is_in_ignore_list(char *ptr) {
73// check profile line; if line == 0, this was generated from a command line option
74// return 1 if the command is to be added to the linked list of profile commands
75// return 0 if the command was already executed inside the function
76int profile_check_line(char *ptr, int lineno, const char *fname) {
77 EUID_ASSERT();
78
79 // check ignore list 99 // check ignore list
80 int i; 100 int i;
81 for (i = 0; i < MAX_PROFILE_IGNORE; i++) { 101 for (i = 0; i < MAX_PROFILE_IGNORE; i++) {
@@ -86,30 +106,182 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
86 if (strncmp(ptr, cfg.profile_ignore[i], len) == 0) { 106 if (strncmp(ptr, cfg.profile_ignore[i], len) == 0) {
87 // full word match 107 // full word match
88 if (*(ptr + len) == '\0' || *(ptr + len) == ' ') 108 if (*(ptr + len) == '\0' || *(ptr + len) == ' ')
89 return 0; // ignore line 109 return 1; // ignore line
90 } 110 }
91 } 111 }
92 112
93 if (strncmp(ptr, "ignore ", 7) == 0) { 113 return 0;
94 char *str = strdup(ptr + 7); 114}
95 if (*str == '\0') { 115
96 fprintf(stderr, "Error: invalid ignore option\n"); 116void profile_add_ignore(const char *str) {
97 exit(1); 117 assert(str);
118 if (*str == '\0') {
119 fprintf(stderr, "Error: invalid ignore option\n");
120 exit(1);
121 }
122
123 // find an empty entry in profile_ignore array
124 int i;
125 for (i = 0; i < MAX_PROFILE_IGNORE; i++) {
126 if (cfg.profile_ignore[i] == NULL)
127 break;
128 }
129 if (i >= MAX_PROFILE_IGNORE) {
130 fprintf(stderr, "Error: maximum %d --ignore options are permitted\n", MAX_PROFILE_IGNORE);
131 exit(1);
132 }
133 // ... and configure it
134 else {
135 cfg.profile_ignore[i] = strdup(str);
136 if (!cfg.profile_ignore[i])
137 errExit("strdup");
138 }
139}
140
141typedef struct cond_t {
142 const char *name; // conditional name
143 int (*check)(void); // true if set
144} Cond;
145
146static int check_appimage(void) {
147 return arg_appimage != 0;
148}
149
150static int check_netoptions(void) {
151 return (arg_nonetwork || any_bridge_configured());
152}
153
154static int check_nodbus(void) {
155 return arg_dbus_user != DBUS_POLICY_ALLOW || arg_dbus_system != DBUS_POLICY_ALLOW;
156}
157
158static int check_nosound(void) {
159 return arg_nosound != 0;
160}
161
162static int check_private(void) {
163 return arg_private;
164}
165
166static int check_x11(void) {
167 return (arg_x11_block || arg_x11_xorg || env_get("FIREJAIL_X11"));
168}
169
170static int check_disable_u2f(void) {
171 return checkcfg(CFG_BROWSER_DISABLE_U2F) != 0;
172}
173
174static int check_allow_drm(void) {
175 return checkcfg(CFG_BROWSER_ALLOW_DRM) != 0;
176}
177
178Cond conditionals[] = {
179 {"HAS_APPIMAGE", check_appimage},
180 {"HAS_NET", check_netoptions},
181 {"HAS_NODBUS", check_nodbus},
182 {"HAS_NOSOUND", check_nosound},
183 {"HAS_PRIVATE", check_private},
184 {"HAS_X11", check_x11},
185 {"BROWSER_DISABLE_U2F", check_disable_u2f},
186 {"BROWSER_ALLOW_DRM", check_allow_drm},
187 { NULL, NULL }
188};
189
190int profile_check_conditional(char *ptr, int lineno, const char *fname) {
191 char *tmp = ptr, *msg = NULL;
192
193 if (*ptr++ != '?')
194 return 1;
195
196 Cond *cond = conditionals;
197 while (cond->name) {
198 // continue if not this conditional
199 if (strncmp(ptr, cond->name, strlen(cond->name)) != 0) {
200 cond++;
201 continue;
98 } 202 }
99 // find an empty entry in profile_ignore array 203 ptr += strlen(cond->name);
100 int j; 204
101 for (j = 0; j < MAX_PROFILE_IGNORE; j++) { 205 if (*ptr == ' ')
102 if (cfg.profile_ignore[j] == NULL) 206 ptr++;
103 break; 207 if (*ptr++ != ':') {
208 msg = "invalid conditional syntax: colon must come after conditional";
209 ptr = tmp;
210 goto error;
104 } 211 }
105 if (j >= MAX_PROFILE_IGNORE) { 212 if (*ptr == '\0') {
106 fprintf(stderr, "Error: maximum %d --ignore options are permitted\n", MAX_PROFILE_IGNORE); 213 msg = "invalid conditional syntax: no profile line after conditional";
107 exit(1); 214 ptr = tmp;
215 goto error;
108 } 216 }
109 // ... and configure it 217 if (*ptr == ' ')
110 else 218 ptr++;
111 cfg.profile_ignore[j] = str; 219
220 // if set, continue processing statement in caller
221 int value = cond->check();
222 if (value) {
223 // move ptr to start of profile line
224 ptr = strdup(ptr);
225 if (!ptr)
226 errExit("strdup");
227
228 // check that the profile line does not contain either
229 // quiet or include directives
230 if ((strncmp(ptr, "quiet", 5) == 0) ||
231 (strncmp(ptr, "include", 7) == 0)) {
232 msg = "invalid conditional syntax: quiet and include not allowed in conditionals";
233 ptr = tmp;
234 goto error;
235 }
236 free(tmp);
237
238 // verify syntax, exit in case of error
239 if (arg_debug)
240 printf("conditional %s, %s\n", cond->name, ptr);
241 if (profile_check_line(ptr, lineno, fname))
242 profile_add(ptr);
243 }
244 // tell caller to ignore
245 return 0;
246 }
247
248 tmp = ptr;
249 // get the conditional used
250 while (*tmp != ':' && *tmp != '\0')
251 tmp++;
252 *tmp = '\0';
253
254 // this was a '?' prefix, but didn't match any of the conditionals
255 msg = "invalid/unsupported conditional";
256
257error:
258 fprintf(stderr, "Error: %s (\"%s\"", msg, ptr);
259 if (lineno == 0) ;
260 else if (fname != NULL)
261 fprintf(stderr, " on line %d in %s", lineno, fname);
262 else
263 fprintf(stderr, " on line %d in the custom profile", lineno);
264 fprintf(stderr, ")\n");
265 exit(1);
266}
267
268
269// check profile line; if line == 0, this was generated from a command line option
270// return 1 if the command is to be added to the linked list of profile commands
271// return 0 if the command was already executed inside the function
272int profile_check_line(char *ptr, int lineno, const char *fname) {
273 EUID_ASSERT();
112 274
275 // check and process conditional profile lines
276 if (profile_check_conditional(ptr, lineno, fname) == 0)
277 return 0;
278
279 // check ignore list
280 if (is_in_ignore_list(ptr))
281 return 0;
282
283 if (strncmp(ptr, "ignore ", 7) == 0) {
284 profile_add_ignore(ptr + 7);
113 return 0; 285 return 0;
114 } 286 }
115 287
@@ -162,12 +334,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
162 return 0; 334 return 0;
163 } 335 }
164 else if (strcmp(ptr, "seccomp") == 0) { 336 else if (strcmp(ptr, "seccomp") == 0) {
165#ifdef HAVE_SECCOMP
166 if (checkcfg(CFG_SECCOMP)) 337 if (checkcfg(CFG_SECCOMP))
167 arg_seccomp = 1; 338 arg_seccomp = 1;
168 else 339 else
169 warning_feature_disabled("seccomp"); 340 warning_feature_disabled("seccomp");
170#endif
171 return 0; 341 return 0;
172 } 342 }
173 else if (strcmp(ptr, "caps") == 0) { 343 else if (strcmp(ptr, "caps") == 0) {
@@ -190,7 +360,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
190 arg_private = 1; 360 arg_private = 1;
191 return 0; 361 return 0;
192 } 362 }
193 if (strncmp(ptr, "private-home ", 13) == 0) { 363 else if (strncmp(ptr, "private-home ", 13) == 0) {
194#ifdef HAVE_PRIVATE_HOME 364#ifdef HAVE_PRIVATE_HOME
195 if (checkcfg(CFG_PRIVATE_HOME)) { 365 if (checkcfg(CFG_PRIVATE_HOME)) {
196 if (cfg.home_private_keep) { 366 if (cfg.home_private_keep) {
@@ -205,26 +375,59 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
205#endif 375#endif
206 return 0; 376 return 0;
207 } 377 }
378 else if (strcmp(ptr, "private-cwd") == 0) {
379 cfg.cwd = NULL;
380 arg_private_cwd = 1;
381 return 0;
382 }
383 else if (strncmp(ptr, "private-cwd ", 12) == 0) {
384 fs_check_private_cwd(ptr + 12);
385 arg_private_cwd = 1;
386 return 0;
387 }
208 else if (strcmp(ptr, "allusers") == 0) { 388 else if (strcmp(ptr, "allusers") == 0) {
209 arg_allusers = 1; 389 arg_allusers = 1;
210 return 0; 390 return 0;
211 } 391 }
392 else if (strcmp(ptr, "private-cache") == 0) {
393#ifdef HAVE_USERTMPFS
394 if (checkcfg(CFG_PRIVATE_CACHE))
395 arg_private_cache = 1;
396 else
397 warning_feature_disabled("private-cache");
398#endif
399 return 0;
400 }
212 else if (strcmp(ptr, "private-dev") == 0) { 401 else if (strcmp(ptr, "private-dev") == 0) {
213 arg_private_dev = 1; 402 arg_private_dev = 1;
214 return 0; 403 return 0;
215 } 404 }
405 else if (strcmp(ptr, "keep-dev-shm") == 0) {
406 arg_keep_dev_shm = 1;
407 return 0;
408 }
216 else if (strcmp(ptr, "private-tmp") == 0) { 409 else if (strcmp(ptr, "private-tmp") == 0) {
217 arg_private_tmp = 1; 410 arg_private_tmp = 1;
218 return 0; 411 return 0;
219 } 412 }
220 else if (strcmp(ptr, "nogroups") == 0) { 413 else if (strcmp(ptr, "nogroups") == 0) {
221 arg_nogroups = 1; 414 // nvidia cards require video group; disable nogroups
415 if (access("/dev/nvidiactl", R_OK) == 0 && arg_no3d == 0) {
416 fwarning("Warning: NVIDIA card detected, nogroups command disabled\n");
417 arg_nogroups = 0;
418 }
419 else
420 arg_nogroups = 1;
222 return 0; 421 return 0;
223 } 422 }
224 else if (strcmp(ptr, "nosound") == 0) { 423 else if (strcmp(ptr, "nosound") == 0) {
225 arg_nosound = 1; 424 arg_nosound = 1;
226 return 0; 425 return 0;
227 } 426 }
427 else if (strcmp(ptr, "noautopulse") == 0) {
428 arg_keep_config_pulse = 1;
429 return 0;
430 }
228 else if (strcmp(ptr, "notv") == 0) { 431 else if (strcmp(ptr, "notv") == 0) {
229 arg_notv = 1; 432 arg_notv = 1;
230 return 0; 433 return 0;
@@ -241,8 +444,153 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
241 arg_no3d = 1; 444 arg_no3d = 1;
242 return 0; 445 return 0;
243 } 446 }
244 else if (strcmp(ptr, "allow-private-blacklist") == 0) { 447 else if (strcmp(ptr, "noinput") == 0) {
245 arg_allow_private_blacklist = 1; 448 arg_noinput = 1;
449 return 0;
450 }
451 else if (strcmp(ptr, "nodbus") == 0) {
452#ifdef HAVE_DBUSPROXY
453 arg_dbus_user = DBUS_POLICY_BLOCK;
454 arg_dbus_system = DBUS_POLICY_BLOCK;
455#endif
456 return 0;
457 }
458 else if (strncmp("dbus-user ", ptr, 10) == 0) {
459#ifdef HAVE_DBUSPROXY
460 ptr += 10;
461 if (strcmp("filter", ptr) == 0) {
462 if (arg_dbus_user == DBUS_POLICY_BLOCK) {
463 fprintf(stderr, "Error: Cannot relax dbus-user policy, it is already set to block\n");
464 } else {
465 arg_dbus_user = DBUS_POLICY_FILTER;
466 }
467 } else if (strcmp("none", ptr) == 0) {
468 if (arg_dbus_log_user) {
469 fprintf(stderr, "Error: --dbus-user.log requires --dbus-user=filter\n");
470 exit(1);
471 }
472 arg_dbus_user = DBUS_POLICY_BLOCK;
473 } else {
474 fprintf(stderr, "Unknown dbus-user policy: %s\n", ptr);
475 exit(1);
476 }
477#endif
478 return 0;
479 }
480 else if (strncmp(ptr, "dbus-user.see ", 14) == 0) {
481#ifdef HAVE_DBUSPROXY
482 if (!dbus_check_name(ptr + 14)) {
483 fprintf(stderr, "Invalid dbus-user.see name: %s\n", ptr + 15);
484 exit(1);
485 }
486#endif
487 return 1;
488 }
489 else if (strncmp(ptr, "dbus-user.talk ", 15) == 0) {
490#ifdef HAVE_DBUSPROXY
491 if (!dbus_check_name(ptr + 15)) {
492 fprintf(stderr, "Error: Invalid dbus-user.talk name: %s\n", ptr + 15);
493 exit(1);
494 }
495#endif
496 return 1;
497 }
498 else if (strncmp(ptr, "dbus-user.own ", 14) == 0) {
499#ifdef HAVE_DBUSPROXY
500 if (!dbus_check_name(ptr + 14)) {
501 fprintf(stderr, "Error: Invalid dbus-user.own name: %s\n", ptr + 14);
502 exit(1);
503 }
504#endif
505 return 1;
506 }
507 else if (strncmp(ptr, "dbus-user.call ", 15) == 0) {
508#ifdef HAVE_DBUSPROXY
509 if (!dbus_check_call_rule(ptr + 15)) {
510 fprintf(stderr, "Error: Invalid dbus-user.call rule: %s\n", ptr + 15);
511 exit(1);
512 }
513#endif
514 return 1;
515 }
516 else if (strncmp(ptr, "dbus-user.broadcast ", 20) == 0) {
517#ifdef HAVE_DBUSPROXY
518 if (!dbus_check_call_rule(ptr + 20)) {
519 fprintf(stderr, "Error: Invalid dbus-user.broadcast rule: %s\n", ptr + 20);
520 exit(1);
521 }
522#endif
523 return 1;
524 }
525 else if (strncmp("dbus-system ", ptr, 12) == 0) {
526#ifdef HAVE_DBUSPROXY
527 ptr += 12;
528 if (strcmp("filter", ptr) == 0) {
529 if (arg_dbus_system == DBUS_POLICY_BLOCK) {
530 fprintf(stderr, "Error: Cannot relax dbus-system policy, it is already set to block\n");
531 } else {
532 arg_dbus_system = DBUS_POLICY_FILTER;
533 }
534 } else if (strcmp("none", ptr) == 0) {
535 if (arg_dbus_log_system) {
536 fprintf(stderr, "Error: --dbus-system.log requires --dbus-system=filter\n");
537 exit(1);
538 }
539 arg_dbus_system = DBUS_POLICY_BLOCK;
540 } else {
541 fprintf(stderr, "Error: Unknown dbus-system policy: %s\n", ptr);
542 exit(1);
543 }
544#endif
545 return 0;
546 }
547 else if (strncmp(ptr, "dbus-system.see ", 16) == 0) {
548#ifdef HAVE_DBUSPROXY
549 if (!dbus_check_name(ptr + 16)) {
550 fprintf(stderr, "Error: Invalid dbus-system.see name: %s\n", ptr + 17);
551 exit(1);
552 }
553#endif
554 return 1;
555 }
556 else if (strncmp(ptr, "dbus-system.talk ", 17) == 0) {
557#ifdef HAVE_DBUSPROXY
558 if (!dbus_check_name(ptr + 17)) {
559 fprintf(stderr, "Error: Invalid dbus-system.talk name: %s\n", ptr + 17);
560 exit(1);
561 }
562#endif
563 return 1;
564 }
565 else if (strncmp(ptr, "dbus-system.own ", 16) == 0) {
566#ifdef HAVE_DBUSPROXY
567 if (!dbus_check_name(ptr + 16)) {
568 fprintf(stderr, "Error: Invalid dbus-system.own name: %s\n", ptr + 16);
569 exit(1);
570 }
571#endif
572 return 1;
573 }
574 else if (strncmp(ptr, "dbus-system.call ", 17) == 0) {
575#ifdef HAVE_DBUSPROXY
576 if (!dbus_check_call_rule(ptr + 17)) {
577 fprintf(stderr, "Error: Invalid dbus-system.call rule: %s\n", ptr + 17);
578 exit(1);
579 }
580#endif
581 return 1;
582 }
583 else if (strncmp(ptr, "dbus-system.broadcast ", 22) == 0) {
584#ifdef HAVE_DBUSPROXY
585 if (!dbus_check_call_rule(ptr + 22)) {
586 fprintf(stderr, "Error: Invalid dbus-system.broadcast rule: %s\n", ptr + 22);
587 exit(1);
588 }
589#endif
590 return 1;
591 }
592 else if (strcmp(ptr, "nou2f") == 0) {
593 arg_nou2f = 1;
246 return 0; 594 return 0;
247 } 595 }
248 else if (strcmp(ptr, "netfilter") == 0) { 596 else if (strcmp(ptr, "netfilter") == 0) {
@@ -282,40 +630,32 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
282#endif 630#endif
283 return 0; 631 return 0;
284 } 632 }
285 else if (strcmp(ptr, "net none") == 0) { 633 else if (strncmp(ptr, "netns ", 6) == 0) {
286#ifdef HAVE_NETWORK 634#ifdef HAVE_NETWORK
287 if (checkcfg(CFG_NETWORK)) { 635 if (checkcfg(CFG_NETWORK)) {
288 arg_nonetwork = 1; 636 arg_netns = ptr + 6;
289 cfg.bridge0.configured = 0; 637 check_netns(arg_netns);
290 cfg.bridge1.configured = 0;
291 cfg.bridge2.configured = 0;
292 cfg.bridge3.configured = 0;
293 cfg.interface0.configured = 0;
294 cfg.interface1.configured = 0;
295 cfg.interface2.configured = 0;
296 cfg.interface3.configured = 0;
297 } 638 }
298 else 639 else
299 warning_feature_disabled("networking"); 640 warning_feature_disabled("networking");
300#endif 641#endif
301 return 0; 642 return 0;
302 } 643 }
644 else if (strcmp(ptr, "net none") == 0) {
645 arg_nonetwork = 1;
646 cfg.bridge0.configured = 0;
647 cfg.bridge1.configured = 0;
648 cfg.bridge2.configured = 0;
649 cfg.bridge3.configured = 0;
650 cfg.interface0.configured = 0;
651 cfg.interface1.configured = 0;
652 cfg.interface2.configured = 0;
653 cfg.interface3.configured = 0;
654 return 0;
655 }
303 else if (strncmp(ptr, "net ", 4) == 0) { 656 else if (strncmp(ptr, "net ", 4) == 0) {
304#ifdef HAVE_NETWORK 657#ifdef HAVE_NETWORK
305 if (checkcfg(CFG_NETWORK)) { 658 if (checkcfg(CFG_NETWORK)) {
306#ifdef HAVE_NETWORK_RESTRICTED
307 // compile time restricted networking
308 if (getuid() != 0) {
309 fprintf(stderr, "Error: only \"net none\" is allowed to non-root users\n");
310 exit(1);
311 }
312#endif
313 // run time restricted networking
314 if (checkcfg(CFG_RESTRICTED_NETWORK) && getuid() != 0) {
315 fprintf(stderr, "Error: only \"net none\" is allowed to non-root users\n");
316 exit(1);
317 }
318
319 if (strcmp(ptr + 4, "lo") == 0) { 659 if (strcmp(ptr + 4, "lo") == 0) {
320 fprintf(stderr, "Error: cannot attach to lo device\n"); 660 fprintf(stderr, "Error: cannot attach to lo device\n");
321 exit(1); 661 exit(1);
@@ -334,7 +674,8 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
334 fprintf(stderr, "Error: maximum 4 network devices are allowed\n"); 674 fprintf(stderr, "Error: maximum 4 network devices are allowed\n");
335 exit(1); 675 exit(1);
336 } 676 }
337 net_configure_bridge(br, ptr + 4); 677 br->dev = ptr + 4;
678 br->configured = 1;
338 } 679 }
339 else 680 else
340 warning_feature_disabled("networking"); 681 warning_feature_disabled("networking");
@@ -399,10 +740,6 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
399 fprintf(stderr, "Error: invalid IP range\n"); 740 fprintf(stderr, "Error: invalid IP range\n");
400 exit(1); 741 exit(1);
401 } 742 }
402 if (in_netrange(br->iprange_start, br->ip, br->mask) || in_netrange(br->iprange_end, br->ip, br->mask)) {
403 fprintf(stderr, "Error: IP range addresses not in network range\n");
404 exit(1);
405 }
406 } 743 }
407 else 744 else
408 warning_feature_disabled("networking"); 745 warning_feature_disabled("networking");
@@ -430,6 +767,12 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
430 fprintf(stderr, "Error: invalid MAC address\n"); 767 fprintf(stderr, "Error: invalid MAC address\n");
431 exit(1); 768 exit(1);
432 } 769 }
770
771 // check multicast address
772 if (br->macsandbox[0] & 1) {
773 fprintf(stderr, "Error: invalid MAC address (multicast)\n");
774 exit(1);
775 }
433 } 776 }
434 else 777 else
435 warning_feature_disabled("networking"); 778 warning_feature_disabled("networking");
@@ -457,6 +800,40 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
457 return 0; 800 return 0;
458 } 801 }
459 802
803 else if (strncmp(ptr, "netmask ", 8) == 0) {
804#ifdef HAVE_NETWORK
805 if (checkcfg(CFG_NETWORK)) {
806 Bridge *br = last_bridge_configured();
807 if (br == NULL) {
808 fprintf(stderr, "Error: no network device configured\n");
809 exit(1);
810 }
811 if (br->arg_ip_none || br->masksandbox) {
812 fprintf(stderr, "Error: cannot configure the network mask twice for the same interface\n");
813 exit(1);
814 }
815
816 // configure this network mask for the last bridge defined
817 if (atoip(ptr + 8, &br->masksandbox)) {
818 fprintf(stderr, "Error: invalid network mask\n");
819 exit(1);
820 }
821
822 // if the bridge is not configured, use this mask as the bridge mask
823 if (br->mask == 0)
824 br->mask = br->masksandbox;
825 else {
826 fprintf(stderr, "Error: interface %s already has a network mask defined; "
827 "please remove --netmask\n",
828 br->dev);
829 exit(1);
830 }
831 }
832 else
833 warning_feature_disabled("networking");
834#endif
835 return 0;
836 }
460 else if (strncmp(ptr, "ip ", 3) == 0) { 837 else if (strncmp(ptr, "ip ", 3) == 0) {
461#ifdef HAVE_NETWORK 838#ifdef HAVE_NETWORK
462 if (checkcfg(CFG_NETWORK)) { 839 if (checkcfg(CFG_NETWORK)) {
@@ -473,7 +850,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
473 // configure this IP address for the last bridge defined 850 // configure this IP address for the last bridge defined
474 if (strcmp(ptr + 3, "none") == 0) 851 if (strcmp(ptr + 3, "none") == 0)
475 br->arg_ip_none = 1; 852 br->arg_ip_none = 1;
476 else { 853 else if (strcmp(ptr + 3, "dhcp") == 0) {
854 br->arg_ip_none = 1;
855 br->arg_ip_dhcp = 1;
856 } else {
477 if (atoip(ptr + 3, &br->ipsandbox)) { 857 if (atoip(ptr + 3, &br->ipsandbox)) {
478 fprintf(stderr, "Error: invalid IP address\n"); 858 fprintf(stderr, "Error: invalid IP address\n");
479 exit(1); 859 exit(1);
@@ -494,19 +874,24 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
494 fprintf(stderr, "Error: no network device configured\n"); 874 fprintf(stderr, "Error: no network device configured\n");
495 exit(1); 875 exit(1);
496 } 876 }
497 if (br->arg_ip_none || br->ip6sandbox) { 877 if (br->arg_ip6_dhcp || br->ip6sandbox) {
498 fprintf(stderr, "Error: cannot configure the IP address twice for the same interface\n"); 878 fprintf(stderr, "Error: cannot configure the IP address twice for the same interface\n");
499 exit(1); 879 exit(1);
500 } 880 }
501 881
502 // configure this IP address for the last bridge defined 882 // configure this IP address for the last bridge defined
503 // todo: verify ipv6 syntax 883 if (strcmp(ptr + 4, "dhcp") == 0)
504 br->ip6sandbox = ptr + 4; 884 br->arg_ip6_dhcp = 1;
505// if (atoip(argv[i] + 5, &br->ipsandbox)) { 885 else {
506// fprintf(stderr, "Error: invalid IP address\n"); 886 if (check_ip46_address(ptr + 4) == 0) {
507// exit(1); 887 fprintf(stderr, "Error: invalid IPv6 address\n");
508// } 888 exit(1);
889 }
509 890
891 br->ip6sandbox = strdup(ptr + 4);
892 if (br->ip6sandbox == NULL)
893 errExit("strdup");
894 }
510 } 895 }
511 else 896 else
512 warning_feature_disabled("networking"); 897 warning_feature_disabled("networking");
@@ -536,21 +921,14 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
536 } 921 }
537 922
538 if (strncmp(ptr, "protocol ", 9) == 0) { 923 if (strncmp(ptr, "protocol ", 9) == 0) {
539#ifdef HAVE_SECCOMP
540 if (checkcfg(CFG_SECCOMP)) { 924 if (checkcfg(CFG_SECCOMP)) {
541 if (cfg.protocol) { 925 const char *add = ptr + 9;
542 fwarning("a protocol list is present, the new list \"%s\" will not be installed\n", ptr + 9); 926 profile_list_augment(&cfg.protocol, add);
543 return 0; 927 if (arg_debug)
544 } 928 fprintf(stderr, "[profile] combined protocol list: \"%s\"\n", cfg.protocol);
545
546 // store list
547 cfg.protocol = strdup(ptr + 9);
548 if (!cfg.protocol)
549 errExit("strdup");
550 } 929 }
551 else 930 else
552 warning_feature_disabled("seccomp"); 931 warning_feature_disabled("seccomp");
553#endif
554 return 0; 932 return 0;
555 } 933 }
556 934
@@ -565,62 +943,107 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
565 943
566 // seccomp drop list on top of default list 944 // seccomp drop list on top of default list
567 if (strncmp(ptr, "seccomp ", 8) == 0) { 945 if (strncmp(ptr, "seccomp ", 8) == 0) {
568#ifdef HAVE_SECCOMP
569 if (checkcfg(CFG_SECCOMP)) { 946 if (checkcfg(CFG_SECCOMP)) {
570 arg_seccomp = 1; 947 arg_seccomp = 1;
571 cfg.seccomp_list = seccomp_check_list(ptr + 8); 948 cfg.seccomp_list = seccomp_check_list(ptr + 8);
572 } 949 }
573 else if (!arg_quiet) 950 else if (!arg_quiet)
574 warning_feature_disabled("seccomp"); 951 warning_feature_disabled("seccomp");
575#endif 952
953 return 0;
954 }
955 if (strncmp(ptr, "seccomp.32 ", 11) == 0) {
956 if (checkcfg(CFG_SECCOMP)) {
957 arg_seccomp32 = 1;
958 cfg.seccomp_list32 = seccomp_check_list(ptr + 11);
959 }
960 else if (!arg_quiet)
961 warning_feature_disabled("seccomp");
576 962
577 return 0; 963 return 0;
578 } 964 }
579 965
580 if (strcmp(ptr, "seccomp.block-secondary") == 0) { 966 if (strcmp(ptr, "seccomp.block-secondary") == 0) {
581#ifdef HAVE_SECCOMP
582 if (checkcfg(CFG_SECCOMP)) { 967 if (checkcfg(CFG_SECCOMP)) {
583 arg_seccomp_block_secondary = 1; 968 arg_seccomp_block_secondary = 1;
584 } 969 }
585 else 970 else
586 warning_feature_disabled("seccomp"); 971 warning_feature_disabled("seccomp");
587#endif
588 return 0; 972 return 0;
589 } 973 }
590 // seccomp drop list without default list 974 // seccomp drop list without default list
591 if (strncmp(ptr, "seccomp.drop ", 13) == 0) { 975 if (strncmp(ptr, "seccomp.drop ", 13) == 0) {
592#ifdef HAVE_SECCOMP
593 if (checkcfg(CFG_SECCOMP)) { 976 if (checkcfg(CFG_SECCOMP)) {
594 arg_seccomp = 1; 977 arg_seccomp = 1;
595 cfg.seccomp_list_drop = seccomp_check_list(ptr + 13); 978 cfg.seccomp_list_drop = seccomp_check_list(ptr + 13);
596 } 979 }
597 else 980 else
598 warning_feature_disabled("seccomp"); 981 warning_feature_disabled("seccomp");
599#endif 982 return 0;
983 }
984 if (strncmp(ptr, "seccomp.32.drop ", 13) == 0) {
985 if (checkcfg(CFG_SECCOMP)) {
986 arg_seccomp32 = 1;
987 cfg.seccomp_list_drop32 = seccomp_check_list(ptr + 13);
988 }
989 else
990 warning_feature_disabled("seccomp");
600 return 0; 991 return 0;
601 } 992 }
602 993
603 // seccomp keep list 994 // seccomp keep list
604 if (strncmp(ptr, "seccomp.keep ", 13) == 0) { 995 if (strncmp(ptr, "seccomp.keep ", 13) == 0) {
605#ifdef HAVE_SECCOMP
606 if (checkcfg(CFG_SECCOMP)) { 996 if (checkcfg(CFG_SECCOMP)) {
607 arg_seccomp = 1; 997 arg_seccomp = 1;
608 cfg.seccomp_list_keep= seccomp_check_list(ptr + 13); 998 cfg.seccomp_list_keep= seccomp_check_list(ptr + 13);
609 } 999 }
610 else 1000 else
611 warning_feature_disabled("seccomp"); 1001 warning_feature_disabled("seccomp");
612#endif 1002 return 0;
1003 }
1004 if (strncmp(ptr, "seccomp.32.keep ", 13) == 0) {
1005 if (checkcfg(CFG_SECCOMP)) {
1006 arg_seccomp32 = 1;
1007 cfg.seccomp_list_keep32 = seccomp_check_list(ptr + 13);
1008 }
1009 else
1010 warning_feature_disabled("seccomp");
613 return 0; 1011 return 0;
614 } 1012 }
615 1013
616 // memory deny write&execute 1014 // memory deny write&execute
617 if (strcmp(ptr, "memory-deny-write-execute") == 0) { 1015 if (strcmp(ptr, "memory-deny-write-execute") == 0) {
618#ifdef HAVE_SECCOMP
619 if (checkcfg(CFG_SECCOMP)) 1016 if (checkcfg(CFG_SECCOMP))
620 arg_memory_deny_write_execute = 1; 1017 arg_memory_deny_write_execute = 1;
621 else 1018 else
622 warning_feature_disabled("seccomp"); 1019 warning_feature_disabled("seccomp");
623#endif 1020 return 0;
1021 }
1022
1023 // seccomp error action
1024 if (strncmp(ptr, "seccomp-error-action ", 21) == 0) {
1025 if (checkcfg(CFG_SECCOMP)) {
1026 int config_seccomp_error_action = checkcfg(CFG_SECCOMP_ERROR_ACTION);
1027 if (config_seccomp_error_action == -1) {
1028 if (strcmp(ptr + 21, "kill") == 0)
1029 arg_seccomp_error_action = SECCOMP_RET_KILL;
1030 else if (strcmp(ptr + 21, "log") == 0)
1031 arg_seccomp_error_action = SECCOMP_RET_LOG;
1032 else {
1033 arg_seccomp_error_action = errno_find_name(ptr + 21);
1034 if (arg_seccomp_error_action == -1)
1035 errExit("seccomp-error-action: unknown errno");
1036 }
1037 cfg.seccomp_error_action = strdup(ptr + 21);
1038 if (!cfg.seccomp_error_action)
1039 errExit("strdup");
1040 } else {
1041 arg_seccomp_error_action = config_seccomp_error_action;
1042 cfg.seccomp_error_action = config_seccomp_error_action_str;
1043 warning_feature_disabled("seccomp-error-action");
1044 }
1045 } else
1046 warning_feature_disabled("seccomp");
624 return 0; 1047 return 0;
625 } 1048 }
626 1049
@@ -660,21 +1083,26 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
660 1083
661 // dns 1084 // dns
662 if (strncmp(ptr, "dns ", 4) == 0) { 1085 if (strncmp(ptr, "dns ", 4) == 0) {
663 uint32_t dns; 1086
664 if (atoip(ptr + 4, &dns)) { 1087 if (check_ip46_address(ptr + 4) == 0) {
665 fprintf(stderr, "Error: invalid DNS server IP address\n"); 1088 fprintf(stderr, "Error: invalid DNS server IPv4 or IPv6 address\n");
666 return 1; 1089 exit(1);
667 } 1090 }
1091 char *dns = strdup(ptr + 4);
1092 if (!dns)
1093 errExit("strdup");
668 1094
669 if (cfg.dns1 == 0) 1095 if (cfg.dns1 == NULL)
670 cfg.dns1 = dns; 1096 cfg.dns1 = dns;
671 else if (cfg.dns2 == 0) 1097 else if (cfg.dns2 == NULL)
672 cfg.dns2 = dns; 1098 cfg.dns2 = dns;
673 else if (cfg.dns3 == 0) 1099 else if (cfg.dns3 == NULL)
674 cfg.dns3 = dns; 1100 cfg.dns3 = dns;
1101 else if (cfg.dns4 == NULL)
1102 cfg.dns4 = dns;
675 else { 1103 else {
676 fprintf(stderr, "Error: up to 3 DNS servers can be specified\n"); 1104 fwarning("Warning: up to 4 DNS servers can be specified, %s ignored\n", dns);
677 return 1; 1105 free(dns);
678 } 1106 }
679 return 0; 1107 return 0;
680 } 1108 }
@@ -686,7 +1114,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
686 } 1114 }
687 1115
688 // nice value 1116 // nice value
689 if (strncmp(ptr, "nice ", 4) == 0) { 1117 if (strncmp(ptr, "nice ", 5) == 0) {
690 cfg.nice = atoi(ptr + 5); 1118 cfg.nice = atoi(ptr + 5);
691 if (getuid() != 0 &&cfg.nice < 0) 1119 if (getuid() != 0 &&cfg.nice < 0)
692 cfg.nice = 0; 1120 cfg.nice = 0;
@@ -696,7 +1124,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
696 1124
697 // cgroup 1125 // cgroup
698 if (strncmp(ptr, "cgroup ", 7) == 0) { 1126 if (strncmp(ptr, "cgroup ", 7) == 0) {
699 set_cgroup(ptr + 7); 1127 if (checkcfg(CFG_CGROUP))
1128 set_cgroup(ptr + 7);
1129 else
1130 warning_feature_disabled("cgroup");
700 return 0; 1131 return 0;
701 } 1132 }
702 1133
@@ -714,11 +1145,22 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
714 arg_machineid = 1; 1145 arg_machineid = 1;
715 return 0; 1146 return 0;
716 } 1147 }
1148
1149 if (strcmp(ptr, "keep-config-pulse") == 0) {
1150 arg_keep_config_pulse = 1;
1151 return 0;
1152 }
1153
717 // writable-var 1154 // writable-var
718 if (strcmp(ptr, "writable-var") == 0) { 1155 if (strcmp(ptr, "writable-var") == 0) {
719 arg_writable_var = 1; 1156 arg_writable_var = 1;
720 return 0; 1157 return 0;
721 } 1158 }
1159 // don't overwrite /var/tmp
1160 if (strcmp(ptr, "keep-var-tmp") == 0) {
1161 arg_keep_var_tmp = 1;
1162 return 0;
1163 }
722 // writable-run-user 1164 // writable-run-user
723 if (strcmp(ptr, "writable-run-user") == 0) { 1165 if (strcmp(ptr, "writable-run-user") == 0) {
724 arg_writable_run_user = 1; 1166 arg_writable_run_user = 1;
@@ -737,6 +1179,11 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
737 return 0; 1179 return 0;
738 } 1180 }
739 1181
1182 if (strcmp(ptr, "allow-debuggers") == 0) {
1183 arg_allow_debuggers = 1;
1184 return 0;
1185 }
1186
740 if (strcmp(ptr, "x11 none") == 0) { 1187 if (strcmp(ptr, "x11 none") == 0) {
741 arg_x11_block = 1; 1188 arg_x11_block = 1;
742 return 0; 1189 return 0;
@@ -745,7 +1192,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
745 if (strcmp(ptr, "x11 xephyr") == 0) { 1192 if (strcmp(ptr, "x11 xephyr") == 0) {
746#ifdef HAVE_X11 1193#ifdef HAVE_X11
747 if (checkcfg(CFG_X11)) { 1194 if (checkcfg(CFG_X11)) {
748 char *x11env = getenv("FIREJAIL_X11"); 1195 const char *x11env = env_get("FIREJAIL_X11");
749 if (x11env && strcmp(x11env, "yes") == 0) { 1196 if (x11env && strcmp(x11env, "yes") == 0) {
750 return 0; 1197 return 0;
751 } 1198 }
@@ -774,7 +1221,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
774 if (strcmp(ptr, "x11 xpra") == 0) { 1221 if (strcmp(ptr, "x11 xpra") == 0) {
775#ifdef HAVE_X11 1222#ifdef HAVE_X11
776 if (checkcfg(CFG_X11)) { 1223 if (checkcfg(CFG_X11)) {
777 char *x11env = getenv("FIREJAIL_X11"); 1224 const char *x11env = env_get("FIREJAIL_X11");
778 if (x11env && strcmp(x11env, "yes") == 0) { 1225 if (x11env && strcmp(x11env, "yes") == 0) {
779 return 0; 1226 return 0;
780 } 1227 }
@@ -793,7 +1240,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
793 if (strcmp(ptr, "x11 xvfb") == 0) { 1240 if (strcmp(ptr, "x11 xvfb") == 0) {
794#ifdef HAVE_X11 1241#ifdef HAVE_X11
795 if (checkcfg(CFG_X11)) { 1242 if (checkcfg(CFG_X11)) {
796 char *x11env = getenv("FIREJAIL_X11"); 1243 const char *x11env = env_get("FIREJAIL_X11");
797 if (x11env && strcmp(x11env, "yes") == 0) { 1244 if (x11env && strcmp(x11env, "yes") == 0) {
798 return 0; 1245 return 0;
799 } 1246 }
@@ -812,7 +1259,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
812 if (strcmp(ptr, "x11") == 0) { 1259 if (strcmp(ptr, "x11") == 0) {
813#ifdef HAVE_X11 1260#ifdef HAVE_X11
814 if (checkcfg(CFG_X11)) { 1261 if (checkcfg(CFG_X11)) {
815 char *x11env = getenv("FIREJAIL_X11"); 1262 const char *x11env = env_get("FIREJAIL_X11");
816 if (x11env && strcmp(x11env, "yes") == 0) { 1263 if (x11env && strcmp(x11env, "yes") == 0) {
817 return 0; 1264 return 0;
818 } 1265 }
@@ -830,56 +1277,69 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
830 1277
831 // private /etc list of files and directories 1278 // private /etc list of files and directories
832 if (strncmp(ptr, "private-etc ", 12) == 0) { 1279 if (strncmp(ptr, "private-etc ", 12) == 0) {
833 if (arg_writable_etc) { 1280 if (checkcfg(CFG_PRIVATE_ETC)) {
834 fprintf(stderr, "Error: --private-etc and --writable-etc are mutually exclusive\n"); 1281 if (arg_writable_etc) {
835 exit(1); 1282 fprintf(stderr, "Error: --private-etc and --writable-etc are mutually exclusive\n");
836 } 1283 exit(1);
837 if (cfg.etc_private_keep) { 1284 }
838 if ( asprintf(&cfg.etc_private_keep, "%s,%s", cfg.etc_private_keep, ptr + 12) < 0 ) 1285 if (cfg.etc_private_keep) {
839 errExit("asprintf"); 1286 if ( asprintf(&cfg.etc_private_keep, "%s,%s", cfg.etc_private_keep, ptr + 12) < 0 )
840 } else { 1287 errExit("asprintf");
841 cfg.etc_private_keep = ptr + 12; 1288 } else {
1289 cfg.etc_private_keep = ptr + 12;
1290 }
1291 arg_private_etc = 1;
842 } 1292 }
843 arg_private_etc = 1; 1293 else
844 1294 warning_feature_disabled("private-etc");
845 return 0; 1295 return 0;
846 } 1296 }
847 1297
848 // private /opt list of files and directories 1298 // private /opt list of files and directories
849 if (strncmp(ptr, "private-opt ", 12) == 0) { 1299 if (strncmp(ptr, "private-opt ", 12) == 0) {
850 if (cfg.opt_private_keep) { 1300 if (checkcfg(CFG_PRIVATE_OPT)) {
851 if ( asprintf(&cfg.opt_private_keep, "%s,%s", cfg.opt_private_keep, ptr + 12) < 0 ) 1301 if (cfg.opt_private_keep) {
852 errExit("asprintf"); 1302 if ( asprintf(&cfg.opt_private_keep, "%s,%s", cfg.opt_private_keep, ptr + 12) < 0 )
853 } else { 1303 errExit("asprintf");
854 cfg.opt_private_keep = ptr + 12; 1304 } else {
1305 cfg.opt_private_keep = ptr + 12;
1306 }
1307 arg_private_opt = 1;
855 } 1308 }
856 arg_private_opt = 1; 1309 else
857 1310 warning_feature_disabled("private-opt");
858 return 0; 1311 return 0;
859 } 1312 }
860 1313
861 // private /srv list of files and directories 1314 // private /srv list of files and directories
862 if (strncmp(ptr, "private-srv ", 12) == 0) { 1315 if (strncmp(ptr, "private-srv ", 12) == 0) {
863 if (cfg.srv_private_keep) { 1316 if (checkcfg(CFG_PRIVATE_SRV)) {
864 if ( asprintf(&cfg.srv_private_keep, "%s,%s", cfg.srv_private_keep, ptr + 12) < 0 ) 1317 if (cfg.srv_private_keep) {
865 errExit("asprintf"); 1318 if ( asprintf(&cfg.srv_private_keep, "%s,%s", cfg.srv_private_keep, ptr + 12) < 0 )
866 } else { 1319 errExit("asprintf");
867 cfg.srv_private_keep = ptr + 12; 1320 } else {
1321 cfg.srv_private_keep = ptr + 12;
1322 }
1323 arg_private_srv = 1;
868 } 1324 }
869 arg_private_srv = 1; 1325 else
870 1326 warning_feature_disabled("private-srv");
871 return 0; 1327 return 0;
872 } 1328 }
873 1329
874 // private /bin list of files 1330 // private /bin list of files
875 if (strncmp(ptr, "private-bin ", 12) == 0) { 1331 if (strncmp(ptr, "private-bin ", 12) == 0) {
876 if (cfg.bin_private_keep) { 1332 if (checkcfg(CFG_PRIVATE_BIN)) {
877 if ( asprintf(&cfg.bin_private_keep, "%s,%s", cfg.bin_private_keep, ptr + 12) < 0 ) 1333 if (cfg.bin_private_keep) {
878 errExit("asprintf"); 1334 if ( asprintf(&cfg.bin_private_keep, "%s,%s", cfg.bin_private_keep, ptr + 12) < 0 )
879 } else { 1335 errExit("asprintf");
880 cfg.bin_private_keep = ptr + 12; 1336 } else {
1337 cfg.bin_private_keep = ptr + 12;
1338 }
1339 arg_private_bin = 1;
881 } 1340 }
882 arg_private_bin = 1; 1341 else
1342 warning_feature_disabled("private-bin");
883 return 0; 1343 return 0;
884 } 1344 }
885 1345
@@ -905,6 +1365,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
905#ifdef HAVE_OVERLAYFS 1365#ifdef HAVE_OVERLAYFS
906 if (strncmp(ptr, "overlay-named ", 14) == 0) { 1366 if (strncmp(ptr, "overlay-named ", 14) == 0) {
907 if (checkcfg(CFG_OVERLAYFS)) { 1367 if (checkcfg(CFG_OVERLAYFS)) {
1368 if (arg_overlay) {
1369 fprintf(stderr, "Error: only one overlay command is allowed\n");
1370 exit(1);
1371 }
908 if (cfg.chrootdir) { 1372 if (cfg.chrootdir) {
909 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n"); 1373 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n");
910 exit(1); 1374 exit(1);
@@ -925,17 +1389,23 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
925 } 1389 }
926 1390
927 // check name 1391 // check name
928 invalid_filename(subdirname); 1392 invalid_filename(subdirname, 0); // no globbing
929 if (strstr(subdirname, "..") || strstr(subdirname, "/")) { 1393 if (strstr(subdirname, "..") || strstr(subdirname, "/")) {
930 fprintf(stderr, "Error: invalid overlay name\n"); 1394 fprintf(stderr, "Error: invalid overlay name\n");
931 exit(1); 1395 exit(1);
932 } 1396 }
933 cfg.overlay_dir = fs_check_overlay_dir(subdirname, arg_overlay_reuse); 1397 cfg.overlay_dir = fs_check_overlay_dir(subdirname, arg_overlay_reuse);
934 } 1398 }
935 1399 else
1400 warning_feature_disabled("overlayfs");
936 return 0; 1401 return 0;
1402
937 } else if (strcmp(ptr, "overlay-tmpfs") == 0) { 1403 } else if (strcmp(ptr, "overlay-tmpfs") == 0) {
938 if (checkcfg(CFG_OVERLAYFS)) { 1404 if (checkcfg(CFG_OVERLAYFS)) {
1405 if (arg_overlay) {
1406 fprintf(stderr, "Error: only one overlay command is allowed\n");
1407 exit(1);
1408 }
939 if (cfg.chrootdir) { 1409 if (cfg.chrootdir) {
940 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n"); 1410 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n");
941 exit(1); 1411 exit(1);
@@ -946,11 +1416,17 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
946 exit(1); 1416 exit(1);
947 } 1417 }
948 arg_overlay = 1; 1418 arg_overlay = 1;
949
950 return 0;
951 } 1419 }
1420 else
1421 warning_feature_disabled("overlayfs");
1422 return 0;
1423
952 } else if (strcmp(ptr, "overlay") == 0) { 1424 } else if (strcmp(ptr, "overlay") == 0) {
953 if (checkcfg(CFG_OVERLAYFS)) { 1425 if (checkcfg(CFG_OVERLAYFS)) {
1426 if (arg_overlay) {
1427 fprintf(stderr, "Error: only one overlay command is allowed\n");
1428 exit(1);
1429 }
954 if (cfg.chrootdir) { 1430 if (cfg.chrootdir) {
955 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n"); 1431 fprintf(stderr, "Error: --overlay and --chroot options are mutually exclusive\n");
956 exit(1); 1432 exit(1);
@@ -969,22 +1445,22 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
969 cfg.overlay_dir = fs_check_overlay_dir(subdirname, arg_overlay_reuse); 1445 cfg.overlay_dir = fs_check_overlay_dir(subdirname, arg_overlay_reuse);
970 1446
971 free(subdirname); 1447 free(subdirname);
972
973 return 0;
974 } 1448 }
1449 else
1450 warning_feature_disabled("overlayfs");
1451 return 0;
975 } 1452 }
976#endif 1453#endif
977 1454
978 // filesystem bind 1455 // filesystem bind
979 if (strncmp(ptr, "bind ", 5) == 0) { 1456 if (strncmp(ptr, "bind ", 5) == 0) {
980#ifdef HAVE_BIND
981 if (checkcfg(CFG_BIND)) { 1457 if (checkcfg(CFG_BIND)) {
1458 // extract two directories
982 if (getuid() != 0) { 1459 if (getuid() != 0) {
983 fprintf(stderr, "Error: --bind option is available only if running as root\n"); 1460 fprintf(stderr, "Error: --bind option is available only if running as root\n");
984 exit(1); 1461 exit(1);
985 } 1462 }
986 1463
987 // extract two directories
988 char *dname1 = ptr + 5; 1464 char *dname1 = ptr + 5;
989 char *dname2 = split_comma(dname1); // this inserts a '0 to separate the two dierctories 1465 char *dname2 = split_comma(dname1); // this inserts a '0 to separate the two dierctories
990 if (dname2 == NULL) { 1466 if (dname2 == NULL) {
@@ -993,8 +1469,8 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
993 } 1469 }
994 1470
995 // check directories 1471 // check directories
996 invalid_filename(dname1); 1472 invalid_filename(dname1, 0); // no globbing
997 invalid_filename(dname2); 1473 invalid_filename(dname2, 0); // no globbing
998 if (strstr(dname1, "..") || strstr(dname2, "..")) { 1474 if (strstr(dname1, "..") || strstr(dname2, "..")) {
999 fprintf(stderr, "Error: invalid file name.\n"); 1475 fprintf(stderr, "Error: invalid file name.\n");
1000 exit(1); 1476 exit(1);
@@ -1010,7 +1486,6 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1010 } 1486 }
1011 else 1487 else
1012 warning_feature_disabled("bind"); 1488 warning_feature_disabled("bind");
1013#endif
1014 return 0; 1489 return 0;
1015 } 1490 }
1016 1491
@@ -1021,14 +1496,22 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1021 sscanf(ptr + 14, "%llu", &cfg.rlimit_nofile); 1496 sscanf(ptr + 14, "%llu", &cfg.rlimit_nofile);
1022 arg_rlimit_nofile = 1; 1497 arg_rlimit_nofile = 1;
1023 } 1498 }
1499 else if (strncmp(ptr, "rlimit-cpu ", 11) == 0) {
1500 check_unsigned(ptr + 11, "Error: invalid rlimit in profile file: ");
1501 sscanf(ptr + 11, "%llu", &cfg.rlimit_cpu);
1502 arg_rlimit_cpu = 1;
1503 }
1024 else if (strncmp(ptr, "rlimit-nproc ", 13) == 0) { 1504 else if (strncmp(ptr, "rlimit-nproc ", 13) == 0) {
1025 check_unsigned(ptr + 13, "Error: invalid rlimit in profile file: "); 1505 check_unsigned(ptr + 13, "Error: invalid rlimit in profile file: ");
1026 sscanf(ptr + 13, "%llu", &cfg.rlimit_nproc); 1506 sscanf(ptr + 13, "%llu", &cfg.rlimit_nproc);
1027 arg_rlimit_nproc = 1; 1507 arg_rlimit_nproc = 1;
1028 } 1508 }
1029 else if (strncmp(ptr, "rlimit-fsize ", 13) == 0) { 1509 else if (strncmp(ptr, "rlimit-fsize ", 13) == 0) {
1030 check_unsigned(ptr + 13, "Error: invalid rlimit in profile file: "); 1510 cfg.rlimit_fsize = parse_arg_size(ptr + 13);
1031 sscanf(ptr + 13, "%llu", &cfg.rlimit_fsize); 1511 if (cfg.rlimit_fsize == 0) {
1512 perror("Error: invalid rlimit-fsize in profile file. Only use positive numbers and k, m or g suffix.");
1513 exit(1);
1514 }
1032 arg_rlimit_fsize = 1; 1515 arg_rlimit_fsize = 1;
1033 } 1516 }
1034 else if (strncmp(ptr, "rlimit-sigpending ", 18) == 0) { 1517 else if (strncmp(ptr, "rlimit-sigpending ", 18) == 0) {
@@ -1036,35 +1519,55 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1036 sscanf(ptr + 18, "%llu", &cfg.rlimit_sigpending); 1519 sscanf(ptr + 18, "%llu", &cfg.rlimit_sigpending);
1037 arg_rlimit_sigpending = 1; 1520 arg_rlimit_sigpending = 1;
1038 } 1521 }
1522 else if (strncmp(ptr, "rlimit-as ", 10) == 0) {
1523 cfg.rlimit_as = parse_arg_size(ptr + 10);
1524 if (cfg.rlimit_as == 0) {
1525 perror("Error: invalid rlimit-as in profile file. Only use positive numbers and k, m or g suffix.");
1526 exit(1);
1527 }
1528 arg_rlimit_as = 1;
1529 }
1039 else { 1530 else {
1040 fprintf(stderr, "Invalid rlimit option on line %d\n", lineno); 1531 fprintf(stderr, "Error: Invalid rlimit option on line %d\n", lineno);
1041 exit(1); 1532 exit(1);
1042 } 1533 }
1043 1534
1044 return 0; 1535 return 0;
1045 } 1536 }
1046 1537
1047 if (strncmp(ptr, "join-or-start ", 14) == 0) { 1538 if (strncmp(ptr, "timeout ", 8) == 0) {
1048 // try to join by name only 1539 cfg.timeout = extract_timeout(ptr +8);
1049 pid_t pid; 1540 return 0;
1050 if (!name2pid(ptr + 14, &pid)) { 1541 }
1051 if (!cfg.shell && !arg_shell_none)
1052 cfg.shell = guess_shell();
1053
1054 // find first non-option arg
1055 int i;
1056 for (i = 1; i < cfg.original_argc && strncmp(cfg.original_argv[i], "--", 2) != 0; i++);
1057 1542
1058 join(pid, cfg.original_argc,cfg.original_argv, i + 1); 1543 if (strncmp(ptr, "join-or-start ", 14) == 0) {
1059 exit(0); 1544 if (checkcfg(CFG_JOIN) || getuid() == 0) {
1060 } 1545 // try to join by name only
1546 pid_t pid;
1547 EUID_ROOT();
1548 int r = name2pid(ptr + 14, &pid);
1549 EUID_USER();
1550 if (!r) {
1551 if (!cfg.shell && !arg_shell_none)
1552 cfg.shell = guess_shell();
1553
1554 // find first non-option arg
1555 int i;
1556 for (i = 1; i < cfg.original_argc && strncmp(cfg.original_argv[i], "--", 2) != 0; i++);
1557
1558 join(pid, cfg.original_argc,cfg.original_argv, i + 1);
1559 exit(0);
1560 }
1061 1561
1062 // set sandbox name and start normally 1562 // set sandbox name and start normally
1063 cfg.name = ptr + 14; 1563 cfg.name = ptr + 14;
1064 if (strlen(cfg.name) == 0) { 1564 if (strlen(cfg.name) == 0) {
1065 fprintf(stderr, "Error: invalid sandbox name\n"); 1565 fprintf(stderr, "Error: invalid sandbox name\n");
1066 exit(1); 1566 exit(1);
1567 }
1067 } 1568 }
1569 else
1570 warning_feature_disabled("join");
1068 return 0; 1571 return 0;
1069 } 1572 }
1070 1573
@@ -1073,6 +1576,11 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1073 return 0; 1576 return 0;
1074 } 1577 }
1075 1578
1579 if (strcmp(ptr, "deterministic-exit-code") == 0) {
1580 arg_deterministic_exit_code = 1;
1581 return 0;
1582 }
1583
1076 // rest of filesystem 1584 // rest of filesystem
1077 if (strncmp(ptr, "blacklist ", 10) == 0) 1585 if (strncmp(ptr, "blacklist ", 10) == 0)
1078 ptr += 10; 1586 ptr += 10;
@@ -1081,16 +1589,8 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1081 else if (strncmp(ptr, "noblacklist ", 12) == 0) 1589 else if (strncmp(ptr, "noblacklist ", 12) == 0)
1082 ptr += 12; 1590 ptr += 12;
1083 else if (strncmp(ptr, "whitelist ", 10) == 0) { 1591 else if (strncmp(ptr, "whitelist ", 10) == 0) {
1084#ifdef HAVE_WHITELIST 1592 arg_whitelist = 1;
1085 if (checkcfg(CFG_WHITELIST)) { 1593 ptr += 10;
1086 arg_whitelist = 1;
1087 ptr += 10;
1088 }
1089 else
1090 return 0;
1091#else
1092 return 0;
1093#endif
1094 } 1594 }
1095 else if (strncmp(ptr, "nowhitelist ", 12) == 0) 1595 else if (strncmp(ptr, "nowhitelist ", 12) == 0)
1096 ptr += 12; 1596 ptr += 12;
@@ -1101,10 +1601,12 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1101 else if (strncmp(ptr, "noexec ", 7) == 0) 1601 else if (strncmp(ptr, "noexec ", 7) == 0)
1102 ptr += 7; 1602 ptr += 7;
1103 else if (strncmp(ptr, "tmpfs ", 6) == 0) { 1603 else if (strncmp(ptr, "tmpfs ", 6) == 0) {
1604#ifndef HAVE_USERTMPFS
1104 if (getuid() != 0) { 1605 if (getuid() != 0) {
1105 fprintf(stderr, "Error: tmpfs available only when running the sandbox as root\n"); 1606 fprintf(stderr, "Error: tmpfs available only when running the sandbox as root\n");
1106 exit(1); 1607 exit(1);
1107 } 1608 }
1609#endif
1108 ptr += 6; 1610 ptr += 6;
1109 } 1611 }
1110 else { 1612 else {
@@ -1118,7 +1620,7 @@ int profile_check_line(char *ptr, int lineno, const char *fname) {
1118 } 1620 }
1119 1621
1120 // some characters just don't belong in filenames 1622 // some characters just don't belong in filenames
1121 invalid_filename(ptr); 1623 invalid_filename(ptr, 1); // globbing
1122 if (strstr(ptr, "..")) { 1624 if (strstr(ptr, "..")) {
1123 if (lineno == 0) 1625 if (lineno == 0)
1124 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr); 1626 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr);
@@ -1165,23 +1667,24 @@ void profile_read(const char *fname) {
1165 } 1667 }
1166 1668
1167 // check file 1669 // check file
1168 invalid_filename(fname); 1670 invalid_filename(fname, 0); // no globbing
1169 if (strlen(fname) == 0 || is_dir(fname)) { 1671 if (strlen(fname) == 0 || is_dir(fname)) {
1170 fprintf(stderr, "Error: invalid profile file\n"); 1672 fprintf(stderr, "Error: invalid profile file\n");
1171 exit(1); 1673 exit(1);
1172 } 1674 }
1173 if (access(fname, R_OK)) { 1675 if (access(fname, R_OK)) {
1676 int errsv = errno;
1174 // if the file ends in ".local", do not exit 1677 // if the file ends in ".local", do not exit
1175 const char *base = gnu_basename(fname); 1678 const char *base = gnu_basename(fname);
1176 char *ptr = strstr(base, ".local"); 1679 char *ptr = strstr(base, ".local");
1177 if (ptr && strlen(ptr) == 6) 1680 if (ptr && strlen(ptr) == 6 && errsv != EACCES)
1178 return; 1681 return;
1179 1682
1180 fprintf(stderr, "Error: cannot access profile file\n"); 1683 fprintf(stderr, "Error: cannot access profile file: %s\n", fname);
1181 exit(1); 1684 exit(1);
1182 } 1685 }
1183 1686
1184 // allow debuggers 1687 // --allow-debuggers - skip disable-devel.inc file
1185 if (arg_allow_debuggers) { 1688 if (arg_allow_debuggers) {
1186 char *tmp = strrchr(fname, '/'); 1689 char *tmp = strrchr(fname, '/');
1187 if (tmp && *(tmp + 1) != '\0') { 1690 if (tmp && *(tmp + 1) != '\0') {
@@ -1190,36 +1693,26 @@ void profile_read(const char *fname) {
1190 return; 1693 return;
1191 } 1694 }
1192 } 1695 }
1696 // --appimage - skip disable-shell.inc file
1697 if (arg_appimage) {
1698 char *tmp = strrchr(fname, '/');
1699 if (tmp && *(tmp + 1) != '\0') {
1700 tmp++;
1701 if (strcmp(tmp, "disable-shell.inc") == 0)
1702 return;
1703 }
1704 }
1193 1705
1194 // open profile file: 1706 // open profile file:
1195 FILE *fp = fopen(fname, "r"); 1707 FILE *fp = fopen(fname, "re");
1196 if (fp == NULL) { 1708 if (fp == NULL) {
1197 fprintf(stderr, "Error: cannot open profile file %s\n", fname); 1709 fprintf(stderr, "Error: cannot open profile file %s\n", fname);
1198 exit(1); 1710 exit(1);
1199 } 1711 }
1200 1712
1201 // save the name of the file for --profile.print option 1713 // save the name of the file for --profile.print option
1202 if (include_level == 0) { 1714 if (include_level == 0)
1203 char *runfile; 1715 set_profile_run_file(getpid(), fname);
1204 if (asprintf(&runfile, "%s/%d", RUN_FIREJAIL_PROFILE_DIR, getpid()) == -1)
1205 errExit("asprintf");
1206
1207 EUID_ROOT();
1208 // the file is deleted first
1209 FILE *fp = fopen(runfile, "w");
1210 if (!fp) {
1211 fprintf(stderr, "Error: cannot create %s\n", runfile);
1212 exit(1);
1213 }
1214 fprintf(fp, "%s\n", fname);
1215
1216 // mode and ownership
1217 SET_PERMS_STREAM(fp, 0, 0, 0644);
1218 fclose(fp);
1219 EUID_USER();
1220 free(runfile);
1221 }
1222
1223 1716
1224 int msg_printed = 0; 1717 int msg_printed = 0;
1225 1718
@@ -1228,44 +1721,100 @@ void profile_read(const char *fname) {
1228 int lineno = 0; 1721 int lineno = 0;
1229 while (fgets(buf, MAX_READ, fp)) { 1722 while (fgets(buf, MAX_READ, fp)) {
1230 ++lineno; 1723 ++lineno;
1724
1725 // remove comments
1726 char *ptr = strchr(buf, '#');
1727 if (ptr)
1728 *ptr = '\0';
1729
1231 // remove empty space - ptr in allocated memory 1730 // remove empty space - ptr in allocated memory
1232 char *ptr = line_remove_spaces(buf); 1731 ptr = line_remove_spaces(buf);
1233 if (ptr == NULL) 1732 if (ptr == NULL)
1234 continue; 1733 continue;
1235 1734 if (*ptr == '\0') {
1236 // comments
1237 if (*ptr == '#' || *ptr == '\0') {
1238 free(ptr); 1735 free(ptr);
1239 continue; 1736 continue;
1240 } 1737 }
1241 1738
1739 // translate allow/deny to whitelist/blacklist
1740 if (strncmp(ptr, "allow ", 6) == 0) {
1741 char *tmp;
1742 if (asprintf(&tmp, "whitelist %s", ptr + 6) == -1)
1743 errExit("asprintf");
1744 free(ptr);
1745 ptr = tmp;
1746 }
1747 else if (strncmp(ptr, "deny ", 5) == 0) {
1748 char *tmp;
1749 if (asprintf(&tmp, "blacklist %s", ptr + 5) == -1)
1750 errExit("asprintf");
1751 free(ptr);
1752 ptr = tmp;
1753 }
1754 else if (strncmp(ptr, "deny-nolog ", 11) == 0) {
1755 char *tmp;
1756 if (asprintf(&tmp, "blacklist-nolog %s", ptr + 11) == -1)
1757 errExit("asprintf");
1758 free(ptr);
1759 ptr = tmp;
1760 }
1761 // translate noallow/nodeny to nowhitelist/noblacklist
1762 else if (strncmp(ptr, "noallow ", 8) == 0) {
1763 char *tmp;
1764 if (asprintf(&tmp, "nowhitelist %s", ptr + 8) == -1)
1765 errExit("asprintf");
1766 free(ptr);
1767 ptr = tmp;
1768 }
1769 else if (strncmp(ptr, "nodeny ", 7) == 0) {
1770 char *tmp;
1771 if (asprintf(&tmp, "noblacklist %s", ptr + 7) == -1)
1772 errExit("asprintf");
1773 free(ptr);
1774 ptr = tmp;
1775 }
1776
1242 // process quiet 1777 // process quiet
1778 // todo: a quiet in the profile file cannot be disabled by --ignore on command line
1243 if (strcmp(ptr, "quiet") == 0) { 1779 if (strcmp(ptr, "quiet") == 0) {
1244 arg_quiet = 1; 1780 if (is_in_ignore_list(ptr))
1781 arg_quiet = 0;
1782 else if (!arg_debug)
1783 arg_quiet = 1;
1245 free(ptr); 1784 free(ptr);
1246 continue; 1785 continue;
1247 } 1786 }
1248 if (!msg_printed) { 1787 if (!msg_printed) {
1249 if (!arg_quiet) 1788 fmessage("Reading profile %s\n", fname);
1250 fprintf(stderr, "Reading profile %s\n", fname);
1251 msg_printed = 1; 1789 msg_printed = 1;
1252 } 1790 }
1253 1791
1254 // process include 1792 // process include
1255 if (strncmp(ptr, "include ", 8) == 0) { 1793 if (strncmp(ptr, "include ", 8) == 0 && !is_in_ignore_list(ptr)) {
1256 include_level++; 1794 include_level++;
1257 1795
1258 // extract profile filename and new skip params 1796 // expand macros in front of the include profile file
1259 char *newprofile = ptr + 8; // profile name 1797 char *newprofile = expand_macros(ptr + 8);
1260 1798
1261 // expand ${HOME}/ in front of the new profile file 1799 char *ptr2 = newprofile;
1262 char *newprofile2 = expand_home(newprofile, cfg.homedir); 1800 while (*ptr2 != '/' && *ptr2 != '\0')
1801 ptr2++;
1802 // profile path contains no / chars, do a search
1803 if (*ptr2 == '\0') {
1804 int rv = profile_find_firejail(newprofile, 0); // returns 1 if a profile was found in sysconfig directory
1805 if (!rv) {
1806 // maybe this is a file in the local working directory?
1807 // it will stop the sandbox if not!
1808 // Note: if the file ends in .local it will not stop the program
1809 profile_read(newprofile);
1810 }
1811 }
1812 else {
1813 profile_read(newprofile);
1814 }
1263 1815
1264 // recursivity
1265 profile_read((newprofile2)? newprofile2:newprofile);
1266 include_level--; 1816 include_level--;
1267 if (newprofile2) 1817 free(newprofile);
1268 free(newprofile2);
1269 free(ptr); 1818 free(ptr);
1270 continue; 1819 continue;
1271 } 1820 }
@@ -1277,9 +1826,148 @@ void profile_read(const char *fname) {
1277// else { 1826// else {
1278// free(ptr); 1827// free(ptr);
1279// } 1828// }
1280#ifdef HAVE_GCOV 1829
1281 __gcov_flush(); 1830 __gcov_flush();
1282#endif
1283 } 1831 }
1284 fclose(fp); 1832 fclose(fp);
1285} 1833}
1834
1835char *profile_list_normalize(char *list)
1836{
1837 /* Remove redundant commas.
1838 *
1839 * As result is always shorter than original,
1840 * in-place copying can be used.
1841 */
1842 size_t i = 0;
1843 size_t j = 0;
1844 int c;
1845 while (list[i] == ',')
1846 ++i;
1847 while ((c = list[i++])) {
1848 if (c == ',') {
1849 while (list[i] == ',')
1850 ++i;
1851 if (list[i] == 0)
1852 break;
1853 }
1854 list[j++] = c;
1855 }
1856 list[j] = 0;
1857 return list;
1858}
1859
1860char *profile_list_compress(char *list)
1861{
1862 size_t i;
1863
1864 /* Comma separated list is processed so that:
1865 * "item" -> adds item to list
1866 * "-item" -> removes item from list
1867 * "+item" -> adds item to list
1868 * "=item" -> clear list, add item
1869 *
1870 * For example:
1871 * ,a,,,b,,,c, -> a,b,c
1872 * a,,b,,,c,a -> a,b,c
1873 * a,b,c,-a -> b,c
1874 * a,b,c,-a,a -> b,c,a
1875 * a,+b,c -> a,b,c
1876 * a,b,=c,d -> c,d
1877 * a,b,c,= ->
1878 */
1879 profile_list_normalize(list);
1880
1881 /* Count items: comma count + 1 */
1882 size_t count = 1;
1883 for (i = 0; list[i]; ++i) {
1884 if (list[i] == ',')
1885 ++count;
1886 }
1887
1888 /* Collect items in an array */
1889 char *in[count];
1890 count = 0;
1891 in[count++] = list;
1892 for (i = 0; list[i]; ++i) {
1893 if (list[i] != ',')
1894 continue;
1895 list[i] = 0;
1896 in[count++] = list + i + 1;
1897 }
1898
1899 /* Filter array: add, remove, reset, filter out duplicates */
1900 for (i = 0; i < count; ++i) {
1901 char *item = in[i];
1902 assert(item);
1903
1904 size_t k;
1905 switch (*item) {
1906 case '-':
1907 ++item;
1908 /* Do not include this item */
1909 in[i] = 0;
1910 /* Remove if already included */
1911 for (k = 0; k < i; ++k) {
1912 if (in[k] && !strcmp(in[k], item)) {
1913 in[k] = 0;
1914 break;
1915 }
1916 }
1917 break;
1918 case '+':
1919 /* Allow +/- symmetry */
1920 in[i] = ++item;
1921 /* FALLTHRU */
1922 default:
1923 /* Adding empty item is a NOP */
1924 if (!*item) {
1925 in[i] = 0;
1926 break;
1927 }
1928 /* Include item unless it is already included */
1929 for (k = 0; k < i; ++k) {
1930 if (in[k] && !strcmp(in[k], item)) {
1931 in[i] = 0;
1932 break;
1933 }
1934 }
1935 break;
1936 case '=':
1937 in[i] = ++item;
1938 /* Include non-empty item */
1939 if (!*item)
1940 in[i] = 0;
1941 /* Remove all already included items */
1942 for (k = 0; k < i; ++k)
1943 in[k] = 0;
1944 break;
1945 }
1946 }
1947
1948 /* Copying back using in-place data works because the
1949 * original order is retained and no item gets longer
1950 * than what it used to be.
1951 */
1952 char *pos = list;
1953 for (i = 0; i < count; ++i) {
1954 char *item = in[i];
1955 if (!item)
1956 continue;
1957 if (pos > list)
1958 *pos++ = ',';
1959 while (*item)
1960 *pos++ = *item++;
1961 }
1962 *pos = 0;
1963 return list;
1964}
1965
1966void profile_list_augment(char **list, const char *items)
1967{
1968 char *tmp = 0;
1969 if (asprintf(&tmp, "%s,%s", *list ?: "", items ?: "") < 0)
1970 errExit("asprintf");
1971 free(*list);
1972 *list = profile_list_compress(tmp);
1973}
diff --git a/src/firejail/protocol.c b/src/firejail/protocol.c
index 9524d6617..f21f8c96e 100644
--- a/src/firejail/protocol.c
+++ b/src/firejail/protocol.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,13 +18,12 @@
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 20
21#ifdef HAVE_SECCOMP
22#include "firejail.h" 21#include "firejail.h"
23#include "../include/seccomp.h" 22#include "../include/seccomp.h"
24 23
25void protocol_filter_save(void) { 24void protocol_filter_save(void) {
26 // save protocol filter configuration in PROTOCOL_CFG 25 // save protocol filter configuration in PROTOCOL_CFG
27 FILE *fp = fopen(RUN_PROTOCOL_CFG, "w"); 26 FILE *fp = fopen(RUN_PROTOCOL_CFG, "wxe");
28 if (!fp) 27 if (!fp)
29 errExit("fopen"); 28 errExit("fopen");
30 fprintf(fp, "%s\n", cfg.protocol); 29 fprintf(fp, "%s\n", cfg.protocol);
@@ -36,7 +35,7 @@ void protocol_filter_load(const char *fname) {
36 assert(fname); 35 assert(fname);
37 36
38 // read protocol filter configuration from PROTOCOL_CFG 37 // read protocol filter configuration from PROTOCOL_CFG
39 FILE *fp = fopen(fname, "r"); 38 FILE *fp = fopen(fname, "re");
40 if (!fp) 39 if (!fp)
41 return; 40 return;
42 41
@@ -64,29 +63,11 @@ void protocol_print_filter(pid_t pid) {
64 63
65 (void) pid; 64 (void) pid;
66#ifdef SYS_socket 65#ifdef SYS_socket
67 // if the pid is that of a firejail process, use the pid of the first child process 66 // in case the pid is that of a firejail process, use the pid of the first child process
68 EUID_ROOT(); 67 pid = switch_to_child(pid);
69 char *comm = pid_proc_comm(pid);
70 EUID_USER();
71 if (comm) {
72 if (strcmp(comm, "firejail") == 0) {
73 pid_t child;
74 if (find_child(pid, &child) == 0) {
75 pid = child;
76 }
77 }
78 free(comm);
79 }
80 68
81 // check privileges for non-root users 69 // exit if no permission to join the sandbox
82 uid_t uid = getuid(); 70 check_join_permission(pid);
83 if (uid != 0) {
84 uid_t sandbox_uid = pid_get_uid(pid);
85 if (uid != sandbox_uid) {
86 fprintf(stderr, "Error: permission denied.\n");
87 exit(1);
88 }
89 }
90 71
91 // find the seccomp filter 72 // find the seccomp filter
92 EUID_ROOT(); 73 EUID_ROOT();
@@ -108,9 +89,6 @@ void protocol_print_filter(pid_t pid) {
108 exit(0); 89 exit(0);
109#else 90#else
110 fwarning("--protocol not supported on this platform\n"); 91 fwarning("--protocol not supported on this platform\n");
111 return; 92 exit(1);
112#endif 93#endif
113} 94}
114
115
116#endif // HAVE_SECCOMP
diff --git a/src/firejail/pulseaudio.c b/src/firejail/pulseaudio.c
index 2f8cd5f7d..f8d4c2f3c 100644
--- a/src/firejail/pulseaudio.c
+++ b/src/firejail/pulseaudio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,56 +20,37 @@
20#include "firejail.h" 20#include "firejail.h"
21#include <sys/types.h> 21#include <sys/types.h>
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <sys/statvfs.h>
23#include <sys/mount.h> 24#include <sys/mount.h>
24#include <dirent.h> 25#include <dirent.h>
26#include <errno.h>
25#include <sys/wait.h> 27#include <sys/wait.h>
26 28
27static void disable_file(const char *path, const char *file) { 29#include <fcntl.h>
28 assert(file); 30#ifndef O_PATH
29 assert(path); 31#define O_PATH 010000000
30 32#endif
31 struct stat s;
32 char *fname;
33 if (asprintf(&fname, "%s/%s", path, file) == -1)
34 errExit("asprintf");
35 if (stat(fname, &s) == -1)
36 goto doexit;
37
38 if (arg_debug)
39 printf("Disable%s\n", fname);
40
41 if (S_ISDIR(s.st_mode)) {
42 if (mount(RUN_RO_DIR, fname, "none", MS_BIND, "mode=400,gid=0") < 0)
43 errExit("disable file");
44 }
45 else {
46 if (mount(RUN_RO_FILE, fname, "none", MS_BIND, "mode=400,gid=0") < 0)
47 errExit("disable file");
48 }
49 fs_logger2("blacklist", fname);
50 33
51doexit: 34#define PULSE_CLIENT_SYSCONF "/etc/pulse/client.conf"
52 free(fname);
53}
54 35
55// disable pulseaudio socket 36// disable pulseaudio socket
56void pulseaudio_disable(void) { 37void pulseaudio_disable(void) {
57 if (arg_debug) 38 if (arg_debug)
58 printf("disable pulseaudio\n"); 39 printf("disable pulseaudio\n");
59 // blacklist user config directory 40 // blacklist user config directory
60 disable_file(cfg.homedir, ".config/pulse"); 41 disable_file_path(cfg.homedir, ".config/pulse");
61 42
62 43
63 // blacklist pulseaudio socket in XDG_RUNTIME_DIR 44 // blacklist pulseaudio socket in XDG_RUNTIME_DIR
64 char *name = getenv("XDG_RUNTIME_DIR"); 45 const char *name = env_get("XDG_RUNTIME_DIR");
65 if (name) 46 if (name)
66 disable_file(name, "pulse/native"); 47 disable_file_path(name, "pulse/native");
67 48
68 // try the default location anyway 49 // try the default location anyway
69 char *path; 50 char *path;
70 if (asprintf(&path, "/run/user/%d", getuid()) == -1) 51 if (asprintf(&path, "/run/user/%d", getuid()) == -1)
71 errExit("asprintf"); 52 errExit("asprintf");
72 disable_file(path, "pulse/native"); 53 disable_file_path(path, "pulse");
73 free(path); 54 free(path);
74 55
75 56
@@ -87,125 +68,98 @@ void pulseaudio_disable(void) {
87 struct dirent *entry; 68 struct dirent *entry;
88 while ((entry = readdir(dir))) { 69 while ((entry = readdir(dir))) {
89 if (strncmp(entry->d_name, "pulse-", 6) == 0) { 70 if (strncmp(entry->d_name, "pulse-", 6) == 0) {
90 disable_file("/tmp", entry->d_name); 71 disable_file_path("/tmp", entry->d_name);
91 } 72 }
92 } 73 }
93 74
94 closedir(dir); 75 closedir(dir);
95
96} 76}
97 77
98 78// disable shm in pulseaudio (issue #69)
99// disable shm in pulseaudio
100void pulseaudio_init(void) { 79void pulseaudio_init(void) {
101 struct stat s;
102
103 // do we have pulseaudio in the system? 80 // do we have pulseaudio in the system?
104 if (stat("/etc/pulse/client.conf", &s) == -1) 81 if (access(PULSE_CLIENT_SYSCONF, R_OK)) {
82 if (arg_debug)
83 printf("Cannot read %s\n", PULSE_CLIENT_SYSCONF);
105 return; 84 return;
85 }
106 86
107 // create the new user pulseaudio directory 87 // create ~/.config/pulse directory if not present
108 int rv = mkdir(RUN_PULSE_DIR, 0700); 88 char *homeusercfg = NULL;
109 (void) rv; // in --chroot mode the directory can already be there 89 if (asprintf(&homeusercfg, "%s/.config", cfg.homedir) == -1)
110 if (set_perms(RUN_PULSE_DIR, getuid(), getgid(), 0700)) 90 errExit("asprintf");
111 errExit("set_perms"); 91 if (create_empty_dir_as_user(homeusercfg, 0700))
92 fs_logger2("create", homeusercfg);
112 93
94 free(homeusercfg);
95 if (asprintf(&homeusercfg, "%s/.config/pulse", cfg.homedir) == -1)
96 errExit("asprintf");
97 if (create_empty_dir_as_user(homeusercfg, 0700))
98 fs_logger2("create", homeusercfg);
99
100 // create the new user pulseaudio directory
101 // that will be mounted over ~/.config/pulse
102 if (mkdir(RUN_PULSE_DIR, 0700) == -1)
103 errExit("mkdir");
104 selinux_relabel_path(RUN_PULSE_DIR, homeusercfg);
105 fs_remount(RUN_PULSE_DIR, MOUNT_NOEXEC, 0);
113 // create the new client.conf file 106 // create the new client.conf file
114 char *pulsecfg = NULL; 107 char *pulsecfg = NULL;
115 if (asprintf(&pulsecfg, "%s/client.conf", RUN_PULSE_DIR) == -1) 108 if (asprintf(&pulsecfg, "%s/client.conf", RUN_PULSE_DIR) == -1)
116 errExit("asprintf"); 109 errExit("asprintf");
117 if (copy_file("/etc/pulse/client.conf", pulsecfg, -1, -1, 0644)) // root needed 110 if (copy_file(PULSE_CLIENT_SYSCONF, pulsecfg, -1, -1, 0644)) // root needed
118 errExit("copy_file"); 111 errExit("copy_file");
119 FILE *fp = fopen(pulsecfg, "a+"); 112 FILE *fp = fopen(pulsecfg, "ae");
120 if (!fp) 113 if (!fp)
121 errExit("fopen"); 114 errExit("fopen");
122 fprintf(fp, "%s", "\nenable-shm = no\n"); 115 fprintf(fp, "%s", "\nenable-shm = no\n");
123 SET_PERMS_STREAM(fp, getuid(), getgid(), 0644); 116 SET_PERMS_STREAM(fp, getuid(), getgid(), 0644);
124 fclose(fp); 117 fclose(fp);
118 // hand over the directory to the user
119 if (set_perms(RUN_PULSE_DIR, getuid(), getgid(), 0700))
120 errExit("set_perms");
125 121
126 // create ~/.config/pulse directory if not present 122 // if ~/.config/pulse exists and there are no symbolic links, mount the new directory
127 char *dir1; 123 // else set environment variable
128 if (asprintf(&dir1, "%s/.config", cfg.homedir) == -1) 124 EUID_USER();
129 errExit("asprintf"); 125 int fd = safer_openat(-1, homeusercfg, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
130 if (stat(dir1, &s) == -1) { 126 EUID_ROOT();
131 pid_t child = fork(); 127 if (fd == -1) {
132 if (child < 0) 128 fwarning("not mounting tmpfs on %s\n", homeusercfg);
133 errExit("fork"); 129 env_store_name_val("PULSE_CLIENTCONFIG", pulsecfg, SETENV);
134 if (child == 0) { 130 goto out;
135 // drop privileges
136 drop_privs(0);
137
138 int rv = mkdir(dir1, 0755);
139 if (rv == 0) {
140 if (set_perms(dir1, getuid(), getgid(), 0755))
141 {;} // do nothing
142 }
143#ifdef HAVE_GCOV
144 __gcov_flush();
145#endif
146 _exit(0);
147 }
148 // wait for the child to finish
149 waitpid(child, NULL, 0);
150 }
151 else {
152 // make sure the directory is owned by the user
153 if (s.st_uid != getuid()) {
154 fprintf(stderr, "Error: user .config directory is not owned by the current user\n");
155 exit(1);
156 }
157 } 131 }
158 free(dir1); 132 // preserve a read-only mount
159 133 struct statvfs vfs;
160 if (asprintf(&dir1, "%s/.config/pulse", cfg.homedir) == -1) 134 if (fstatvfs(fd, &vfs) == -1)
135 errExit("fstatvfs");
136 if ((vfs.f_flag & MS_RDONLY) == MS_RDONLY)
137 fs_remount(RUN_PULSE_DIR, MOUNT_READONLY, 0);
138 // mount via the link in /proc/self/fd
139 if (arg_debug)
140 printf("Mounting %s on %s\n", RUN_PULSE_DIR, homeusercfg);
141 if (bind_mount_path_to_fd(RUN_PULSE_DIR, fd))
142 errExit("mount pulseaudio");
143 // check /proc/self/mountinfo to confirm the mount is ok
144 MountData *mptr = get_last_mount();
145 if (strcmp(mptr->dir, homeusercfg) != 0 || strcmp(mptr->fstype, "tmpfs") != 0)
146 errLogExit("invalid pulseaudio mount");
147 fs_logger2("tmpfs", homeusercfg);
148 close(fd);
149
150 char *p;
151 if (asprintf(&p, "%s/client.conf", homeusercfg) == -1)
161 errExit("asprintf"); 152 errExit("asprintf");
162 if (stat(dir1, &s) == -1) { 153 env_store_name_val("PULSE_CLIENTCONFIG", p, SETENV);
163 pid_t child = fork(); 154 fs_logger2("create", p);
164 if (child < 0) 155 free(p);
165 errExit("fork");
166 if (child == 0) {
167 // drop privileges
168 drop_privs(0);
169
170 int rv = mkdir(dir1, 0700);
171 if (rv == 0) {
172 if (set_perms(dir1, getuid(), getgid(), 0700))
173 {;} // do nothing
174 }
175#ifdef HAVE_GCOV
176 __gcov_flush();
177#endif
178 _exit(0);
179 }
180 // wait for the child to finish
181 waitpid(child, NULL, 0);
182 }
183 else {
184 // make sure the directory is owned by the user
185 if (s.st_uid != getuid()) {
186 fprintf(stderr, "Error: user .config/pulse directory is not owned by the current user\n");
187 exit(1);
188 }
189 }
190 free(dir1);
191 156
157 // RUN_PULSE_DIR not needed anymore, mask it
158 if (mount("tmpfs", RUN_PULSE_DIR, "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
159 errExit("mount pulseaudio");
160 fs_logger2("tmpfs", RUN_PULSE_DIR);
192 161
193 // if we have ~/.config/pulse mount the new directory, else set environment variable 162out:
194 char *homeusercfg;
195 if (asprintf(&homeusercfg, "%s/.config/pulse", cfg.homedir) == -1)
196 errExit("asprintf");
197 if (stat(homeusercfg, &s) == 0) {
198 if (mount(RUN_PULSE_DIR, homeusercfg, "none", MS_BIND, NULL) < 0 ||
199 mount(NULL, homeusercfg, NULL, MS_NOEXEC|MS_NODEV|MS_NOSUID|MS_BIND|MS_REMOUNT, NULL) < 0)
200 errExit("mount pulseaudio");
201 fs_logger2("tmpfs", homeusercfg);
202 }
203 else {
204 // set environment
205 if (setenv("PULSE_CLIENTCONFIG", pulsecfg, 1) < 0)
206 errExit("setenv");
207 }
208
209 free(pulsecfg); 163 free(pulsecfg);
210 free(homeusercfg); 164 free(homeusercfg);
211} 165}
diff --git a/src/firejail/restrict_users.c b/src/firejail/restrict_users.c
index 87ee513af..6f17231a4 100644
--- a/src/firejail/restrict_users.c
+++ b/src/firejail/restrict_users.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,15 +18,19 @@
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/firejail_user.h"
21#include <sys/mount.h> 22#include <sys/mount.h>
22#include <sys/stat.h> 23#include <sys/stat.h>
23#include <linux/limits.h> 24#include <linux/limits.h>
24#include <fnmatch.h> 25#include <fnmatch.h>
25#include <glob.h> 26#include <glob.h>
26#include <dirent.h> 27#include <dirent.h>
27#include <fcntl.h>
28#include <errno.h> 28#include <errno.h>
29#include "../../uids.h" 29
30#include <fcntl.h>
31#ifndef O_PATH
32#define O_PATH 010000000
33#endif
30 34
31#define MAXBUF 1024 35#define MAXBUF 1024
32 36
@@ -41,6 +45,8 @@ static void ulist_add(const char *user) {
41 assert(user); 45 assert(user);
42 46
43 USER_LIST *nlist = malloc(sizeof(USER_LIST)); 47 USER_LIST *nlist = malloc(sizeof(USER_LIST));
48 if (!nlist)
49 errExit("malloc");
44 memset(nlist, 0, sizeof(USER_LIST)); 50 memset(nlist, 0, sizeof(USER_LIST));
45 nlist->user = user; 51 nlist->user = user;
46 nlist->next = ulist; 52 nlist->next = ulist;
@@ -62,32 +68,30 @@ static USER_LIST *ulist_find(const char *user) {
62 68
63static void sanitize_home(void) { 69static void sanitize_home(void) {
64 assert(getuid() != 0); // this code works only for regular users 70 assert(getuid() != 0); // this code works only for regular users
71 struct stat s;
65 72
66 if (arg_debug) 73 if (arg_debug)
67 printf("Cleaning /home directory\n"); 74 printf("Cleaning /home directory\n");
68 75 // open user home directory in order to keep it around
69 struct stat s; 76 int fd = safer_openat(-1, cfg.homedir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
70 if (stat(cfg.homedir, &s) == -1) { 77 if (fd == -1)
71 // cannot find home directory, just return 78 goto errout;
72 fwarning("cannot find home directory\n"); 79 if (fstat(fd, &s) == -1) { // FUSE
73 return; 80 if (errno != EACCES)
81 errExit("fstat");
82 close(fd);
83 goto errout;
74 } 84 }
75 85
76 if (mkdir(RUN_WHITELIST_HOME_DIR, 0755) == -1) 86 // mount tmpfs on /home
77 errExit("mkdir"); 87 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
78
79 // keep a copy of the user home directory
80 if (mount(cfg.homedir, RUN_WHITELIST_HOME_DIR, NULL, MS_BIND|MS_REC, NULL) < 0)
81 errExit("mount bind");
82
83 // mount tmpfs in the new home
84 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
85 errExit("mount tmpfs"); 88 errExit("mount tmpfs");
89 selinux_relabel_path("/home", "/home");
86 fs_logger("tmpfs /home"); 90 fs_logger("tmpfs /home");
87 91
88 // create user home directory 92 // create new user home directory
89 if (mkdir(cfg.homedir, 0755) == -1) { 93 if (mkdir(cfg.homedir, 0755) == -1) {
90 if (mkpath_as_root(cfg.homedir)) 94 if (mkpath_as_root(cfg.homedir) == -1)
91 errExit("mkpath"); 95 errExit("mkpath");
92 if (mkdir(cfg.homedir, 0755) == -1) 96 if (mkdir(cfg.homedir, 0755) == -1)
93 errExit("mkdir"); 97 errExit("mkdir");
@@ -97,26 +101,70 @@ static void sanitize_home(void) {
97 // set mode and ownership 101 // set mode and ownership
98 if (set_perms(cfg.homedir, s.st_uid, s.st_gid, s.st_mode)) 102 if (set_perms(cfg.homedir, s.st_uid, s.st_gid, s.st_mode))
99 errExit("set_perms"); 103 errExit("set_perms");
104 selinux_relabel_path(cfg.homedir, cfg.homedir);
100 105
101 // mount user home directory 106 // bring back real user home directory
102 if (mount(RUN_WHITELIST_HOME_DIR, cfg.homedir, NULL, MS_BIND|MS_REC, NULL) < 0) 107 if (bind_mount_fd_to_path(fd, cfg.homedir))
103 errExit("mount bind"); 108 errExit("mount bind");
109 close(fd);
104 110
105 // mask home dir under /run
106 if (mount("tmpfs", RUN_WHITELIST_HOME_DIR, "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0)
107 errExit("mount tmpfs");
108 fs_logger2("tmpfs", RUN_WHITELIST_HOME_DIR);
109 if (!arg_private) 111 if (!arg_private)
110 fs_logger2("whitelist", cfg.homedir); 112 fs_logger2("whitelist", cfg.homedir);
113 return;
111 114
115errout:
116 fwarning("cannot clean /home directory\n");
117}
118
119static void sanitize_run(void) {
120 if (arg_debug)
121 printf("Cleaning /run/user directory\n");
122
123 char *runuser;
124 if (asprintf(&runuser, "/run/user/%u", getuid()) == -1)
125 errExit("asprintf");
126
127 // open /run/user/$UID directory in order to keep it around
128 int fd = open(runuser, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
129 if (fd == -1) {
130 if (arg_debug)
131 printf("Cannot open %s directory\n", runuser);
132 free(runuser);
133 return;
134 }
135
136 // mount tmpfs on /run/user
137 if (mount("tmpfs", "/run/user", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
138 errExit("mount tmpfs");
139 selinux_relabel_path("/run/user", "/run/user");
140 fs_logger("tmpfs /run/user");
141
142 // create new user directory
143 if (mkdir(runuser, 0700) == -1)
144 errExit("mkdir");
145 fs_logger2("mkdir", runuser);
146
147 // set mode and ownership
148 if (set_perms(runuser, getuid(), getgid(), 0700))
149 errExit("set_perms");
150 selinux_relabel_path(runuser, runuser);
151
152 // bring back real run/user/$UID directory
153 if (bind_mount_fd_to_path(fd, runuser))
154 errExit("mount bind");
155 close(fd);
156
157 fs_logger2("whitelist", runuser);
158 free(runuser);
112} 159}
113 160
114static void sanitize_passwd(void) { 161static void sanitize_passwd(void) {
115 struct stat s; 162 struct stat s;
116 if (stat("/etc/passwd", &s) == -1) 163 if (stat("/etc/passwd", &s) == -1)
117 return; 164 return;
165 assert(uid_min);
118 if (arg_debug) 166 if (arg_debug)
119 printf("Sanitizing /etc/passwd, UID_MIN %d\n", UID_MIN); 167 printf("Sanitizing /etc/passwd, UID_MIN %d\n", uid_min);
120 if (is_link("/etc/passwd")) { 168 if (is_link("/etc/passwd")) {
121 fprintf(stderr, "Error: invalid /etc/passwd\n"); 169 fprintf(stderr, "Error: invalid /etc/passwd\n");
122 exit(1); 170 exit(1);
@@ -127,10 +175,10 @@ static void sanitize_passwd(void) {
127 175
128 // open files 176 // open files
129 /* coverity[toctou] */ 177 /* coverity[toctou] */
130 fpin = fopen("/etc/passwd", "r"); 178 fpin = fopen("/etc/passwd", "re");
131 if (!fpin) 179 if (!fpin)
132 goto errout; 180 goto errout;
133 fpout = fopen(RUN_PASSWD_FILE, "w"); 181 fpout = fopen(RUN_PASSWD_FILE, "we");
134 if (!fpout) 182 if (!fpout)
135 goto errout; 183 goto errout;
136 184
@@ -167,7 +215,8 @@ static void sanitize_passwd(void) {
167 int rv = sscanf(ptr, "%d:", &uid); 215 int rv = sscanf(ptr, "%d:", &uid);
168 if (rv == 0 || uid < 0) 216 if (rv == 0 || uid < 0)
169 goto errout; 217 goto errout;
170 if (uid < UID_MIN || uid == 65534) { // on Debian platforms user nobody is 65534 218 assert(uid_min);
219 if (uid < uid_min || uid == 65534) { // on Debian platforms user nobody is 65534
171 fprintf(fpout, "%s", buf); 220 fprintf(fpout, "%s", buf);
172 continue; 221 continue;
173 } 222 }
@@ -189,6 +238,11 @@ static void sanitize_passwd(void) {
189 // mount-bind tne new password file 238 // mount-bind tne new password file
190 if (mount(RUN_PASSWD_FILE, "/etc/passwd", "none", MS_BIND, "mode=400,gid=0") < 0) 239 if (mount(RUN_PASSWD_FILE, "/etc/passwd", "none", MS_BIND, "mode=400,gid=0") < 0)
191 errExit("mount"); 240 errExit("mount");
241
242 // blacklist RUN_PASSWD_FILE
243 if (mount(RUN_RO_FILE, RUN_PASSWD_FILE, "none", MS_BIND, "mode=400,gid=0") < 0)
244 errExit("mount");
245
192 fs_logger("create /etc/passwd"); 246 fs_logger("create /etc/passwd");
193 247
194 return; 248 return;
@@ -248,8 +302,9 @@ static void sanitize_group(void) {
248 struct stat s; 302 struct stat s;
249 if (stat("/etc/group", &s) == -1) 303 if (stat("/etc/group", &s) == -1)
250 return; 304 return;
305 assert(gid_min);
251 if (arg_debug) 306 if (arg_debug)
252 printf("Sanitizing /etc/group, GID_MIN %d\n", GID_MIN); 307 printf("Sanitizing /etc/group, GID_MIN %d\n", gid_min);
253 if (is_link("/etc/group")) { 308 if (is_link("/etc/group")) {
254 fprintf(stderr, "Error: invalid /etc/group\n"); 309 fprintf(stderr, "Error: invalid /etc/group\n");
255 exit(1); 310 exit(1);
@@ -260,10 +315,10 @@ static void sanitize_group(void) {
260 315
261 // open files 316 // open files
262 /* coverity[toctou] */ 317 /* coverity[toctou] */
263 fpin = fopen("/etc/group", "r"); 318 fpin = fopen("/etc/group", "re");
264 if (!fpin) 319 if (!fpin)
265 goto errout; 320 goto errout;
266 fpout = fopen(RUN_GROUP_FILE, "w"); 321 fpout = fopen(RUN_GROUP_FILE, "we");
267 if (!fpout) 322 if (!fpout)
268 goto errout; 323 goto errout;
269 324
@@ -299,7 +354,8 @@ static void sanitize_group(void) {
299 int rv = sscanf(ptr, "%d:", &gid); 354 int rv = sscanf(ptr, "%d:", &gid);
300 if (rv == 0 || gid < 0) 355 if (rv == 0 || gid < 0)
301 goto errout; 356 goto errout;
302 if (gid < GID_MIN || gid == 65534) { // on Debian platforms 65534 is group nogroup 357 assert(gid_min);
358 if (gid < gid_min || gid == 65534) { // on Debian platforms 65534 is group nogroup
303 if (copy_line(fpout, buf, ptr)) 359 if (copy_line(fpout, buf, ptr))
304 goto errout; 360 goto errout;
305 continue; 361 continue;
@@ -317,6 +373,11 @@ static void sanitize_group(void) {
317 // mount-bind tne new group file 373 // mount-bind tne new group file
318 if (mount(RUN_GROUP_FILE, "/etc/group", "none", MS_BIND, "mode=400,gid=0") < 0) 374 if (mount(RUN_GROUP_FILE, "/etc/group", "none", MS_BIND, "mode=400,gid=0") < 0)
319 errExit("mount"); 375 errExit("mount");
376
377 // blacklist RUN_GROUP_FILE
378 if (mount(RUN_RO_FILE, RUN_GROUP_FILE, "none", MS_BIND, "mode=400,gid=0") < 0)
379 errExit("mount");
380
320 fs_logger("create /etc/group"); 381 fs_logger("create /etc/group");
321 382
322 return; 383 return;
@@ -342,10 +403,11 @@ void restrict_users(void) {
342 else { 403 else {
343 // user has the home directory outside /home 404 // user has the home directory outside /home
344 // mount tmpfs on top of /home in order to hide it 405 // mount tmpfs on top of /home in order to hide it
345 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) 406 if (mount("tmpfs", "/home", "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
346 errExit("mount tmpfs"); 407 errExit("mount tmpfs");
347 fs_logger("tmpfs /home"); 408 fs_logger("tmpfs /home");
348 } 409 }
410 sanitize_run();
349 sanitize_passwd(); 411 sanitize_passwd();
350 sanitize_group(); 412 sanitize_group();
351 } 413 }
diff --git a/src/firejail/restricted_shell.c b/src/firejail/restricted_shell.c
index d09a2c7e5..ed66903b5 100644
--- a/src/firejail/restricted_shell.c
+++ b/src/firejail/restricted_shell.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -32,7 +32,7 @@ int restricted_shell(const char *user) {
32 char *fname; 32 char *fname;
33 if (asprintf(&fname, "%s/login.users", SYSCONFDIR) == -1) 33 if (asprintf(&fname, "%s/login.users", SYSCONFDIR) == -1)
34 errExit("asprintf"); 34 errExit("asprintf");
35 FILE *fp = fopen(fname, "r"); 35 FILE *fp = fopen(fname, "re");
36 free(fname); 36 free(fname);
37 if (fp == NULL) 37 if (fp == NULL)
38 return 0; 38 return 0;
@@ -96,7 +96,7 @@ int restricted_shell(const char *user) {
96 fullargv[i] = ptr; 96 fullargv[i] = ptr;
97#ifdef DEBUG_RESTRICTED_SHELL 97#ifdef DEBUG_RESTRICTED_SHELL
98 {EUID_ROOT(); 98 {EUID_ROOT();
99 FILE *fp = fopen("/firelog", "a"); 99 FILE *fp = fopen("/firelog", "ae");
100 if (fp) { 100 if (fp) {
101 fprintf(fp, "i %d ptr #%s#\n", i, fullargv[i]); 101 fprintf(fp, "i %d ptr #%s#\n", i, fullargv[i]);
102 fclose(fp); 102 fclose(fp);
diff --git a/src/firejail/rlimit.c b/src/firejail/rlimit.c
index 99127673e..f177f4b89 100644
--- a/src/firejail/rlimit.c
+++ b/src/firejail/rlimit.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,18 +18,43 @@
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#include "firejail.h" 20#include "firejail.h"
21#include "../include/gcov_wrapper.h"
21#include <sys/time.h> 22#include <sys/time.h>
22#include <sys/resource.h> 23#include <sys/resource.h>
23 24
24void set_rlimits(void) { 25void set_rlimits(void) {
26 EUID_ASSERT();
25 // resource limits 27 // resource limits
26 struct rlimit rl; 28 struct rlimit rl;
29 if (arg_rlimit_cpu) {
30 if (getrlimit(RLIMIT_CPU, &rl) == -1)
31 errExit("getrlimit");
32 if (cfg.rlimit_cpu > rl.rlim_max && getuid() != 0)
33 cfg.rlimit_cpu = rl.rlim_max;
34 // set the new limit
35 rl.rlim_cur = (rlim_t) cfg.rlimit_cpu;
36 rl.rlim_max = (rlim_t) cfg.rlimit_cpu;
37
38 __gcov_dump();
39
40 if (setrlimit(RLIMIT_CPU, &rl) == -1)
41 errExit("setrlimit");
42 if (arg_debug)
43 printf("Config rlimit: max cpu time %llu\n", cfg.rlimit_cpu);
44 }
45
27 if (arg_rlimit_nofile) { 46 if (arg_rlimit_nofile) {
47 if (getrlimit(RLIMIT_NOFILE, &rl) == -1)
48 errExit("getrlimit");
49 if (cfg.rlimit_nofile > rl.rlim_max && getuid() != 0)
50 cfg.rlimit_nofile = rl.rlim_max;
51 // set the new limit
28 rl.rlim_cur = (rlim_t) cfg.rlimit_nofile; 52 rl.rlim_cur = (rlim_t) cfg.rlimit_nofile;
29 rl.rlim_max = (rlim_t) cfg.rlimit_nofile; 53 rl.rlim_max = (rlim_t) cfg.rlimit_nofile;
30#ifdef HAVE_GCOV // gcov-instrumented programs might crash at this point 54
55 // gcov-instrumented programs might crash at this point
31 __gcov_dump(); 56 __gcov_dump();
32#endif 57
33 if (setrlimit(RLIMIT_NOFILE, &rl) == -1) 58 if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
34 errExit("setrlimit"); 59 errExit("setrlimit");
35 if (arg_debug) 60 if (arg_debug)
@@ -37,11 +62,16 @@ void set_rlimits(void) {
37 } 62 }
38 63
39 if (arg_rlimit_nproc) { 64 if (arg_rlimit_nproc) {
65 if (getrlimit(RLIMIT_NPROC, &rl) == -1)
66 errExit("getrlimit");
67 if (cfg.rlimit_nproc > rl.rlim_max && getuid() != 0)
68 cfg.rlimit_nproc = rl.rlim_max;
69 // set the new limit
40 rl.rlim_cur = (rlim_t) cfg.rlimit_nproc; 70 rl.rlim_cur = (rlim_t) cfg.rlimit_nproc;
41 rl.rlim_max = (rlim_t) cfg.rlimit_nproc; 71 rl.rlim_max = (rlim_t) cfg.rlimit_nproc;
42#ifdef HAVE_GCOV 72
43 __gcov_dump(); 73 __gcov_dump();
44#endif 74
45 if (setrlimit(RLIMIT_NPROC, &rl) == -1) 75 if (setrlimit(RLIMIT_NPROC, &rl) == -1)
46 errExit("setrlimit"); 76 errExit("setrlimit");
47 if (arg_debug) 77 if (arg_debug)
@@ -49,11 +79,16 @@ void set_rlimits(void) {
49 } 79 }
50 80
51 if (arg_rlimit_fsize) { 81 if (arg_rlimit_fsize) {
82 if (getrlimit(RLIMIT_FSIZE, &rl) == -1)
83 errExit("getrlimit");
84 if (cfg.rlimit_fsize > rl.rlim_max && getuid() != 0)
85 cfg.rlimit_fsize = rl.rlim_max;
86 // set the new limit
52 rl.rlim_cur = (rlim_t) cfg.rlimit_fsize; 87 rl.rlim_cur = (rlim_t) cfg.rlimit_fsize;
53 rl.rlim_max = (rlim_t) cfg.rlimit_fsize; 88 rl.rlim_max = (rlim_t) cfg.rlimit_fsize;
54#ifdef HAVE_GCOV 89
55 __gcov_dump(); 90 __gcov_dump();
56#endif 91
57 if (setrlimit(RLIMIT_FSIZE, &rl) == -1) 92 if (setrlimit(RLIMIT_FSIZE, &rl) == -1)
58 errExit("setrlimit"); 93 errExit("setrlimit");
59 if (arg_debug) 94 if (arg_debug)
@@ -61,14 +96,36 @@ void set_rlimits(void) {
61 } 96 }
62 97
63 if (arg_rlimit_sigpending) { 98 if (arg_rlimit_sigpending) {
99 if (getrlimit(RLIMIT_SIGPENDING, &rl) == -1)
100 errExit("getrlimit");
101 if (cfg.rlimit_sigpending > rl.rlim_max && getuid() != 0)
102 cfg.rlimit_sigpending = rl.rlim_max;
103 // set the new limit
64 rl.rlim_cur = (rlim_t) cfg.rlimit_sigpending; 104 rl.rlim_cur = (rlim_t) cfg.rlimit_sigpending;
65 rl.rlim_max = (rlim_t) cfg.rlimit_sigpending; 105 rl.rlim_max = (rlim_t) cfg.rlimit_sigpending;
66#ifdef HAVE_GCOV 106
67 __gcov_dump(); 107 __gcov_dump();
68#endif 108
69 if (setrlimit(RLIMIT_SIGPENDING, &rl) == -1) 109 if (setrlimit(RLIMIT_SIGPENDING, &rl) == -1)
70 errExit("setrlimit"); 110 errExit("setrlimit");
71 if (arg_debug) 111 if (arg_debug)
72 printf("Config rlimit: maximum number of signals pending %llu\n", cfg.rlimit_sigpending); 112 printf("Config rlimit: maximum number of signals pending %llu\n", cfg.rlimit_sigpending);
73 } 113 }
114
115 if (arg_rlimit_as) {
116 if (getrlimit(RLIMIT_AS, &rl) == -1)
117 errExit("getrlimit");
118 if (cfg.rlimit_as > rl.rlim_max && getuid() != 0)
119 cfg.rlimit_as = rl.rlim_max;
120 // set the new limit
121 rl.rlim_cur = (rlim_t) cfg.rlimit_as;
122 rl.rlim_max = (rlim_t) cfg.rlimit_as;
123
124 __gcov_dump();
125
126 if (setrlimit(RLIMIT_AS, &rl) == -1)
127 errExit("setrlimit");
128 if (arg_debug)
129 printf("Config rlimit: maximum virtual memory %llu\n", cfg.rlimit_as);
130 }
74} 131}
diff --git a/src/firejail/run_files.c b/src/firejail/run_files.c
new file mode 100644
index 000000000..c28c3e01b
--- /dev/null
+++ b/src/firejail/run_files.c
@@ -0,0 +1,154 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#include "firejail.h"
22#include "../include/pid.h"
23#define BUFLEN 4096
24
25static void delete_x11_run_file(pid_t pid) {
26 char *fname;
27 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_X11_DIR, pid) == -1)
28 errExit("asprintf");
29 int rv = unlink(fname);
30 (void) rv;
31 free(fname);
32}
33
34static void delete_profile_run_file(pid_t pid) {
35 char *fname;
36 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_PROFILE_DIR, pid) == -1)
37 errExit("asprintf");
38 int rv = unlink(fname);
39 (void) rv;
40 free(fname);
41}
42
43static void delete_name_run_file(pid_t pid) {
44 char *fname;
45 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_NAME_DIR, pid) == -1)
46 errExit("asprintf");
47 int rv = unlink(fname);
48 (void) rv;
49 free(fname);
50}
51
52void delete_bandwidth_run_file(pid_t pid) {
53 char *fname;
54 if (asprintf(&fname, "%s/%d-bandwidth", RUN_FIREJAIL_BANDWIDTH_DIR, (int) pid) == -1)
55 errExit("asprintf");
56 unlink(fname);
57 free(fname);
58}
59
60static void delete_network_run_file(pid_t pid) {
61 char *fname;
62 if (asprintf(&fname, "%s/%d-netmap", RUN_FIREJAIL_NETWORK_DIR, (int) pid) == -1)
63 errExit("asprintf");
64 unlink(fname);
65 free(fname);
66}
67
68
69
70void delete_run_files(pid_t pid) {
71 delete_bandwidth_run_file(pid);
72 delete_network_run_file(pid);
73 delete_name_run_file(pid);
74 delete_x11_run_file(pid);
75 delete_profile_run_file(pid);
76}
77
78static char *newname(char *name) {
79 char *rv = name;
80 pid_t pid;
81
82 if (checkcfg(CFG_NAME_CHANGE)) {
83 // try the name
84 if (name2pid(name, &pid))
85 return name;
86
87 // return name-pid
88 if (asprintf(&rv, "%s-%d", name, getpid()) == -1)
89 errExit("asprintf");
90 }
91
92 return rv;
93}
94
95
96void set_name_run_file(pid_t pid) {
97 cfg.name = newname(cfg.name);
98
99 char *fname;
100 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_NAME_DIR, pid) == -1)
101 errExit("asprintf");
102
103 // the file is deleted first
104 FILE *fp = fopen(fname, "we");
105 if (!fp) {
106 fprintf(stderr, "Error: cannot create %s\n", fname);
107 exit(1);
108 }
109 fprintf(fp, "%s\n", cfg.name);
110
111 // mode and ownership
112 SET_PERMS_STREAM(fp, 0, 0, 0644);
113 fclose(fp);
114}
115
116
117void set_x11_run_file(pid_t pid, int display) {
118 char *fname;
119 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_X11_DIR, pid) == -1)
120 errExit("asprintf");
121
122 // the file is deleted first
123 FILE *fp = fopen(fname, "we");
124 if (!fp) {
125 fprintf(stderr, "Error: cannot create %s\n", fname);
126 exit(1);
127 }
128 fprintf(fp, "%d\n", display);
129
130 // mode and ownership
131 SET_PERMS_STREAM(fp, 0, 0, 0644);
132 fclose(fp);
133}
134
135void set_profile_run_file(pid_t pid, const char *fname) {
136 char *runfile;
137 if (asprintf(&runfile, "%s/%d", RUN_FIREJAIL_PROFILE_DIR, pid) == -1)
138 errExit("asprintf");
139
140 EUID_ROOT();
141 // the file is deleted first
142 FILE *fp = fopen(runfile, "we");
143 if (!fp) {
144 fprintf(stderr, "Error: cannot create %s\n", runfile);
145 exit(1);
146 }
147 fprintf(fp, "%s\n", fname);
148
149 // mode and ownership
150 SET_PERMS_STREAM(fp, 0, 0, 0644);
151 fclose(fp);
152 EUID_USER();
153 free(runfile);
154}
diff --git a/src/firejail/run_symlink.c b/src/firejail/run_symlink.c
index ed885d3b1..77fac5438 100644
--- a/src/firejail/run_symlink.c
+++ b/src/firejail/run_symlink.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -22,7 +22,9 @@
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <unistd.h> 23#include <unistd.h>
24 24
25void run_symlink(int argc, char **argv) { 25extern char *find_in_path(const char *program);
26
27void run_symlink(int argc, char **argv, int run_as_is) {
26 EUID_ASSERT(); 28 EUID_ASSERT();
27 29
28 char *program = strrchr(argv[0], '/'); 30 char *program = strrchr(argv[0], '/');
@@ -30,69 +32,43 @@ void run_symlink(int argc, char **argv) {
30 program += 1; 32 program += 1;
31 else 33 else
32 program = argv[0]; 34 program = argv[0];
33 if (strcmp(program, "firejail") == 0) 35 if (strcmp(program, "firejail") == 0) // this is a regular "firejail program" sandbox starting
34 return; 36 return;
35 37
36 // find the real program 38 // drop privileges
37 // probably the first entry returend by "which -a" is a symlink - use the second entry! 39 if (setresgid(-1, getgid(), getgid()) != 0)
38 char *p = getenv("PATH"); 40 errExit("setresgid");
39 if (!p) { 41 if (setresuid(-1, getuid(), getuid()) != 0)
42 errExit("setresuid");
43
44 // find the real program by looking in PATH
45 const char *path = env_get("PATH");
46 if (!path) {
40 fprintf(stderr, "Error: PATH environment variable not set\n"); 47 fprintf(stderr, "Error: PATH environment variable not set\n");
41 exit(1); 48 exit(1);
42 } 49 }
43 50
44 char *path = strdup(p); 51 char *p = find_in_path(program);
45 if (!path) 52 if (!p) {
46 errExit("strdup");
47
48 char *selfpath = realpath("/proc/self/exe", NULL);
49 if (!selfpath)
50 errExit("realpath");
51
52 // look in path for our program
53 char *tok = strtok(path, ":");
54 int found = 0;
55 while (tok) {
56 char *name;
57 if (asprintf(&name, "%s/%s", tok, program) == -1)
58 errExit("asprintf");
59
60 struct stat s;
61 if (stat(name, &s) == 0) {
62 /* coverity[toctou] */
63 char* rp = realpath(name, NULL);
64 if (!rp)
65 errExit("realpath");
66
67 if (strcmp(selfpath, rp) != 0) {
68 program = strdup(name);
69 found = 1;
70 free(rp);
71 break;
72 }
73
74 free(rp);
75 }
76
77 free(name);
78 tok = strtok(NULL, ":");
79 }
80 if (!found) {
81 fprintf(stderr, "Error: cannot find the program in the path\n"); 53 fprintf(stderr, "Error: cannot find the program in the path\n");
82 exit(1); 54 exit(1);
83 } 55 }
56 program = p;
84 57
85 free(selfpath); 58 // restore original umask
59 umask(orig_umask);
86 60
61 // restore original environment variables
62 env_apply_all();
87 63
88 // start the argv[0] program in a new sandbox 64 // desktop integration is not supported for root user; instead, the original program is started
89 // drop privileges 65 if (getuid() == 0 || run_as_is) {
90 if (setgid(getgid()) < 0) 66 argv[0] = program;
91 errExit("setgid/getgid"); 67 execv(program, argv);
92 if (setuid(getuid()) < 0) 68 exit(1);
93 errExit("setuid/getuid"); 69 }
94 70
95 // run command 71 // start the argv[0] program in a new sandbox
96 char *a[3 + argc]; 72 char *a[3 + argc];
97 a[0] =PATH_FIREJAIL; 73 a[0] =PATH_FIREJAIL;
98 a[1] = program; 74 a[1] = program;
@@ -101,6 +77,7 @@ void run_symlink(int argc, char **argv) {
101 a[i + 2] = argv[i + 1]; 77 a[i + 2] = argv[i + 1];
102 } 78 }
103 a[i + 2] = NULL; 79 a[i + 2] = NULL;
80 assert(env_get("LD_PRELOAD") == NULL);
104 assert(getenv("LD_PRELOAD") == NULL); 81 assert(getenv("LD_PRELOAD") == NULL);
105 execvp(a[0], a); 82 execvp(a[0], a);
106 83
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index abdbbfecd..995827fb7 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,16 +19,19 @@
19*/ 19*/
20 20
21#include "firejail.h" 21#include "firejail.h"
22#include "../include/gcov_wrapper.h"
23#include "../include/seccomp.h"
24#include <sys/mman.h>
22#include <sys/mount.h> 25#include <sys/mount.h>
23#include <sys/wait.h> 26#include <sys/wait.h>
24#include <sys/stat.h> 27#include <sys/stat.h>
25#include <sys/prctl.h>
26#include <sys/time.h> 28#include <sys/time.h>
27#include <sys/resource.h> 29#include <sys/resource.h>
28#include <sys/types.h> 30#include <sys/types.h>
29#include <dirent.h> 31#include <dirent.h>
30#include <errno.h> 32#include <errno.h>
31#include <fcntl.h> 33#include <fcntl.h>
34#include <syscall.h>
32 35
33#include <sched.h> 36#include <sched.h>
34#ifndef CLONE_NEWUSER 37#ifndef CLONE_NEWUSER
@@ -37,26 +40,22 @@
37 40
38#include <sys/prctl.h> 41#include <sys/prctl.h>
39#ifndef PR_SET_NO_NEW_PRIVS 42#ifndef PR_SET_NO_NEW_PRIVS
40# define PR_SET_NO_NEW_PRIVS 38 43#define PR_SET_NO_NEW_PRIVS 38
44#endif
45#ifndef PR_GET_NO_NEW_PRIVS
46#define PR_GET_NO_NEW_PRIVS 39
41#endif 47#endif
42 48
43#ifdef HAVE_APPARMOR 49#ifdef HAVE_APPARMOR
44#include <sys/apparmor.h> 50#include <sys/apparmor.h>
45#endif 51#endif
46#include <syscall.h>
47
48
49#ifdef HAVE_SECCOMP
50int enforce_seccomp = 0;
51#endif
52 52
53static int force_nonewprivs = 0;
53 54
54static int monitored_pid = 0; 55static int monitored_pid = 0;
55static void sandbox_handler(int sig){ 56static void sandbox_handler(int sig){
56 if (!arg_quiet) { 57 usleep(10000); // don't race to print a message
57 printf("\nChild received signal %d, shutting down the sandbox...\n", sig); 58 fmessage("\nChild received signal %d, shutting down the sandbox...\n", sig);
58 fflush(0);
59 }
60 59
61 // broadcast sigterm to all processes in the group 60 // broadcast sigterm to all processes in the group
62 kill(-1, SIGTERM); 61 kill(-1, SIGTERM);
@@ -68,7 +67,7 @@ static void sandbox_handler(int sig){
68 if (asprintf(&monfile, "/proc/%d/cmdline", monitored_pid) == -1) 67 if (asprintf(&monfile, "/proc/%d/cmdline", monitored_pid) == -1)
69 errExit("asprintf"); 68 errExit("asprintf");
70 while (monsec) { 69 while (monsec) {
71 FILE *fp = fopen(monfile, "r"); 70 FILE *fp = fopen(monfile, "re");
72 if (!fp) 71 if (!fp)
73 break; 72 break;
74 73
@@ -84,17 +83,32 @@ static void sandbox_handler(int sig){
84 monsec--; 83 monsec--;
85 } 84 }
86 free(monfile); 85 free(monfile);
87
88 } 86 }
89 87
90
91 // broadcast a SIGKILL 88 // broadcast a SIGKILL
92 kill(-1, SIGKILL); 89 kill(-1, SIGKILL);
93 flush_stdin();
94 90
95 exit(sig); 91 flush_stdin();
92 exit(128 + sig);
96} 93}
97 94
95static void install_handler(void) {
96 struct sigaction sga;
97
98 // block SIGTERM while handling SIGINT
99 sigemptyset(&sga.sa_mask);
100 sigaddset(&sga.sa_mask, SIGTERM);
101 sga.sa_handler = sandbox_handler;
102 sga.sa_flags = 0;
103 sigaction(SIGINT, &sga, NULL);
104
105 // block SIGINT while handling SIGTERM
106 sigemptyset(&sga.sa_mask);
107 sigaddset(&sga.sa_mask, SIGINT);
108 sga.sa_handler = sandbox_handler;
109 sga.sa_flags = 0;
110 sigaction(SIGTERM, &sga, NULL);
111}
98 112
99static void set_caps(void) { 113static void set_caps(void) {
100 if (arg_caps_drop_all) 114 if (arg_caps_drop_all)
@@ -105,18 +119,50 @@ static void set_caps(void) {
105 caps_keep_list(arg_caps_list); 119 caps_keep_list(arg_caps_list);
106 else if (arg_caps_default_filter) 120 else if (arg_caps_default_filter)
107 caps_default_filter(); 121 caps_default_filter();
108 122
109 // drop discretionary access control capabilities for root sandboxes 123 // drop discretionary access control capabilities for root sandboxes
110 // if caps.keep, the user has to set it manually in the list 124 // if caps.keep, the user has to set it manually in the list
111 if (!arg_caps_keep) 125 if (!arg_caps_keep)
112 caps_drop_dac_override(); 126 caps_drop_dac_override();
113} 127}
114 128
115void save_nogroups(void) { 129#ifdef HAVE_APPARMOR
130void set_apparmor(void) {
131 EUID_ASSERT();
132 if (checkcfg(CFG_APPARMOR) && arg_apparmor) {
133 if (aa_change_onexec("firejail-default")) {
134 fwarning("Cannot confine the application using AppArmor.\n"
135 "Maybe firejail-default AppArmor profile is not loaded into the kernel.\n"
136 "As root, run \"aa-enforce firejail-default\" to load it.\n");
137 }
138 else if (arg_debug)
139 printf("AppArmor enabled\n");
140 }
141}
142#endif
143
144static void seccomp_debug(void) {
145 if (arg_debug == 0)
146 return;
147
148 EUID_USER();
149 printf("Seccomp directory:\n");
150 ls(RUN_SECCOMP_DIR);
151 struct stat s;
152 if (stat(RUN_SECCOMP_LIST, &s) == 0) {
153 printf("Active seccomp files:\n");
154 cat(RUN_SECCOMP_LIST);
155 }
156 else
157 printf("No active seccomp files\n");
158 EUID_ROOT();
159}
160
161static void save_nogroups(void) {
116 if (arg_nogroups == 0) 162 if (arg_nogroups == 0)
117 return; 163 return;
118 164
119 FILE *fp = fopen(RUN_GROUPS_CFG, "w"); 165 FILE *fp = fopen(RUN_GROUPS_CFG, "wxe");
120 if (fp) { 166 if (fp) {
121 fprintf(fp, "\n"); 167 fprintf(fp, "\n");
122 SET_PERMS_STREAM(fp, 0, 0, 0644); // assume mode 0644 168 SET_PERMS_STREAM(fp, 0, 0, 0644); // assume mode 0644
@@ -126,7 +172,48 @@ void save_nogroups(void) {
126 fprintf(stderr, "Error: cannot save nogroups state\n"); 172 fprintf(stderr, "Error: cannot save nogroups state\n");
127 exit(1); 173 exit(1);
128 } 174 }
175}
176
177static void save_nonewprivs(void) {
178 if (arg_nonewprivs == 0)
179 return;
180
181 FILE *fp = fopen(RUN_NONEWPRIVS_CFG, "wxe");
182 if (fp) {
183 fprintf(fp, "\n");
184 SET_PERMS_STREAM(fp, 0, 0, 0644); // assume mode 0644
185 fclose(fp);
186 }
187 else {
188 fprintf(stderr, "Error: cannot save nonewprivs state\n");
189 exit(1);
190 }
191}
192
193static void save_umask(void) {
194 FILE *fp = fopen(RUN_UMASK_FILE, "wxe");
195 if (fp) {
196 fprintf(fp, "%o\n", orig_umask);
197 SET_PERMS_STREAM(fp, 0, 0, 0644); // assume mode 0644
198 fclose(fp);
199 }
200 else {
201 fprintf(stderr, "Error: cannot save umask\n");
202 exit(1);
203 }
204}
129 205
206static char *create_join_file(void) {
207 int fd = open(RUN_JOIN_FILE, O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH);
208 if (fd == -1)
209 errExit("open");
210 if (ftruncate(fd, 1) == -1)
211 errExit("ftruncate");
212 char *rv = mmap(NULL, 1, PROT_WRITE, MAP_SHARED, fd, 0);
213 if (rv == MAP_FAILED)
214 errExit("mmap");
215 close(fd);
216 return rv;
130} 217}
131 218
132static void sandbox_if_up(Bridge *br) { 219static void sandbox_if_up(Bridge *br) {
@@ -140,7 +227,7 @@ static void sandbox_if_up(Bridge *br) {
140 if (br->arg_ip_none == 1); // do nothing 227 if (br->arg_ip_none == 1); // do nothing
141 else if (br->arg_ip_none == 0 && br->macvlan == 0) { 228 else if (br->arg_ip_none == 0 && br->macvlan == 0) {
142 if (br->ipsandbox == br->ip) { 229 if (br->ipsandbox == br->ip) {
143 fprintf(stderr, "Error: %d.%d.%d.%d is interface %s address.\n", PRINT_IP(br->ipsandbox), br->dev); 230 fprintf(stderr, "Error: %d.%d.%d.%d is interface %s address, exiting...\n", PRINT_IP(br->ipsandbox), br->dev);
144 exit(1); 231 exit(1);
145 } 232 }
146 233
@@ -158,13 +245,17 @@ static void sandbox_if_up(Bridge *br) {
158 br->ipsandbox = arp_assign(dev, br); //br->ip, br->mask); 245 br->ipsandbox = arp_assign(dev, br); //br->ip, br->mask);
159 else { 246 else {
160 if (br->ipsandbox == br->ip) { 247 if (br->ipsandbox == br->ip) {
161 fprintf(stderr, "Error: %d.%d.%d.%d is interface %s address.\n", PRINT_IP(br->ipsandbox), br->dev); 248 fprintf(stderr, "Error: %d.%d.%d.%d is interface %s address, exiting...\n", PRINT_IP(br->ipsandbox), br->dev);
249 exit(1);
250 }
251 if (br->ipsandbox == cfg.defaultgw) {
252 fprintf(stderr, "Error: %d.%d.%d.%d is the default gateway, exiting...\n", PRINT_IP(br->ipsandbox));
162 exit(1); 253 exit(1);
163 } 254 }
164 255
165 uint32_t rv = arp_check(dev, br->ipsandbox); 256 uint32_t rv = arp_check(dev, br->ipsandbox);
166 if (rv) { 257 if (rv) {
167 fprintf(stderr, "Error: the address %d.%d.%d.%d is already in use.\n", PRINT_IP(br->ipsandbox)); 258 fprintf(stderr, "Error: the address %d.%d.%d.%d is already in use, exiting...\n", PRINT_IP(br->ipsandbox));
168 exit(1); 259 exit(1);
169 } 260 }
170 } 261 }
@@ -181,8 +272,7 @@ static void sandbox_if_up(Bridge *br) {
181 272
182static void chk_chroot(void) { 273static void chk_chroot(void) {
183 // if we are starting firejail inside some other container technology, we don't care about this 274 // if we are starting firejail inside some other container technology, we don't care about this
184 char *mycont = getenv("container"); 275 if (env_get("container"))
185 if (mycont)
186 return; 276 return;
187 277
188 // check if this is a regular chroot 278 // check if this is a regular chroot
@@ -197,11 +287,29 @@ static void chk_chroot(void) {
197} 287}
198 288
199static int monitor_application(pid_t app_pid) { 289static int monitor_application(pid_t app_pid) {
290 EUID_ASSERT();
200 monitored_pid = app_pid; 291 monitored_pid = app_pid;
201 signal (SIGTERM, sandbox_handler); 292
202 EUID_USER(); 293 // block signals and install handler
294 sigset_t oldmask, newmask;
295 sigemptyset(&oldmask);
296 sigemptyset(&newmask);
297 sigaddset(&newmask, SIGTERM);
298 sigaddset(&newmask, SIGINT);
299 sigprocmask(SIG_BLOCK, &newmask, &oldmask);
300 install_handler();
301
302 // handle --timeout
303 int options = 0;;
304 unsigned timeout = 0;
305 if (cfg.timeout) {
306 options = WNOHANG;
307 timeout = cfg.timeout;
308 sleep(1);
309 }
203 310
204 int status = 0; 311 int status = 0;
312 int app_status = 0;
205 while (monitored_pid) { 313 while (monitored_pid) {
206 usleep(20000); 314 usleep(20000);
207 char *msg; 315 char *msg;
@@ -214,24 +322,39 @@ static int monitor_application(pid_t app_pid) {
214 322
215 pid_t rv; 323 pid_t rv;
216 do { 324 do {
217 rv = waitpid(-1, &status, 0); 325 // handle signals asynchronously
218 if (rv == -1) 326 sigprocmask(SIG_SETMASK, &oldmask, NULL);
327
328 rv = waitpid(-1, &status, options);
329
330 // block signals again
331 sigprocmask(SIG_BLOCK, &newmask, NULL);
332
333 if (rv == -1) { // we can get here if we have processes joining the sandbox (ECHILD)
334 sleep(1);
219 break; 335 break;
336 }
337 else if (rv == app_pid)
338 app_status = status;
339
340 // handle --timeout
341 if (options) {
342 if (--timeout == 0) {
343 // SIGTERM might fail if the process ignores it (SIG_IGN)
344 // we give it 100ms to close properly and after that we SIGKILL it
345 kill(-1, SIGTERM);
346 usleep(100000);
347 kill(-1, SIGKILL);
348 flush_stdin();
349 _exit(1);
350 }
351 else
352 sleep(1);
353 }
220 } 354 }
221 while(rv != monitored_pid); 355 while(rv != monitored_pid);
222 if (arg_debug) 356 if (arg_debug)
223 printf("Sandbox monitor: waitpid %u retval %d status %d\n", monitored_pid, rv, status); 357 printf("Sandbox monitor: waitpid %d retval %d status %d\n", monitored_pid, rv, status);
224 if (rv == -1) { // we can get here if we have processes joining the sandbox (ECHILD)
225 if (arg_debug)
226 perror("waitpid");
227 sleep(1);
228 }
229
230 // if /proc is not remounted, we cannot check /proc directory,
231 // for now we just get out of here
232 // todo: find another way of checking child processes!
233 if (!checkcfg(CFG_REMOUNT_PROC_SYS))
234 break;
235 358
236 DIR *dir; 359 DIR *dir;
237 if (!(dir = opendir("/proc"))) { 360 if (!(dir = opendir("/proc"))) {
@@ -251,6 +374,8 @@ static int monitor_application(pid_t app_pid) {
251 continue; 374 continue;
252 if (pid == 1) 375 if (pid == 1)
253 continue; 376 continue;
377 if ((pid_t) pid == dhclient4_pid || (pid_t) pid == dhclient6_pid)
378 continue;
254 379
255 // todo: make this generic 380 // todo: make this generic
256 // Dillo browser leaves a dpid process running, we need to shut it down 381 // Dillo browser leaves a dpid process running, we need to shut it down
@@ -270,27 +395,16 @@ static int monitor_application(pid_t app_pid) {
270 closedir(dir); 395 closedir(dir);
271 396
272 if (monitored_pid != 0 && arg_debug) 397 if (monitored_pid != 0 && arg_debug)
273 printf("Sandbox monitor: monitoring %u\n", monitored_pid); 398 printf("Sandbox monitor: monitoring %d\n", monitored_pid);
274 } 399 }
275 400
276 // return the latest exit status. 401 // return the appropriate exit status.
277 return status; 402 return arg_deterministic_exit_code ? app_status : status;
278} 403}
279 404
280static void print_time(void) { 405static void print_time(void) {
281 if (start_timestamp) { 406 float delta = timetrace_end();
282 unsigned long long end_timestamp = getticks(); 407 fmessage("Child process initialized in %.02f ms\n", delta);
283 // measure 1 ms
284 usleep(1000);
285 unsigned long long onems = getticks() - end_timestamp;
286 if (onems) {
287 printf("Child process initialized in %.02f ms\n",
288 (float) (end_timestamp - start_timestamp) / (float) onems);
289 return;
290 }
291 }
292
293 printf("Child process initialized\n");
294} 408}
295 409
296 410
@@ -308,7 +422,7 @@ static int ok_to_run(const char *program) {
308 return 1; 422 return 1;
309 } 423 }
310 else { // search $PATH 424 else { // search $PATH
311 char *path1 = getenv("PATH"); 425 const char *path1 = env_get("PATH");
312 if (path1) { 426 if (path1) {
313 if (arg_debug) 427 if (arg_debug)
314 printf("Searching $PATH for %s\n", program); 428 printf("Searching $PATH for %s\n", program);
@@ -350,34 +464,24 @@ static int ok_to_run(const char *program) {
350 return 0; 464 return 0;
351} 465}
352 466
353void start_application(int no_sandbox) { 467void start_application(int no_sandbox, int fd, char *set_sandbox_status) {
354 // set environment 468 // set environment
355 if (no_sandbox == 0) { 469 if (no_sandbox == 0)
356 env_defaults(); 470 env_defaults();
357 env_apply(); 471 env_apply_all();
358 } 472
473 // restore original umask
474 umask(orig_umask);
475
359 if (arg_debug) { 476 if (arg_debug) {
360 printf("starting application\n"); 477 printf("Starting application\n");
361 printf("LD_PRELOAD=%s\n", getenv("LD_PRELOAD")); 478 printf("LD_PRELOAD=%s\n", getenv("LD_PRELOAD"));
362 } 479 }
363 480
364 //**************************************** 481 //****************************************
365 // audit
366 //****************************************
367 if (arg_audit) {
368 assert(arg_audit_prog);
369#ifdef HAVE_GCOV
370 __gcov_dump();
371#endif
372#ifdef HAVE_SECCOMP
373 seccomp_install_filters();
374#endif
375 execl(arg_audit_prog, arg_audit_prog, NULL);
376 }
377 //****************************************
378 // start the program without using a shell 482 // start the program without using a shell
379 //**************************************** 483 //****************************************
380 else if (arg_shell_none) { 484 if (arg_shell_none) {
381 if (arg_debug) { 485 if (arg_debug) {
382 int i; 486 int i;
383 for (i = cfg.original_program_index; i < cfg.original_argc; i++) { 487 for (i = cfg.original_program_index; i < cfg.original_argc; i++) {
@@ -395,53 +499,55 @@ void start_application(int no_sandbox) {
395 if (!arg_command && !arg_quiet) 499 if (!arg_command && !arg_quiet)
396 print_time(); 500 print_time();
397 501
398 int rv = ok_to_run(cfg.original_argv[cfg.original_program_index]); 502 if (ok_to_run(cfg.original_argv[cfg.original_program_index]) == 0) {
399#ifdef HAVE_GCOV 503 fprintf(stderr, "Error: no suitable %s executable found\n", cfg.original_argv[cfg.original_program_index]);
504 exit(1);
505 }
506
400 __gcov_dump(); 507 __gcov_dump();
401#endif 508
402#ifdef HAVE_SECCOMP
403 seccomp_install_filters(); 509 seccomp_install_filters();
404#endif 510
405 if (rv) 511 if (set_sandbox_status)
406 execvp(cfg.original_argv[cfg.original_program_index], &cfg.original_argv[cfg.original_program_index]); 512 *set_sandbox_status = SANDBOX_DONE;
407 else 513 execvp(cfg.original_argv[cfg.original_program_index], &cfg.original_argv[cfg.original_program_index]);
408 fprintf(stderr, "Error: no suitable %s executable found\n", cfg.original_argv[cfg.original_program_index]);
409 exit(1);
410 } 514 }
411 //**************************************** 515 //****************************************
412 // start the program using a shell 516 // start the program using a shell
413 //**************************************** 517 //****************************************
414 else { 518 else {
415 assert(cfg.shell); 519 assert(cfg.shell);
416 assert(cfg.command_line);
417 520
418 char *arg[5]; 521 char *arg[5];
419 int index = 0; 522 int index = 0;
420 arg[index++] = cfg.shell; 523 arg[index++] = cfg.shell;
421 if (login_shell) { 524 if (cfg.command_line) {
422 arg[index++] = "-l";
423 if (arg_debug)
424 printf("Starting %s login shell\n", cfg.shell);
425 } else {
426 arg[index++] = "-c";
427 if (arg_debug) 525 if (arg_debug)
428 printf("Running %s command through %s\n", cfg.command_line, cfg.shell); 526 printf("Running %s command through %s\n", cfg.command_line, cfg.shell);
527 arg[index++] = "-c";
429 if (arg_doubledash) 528 if (arg_doubledash)
430 arg[index++] = "--"; 529 arg[index++] = "--";
431 arg[index++] = cfg.command_line; 530 arg[index++] = cfg.command_line;
432 } 531 }
433 arg[index] = NULL; 532 else if (login_shell) {
533 if (arg_debug)
534 printf("Starting %s login shell\n", cfg.shell);
535 arg[index++] = "-l";
536 }
537 else if (arg_debug)
538 printf("Starting %s shell\n", cfg.shell);
539
434 assert(index < 5); 540 assert(index < 5);
541 arg[index] = NULL;
435 542
436 if (arg_debug) { 543 if (arg_debug) {
437 char *msg; 544 char *msg;
438 if (asprintf(&msg, "sandbox %d, execvp into %s", sandbox_pid, cfg.command_line) == -1) 545 if (asprintf(&msg, "sandbox %d, execvp into %s",
546 sandbox_pid, cfg.command_line ? cfg.command_line : cfg.shell) == -1)
439 errExit("asprintf"); 547 errExit("asprintf");
440 logmsg(msg); 548 logmsg(msg);
441 free(msg); 549 free(msg);
442 }
443 550
444 if (arg_debug) {
445 int i; 551 int i;
446 for (i = 0; i < 5; i++) { 552 for (i = 0; i < 5; i++) {
447 if (arg[i] == NULL) 553 if (arg[i] == NULL)
@@ -452,45 +558,36 @@ void start_application(int no_sandbox) {
452 558
453 if (!arg_command && !arg_quiet) 559 if (!arg_command && !arg_quiet)
454 print_time(); 560 print_time();
455#ifdef HAVE_GCOV 561
456 __gcov_dump(); 562 __gcov_dump();
457#endif 563
458#ifdef HAVE_SECCOMP
459 seccomp_install_filters(); 564 seccomp_install_filters();
460#endif 565
566 if (set_sandbox_status)
567 *set_sandbox_status = SANDBOX_DONE;
461 execvp(arg[0], arg); 568 execvp(arg[0], arg);
569
570 // join sandbox without shell in the mount namespace
571 if (fd > -1)
572 fexecve(fd, arg, environ);
462 } 573 }
463 574
464 perror("execvp"); 575 perror("Cannot start application");
465 exit(1); // it should never get here!!! 576 exit(1);
466} 577}
467 578
468static void enforce_filters(void) { 579static void enforce_filters(void) {
469 // force default seccomp inside the chroot, no keep or drop list 580 fmessage("\n** Warning: dropping all Linux capabilities and setting NO_NEW_PRIVS prctl **\n\n");
470 // the list build on top of the default drop list is kept intact 581 // enforce NO_NEW_PRIVS
471 arg_seccomp = 1; 582 arg_nonewprivs = 1;
472#ifdef HAVE_SECCOMP 583 force_nonewprivs = 1;
473 enforce_seccomp = 1;
474#endif
475 if (cfg.seccomp_list_drop) {
476 free(cfg.seccomp_list_drop);
477 cfg.seccomp_list_drop = NULL;
478 }
479 if (cfg.seccomp_list_keep) {
480 free(cfg.seccomp_list_keep);
481 cfg.seccomp_list_keep = NULL;
482 }
483 584
484 // disable all capabilities 585 // disable all capabilities
485 if (arg_caps_default_filter || arg_caps_list)
486 fwarning("all capabilities disabled for a regular user in chroot\n");
487 arg_caps_drop_all = 1; 586 arg_caps_drop_all = 1;
488 587
489 // drop all supplementary groups; /etc/group file inside chroot 588 // drop all supplementary groups; /etc/group file inside chroot
490 // is controlled by a regular usr 589 // is controlled by a regular usr
491 arg_nogroups = 1; 590 arg_nogroups = 1;
492 if (!arg_quiet)
493 printf("Dropping all Linux capabilities and enforcing default seccomp filter\n");
494} 591}
495 592
496int sandbox(void* sandbox_arg) { 593int sandbox(void* sandbox_arg) {
@@ -529,6 +626,12 @@ int sandbox(void* sandbox_arg) {
529 } 626 }
530 // ... and mount a tmpfs on top of /run/firejail/mnt directory 627 // ... and mount a tmpfs on top of /run/firejail/mnt directory
531 preproc_mount_mnt_dir(); 628 preproc_mount_mnt_dir();
629 // bind-mount firejail binaries and helper programs
630 if (mount(LIBDIR "/firejail", RUN_FIREJAIL_LIB_DIR, NULL, MS_BIND, NULL) < 0 ||
631 mount(NULL, RUN_FIREJAIL_LIB_DIR, NULL, MS_RDONLY|MS_NOSUID|MS_NODEV|MS_BIND|MS_REMOUNT, NULL) < 0)
632 errExit("mounting " RUN_FIREJAIL_LIB_DIR);
633 // keep a copy of dhclient executable before the filesystem is modified
634 dhcp_store_exec();
532 635
533 //**************************** 636 //****************************
534 // log sandbox data 637 // log sandbox data
@@ -628,28 +731,29 @@ int sandbox(void* sandbox_arg) {
628 // print network configuration 731 // print network configuration
629 if (!arg_quiet) { 732 if (!arg_quiet) {
630 if (any_bridge_configured() || any_interface_configured() || cfg.defaultgw || cfg.dns1) { 733 if (any_bridge_configured() || any_interface_configured() || cfg.defaultgw || cfg.dns1) {
631 printf("\n"); 734 fmessage("\n");
632 if (any_bridge_configured() || any_interface_configured()) { 735 if (any_bridge_configured() || any_interface_configured()) {
633// net_ifprint();
634 if (arg_scan) 736 if (arg_scan)
635 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 3, PATH_FNET, "printif", "scan"); 737 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 3, PATH_FNET, "printif", "scan");
636 else 738 else
637 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, PATH_FNET, "printif", "scan"); 739 sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, PATH_FNET, "printif");
638 740
639 } 741 }
640 if (cfg.defaultgw != 0) { 742 if (cfg.defaultgw != 0) {
641 if (gw_cfg_failed) 743 if (gw_cfg_failed)
642 printf("Default gateway configuration failed\n"); 744 fmessage("Default gateway configuration failed\n");
643 else 745 else
644 printf("Default gateway %d.%d.%d.%d\n", PRINT_IP(cfg.defaultgw)); 746 fmessage("Default gateway %d.%d.%d.%d\n", PRINT_IP(cfg.defaultgw));
645 } 747 }
646 if (cfg.dns1 != 0) 748 if (cfg.dns1 != NULL)
647 printf("DNS server %d.%d.%d.%d\n", PRINT_IP(cfg.dns1)); 749 fmessage("DNS server %s\n", cfg.dns1);
648 if (cfg.dns2 != 0) 750 if (cfg.dns2 != NULL)
649 printf("DNS server %d.%d.%d.%d\n", PRINT_IP(cfg.dns2)); 751 fmessage("DNS server %s\n", cfg.dns2);
650 if (cfg.dns3 != 0) 752 if (cfg.dns3 != NULL)
651 printf("DNS server %d.%d.%d.%d\n", PRINT_IP(cfg.dns3)); 753 fmessage("DNS server %s\n", cfg.dns3);
652 printf("\n"); 754 if (cfg.dns4 != NULL)
755 fmessage("DNS server %s\n", cfg.dns4);
756 fmessage("\n");
653 } 757 }
654 } 758 }
655 759
@@ -657,15 +761,17 @@ int sandbox(void* sandbox_arg) {
657 if (arg_nonetwork || any_bridge_configured() || any_interface_configured()) { 761 if (arg_nonetwork || any_bridge_configured() || any_interface_configured()) {
658 // do nothing - there are problems with ibus version 1.5.11 762 // do nothing - there are problems with ibus version 1.5.11
659 } 763 }
660 else 764 else {
765 EUID_USER();
661 env_ibus_load(); 766 env_ibus_load();
767 EUID_ROOT();
768 }
662 769
663 //**************************** 770 //****************************
664 // fs pre-processing: 771 // fs pre-processing:
665 // - build seccomp filters 772 // - build seccomp filters
666 // - create an empty /etc/ld.so.preload 773 // - create an empty /etc/ld.so.preload
667 //**************************** 774 //****************************
668#ifdef HAVE_SECCOMP
669 if (cfg.protocol) { 775 if (cfg.protocol) {
670 if (arg_debug) 776 if (arg_debug)
671 printf("Build protocol filter: %s\n", cfg.protocol); 777 printf("Build protocol filter: %s\n", cfg.protocol);
@@ -676,9 +782,16 @@ int sandbox(void* sandbox_arg) {
676 if (rv) 782 if (rv)
677 exit(rv); 783 exit(rv);
678 } 784 }
679 if (arg_seccomp && (cfg.seccomp_list || cfg.seccomp_list_drop || cfg.seccomp_list_keep)) 785
680 arg_seccomp_postexec = 1; 786#ifdef HAVE_FORCE_NONEWPRIVS
787 bool always_enforce_filters = true;
788#else
789 bool always_enforce_filters = false;
681#endif 790#endif
791 // for --appimage, --chroot and --overlay* we force NO_NEW_PRIVS
792 // and drop all capabilities
793 if (getuid() != 0 && (arg_appimage || cfg.chrootdir || arg_overlay || always_enforce_filters))
794 enforce_filters();
682 795
683 // need ld.so.preload if tracing or seccomp with any non-default lists 796 // need ld.so.preload if tracing or seccomp with any non-default lists
684 bool need_preload = arg_trace || arg_tracelog || arg_seccomp_postexec; 797 bool need_preload = arg_trace || arg_tracelog || arg_seccomp_postexec;
@@ -694,19 +807,10 @@ int sandbox(void* sandbox_arg) {
694 //**************************** 807 //****************************
695 // configure filesystem 808 // configure filesystem
696 //**************************** 809 //****************************
697 if (arg_appimage)
698 enforce_filters();
699
700#ifdef HAVE_CHROOT 810#ifdef HAVE_CHROOT
701 if (cfg.chrootdir) { 811 if (cfg.chrootdir) {
702 fs_chroot(cfg.chrootdir); 812 fs_chroot(cfg.chrootdir);
703 813
704 // force caps and seccomp if not started as root
705 if (getuid() != 0)
706 enforce_filters();
707 else
708 arg_seccomp = 1;
709
710 //**************************** 814 //****************************
711 // trace pre-install, this time inside chroot 815 // trace pre-install, this time inside chroot
712 //**************************** 816 //****************************
@@ -716,22 +820,22 @@ int sandbox(void* sandbox_arg) {
716 else 820 else
717#endif 821#endif
718#ifdef HAVE_OVERLAYFS 822#ifdef HAVE_OVERLAYFS
719 if (arg_overlay) { 823 if (arg_overlay)
720 fs_overlayfs(); 824 fs_overlayfs();
721 // force caps and seccomp if not started as root
722 if (getuid() != 0)
723 enforce_filters();
724 else
725 arg_seccomp = 1;
726 }
727 else 825 else
728#endif 826#endif
729 fs_basic_fs(); 827 fs_basic_fs();
730 828
731 //**************************** 829 //****************************
830 // appimage
831 //****************************
832 appimage_mount();
833
834 //****************************
732 // private mode 835 // private mode
733 //**************************** 836 //****************************
734 if (arg_private) { 837 if (arg_private) {
838 EUID_USER();
735 if (cfg.home_private) { // --private= 839 if (cfg.home_private) { // --private=
736 if (cfg.chrootdir) 840 if (cfg.chrootdir)
737 fwarning("private=directory feature is disabled in chroot\n"); 841 fwarning("private=directory feature is disabled in chroot\n");
@@ -750,29 +854,11 @@ int sandbox(void* sandbox_arg) {
750 } 854 }
751 else // --private 855 else // --private
752 fs_private(); 856 fs_private();
857 EUID_ROOT();
753 } 858 }
754 859
755 if (arg_private_dev) { 860 if (arg_private_dev)
756 if (cfg.chrootdir) 861 fs_private_dev();
757 fwarning("private-dev feature is disabled in chroot\n");
758 else if (arg_overlay)
759 fwarning("private-dev feature is disabled in overlay\n");
760 else
761 fs_private_dev();
762 }
763
764 if (arg_private_etc) {
765 if (cfg.chrootdir)
766 fwarning("private-etc feature is disabled in chroot\n");
767 else if (arg_overlay)
768 fwarning("private-etc feature is disabled in overlay\n");
769 else {
770 fs_private_dir_list("/etc", RUN_ETC_DIR, cfg.etc_private_keep);
771 // create /etc/ld.so.preload file again
772 if (need_preload)
773 fs_trace_preload();
774 }
775 }
776 862
777 if (arg_private_opt) { 863 if (arg_private_opt) {
778 if (cfg.chrootdir) 864 if (cfg.chrootdir)
@@ -794,7 +880,8 @@ int sandbox(void* sandbox_arg) {
794 } 880 }
795 } 881 }
796 882
797 if (arg_private_bin) { 883 // private-bin is disabled for appimages
884 if (arg_private_bin && !arg_appimage) {
798 if (cfg.chrootdir) 885 if (cfg.chrootdir)
799 fwarning("private-bin feature is disabled in chroot\n"); 886 fwarning("private-bin feature is disabled in chroot\n");
800 else if (arg_overlay) 887 else if (arg_overlay)
@@ -813,7 +900,8 @@ int sandbox(void* sandbox_arg) {
813 } 900 }
814 } 901 }
815 902
816 if (arg_private_lib) { 903 // private-lib is disabled for appimages
904 if (arg_private_lib && !arg_appimage) {
817 if (cfg.chrootdir) 905 if (cfg.chrootdir)
818 fwarning("private-lib feature is disabled in chroot\n"); 906 fwarning("private-lib feature is disabled in chroot\n");
819 else if (arg_overlay) 907 else if (arg_overlay)
@@ -823,20 +911,29 @@ int sandbox(void* sandbox_arg) {
823 } 911 }
824 } 912 }
825 913
914#ifdef HAVE_USERTMPFS
915 if (arg_private_cache) {
916 EUID_USER();
917 profile_add("tmpfs ${HOME}/.cache");
918 EUID_ROOT();
919 }
920#endif
921
826 if (arg_private_tmp) { 922 if (arg_private_tmp) {
827 if (cfg.chrootdir) 923 // private-tmp is implemented as a whitelist
828 fwarning("private-tmp feature is disabled in chroot\n"); 924 EUID_USER();
829 else if (arg_overlay) 925 fs_private_tmp();
830 fwarning("private-tmp feature is disabled in overlay\n"); 926 EUID_ROOT();
831 else {
832 // private-tmp is implemented as a whitelist
833 EUID_USER();
834 fs_private_tmp();
835 EUID_ROOT();
836 }
837 } 927 }
838 928
839 //**************************** 929 //****************************
930 // Session D-BUS
931 //****************************
932#ifdef HAVE_DBUSPROXY
933 dbus_apply_policy();
934#endif
935
936 //****************************
840 // hosts and hostname 937 // hosts and hostname
841 //**************************** 938 //****************************
842 if (cfg.hostname) 939 if (cfg.hostname)
@@ -854,25 +951,60 @@ int sandbox(void* sandbox_arg) {
854 //**************************** 951 //****************************
855 // update /proc, /sys, /dev, /boot directory 952 // update /proc, /sys, /dev, /boot directory
856 //**************************** 953 //****************************
857 if (checkcfg(CFG_REMOUNT_PROC_SYS)) 954 fs_proc_sys_dev_boot();
858 fs_proc_sys_dev_boot();
859 955
860 //**************************** 956 //****************************
861 // handle /mnt and /media 957 // handle /mnt and /media
862 //**************************** 958 //****************************
863 if (arg_disable_mnt || checkcfg(CFG_DISABLE_MNT)) 959 if (checkcfg(CFG_DISABLE_MNT))
864 fs_mnt(); 960 fs_mnt(1);
961 else if (arg_disable_mnt)
962 fs_mnt(0);
963
964 // Install new /etc last, so we can use it as long as possible
965 if (arg_private_etc) {
966 if (cfg.chrootdir)
967 fwarning("private-etc feature is disabled in chroot\n");
968 else if (arg_overlay)
969 fwarning("private-etc feature is disabled in overlay\n");
970 else {
971 /* Current /etc/passwd and /etc/group files are bind
972 * mounted filtered versions of originals. Leaving
973 * them underneath private-etc mount causes problems
974 * in devices with older kernels, e.g. attempts to
975 * update the real /etc/passwd file yield EBUSY.
976 *
977 * As we do want to retain filtered /etc content:
978 * 1. duplicate /etc content to RUN_ETC_DIR
979 * 2. unmount bind mounts from /etc
980 * 3. mount RUN_ETC_DIR at /etc
981 */
982 timetrace_start();
983 fs_private_dir_copy("/etc", RUN_ETC_DIR, cfg.etc_private_keep);
984
985 if (umount2("/etc/group", MNT_DETACH) == -1)
986 fprintf(stderr, "/etc/group: unmount: %s\n", strerror(errno));
987 if (umount2("/etc/passwd", MNT_DETACH) == -1)
988 fprintf(stderr, "/etc/passwd: unmount: %s\n", strerror(errno));
989
990 fs_private_dir_mount("/etc", RUN_ETC_DIR);
991 fmessage("Private /etc installed in %0.2f ms\n", timetrace_end());
992
993 // create /etc/ld.so.preload file again
994 if (need_preload)
995 fs_trace_preload();
996
997 // openSUSE configuration is split between /etc and /usr/etc
998 // process private-etc a second time
999 fs_private_dir_list("/usr/etc", RUN_USR_ETC_DIR, cfg.etc_private_keep);
1000 }
1001 }
865 1002
866 //**************************** 1003 //****************************
867 // apply the profile file 1004 // apply the profile file
868 //**************************** 1005 //****************************
869 // apply all whitelist commands ... 1006 // apply all whitelist commands ...
870 if (cfg.chrootdir) 1007 fs_whitelist();
871 fwarning("whitelist feature is disabled in chroot\n");
872 else if (arg_overlay)
873 fwarning("whitelist feature is disabled in overlay\n");
874 else
875 fs_whitelist();
876 1008
877 // ... followed by blacklist commands 1009 // ... followed by blacklist commands
878 fs_blacklist(); // mkdir and mkfile are processed all over again 1010 fs_blacklist(); // mkdir and mkfile are processed all over again
@@ -887,7 +1019,7 @@ int sandbox(void* sandbox_arg) {
887 // disable /dev/snd 1019 // disable /dev/snd
888 fs_dev_disable_sound(); 1020 fs_dev_disable_sound();
889 } 1021 }
890 else 1022 else if (!arg_keep_config_pulse)
891 pulseaudio_init(); 1023 pulseaudio_init();
892 1024
893 if (arg_no3d) 1025 if (arg_no3d)
@@ -899,34 +1031,37 @@ int sandbox(void* sandbox_arg) {
899 if (arg_nodvd) 1031 if (arg_nodvd)
900 fs_dev_disable_dvd(); 1032 fs_dev_disable_dvd();
901 1033
1034 if (arg_nou2f)
1035 fs_dev_disable_u2f();
1036
902 if (arg_novideo) 1037 if (arg_novideo)
903 fs_dev_disable_video(); 1038 fs_dev_disable_video();
904 1039
905 //**************************** 1040 if (arg_noinput)
906 // install trace 1041 fs_dev_disable_input();
907 //****************************
908 if (need_preload)
909 fs_trace();
910 1042
911 //**************************** 1043 //****************************
912 // set dns 1044 // set dns
913 //**************************** 1045 //****************************
914 fs_resolvconf(); 1046 fs_rebuild_etc();
915 1047
916 //**************************** 1048 //****************************
917 // fs post-processing 1049 // start dhcp client
918 //**************************** 1050 //****************************
919 fs_logger_print(); 1051 dhcp_start();
920 fs_logger_change_owner();
921 1052
922 //**************************** 1053 //****************************
923 // set application environment 1054 // set application environment
924 //**************************** 1055 //****************************
925 prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); // kill the child in case the parent died 1056 EUID_USER();
926 int cwd = 0; 1057 int cwd = 0;
927 if (cfg.cwd) { 1058 if (cfg.cwd) {
928 if (chdir(cfg.cwd) == 0) 1059 if (chdir(cfg.cwd) == 0)
929 cwd = 1; 1060 cwd = 1;
1061 else if (arg_private_cwd) {
1062 fprintf(stderr, "Error: unable to enter private working directory: %s: %s\n", cfg.cwd, strerror(errno));
1063 exit(1);
1064 }
930 } 1065 }
931 1066
932 if (!cwd) { 1067 if (!cwd) {
@@ -949,44 +1084,34 @@ int sandbox(void* sandbox_arg) {
949 } 1084 }
950 } 1085 }
951 1086
952 1087 EUID_ROOT();
953 // set nice
954 if (arg_nice) {
955 errno = 0;
956 int rv = nice(cfg.nice);
957 (void) rv;
958 if (errno) {
959 fwarning("cannot set nice value\n");
960 errno = 0;
961 }
962 }
963
964 // clean /tmp/.X11-unix sockets 1088 // clean /tmp/.X11-unix sockets
965 fs_x11(); 1089 fs_x11();
966 if (arg_x11_xorg) 1090 if (arg_x11_xorg)
967 x11_xorg(); 1091 x11_xorg();
968 1092
1093 // save original umask
1094 save_umask();
1095
969 //**************************** 1096 //****************************
970 // set security filters 1097 // fs post-processing
971 //**************************** 1098 //****************************
972 // set capabilities 1099 fs_logger_print();
973 set_caps(); 1100 fs_logger_change_owner();
974 1101
975 // set rlimits 1102 //****************************
976 set_rlimits(); 1103 // set security filters
1104 //****************************
1105 // save state of nonewprivs
1106 save_nonewprivs();
977 1107
978 // set cpu affinity 1108 // save cpu affinity mask to CPU_CFG file
979 if (cfg.cpus) { 1109 save_cpu();
980 save_cpu(); // save cpu affinity mask to CPU_CFG file
981 set_cpu_affinity();
982 }
983 1110
984 // save cgroup in CGROUP_CFG file 1111 // save cgroup in CGROUP_CFG file
985 if (cfg.cgroup) 1112 save_cgroup();
986 save_cgroup();
987 1113
988 // set seccomp 1114 // set seccomp
989#ifdef HAVE_SECCOMP
990 // install protocol filter 1115 // install protocol filter
991#ifdef SYS_socket 1116#ifdef SYS_socket
992 if (cfg.protocol) { 1117 if (cfg.protocol) {
@@ -995,44 +1120,71 @@ int sandbox(void* sandbox_arg) {
995 seccomp_load(RUN_SECCOMP_PROTOCOL); // install filter 1120 seccomp_load(RUN_SECCOMP_PROTOCOL); // install filter
996 protocol_filter_save(); // save filter in RUN_PROTOCOL_CFG 1121 protocol_filter_save(); // save filter in RUN_PROTOCOL_CFG
997 } 1122 }
1123 else {
1124 int rv = unlink(RUN_SECCOMP_PROTOCOL);
1125 (void) rv;
1126 }
998#endif 1127#endif
999 1128
1000 // if a keep list is available, disregard the drop list 1129 // if a keep list is available, disregard the drop list
1001 if (arg_seccomp == 1) { 1130 if (arg_seccomp == 1) {
1002 if (cfg.seccomp_list_keep) 1131 if (cfg.seccomp_list_keep)
1003 seccomp_filter_keep(); 1132 seccomp_filter_keep(true);
1004 else 1133 else
1005 seccomp_filter_drop(); 1134 seccomp_filter_drop(true);
1006 } 1135 }
1136 if (arg_seccomp32 == 1) {
1137 if (cfg.seccomp_list_keep32)
1138 seccomp_filter_keep(false);
1139 else
1140 seccomp_filter_drop(false);
1007 1141
1008 if (arg_debug) {
1009 printf("\nSeccomp files:\n");
1010 int rv = system("ls -l /run/firejail/mnt/seccomp*\n");
1011 (void) rv;
1012 printf("\n");
1013 } 1142 }
1014 1143
1015 if (arg_memory_deny_write_execute) { 1144 if (arg_memory_deny_write_execute) {
1145 if (arg_seccomp_error_action != EPERM) {
1146 seccomp_filter_mdwx(true);
1147 seccomp_filter_mdwx(false);
1148 }
1016 if (arg_debug) 1149 if (arg_debug)
1017 printf("Install memory write&execute filter\n"); 1150 printf("Install memory write&execute filter\n");
1018 seccomp_load(RUN_SECCOMP_MDWX); // install filter 1151 seccomp_load(RUN_SECCOMP_MDWX); // install filter
1152 seccomp_load(RUN_SECCOMP_MDWX_32);
1019 } 1153 }
1020#endif 1154
1155 // make seccomp filters read-only
1156 fs_remount(RUN_SECCOMP_DIR, MOUNT_READONLY, 0);
1157 seccomp_debug();
1158
1159 //****************************
1160 // install trace - still need capabilities
1161 //****************************
1162 if (need_preload)
1163 fs_trace();
1164
1165 //****************************
1166 // continue security filters
1167 //****************************
1168 // set capabilities
1169 set_caps();
1170
1171 //****************************************
1172 // relay status information to join option
1173 //****************************************
1174 char *set_sandbox_status = create_join_file();
1021 1175
1022 //**************************************** 1176 //****************************************
1023 // drop privileges or create a new user namespace 1177 // create a new user namespace
1178 // - too early to drop privileges
1024 //**************************************** 1179 //****************************************
1025 save_nogroups(); 1180 save_nogroups();
1026 if (arg_noroot) { 1181 if (arg_noroot) {
1027 int rv = unshare(CLONE_NEWUSER); 1182 int rv = unshare(CLONE_NEWUSER);
1028 if (rv == -1) { 1183 if (rv == -1) {
1029 fwarning("cannot create a new user namespace, going forward without it...\n"); 1184 fwarning("cannot create a new user namespace, going forward without it...\n");
1030 drop_privs(arg_nogroups);
1031 arg_noroot = 0; 1185 arg_noroot = 0;
1032 } 1186 }
1033 } 1187 }
1034 else
1035 drop_privs(arg_nogroups);
1036 1188
1037 // notify parent that new user namespace has been created so a proper 1189 // notify parent that new user namespace has been created so a proper
1038 // UID/GID map can be setup 1190 // UID/GID map can be setup
@@ -1055,15 +1207,34 @@ int sandbox(void* sandbox_arg) {
1055 // Set NO_NEW_PRIVS if desired 1207 // Set NO_NEW_PRIVS if desired
1056 //**************************************** 1208 //****************************************
1057 if (arg_nonewprivs) { 1209 if (arg_nonewprivs) {
1058 int no_new_privs = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); 1210 prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
1059 1211
1060 if(no_new_privs != 0 && !arg_quiet) 1212 if (prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0) != 1) {
1061 fwarning("NO_NEW_PRIVS disabled, it requires a Linux kernel version 3.5 or newer.\n"); 1213 fwarning("cannot set NO_NEW_PRIVS, it requires a Linux kernel version 3.5 or newer.\n");
1214 if (force_nonewprivs) {
1215 fprintf(stderr, "Error: NO_NEW_PRIVS required for this sandbox, exiting ...\n");
1216 exit(1);
1217 }
1218 }
1062 else if (arg_debug) 1219 else if (arg_debug)
1063 printf("NO_NEW_PRIVS set\n"); 1220 printf("NO_NEW_PRIVS set\n");
1064 } 1221 }
1065 1222
1066 //**************************************** 1223 //****************************************
1224 // drop privileges
1225 //****************************************
1226 drop_privs(arg_nogroups);
1227
1228 // kill the sandbox in case the parent died
1229 prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
1230
1231 //****************************************
1232 // set cpu affinity
1233 //****************************************
1234 if (cfg.cpus)
1235 set_cpu_affinity();
1236
1237 //****************************************
1067 // fork the application and monitor it 1238 // fork the application and monitor it
1068 //**************************************** 1239 //****************************************
1069 pid_t app_pid = fork(); 1240 pid_t app_pid = fork();
@@ -1072,29 +1243,31 @@ int sandbox(void* sandbox_arg) {
1072 1243
1073 if (app_pid == 0) { 1244 if (app_pid == 0) {
1074#ifdef HAVE_APPARMOR 1245#ifdef HAVE_APPARMOR
1075 if (arg_apparmor) { 1246 set_apparmor();
1076 errno = 0;
1077 if (aa_change_onexec("firejail-default")) {
1078 fwarning("Cannot confine the application using AppArmor.\n"
1079 "Maybe firejail-default AppArmor profile is not loaded into the kernel.\n"
1080 "As root, run \"aa-enforce firejail-default\" to load it.\n");
1081 }
1082 else if (arg_debug)
1083 printf("AppArmor enabled\n");
1084 }
1085#endif 1247#endif
1086 prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); // kill the child in case the parent died 1248
1087 start_application(0); // start app 1249 // set nice and rlimits
1250 if (arg_nice)
1251 set_nice(cfg.nice);
1252 set_rlimits();
1253
1254 start_application(0, -1, set_sandbox_status);
1088 } 1255 }
1089 1256
1257 munmap(set_sandbox_status, 1);
1258
1090 int status = monitor_application(app_pid); // monitor application 1259 int status = monitor_application(app_pid); // monitor application
1091 flush_stdin();
1092 1260
1093 if (WIFEXITED(status)) { 1261 if (WIFEXITED(status)) {
1094 // if we had a proper exit, return that exit status 1262 // if we had a proper exit, return that exit status
1095 return WEXITSTATUS(status); 1263 status = WEXITSTATUS(status);
1264 } else if (WIFSIGNALED(status)) {
1265 // distinguish fatal signals by adding 128
1266 status = 128 + WTERMSIG(status);
1096 } else { 1267 } else {
1097 // something else went wrong! 1268 status = -1;
1098 return -1;
1099 } 1269 }
1270
1271 flush_stdin();
1272 return status;
1100} 1273}
diff --git a/src/firejail/sbox.c b/src/firejail/sbox.c
index 1d6cc2353..37111324a 100644
--- a/src/firejail/sbox.c
+++ b/src/firejail/sbox.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -23,211 +23,295 @@
23#include <unistd.h> 23#include <unistd.h>
24#include <net/if.h> 24#include <net/if.h>
25#include <stdarg.h> 25#include <stdarg.h>
26 #include <sys/wait.h> 26#include <sys/wait.h>
27#include "../include/seccomp.h" 27#include "../include/seccomp.h"
28 28
29static struct sock_filter filter[] = { 29#include <fcntl.h>
30 VALIDATE_ARCHITECTURE, 30#ifndef O_PATH
31 EXAMINE_SYSCALL, 31#define O_PATH 010000000
32#endif
33
34static int __attribute__((noreturn)) sbox_do_exec_v(unsigned filtermask, char * const arg[]) {
35 // build a new, clean environment
36 int env_index = 0;
37 char *new_environment[256] = { NULL };
38 // preserve firejail-specific env vars
39 const char *cl = env_get("FIREJAIL_FILE_COPY_LIMIT");
40 if (cl) {
41 if (asprintf(&new_environment[env_index++], "FIREJAIL_FILE_COPY_LIMIT=%s", cl) == -1)
42 errExit("asprintf");
43 }
44 if (arg_quiet) // --quiet is passed as an environment variable
45 new_environment[env_index++] = "FIREJAIL_QUIET=yes";
46 if (arg_debug) // --debug is passed as an environment variable
47 new_environment[env_index++] = "FIREJAIL_DEBUG=yes";
48 if (cfg.seccomp_error_action)
49 if (asprintf(&new_environment[env_index++], "FIREJAIL_SECCOMP_ERROR_ACTION=%s", cfg.seccomp_error_action) == -1)
50 errExit("asprintf");
51 new_environment[env_index++] = "FIREJAIL_PLUGIN="; // always set
52
53 if (filtermask & SBOX_STDIN_FROM_FILE) {
54 int fd;
55 if((fd = open(SBOX_STDIN_FILE, O_RDONLY)) == -1) {
56 fprintf(stderr,"Error: cannot open %s\n", SBOX_STDIN_FILE);
57 exit(1);
58 }
59 if (dup2(fd, STDIN_FILENO) == -1)
60 errExit("dup2");
61 close(fd);
62 }
63 else if ((filtermask & SBOX_ALLOW_STDIN) == 0) {
64 int fd = open("/dev/null",O_RDWR, 0);
65 if (fd != -1) {
66 if (dup2(fd, STDIN_FILENO) == -1)
67 errExit("dup2");
68 close(fd);
69 }
70 else // the user could run the sandbox without /dev/null
71 close(STDIN_FILENO);
72 }
73
74 // close all other file descriptors
75 if ((filtermask & SBOX_KEEP_FDS) == 0) {
76 int i;
77 for (i = 3; i < FIREJAIL_MAX_FD; i++)
78 close(i); // close open files
79 }
80
81 umask(027);
82
83 // apply filters
84 if (filtermask & SBOX_CAPS_NONE) {
85 caps_drop_all();
86 } else {
87 uint64_t set = 0;
88 if (filtermask & SBOX_CAPS_NETWORK) {
89#ifndef HAVE_GCOV // the following filter will prevent GCOV from saving info in .gcda files
90 set |= ((uint64_t) 1) << CAP_NET_ADMIN;
91 set |= ((uint64_t) 1) << CAP_NET_RAW;
92#endif
93 }
94 if (filtermask & SBOX_CAPS_HIDEPID) {
95#ifndef HAVE_GCOV // the following filter will prevent GCOV from saving info in .gcda files
96 set |= ((uint64_t) 1) << CAP_SYS_PTRACE;
97 set |= ((uint64_t) 1) << CAP_SYS_PACCT;
98#endif
99 }
100 if (filtermask & SBOX_CAPS_NET_SERVICE) {
101#ifndef HAVE_GCOV // the following filter will prevent GCOV from saving info in .gcda files
102 set |= ((uint64_t) 1) << CAP_NET_BIND_SERVICE;
103 set |= ((uint64_t) 1) << CAP_NET_BROADCAST;
104#endif
105 }
106 if (set != 0) { // some SBOX_CAPS_ flag was specified, drop all other capabilities
107#ifndef HAVE_GCOV // the following filter will prevent GCOV from saving info in .gcda files
108 caps_set(set);
109#endif
110 }
111 }
112
113 if (filtermask & SBOX_SECCOMP) {
114 struct sock_filter filter[] = {
115 VALIDATE_ARCHITECTURE,
116 EXAMINE_SYSCALL,
32 117
33#if defined(__x86_64__) 118#if defined(__x86_64__)
34#define X32_SYSCALL_BIT 0x40000000 119#define X32_SYSCALL_BIT 0x40000000
35 // handle X32 ABI 120 // handle X32 ABI
36 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, X32_SYSCALL_BIT, 1, 0), 121 BPF_JUMP(BPF_JMP + BPF_JGE + BPF_K, X32_SYSCALL_BIT, 1, 0),
37 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0, 1, 0), 122 BPF_JUMP(BPF_JMP + BPF_JGE + BPF_K, 0, 1, 0),
38 RETURN_ERRNO(EPERM), 123 KILL_OR_RETURN_ERRNO,
39#endif 124#endif
40 125
41 // syscall list 126 // syscall list
42#ifdef SYS_mount 127#ifdef SYS_mount
43 BLACKLIST(SYS_mount), // mount/unmount filesystems 128 BLACKLIST(SYS_mount), // mount/unmount filesystems
129#endif
130#ifdef SYS_umount
131 BLACKLIST(SYS_umount),
44#endif 132#endif
45#ifdef SYS_umount2 133#ifdef SYS_umount2
46 BLACKLIST(SYS_umount2), 134 BLACKLIST(SYS_umount2),
47#endif 135#endif
48#ifdef SYS_ptrace 136#ifdef SYS_ptrace
49 BLACKLIST(SYS_ptrace), // trace processes 137 BLACKLIST(SYS_ptrace), // trace processes
138#endif
139#ifdef SYS_process_vm_readv
140 BLACKLIST(SYS_process_vm_readv),
141#endif
142#ifdef SYS_process_vm_writev
143 BLACKLIST(SYS_process_vm_writev),
50#endif 144#endif
51#ifdef SYS_kexec_file_load 145#ifdef SYS_kexec_file_load
52 BLACKLIST(SYS_kexec_file_load), 146 BLACKLIST(SYS_kexec_file_load), // loading a different kernel
53#endif 147#endif
54#ifdef SYS_kexec_load 148#ifdef SYS_kexec_load
55 BLACKLIST(SYS_kexec_load), // loading a different kernel 149 BLACKLIST(SYS_kexec_load),
56#endif 150#endif
57#ifdef SYS_name_to_handle_at 151#ifdef SYS_name_to_handle_at
58 BLACKLIST(SYS_name_to_handle_at), 152 BLACKLIST(SYS_name_to_handle_at),
59#endif 153#endif
60#ifdef SYS_open_by_handle_at 154#ifdef SYS_open_by_handle_at
61 BLACKLIST(SYS_open_by_handle_at), // open by handle 155 BLACKLIST(SYS_open_by_handle_at), // open by handle
62#endif 156#endif
63#ifdef SYS_init_module 157#ifdef SYS_init_module
64 BLACKLIST(SYS_init_module), // kernel module handling 158 BLACKLIST(SYS_init_module), // kernel module handling
65#endif 159#endif
66#ifdef SYS_finit_module // introduced in 2013 160#ifdef SYS_finit_module // introduced in 2013
67 BLACKLIST(SYS_finit_module), 161 BLACKLIST(SYS_finit_module),
68#endif 162#endif
69#ifdef SYS_create_module 163#ifdef SYS_create_module
70 BLACKLIST(SYS_create_module), 164 BLACKLIST(SYS_create_module),
71#endif 165#endif
72#ifdef SYS_delete_module 166#ifdef SYS_delete_module
73 BLACKLIST(SYS_delete_module), 167 BLACKLIST(SYS_delete_module),
74#endif 168#endif
75#ifdef SYS_iopl 169#ifdef SYS_iopl
76 BLACKLIST(SYS_iopl), // io permissions 170 BLACKLIST(SYS_iopl), // io permissions
77#endif
78#ifdef SYS_ioperm
79 BLACKLIST(SYS_ioperm),
80#endif 171#endif
81#ifdef SYS_iopl 172#ifdef SYS_ioperm
82 BLACKLIST(SYS_iopl), // io permissions 173 BLACKLIST(SYS_ioperm),
83#endif 174#endif
84#ifdef SYS_ioprio_set 175#ifdef SYS_ioprio_set
85 BLACKLIST(SYS_ioprio_set), 176 BLACKLIST(SYS_ioprio_set),
86#endif 177#endif
87#ifdef SYS_ni_syscall // new io permissions call on arm devices 178#ifdef SYS_ni_syscall // new io permissions call on arm devices
88 BLACKLIST(SYS_ni_syscall), 179 BLACKLIST(SYS_ni_syscall),
89#endif 180#endif
90#ifdef SYS_swapon 181#ifdef SYS_swapon
91 BLACKLIST(SYS_swapon), // swap on/off 182 BLACKLIST(SYS_swapon), // swap on/off
92#endif 183#endif
93#ifdef SYS_swapoff 184#ifdef SYS_swapoff
94 BLACKLIST(SYS_swapoff), 185 BLACKLIST(SYS_swapoff),
95#endif 186#endif
96#ifdef SYS_syslog 187#ifdef SYS_syslog
97 BLACKLIST(SYS_syslog), // kernel printk control 188 BLACKLIST(SYS_syslog), // kernel printk control
98#endif 189#endif
99 RETURN_ALLOW 190 RETURN_ALLOW
100}; 191 };
101 192
102static struct sock_fprog prog = { 193 struct sock_fprog prog = {
103 .len = (unsigned short)(sizeof(filter) / sizeof(filter[0])), 194 .len = (unsigned short)(sizeof(filter) / sizeof(filter[0])),
104 .filter = filter, 195 .filter = filter,
105}; 196 };
106 197
107typedef struct sbox_config { 198 if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {
108 char *name; 199 perror("prctl(NO_NEW_PRIVS)");
109 char *path; 200 }
110 unsigned filters; 201 if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) {
111} SboxConfig; 202 perror("prctl(PR_SET_SECCOMP)");
203 }
204 }
112 205
206 if (filtermask & SBOX_USER)
207 drop_privs(1);
208 else if (filtermask & SBOX_ROOT) {
209 // elevate privileges in order to get grsecurity working
210 if (setreuid(0, 0))
211 errExit("setreuid");
212 if (setregid(0, 0))
213 errExit("setregid");
214 }
215 else assert(0);
113 216
114int sbox_run(unsigned filter, int num, ...) { 217 if (arg[0]) { // get rid of scan-build warning
115 EUID_ROOT(); 218 int fd = open(arg[0], O_PATH | O_CLOEXEC);
219 if (fd == -1) {
220 if (errno == ENOENT) {
221 fprintf(stderr, "Error: %s does not exist\n", arg[0]);
222 exit(1);
223 } else {
224 errExit("open");
225 }
226 }
227 struct stat s;
228 if (fstat(fd, &s) == -1)
229 errExit("fstat");
230 if (s.st_uid != 0 && s.st_gid != 0) {
231 fprintf(stderr, "Error: %s is not owned by root, refusing to execute\n", arg[0]);
232 exit(1);
233 }
234 if (s.st_mode & 00002) {
235 fprintf(stderr, "Error: %s is world writable, refusing to execute\n", arg[0]);
236 exit(1);
237 }
238 fexecve(fd, arg, new_environment);
239 } else {
240 assert(0);
241 }
242 perror("fexecve");
243 _exit(1);
244}
116 245
117 int i; 246int sbox_run(unsigned filtermask, int num, ...) {
118 va_list valist; 247 va_list valist;
119 va_start(valist, num); 248 va_start(valist, num);
120 249
121 // build argument list 250 // build argument list
122 char *arg[num + 1]; 251 char **arg = calloc(num + 1, sizeof(char *));
252 if (!arg)
253 errExit("calloc");
254 int i;
123 for (i = 0; i < num; i++) 255 for (i = 0; i < num; i++)
124 arg[i] = va_arg(valist, char*); 256 arg[i] = va_arg(valist, char *);
125 arg[i] = NULL; 257 arg[i] = NULL;
126 va_end(valist); 258 va_end(valist);
127 259
260 int status = sbox_run_v(filtermask, arg);
261
262 free(arg);
263
264 return status;
265}
266
267int sbox_run_v(unsigned filtermask, char * const arg[]) {
268 assert(arg);
269
128 if (arg_debug) { 270 if (arg_debug) {
129 printf("sbox run: "); 271 printf("sbox run: ");
130 for (i = 0; i <= num; i++) 272 int i = 0;
273 while (arg[i]) {
131 printf("%s ", arg[i]); 274 printf("%s ", arg[i]);
275 i++;
276 }
132 printf("\n"); 277 printf("\n");
133 } 278 }
134 279
280 // KEEP_FDS only makes sense with sbox_exec_v
281 assert((filtermask & SBOX_KEEP_FDS) == 0);
282
135 pid_t child = fork(); 283 pid_t child = fork();
136 if (child < 0) 284 if (child < 0)
137 errExit("fork"); 285 errExit("fork");
138 if (child == 0) { 286 if (child == 0) {
139 // clean the new process 287 EUID_ROOT();
140 clearenv(); 288 sbox_do_exec_v(filtermask, arg);
141
142 if (filter & SBOX_STDIN_FROM_FILE) {
143 int fd;
144 if((fd = open(SBOX_STDIN_FILE, O_RDONLY)) == -1) {
145 fprintf(stderr,"Error: cannot open /tmp/netfilter\n");
146 exit(1);
147 }
148 dup2(fd,STDIN_FILENO);
149 }
150 else if ((filter & SBOX_ALLOW_STDIN) == 0) {
151 int fd = open("/dev/null",O_RDWR, 0);
152 if (fd != -1)
153 dup2(fd, STDIN_FILENO);
154 else // the user could run the sandbox without /dev/null
155 close(STDIN_FILENO);
156 }
157
158 // close all other file descriptors
159 int max = 20; // getdtablesize() is overkill for a firejail process
160 for (i = 3; i < max; i++)
161 close(i); // close open files
162
163 if (arg_debug) {
164 printf("sbox file descriptors:\n");
165 int rv = system("ls -l /proc/self/fd");
166 (void) rv;
167 }
168
169 umask(027);
170
171 // apply filters
172 if (filter & SBOX_CAPS_NONE) {
173 caps_drop_all();
174 }
175 else if (filter & SBOX_CAPS_NETWORK) {
176#ifndef HAVE_GCOV // the following filter will prevent GCOV from saving info in .gcda files
177 uint64_t set = ((uint64_t) 1) << CAP_NET_ADMIN;
178 set |= ((uint64_t) 1) << CAP_NET_RAW;
179 caps_set(set);
180#endif
181 }
182
183 if (filter & SBOX_SECCOMP) {
184 if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {
185 perror("prctl(NO_NEW_PRIVS)");
186 }
187 if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog)) {
188 perror("prctl(PR_SET_SECCOMP)");
189 }
190 }
191
192 if (filter & SBOX_ROOT) {
193 // elevate privileges in order to get grsecurity working
194 if (setreuid(0, 0))
195 errExit("setreuid");
196 if (setregid(0, 0))
197 errExit("setregid");
198 }
199 else if (filter & SBOX_USER)
200 drop_privs(1);
201
202 clearenv();
203
204 // --quiet is passed as an environment variable
205 if (arg_quiet)
206 setenv("FIREJAIL_QUIET", "yes", 1);
207
208 if (arg[0]) // get rid of scan-build warning
209 execvp(arg[0], arg);
210 else
211 assert(0);
212 perror("execvp");
213 _exit(1);
214 } 289 }
215 290
216 int status; 291 int status;
217 if (waitpid(child, &status, 0) == -1 ) { 292 if (waitpid(child, &status, 0) == -1 ) {
218 errExit("waitpid"); 293 errExit("waitpid");
219 } 294 }
220 if (WIFEXITED(status) && status != 0) { 295 if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
221 fprintf(stderr, "Error: failed to run %s\n", arg[0]); 296 fprintf(stderr, "Error: failed to run %s, exiting...\n", arg[0]);
222 exit(1); 297 exit(1);
223 } 298 }
224 299
225#if 0
226printf("** sbox run out *********************************\n");
227system("ls -l /run/firejail/mnt\n");
228system("ls -l /proc/self/fd");
229printf("** sbox run out *********************************\n");
230#endif
231
232 return status; 300 return status;
233} 301}
302
303void sbox_exec_v(unsigned filtermask, char * const arg[]) {
304 EUID_ROOT();
305
306 if (arg_debug) {
307 printf("sbox exec: ");
308 int i = 0;
309 while (arg[i]) {
310 printf("%s ", arg[i]);
311 i++;
312 }
313 printf("\n");
314 }
315
316 sbox_do_exec_v(filtermask, arg);
317}
diff --git a/src/firejail/seccomp.c b/src/firejail/seccomp.c
index e75863c3a..3d9bf9082 100644
--- a/src/firejail/seccomp.c
+++ b/src/firejail/seccomp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,7 +18,6 @@
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 20
21#ifdef HAVE_SECCOMP
22#include "firejail.h" 21#include "firejail.h"
23#include "../include/seccomp.h" 22#include "../include/seccomp.h"
24#include <sys/mman.h> 23#include <sys/mman.h>
@@ -31,7 +30,6 @@ typedef struct filter_list {
31 30
32static FilterList *filter_list_head = NULL; 31static FilterList *filter_list_head = NULL;
33static int err_printed = 0; 32static int err_printed = 0;
34extern int enforce_seccomp;
35 33
36char *seccomp_check_list(const char *str) { 34char *seccomp_check_list(const char *str) {
37 assert(str); 35 assert(str);
@@ -49,10 +47,11 @@ char *seccomp_check_list(const char *str) {
49 const char *ptr1 = str; 47 const char *ptr1 = str;
50 char *ptr2 = rv; 48 char *ptr2 = rv;
51 while (*ptr1 != '\0') { 49 while (*ptr1 != '\0') {
52 if (isalnum(*ptr1) || *ptr1 == '_' || *ptr1 == ',' || *ptr1 == ':' || *ptr1 == '@' || *ptr1 == '-') 50 if (isalnum(*ptr1) || *ptr1 == '_' || *ptr1 == ',' || *ptr1 == ':'
51 || *ptr1 == '@' || *ptr1 == '-' || *ptr1 == '$' || *ptr1 == '!')
53 *ptr2++ = *ptr1++; 52 *ptr2++ = *ptr1++;
54 else { 53 else {
55 fprintf(stderr, "Error: invalid syscall list\n"); 54 fprintf(stderr, "Error: invalid syscall list entry %s\n", str);
56 exit(1); 55 exit(1);
57 } 56 }
58 } 57 }
@@ -74,11 +73,6 @@ int seccomp_install_filters(void) {
74 73
75 if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &fl->prog)) { 74 if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &fl->prog)) {
76 75
77 if (enforce_seccomp) {
78 fprintf(stderr, "Error: a seccomp-enabled Linux kernel is required, exiting...\n");
79 exit(1);
80 }
81
82 if (!err_printed) 76 if (!err_printed)
83 fwarning("seccomp disabled, it requires a Linux kernel version 3.5 or newer.\n"); 77 fwarning("seccomp disabled, it requires a Linux kernel version 3.5 or newer.\n");
84 err_printed = 1; 78 err_printed = 1;
@@ -89,11 +83,46 @@ int seccomp_install_filters(void) {
89 return r; 83 return r;
90} 84}
91 85
86static void seccomp_save_file_list(const char *fname) {
87 assert(fname);
88
89 FILE *fp = fopen(RUN_SECCOMP_LIST, "ae");
90 if (!fp)
91 errExit("fopen");
92
93 fprintf(fp, "%s\n", fname);
94 fclose(fp);
95 int rv = chown(RUN_SECCOMP_LIST, getuid(), getgid());
96 (void) rv;
97}
98
99#define MAXBUF 4096
100static int load_file_list_flag = 0;
101void seccomp_load_file_list(void) {
102 FILE *fp = fopen(RUN_SECCOMP_LIST, "re");
103 if (!fp)
104 return; // no seccomp configuration whatsoever
105
106 load_file_list_flag = 1;
107 char buf[MAXBUF];
108 while (fgets(buf, MAXBUF, fp)) {
109 // clean '\n'
110 char *ptr = strchr(buf, '\n');
111 if (ptr)
112 *ptr = '\0';
113 seccomp_load(buf);
114 }
115
116 fclose(fp);
117 load_file_list_flag = 0;
118}
119
120
92int seccomp_load(const char *fname) { 121int seccomp_load(const char *fname) {
93 assert(fname); 122 assert(fname);
94 123
95 // open filter file 124 // open filter file
96 int fd = open(fname, O_RDONLY); 125 int fd = open(fname, O_RDONLY|O_CLOEXEC);
97 if (fd == -1) 126 if (fd == -1)
98 goto errexit; 127 goto errexit;
99 128
@@ -126,11 +155,15 @@ int seccomp_load(const char *fname) {
126 errExit("strdup"); 155 errExit("strdup");
127 filter_list_head = fl; 156 filter_list_head = fl;
128 157
129 if (arg_debug && access(PATH_FSECCOMP, X_OK) == 0) { 158 if (arg_debug && access(PATH_FSEC_PRINT, X_OK) == 0) {
130 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3, 159 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2,
131 PATH_FSECCOMP, "print", fname); 160 PATH_FSEC_PRINT, fname);
132 } 161 }
133 162
163 // save the file name in seccomp list
164 if (!load_file_list_flag)
165 seccomp_save_file_list(fname);
166
134 return 0; 167 return 0;
135errexit: 168errexit:
136 fprintf(stderr, "Error: cannot read %s\n", fname); 169 fprintf(stderr, "Error: cannot read %s\n", fname);
@@ -138,6 +171,7 @@ errexit:
138} 171}
139 172
140// 32 bit arch filter installed on 64 bit architectures 173// 32 bit arch filter installed on 64 bit architectures
174#if defined(__x86_64__)
141#if defined(__LP64__) 175#if defined(__LP64__)
142static void seccomp_filter_32(void) { 176static void seccomp_filter_32(void) {
143 if (seccomp_load(RUN_SECCOMP_32) == 0) { 177 if (seccomp_load(RUN_SECCOMP_32) == 0) {
@@ -146,15 +180,6 @@ static void seccomp_filter_32(void) {
146 } 180 }
147} 181}
148#endif 182#endif
149
150// 64 bit arch filter installed on 32 bit architectures
151#if defined(__ILP32__)
152static void seccomp_filter_64(void) {
153 if (seccomp_load(RUN_SECCOMP_64) == 0) {
154 if (arg_debug)
155 printf("Dual 32/64 bit seccomp filter configured\n");
156 }
157}
158#endif 183#endif
159 184
160static void seccomp_filter_block_secondary(void) { 185static void seccomp_filter_block_secondary(void) {
@@ -165,49 +190,98 @@ static void seccomp_filter_block_secondary(void) {
165} 190}
166 191
167// drop filter for seccomp option 192// drop filter for seccomp option
168int seccomp_filter_drop(void) { 193int seccomp_filter_drop(bool native) {
194 const char *filter, *postexec_filter;
195
196 if (native) {
197 filter = RUN_SECCOMP_CFG;
198 postexec_filter = RUN_SECCOMP_POSTEXEC;
199 } else {
200 filter = RUN_SECCOMP_32;
201 postexec_filter = RUN_SECCOMP_POSTEXEC_32;
202 }
203
169 // if we have multiple seccomp commands, only one of them is executed 204 // if we have multiple seccomp commands, only one of them is executed
170 // in the following order: 205 // in the following order:
171 // - seccomp.drop list 206 // - seccomp.drop list
172 // - seccomp list 207 // - seccomp list
173 // - seccomp 208 // - seccomp
174 if (cfg.seccomp_list_drop == NULL) { 209 if (cfg.seccomp_list_drop == NULL) {
175 // default seccomp 210 // default seccomp if error action is not changed
176 if (cfg.seccomp_list == NULL) { 211 if ((cfg.seccomp_list == NULL || cfg.seccomp_list[0] == '\0')
212 && arg_seccomp_error_action == DEFAULT_SECCOMP_ERROR_ACTION) {
177 if (arg_seccomp_block_secondary) 213 if (arg_seccomp_block_secondary)
178 seccomp_filter_block_secondary(); 214 seccomp_filter_block_secondary();
179 else { 215 else {
216#if defined(__x86_64__)
180#if defined(__LP64__) 217#if defined(__LP64__)
181 seccomp_filter_32(); 218 seccomp_filter_32();
182#endif 219#endif
183#if defined(__ILP32__)
184 seccomp_filter_64();
185#endif 220#endif
186 } 221 }
187 } 222 }
188 // default seccomp filter with additional drop list 223 // default seccomp filter with additional drop list
189 else { // cfg.seccomp_list != NULL 224 else { // cfg.seccomp_list != NULL
190 if (arg_seccomp_block_secondary) 225 int rv;
226
227 if (arg_seccomp_block_secondary) {
228 if (arg_seccomp_error_action != DEFAULT_SECCOMP_ERROR_ACTION) {
229 if (arg_debug)
230 printf("Rebuild secondary block seccomp filter\n");
231 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 4,
232 PATH_FSECCOMP, "secondary", "block", RUN_SECCOMP_BLOCK_SECONDARY);
233 if (rv)
234 exit(rv);
235 }
191 seccomp_filter_block_secondary(); 236 seccomp_filter_block_secondary();
192 else { 237 } else {
238#if defined(__x86_64__)
193#if defined(__LP64__) 239#if defined(__LP64__)
240 if (arg_seccomp_error_action != DEFAULT_SECCOMP_ERROR_ACTION) {
241 if (arg_debug)
242 printf("Rebuild 32 bit seccomp filter\n");
243 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 4,
244 PATH_FSECCOMP, "secondary", "32", RUN_SECCOMP_32);
245 if (rv)
246 exit(rv);
247 }
194 seccomp_filter_32(); 248 seccomp_filter_32();
195#endif 249#endif
196#if defined(__ILP32__)
197 seccomp_filter_64();
198#endif 250#endif
199 } 251 }
200 if (arg_debug) 252 if (arg_debug)
201 printf("Build default+drop seccomp filter\n"); 253 printf("Build default+drop seccomp filter\n");
202 254
255 const char *command, *list;
256 if (native) {
257 command = "default";
258 list = cfg.seccomp_list;
259 } else {
260 command = "default32";
261 list = cfg.seccomp_list32;
262 }
263
203 // build the seccomp filter as a regular user 264 // build the seccomp filter as a regular user
204 int rv; 265 if (list && list[0])
205 if (arg_allow_debuggers) 266 if (arg_allow_debuggers)
206 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 7, 267 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 7,
207 PATH_FSECCOMP, "default", "drop", RUN_SECCOMP_CFG, RUN_SECCOMP_POSTEXEC, cfg.seccomp_list, "allow-debuggers"); 268 PATH_FSECCOMP, command, "drop", filter, postexec_filter, list, "allow-debuggers");
269 else
270 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 6,
271 PATH_FSECCOMP, command, "drop", filter, postexec_filter, list);
208 else 272 else
209 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 6, 273 if (arg_allow_debuggers)
210 PATH_FSECCOMP, "default", "drop", RUN_SECCOMP_CFG, RUN_SECCOMP_POSTEXEC, cfg.seccomp_list); 274 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 4,
275 PATH_FSECCOMP, command, filter, "allow-debuggers");
276 else
277 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3,
278 PATH_FSECCOMP, command, filter);
279
280 if (rv)
281 exit(rv);
282
283 // optimize the new filter
284 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSEC_OPTIMIZE, filter);
211 if (rv) 285 if (rv)
212 exit(rv); 286 exit(rv);
213 } 287 }
@@ -221,31 +295,45 @@ int seccomp_filter_drop(void) {
221 if (arg_debug) 295 if (arg_debug)
222 printf("Build drop seccomp filter\n"); 296 printf("Build drop seccomp filter\n");
223 297
298 const char *command, *list;
299 if (native) {
300 command = "drop";
301 list = cfg.seccomp_list_drop;
302 } else {
303 command = "drop32";
304 list = cfg.seccomp_list_drop32;
305 }
306
224 // build the seccomp filter as a regular user 307 // build the seccomp filter as a regular user
225 int rv; 308 int rv;
226 if (arg_allow_debuggers) 309 if (arg_allow_debuggers)
227 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 6, 310 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 6,
228 PATH_FSECCOMP, "drop", RUN_SECCOMP_CFG, RUN_SECCOMP_POSTEXEC, cfg.seccomp_list_drop, "allow-debuggers"); 311 PATH_FSECCOMP, command, filter, postexec_filter, list, "allow-debuggers");
229 else 312 else
230 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 5, 313 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 5,
231 PATH_FSECCOMP, "drop", RUN_SECCOMP_CFG, RUN_SECCOMP_POSTEXEC, cfg.seccomp_list_drop); 314 PATH_FSECCOMP, command, filter, postexec_filter, list);
232 315
233 if (rv) 316 if (rv)
234 exit(rv); 317 exit(rv);
318
319 // optimize the drop filter
320 rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2, PATH_FSEC_OPTIMIZE, filter);
321 if (rv)
322 exit(rv);
235 } 323 }
236 324
237 // load the filter 325 // load the filter
238 if (seccomp_load(RUN_SECCOMP_CFG) == 0) { 326 if (seccomp_load(filter) == 0) {
239 if (arg_debug) 327 if (arg_debug)
240 printf("seccomp filter configured\n"); 328 printf("seccomp filter configured\n");
241 } 329 }
242 330
243 if (arg_debug && access(PATH_FSECCOMP, X_OK) == 0) { 331 if (arg_debug && access(PATH_FSEC_PRINT, X_OK) == 0) {
244 struct stat st; 332 struct stat st;
245 if (stat(RUN_SECCOMP_POSTEXEC, &st) != -1 && st.st_size != 0) { 333 if (stat(postexec_filter, &st) != -1 && st.st_size != 0) {
246 printf("configuring postexec seccomp filter in %s\n", RUN_SECCOMP_POSTEXEC); 334 printf("configuring postexec seccomp filter in %s\n", postexec_filter);
247 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3, 335 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2,
248 PATH_FSECCOMP, "print", RUN_SECCOMP_POSTEXEC); 336 PATH_FSEC_PRINT, postexec_filter);
249 } 337 }
250 } 338 }
251 339
@@ -253,7 +341,7 @@ int seccomp_filter_drop(void) {
253} 341}
254 342
255// keep filter for seccomp option 343// keep filter for seccomp option
256int seccomp_filter_keep(void) { 344int seccomp_filter_keep(bool native) {
257 // secondary filters are not installed except when secondary 345 // secondary filters are not installed except when secondary
258 // architectures are explicitly blocked 346 // architectures are explicitly blocked
259 if (arg_seccomp_block_secondary) 347 if (arg_seccomp_block_secondary)
@@ -262,9 +350,20 @@ int seccomp_filter_keep(void) {
262 if (arg_debug) 350 if (arg_debug)
263 printf("Build keep seccomp filter\n"); 351 printf("Build keep seccomp filter\n");
264 352
353 const char *filter, *postexec_filter, *list;
354 if (native) {
355 filter = RUN_SECCOMP_CFG;
356 postexec_filter = RUN_SECCOMP_POSTEXEC;
357 list = cfg.seccomp_list_keep;
358 } else {
359 filter = RUN_SECCOMP_32;
360 postexec_filter = RUN_SECCOMP_POSTEXEC_32;
361 list = cfg.seccomp_list_keep32;
362 }
363
265 // build the seccomp filter as a regular user 364 // build the seccomp filter as a regular user
266 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 5, 365 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 5,
267 PATH_FSECCOMP, "keep", RUN_SECCOMP_CFG, RUN_SECCOMP_POSTEXEC, cfg.seccomp_list_keep); 366 PATH_FSECCOMP, "keep", filter, postexec_filter, list);
268 367
269 if (rv) { 368 if (rv) {
270 fprintf(stderr, "Error: cannot configure seccomp filter\n"); 369 fprintf(stderr, "Error: cannot configure seccomp filter\n");
@@ -275,67 +374,98 @@ int seccomp_filter_keep(void) {
275 printf("seccomp filter configured\n"); 374 printf("seccomp filter configured\n");
276 375
277 // load the filter 376 // load the filter
278 if (seccomp_load(RUN_SECCOMP_CFG) == 0) { 377 if (seccomp_load(filter) == 0) {
279 if (arg_debug) 378 if (arg_debug)
280 printf("seccomp filter configured\n"); 379 printf("seccomp filter configured\n");
281 } 380 }
282 381
283 if (arg_debug && access(PATH_FSECCOMP, X_OK) == 0) { 382 if (arg_debug && access(PATH_FSEC_PRINT, X_OK) == 0) {
284 struct stat st; 383 struct stat st;
285 if (stat(RUN_SECCOMP_POSTEXEC, &st) != -1 && st.st_size != 0) { 384 if (stat(postexec_filter, &st) != -1 && st.st_size != 0) {
286 printf("configuring postexec seccomp filter in %s\n", RUN_SECCOMP_POSTEXEC); 385 printf("configuring postexec seccomp filter in %s\n", postexec_filter);
287 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3, 386 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 2,
288 PATH_FSECCOMP, "print", RUN_SECCOMP_POSTEXEC); 387 PATH_FSEC_PRINT, postexec_filter);
289 } 388 }
290 } 389 }
291 390
292 return 0; 391 return 0;
293} 392}
294 393
394// create mdwx filter for non-default error action
395int seccomp_filter_mdwx(bool native) {
396 if (arg_debug)
397 printf("Build memory-deny-write-execute filter\n");
398
399 const char *command, *filter;
400 if (native) {
401 command = "memory-deny-write-execute";
402 filter = RUN_SECCOMP_MDWX;
403 } else {
404 command = "memory-deny-write-execute.32";
405 filter = RUN_SECCOMP_MDWX_32;
406 }
407
408 // build the seccomp filter as a regular user
409 int rv = sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 3,
410 PATH_FSECCOMP, command, filter);
411
412 if (rv) {
413 fprintf(stderr, "Error: cannot build memory-deny-write-execute filter\n");
414 exit(rv);
415 }
416
417 if (arg_debug)
418 printf("Memory-deny-write-execute filter configured\n");
419
420 return 0;
421}
422
295void seccomp_print_filter(pid_t pid) { 423void seccomp_print_filter(pid_t pid) {
296 EUID_ASSERT(); 424 EUID_ASSERT();
297 425
298 // if the pid is that of a firejail process, use the pid of the first child process 426 // in case the pid is that of a firejail process, use the pid of the first child process
299 EUID_ROOT(); 427 pid = switch_to_child(pid);
300 char *comm = pid_proc_comm(pid);
301 EUID_USER();
302 if (comm) {
303 if (strcmp(comm, "firejail") == 0) {
304 pid_t child;
305 if (find_child(pid, &child) == 0) {
306 pid = child;
307 }
308 }
309 free(comm);
310 }
311 428
312 // check privileges for non-root users 429 // exit if no permission to join the sandbox
313 uid_t uid = getuid(); 430 check_join_permission(pid);
314 if (uid != 0) {
315 uid_t sandbox_uid = pid_get_uid(pid);
316 if (uid != sandbox_uid) {
317 fprintf(stderr, "Error: permission denied.\n");
318 exit(1);
319 }
320 }
321 431
322 // find the seccomp filter 432 // find the seccomp list file
323 EUID_ROOT(); 433 EUID_ROOT();
324 char *fname; 434 char *fname;
325 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_SECCOMP_CFG) == -1) 435 if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_SECCOMP_LIST) == -1)
326 errExit("asprintf"); 436 errExit("asprintf");
327 437
328 struct stat s; 438 struct stat s;
329 if (stat(fname, &s) == -1) { 439 if (stat(fname, &s) == -1)
330 printf("Cannot access seccomp filter.\n"); 440 goto errexit;
331 exit(1);
332 }
333 441
334 // read and print the filter - run this as root, the user doesn't have access 442 FILE *fp = fopen(fname, "re");
335 sbox_run(SBOX_ROOT | SBOX_SECCOMP, 3, PATH_FSECCOMP, "print", fname); 443 if (!fp)
444 goto errexit;
336 free(fname); 445 free(fname);
337 446
447 char buf[MAXBUF];
448 while (fgets(buf, MAXBUF, fp)) {
449 // clean '\n'
450 char *ptr = strchr(buf, '\n');
451 if (ptr)
452 *ptr = '\0';
453
454 if (asprintf(&fname, "/proc/%d/root%s", pid, buf) == -1)
455 errExit("asprintf");
456 printf("FILE: %s\n", fname); fflush(0);
457
458 // read and print the filter - run this as root, the user doesn't have access
459 sbox_run(SBOX_ROOT | SBOX_SECCOMP, 2, PATH_FSEC_PRINT, fname);
460 fflush(0);
461
462 printf("\n"); fflush(0);
463 free(fname);
464 }
465 fclose(fp);
338 exit(0); 466 exit(0);
339}
340 467
341#endif // HAVE_SECCOMP 468errexit:
469 printf("Cannot access seccomp filter.\n");
470 exit(1);
471}
diff --git a/src/firejail/selinux.c b/src/firejail/selinux.c
new file mode 100644
index 000000000..6969e7a3d
--- /dev/null
+++ b/src/firejail/selinux.c
@@ -0,0 +1,80 @@
1/*
2 * Copyright (C) 2020-2021 Firejail and systemd authors
3 *
4 * This file is part of firejail project, from systemd selinux-util.c
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#if HAVE_SELINUX
21#include "firejail.h"
22#include <sys/types.h>
23#include <sys/stat.h>
24
25#include <fcntl.h>
26#ifndef O_PATH
27#define O_PATH 010000000
28#endif
29
30#include <selinux/context.h>
31#include <selinux/label.h>
32#include <selinux/selinux.h>
33
34static struct selabel_handle *label_hnd = NULL;
35static int selinux_enabled = -1;
36#endif
37
38void selinux_relabel_path(const char *path, const char *inside_path)
39{
40#if HAVE_SELINUX
41 char procfs_path[64];
42 char *fcon = NULL;
43 int fd;
44 struct stat st;
45
46 if (selinux_enabled == -1)
47 selinux_enabled = is_selinux_enabled();
48
49 if (!selinux_enabled)
50 return;
51
52 if (!label_hnd)
53 label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
54
55 if (!label_hnd)
56 errExit("selabel_open");
57
58 /* Open the file as O_PATH, to pin it while we determine and adjust the label
59 * Defeat symlink races by not allowing symbolic links */
60 fd = safer_openat(-1, path, O_NOFOLLOW|O_CLOEXEC|O_PATH);
61 if (fd < 0)
62 return;
63 if (fstat(fd, &st) < 0)
64 goto close;
65
66 if (selabel_lookup_raw(label_hnd, &fcon, inside_path, st.st_mode) == 0) {
67 sprintf(procfs_path, "/proc/self/fd/%i", fd);
68 if (arg_debug)
69 printf("Relabeling %s as %s (%s)\n", path, inside_path, fcon);
70
71 setfilecon_raw(procfs_path, fcon);
72 }
73 freecon(fcon);
74 close:
75 close(fd);
76#else
77 (void) path;
78 (void) inside_path;
79#endif
80}
diff --git a/src/firejail/shutdown.c b/src/firejail/shutdown.c
index f187960d5..d1be6eed4 100644
--- a/src/firejail/shutdown.c
+++ b/src/firejail/shutdown.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -26,27 +26,20 @@
26void shut(pid_t pid) { 26void shut(pid_t pid) {
27 EUID_ASSERT(); 27 EUID_ASSERT();
28 28
29 pid_t parent = pid;
30 // if the pid is that of a firejail process, use the pid of a child process inside the sandbox
31 EUID_ROOT(); 29 EUID_ROOT();
32 char *comm = pid_proc_comm(pid); 30 char *comm = pid_proc_comm(pid);
33 EUID_USER(); 31 EUID_USER();
34 if (comm) { 32 if (comm) {
35 if (strcmp(comm, "firejail") == 0) { 33 if (strcmp(comm, "firejail") != 0) {
36 pid_t child;
37 if (find_child(pid, &child) == 0) {
38 pid = child;
39 printf("Switching to pid %u, the first child process inside the sandbox\n", (unsigned) pid);
40 }
41 }
42 else {
43 fprintf(stderr, "Error: this is not a firejail sandbox\n"); 34 fprintf(stderr, "Error: this is not a firejail sandbox\n");
44 exit(1); 35 exit(1);
45 } 36 }
46 free(comm); 37 free(comm);
47 } 38 }
48 else 39 else {
49 errExit("/proc/PID/comm"); 40 fprintf(stderr, "Error: cannot find process %d\n", pid);
41 exit(1);
42 }
50 43
51 // check privileges for non-root users 44 // check privileges for non-root users
52 uid_t uid = getuid(); 45 uid_t uid = getuid();
@@ -58,20 +51,23 @@ void shut(pid_t pid) {
58 } 51 }
59 } 52 }
60 53
61 EUID_ROOT();
62 printf("Sending SIGTERM to %u\n", pid); 54 printf("Sending SIGTERM to %u\n", pid);
63 kill(pid, SIGTERM); 55 kill(pid, SIGTERM);
64 56
65 // wait for not more than 10 seconds 57 // wait for not more than 11 seconds
66 sleep(2); 58 int monsec = 11;
67 int monsec = 8;
68 char *monfile; 59 char *monfile;
69 if (asprintf(&monfile, "/proc/%d/cmdline", pid) == -1) 60 if (asprintf(&monfile, "/proc/%d/cmdline", pid) == -1)
70 errExit("asprintf"); 61 errExit("asprintf");
71 int killdone = 0; 62 int killdone = 0;
72 63
73 while (monsec) { 64 while (monsec) {
74 FILE *fp = fopen(monfile, "r"); 65 sleep(1);
66 monsec--;
67
68 EUID_ROOT();
69 FILE *fp = fopen(monfile, "re");
70 EUID_USER();
75 if (!fp) { 71 if (!fp) {
76 killdone = 1; 72 killdone = 1;
77 break; 73 break;
@@ -85,23 +81,22 @@ void shut(pid_t pid) {
85 killdone = 1; 81 killdone = 1;
86 break; 82 break;
87 } 83 }
88
89 sleep(1);
90 monsec--;
91 } 84 }
92 free(monfile); 85 free(monfile);
93 86
94 87
95 // force SIGKILL 88 // force SIGKILL
96 if (!killdone) { 89 if (!killdone) {
97 // kill the process and also the parent 90 // kill the process and its child
91 pid_t child;
92 if (find_child(pid, &child) == 0) {
93 printf("Sending SIGKILL to %u\n", child);
94 kill(child, SIGKILL);
95 }
98 printf("Sending SIGKILL to %u\n", pid); 96 printf("Sending SIGKILL to %u\n", pid);
99 kill(pid, SIGKILL); 97 kill(pid, SIGKILL);
100 if (parent != pid) {
101 printf("Sending SIGKILL to %u\n", parent);
102 kill(parent, SIGKILL);
103 }
104 } 98 }
105 99
106 clear_run_files(parent); 100 EUID_ROOT();
101 delete_run_files(pid);
107} 102}
diff --git a/src/firejail/usage.c b/src/firejail/usage.c
index 28b5cc8a4..43f862b9d 100644
--- a/src/firejail/usage.c
+++ b/src/firejail/usage.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,230 +19,280 @@
19*/ 19*/
20#include "firejail.h" 20#include "firejail.h"
21 21
22void usage(void) { 22static char *usage_str =
23 printf("firejail - version %s\n\n", VERSION); 23 "Firejail is a SUID sandbox program that reduces the risk of security breaches by\n"
24 printf("Firejail is a SUID sandbox program that reduces the risk of security breaches by\n"); 24 "restricting the running environment of untrusted applications using Linux\n"
25 printf("restricting the running environment of untrusted applications using Linux\n"); 25 "namespaces.\n"
26 printf("namespaces.\n"); 26 "\n"
27 printf("\n"); 27 "Usage: firejail [options] [program and arguments]\n"
28 printf("Usage: firejail [options] [program and arguments]\n"); 28 "\n"
29 printf("\n"); 29 "Options:\n"
30 printf("Options:\n"); 30 " -- - signal the end of options and disables further option processing.\n"
31 printf(" -- - signal the end of options and disables further option processing.\n"); 31 " --allow-debuggers - allow tools such as strace and gdb inside the sandbox.\n"
32 printf(" --allow-debuggers - allow tools such as strace and gdb inside the sandbox.\n"); 32 " --allusers - all user home directories are visible inside the sandbox.\n"
33 printf(" --allow-private-blacklist - allow blacklisting files in private\n"); 33 " --apparmor - enable AppArmor confinement.\n"
34 printf("\thome directories.\n"); 34 " --apparmor.print=name|pid - print apparmor status.\n"
35 printf(" --allusers - all user home directories are visible inside the sandbox.\n"); 35 " --appimage - sandbox an AppImage application.\n"
36 printf(" --apparmor - enable AppArmor confinement.\n");
37 printf(" --appimage - sandbox an AppImage application.\n");
38 printf(" --audit[=test-program] - audit the sandbox.\n");
39#ifdef HAVE_NETWORK 36#ifdef HAVE_NETWORK
40 printf(" --bandwidth=name|pid - set bandwidth limits.\n"); 37 " --bandwidth=name|pid - set bandwidth limits.\n"
41#endif 38#endif
42#ifdef HAVE_BIND 39 " --bind=dirname1,dirname2 - mount-bind dirname1 on top of dirname2.\n"
43 printf(" --bind=dirname1,dirname2 - mount-bind dirname1 on top of dirname2.\n"); 40 " --bind=filename1,filename2 - mount-bind filename1 on top of filename2.\n"
44 printf(" --bind=filename1,filename2 - mount-bind filename1 on top of filename2.\n"); 41 " --blacklist=filename - blacklist directory or file.\n"
45#endif 42 " --build - build a whitelisted profile for the application.\n"
46 printf(" --blacklist=filename - blacklist directory or file.\n"); 43 " --build=filename - build a whitelisted profile for the application.\n"
47 printf(" --build - build a whitelisted profile for the application.\n"); 44 " --caps - enable default Linux capabilities filter.\n"
48 printf(" -c - execute command and exit.\n"); 45 " --caps.drop=all - drop all capabilities.\n"
49 printf(" --caps - enable default Linux capabilities filter.\n"); 46 " --caps.drop=capability,capability - blacklist capabilities filter.\n"
50 printf(" --caps.drop=all - drop all capabilities.\n"); 47 " --caps.keep=capability,capability - whitelist capabilities filter.\n"
51 printf(" --caps.drop=capability,capability - blacklist capabilities filter.\n"); 48 " --caps.print=name|pid - print the caps filter.\n"
52 printf(" --caps.keep=capability,capability - whitelist capabilities filter.\n"); 49#ifdef HAVE_FILE_TRANSFER
53 printf(" --caps.print=name|pid - print the caps filter.\n"); 50 " --cat=name|pid filename - print content of file from sandbox container.\n"
54 printf(" --cgroup=tasks-file - place the sandbox in the specified control group.\n"); 51#endif
52 " --cgroup=tasks-file - place the sandbox in the specified control group.\n"
55#ifdef HAVE_CHROOT 53#ifdef HAVE_CHROOT
56 printf(" --chroot=dirname - chroot into directory.\n"); 54 " --chroot=dirname - chroot into directory.\n"
57#endif
58 printf(" --cpu=cpu-number,cpu-number - set cpu affinity.\n");
59 printf(" --cpu.print=name|pid - print the cpus in use.\n");
60 printf(" --csh - use /bin/csh as default shell.\n");
61 printf(" --debug - print sandbox debug messages.\n");
62 printf(" --debug-blacklists - debug blacklisting.\n");
63 printf(" --debug-caps - print all recognized capabilities.\n");
64 printf(" --debug-check-filename - debug filename checking.\n");
65 printf(" --debug-errnos - print all recognized error numbers.\n");
66 printf(" --debug-protocols - print all recognized protocols.\n");
67 printf(" --debug-syscalls - print all recognized system calls.\n");
68#ifdef HAVE_WHITELIST
69 printf(" --debug-whitelists - debug whitelisting.\n");
70#endif 55#endif
71#ifdef HAVE_NETWORK 56 " --cpu=cpu-number,cpu-number - set cpu affinity.\n"
72 printf(" --defaultgw=address - configure default gateway.\n"); 57 " --cpu.print=name|pid - print the cpus in use.\n"
58#ifdef HAVE_DBUSPROXY
59 " --dbus-log=file - set DBus log file location.\n"
60 " --dbus-system=filter|none - set system DBus access policy.\n"
61 " --dbus-system.broadcast=rule - allow signals on the system DBus according\n"
62 "\tto rule.\n"
63 " --dbus-system.call=rule - allow calls on the system DBus according to rule.\n"
64 " --dbus-system.log - turn on logging for the system DBus.\n"
65 " --dbus-system.own=name - allow ownership of name on the system DBus.\n"
66 " --dbus-system.see=name - allow seeing name on the system DBus.\n"
67 " --dbus-system.talk=name - allow talking to name on the system DBus.\n"
68 " --dbus-user=filter|none - set session DBus access policy.\n"
69 " --dbus-user.broadcast=rule - allow signals on the session DBus according\n"
70 "\tto rule.\n"
71 " --dbus-user.call=rule - allow calls on the session DBus according to rule.\n"
72 " --dbus-user.log - turn on logging for the user DBus.\n"
73 " --dbus-user.own=name - allow ownership of name on the session DBus.\n"
74 " --dbus-user.see=name - allow seeing name on the session DBus.\n"
75 " --dbus-user.talk=name - allow talking to name on the session DBus.\n"
73#endif 76#endif
74 printf(" --dns=address - set DNS server.\n"); 77 " --debug - print sandbox debug messages.\n"
75 printf(" --dns.print=name|pid - print DNS configuration.\n"); 78 " --debug-blacklists - debug blacklisting.\n"
76 79 " --debug-caps - print all recognized capabilities.\n"
77 printf(" --env=name=value - set environment variable.\n"); 80 " --debug-errnos - print all recognized error numbers.\n"
78 printf(" --force - attempt to start a new sandbox inside the existing sandbox.\n"); 81 " --debug-private-lib - debug for --private-lib option.\n"
79 printf(" --fs.print=name|pid - print the filesystem log.\n"); 82 " --debug-protocols - print all recognized protocols.\n"
80 printf(" --get=name|pid filename - get a file from sandbox container.\n"); 83 " --debug-syscalls - print all recognized system calls.\n"
81#ifdef HAVE_GIT_INSTALL 84 " --debug-syscalls32 - print all recognized 32 bit system calls.\n"
82 printf(" --git-install - download, compile and install mainline git version\n"); 85 " --debug-whitelists - debug whitelisting.\n"
83 printf("\tof Firejail.\n");
84 printf(" --git-uninstall - uninstall mainline git version of Firejail\n");
85#endif
86 printf(" --help, -? - this help screen.\n");
87 printf(" --hostname=name - set sandbox hostname.\n");
88 printf(" --hosts-file=file - use file as /etc/hosts.\n");
89 printf(" --ignore=command - ignore command in profile files.\n");
90#ifdef HAVE_NETWORK 86#ifdef HAVE_NETWORK
91 printf(" --interface=name - move interface in sandbox.\n"); 87 " --defaultgw=address - configure default gateway.\n"
92 printf(" --ip=address - set interface IP address.\n"); 88#endif
93 printf(" --ip=none - no IP address and no default gateway are configured.\n"); 89 " --deterministic-exit-code - always exit with first child's status code.\n"
94 printf(" --ip6=address - set interface IPv6 address.\n"); 90 " --dns=address - set DNS server.\n"
95 printf(" --iprange=address,address - configure an IP address in this range.\n"); 91 " --dns.print=name|pid - print DNS configuration.\n"
96#endif 92 " --env=name=value - set environment variable.\n"
97 printf(" --ipc-namespace - enable a new IPC namespace.\n"); 93 " --fs.print=name|pid - print the filesystem log.\n"
98 printf(" --join=name|pid - join the sandbox.\n"); 94#ifdef HAVE_FILE_TRANSFER
99 printf(" --join-filesystem=name|pid - join the mount namespace.\n"); 95 " --get=name|pid filename - get a file from sandbox container.\n"
96#endif
97 " --help, -? - this help screen.\n"
98 " --hostname=name - set sandbox hostname.\n"
99 " --hosts-file=file - use file as /etc/hosts.\n"
100 " --ids-check - verify file system.\n"
101 " --ids-init - initialize IDS database.\n"
102 " --ignore=command - ignore command in profile files.\n"
100#ifdef HAVE_NETWORK 103#ifdef HAVE_NETWORK
101 printf(" --join-network=name|pid - join the network namespace.\n"); 104 " --interface=name - move interface in sandbox.\n"
105 " --ip=address - set interface IP address.\n"
106 " --ip=none - no IP address and no default gateway are configured.\n"
107 " --ip=dhcp - acquire IP address by running dhclient.\n"
108 " --ip6=address - set interface IPv6 address.\n"
109 " --ip6=dhcp - acquire IPv6 address by running dhclient.\n"
110 " --iprange=address,address - configure an IP address in this range.\n"
102#endif 111#endif
103 printf(" --join-or-start=name|pid - join the sandbox or start a new one.\n"); 112 " --ipc-namespace - enable a new IPC namespace.\n"
104 printf(" --list - list all sandboxes.\n"); 113 " --join=name|pid - join the sandbox.\n"
105 printf(" --ls=name|pid dir_or_filename - list files in sandbox container.\n"); 114 " --join-filesystem=name|pid - join the mount namespace.\n"
106#ifdef HAVE_NETWORK 115#ifdef HAVE_NETWORK
107 printf(" --mac=xx:xx:xx:xx:xx:xx - set interface MAC address.\n"); 116 " --join-network=name|pid - join the network namespace.\n"
108#endif 117#endif
109 printf(" --machine-id - preserve /etc/machine-id\n"); 118 " --join-or-start=name|pid - join the sandbox or start a new one.\n"
110#ifdef HAVE_SECCOMP 119 " --keep-config-pulse - disable automatic ~/.config/pulse init.\n"
111 printf(" --memory-deny-write-execute - seccomp filter to block attempts to create\n"); 120 " --keep-dev-shm - /dev/shm directory is untouched (even with --private-dev).\n"
112 printf("\tmemory mappings that are both writable and executable.\n"); 121 " --keep-var-tmp - /var/tmp directory is untouched.\n"
122 " --list - list all sandboxes.\n"
123#ifdef HAVE_FILE_TRANSFER
124 " --ls=name|pid dir_or_filename - list files in sandbox container.\n"
113#endif 125#endif
114#ifdef HAVE_NETWORK 126#ifdef HAVE_NETWORK
115 printf(" --mtu=number - set interface MTU.\n"); 127 " --mac=xx:xx:xx:xx:xx:xx - set interface MAC address.\n"
116#endif 128#endif
117 printf(" --name=name - set sandbox name.\n"); 129 " --machine-id - preserve /etc/machine-id\n"
130 " --memory-deny-write-execute - seccomp filter to block attempts to create\n"
131 "\tmemory mappings that are both writable and executable.\n"
132 " --mkdir=dirname - create a directory.\n"
133 " --mkfile=filename - create a file.\n"
118#ifdef HAVE_NETWORK 134#ifdef HAVE_NETWORK
119 printf(" --net=bridgename - enable network namespaces and connect to this bridge.\n"); 135 " --mtu=number - set interface MTU.\n"
120 printf(" --net=ethernet_interface - enable network namespaces and connect to this\n"); 136#endif
121 printf("\tEthernet interface.\n"); 137 " --name=name - set sandbox name.\n"
122 printf(" --net=none - enable a new, unconnected network namespace.\n");
123 printf(" --netfilter[=filename] - enable the default client network filter.\n");
124 printf(" --netfilter6=filename - enable the IPv6 network filter.\n");
125 printf(" --netns=name - Run the program in a named, persistent network namespace.\n");
126 printf(" --netstats - monitor network statistics.\n");
127#endif
128 printf(" --nice=value - set nice value.\n");
129 printf(" --no3d - disable 3D hardware acceleration.\n");
130 printf(" --noblacklist=filename - disable blacklist for file or directory .\n");
131 printf(" --noexec=filename - remount the file or directory noexec nosuid and nodev.\n");
132 printf(" --nogroups - disable supplementary groups.\n");
133 printf(" --nonewprivs - sets the NO_NEW_PRIVS prctl.\n");
134 printf(" --noprofile - do not use a security profile.\n");
135#ifdef HAVE_USERNS
136 printf(" --noroot - install a user namespace with only the current user.\n");
137#endif
138 printf(" --nosound - disable sound system.\n");
139 printf(" --novideo - disable video devices.\n");
140 printf(" --nowhitelist=filename - disable whitelist for file or directory .\n");
141 printf(" --output=logfile - stdout logging and log rotation.\n");
142 printf(" --output-stderr=logfile - stdout and stderr logging and log rotation.\n");
143 printf(" --overlay - mount a filesystem overlay on top of the current filesystem.\n");
144 printf(" --overlay-named=name - mount a filesystem overlay on top of the current\n");
145 printf("\tfilesystem, and store it in name directory.\n");
146 printf(" --overlay-tmpfs - mount a temporary filesystem overlay on top of the\n");
147 printf("\tcurrent filesystem.\n");
148 printf(" --overlay-clean - clean all overlays stored in $HOME/.firejail directory.\n");
149 printf(" --private - temporary home directory.\n");
150 printf(" --private=directory - use directory as user home.\n");
151 printf(" --private-home=file,directory - build a new user home in a temporary\n");
152 printf("\tfilesystem, and copy the files and directories in the list in\n");
153 printf("\tthe new home.\n");
154 printf(" --private-bin=file,file - build a new /bin in a temporary filesystem,\n");
155 printf("\tand copy the programs in the list.\n");
156 printf(" --private-dev - create a new /dev directory with a small number of\n");
157 printf("\tcommon device files.\n");
158 printf(" --private-etc=file,directory - build a new /etc in a temporary\n");
159 printf("\tfilesystem, and copy the files and directories in the list.\n");
160 printf(" --private-tmp - mount a tmpfs on top of /tmp directory.\n");
161 printf(" --private-opt=file,directory - build a new /opt in a temporary filesystem.\n");
162 printf(" --profile=filename - use a custom profile.\n");
163 printf(" --profile.print=name|pid - print the name of profile file.\n");
164 printf(" --profile-path=directory - use this directory to look for profile files.\n");
165 printf(" --protocol=protocol,protocol,protocol - enable protocol filter.\n");
166 printf(" --protocol.print=name|pid - print the protocol filter.\n");
167 printf(" --put=name|pid src-filename dest-filename - put a file in sandbox\n");
168 printf("\tcontainer.\n");
169 printf(" --quiet - turn off Firejail's output.\n");
170 printf(" --read-only=filename - set directory or file read-only..\n");
171 printf(" --read-write=filename - set directory or file read-write.\n");
172 printf(" --rlimit-fsize=number - set the maximum file size that can be created\n");
173 printf("\tby a process.\n");
174 printf(" --rlimit-nofile=number - set the maximum number of files that can be\n");
175 printf("\topened by a process.\n");
176 printf(" --rlimit-nproc=number - set the maximum number of processes that can be\n");
177 printf("\tcreated for the real user ID of the calling process.\n");
178 printf(" --rlimit-sigpending=number - set the maximum number of pending signals\n");
179 printf("\tfor a process.\n");
180 printf(" --rmenv=name - remove environment variable in the new sandbox.\n");
181#ifdef HAVE_NETWORK 138#ifdef HAVE_NETWORK
182 printf(" --scan - ARP-scan all the networks from inside a network namespace.\n"); 139 " --net=bridgename - enable network namespaces and connect to this bridge.\n"
183#endif 140 " --net=ethernet_interface - enable network namespaces and connect to this\n"
184#ifdef HAVE_SECCOMP 141 "\tEthernet interface.\n"
185 printf(" --seccomp - enable seccomp filter and apply the default blacklist.\n"); 142 " --net=none - enable a new, unconnected network namespace.\n"
186 printf(" --seccomp=syscall,syscall,syscall - enable seccomp filter, blacklist the\n"); 143 " --net.print=name|pid - print network interface configuration.\n"
187 printf("\tdefault syscall list and the syscalls specified by the command.\n"); 144 " --netfilter[=filename,arg1,arg2,arg3 ...] - enable firewall.\n"
188 printf(" --seccomp.block-secondary - build only the native architecture filters.\n"); 145 " --netfilter.print=name|pid - print the firewall.\n"
189 printf(" --seccomp.drop=syscall,syscall,syscall - enable seccomp filter, and\n"); 146 " --netfilter6=filename - enable IPv6 firewall.\n"
190 printf("\tblacklist the syscalls specified by the command.\n"); 147 " --netfilter6.print=name|pid - print the IPv6 firewall.\n"
191 printf(" --seccomp.keep=syscall,syscall,syscall - enable seccomp filter, and\n"); 148 " --netmask=address - define a network mask when dealing with unconfigured\n"
192 printf("\twhitelist the syscalls specified by the command.\n"); 149 "\tparent interfaces.\n"
193 printf(" --seccomp.print=name|pid - print the seccomp filter for the sandbox\n"); 150 " --netns=name - Run the program in a named, persistent network namespace.\n"
194 printf("\tidentified by name or PID.\n"); 151 " --netstats - monitor network statistics.\n"
195#endif 152#endif
196 printf(" --shell=none - run the program directly without a user shell.\n"); 153 " --nice=value - set nice value.\n"
197 printf(" --shell=program - set default user shell.\n"); 154 " --no3d - disable 3D hardware acceleration.\n"
198 printf(" --shutdown=name|pid - shutdown the sandbox identified by name or PID.\n"); 155 " --noblacklist=filename - disable blacklist for file or directory.\n"
199 printf(" --tmpfs=dirname - mount a tmpfs filesystem on directory dirname.\n"); 156 " --nodbus - disable D-Bus access.\n"
200 printf(" --top - monitor the most CPU-intensive sandboxes.\n"); 157 " --nodvd - disable DVD and audio CD devices.\n"
201 printf(" --trace - trace open, access and connect system calls.\n"); 158 " --noexec=filename - remount the file or directory noexec nosuid and nodev.\n"
202 printf(" --tracelog - add a syslog message for every access to files or\n"); 159 " --nogroups - disable supplementary groups.\n"
203 printf("\tdirectoires blacklisted by the security profile.\n"); 160 " --noinput - disable input devices.\n"
204 printf(" --tree - print a tree of all sandboxed processes.\n"); 161 " --nonewprivs - sets the NO_NEW_PRIVS prctl.\n"
205 printf(" --version - print program version and exit.\n"); 162 " --noprofile - do not use a security profile.\n"
163#ifdef HAVE_USERNS
164 " --noroot - install a user namespace with only the current user.\n"
165#endif
166 " --nosound - disable sound system.\n"
167 " --noautopulse - disable automatic ~/.config/pulse init.\n"
168 " --novideo - disable video devices.\n"
169 " --nou2f - disable U2F devices.\n"
170 " --nowhitelist=filename - disable whitelist for file or directory.\n"
171#ifdef HAVE_OUTPUT
172 " --output=logfile - stdout logging and log rotation.\n"
173 " --output-stderr=logfile - stdout and stderr logging and log rotation.\n"
174#endif
175#ifdef HAVE_OVERLAYFS
176 " --overlay - mount a filesystem overlay on top of the current filesystem.\n"
177 " --overlay-named=name - mount a filesystem overlay on top of the current\n"
178 "\tfilesystem, and store it in name directory.\n"
179 " --overlay-tmpfs - mount a temporary filesystem overlay on top of the\n"
180 "\tcurrent filesystem.\n"
181 " --overlay-clean - clean all overlays stored in $HOME/.firejail directory.\n"
182#endif
183 " --private - temporary home directory.\n"
184 " --private=directory - use directory as user home.\n"
185 " --private-cache - temporary ~/.cache directory.\n"
186 " --private-home=file,directory - build a new user home in a temporary\n"
187 "\tfilesystem, and copy the files and directories in the list in\n"
188 "\tthe new home.\n"
189 " --private-bin=file,file - build a new /bin in a temporary filesystem,\n"
190 "\tand copy the programs in the list.\n"
191 " --private-dev - create a new /dev directory with a small number of\n"
192 "\tcommon device files.\n"
193 " --private-etc=file,directory - build a new /etc in a temporary\n"
194 "\tfilesystem, and copy the files and directories in the list.\n"
195 " --private-tmp - mount a tmpfs on top of /tmp directory.\n"
196 " --private-cwd - do not inherit working directory inside jail.\n"
197 " --private-cwd=directory - set working directory inside jail.\n"
198 " --private-opt=file,directory - build a new /opt in a temporary filesystem.\n"
199 " --private-srv=file,directory - build a new /srv in a temporary filesystem.\n"
200 " --profile=filename|profile_name - use a custom profile.\n"
201 " --profile.print=name|pid - print the name of profile file.\n"
202 " --profile-path=directory - use this directory to look for profile files.\n"
203 " --protocol=protocol,protocol,protocol - enable protocol filter.\n"
204 " --protocol.print=name|pid - print the protocol filter.\n"
205#ifdef HAVE_FILE_TRANSFER
206 " --put=name|pid src-filename dest-filename - put a file in sandbox\n"
207 "\tcontainer.\n"
208#endif
209 " --quiet - turn off Firejail's output.\n"
210 " --read-only=filename - set directory or file read-only.\n"
211 " --read-write=filename - set directory or file read-write.\n"
212 " --rlimit-as=number - set the maximum size of the process's virtual memory.\n"
213 "\t(address space) in bytes.\n"
214 " --rlimit-cpu=number - set the maximum CPU time in seconds.\n"
215 " --rlimit-fsize=number - set the maximum file size that can be created\n"
216 "\tby a process.\n"
217 " --rlimit-nofile=number - set the maximum number of files that can be\n"
218 "\topened by a process.\n"
219 " --rlimit-nproc=number - set the maximum number of processes that can be\n"
220 "\tcreated for the real user ID of the calling process.\n"
221 " --rlimit-sigpending=number - set the maximum number of pending signals\n"
222 "\tfor a process.\n"
223 " --rmenv=name - remove environment variable in the new sandbox.\n"
206#ifdef HAVE_NETWORK 224#ifdef HAVE_NETWORK
207 printf(" --veth-name=name - use this name for the interface connected to the bridge.\n"); 225 " --scan - ARP-scan all the networks from inside a network namespace.\n"
208#endif 226#endif
209#ifdef HAVE_WHITELIST 227 " --seccomp - enable seccomp filter and apply the default blacklist.\n"
210 printf(" --whitelist=filename - whitelist directory or file.\n"); 228 " --seccomp=syscall,syscall,syscall - enable seccomp filter, blacklist the\n"
229 "\tdefault syscall list and the syscalls specified by the command.\n"
230 " --seccomp.block-secondary - build only the native architecture filters.\n"
231 " --seccomp.drop=syscall,syscall,syscall - enable seccomp filter, and\n"
232 "\tblacklist the syscalls specified by the command.\n"
233 " --seccomp.keep=syscall,syscall,syscall - enable seccomp filter, and\n"
234 "\twhitelist the syscalls specified by the command.\n"
235 " --seccomp.print=name|pid - print the seccomp filter for the sandbox\n"
236 "\tidentified by name or PID.\n"
237 " --seccomp.32[.drop,.keep][=syscall] - like above but for 32 bit architecture.\n"
238 " --seccomp-error-action=errno|kill|log - change error code, kill process\n"
239 "\tor log the attempt.\n"
240 " --shell=none - run the program directly without a user shell.\n"
241 " --shell=program - set default user shell.\n"
242 " --shutdown=name|pid - shutdown the sandbox identified by name or PID.\n"
243 " --timeout=hh:mm:ss - kill the sandbox automatically after the time\n"
244 "\thas elapsed.\n"
245 " --tmpfs=dirname - mount a tmpfs filesystem on directory dirname.\n"
246 " --top - monitor the most CPU-intensive sandboxes.\n"
247 " --trace - trace open, access and connect system calls.\n"
248 " --tracelog - add a syslog message for every access to files or\n"
249 "\tdirectories blacklisted by the security profile.\n"
250 " --tree - print a tree of all sandboxed processes.\n"
251 " --tunnel[=devname] - connect the sandbox to a tunnel created by\n"
252 "\tfiretunnel utility.\n"
253 " --version - print program version and exit.\n"
254#ifdef HAVE_NETWORK
255 " --veth-name=name - use this name for the interface connected to the bridge.\n"
211#endif 256#endif
212 printf(" --writable-etc - /etc directory is mounted read-write.\n"); 257 " --whitelist=filename - whitelist directory or file.\n"
213 printf(" --writable-run-user - allow access to /run/user/$UID/systemd and\n"); 258 " --writable-etc - /etc directory is mounted read-write.\n"
214 printf("\t/run/user/$UID/gnupg.\n"); 259 " --writable-run-user - allow access to /run/user/$UID/systemd and\n"
215 printf(" --writable-var - /var directory is mounted read-write.\n"); 260 "\t/run/user/$UID/gnupg.\n"
216 printf(" --writable-var-log - use the real /var/log directory, not a clone.\n"); 261 " --writable-var - /var directory is mounted read-write.\n"
262 " --writable-var-log - use the real /var/log directory, not a clone.\n"
217#ifdef HAVE_X11 263#ifdef HAVE_X11
218 printf(" --x11 - enable X11 sandboxing. The software checks first if Xpra is\n"); 264 " --x11 - enable X11 sandboxing. The software checks first if Xpra is\n"
219 printf("\tinstalled, then it checks if Xephyr is installed. If all fails, it will\n"); 265 "\tinstalled, then it checks if Xephyr is installed. If all fails, it will\n"
220 printf("\tattempt to use X11 security extension.\n"); 266 "\tattempt to use X11 security extension.\n"
221 printf(" --x11=none - disable access to X11 sockets.\n"); 267 " --x11=none - disable access to X11 sockets.\n"
222 printf(" --x11=xephyr - enable Xephyr X11 server. The window size is 800x600.\n"); 268 " --x11=xephyr - enable Xephyr X11 server. The window size is 800x600.\n"
223 printf(" --x11=xorg - enable X11 security extension.\n"); 269 " --x11=xorg - enable X11 security extension.\n"
224 printf(" --x11=xpra - enable Xpra X11 server.\n"); 270 " --x11=xpra - enable Xpra X11 server.\n"
225 printf(" --x11=xvfb - enable Xvfb X11 server.\n"); 271 " --x11=xvfb - enable Xvfb X11 server.\n"
226 printf(" --xephyr-screen=WIDTHxHEIGHT - set screen size for --x11=xephyr.\n"); 272 " --xephyr-screen=WIDTHxHEIGHT - set screen size for --x11=xephyr.\n"
227#endif 273#endif
228 printf(" --zsh - use /usr/bin/zsh as default shell.\n"); 274 "\n"
229 printf("\n"); 275 "Examples:\n"
230 printf("Examples:\n"); 276 " $ firejail firefox\n"
231 printf(" $ firejail firefox\n"); 277 "\tstart Mozilla Firefox\n"
232 printf("\tstart Mozilla Firefox\n"); 278 " $ firejail --debug firefox\n"
233 printf(" $ firejail --debug firefox\n"); 279 "\tdebug Firefox sandbox\n"
234 printf("\tdebug Firefox sandbox\n"); 280 " $ firejail --private --dns=8.8.8.8 firefox\n"
235 printf(" $ firejail --private --dns=8.8.8.8 firefox\n"); 281 "\tstart Firefox with a new, empty home directory, and a well-known DNS\n"
236 printf("\tstart Firefox with a new, empty home directory, and a well-known DNS\n"); 282 "\tserver setting.\n"
237 printf("\tserver setting.\n"); 283 " $ firejail --net=eth0 firefox\n"
238 printf(" $ firejail --net=eth0 firefox\n"); 284 "\tstart Firefox in a new network namespace\n"
239 printf("\tstart Firefox in a new network namespace\n"); 285 " $ firejail --x11=xorg firefox\n"
240 printf(" $ firejail --x11=xorg firefox\n"); 286 "\tstart Firefox and sandbox X11\n"
241 printf("\tstart Firefox and sandbox X11\n"); 287 " $ firejail --list\n"
242 printf(" $ firejail --list\n"); 288 "\tlist all running sandboxes\n"
243 printf("\tlist all running sandboxes\n"); 289 "\n"
244 printf("\n"); 290 "License GPL version 2 or later\n"
245 printf("License GPL version 2 or later\n"); 291 "Homepage: https://firejail.wordpress.com\n"
246 printf("Homepage: http://firejail.wordpress.com\n"); 292 "\n";
247 printf("\n"); 293
294
295void usage(void) {
296 printf("firejail - version %s\n\n", VERSION);
297 puts(usage_str);
248} 298}
diff --git a/src/firejail/util.c b/src/firejail/util.c
index 4d1c94c25..094a68c60 100644
--- a/src/firejail/util.c
+++ b/src/firejail/util.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,9 +19,10 @@
19 */ 19 */
20#define _XOPEN_SOURCE 500 20#define _XOPEN_SOURCE 500
21#include "firejail.h" 21#include "firejail.h"
22#include "../include/gcov_wrapper.h"
22#include <ftw.h> 23#include <ftw.h>
23#include <sys/stat.h> 24#include <sys/stat.h>
24#include <fcntl.h> 25#include <sys/mount.h>
25#include <syslog.h> 26#include <syslog.h>
26#include <errno.h> 27#include <errno.h>
27#include <dirent.h> 28#include <dirent.h>
@@ -29,55 +30,168 @@
29#include <sys/ioctl.h> 30#include <sys/ioctl.h>
30#include <termios.h> 31#include <termios.h>
31#include <sys/wait.h> 32#include <sys/wait.h>
33#include <limits.h>
34
35#include <string.h>
36#include <ctype.h>
37
38#include <fcntl.h>
39#ifndef O_PATH
40#define O_PATH 010000000
41#endif
42
43#include <sys/syscall.h>
44#ifdef __NR_openat2
45#include <linux/openat2.h>
46#endif
32 47
33#define MAX_GROUPS 1024 48#define MAX_GROUPS 1024
49#define MAXBUF 4098
50#define EMPTY_STRING ("")
51
52
53long long unsigned parse_arg_size(char *str) {
54 long long unsigned result = 0;
55 int len = strlen(str);
56 sscanf(str, "%llu", &result);
57
58 char suffix = *(str + len - 1);
59 if (!isdigit(suffix) && (suffix == 'k' || suffix == 'm' || suffix == 'g')) {
60 len -= 1;
61 }
62
63 /* checks for is value valid positive number */
64 for (int i = 0; i < len; i++) {
65 if (!isdigit(*(str+i))) {
66 return 0;
67 }
68 }
69
70 if (isdigit(suffix))
71 return result;
72
73 switch (suffix) {
74 case 'k':
75 result *= 1024;
76 break;
77 case 'm':
78 result *= 1024 * 1024;
79 break;
80 case 'g':
81 result *= 1024 * 1024 * 1024;
82 break;
83 default:
84 result = 0;
85 break;
86 }
87
88 return result;
89}
90
91// send the error to /var/log/auth.log and exit after a small delay
92void errLogExit(char* fmt, ...) {
93 va_list args;
94 va_start(args,fmt);
95 openlog("firejail", LOG_NDELAY | LOG_PID, LOG_AUTH);
96 MountData *m = get_last_mount();
97
98 char *msg1;
99 char *msg2 = "Access error";
100 if (vasprintf(&msg1, fmt, args) != -1 &&
101 asprintf(&msg2, "Access error: uid %d, last mount name:%s dir:%s type:%s - %s", getuid(), m->fsname, m->dir, m->fstype, msg1) != -1)
102 syslog(LOG_CRIT, "%s", msg2);
103 va_end(args);
104 closelog();
105
106 sleep(2);
107 fprintf(stderr, "%s\n", msg2);
108 exit(1);
109}
110
111static void clean_supplementary_groups(gid_t gid) {
112 assert(cfg.username);
113 gid_t groups[MAX_GROUPS];
114 int ngroups = MAX_GROUPS;
115 int rv = getgrouplist(cfg.username, gid, groups, &ngroups);
116 if (rv == -1)
117 goto clean_all;
118
119 // clean supplementary group list
120 // allow only firejail, tty, audio, video, games
121 gid_t new_groups[MAX_GROUPS];
122 int new_ngroups = 0;
123 char *allowed[] = {
124 "firejail",
125 "tty",
126 "audio",
127 "video",
128 "games",
129 NULL
130 };
131
132 int i = 0;
133 while (allowed[i]) {
134 gid_t g = get_group_id(allowed[i]);
135 if (g) {
136 int j;
137 for (j = 0; j < ngroups; j++) {
138 if (g == groups[j]) {
139 new_groups[new_ngroups] = g;
140 new_ngroups++;
141 break;
142 }
143 }
144 }
145 i++;
146 }
147
148 if (new_ngroups) {
149 rv = setgroups(new_ngroups, new_groups);
150 if (rv)
151 goto clean_all;
152
153 if (arg_debug) {
154 printf("Supplementary groups: ");
155 for (i = 0; i < new_ngroups; i++)
156 printf("%d ", new_groups[i]);
157 printf("\n");
158 }
159 }
160 else
161 goto clean_all;
162
163 return;
164
165clean_all:
166 fwarning("cleaning all supplementary groups\n");
167 if (setgroups(0, NULL) < 0)
168 errExit("setgroups");
169}
170
171
34// drop privileges 172// drop privileges
35// - for root group or if nogroups is set, supplementary groups are not configured 173// - for root group or if nogroups is set, supplementary groups are not configured
36void drop_privs(int nogroups) { 174void drop_privs(int nogroups) {
37 EUID_ROOT();
38 gid_t gid = getgid(); 175 gid_t gid = getgid();
176 if (arg_debug)
177 printf("Drop privileges: pid %d, uid %d, gid %d, nogroups %d\n", getpid(), getuid(), gid, nogroups);
39 178
40 // configure supplementary groups 179 // configure supplementary groups
180 EUID_ROOT();
41 if (gid == 0 || nogroups) { 181 if (gid == 0 || nogroups) {
42 if (setgroups(0, NULL) < 0) 182 if (setgroups(0, NULL) < 0)
43 errExit("setgroups"); 183 errExit("setgroups");
44 if (arg_debug) 184 if (arg_debug)
45 printf("Username %s, no supplementary groups\n", cfg.username); 185 printf("No supplementary groups\n");
46 }
47 else {
48 assert(cfg.username);
49 gid_t groups[MAX_GROUPS];
50 int ngroups = MAX_GROUPS;
51 int rv = getgrouplist(cfg.username, gid, groups, &ngroups);
52
53 if (arg_debug && rv) {
54 printf("Username %s, groups ", cfg.username);
55 int i;
56 for (i = 0; i < ngroups; i++)
57 printf("%u, ", groups[i]);
58 printf("\n");
59 }
60
61 if (rv == -1) {
62 fwarning("cannot extract supplementary group list, dropping them\n");
63 if (setgroups(0, NULL) < 0)
64 errExit("setgroups");
65 }
66 else {
67 rv = setgroups(ngroups, groups);
68 if (rv) {
69 fwarning("cannot set supplementary group list, dropping them\n");
70 if (setgroups(0, NULL) < 0)
71 errExit("setgroups");
72 }
73 }
74 } 186 }
187 else if (arg_noroot)
188 clean_supplementary_groups(gid);
75 189
76 // set uid/gid 190 // set uid/gid
77 if (setgid(getgid()) < 0) 191 if (setresgid(-1, getgid(), getgid()) != 0)
78 errExit("setgid/getgid"); 192 errExit("setresgid");
79 if (setuid(getuid()) < 0) 193 if (setresuid(-1, getuid(), getuid()) != 0)
80 errExit("setuid/getuid"); 194 errExit("setresuid");
81} 195}
82 196
83 197
@@ -95,7 +209,6 @@ int mkpath_as_root(const char* path) {
95 *p='\0'; 209 *p='\0';
96 if (mkdir(file_path, 0755)==-1) { 210 if (mkdir(file_path, 0755)==-1) {
97 if (errno != EEXIST) { 211 if (errno != EEXIST) {
98 *p='/';
99 free(file_path); 212 free(file_path);
100 return -1; 213 return -1;
101 } 214 }
@@ -126,6 +239,16 @@ void fwarning(char* fmt, ...) {
126 va_end(args); 239 va_end(args);
127} 240}
128 241
242void fmessage(char* fmt, ...) { // TODO: this function is duplicated in src/fnet/interface.c
243 if (arg_quiet)
244 return;
245
246 va_list args;
247 va_start(args,fmt);
248 vfprintf(stderr, fmt, args);
249 va_end(args);
250 fflush(0);
251}
129 252
130void logsignal(int s) { 253void logsignal(int s) {
131 if (!arg_debug) 254 if (!arg_debug)
@@ -180,6 +303,16 @@ void logerr(const char *msg) {
180 closelog(); 303 closelog();
181} 304}
182 305
306
307void set_nice(int inc) {
308 errno = 0;
309 int rv = nice(inc);
310 (void) rv;
311 if (errno)
312 fwarning("cannot set nice value\n");
313}
314
315
183static int copy_file_by_fd(int src, int dst) { 316static int copy_file_by_fd(int src, int dst) {
184 assert(src >= 0); 317 assert(src >= 0);
185 assert(dst >= 0); 318 assert(dst >= 0);
@@ -196,8 +329,9 @@ static int copy_file_by_fd(int src, int dst) {
196 done += rv; 329 done += rv;
197 } 330 }
198 } 331 }
199// fflush(0); 332 if (len == 0)
200 return 0; 333 return 0;
334 return -1;
201} 335}
202 336
203// return -1 if error, 0 if no error; if destname already exists, return error 337// return -1 if error, 0 if no error; if destname already exists, return error
@@ -206,14 +340,14 @@ int copy_file(const char *srcname, const char *destname, uid_t uid, gid_t gid, m
206 assert(destname); 340 assert(destname);
207 341
208 // open source 342 // open source
209 int src = open(srcname, O_RDONLY); 343 int src = open(srcname, O_RDONLY|O_CLOEXEC);
210 if (src < 0) { 344 if (src < 0) {
211 fwarning("cannot open source file %s, file not copied\n", srcname); 345 fwarning("cannot open source file %s, file not copied\n", srcname);
212 return -1; 346 return -1;
213 } 347 }
214 348
215 // open destination 349 // open destination
216 int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 350 int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
217 if (dst < 0) { 351 if (dst < 0) {
218 fwarning("cannot open destination file %s, file not copied\n", destname); 352 fwarning("cannot open destination file %s, file not copied\n", destname);
219 close(src); 353 close(src);
@@ -233,7 +367,7 @@ int copy_file(const char *srcname, const char *destname, uid_t uid, gid_t gid, m
233} 367}
234 368
235// return -1 if error, 0 if no error 369// return -1 if error, 0 if no error
236void copy_file_as_user(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode) { 370void copy_file_as_user(const char *srcname, const char *destname, mode_t mode) {
237 pid_t child = fork(); 371 pid_t child = fork();
238 if (child < 0) 372 if (child < 0)
239 errExit("fork"); 373 errExit("fork");
@@ -241,13 +375,13 @@ void copy_file_as_user(const char *srcname, const char *destname, uid_t uid, gid
241 // drop privileges 375 // drop privileges
242 drop_privs(0); 376 drop_privs(0);
243 377
244 // copy, set permissions and ownership 378 // copy, set permissions
245 int rv = copy_file(srcname, destname, uid, gid, mode); // already a regular user 379 int rv = copy_file(srcname, destname, -1, -1, mode); // already a regular user
246 if (rv) 380 if (rv)
247 fwarning("cannot copy %s\n", srcname); 381 fwarning("cannot copy %s\n", srcname);
248#ifdef HAVE_GCOV 382
249 __gcov_flush(); 383 __gcov_flush();
250#endif 384
251 _exit(0); 385 _exit(0);
252 } 386 }
253 // wait for the child to finish 387 // wait for the child to finish
@@ -256,7 +390,7 @@ void copy_file_as_user(const char *srcname, const char *destname, uid_t uid, gid
256 390
257void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode) { 391void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_t uid, gid_t gid, mode_t mode) {
258 // open destination 392 // open destination
259 int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 393 int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
260 if (dst < 0) { 394 if (dst < 0) {
261 fwarning("cannot open destination file %s, file not copied\n", destname); 395 fwarning("cannot open destination file %s, file not copied\n", destname);
262 return; 396 return;
@@ -269,7 +403,7 @@ void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_
269 // drop privileges 403 // drop privileges
270 drop_privs(0); 404 drop_privs(0);
271 405
272 int src = open(srcname, O_RDONLY); 406 int src = open(srcname, O_RDONLY|O_CLOEXEC);
273 if (src < 0) { 407 if (src < 0) {
274 fwarning("cannot open source file %s, file not copied\n", srcname); 408 fwarning("cannot open source file %s, file not copied\n", srcname);
275 } else { 409 } else {
@@ -279,9 +413,9 @@ void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_
279 close(src); 413 close(src);
280 } 414 }
281 close(dst); 415 close(dst);
282#ifdef HAVE_GCOV 416
283 __gcov_flush(); 417 __gcov_flush();
284#endif 418
285 _exit(0); 419 _exit(0);
286 } 420 }
287 // wait for the child to finish 421 // wait for the child to finish
@@ -294,7 +428,7 @@ void copy_file_from_user_to_root(const char *srcname, const char *destname, uid_
294} 428}
295 429
296// return -1 if error, 0 if no error 430// return -1 if error, 0 if no error
297void touch_file_as_user(const char *fname, uid_t uid, gid_t gid, mode_t mode) { 431void touch_file_as_user(const char *fname, mode_t mode) {
298 pid_t child = fork(); 432 pid_t child = fork();
299 if (child < 0) 433 if (child < 0)
300 errExit("fork"); 434 errExit("fork");
@@ -302,15 +436,17 @@ void touch_file_as_user(const char *fname, uid_t uid, gid_t gid, mode_t mode) {
302 // drop privileges 436 // drop privileges
303 drop_privs(0); 437 drop_privs(0);
304 438
305 FILE *fp = fopen(fname, "w"); 439 int fd = open(fname, O_RDONLY|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR | S_IWUSR);
306 if (fp) { 440 if (fd > -1) {
307 fprintf(fp, "\n"); 441 int err = fchmod(fd, mode);
308 SET_PERMS_STREAM(fp, uid, gid, mode); 442 (void) err;
309 fclose(fp); 443 close(fd);
310 } 444 }
311#ifdef HAVE_GCOV 445 else
446 fwarning("cannot create %s\n", fname);
447
312 __gcov_flush(); 448 __gcov_flush();
313#endif 449
314 _exit(0); 450 _exit(0);
315 } 451 }
316 // wait for the child to finish 452 // wait for the child to finish
@@ -323,6 +459,13 @@ int is_dir(const char *fname) {
323 if (*fname == '\0') 459 if (*fname == '\0')
324 return 0; 460 return 0;
325 461
462 int called_as_root = 0;
463 if (geteuid() == 0)
464 called_as_root = 1;
465
466 if (called_as_root)
467 EUID_USER();
468
326 // if fname doesn't end in '/', add one 469 // if fname doesn't end in '/', add one
327 int rv; 470 int rv;
328 struct stat s; 471 struct stat s;
@@ -338,6 +481,9 @@ int is_dir(const char *fname) {
338 free(tmp); 481 free(tmp);
339 } 482 }
340 483
484 if (called_as_root)
485 EUID_ROOT();
486
341 if (rv == -1) 487 if (rv == -1)
342 return 0; 488 return 0;
343 489
@@ -347,32 +493,117 @@ int is_dir(const char *fname) {
347 return 0; 493 return 0;
348} 494}
349 495
350
351// return 1 if the file is a link 496// return 1 if the file is a link
352int is_link(const char *fname) { 497int is_link(const char *fname) {
353 assert(fname); 498 assert(fname);
354 if (*fname == '\0') 499 if (*fname == '\0')
355 return 0; 500 return 0;
356 501
357 struct stat s; 502 int called_as_root = 0;
358 if (lstat(fname, &s) == 0) { 503 if (geteuid() == 0)
359 if (S_ISLNK(s.st_mode)) 504 called_as_root = 1;
360 return 1;
361 }
362 505
363 return 0; 506 if (called_as_root)
507 EUID_USER();
508
509 // remove trailing '/' if any
510 char *tmp = strdup(fname);
511 if (!tmp)
512 errExit("strdup");
513 trim_trailing_slash_or_dot(tmp);
514
515 char c;
516 ssize_t rv = readlink(tmp, &c, 1);
517 free(tmp);
518
519 if (called_as_root)
520 EUID_ROOT();
521
522 return (rv != -1);
364} 523}
365 524
525char *realpath_as_user(const char *fname) {
526 assert(fname);
527
528 int called_as_root = 0;
529 if (geteuid() == 0)
530 called_as_root = 1;
531
532 if (called_as_root)
533 EUID_USER();
534
535 char *rv = realpath(fname, NULL);
536
537 if (called_as_root)
538 EUID_ROOT();
539
540 return rv;
541}
542
543int stat_as_user(const char *fname, struct stat *s) {
544 assert(fname);
545
546 int called_as_root = 0;
547 if (geteuid() == 0)
548 called_as_root = 1;
549
550 if (called_as_root)
551 EUID_USER();
552
553 int rv = stat(fname, s);
554
555 if (called_as_root)
556 EUID_ROOT();
557
558 return rv;
559}
560
561int lstat_as_user(const char *fname, struct stat *s) {
562 assert(fname);
563
564 int called_as_root = 0;
565 if (geteuid() == 0)
566 called_as_root = 1;
567
568 if (called_as_root)
569 EUID_USER();
570
571 int rv = lstat(fname, s);
572
573 if (called_as_root)
574 EUID_ROOT();
575
576 return rv;
577}
578
579// remove all slashes and single dots from the end of a path
580// for example /foo/bar///././. -> /foo/bar
581void trim_trailing_slash_or_dot(char *path) {
582 assert(path);
583
584 char *end = strchr(path, '\0');
585 if ((end - path) > 1) {
586 end--;
587 while (*end == '/' ||
588 (*end == '.' && *(end - 1) == '/')) {
589 *end = '\0';
590 end--;
591 if (end == path)
592 break;
593 }
594 }
595}
366 596
367// remove multiple spaces and return allocated memory 597// remove multiple spaces and return allocated memory
368char *line_remove_spaces(const char *buf) { 598char *line_remove_spaces(const char *buf) {
369 EUID_ASSERT(); 599 EUID_ASSERT();
370 assert(buf); 600 assert(buf);
371 if (strlen(buf) == 0) 601 size_t len = strlen(buf);
602 if (len == 0)
372 return NULL; 603 return NULL;
373 604
374 // allocate memory for the new string 605 // allocate memory for the new string
375 char *rv = malloc(strlen(buf) + 1); 606 char *rv = malloc(len + 1);
376 if (rv == NULL) 607 if (rv == NULL)
377 errExit("malloc"); 608 errExit("malloc");
378 609
@@ -430,6 +661,43 @@ char *split_comma(char *str) {
430} 661}
431 662
432 663
664// simplify absolute path by removing
665// 1) consecutive and trailing slashes, and
666// 2) segments with a single dot
667// for example /foo//./bar/ -> /foo/bar
668char *clean_pathname(const char *path) {
669 assert(path && path[0] == '/');
670
671 size_t len = strlen(path);
672 char *rv = malloc(len + 1);
673 if (!rv)
674 errExit("malloc");
675
676 size_t i = 0;
677 size_t j = 0;
678 while (path[i]) {
679 if (path[i] == '/') {
680 while (path[i+1] == '/' ||
681 (path[i+1] == '.' && path[i+2] == '/'))
682 i++;
683 }
684
685 rv[j++] = path[i++];
686 }
687 rv[j] = '\0';
688
689 // remove a trailing dot
690 if (j > 1 && rv[j - 1] == '.' && rv[j - 2] == '/')
691 rv[--j] = '\0';
692
693 // remove a trailing slash
694 if (j > 1 && rv[j - 1] == '/')
695 rv[--j] = '\0';
696
697 return rv;
698}
699
700
433void check_unsigned(const char *str, const char *msg) { 701void check_unsigned(const char *str, const char *msg) {
434 EUID_ASSERT(); 702 EUID_ASSERT();
435 const char *ptr = str; 703 const char *ptr = str;
@@ -475,7 +743,7 @@ int find_child(pid_t parent, pid_t *child) {
475 perror("asprintf"); 743 perror("asprintf");
476 exit(1); 744 exit(1);
477 } 745 }
478 FILE *fp = fopen(file, "r"); 746 FILE *fp = fopen(file, "re");
479 if (!fp) { 747 if (!fp) {
480 free(file); 748 free(file);
481 continue; 749 continue;
@@ -493,8 +761,15 @@ int find_child(pid_t parent, pid_t *child) {
493 fprintf(stderr, "Error: cannot read /proc file\n"); 761 fprintf(stderr, "Error: cannot read /proc file\n");
494 exit(1); 762 exit(1);
495 } 763 }
496 if (parent == atoi(ptr)) 764 if (parent == atoi(ptr)) {
497 *child = pid; 765 // we don't want /usr/bin/xdg-dbus-proxy!
766 char *cmdline = pid_proc_cmdline(pid);
767 if (cmdline) {
768 if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) != 0)
769 *child = pid;
770 free(cmdline);
771 }
772 }
498 break; // stop reading the file 773 break; // stop reading the file
499 } 774 }
500 } 775 }
@@ -533,33 +808,33 @@ void extract_command_name(int index, char **argv) {
533 if (!cfg.command_name) 808 if (!cfg.command_name)
534 errExit("strdup"); 809 errExit("strdup");
535 810
536 // restrict the command name to the first word
537 char *ptr = cfg.command_name;
538 while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0')
539 ptr++;
540 *ptr = '\0';
541
542 // remove the path: /usr/bin/firefox becomes firefox 811 // remove the path: /usr/bin/firefox becomes firefox
543 ptr = strrchr(cfg.command_name, '/'); 812 char *basename = cfg.command_name;
813 char *ptr = strrchr(cfg.command_name, '/');
544 if (ptr) { 814 if (ptr) {
545 ptr++; 815 basename = ++ptr;
546 if (*ptr == '\0') { 816 if (*ptr == '\0') {
547 fprintf(stderr, "Error: invalid command name\n"); 817 fprintf(stderr, "Error: invalid command name\n");
548 exit(1); 818 exit(1);
549 } 819 }
820 }
821 else
822 ptr = basename;
550 823
551 char *tmp = strdup(ptr); 824 // restrict the command name to the first word
552 if (!tmp) 825 while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0')
553 errExit("strdup"); 826 ptr++;
827
828 // command name is a substring of cfg.command_name
829 if (basename != cfg.command_name || *ptr != '\0') {
830 *ptr = '\0';
554 831
555 // limit the command to the first ' ' 832 basename = strdup(basename);
556 char *ptr2 = tmp; 833 if (!basename)
557 while (*ptr2 != ' ' && *ptr2 != '\0') 834 errExit("strdup");
558 ptr2++;
559 *ptr2 = '\0';
560 835
561 free(cfg.command_name); 836 free(cfg.command_name);
562 cfg.command_name = tmp; 837 cfg.command_name = basename;
563 } 838 }
564} 839}
565 840
@@ -576,7 +851,7 @@ void update_map(char *mapping, char *map_file) {
576 if (mapping[j] == ',') 851 if (mapping[j] == ',')
577 mapping[j] = '\n'; 852 mapping[j] = '\n';
578 853
579 fd = open(map_file, O_RDWR); 854 fd = open(map_file, O_RDWR|O_CLOEXEC);
580 if (fd == -1) { 855 if (fd == -1) {
581 fprintf(stderr, "Error: cannot open %s: %s\n", map_file, strerror(errno)); 856 fprintf(stderr, "Error: cannot open %s: %s\n", map_file, strerror(errno));
582 exit(EXIT_FAILURE); 857 exit(EXIT_FAILURE);
@@ -596,9 +871,9 @@ void wait_for_other(int fd) {
596 // wait for the parent to be initialized 871 // wait for the parent to be initialized
597 //**************************** 872 //****************************
598 char childstr[BUFLEN + 1]; 873 char childstr[BUFLEN + 1];
599 int newfd = dup(fd); 874 int newfd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
600 if (newfd == -1) 875 if (newfd == -1)
601 errExit("dup"); 876 errExit("fcntl");
602 FILE* stream; 877 FILE* stream;
603 stream = fdopen(newfd, "r"); 878 stream = fdopen(newfd, "r");
604 *childstr = '\0'; 879 *childstr = '\0';
@@ -645,61 +920,15 @@ void wait_for_other(int fd) {
645 920
646void notify_other(int fd) { 921void notify_other(int fd) {
647 FILE* stream; 922 FILE* stream;
648 int newfd = dup(fd); 923 int newfd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
649 if (newfd == -1) 924 if (newfd == -1)
650 errExit("dup"); 925 errExit("fcntl");
651 stream = fdopen(newfd, "w"); 926 stream = fdopen(newfd, "w");
652 fprintf(stream, "arg_noroot=%d\n", arg_noroot); 927 fprintf(stream, "arg_noroot=%d\n", arg_noroot);
653 fflush(stream); 928 fflush(stream);
654 fclose(stream); 929 fclose(stream);
655} 930}
656 931
657
658// This function takes a pathname supplied by the user and expands '~' and
659// '${HOME}' at the start, to refer to a path relative to the user's home
660// directory (supplied).
661// The return value is allocated using malloc and must be freed by the caller.
662// The function returns NULL if there are any errors.
663char *expand_home(const char *path, const char* homedir) {
664 assert(path);
665 assert(homedir);
666
667 // Replace home macro
668 char *new_name = NULL;
669 if (strncmp(path, "${HOME}", 7) == 0) {
670 if (asprintf(&new_name, "%s%s", homedir, path + 7) == -1)
671 errExit("asprintf");
672 return new_name;
673 }
674 else if (*path == '~') {
675 if (asprintf(&new_name, "%s%s", homedir, path + 1) == -1)
676 errExit("asprintf");
677 return new_name;
678 }
679 else if (strncmp(path, "${CFG}", 6) == 0) {
680 if (asprintf(&new_name, "%s%s", SYSCONFDIR, path + 6) == -1)
681 errExit("asprintf");
682 return new_name;
683 }
684
685 char *rv = strdup(path);
686 if (!rv)
687 errExit("strdup");
688 return rv;
689}
690
691
692// Equivalent to the GNU version of basename, which is incompatible with
693// the POSIX basename. A few lines of code saves any portability pain.
694// https://www.gnu.org/software/libc/manual/html_node/Finding-Tokens-in-a-String.html#index-basename
695const char *gnu_basename(const char *path) {
696 const char *last_slash = strrchr(path, '/');
697 if (!last_slash)
698 return path;
699 return last_slash+1;
700}
701
702
703uid_t pid_get_uid(pid_t pid) { 932uid_t pid_get_uid(pid_t pid) {
704 EUID_ASSERT(); 933 EUID_ASSERT();
705 uid_t rv = 0; 934 uid_t rv = 0;
@@ -711,7 +940,7 @@ uid_t pid_get_uid(pid_t pid) {
711 exit(1); 940 exit(1);
712 } 941 }
713 EUID_ROOT(); // grsecurity fix 942 EUID_ROOT(); // grsecurity fix
714 FILE *fp = fopen(file, "r"); 943 FILE *fp = fopen(file, "re");
715 if (!fp) { 944 if (!fp) {
716 free(file); 945 free(file);
717 fprintf(stderr, "Error: cannot open /proc file\n"); 946 fprintf(stderr, "Error: cannot open /proc file\n");
@@ -723,12 +952,14 @@ uid_t pid_get_uid(pid_t pid) {
723 char buf[PIDS_BUFLEN]; 952 char buf[PIDS_BUFLEN];
724 while (fgets(buf, PIDS_BUFLEN - 1, fp)) { 953 while (fgets(buf, PIDS_BUFLEN - 1, fp)) {
725 if (strncmp(buf, "Uid:", 4) == 0) { 954 if (strncmp(buf, "Uid:", 4) == 0) {
726 char *ptr = buf + 5; 955 char *ptr = buf + 4;
727 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) { 956 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) {
728 ptr++; 957 ptr++;
729 } 958 }
730 if (*ptr == '\0') 959 if (*ptr == '\0') {
731 break; 960 fprintf(stderr, "Error: cannot read /proc file\n");
961 exit(1);
962 }
732 963
733 rv = atoi(ptr); 964 rv = atoi(ptr);
734 break; // break regardless! 965 break; // break regardless!
@@ -739,36 +970,10 @@ uid_t pid_get_uid(pid_t pid) {
739 free(file); 970 free(file);
740 EUID_USER(); // grsecurity fix 971 EUID_USER(); // grsecurity fix
741 972
742 if (rv == 0) {
743 fprintf(stderr, "Error: cannot read /proc file\n");
744 exit(1);
745 }
746 return rv; 973 return rv;
747} 974}
748 975
749 976
750void invalid_filename(const char *fname) {
751// EUID_ASSERT();
752 assert(fname);
753 const char *ptr = fname;
754
755 if (arg_debug_check_filename)
756 printf("Checking filename %s\n", fname);
757
758 if (strncmp(ptr, "${HOME}", 7) == 0)
759 ptr = fname + 7;
760 else if (strncmp(ptr, "${PATH}", 7) == 0)
761 ptr = fname + 7;
762 else if (strcmp(fname, "${DOWNLOADS}") == 0)
763 return;
764
765 int len = strlen(ptr);
766 // file globbing ('*') is allowed
767 if (strcspn(ptr, "\\&!?\"'<>%^(){}[];,") != (size_t)len) {
768 fprintf(stderr, "Error: \"%s\" is an invalid filename\n", ptr);
769 exit(1);
770 }
771}
772 977
773 978
774uid_t get_group_id(const char *group) { 979uid_t get_group_id(const char *group) {
@@ -786,30 +991,136 @@ static int remove_callback(const char *fpath, const struct stat *sb, int typefla
786 (void) sb; 991 (void) sb;
787 (void) typeflag; 992 (void) typeflag;
788 (void) ftwbuf; 993 (void) ftwbuf;
994 assert(fpath);
789 995
790 int rv = remove(fpath); 996 if (strcmp(fpath, ".") == 0)
791 if (rv) 997 return 0;
792 perror(fpath);
793 998
794 return rv; 999 if (remove(fpath)) { // removes the link not the actual file
1000 perror("remove");
1001 fprintf(stderr, "Error: cannot remove file from user .firejail directory: %s\n", fpath);
1002 exit(1);
1003 }
1004
1005 return 0;
795} 1006}
796 1007
797 1008
798int remove_directory(const char *path) { 1009int remove_overlay_directory(void) {
799 // FTW_PHYS - do not follow symbolic links 1010 EUID_ASSERT();
800 return nftw(path, remove_callback, 64, FTW_DEPTH | FTW_PHYS); 1011 sleep(1);
1012
1013 char *path;
1014 if (asprintf(&path, "%s/.firejail", cfg.homedir) == -1)
1015 errExit("asprintf");
1016
1017 if (access(path, F_OK) == 0) {
1018 pid_t child = fork();
1019 if (child < 0)
1020 errExit("fork");
1021 if (child == 0) {
1022 // open ~/.firejail
1023 int fd = safer_openat(-1, path, O_PATH|O_NOFOLLOW|O_CLOEXEC);
1024 if (fd == -1) {
1025 fprintf(stderr, "Error: cannot open %s\n", path);
1026 exit(1);
1027 }
1028 struct stat s;
1029 if (fstat(fd, &s) == -1)
1030 errExit("fstat");
1031 if (!S_ISDIR(s.st_mode)) {
1032 if (S_ISLNK(s.st_mode))
1033 fprintf(stderr, "Error: %s is a symbolic link\n", path);
1034 else
1035 fprintf(stderr, "Error: %s is not a directory\n", path);
1036 exit(1);
1037 }
1038 if (s.st_uid != getuid()) {
1039 fprintf(stderr, "Error: %s is not owned by the current user\n", path);
1040 exit(1);
1041 }
1042 // chdir to ~/.firejail
1043 if (fchdir(fd) == -1)
1044 errExit("fchdir");
1045 close(fd);
1046
1047 EUID_ROOT();
1048 // FTW_PHYS - do not follow symbolic links
1049 if (nftw(".", remove_callback, 64, FTW_DEPTH | FTW_PHYS) == -1)
1050 errExit("nftw");
1051
1052 EUID_USER();
1053 // remove ~/.firejail
1054 if (rmdir(path) == -1)
1055 errExit("rmdir");
1056
1057 __gcov_flush();
1058
1059 _exit(0);
1060 }
1061 // wait for the child to finish
1062 waitpid(child, NULL, 0);
1063 // check if ~/.firejail was deleted
1064 if (access(path, F_OK) == 0)
1065 return 1;
1066 }
1067 return 0;
801} 1068}
802 1069
1070// flush stdin if it is connected to a tty and has input
803void flush_stdin(void) { 1071void flush_stdin(void) {
804 if (isatty(STDIN_FILENO)) { 1072 if (!isatty(STDIN_FILENO))
805 int cnt = 0; 1073 return;
806 int rv = ioctl(STDIN_FILENO, FIONREAD, &cnt); 1074
807 if (rv == 0 && cnt) { 1075 int cnt = 0;
808 fwarning("removing %d bytes from stdin\n", cnt); 1076 int rv = ioctl(STDIN_FILENO, FIONREAD, &cnt);
809 rv = ioctl(STDIN_FILENO, TCFLSH, TCIFLUSH); 1077 if (rv != 0 || cnt == 0)
810 (void) rv; 1078 return;
1079
1080 fwarning("removing %d bytes from stdin\n", cnt);
1081
1082 // If this process is backgrounded, below ioctl() will trigger
1083 // SIGTTOU and stop us. We avoid this by ignoring SIGTTOU for
1084 // the duration of the ioctl.
1085 sighandler_t hdlr = signal(SIGTTOU, SIG_IGN);
1086 rv = ioctl(STDIN_FILENO, TCFLSH, TCIFLUSH);
1087 signal(SIGTTOU, hdlr);
1088
1089 if (rv)
1090 fwarning("Flushing stdin failed: %s\n", strerror(errno));
1091}
1092
1093// return 1 if new directory was created, else return 0
1094int create_empty_dir_as_user(const char *dir, mode_t mode) {
1095 assert(dir);
1096 mode &= 07777;
1097
1098 if (access(dir, F_OK) != 0) {
1099 if (arg_debug)
1100 printf("Creating empty %s directory\n", dir);
1101 pid_t child = fork();
1102 if (child < 0)
1103 errExit("fork");
1104 if (child == 0) {
1105 // drop privileges
1106 drop_privs(0);
1107
1108 if (mkdir(dir, mode) == 0) {
1109 int err = chmod(dir, mode);
1110 (void) err;
1111 }
1112 else if (arg_debug)
1113 printf("Directory %s not created: %s\n", dir, strerror(errno));
1114
1115 __gcov_flush();
1116
1117 _exit(0);
811 } 1118 }
1119 waitpid(child, NULL, 0);
1120 if (access(dir, F_OK) == 0)
1121 return 1;
812 } 1122 }
1123 return 0;
813} 1124}
814 1125
815void create_empty_dir_as_root(const char *dir, mode_t mode) { 1126void create_empty_dir_as_root(const char *dir, mode_t mode) {
@@ -839,15 +1150,14 @@ void create_empty_file_as_root(const char *fname, mode_t mode) {
839 if (stat(fname, &s)) { 1150 if (stat(fname, &s)) {
840 if (arg_debug) 1151 if (arg_debug)
841 printf("Creating empty %s file\n", fname); 1152 printf("Creating empty %s file\n", fname);
842
843 /* coverity[toctou] */ 1153 /* coverity[toctou] */
844 FILE *fp = fopen(fname, "w"); 1154 // don't fail if file already exists. This can be the case in a race
1155 // condition, when two jails launch at the same time. Compare to #1013
1156 FILE *fp = fopen(fname, "we");
845 if (!fp) 1157 if (!fp)
846 errExit("fopen"); 1158 errExit("fopen");
847 SET_PERMS_STREAM(fp, 0, 0, S_IRUSR); 1159 SET_PERMS_STREAM(fp, 0, 0, mode);
848 fclose(fp); 1160 fclose(fp);
849 if (chmod(fname, mode) == -1)
850 errExit("chmod");
851 } 1161 }
852} 1162}
853 1163
@@ -899,44 +1209,311 @@ void mkdir_attr(const char *fname, mode_t mode, uid_t uid, gid_t gid) {
899 ASSERT_PERMS(fname, uid, gid, mode); 1209 ASSERT_PERMS(fname, uid, gid, mode);
900} 1210}
901 1211
902char *read_text_file_or_exit(const char *fname) { 1212unsigned extract_timeout(const char *str) {
903 assert(fname); 1213 unsigned s;
904 1214 unsigned m;
905 // open file 1215 unsigned h;
906 int fd = open(fname, O_RDONLY); 1216 int rv = sscanf(str, "%02u:%02u:%02u", &h, &m, &s);
907 if (fd == -1) { 1217 if (rv != 3) {
908 fprintf(stderr, "Error: cannot read %s\n", fname); 1218 fprintf(stderr, "Error: invalid timeout, please use a hh:mm:ss format\n");
1219 exit(1);
1220 }
1221 unsigned timeout = h * 3600 + m * 60 + s;
1222 if (timeout == 0) {
1223 fprintf(stderr, "Error: invalid timeout\n");
909 exit(1); 1224 exit(1);
910 } 1225 }
911 1226
912 int size = lseek(fd, 0, SEEK_END); 1227 return timeout;
913 if (size == -1) 1228}
914 goto errexit; 1229
915 if (lseek(fd, 0 , SEEK_SET) == -1) 1230void disable_file_or_dir(const char *fname) {
916 goto errexit; 1231 assert(geteuid() == 0);
917 1232 assert(fname);
918 // allocate memory 1233
919 char *data = malloc(size + 1); // + '\0' 1234 EUID_USER();
920 if (data == NULL) 1235 int fd = open(fname, O_PATH|O_CLOEXEC);
921 goto errexit; 1236 EUID_ROOT();
922 memset(data, 0, size + 1); 1237 if (fd < 0)
923 1238 return;
924 // read file 1239
925 int rd = 0; 1240 struct stat s;
926 while (rd < size) { 1241 if (fstat(fd, &s) < 0) { // FUSE
927 int rv = read(fd, (unsigned char *) data + rd, size - rd); 1242 if (errno != EACCES)
928 if (rv == -1) { 1243 errExit("fstat");
929 goto errexit; 1244 close(fd);
930 } 1245 return;
931 rd += rv;
932 } 1246 }
933 1247
934 // close file 1248 if (arg_debug)
1249 printf("blacklist %s\n", fname);
1250 if (S_ISDIR(s.st_mode)) {
1251 if (bind_mount_path_to_fd(RUN_RO_DIR, fd) < 0)
1252 errExit("disable directory");
1253 }
1254 else {
1255 if (bind_mount_path_to_fd(RUN_RO_FILE, fd) < 0)
1256 errExit("disable file");
1257 }
935 close(fd); 1258 close(fd);
936 return data; 1259 fs_logger2("blacklist", fname);
1260}
1261
1262void disable_file_path(const char *path, const char *file) {
1263 assert(file);
1264 assert(path);
937 1265
938errexit: 1266 char *fname;
1267 if (asprintf(&fname, "%s/%s", path, file) == -1)
1268 errExit("asprintf");
1269
1270 disable_file_or_dir(fname);
1271 free(fname);
1272}
1273
1274// open an existing file without following any symbolic link
1275// relative paths are interpreted relative to dirfd
1276// ignore dirfd if path is absolute
1277// https://web.archive.org/web/20180419120236/https://blogs.gnome.org/jamesh/2018/04/19/secure-mounts
1278int safer_openat(int dirfd, const char *path, int flags) {
1279 assert(path && path[0]);
1280 flags |= O_NOFOLLOW;
1281
1282 int fd = -1;
1283
1284#ifdef __NR_openat2 // kernel 5.6 or better
1285 struct open_how oh;
1286 memset(&oh, 0, sizeof(oh));
1287 oh.flags = flags;
1288 oh.resolve = RESOLVE_NO_SYMLINKS;
1289 fd = syscall(__NR_openat2, dirfd, path, &oh, sizeof(struct open_how));
1290 if (fd != -1 || errno != ENOSYS)
1291 return fd;
1292#endif
1293
1294 // openat2 syscall is not available, traverse path and
1295 // check each component if it is a symbolic link or not
1296 char *dup = strdup(path);
1297 if (!dup)
1298 errExit("strdup");
1299 char *tok = strtok(dup, "/");
1300 if (!tok) { // nothing to do, path is the root directory
1301 free(dup);
1302 return openat(dirfd, path, flags);
1303 }
1304 char *last_tok = EMPTY_STRING;
1305
1306 int parentfd;
1307 if (path[0] == '/')
1308 parentfd = open("/", O_PATH|O_CLOEXEC);
1309 else
1310 parentfd = fcntl(dirfd, F_DUPFD_CLOEXEC, 0);
1311 if (parentfd == -1)
1312 errExit("open/fcntl");
1313
1314 while (1) {
1315 // open path component, assuming it is a directory; this fails with ENOTDIR if it is a symbolic link
1316 // if token is a single dot, the directory referred to by parentfd is reopened
1317 fd = openat(parentfd, tok, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
1318 if (fd == -1) {
1319 // if the following token is NULL, the current token is the final path component
1320 // try again to open it, this time using the passed flags, and return -1 or the descriptor
1321 last_tok = tok;
1322 tok = strtok(NULL, "/");
1323 if (!tok)
1324 fd = openat(parentfd, last_tok, flags);
1325 close(parentfd);
1326 free(dup);
1327 return fd;
1328 }
1329 // move on to next path component
1330 last_tok = tok;
1331 tok = strtok(NULL, "/");
1332 if (!tok)
1333 break;
1334 close(parentfd);
1335 parentfd = fd;
1336 }
1337 // getting here when the last path component exists and is of file type directory
1338 // reopen it using the passed flags
939 close(fd); 1339 close(fd);
940 fprintf(stderr, "Error: cannot read %s\n", fname); 1340 fd = openat(parentfd, last_tok, flags);
941 exit(1); 1341 close(parentfd);
1342 free(dup);
1343 return fd;
1344}
1345
1346int remount_by_fd(int dst, unsigned long mountflags) {
1347 char *proc;
1348 if (asprintf(&proc, "/proc/self/fd/%d", dst) < 0)
1349 errExit("asprintf");
1350
1351 int rv = mount(NULL, proc, NULL, mountflags|MS_BIND|MS_REMOUNT, NULL);
1352 if (rv < 0 && arg_debug)
1353 printf("Failed mount: %s\n", strerror(errno));
1354
1355 free(proc);
1356 return rv;
1357}
1358
1359int bind_mount_by_fd(int src, int dst) {
1360 char *proc_src, *proc_dst;
1361 if (asprintf(&proc_src, "/proc/self/fd/%d", src) < 0 ||
1362 asprintf(&proc_dst, "/proc/self/fd/%d", dst) < 0)
1363 errExit("asprintf");
1364
1365 int rv = mount(proc_src, proc_dst, NULL, MS_BIND|MS_REC, NULL);
1366 if (rv < 0 && arg_debug)
1367 printf("Failed mount: %s\n", strerror(errno));
1368
1369 free(proc_src);
1370 free(proc_dst);
1371 return rv;
1372}
1373
1374int bind_mount_fd_to_path(int src, const char *destname) {
1375 char *proc;
1376 if (asprintf(&proc, "/proc/self/fd/%d", src) < 0)
1377 errExit("asprintf");
1378
1379 int rv = mount(proc, destname, NULL, MS_BIND|MS_REC, NULL);
1380 if (rv < 0 && arg_debug)
1381 printf("Failed mount: %s\n", strerror(errno));
1382
1383 free(proc);
1384 return rv;
1385}
1386
1387int bind_mount_path_to_fd(const char *srcname, int dst) {
1388 char *proc;
1389 if (asprintf(&proc, "/proc/self/fd/%d", dst) < 0)
1390 errExit("asprintf");
1391
1392 int rv = mount(srcname, proc, NULL, MS_BIND|MS_REC, NULL);
1393 if (rv < 0 && arg_debug)
1394 printf("Failed mount: %s\n", strerror(errno));
1395
1396 free(proc);
1397 return rv;
1398}
1399
1400int has_handler(pid_t pid, int signal) {
1401 if (signal > 0 && signal <= SIGRTMAX) {
1402 char *fname;
1403 if (asprintf(&fname, "/proc/%d/status", pid) == -1)
1404 errExit("asprintf");
1405 EUID_ROOT();
1406 FILE *fp = fopen(fname, "re");
1407 EUID_USER();
1408 free(fname);
1409 if (fp) {
1410 char buf[BUFLEN];
1411 while (fgets(buf, BUFLEN, fp)) {
1412 if (strncmp(buf, "SigCgt:", 7) == 0) {
1413 unsigned long long val;
1414 if (sscanf(buf + 7, "%llx", &val) != 1) {
1415 fprintf(stderr, "Error: cannot read /proc file\n");
1416 exit(1);
1417 }
1418 val >>= (signal - 1);
1419 val &= 1ULL;
1420 fclose(fp);
1421 return val; // 1 if process has a handler for the signal, else 0
1422 }
1423 }
1424 fclose(fp);
1425 }
1426 }
1427 return 0;
1428}
1429
1430void enter_network_namespace(pid_t pid) {
1431 // in case the pid is that of a firejail process, use the pid of the first child process
1432 pid_t child = switch_to_child(pid);
1433
1434 // exit if no permission to join the sandbox
1435 check_join_permission(child);
1436
1437 // check network namespace
1438 char *name;
1439 if (asprintf(&name, "/run/firejail/network/%d-netmap", pid) == -1)
1440 errExit("asprintf");
1441 struct stat s;
1442 if (stat(name, &s) == -1) {
1443 fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n");
1444 exit(1);
1445 }
1446
1447 // join the namespace
1448 EUID_ROOT();
1449 if (join_namespace(child, "net")) {
1450 fprintf(stderr, "Error: cannot join the network namespace\n");
1451 exit(1);
1452 }
1453}
1454
1455// return 1 if error, 0 if a valid pid was found
1456static int extract_pid(const char *name, pid_t *pid) {
1457 int retval = 0;
1458 EUID_ASSERT();
1459 if (!name || strlen(name) == 0) {
1460 fprintf(stderr, "Error: invalid sandbox name\n");
1461 exit(1);
1462 }
1463
1464 EUID_ROOT();
1465 if (name2pid(name, pid)) {
1466 retval = 1;
1467 }
1468 EUID_USER();
1469 return retval;
1470}
1471
1472// return 1 if error, 0 if a valid pid was found
1473int read_pid(const char *name, pid_t *pid) {
1474 char *endptr;
1475 errno = 0;
1476 long int pidtmp = strtol(name, &endptr, 10);
1477 if ((errno == ERANGE && (pidtmp == LONG_MAX || pidtmp == LONG_MIN))
1478 || (errno != 0 && pidtmp == 0)) {
1479 return extract_pid(name,pid);
1480 }
1481 // endptr points to '\0' char in name if the entire string is valid
1482 if (endptr == NULL || endptr[0]!='\0') {
1483 return extract_pid(name,pid);
1484 }
1485 *pid =(pid_t)pidtmp;
1486 return 0;
1487}
1488
1489pid_t require_pid(const char *name) {
1490 pid_t pid;
1491 if (read_pid(name,&pid)) {
1492 fprintf(stderr, "Error: cannot find sandbox %s\n", name);
1493 exit(1);
1494 }
1495 return pid;
1496}
1497
1498// return 1 if there is a link somewhere in path of directory
1499static int has_link(const char *dir) {
1500 assert(dir);
1501 int fd = safer_openat(-1, dir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC);
1502 if (fd != -1)
1503 close(fd);
1504 else if (errno == ELOOP || (errno == ENOTDIR && is_dir(dir)))
1505 return 1;
1506 return 0;
1507}
1508
1509void check_homedir(const char *dir) {
1510 assert(dir);
1511 if (dir[0] != '/') {
1512 fprintf(stderr, "Error: invalid user directory \"%s\"\n", cfg.homedir);
1513 exit(1);
1514 }
1515 // symlinks are rejected in many places
1516 if (has_link(dir))
1517 fmessage("No full support for symbolic links in path of user directory.\n"
1518 "Please provide resolved path in password database (/etc/passwd).\n\n");
942} 1519}
diff --git a/src/firejail/x11.c b/src/firejail/x11.c
index d41f46d93..896aa2fd3 100644
--- a/src/firejail/x11.c
+++ b/src/firejail/x11.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,9 +20,9 @@
20#include "firejail.h" 20#include "firejail.h"
21#include <sys/types.h> 21#include <sys/types.h>
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <sys/statvfs.h>
23#include <sys/socket.h> 24#include <sys/socket.h>
24#include <sys/un.h> 25#include <sys/un.h>
25#include <fcntl.h>
26#include <unistd.h> 26#include <unistd.h>
27#include <signal.h> 27#include <signal.h>
28#include <stdlib.h> 28#include <stdlib.h>
@@ -32,10 +32,16 @@
32#include <errno.h> 32#include <errno.h>
33#include <limits.h> 33#include <limits.h>
34 34
35#include <fcntl.h>
36#ifndef O_PATH
37#define O_PATH 010000000
38#endif
39
40
35// Parse the DISPLAY environment variable and return a display number. 41// Parse the DISPLAY environment variable and return a display number.
36// Returns -1 if DISPLAY is not set, or is set to anything other than :ddd. 42// Returns -1 if DISPLAY is not set, or is set to anything other than :ddd.
37int x11_display(void) { 43int x11_display(void) {
38 const char *display_str = getenv("DISPLAY"); 44 const char *display_str = env_get("DISPLAY");
39 char *endp; 45 char *endp;
40 unsigned long display; 46 unsigned long display;
41 47
@@ -78,7 +84,7 @@ int x11_display(void) {
78static int x11_abstract_sockets_present(void) { 84static int x11_abstract_sockets_present(void) {
79 85
80 EUID_ROOT(); // grsecurity fix 86 EUID_ROOT(); // grsecurity fix
81 FILE *fp = fopen("/proc/net/unix", "r"); 87 FILE *fp = fopen("/proc/net/unix", "re");
82 if (!fp) 88 if (!fp)
83 errExit("fopen"); 89 errExit("fopen");
84 EUID_USER(); 90 EUID_USER();
@@ -198,13 +204,12 @@ static int random_display_number(void) {
198void x11_start_xvfb(int argc, char **argv) { 204void x11_start_xvfb(int argc, char **argv) {
199 EUID_ASSERT(); 205 EUID_ASSERT();
200 int i; 206 int i;
201 struct stat s;
202 pid_t jail = 0; 207 pid_t jail = 0;
203 pid_t server = 0; 208 pid_t server = 0;
204 209
205 setenv("FIREJAIL_X11", "yes", 1); 210 env_store_name_val("FIREJAIL_X11", "yes", SETENV);
206 211
207 // mever try to run X servers as root!!! 212 // never try to run X servers as root!!!
208 if (getuid() == 0) { 213 if (getuid() == 0) {
209 fprintf(stderr, "Error: X11 sandboxing is not available when running as root\n"); 214 fprintf(stderr, "Error: X11 sandboxing is not available when running as root\n");
210 exit(1); 215 exit(1);
@@ -216,6 +221,7 @@ void x11_start_xvfb(int argc, char **argv) {
216 fprintf(stderr, "\nError: Xvfb program was not found in /usr/bin directory, please install it:\n"); 221 fprintf(stderr, "\nError: Xvfb program was not found in /usr/bin directory, please install it:\n");
217 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xvfb\n"); 222 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xvfb\n");
218 fprintf(stderr, " Arch: sudo pacman -S xorg-server-xvfb\n"); 223 fprintf(stderr, " Arch: sudo pacman -S xorg-server-xvfb\n");
224 fprintf(stderr, " Fedora: sudo dnf install xorg-x11-server-Xvfb\n");
219 exit(0); 225 exit(0);
220 } 226 }
221 227
@@ -226,7 +232,7 @@ void x11_start_xvfb(int argc, char **argv) {
226 232
227 assert(xvfb_screen); 233 assert(xvfb_screen);
228 234
229 char *server_argv[256] = { // rest initialyzed to NULL 235 char *server_argv[256] = { // rest initialized to NULL
230 "Xvfb", display_str, "-screen", "0", xvfb_screen 236 "Xvfb", display_str, "-screen", "0", xvfb_screen
231 }; 237 };
232 unsigned pos = 0; 238 unsigned pos = 0;
@@ -304,7 +310,7 @@ void x11_start_xvfb(int argc, char **argv) {
304 310
305 if (arg_debug) { 311 if (arg_debug) {
306 size_t i = 0; 312 size_t i = 0;
307 printf("\n*** Stating xvfb client:"); 313 printf("\n*** Starting xvfb client:");
308 while (jail_argv[i]!=NULL) { 314 while (jail_argv[i]!=NULL) {
309 printf(" \"%s\"", jail_argv[i]); 315 printf(" \"%s\"", jail_argv[i]);
310 i++; 316 i++;
@@ -319,7 +325,11 @@ void x11_start_xvfb(int argc, char **argv) {
319 if (arg_debug) 325 if (arg_debug)
320 printf("Starting xvfb...\n"); 326 printf("Starting xvfb...\n");
321 327
328 // restore original environment variables
329 env_apply_all();
330
322 // running without privileges - see drop_privs call above 331 // running without privileges - see drop_privs call above
332 assert(env_get("LD_PRELOAD") == NULL);
323 assert(getenv("LD_PRELOAD") == NULL); 333 assert(getenv("LD_PRELOAD") == NULL);
324 execvp(server_argv[0], server_argv); 334 execvp(server_argv[0], server_argv);
325 perror("execvp"); 335 perror("execvp");
@@ -337,7 +347,7 @@ void x11_start_xvfb(int argc, char **argv) {
337 // wait for x11 server to start 347 // wait for x11 server to start
338 while (++n < 10) { 348 while (++n < 10) {
339 sleep(1); 349 sleep(1);
340 if (stat(fname, &s) == 0) 350 if (access(fname, F_OK) == 0)
341 break; 351 break;
342 }; 352 };
343 353
@@ -347,23 +357,20 @@ void x11_start_xvfb(int argc, char **argv) {
347 } 357 }
348 free(fname); 358 free(fname);
349 359
350 if (arg_debug) {
351 printf("X11 sockets: "); fflush(0);
352 int rv = system("ls /tmp/.X11-unix");
353 (void) rv;
354 }
355
356 assert(display_str); 360 assert(display_str);
357 setenv("DISPLAY", display_str, 1); 361 env_store_name_val("DISPLAY", display_str, SETENV);
358 // run attach command 362 // run attach command
359 jail = fork(); 363 jail = fork();
360 if (jail < 0) 364 if (jail < 0)
361 errExit("fork"); 365 errExit("fork");
362 if (jail == 0) { 366 if (jail == 0) {
363 if (!arg_quiet) 367 fmessage("\n*** Attaching to Xvfb display %d ***\n\n", display);
364 printf("\n*** Attaching to Xvfb display %d ***\n\n", display); 368
369 // restore original environment variables
370 env_apply_all();
365 371
366 // running without privileges - see drop_privs call above 372 // running without privileges - see drop_privs call above
373 assert(env_get("LD_PRELOAD") == NULL);
367 assert(getenv("LD_PRELOAD") == NULL); 374 assert(getenv("LD_PRELOAD") == NULL);
368 execvp(jail_argv[0], jail_argv); 375 execvp(jail_argv[0], jail_argv);
369 perror("execvp"); 376 perror("execvp");
@@ -419,16 +426,15 @@ static char *extract_setting(int argc, char **argv, const char *argument) {
419void x11_start_xephyr(int argc, char **argv) { 426void x11_start_xephyr(int argc, char **argv) {
420 EUID_ASSERT(); 427 EUID_ASSERT();
421 int i; 428 int i;
422 struct stat s;
423 pid_t jail = 0; 429 pid_t jail = 0;
424 pid_t server = 0; 430 pid_t server = 0;
425 431
426 // default xephyr screen can be overwriten by a --xephyr-screen= command line option 432 // default xephyr screen can be overwritten by a --xephyr-screen= command line option
427 char *newscreen = extract_setting(argc, argv, "--xephyr-screen="); 433 char *newscreen = extract_setting(argc, argv, "--xephyr-screen=");
428 if (newscreen) 434 if (newscreen)
429 xephyr_screen = newscreen; 435 xephyr_screen = newscreen;
430 436
431 setenv("FIREJAIL_X11", "yes", 1); 437 env_store_name_val("FIREJAIL_X11", "yes", SETENV);
432 438
433 // unfortunately, xephyr does a number of weird things when started by root user!!! 439 // unfortunately, xephyr does a number of weird things when started by root user!!!
434 if (getuid() == 0) { 440 if (getuid() == 0) {
@@ -442,6 +448,7 @@ void x11_start_xephyr(int argc, char **argv) {
442 fprintf(stderr, "\nError: Xephyr program was not found in /usr/bin directory, please install it:\n"); 448 fprintf(stderr, "\nError: Xephyr program was not found in /usr/bin directory, please install it:\n");
443 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n"); 449 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n");
444 fprintf(stderr, " Arch: sudo pacman -S xorg-server-xephyr\n"); 450 fprintf(stderr, " Arch: sudo pacman -S xorg-server-xephyr\n");
451 fprintf(stderr, " Fedora: sudo dnf install xorg-x11-server-Xephyr\n");
445 exit(0); 452 exit(0);
446 } 453 }
447 454
@@ -451,7 +458,7 @@ void x11_start_xephyr(int argc, char **argv) {
451 errExit("asprintf"); 458 errExit("asprintf");
452 459
453 assert(xephyr_screen); 460 assert(xephyr_screen);
454 char *server_argv[256] = { // rest initialyzed to NULL 461 char *server_argv[256] = { // rest initialized to NULL
455 "Xephyr", "-ac", "-br", "-noreset", "-screen", xephyr_screen 462 "Xephyr", "-ac", "-br", "-noreset", "-screen", xephyr_screen
456 }; 463 };
457 unsigned pos = 0; 464 unsigned pos = 0;
@@ -515,7 +522,7 @@ void x11_start_xephyr(int argc, char **argv) {
515 assert(pos < (sizeof(server_argv)/sizeof(*server_argv))); 522 assert(pos < (sizeof(server_argv)/sizeof(*server_argv)));
516 assert(server_argv[pos-1] == NULL); // last element is null 523 assert(server_argv[pos-1] == NULL); // last element is null
517 524
518 if (arg_debug) { 525 {
519 size_t i = 0; 526 size_t i = 0;
520 printf("\n*** Starting xephyr server:"); 527 printf("\n*** Starting xephyr server:");
521 while (server_argv[i]!=NULL) { 528 while (server_argv[i]!=NULL) {
@@ -555,7 +562,11 @@ void x11_start_xephyr(int argc, char **argv) {
555 if (arg_debug) 562 if (arg_debug)
556 printf("Starting xephyr...\n"); 563 printf("Starting xephyr...\n");
557 564
565 // restore original environment variables
566 env_apply_all();
567
558 // running without privileges - see drop_privs call above 568 // running without privileges - see drop_privs call above
569 assert(env_get("LD_PRELOAD") == NULL);
559 assert(getenv("LD_PRELOAD") == NULL); 570 assert(getenv("LD_PRELOAD") == NULL);
560 execvp(server_argv[0], server_argv); 571 execvp(server_argv[0], server_argv);
561 perror("execvp"); 572 perror("execvp");
@@ -573,7 +584,7 @@ void x11_start_xephyr(int argc, char **argv) {
573 // wait for x11 server to start 584 // wait for x11 server to start
574 while (++n < 10) { 585 while (++n < 10) {
575 sleep(1); 586 sleep(1);
576 if (stat(fname, &s) == 0) 587 if (access(fname, F_OK) == 0)
577 break; 588 break;
578 }; 589 };
579 590
@@ -583,14 +594,8 @@ void x11_start_xephyr(int argc, char **argv) {
583 } 594 }
584 free(fname); 595 free(fname);
585 596
586 if (arg_debug) {
587 printf("X11 sockets: "); fflush(0);
588 int rv = system("ls /tmp/.X11-unix");
589 (void) rv;
590 }
591
592 assert(display_str); 597 assert(display_str);
593 setenv("DISPLAY", display_str, 1); 598 env_store_name_val("DISPLAY", display_str, SETENV);
594 // run attach command 599 // run attach command
595 jail = fork(); 600 jail = fork();
596 if (jail < 0) 601 if (jail < 0)
@@ -599,8 +604,12 @@ void x11_start_xephyr(int argc, char **argv) {
599 if (!arg_quiet) 604 if (!arg_quiet)
600 printf("\n*** Attaching to Xephyr display %d ***\n\n", display); 605 printf("\n*** Attaching to Xephyr display %d ***\n\n", display);
601 606
607 // restore original environment variables
608 env_apply_all();
609
602 // running without privileges - see drop_privs call above 610 // running without privileges - see drop_privs call above
603 assert(getenv("LD_PRELOAD") == NULL); 611 assert(getenv("LD_PRELOAD") == NULL);
612 assert(env_get("LD_PRELOAD") == NULL);
604 execvp(jail_argv[0], jail_argv); 613 execvp(jail_argv[0], jail_argv);
605 perror("execvp"); 614 perror("execvp");
606 _exit(1); 615 _exit(1);
@@ -630,15 +639,71 @@ void x11_start_xephyr(int argc, char **argv) {
630} 639}
631 640
632 641
633void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) { 642// this function returns the string that will appear in the window title when xpra is being used
643// this string may include one of these items:
644// * the "--name" argument, if specified
645// * the basename portion of the "--private" directory, if specified
646// note: the malloc() is leaking, but this is a small string allocated one time only during startup, so don't care
647static char * get_title_arg_str() {
648
649 char * title_arg_str = NULL;
650
651 const char * title_start = "--title=firejail x11 sandbox";
652 const char * title_sep = " ";
653
654 // use the "--name" argument if it was explicitly specified
655 if ((cfg.name != NULL) && (strlen(cfg.name) > 0)) {
656
657 title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(cfg.name) + 1);
658 if (title_arg_str == NULL) {
659 fprintf(stderr, "Error: malloc() failed to allocate memory\n");
660 exit(1);
661 }
662
663 strcpy(title_arg_str, title_start);
664 strcat(title_arg_str, title_sep);
665 strcat(title_arg_str, cfg.name);
666 }
667
668 // use the "--private" argument if it was explicitly specified
669 else if ((cfg.home_private != NULL) && (strlen(cfg.home_private) > 0)) {
670
671 const char * base_out = gnu_basename(cfg.home_private);
672
673 title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(base_out) + 1);
674 if (title_arg_str == NULL) {
675 fprintf(stderr, "Error: malloc() failed to allocate memory\n");
676 exit(1);
677 }
678
679 strcpy(title_arg_str, title_start);
680 strcat(title_arg_str, title_sep);
681 strcat(title_arg_str, base_out);
682 }
683
684 // default
685 else {
686 title_arg_str = malloc(strlen(title_start) + 1);
687 if (title_arg_str == NULL) {
688 fprintf(stderr, "Error: malloc() failed to allocate memory\n");
689 exit(1);
690 }
691
692 strcpy(title_arg_str, title_start);
693 }
694
695 return title_arg_str;
696}
697
698
699static void __attribute__((noreturn)) x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
634 EUID_ASSERT(); 700 EUID_ASSERT();
635 int i; 701 int i;
636 struct stat s;
637 pid_t client = 0; 702 pid_t client = 0;
638 pid_t server = 0; 703 pid_t server = 0;
639 704
640 // build the start command 705 // build the start command
641 char *server_argv[256] = { // rest initialyzed to NULL 706 char *server_argv[256] = { // rest initialized to NULL
642 "xpra", "start", display_str, "--no-daemon", 707 "xpra", "start", display_str, "--no-daemon",
643 }; 708 };
644 unsigned pos = 0; 709 unsigned pos = 0;
@@ -728,8 +793,12 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
728 dup2(fd_null,2); 793 dup2(fd_null,2);
729 } 794 }
730 795
796 // restore original environment variables
797 env_apply_all();
798
731 // running without privileges - see drop_privs call above 799 // running without privileges - see drop_privs call above
732 assert(getenv("LD_PRELOAD") == NULL); 800 assert(getenv("LD_PRELOAD") == NULL);
801 assert(env_get("LD_PRELOAD") == NULL);
733 execvp(server_argv[0], server_argv); 802 execvp(server_argv[0], server_argv);
734 perror("execvp"); 803 perror("execvp");
735 _exit(1); 804 _exit(1);
@@ -746,7 +815,7 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
746 // wait for x11 server to start 815 // wait for x11 server to start
747 while (++n < 10) { 816 while (++n < 10) {
748 sleep(1); 817 sleep(1);
749 if (stat(fname, &s) == 0) 818 if (access(fname, F_OK) == 0)
750 break; 819 break;
751 } 820 }
752 821
@@ -756,14 +825,11 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
756 } 825 }
757 free(fname); 826 free(fname);
758 827
759 if (arg_debug) {
760 printf("X11 sockets: "); fflush(0);
761 int rv = system("ls /tmp/.X11-unix");
762 (void) rv;
763 }
764
765 // build attach command 828 // build attach command
766 char *attach_argv[] = { "xpra", "--title=\"firejail x11 sandbox\"", "attach", display_str, NULL }; 829
830 char * title_arg_str = get_title_arg_str();
831
832 char *attach_argv[] = { "xpra", title_arg_str, "attach", display_str, NULL };
767 833
768 // run attach command 834 // run attach command
769 client = fork(); 835 client = fork();
@@ -776,10 +842,13 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
776 dup2(fd_null,2); 842 dup2(fd_null,2);
777 } 843 }
778 844
779 if (!arg_quiet) 845 fmessage("\n*** Attaching to xpra display %d ***\n\n", display);
780 printf("\n*** Attaching to xpra display %d ***\n\n", display); 846
847 // restore original environment variables
848 env_apply_all();
781 849
782 // running without privileges - see drop_privs call above 850 // running without privileges - see drop_privs call above
851 assert(env_get("LD_PRELOAD") == NULL);
783 assert(getenv("LD_PRELOAD") == NULL); 852 assert(getenv("LD_PRELOAD") == NULL);
784 execvp(attach_argv[0], attach_argv); 853 execvp(attach_argv[0], attach_argv);
785 perror("execvp"); 854 perror("execvp");
@@ -787,7 +856,7 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
787 } 856 }
788 857
789 assert(display_str); 858 assert(display_str);
790 setenv("DISPLAY", display_str, 1); 859 env_store_name_val("DISPLAY", display_str, SETENV);
791 860
792 // build jail command 861 // build jail command
793 char *firejail_argv[argc+2]; 862 char *firejail_argv[argc+2];
@@ -809,15 +878,19 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
809 errExit("fork"); 878 errExit("fork");
810 if (jail == 0) { 879 if (jail == 0) {
811 // running without privileges - see drop_privs call above 880 // running without privileges - see drop_privs call above
881 assert(env_get("LD_PRELOAD") == NULL);
812 assert(getenv("LD_PRELOAD") == NULL); 882 assert(getenv("LD_PRELOAD") == NULL);
883
884 // restore original environment variables
885 env_apply_all();
886
813 if (firejail_argv[0]) // shut up llvm scan-build 887 if (firejail_argv[0]) // shut up llvm scan-build
814 execvp(firejail_argv[0], firejail_argv); 888 execvp(firejail_argv[0], firejail_argv);
815 perror("execvp"); 889 perror("execvp");
816 exit(1); 890 exit(1);
817 } 891 }
818 892
819 if (!arg_quiet) 893 fmessage("Xpra server pid %d, xpra client pid %d, jail %d\n", server, client, jail);
820 printf("Xpra server pid %d, xpra client pid %d, jail %d\n", server, client, jail);
821 894
822 sleep(1); // adding a delay in order to let the server start 895 sleep(1); // adding a delay in order to let the server start
823 896
@@ -836,7 +909,12 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
836 dup2(fd_null,1); 909 dup2(fd_null,1);
837 dup2(fd_null,2); 910 dup2(fd_null,2);
838 } 911 }
912
913 // restore original environment variables
914 env_apply_all();
915
839 // running without privileges - see drop_privs call above 916 // running without privileges - see drop_privs call above
917 assert(env_get("LD_PRELOAD") == NULL);
840 assert(getenv("LD_PRELOAD") == NULL); 918 assert(getenv("LD_PRELOAD") == NULL);
841 execvp(stop_argv[0], stop_argv); 919 execvp(stop_argv[0], stop_argv);
842 perror("execvp"); 920 perror("execvp");
@@ -853,7 +931,7 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
853 931
854 if (arg_debug) { 932 if (arg_debug) {
855 if (n == 10) 933 if (n == 10)
856 printf("failed to stop xpra server gratefully\n"); 934 printf("failed to stop xpra server gracefully\n");
857 else 935 else
858 printf("xpra server successfully stopped in %d secs\n", n); 936 printf("xpra server successfully stopped in %d secs\n", n);
859 } 937 }
@@ -874,13 +952,13 @@ void x11_start_xpra_old(int argc, char **argv, int display, char *display_str) {
874} 952}
875 953
876 954
877void x11_start_xpra_new(int argc, char **argv, char *display_str) { 955static void __attribute__((noreturn)) x11_start_xpra_new(int argc, char **argv, char *display_str) {
878 EUID_ASSERT(); 956 EUID_ASSERT();
879 int i; 957 int i;
880 pid_t server = 0; 958 pid_t server = 0;
881 959
882 // build the start command 960 // build the start command
883 char *server_argv[256] = { // rest initialyzed to NULL 961 char *server_argv[256] = { // rest initialized to NULL
884 "xpra", "start", display_str, "--daemon=no", "--attach=yes", "--exit-with-children=yes" 962 "xpra", "start", display_str, "--daemon=no", "--attach=yes", "--exit-with-children=yes"
885 }; 963 };
886 unsigned spos = 0; 964 unsigned spos = 0;
@@ -908,9 +986,9 @@ void x11_start_xpra_new(int argc, char **argv, char *display_str) {
908 986
909 strcpy(start_child,start_child_prefix); 987 strcpy(start_child,start_child_prefix);
910 for(i = 0; (unsigned) i < fpos; i++) { 988 for(i = 0; (unsigned) i < fpos; i++) {
911 strncat(start_child,firejail_argv[i],strlen(firejail_argv[i])); 989 strcat(start_child,firejail_argv[i]);
912 if((unsigned) i != fpos - 1) 990 if((unsigned) i != fpos - 1)
913 strncat(start_child," ",strlen(" ")); 991 strcat(start_child," ");
914 } 992 }
915 993
916 server_argv[spos++] = start_child; 994 server_argv[spos++] = start_child;
@@ -965,6 +1043,8 @@ void x11_start_xpra_new(int argc, char **argv, char *display_str) {
965 } 1043 }
966 } 1044 }
967 1045
1046 server_argv[spos++] = NULL;
1047
968 assert((int) fpos < (argc+2)); 1048 assert((int) fpos < (argc+2));
969 assert(!firejail_argv[fpos]); 1049 assert(!firejail_argv[fpos]);
970 // no overrun 1050 // no overrun
@@ -1002,7 +1082,11 @@ void x11_start_xpra_new(int argc, char **argv, char *display_str) {
1002 dup2(fd_null,2); 1082 dup2(fd_null,2);
1003 } 1083 }
1004 1084
1085 // restore original environment variables
1086 env_apply_all();
1087
1005 // running without privileges - see drop_privs call above 1088 // running without privileges - see drop_privs call above
1089 assert(env_get("LD_PRELOAD") == NULL);
1006 assert(getenv("LD_PRELOAD") == NULL); 1090 assert(getenv("LD_PRELOAD") == NULL);
1007 execvp(server_argv[0], server_argv); 1091 execvp(server_argv[0], server_argv);
1008 perror("execvp"); 1092 perror("execvp");
@@ -1023,7 +1107,7 @@ void x11_start_xpra_new(int argc, char **argv, char *display_str) {
1023void x11_start_xpra(int argc, char **argv) { 1107void x11_start_xpra(int argc, char **argv) {
1024 EUID_ASSERT(); 1108 EUID_ASSERT();
1025 1109
1026 setenv("FIREJAIL_X11", "yes", 1); 1110 env_store_name_val("FIREJAIL_X11", "yes", SETENV);
1027 1111
1028 // unfortunately, xpra does a number of weird things when started by root user!!! 1112 // unfortunately, xpra does a number of weird things when started by root user!!!
1029 if (getuid() == 0) { 1113 if (getuid() == 0) {
@@ -1036,6 +1120,8 @@ void x11_start_xpra(int argc, char **argv) {
1036 if (!program_in_path("xpra")) { 1120 if (!program_in_path("xpra")) {
1037 fprintf(stderr, "\nError: Xpra program was not found in /usr/bin directory, please install it:\n"); 1121 fprintf(stderr, "\nError: Xpra program was not found in /usr/bin directory, please install it:\n");
1038 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n"); 1122 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n");
1123 fprintf(stderr, " Arch: sudo pacman -S xpra\n");
1124 fprintf(stderr, " Fedora: sudo dnf install xpra\n");
1039 exit(0); 1125 exit(0);
1040 } 1126 }
1041 1127
@@ -1043,7 +1129,7 @@ void x11_start_xpra(int argc, char **argv) {
1043 char *display_str; 1129 char *display_str;
1044 if (asprintf(&display_str, ":%d", display) == -1) 1130 if (asprintf(&display_str, ":%d", display) == -1)
1045 errExit("asprintf"); 1131 errExit("asprintf");
1046 1132
1047 if (checkcfg(CFG_XPRA_ATTACH)) 1133 if (checkcfg(CFG_XPRA_ATTACH))
1048 x11_start_xpra_new(argc, argv, display_str); 1134 x11_start_xpra_new(argc, argv, display_str);
1049 else 1135 else
@@ -1069,152 +1155,161 @@ void x11_start(int argc, char **argv) {
1069 fprintf(stderr, "\nError: Xpra or Xephyr not found in /usr/bin directory, please install one of them:\n"); 1155 fprintf(stderr, "\nError: Xpra or Xephyr not found in /usr/bin directory, please install one of them:\n");
1070 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n"); 1156 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xpra\n");
1071 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n"); 1157 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xserver-xephyr\n");
1158 fprintf(stderr, " Arch: sudo pacman -S xpra\n");
1159 fprintf(stderr, " Arch: sudo pacman -S xorg-server-xephyr\n");
1160 fprintf(stderr, " Fedora: sudo dnf install xpra\n");
1161 fprintf(stderr, " Fedora: sudo dnf install xorg-x11-server-Xephyr\n");
1072 exit(0); 1162 exit(0);
1073 } 1163 }
1074} 1164}
1075#endif 1165#endif
1076 1166
1077// Porting notes: 1167
1078//
1079// 1. merge #1100 from zackw:
1080// Attempting to run xauth -f directly on a file in /run/firejail/mnt/ directory fails on Debian 8
1081// with this message:
1082// xauth: timeout in locking authority file /run/firejail/mnt/sec.Xauthority-Qt5Mu4
1083// Failed to create untrusted X cookie: xauth: exit 1
1084// For this reason we run xauth on a file in a tmpfs filesystem mounted on /tmp. This was
1085// a partial merge.
1086//
1087// 2. Since we cannot deal with the TOCTOU condition when mounting .Xauthority in user home
1088// directory, we need to make sure /usr/bin/xauth executable is the real thing, and not
1089// something picked up on $PATH.
1090//
1091// 3. If for any reason xauth command fails, we exit the sandbox. On Debian 8 this happens
1092// when using a network namespace. Somehow, xauth tries to connect to the abstract socket,
1093// and it fails because of the network namespace - it should try to connect to the regular
1094// Unix socket! If we ignore the fail condition, the program will be started on X server without
1095// the security extension loaded.
1096void x11_xorg(void) { 1168void x11_xorg(void) {
1097#ifdef HAVE_X11 1169#ifdef HAVE_X11
1098 1170
1099 // check xauth utility is present in the system
1100 struct stat s;
1101 if (stat("/usr/bin/xauth", &s) == -1) {
1102 fprintf(stderr, "Error: xauth utility not found in PATH. Please install it:\n"
1103 " Debian/Ubuntu/Mint: sudo apt-get install xauth\n");
1104 exit(1);
1105 }
1106 if (s.st_uid != 0 && s.st_gid != 0) {
1107 fprintf(stderr, "Error: invalid /usr/bin/xauth executable\n");
1108 exit(1);
1109 }
1110
1111 // get DISPLAY env 1171 // get DISPLAY env
1112 char *display = getenv("DISPLAY"); 1172 const char *display = env_get("DISPLAY");
1113 if (!display) { 1173 if (!display) {
1114 fputs("Error: --x11=xorg requires an 'outer' X11 server to use.\n", stderr); 1174 fputs("Error: --x11=xorg requires an 'outer' X11 server to use.\n", stderr);
1115 exit(1); 1175 exit(1);
1116 } 1176 }
1117 1177
1118 // temporarily mount a tempfs on top of /tmp directory 1178 // check xauth utility is present in the system
1119 if (mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=777,gid=0") < 0) 1179 struct stat s;
1120 errExit("mounting /tmp"); 1180 if (stat("/usr/bin/xauth", &s) == -1) {
1121 1181 fprintf(stderr, "Error: xauth utility not found in /usr/bin. Please install it:\n");
1122 // create the temporary .Xauthority file 1182 fprintf(stderr, " Debian/Ubuntu/Mint: sudo apt-get install xauth\n");
1123 if (arg_debug) 1183 fprintf(stderr, " Arch: sudo pacman -S xorg-xauth\n");
1124 printf("Generating a new .Xauthority file\n"); 1184 fprintf(stderr, " Fedora: sudo dnf install xorg-x11-xauth\n");
1125 char tmpfname[] = "/tmp/.tmpXauth-XXXXXX";
1126 int fd = mkstemp(tmpfname);
1127 if (fd == -1) {
1128 fprintf(stderr, "Error: cannot create .Xauthority file\n");
1129 exit(1); 1185 exit(1);
1130 } 1186 }
1131 if (fchown(fd, getuid(), getgid()) == -1) 1187 if ((s.st_uid != 0 && s.st_gid != 0) || (s.st_mode & S_IWOTH)) {
1132 errExit("chown"); 1188 fprintf(stderr, "Error: invalid /usr/bin/xauth executable\n");
1133 close(fd);
1134
1135 pid_t child = fork();
1136 if (child < 0)
1137 errExit("fork");
1138 if (child == 0) {
1139 drop_privs(1);
1140 clearenv();
1141#ifdef HAVE_GCOV
1142 __gcov_flush();
1143#endif
1144 execlp("/usr/bin/xauth", "/usr/bin/xauth", "-v", "-f", tmpfname,
1145 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted", NULL);
1146
1147 _exit(127);
1148 }
1149
1150 // wait for the xauth process to finish
1151 int status;
1152 if (waitpid(child, &status, 0) != child)
1153 errExit("waitpid");
1154 if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
1155 /* success */
1156 }
1157 else if (WIFEXITED(status)) {
1158 fprintf(stderr, "Failed to create untrusted X cookie: xauth: exit %d\n",
1159 WEXITSTATUS(status));
1160 exit(1); 1189 exit(1);
1161 } 1190 }
1162 else if (WIFSIGNALED(status)) { 1191 if (s.st_size > 1024 * 1024) {
1163 fprintf(stderr, "Failed to create untrusted X cookie: xauth: %s\n", 1192 fprintf(stderr, "Error: /usr/bin/xauth executable is too large\n");
1164 strsignal(WTERMSIG(status)));
1165 exit(1); 1193 exit(1);
1166 } 1194 }
1167 else { 1195 // copy /usr/bin/xauth in the sandbox and set mode to 0711
1168 fprintf(stderr, "Failed to create untrusted X cookie: " 1196 // users are not able to trace the running xauth this way
1169 "xauth: un-decodable exit status %04x\n", status); 1197 if (arg_debug)
1198 printf("Copying /usr/bin/xauth to %s\n", RUN_XAUTH_FILE);
1199 if (copy_file("/usr/bin/xauth", RUN_XAUTH_FILE, 0, 0, 0711)) {
1200 fprintf(stderr, "Error: cannot copy /usr/bin/xauth executable\n");
1170 exit(1); 1201 exit(1);
1171 } 1202 }
1172 1203
1173 // ensure the file has the correct permissions and move it 1204 fmessage("Generating a new .Xauthority file\n");
1174 // into the correct location. 1205 mkdir_attr(RUN_XAUTHORITY_SEC_DIR, 0700, getuid(), getgid());
1175 if (stat(tmpfname, &s) == -1) { 1206 // create new Xauthority file in RUN_XAUTHORITY_SEC_DIR
1176 fprintf(stderr, "Error: .Xauthority file was not created\n"); 1207 EUID_USER();
1208 char tmpfname[] = RUN_XAUTHORITY_SEC_DIR "/.Xauth-XXXXXX";
1209 int fd = mkstemp(tmpfname);
1210 if (fd == -1) {
1211 fprintf(stderr, "Error: cannot create .Xauthority file\n");
1177 exit(1); 1212 exit(1);
1178 } 1213 }
1179 if (set_perms(tmpfname, getuid(), getgid(), 0600)) 1214 close(fd);
1180 errExit("set_perms");
1181 1215
1182 // move the temporary file in RUN_XAUTHORITY_SEC_FILE in order to have it deleted 1216 // run xauth
1183 // automatically when the sandbox is closed (rename doesn't work) 1217 if (arg_debug)
1184 // root needed 1218 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 8, RUN_XAUTH_FILE, "-v", "-f", tmpfname,
1185 if (copy_file(tmpfname, RUN_XAUTHORITY_SEC_FILE, getuid(), getgid(), 0600)) { 1219 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted");
1186 fprintf(stderr, "Error: cannot create the new .Xauthority file\n"); 1220 else
1187 exit(1); 1221 sbox_run(SBOX_USER | SBOX_CAPS_NONE | SBOX_SECCOMP, 7, RUN_XAUTH_FILE, "-f", tmpfname,
1188 } 1222 "generate", display, "MIT-MAGIC-COOKIE-1", "untrusted");
1189 if (set_perms(RUN_XAUTHORITY_SEC_FILE, getuid(), getgid(), 0600))
1190 errExit("set_perms");
1191 /* coverity[toctou] */
1192 unlink(tmpfname);
1193 umount("/tmp");
1194 1223
1195 // Ensure there is already a file in the usual location, so that bind-mount below will work. 1224 // ensure there is already a file ~/.Xauthority, so that bind-mount below will work.
1196 // todo: fix TOCTOU races, currently managed by imposing /usr/bin/xauth as executable
1197 char *dest; 1225 char *dest;
1198 if (asprintf(&dest, "%s/.Xauthority", cfg.homedir) == -1) 1226 if (asprintf(&dest, "%s/.Xauthority", cfg.homedir) == -1)
1199 errExit("asprintf"); 1227 errExit("asprintf");
1200 if (stat(dest, &s) == -1) { 1228 if (access(dest, F_OK) == -1) {
1201 // create an .Xauthority file 1229 touch_file_as_user(dest, 0600);
1202 touch_file_as_user(dest, getuid(), getgid(), 0600); 1230 if (access(dest, F_OK) == -1) {
1231 fprintf(stderr, "Error: cannot create %s\n", dest);
1232 exit(1);
1233 }
1203 } 1234 }
1204 if (is_link(dest)) { 1235 // get a file descriptor for ~/.Xauthority
1205 fprintf(stderr, "Error: .Xauthority is a symbolic link\n"); 1236 int dst = safer_openat(-1, dest, O_PATH|O_NOFOLLOW|O_CLOEXEC);
1237 if (dst == -1)
1238 errExit("safer_openat");
1239 // check if the actual mount destination is a user owned regular file
1240 if (fstat(dst, &s) == -1)
1241 errExit("fstat");
1242 if (!S_ISREG(s.st_mode) || s.st_uid != getuid()) {
1243 if (S_ISLNK(s.st_mode))
1244 fprintf(stderr, "Error: .Xauthority is a symbolic link\n");
1245 else
1246 fprintf(stderr, "Error: .Xauthority is not a user owned regular file\n");
1206 exit(1); 1247 exit(1);
1207 } 1248 }
1249 // preserve a read-only mount
1250 struct statvfs vfs;
1251 if (fstatvfs(dst, &vfs) == -1)
1252 errExit("fstatvfs");
1253 if ((vfs.f_flag & MS_RDONLY) == MS_RDONLY)
1254 fs_remount(RUN_XAUTHORITY_SEC_DIR, MOUNT_READONLY, 0);
1208 1255
1209 // mount 1256 // always mounting the new Xauthority file noexec,nodev,nosuid
1210 if (mount(RUN_XAUTHORITY_SEC_FILE, dest, "none", MS_BIND, "mode=0600") == -1) { 1257 fs_remount(RUN_XAUTHORITY_SEC_DIR, MOUNT_NOEXEC, 0);
1258
1259 // get a file descriptor for the new Xauthority file
1260 int src = safer_openat(-1, tmpfname, O_PATH|O_NOFOLLOW|O_CLOEXEC);
1261 if (src == -1)
1262 errExit("safer_openat");
1263 if (fstat(src, &s) == -1)
1264 errExit("fstat");
1265 if (!S_ISREG(s.st_mode)) {
1266 errno = EPERM;
1267 errExit("mounting Xauthority file");
1268 }
1269
1270 // mount via the link in /proc/self/fd
1271 if (arg_debug)
1272 printf("Mounting %s on %s\n", tmpfname, dest);
1273 EUID_ROOT();
1274 if (bind_mount_by_fd(src, dst)) {
1211 fprintf(stderr, "Error: cannot mount the new .Xauthority file\n"); 1275 fprintf(stderr, "Error: cannot mount the new .Xauthority file\n");
1212 exit(1); 1276 exit(1);
1213 } 1277 }
1214 // just in case... 1278 EUID_USER();
1215 if (set_perms(dest, getuid(), getgid(), 0600)) 1279 // check /proc/self/mountinfo to confirm the mount is ok
1216 errExit("set_perms"); 1280 MountData *mptr = get_last_mount();
1281 if (strcmp(mptr->dir, dest) != 0 || strcmp(mptr->fstype, "tmpfs") != 0)
1282 errLogExit("invalid .Xauthority mount");
1283 close(src);
1284 close(dst);
1285
1286 ASSERT_PERMS(dest, getuid(), getgid(), 0600);
1287
1288 // blacklist user .Xauthority file if it is not masked already
1289 const char *envar = env_get("XAUTHORITY");
1290 if (envar) {
1291 char *rp = realpath(envar, NULL);
1292 if (rp) {
1293 if (strcmp(rp, dest) != 0) {
1294 EUID_ROOT();
1295 disable_file_or_dir(rp);
1296 EUID_USER();
1297 }
1298 free(rp);
1299 }
1300 }
1301 // set environment variable
1302 env_store_name_val("XAUTHORITY", dest, SETENV);
1217 free(dest); 1303 free(dest);
1304
1305 // mask RUN_XAUTHORITY_SEC_DIR
1306 EUID_ROOT();
1307 if (mount("tmpfs", RUN_XAUTHORITY_SEC_DIR, "tmpfs", MS_NOSUID | MS_NODEV | MS_STRICTATIME, "mode=755,gid=0") < 0)
1308 errExit("mounting tmpfs");
1309 fs_logger2("tmpfs", RUN_XAUTHORITY_SEC_DIR);
1310
1311 // cleanup
1312 unlink(RUN_XAUTH_FILE);
1218#endif 1313#endif
1219} 1314}
1220 1315
@@ -1225,60 +1320,58 @@ void fs_x11(void) {
1225 if (display <= 0) 1320 if (display <= 0)
1226 return; 1321 return;
1227 1322
1323 struct stat s1, s2;
1324 if (stat("/tmp", &s1) != 0 || lstat("/tmp/.X11-unix", &s2) != 0)
1325 return;
1326 if ((s1.st_mode & S_ISVTX) != S_ISVTX) {
1327 fwarning("cannot mask X11 sockets: sticky bit not set on /tmp directory\n");
1328 return;
1329 }
1330 if (s2.st_uid != 0) {
1331 fwarning("cannot mask X11 sockets: /tmp/.X11-unix not owned by root user\n");
1332 return;
1333 }
1334
1335 // the mount source is under control of the user, so be careful and
1336 // mount without following symbolic links, using a file descriptor
1228 char *x11file; 1337 char *x11file;
1229 if (asprintf(&x11file, "/tmp/.X11-unix/X%d", display) == -1) 1338 if (asprintf(&x11file, "/tmp/.X11-unix/X%d", display) == -1)
1230 errExit("asprintf"); 1339 errExit("asprintf");
1231 struct stat x11stat; 1340 int src = open(x11file, O_PATH|O_NOFOLLOW|O_CLOEXEC);
1232 if (stat(x11file, &x11stat) == -1 || !S_ISSOCK(x11stat.st_mode)) { 1341 if (src < 0) {
1342 free(x11file);
1343 return;
1344 }
1345 struct stat s3;
1346 if (fstat(src, &s3) < 0)
1347 errExit("fstat");
1348 if (!S_ISSOCK(s3.st_mode)) {
1349 close(src);
1233 free(x11file); 1350 free(x11file);
1234 return; 1351 return;
1235 } 1352 }
1236 1353
1237 if (arg_debug || arg_debug_whitelists) 1354 if (arg_debug || arg_debug_whitelists)
1238 fprintf(stderr, "Masking all X11 sockets except %s\n", x11file); 1355 fprintf(stderr, "Masking all X11 sockets except %s\n", x11file);
1239 1356 // This directory must be mode 1777
1240 // Move the real /tmp/.X11-unix to a scratch location
1241 // so we can still access x11file after we mount a
1242 // tmpfs over /tmp/.X11-unix.
1243 int rv = mkdir(RUN_WHITELIST_X11_DIR, 0700);
1244 if (rv == -1)
1245 errExit("mkdir");
1246 if (set_perms(RUN_WHITELIST_X11_DIR, 0, 0, 0700))
1247 errExit("set_perms");
1248
1249 if (mount("/tmp/.X11-unix", RUN_WHITELIST_X11_DIR, 0, MS_BIND|MS_REC, 0) < 0)
1250 errExit("mount bind");
1251
1252 // This directory must be mode 1777, or Xlib will barf.
1253 if (mount("tmpfs", "/tmp/.X11-unix", "tmpfs", 1357 if (mount("tmpfs", "/tmp/.X11-unix", "tmpfs",
1254 MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME | MS_REC, 1358 MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_STRICTATIME,
1255 "mode=1777,uid=0,gid=0") < 0) 1359 "mode=1777,uid=0,gid=0") < 0)
1256 errExit("mounting tmpfs on /tmp/.X11-unix"); 1360 errExit("mounting tmpfs on /tmp/.X11-unix");
1361 selinux_relabel_path("/tmp/.X11-unix", "/tmp/.X11-unix");
1257 fs_logger("tmpfs /tmp/.X11-unix"); 1362 fs_logger("tmpfs /tmp/.X11-unix");
1258 1363
1259 // create an empty file which will have the desired socket bind-mounted over it 1364 // create an empty root-owned file which will have the desired socket bind-mounted over it
1260 int fd = open(x11file, O_RDWR|O_CREAT|O_EXCL, x11stat.st_mode & ~S_IFMT); 1365 int dst = open(x11file, O_RDONLY|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR | S_IWUSR);
1261 if (fd < 0) 1366 if (dst < 0)
1262 errExit(x11file); 1367 errExit("open");
1263 if (fchown(fd, x11stat.st_uid, x11stat.st_gid))
1264 errExit("fchown");
1265 close(fd);
1266 1368
1267 // do the mount 1369 if (bind_mount_by_fd(src, dst))
1268 char *wx11file;
1269 if (asprintf(&wx11file, "%s/X%d", RUN_WHITELIST_X11_DIR, display) == -1)
1270 errExit("asprintf");
1271 if (mount(wx11file, x11file, NULL, MS_BIND|MS_REC, NULL) < 0)
1272 errExit("mount bind"); 1370 errExit("mount bind");
1371 close(src);
1372 close(dst);
1273 fs_logger2("whitelist", x11file); 1373 fs_logger2("whitelist", x11file);
1274
1275 free(x11file); 1374 free(x11file);
1276 free(wx11file);
1277
1278 // block access to RUN_WHITELIST_X11_DIR
1279 if (mount(RUN_RO_DIR, RUN_WHITELIST_X11_DIR, 0, MS_BIND, 0) < 0)
1280 errExit("mount");
1281 fs_logger2("blacklist", RUN_WHITELIST_X11_DIR);
1282#endif 1375#endif
1283} 1376}
1284 1377
@@ -1286,7 +1379,7 @@ void fs_x11(void) {
1286void x11_block(void) { 1379void x11_block(void) {
1287#ifdef HAVE_X11 1380#ifdef HAVE_X11
1288 // check abstract socket presence and network namespace options 1381 // check abstract socket presence and network namespace options
1289 if ((!arg_nonetwork && !cfg.bridge0.configured && !cfg.interface0.configured) 1382 if ((!arg_nonetwork && !arg_netns && !cfg.bridge0.configured && !cfg.interface0.configured)
1290 && x11_abstract_sockets_present()) { 1383 && x11_abstract_sockets_present()) {
1291 fprintf(stderr, "ERROR: --x11=none specified, but abstract X11 socket still accessible.\n" 1384 fprintf(stderr, "ERROR: --x11=none specified, but abstract X11 socket still accessible.\n"
1292 "Additional setup required. To block abstract X11 socket you can either:\n" 1385 "Additional setup required. To block abstract X11 socket you can either:\n"
@@ -1297,13 +1390,19 @@ void x11_block(void) {
1297 } 1390 }
1298 1391
1299 // blacklist sockets 1392 // blacklist sockets
1300 profile_check_line("blacklist /tmp/.X11-unix", 0, NULL); 1393 char *cmd = strdup("blacklist /tmp/.X11-unix");
1301 profile_add(strdup("blacklist /tmp/.X11-unix")); 1394 if (!cmd)
1395 errExit("strdup");
1396 profile_check_line(cmd, 0, NULL);
1397 profile_add(cmd);
1302 1398
1303 // blacklist .Xauthority 1399 // blacklist .Xauthority
1304 profile_check_line("blacklist ${HOME}/.Xauthority", 0, NULL); 1400 cmd = strdup("blacklist ${HOME}/.Xauthority");
1305 profile_add(strdup("blacklist ${HOME}/.Xauthority")); 1401 if (!cmd)
1306 char *xauthority = getenv("XAUTHORITY"); 1402 errExit("strdup");
1403 profile_check_line(cmd, 0, NULL);
1404 profile_add(cmd);
1405 const char *xauthority = env_get("XAUTHORITY");
1307 if (xauthority) { 1406 if (xauthority) {
1308 char *line; 1407 char *line;
1309 if (asprintf(&line, "blacklist %s", xauthority) == -1) 1408 if (asprintf(&line, "blacklist %s", xauthority) == -1)
diff --git a/src/firemon/Makefile.in b/src/firemon/Makefile.in
index c24bae9ff..a1b6692aa 100644
--- a/src/firemon/Makefile.in
+++ b/src/firemon/Makefile.in
@@ -1,30 +1,17 @@
1.PHONY: all
1all: firemon 2all: firemon
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5VERSION=@PACKAGE_VERSION@
6NAME=@PACKAGE_NAME@
7HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
8HAVE_GCOV=@HAVE_GCOV@
9EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
10 5
11H_FILE_LIST = $(sort $(wildcard *.[h])) 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/pid.h
12C_FILE_LIST = $(sort $(wildcard *.c)) 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
13OBJS = $(C_FILE_LIST:.c=.o)
14BINOBJS = $(foreach file, $(OBJS), $file)
15CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -DPREFIX='"$(prefix)"' $(HAVE_GCOV) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
16LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now
17HAVE_GCOV=@HAVE_GCOV@
18EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
19
20
21%.o : %.c $(H_FILE_LIST)
22 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
23 8
24firemon: $(OBJS) ../lib/common.o ../lib/pid.o 9firemon: $(OBJS) ../lib/common.o ../lib/pid.o
25 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/pid.o $(LIBS) $(EXTRA_LDFLAGS) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/pid.o $(LIBS) $(EXTRA_LDFLAGS)
26 11
27clean:; rm -f *.o firemon *.gcov *.gcda *.gcno 12.PHONY: clean
13clean:; rm -fr *.o firemon *.gcov *.gcda *.gcno *.plist
28 14
15.PHONY: distclean
29distclean: clean 16distclean: clean
30 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/firemon/apparmor.c b/src/firemon/apparmor.c
new file mode 100644
index 000000000..eb810a9e7
--- /dev/null
+++ b/src/firemon/apparmor.c
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "firemon.h"
21
22#ifdef HAVE_APPARMOR
23#include <sys/apparmor.h>
24
25static void print_apparmor(int pid) {
26 char *label = NULL;
27 char *mode = NULL;
28 int rv = aa_gettaskcon(pid, &label, &mode);
29 if (rv != -1) {
30 printf(" AppArmor: ");
31 if (label)
32 printf("%s ", label);
33 if (mode)
34 printf("%s", mode);
35 printf("\n");
36 }
37}
38
39void apparmor(pid_t pid, int print_procs) {
40 pid_read(pid);
41
42 // print processes
43 int i;
44 for (i = 0; i < max_pids; i++) {
45 if (pids[i].level == 1) {
46 if (print_procs || pid == 0)
47 pid_print_list(i, arg_wrap);
48 int child = find_child(i);
49 if (child != -1)
50 print_apparmor(child);
51 }
52 }
53 printf("\n");
54}
55
56#else
57
58void apparmor(pid_t pid, int print_procs) {
59 (void) pid;
60 (void) print_procs;
61 printf("AppArmor support not available\n");
62}
63#endif
diff --git a/src/firemon/arp.c b/src/firemon/arp.c
index dad183b85..1a69a67b1 100644
--- a/src/firemon/arp.c
+++ b/src/firemon/arp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -51,7 +51,7 @@ static void print_arp(const char *fname) {
51 char mac[64]; 51 char mac[64];
52 char mask[64]; 52 char mask[64];
53 char device[64]; 53 char device[64];
54 int rv = sscanf(start, "%s %s %s %s %s %s\n", ip, type, flags, mac, mask, device); 54 int rv = sscanf(start, "%63s %63s %63s %63s %63s %63s\n", ip, type, flags, mac, mask, device);
55 if (rv != 6) 55 if (rv != 6)
56 continue; 56 continue;
57 57
@@ -80,7 +80,7 @@ void arp(pid_t pid, int print_procs) {
80 for (i = 0; i < max_pids; i++) { 80 for (i = 0; i < max_pids; i++) {
81 if (pids[i].level == 1) { 81 if (pids[i].level == 1) {
82 if (print_procs || pid == 0) 82 if (print_procs || pid == 0)
83 pid_print_list(i, arg_nowrap); 83 pid_print_list(i, arg_wrap);
84 int child = find_child(i); 84 int child = find_child(i);
85 if (child != -1) { 85 if (child != -1) {
86 char *fname; 86 char *fname;
diff --git a/src/firemon/caps.c b/src/firemon/caps.c
index 09955d983..c0f305a5d 100644
--- a/src/firemon/caps.c
+++ b/src/firemon/caps.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -53,7 +53,7 @@ void caps(pid_t pid, int print_procs) {
53 for (i = 0; i < max_pids; i++) { 53 for (i = 0; i < max_pids; i++) {
54 if (pids[i].level == 1) { 54 if (pids[i].level == 1) {
55 if (print_procs || pid == 0) 55 if (print_procs || pid == 0)
56 pid_print_list(i, arg_nowrap); 56 pid_print_list(i, arg_wrap);
57 int child = find_child(i); 57 int child = find_child(i);
58 if (child != -1) 58 if (child != -1)
59 print_caps(child); 59 print_caps(child);
diff --git a/src/firemon/cgroup.c b/src/firemon/cgroup.c
index 6b39ee385..97ba591a6 100644
--- a/src/firemon/cgroup.c
+++ b/src/firemon/cgroup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -53,7 +53,7 @@ void cgroup(pid_t pid, int print_procs) {
53 for (i = 0; i < max_pids; i++) { 53 for (i = 0; i < max_pids; i++) {
54 if (pids[i].level == 1) { 54 if (pids[i].level == 1) {
55 if (print_procs || pid == 0) 55 if (print_procs || pid == 0)
56 pid_print_list(i, arg_nowrap); 56 pid_print_list(i, arg_wrap);
57 int child = find_child(i); 57 int child = find_child(i);
58 if (child != -1) 58 if (child != -1)
59 print_cgroup(child); 59 print_cgroup(child);
diff --git a/src/firemon/cpu.c b/src/firemon/cpu.c
index 6a7310c34..91b455941 100644
--- a/src/firemon/cpu.c
+++ b/src/firemon/cpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -54,7 +54,7 @@ void cpu(pid_t pid, int print_procs) {
54 for (i = 0; i < max_pids; i++) { 54 for (i = 0; i < max_pids; i++) {
55 if (pids[i].level == 1) { 55 if (pids[i].level == 1) {
56 if (print_procs || pid == 0) 56 if (print_procs || pid == 0)
57 pid_print_list(i, arg_nowrap); 57 pid_print_list(i, arg_wrap);
58 int child = find_child(i); 58 int child = find_child(i);
59 if (child != -1) 59 if (child != -1)
60 print_cpu(child); 60 print_cpu(child);
diff --git a/src/firemon/firemon.c b/src/firemon/firemon.c
index 1f3fdd578..6c34cd411 100644
--- a/src/firemon/firemon.c
+++ b/src/firemon/firemon.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,6 +25,8 @@
25#include <grp.h> 25#include <grp.h>
26#include <sys/stat.h> 26#include <sys/stat.h>
27 27
28pid_t skip_process = 0;
29int arg_debug = 0;
28static int arg_route = 0; 30static int arg_route = 0;
29static int arg_arp = 0; 31static int arg_arp = 0;
30static int arg_tree = 0; 32static int arg_tree = 0;
@@ -37,7 +39,8 @@ static int arg_x11 = 0;
37static int arg_top = 0; 39static int arg_top = 0;
38static int arg_list = 0; 40static int arg_list = 0;
39static int arg_netstats = 0; 41static int arg_netstats = 0;
40int arg_nowrap = 0; 42static int arg_apparmor = 0;
43int arg_wrap = 0;
41 44
42static struct termios tlocal; // startup terminal setting 45static struct termios tlocal; // startup terminal setting
43static struct termios twait; // no wait on key press 46static struct termios twait; // no wait on key press
@@ -49,24 +52,31 @@ static void my_handler(int s){
49 52
50 if (terminal_set) 53 if (terminal_set)
51 tcsetattr(0, TCSANOW, &tlocal); 54 tcsetattr(0, TCSANOW, &tlocal);
52 exit(0); 55 _exit(0);
53} 56}
54 57
55// find the second child process for the specified pid 58// find the second child process for the specified pid
56// return -1 if not found 59// return -1 if not found
57// 60//
58// Example: 61// Example:
59//14776:netblue:/usr/bin/firejail /usr/bin/transmission-qt 62//14776:netblue:/usr/bin/firejail /usr/bin/transmission-qt
60// 14777:netblue:/usr/bin/firejail /usr/bin/transmission-qt 63// 14777:netblue:/usr/bin/firejail /usr/bin/transmission-qt
61// 14792:netblue:/usr/bin/transmission-qt 64// 14792:netblue:/usr/bin/transmission-qt
62// We need 14792, the first real sandboxed process 65// We need 14792, the first real sandboxed process
63int find_child(int id) { 66int find_child(int id) {
64 int i; 67 int i;
65 int first_child = -1; 68 int first_child = -1;
66 69
67 // find the first child 70 // find the first child
68 for (i = 0; i < max_pids; i++) { 71 for (i = 0; i < max_pids; i++) {
69 if (pids[i].level == 2 && pids[i].parent == id) { 72 if (pids[i].level == 2 && pids[i].parent == id) {
73 // skip /usr/bin/xdg-dbus-proxy (started by firejail for dbus filtering)
74 char *cmdline = pid_proc_cmdline(i);
75 if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) == 0) {
76 free(cmdline);
77 continue;
78 }
79 free(cmdline);
70 first_child = i; 80 first_child = i;
71 break; 81 break;
72 } 82 }
@@ -74,14 +84,16 @@ int find_child(int id) {
74 84
75 if (first_child == -1) 85 if (first_child == -1)
76 return -1; 86 return -1;
77 87
78 // find the second child 88 // find the second-level child
79 for (i = 0; i < max_pids; i++) { 89 for (i = 0; i < max_pids; i++) {
80 if (pids[i].level == 3 && pids[i].parent == first_child) 90 if (pids[i].level == 3 && pids[i].parent == first_child)
81 return i; 91 return i;
82 } 92 }
83 93
84 return -1; 94 // if a second child is not found, return the first child pid
95 // this happens for processes sandboxed with --join
96 return first_child;
85} 97}
86 98
87// sleep and wait for a key to be pressed 99// sleep and wait for a key to be pressed
@@ -138,7 +150,8 @@ int main(int argc, char **argv) {
138 printf("firemon version %s\n\n", VERSION); 150 printf("firemon version %s\n\n", VERSION);
139 return 0; 151 return 0;
140 } 152 }
141 153 else if (strcmp(argv[i], "--debug") == 0)
154 arg_debug = 1;
142 // options without a pid argument 155 // options without a pid argument
143 else if (strcmp(argv[i], "--top") == 0) 156 else if (strcmp(argv[i], "--top") == 0)
144 arg_top = 1; 157 arg_top = 1;
@@ -146,6 +159,7 @@ int main(int argc, char **argv) {
146 arg_list = 1; 159 arg_list = 1;
147 else if (strcmp(argv[i], "--tree") == 0) 160 else if (strcmp(argv[i], "--tree") == 0)
148 arg_tree = 1; 161 arg_tree = 1;
162#ifdef HAVE_NETWORK
149 else if (strcmp(argv[i], "--netstats") == 0) { 163 else if (strcmp(argv[i], "--netstats") == 0) {
150 struct stat s; 164 struct stat s;
151 if (getuid() != 0 && stat("/proc/sys/kernel/grsecurity", &s) == 0) { 165 if (getuid() != 0 && stat("/proc/sys/kernel/grsecurity", &s) == 0) {
@@ -154,7 +168,7 @@ int main(int argc, char **argv) {
154 } 168 }
155 arg_netstats = 1; 169 arg_netstats = 1;
156 } 170 }
157 171#endif
158 172
159 // cumulative options with or without a pid argument 173 // cumulative options with or without a pid argument
160 else if (strcmp(argv[i], "--x11") == 0) 174 else if (strcmp(argv[i], "--x11") == 0)
@@ -174,10 +188,14 @@ int main(int argc, char **argv) {
174 } 188 }
175 arg_interface = 1; 189 arg_interface = 1;
176 } 190 }
191#ifdef HAVE_NETWORK
177 else if (strcmp(argv[i], "--route") == 0) 192 else if (strcmp(argv[i], "--route") == 0)
178 arg_route = 1; 193 arg_route = 1;
179 else if (strcmp(argv[i], "--arp") == 0) 194 else if (strcmp(argv[i], "--arp") == 0)
180 arg_arp = 1; 195 arg_arp = 1;
196#endif
197 else if (strcmp(argv[i], "--apparmor") == 0)
198 arg_apparmor = 1;
181 199
182 else if (strncmp(argv[i], "--name=", 7) == 0) { 200 else if (strncmp(argv[i], "--name=", 7) == 0) {
183 char *name = argv[i] + 7; 201 char *name = argv[i] + 7;
@@ -188,8 +206,8 @@ int main(int argc, char **argv) {
188 } 206 }
189 207
190 // etc 208 // etc
191 else if (strcmp(argv[i], "--nowrap") == 0) 209 else if (strcmp(argv[i], "--wrap") == 0)
192 arg_nowrap = 1; 210 arg_wrap = 1;
193 211
194 // invalid option 212 // invalid option
195 else if (*argv[i] == '-') { 213 else if (*argv[i] == '-') {
@@ -214,6 +232,13 @@ int main(int argc, char **argv) {
214 } 232 }
215 } 233 }
216 234
235
236 // if the parent is firejail, skip the process
237 pid_t ppid = getppid();
238 char *pcomm = pid_proc_comm(ppid);
239 if (pcomm && strcmp(pcomm, "firejail") == 0)
240 skip_process = ppid;
241
217 // allow only root user if /proc is mounted hidepid 242 // allow only root user if /proc is mounted hidepid
218 if (pid_hidepid() && getuid() != 0) { 243 if (pid_hidepid() && getuid() != 0) {
219 fprintf(stderr, "Error: /proc is mounted hidepid, you would need to be root to run this command\n"); 244 fprintf(stderr, "Error: /proc is mounted hidepid, you would need to be root to run this command\n");
@@ -232,9 +257,13 @@ int main(int argc, char **argv) {
232 netstats(); // print all sandboxes, --name disregarded 257 netstats(); // print all sandboxes, --name disregarded
233 return 0; 258 return 0;
234 } 259 }
260 if (arg_tree) {
261 tree(pid);
262 return 0;
263 }
235 264
236 // if --name requested without other options, print all data 265 // if --name requested without other options, print all data
237 if (pid && !arg_tree && !arg_cpu && !arg_seccomp && !arg_caps && 266 if (pid && !arg_cpu && !arg_seccomp && !arg_caps && !arg_apparmor &&
238 !arg_cgroup && !arg_x11 && !arg_interface && !arg_route && !arg_arp) { 267 !arg_cgroup && !arg_x11 && !arg_interface && !arg_route && !arg_arp) {
239 arg_tree = 1; 268 arg_tree = 1;
240 arg_cpu = 1; 269 arg_cpu = 1;
@@ -245,14 +274,11 @@ int main(int argc, char **argv) {
245 arg_interface = 1; 274 arg_interface = 1;
246 arg_route = 1; 275 arg_route = 1;
247 arg_arp = 1; 276 arg_arp = 1;
277 arg_apparmor = 1;
248 } 278 }
249 279
250 // cumulative options 280 // cumulative options
251 int print_procs = 1; 281 int print_procs = 1;
252 if (arg_tree) {
253 tree((pid_t) pid);
254 print_procs = 0;
255 }
256 if (arg_cpu) { 282 if (arg_cpu) {
257 cpu((pid_t) pid, print_procs); 283 cpu((pid_t) pid, print_procs);
258 print_procs = 0; 284 print_procs = 0;
@@ -265,6 +291,10 @@ int main(int argc, char **argv) {
265 caps((pid_t) pid, print_procs); 291 caps((pid_t) pid, print_procs);
266 print_procs = 0; 292 print_procs = 0;
267 } 293 }
294 if (arg_apparmor) {
295 apparmor((pid_t) pid, print_procs);
296 print_procs = 0;
297 }
268 if (arg_cgroup) { 298 if (arg_cgroup) {
269 cgroup((pid_t) pid, print_procs); 299 cgroup((pid_t) pid, print_procs);
270 print_procs = 0; 300 print_procs = 0;
@@ -285,10 +315,10 @@ int main(int argc, char **argv) {
285 arp((pid_t) pid, print_procs); 315 arp((pid_t) pid, print_procs);
286 print_procs = 0; 316 print_procs = 0;
287 } 317 }
318 (void) print_procs;
288 319
289 if (getuid() == 0) { 320 if (getuid() == 0) {
290 if (!arg_tree) 321 tree((pid_t) pid); // pid initialized as zero, will print the tree for all processes if a specific pid was not requested
291 tree((pid_t) pid);
292 procevent((pid_t) pid); 322 procevent((pid_t) pid);
293 } 323 }
294 324
diff --git a/src/firemon/firemon.h b/src/firemon/firemon.h
index 9798ed545..5252ad34f 100644
--- a/src/firemon/firemon.h
+++ b/src/firemon/firemon.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -29,6 +29,9 @@
29#include "../include/pid.h" 29#include "../include/pid.h"
30#include "../include/common.h" 30#include "../include/common.h"
31 31
32// main.c
33extern int arg_debug;
34
32// clear screen 35// clear screen
33static inline void firemon_clrscr(void) { 36static inline void firemon_clrscr(void) {
34 printf("\033[2J\033[1;1H"); 37 printf("\033[2J\033[1;1H");
@@ -36,19 +39,20 @@ static inline void firemon_clrscr(void) {
36} 39}
37 40
38// firemon.c 41// firemon.c
39extern int arg_nowrap; 42extern pid_t skip_process;
43extern int arg_wrap;
40int find_child(int id); 44int find_child(int id);
41void firemon_sleep(int st); 45void firemon_sleep(int st);
42 46
43 47
44// procevent.c 48// procevent.c
45void procevent(pid_t pid); 49void procevent(pid_t pid) __attribute__((noreturn));
46 50
47// usage.c 51// usage.c
48void usage(void); 52void usage(void);
49 53
50// top.c 54// top.c
51void top(void); 55void top(void) __attribute__((noreturn));
52 56
53// list.c 57// list.c
54void list(void); 58void list(void);
@@ -78,9 +82,12 @@ void cgroup(pid_t pid, int print_procs);
78void tree(pid_t pid); 82void tree(pid_t pid);
79 83
80// netstats.c 84// netstats.c
81void netstats(void); 85void netstats(void) __attribute__((noreturn));
82 86
83// x11.c 87// x11.c
84void x11(pid_t pid, int print_procs); 88void x11(pid_t pid, int print_procs);
85 89
90//apparmor.c
91void apparmor(pid_t pid, int print_procs);
92
86#endif 93#endif
diff --git a/src/firemon/interface.c b/src/firemon/interface.c
index 839cea624..780e3d706 100644
--- a/src/firemon/interface.c
+++ b/src/firemon/interface.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,7 @@
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#include "firemon.h" 20#include "firemon.h"
21#include "../include/gcov_wrapper.h"
21#include <sys/types.h> 22#include <sys/types.h>
22#include <sys/wait.h> 23#include <sys/wait.h>
23#include <netdb.h> 24#include <netdb.h>
@@ -62,7 +63,7 @@ static void net_ifprint(void) {
62 // extract mac address 63 // extract mac address
63 struct ifreq ifr; 64 struct ifreq ifr;
64 memset(&ifr, 0, sizeof(ifr)); 65 memset(&ifr, 0, sizeof(ifr));
65 strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); 66 strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ - 1);
66 int rv = ioctl (fd, SIOCGIFHWADDR, &ifr); 67 int rv = ioctl (fd, SIOCGIFHWADDR, &ifr);
67 68
68 if (rv == 0) 69 if (rv == 0)
@@ -145,9 +146,9 @@ static void print_sandbox(pid_t pid) {
145 if (rv) 146 if (rv)
146 return; 147 return;
147 net_ifprint(); 148 net_ifprint();
148#ifdef HAVE_GCOV 149
149 __gcov_flush(); 150 __gcov_flush();
150#endif 151
151 _exit(0); 152 _exit(0);
152 } 153 }
153 154
@@ -163,7 +164,7 @@ void interface(pid_t pid, int print_procs) {
163 for (i = 0; i < max_pids; i++) { 164 for (i = 0; i < max_pids; i++) {
164 if (pids[i].level == 1) { 165 if (pids[i].level == 1) {
165 if (print_procs || pid == 0) 166 if (print_procs || pid == 0)
166 pid_print_list(i, arg_nowrap); 167 pid_print_list(i, arg_wrap);
167 int child = find_child(i); 168 int child = find_child(i);
168 if (child != -1) { 169 if (child != -1) {
169 print_sandbox(child); 170 print_sandbox(child);
diff --git a/src/firemon/list.c b/src/firemon/list.c
index b8e54c233..51099a75c 100644
--- a/src/firemon/list.c
+++ b/src/firemon/list.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,7 +25,9 @@ void list(void) {
25 // print processes 25 // print processes
26 int i; 26 int i;
27 for (i = 0; i < max_pids; i++) { 27 for (i = 0; i < max_pids; i++) {
28 if (i == skip_process)
29 continue;
28 if (pids[i].level == 1) 30 if (pids[i].level == 1)
29 pid_print_list(i, arg_nowrap); 31 pid_print_list(i, arg_wrap);
30 } 32 }
31} 33}
diff --git a/src/firemon/netstats.c b/src/firemon/netstats.c
index c68e2e51b..9d8e5d7f5 100644
--- a/src/firemon/netstats.c
+++ b/src/firemon/netstats.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,7 @@
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#include "firemon.h" 20#include "firemon.h"
21#include "../include/gcov_wrapper.h"
21#include <termios.h> 22#include <termios.h>
22#include <sys/ioctl.h> 23#include <sys/ioctl.h>
23#include <sys/types.h> 24#include <sys/types.h>
@@ -242,8 +243,7 @@ void netstats(void) {
242 print_proc(i, itv, col); 243 print_proc(i, itv, col);
243 } 244 }
244 } 245 }
245#ifdef HAVE_GCOV 246
246 __gcov_flush(); 247 __gcov_flush();
247#endif
248 } 248 }
249} 249}
diff --git a/src/firemon/procevent.c b/src/firemon/procevent.c
index ecbcf35db..716a9cba4 100644
--- a/src/firemon/procevent.c
+++ b/src/firemon/procevent.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,7 @@
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#include "firemon.h" 20#include "firemon.h"
21#include "../include/gcov_wrapper.h"
21#include <sys/socket.h> 22#include <sys/socket.h>
22#include <linux/connector.h> 23#include <linux/connector.h>
23#include <linux/netlink.h> 24#include <linux/netlink.h>
@@ -94,10 +95,21 @@ static int pid_is_firejail(pid_t pid) {
94 // list of firejail arguments that don't trigger sandbox creation 95 // list of firejail arguments that don't trigger sandbox creation
95 // the initial -- is not included 96 // the initial -- is not included
96 char *exclude_args[] = { 97 char *exclude_args[] = {
97 "ls", "list", "tree", "x11", "help", "version", "top", "netstats", "debug-syscalls", 98 // all print options
98 "debug-errnos", "debug-protocols", "protocol.print", "debug.caps", 99 "apparmor.print", "caps.print", "cpu.print", "dns.print", "fs.print", "netfilter.print",
99 "shutdown", "bandwidth", "caps.print", "cpu.print", "debug-caps", 100 "netfilter6.print", "profile.print", "protocol.print", "seccomp.print",
100 "fs.print", "get", "overlay-clean", NULL 101 // debug
102 "debug-caps", "debug-errnos", "debug-protocols", "debug-syscalls", "debug-syscalls32",
103 // file transfer
104 "ls", "get", "put", "cat",
105 // stats
106 "tree", "list", "top",
107 // network
108 "netstats", "bandwidth",
109 // etc
110 "help", "version", "overlay-clean",
111
112 NULL // end of list marker
101 }; 113 };
102 114
103 int i; 115 int i;
@@ -162,6 +174,20 @@ static int procevent_netlink_setup(void) {
162 if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) 174 if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
163 goto errexit; 175 goto errexit;
164 176
177 // set a large socket rx buffer
178 // the regular default value as set in /proc/sys/net/core/rmem_default will fill the
179 // buffer much quicker than we can process it
180 int bsize = 1024 * 1024; // 1MB
181 socklen_t blen = sizeof(int);
182 if (setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE, &bsize, blen) == -1)
183 fprintf(stderr, "Warning: cannot set rx buffer size, using default system value\n");
184 else if (arg_debug) {
185 if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, &bsize, &blen) == -1)
186 fprintf(stderr, "Error: cannot read rx buffer size\n");
187 else
188 printf("rx buffer size %d\n", bsize / 2); // the value returned is duble the real one, see man 7 socket
189 }
190
165 // send monitoring message 191 // send monitoring message
166 struct nlmsghdr nlmsghdr; 192 struct nlmsghdr nlmsghdr;
167 memset(&nlmsghdr, 0, sizeof(nlmsghdr)); 193 memset(&nlmsghdr, 0, sizeof(nlmsghdr));
@@ -195,7 +221,7 @@ errexit:
195} 221}
196 222
197 223
198static int procevent_monitor(const int sock, pid_t mypid) { 224static void __attribute__((noreturn)) procevent_monitor(const int sock, pid_t mypid) {
199 ssize_t len; 225 ssize_t len;
200 struct nlmsghdr *nlmsghdr; 226 struct nlmsghdr *nlmsghdr;
201 227
@@ -205,9 +231,7 @@ static int procevent_monitor(const int sock, pid_t mypid) {
205 tv.tv_usec = 0; 231 tv.tv_usec = 0;
206 232
207 while (1) { 233 while (1) {
208#ifdef HAVE_GCOV
209 __gcov_flush(); 234 __gcov_flush();
210#endif
211 235
212#define BUFFSIZE 4096 236#define BUFFSIZE 4096
213 char __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE]; 237 char __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE];
@@ -221,8 +245,7 @@ static int procevent_monitor(const int sock, pid_t mypid) {
221 245
222 int rv = select(max, &readfds, NULL, NULL, &tv); 246 int rv = select(max, &readfds, NULL, NULL, &tv);
223 if (rv == -1) { 247 if (rv == -1) {
224 fprintf(stderr, "recv: %s\n", strerror(errno)); 248 errExit("recv");
225 return -1;
226 } 249 }
227 250
228 // timeout 251 // timeout
@@ -233,15 +256,20 @@ static int procevent_monitor(const int sock, pid_t mypid) {
233 } 256 }
234 257
235 258
236 if ((len = recv(sock, buf, sizeof(buf), 0)) == 0) { 259 if ((len = recv(sock, buf, sizeof(buf), 0)) == 0)
237 return 0; 260 exit(0);
238 }
239 if (len == -1) { 261 if (len == -1) {
240 if (errno == EINTR) { 262 if (errno == EINTR)
241 return 0; 263 continue;
242 } else { 264 else if (errno == ENOBUFS) {
243 fprintf(stderr,"recv: %s\n", strerror(errno)); 265 // rx buffer is full, the kernel started dropping messages
244 return -1; 266 printf("*** Waning *** - message burst received, not all events are printed\n");
267//return -1;
268 continue;
269 }
270 else {
271 fprintf(stderr,"Error: rx socket recv call, errno %d, %s\n", errno, strerror(errno));
272 exit(1);
245 } 273 }
246 } 274 }
247 275
@@ -291,6 +319,7 @@ static int procevent_monitor(const int sock, pid_t mypid) {
291 child %= max_pids; 319 child %= max_pids;
292 pids[child].level = pids[pid].level + 1; 320 pids[child].level = pids[pid].level + 1;
293 pids[child].uid = pid_get_uid(child); 321 pids[child].uid = pid_get_uid(child);
322 pids[child].parent = pid;
294 } 323 }
295 sprintf(lineptr, " fork"); 324 sprintf(lineptr, " fork");
296 break; 325 break;
@@ -318,12 +347,22 @@ static int procevent_monitor(const int sock, pid_t mypid) {
318 sprintf(lineptr, " exit"); 347 sprintf(lineptr, " exit");
319 break; 348 break;
320 349
350
351
321 case PROC_EVENT_UID: 352 case PROC_EVENT_UID:
322 pid = proc_ev->event_data.id.process_tgid; 353 pid = proc_ev->event_data.id.process_tgid;
323#ifdef DEBUG_PRCTL 354#ifdef DEBUG_PRCTL
324 printf("%s: %d, event uid, pid %d\n", __FUNCTION__, __LINE__, pid); 355 printf("%s: %d, event uid, pid %d\n", __FUNCTION__, __LINE__, pid);
325#endif 356#endif
326 sprintf(lineptr, " uid "); 357 if (pids[pid].level == 1 ||
358 pids[pids[pid].parent].level == 1) {
359 sprintf(lineptr, "\n");
360 continue;
361 }
362 else
363 sprintf(lineptr, " uid (%d:%d)",
364 proc_ev->event_data.id.r.ruid,
365 proc_ev->event_data.id.e.euid);
327 break; 366 break;
328 367
329 case PROC_EVENT_GID: 368 case PROC_EVENT_GID:
@@ -331,9 +370,19 @@ static int procevent_monitor(const int sock, pid_t mypid) {
331#ifdef DEBUG_PRCTL 370#ifdef DEBUG_PRCTL
332 printf("%s: %d, event gid, pid %d\n", __FUNCTION__, __LINE__, pid); 371 printf("%s: %d, event gid, pid %d\n", __FUNCTION__, __LINE__, pid);
333#endif 372#endif
334 sprintf(lineptr, " gid "); 373 if (pids[pid].level == 1 ||
374 pids[pids[pid].parent].level == 1) {
375 sprintf(lineptr, "\n");
376 continue;
377 }
378 else
379 sprintf(lineptr, " gid (%d:%d)",
380 proc_ev->event_data.id.r.rgid,
381 proc_ev->event_data.id.e.egid);
335 break; 382 break;
336 383
384
385
337 case PROC_EVENT_SID: 386 case PROC_EVENT_SID:
338 pid = proc_ev->event_data.sid.process_tgid; 387 pid = proc_ev->event_data.sid.process_tgid;
339#ifdef DEBUG_PRCTL 388#ifdef DEBUG_PRCTL
@@ -353,7 +402,7 @@ static int procevent_monitor(const int sock, pid_t mypid) {
353 int add_new = 0; 402 int add_new = 0;
354 if (pids[pid].level < 0) // not a firejail process 403 if (pids[pid].level < 0) // not a firejail process
355 continue; 404 continue;
356 else if (pids[pid].level == 0) { // new porcess, do we track it? 405 else if (pids[pid].level == 0) { // new process, do we track it?
357 if (pid_is_firejail(pid) && mypid == 0) { 406 if (pid_is_firejail(pid) && mypid == 0) {
358 pids[pid].level = 1; 407 pids[pid].level = 1;
359 add_new = 1; 408 add_new = 1;
@@ -446,7 +495,7 @@ static int procevent_monitor(const int sock, pid_t mypid) {
446 exit(0); 495 exit(0);
447 } 496 }
448 } 497 }
449 return 0; 498 __builtin_unreachable();
450} 499}
451 500
452void procevent(pid_t pid) { 501void procevent(pid_t pid) {
@@ -464,6 +513,4 @@ void procevent(pid_t pid) {
464 } 513 }
465 514
466 procevent_monitor(sock, pid); // it will never return from here 515 procevent_monitor(sock, pid); // it will never return from here
467 assert(0);
468 close(sock); // quiet static analyzers
469} 516}
diff --git a/src/firemon/route.c b/src/firemon/route.c
index 76b268897..9cf5054b2 100644
--- a/src/firemon/route.c
+++ b/src/firemon/route.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -144,7 +144,7 @@ static void print_route(const char *fname) {
144 char use[64]; 144 char use[64];
145 char metric[64]; 145 char metric[64];
146 char mask[64]; 146 char mask[64];
147 int rv = sscanf(start, "%s %s %s %s %s %s %s %s\n", ifname, destination, gateway, flags, refcnt, use, metric, mask); 147 int rv = sscanf(start, "%63s %63s %63s %63s %63s %63s %63s %63s\n", ifname, destination, gateway, flags, refcnt, use, metric, mask);
148 if (rv != 8) 148 if (rv != 8)
149 continue; 149 continue;
150 150
@@ -161,7 +161,7 @@ static void print_route(const char *fname) {
161 161
162// printf("#%s# #%s# #%s# #%s# #%s# #%s# #%s# #%s#\n", ifname, destination, gateway, flags, refcnt, use, metric, mask); 162// printf("#%s# #%s# #%s# #%s# #%s# #%s# #%s# #%s#\n", ifname, destination, gateway, flags, refcnt, use, metric, mask);
163 if (gw != 0) 163 if (gw != 0)
164 printf(" %u.%u.%u.%u/%u via %u.%u.%u.%u, dev %s, metric %s\n", 164 printf(" %d.%d.%d.%d/%u via %d.%d.%d.%d, dev %s, metric %s\n",
165 PRINT_IP(destip), mask2bits(destmask), 165 PRINT_IP(destip), mask2bits(destmask),
166 PRINT_IP(gw), 166 PRINT_IP(gw),
167 ifname, 167 ifname,
@@ -169,7 +169,7 @@ static void print_route(const char *fname) {
169 else { // this is an interface 169 else { // this is an interface
170 IfList *ifentry = list_find(destip, destmask); 170 IfList *ifentry = list_find(destip, destmask);
171 if (ifentry) { 171 if (ifentry) {
172 printf(" %u.%u.%u.%u/%u, dev %s, scope link src %d.%d.%d.%d\n", 172 printf(" %d.%d.%d.%d/%u, dev %s, scope link src %d.%d.%d.%d\n",
173 PRINT_IP(destip), mask2bits(destmask), 173 PRINT_IP(destip), mask2bits(destmask),
174 ifname, 174 ifname,
175 PRINT_IP(ifentry->ip)); 175 PRINT_IP(ifentry->ip));
@@ -189,7 +189,7 @@ void route(pid_t pid, int print_procs) {
189 for (i = 0; i < max_pids; i++) { 189 for (i = 0; i < max_pids; i++) {
190 if (pids[i].level == 1) { 190 if (pids[i].level == 1) {
191 if (print_procs || pid == 0) 191 if (print_procs || pid == 0)
192 pid_print_list(i, arg_nowrap); 192 pid_print_list(i, arg_wrap);
193 int child = find_child(i); 193 int child = find_child(i);
194 if (child != -1) { 194 if (child != -1) {
195 char *fname; 195 char *fname;
diff --git a/src/firemon/seccomp.c b/src/firemon/seccomp.c
index ce9d1dffb..04111b6c0 100644
--- a/src/firemon/seccomp.c
+++ b/src/firemon/seccomp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -52,7 +52,7 @@ void seccomp(pid_t pid, int print_procs) {
52 for (i = 0; i < max_pids; i++) { 52 for (i = 0; i < max_pids; i++) {
53 if (pids[i].level == 1) { 53 if (pids[i].level == 1) {
54 if (print_procs || pid == 0) 54 if (print_procs || pid == 0)
55 pid_print_list(i, arg_nowrap); 55 pid_print_list(i, arg_wrap);
56 int child = find_child(i); 56 int child = find_child(i);
57 if (child != -1) 57 if (child != -1)
58 print_seccomp(child); 58 print_seccomp(child);
diff --git a/src/firemon/top.c b/src/firemon/top.c
index 6ea642109..2217cc7de 100644
--- a/src/firemon/top.c
+++ b/src/firemon/top.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,6 +18,7 @@
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#include "firemon.h" 20#include "firemon.h"
21#include "../include/gcov_wrapper.h"
21#include <termios.h> 22#include <termios.h>
22#include <sys/ioctl.h> 23#include <sys/ioctl.h>
23#include <sys/types.h> 24#include <sys/types.h>
@@ -273,6 +274,8 @@ void top(void) {
273 unsigned utime = 0; 274 unsigned utime = 0;
274 unsigned stime = 0; 275 unsigned stime = 0;
275 for (i = 0; i < max_pids; i++) { 276 for (i = 0; i < max_pids; i++) {
277 if (i == skip_process)
278 continue;
276 if (pids[i].level == 1) 279 if (pids[i].level == 1)
277 pid_store_cpu(i, 0, &utime, &stime); 280 pid_store_cpu(i, 0, &utime, &stime);
278 } 281 }
@@ -313,6 +316,8 @@ void top(void) {
313 316
314 // print processes 317 // print processes
315 for (i = 0; i < max_pids; i++) { 318 for (i = 0; i < max_pids; i++) {
319 if (i == skip_process)
320 continue;
316 if (pids[i].level == 1) { 321 if (pids[i].level == 1) {
317 float cpu = 0; 322 float cpu = 0;
318 int cnt = 0; // process count 323 int cnt = 0; // process count
@@ -322,8 +327,7 @@ void top(void) {
322 } 327 }
323 } 328 }
324 head_print(col, row); 329 head_print(col, row);
325#ifdef HAVE_GCOV 330
326 __gcov_flush(); 331 __gcov_flush();
327#endif
328 } 332 }
329} 333}
diff --git a/src/firemon/tree.c b/src/firemon/tree.c
index 846c6ed75..899214b9f 100644
--- a/src/firemon/tree.c
+++ b/src/firemon/tree.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -25,8 +25,10 @@ void tree(pid_t pid) {
25 // print processes 25 // print processes
26 int i; 26 int i;
27 for (i = 0; i < max_pids; i++) { 27 for (i = 0; i < max_pids; i++) {
28 if (i == skip_process)
29 continue;
28 if (pids[i].level == 1) 30 if (pids[i].level == 1)
29 pid_print_tree(i, 0, arg_nowrap); 31 pid_print_tree(i, 0, arg_wrap);
30 } 32 }
31 printf("\n"); 33 printf("\n");
32} 34}
diff --git a/src/firemon/usage.c b/src/firemon/usage.c
index 58e3b63f3..baaef3111 100644
--- a/src/firemon/usage.c
+++ b/src/firemon/usage.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,61 +19,67 @@
19*/ 19*/
20#include "firemon.h" 20#include "firemon.h"
21 21
22void usage(void) { 22static char *help_str =
23 printf("firemon - version %s\n", VERSION); 23 "Usage: firemon [OPTIONS] [PID]\n\n"
24 printf("Usage: firemon [OPTIONS] [PID]\n\n"); 24 "Monitor processes started in a Firejail sandbox. Without any PID specified,\n"
25 printf("Monitor processes started in a Firejail sandbox. Without any PID specified,\n"); 25 "all processes started by Firejail are monitored. Descendants of these processes\n"
26 printf("all processes started by Firejail are monitored. Descendants of these processes\n"); 26 "are also being monitored. On Grsecurity systems only root user\n"
27 printf("are also being monitored. On Grsecurity systems only root user\n"); 27 "can run this program.\n\n"
28 printf("can run this program.\n\n"); 28 "Options:\n"
29 printf("Options:\n"); 29 "\t--apparmor - print AppArmor confinement status for each sandbox.\n\n"
30 printf("\t--arp - print ARP table for each sandbox.\n\n"); 30 "\t--arp - print ARP table for each sandbox.\n\n"
31 printf("\t--caps - print capabilities configuration for each sandbox.\n\n"); 31 "\t--caps - print capabilities configuration for each sandbox.\n\n"
32 printf("\t--cgroup - print control group information for each sandbox.\n\n"); 32 "\t--cgroup - print control group information for each sandbox.\n\n"
33 printf("\t--cpu - print CPU affinity for each sandbox.\n\n"); 33 "\t--cpu - print CPU affinity for each sandbox.\n\n"
34 printf("\t--help, -? - this help screen.\n\n"); 34 "\t--debug - print debug messages.\n\n"
35 printf("\t--interface - print network interface information for each sandbox.\n\n"); 35 "\t--help, -? - this help screen.\n\n"
36 printf("\t--list - list all sandboxes.\n\n"); 36 "\t--interface - print network interface information for each sandbox.\n\n"
37 printf("\t--name=name - print information only about named sandbox.\n\n"); 37 "\t--list - list all sandboxes.\n\n"
38 printf("\t--netstats - monitor network statistics for sandboxes creating a new\n"); 38 "\t--name=name - print information only about named sandbox.\n\n"
39 printf("\t\tnetwork namespace.\n\n"); 39 "\t--netstats - monitor network statistics for sandboxes creating a new\n"
40 printf("\t--nowrap - enable line wrapping in terminals.\n\n"); 40 "\t\tnetwork namespace.\n\n"
41 printf("\t--route - print route table for each sandbox.\n\n"); 41 "\t--nowrap - enable line wrapping in terminals.\n\n"
42 printf("\t--seccomp - print seccomp configuration for each sandbox.\n\n"); 42 "\t--route - print route table for each sandbox.\n\n"
43 printf("\t--tree - print a tree of all sandboxed processes.\n\n"); 43 "\t--seccomp - print seccomp configuration for each sandbox.\n\n"
44 printf("\t--top - monitor the most CPU-intensive sandboxes.\n\n"); 44 "\t--tree - print a tree of all sandboxed processes.\n\n"
45 printf("\t--version - print program version and exit.\n\n"); 45 "\t--top - monitor the most CPU-intensive sandboxes.\n\n"
46 "\t--version - print program version and exit.\n\n"
47 "\t--x11 - print X11 display number.\n\n"
48
49 "Without any options, firemon monitors all fork, exec, id change, and exit\n"
50 "events in the sandbox. Monitoring a specific PID is also supported.\n\n"
46 51
47 printf("Without any options, firemon monitors all fork, exec, id change, and exit events\n"); 52 "Option --list prints a list of all sandboxes. The format for each entry is as\n"
48 printf("in the sandbox. Monitoring a specific PID is also supported.\n\n"); 53 "follows:\n\n"
54 "\tPID:USER:Command\n\n"
49 55
50 printf("Option --list prints a list of all sandboxes. The format for each entry is as\n"); 56 "Option --tree prints the tree of processes running in the sandbox. The format\n"
51 printf("follows:\n\n"); 57 "for each process entry is as follows:\n\n"
52 printf("\tPID:USER:Command\n\n"); 58 "\tPID:USER:Command\n\n"
53 59
54 printf("Option --tree prints the tree of processes running in the sandbox. The format\n"); 60 "Option --top is similar to the UNIX top command, however it applies only to\n"
55 printf("for each process entry is as follows:\n\n"); 61 "sandboxes. Listed below are the available fields (columns) in alphabetical\n"
56 printf("\tPID:USER:Command\n\n"); 62 "order:\n\n"
63 "\tCommand - command used to start the sandbox.\n"
64 "\tCPU%% - CPU usage, the sandbox share of the elapsed CPU time since the\n"
65 "\t last screen update\n"
66 "\tPID - Unique process ID for the task controlling the sandbox.\n"
67 "\tPrcs - number of processes running in sandbox, including the\n"
68 "\t controlling process.\n"
69 "\tRES - Resident Memory Size (KiB), sandbox non-swapped physical memory.\n"
70 "\t It is a sum of the RES values for all processes running in the\n"
71 "\t sandbox.\n"
72 "\tSHR - Shared Memory Size (KiB), it reflects memory shared with other\n"
73 "\t processes. It is a sum of the SHR values for all processes\n"
74 "\t running in the sandbox, including the controlling process.\n"
75 "\tUptime - sandbox running time in hours:minutes:seconds format.\n"
76 "\tUser - The owner of the sandbox.\n"
77 "\n"
78 "License GPL version 2 or later\n"
79 "Homepage: https://firejail.wordpress.com\n"
80 "\n";
57 81
58 printf("Option --top is similar to the UNIX top command, however it applies only to\n"); 82void usage(void) {
59 printf("sandboxes. Listed below are the available fields (columns) in alphabetical\n"); 83 printf("firemon - version %s\n", VERSION);
60 printf("order:\n\n"); 84 puts(help_str);
61 printf("\tCommand - command used to start the sandbox.\n");
62 printf("\tCPU%% - CPU usage, the sandbox share of the elapsed CPU time since the\n");
63 printf("\t last screen update\n");
64 printf("\tPID - Unique process ID for the task controlling the sandbox.\n");
65 printf("\tPrcs - number of processes running in sandbox, including the controlling\n");
66 printf("\t process.\n");
67 printf("\tRES - Resident Memory Size (KiB), sandbox non-swapped physical memory.\n");
68 printf("\t It is a sum of the RES values for all processes running in the\n");
69 printf("\t sandbox.\n");
70 printf("\tSHR - Shared Memory Size (KiB), it reflects memory shared with other\n");
71 printf("\t processes. It is a sum of the SHR values for all processes running\n");
72 printf("\t in the sandbox, including the controlling process.\n");
73 printf("\tUptime - sandbox running time in hours:minutes:seconds format.\n");
74 printf("\tUser - The owner of the sandbox.\n");
75 printf("\n");
76 printf("License GPL version 2 or later\n");
77 printf("Homepage: http://firejail.wordpress.com\n");
78 printf("\n");
79} 85}
diff --git a/src/firemon/x11.c b/src/firemon/x11.c
index 57d7c1e82..97e24b2d2 100644
--- a/src/firemon/x11.c
+++ b/src/firemon/x11.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -30,7 +30,7 @@ void x11(pid_t pid, int print_procs) {
30 for (i = 0; i < max_pids; i++) { 30 for (i = 0; i < max_pids; i++) {
31 if (pids[i].level == 1) { 31 if (pids[i].level == 1) {
32 if (print_procs || pid == 0) 32 if (print_procs || pid == 0)
33 pid_print_list(i, arg_nowrap); 33 pid_print_list(i, arg_wrap);
34 34
35 char *x11file; 35 char *x11file;
36 // todo: use macro from src/firejail/firejail.h for /run/firejail/x11 directory 36 // todo: use macro from src/firejail/firejail.h for /run/firejail/x11 directory
diff --git a/src/fldd/Makefile.in b/src/fldd/Makefile.in
index 7369c835b..ba87d16cd 100644
--- a/src/fldd/Makefile.in
+++ b/src/fldd/Makefile.in
@@ -1,45 +1,17 @@
1.PHONY: all
1all: fldd 2all: fldd
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8 5
9VERSION=@PACKAGE_VERSION@ 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h ../include/ldd_utils.h
10NAME=@PACKAGE_NAME@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
26HAVE_GCOV=@HAVE_GCOV@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28 8
29H_FILE_LIST = $(sort $(wildcard *.[h])) 9fldd: $(OBJS) ../lib/common.o ../lib/ldd_utils.o
30C_FILE_LIST = $(sort $(wildcard *.c)) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/ldd_utils.o $(LIBS) $(EXTRA_LDFLAGS)
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35 11
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h 12.PHONY: clean
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 13clean:; rm -fr *.o fldd *.gcov *.gcda *.gcno *.plist
38
39fldd: $(OBJS)
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS)
41
42clean:; rm -f *.o fldd *.gcov *.gcda *.gcno
43 14
15.PHONY: distclean
44distclean: clean 16distclean: clean
45 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/fldd/main.c b/src/fldd/main.c
index c04daa0ed..b71145793 100644
--- a/src/fldd/main.c
+++ b/src/fldd/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -19,8 +19,8 @@
19*/ 19*/
20 20
21#include "../include/common.h" 21#include "../include/common.h"
22#include "../include/ldd_utils.h"
22 23
23#include <elf.h>
24#include <fcntl.h> 24#include <fcntl.h>
25#include <sys/mman.h> 25#include <sys/mman.h>
26#include <sys/mount.h> 26#include <sys/mount.h>
@@ -29,33 +29,10 @@
29#include <unistd.h> 29#include <unistd.h>
30#include <dirent.h> 30#include <dirent.h>
31 31
32#ifdef __LP64__
33#define Elf_Ehdr Elf64_Ehdr
34#define Elf_Phdr Elf64_Phdr
35#define Elf_Shdr Elf64_Shdr
36#define Elf_Dyn Elf64_Dyn
37#else
38#define Elf_Ehdr Elf32_Ehdr
39#define Elf_Phdr Elf32_Phdr
40#define Elf_Shdr Elf32_Shdr
41#define Elf_Dyn Elf32_Dyn
42#endif
43 32
44static int arg_quiet = 0; 33static int arg_quiet = 0;
45static void copy_libs_for_lib(const char *lib); 34static void copy_libs_for_lib(const char *lib);
46 35
47static const char * const default_lib_paths[] = {
48 "/lib",
49 "/lib/x86_64-linux-gnu",
50 "/lib64",
51 "/usr/lib",
52 "/usr/lib/x86_64-linux-gnu",
53 LIBDIR,
54 "/usr/local/lib",
55 NULL
56}; // Note: this array is duplicated in src/firejail/fs_lib.c
57
58
59typedef struct storage_t { 36typedef struct storage_t {
60 struct storage_t *next; 37 struct storage_t *next;
61 const char *name; 38 const char *name;
@@ -98,12 +75,14 @@ static void storage_print(Storage *ptr, int fd) {
98 75
99static bool ptr_ok(const void *ptr, const void *base, const void *end, const char *name) { 76static bool ptr_ok(const void *ptr, const void *base, const void *end, const char *name) {
100 bool r; 77 bool r;
78 (void) name;
101 79
102 r = (ptr >= base && ptr < end); 80 r = (ptr >= base && ptr < end);
103 return r; 81 return r;
104} 82}
105 83
106static void copy_libs_for_exe(const char *exe) { 84
85static void parse_elf(const char *exe) {
107 int f; 86 int f;
108 f = open(exe, O_RDONLY); 87 f = open(exe, O_RDONLY);
109 if (f < 0) { 88 if (f < 0) {
@@ -111,7 +90,7 @@ static void copy_libs_for_exe(const char *exe) {
111 fprintf(stderr, "Warning fldd: cannot open %s, skipping...\n", exe); 90 fprintf(stderr, "Warning fldd: cannot open %s, skipping...\n", exe);
112 return; 91 return;
113 } 92 }
114 93
115 struct stat s; 94 struct stat s;
116 char *base = NULL, *end; 95 char *base = NULL, *end;
117 if (fstat(f, &s) == -1) 96 if (fstat(f, &s) == -1)
@@ -128,6 +107,12 @@ static void copy_libs_for_exe(const char *exe) {
128 fprintf(stderr, "Warning fldd: %s is not an ELF executable or library\n", exe); 107 fprintf(stderr, "Warning fldd: %s is not an ELF executable or library\n", exe);
129 goto close; 108 goto close;
130 } 109 }
110//unsigned char elfclass = ebuf->e_ident[EI_CLASS];
111//if (elfclass == ELFCLASS32)
112//printf("%s 32bit\n", exe);
113//else if (elfclass == ELFCLASS64)
114//printf("%s 64bit\n", exe);
115
131 116
132 Elf_Phdr *pbuf = (Elf_Phdr *)(base + sizeof(*ebuf)); 117 Elf_Phdr *pbuf = (Elf_Phdr *)(base + sizeof(*ebuf));
133 while (ebuf->e_phnum-- > 0 && ptr_ok(pbuf, base, end, "pbuf")) { 118 while (ebuf->e_phnum-- > 0 && ptr_ok(pbuf, base, end, "pbuf")) {
@@ -213,7 +198,7 @@ static void copy_libs_for_exe(const char *exe) {
213 close: 198 close:
214 if (base) 199 if (base)
215 munmap(base, s.st_size); 200 munmap(base, s.st_size);
216 201
217 close(f); 202 close(f);
218} 203}
219 204
@@ -223,11 +208,11 @@ static void copy_libs_for_lib(const char *lib) {
223 char *fname; 208 char *fname;
224 if (asprintf(&fname, "%s/%s", lib_path->name, lib) == -1) 209 if (asprintf(&fname, "%s/%s", lib_path->name, lib) == -1)
225 errExit("asprintf"); 210 errExit("asprintf");
226 if (access(fname, R_OK) == 0) { 211 if (access(fname, R_OK) == 0 && is_lib_64(fname)) {
227 if (!storage_find(libs, fname)) { 212 if (!storage_find(libs, fname)) {
228 storage_add(&libs, fname); 213 storage_add(&libs, fname);
229 // libs may need other libs 214 // libs may need other libs
230 copy_libs_for_exe(fname); 215 parse_elf(fname);
231 } 216 }
232 free(fname); 217 free(fname);
233 return; 218 return;
@@ -266,9 +251,9 @@ static void walk_directory(const char *dirname) {
266 251
267 // check regular so library 252 // check regular so library
268 char *ptr = strstr(entry->d_name, ".so"); 253 char *ptr = strstr(entry->d_name, ".so");
269 if (ptr) { 254 if (ptr && is_lib_64(path)) {
270 if (*(ptr + 3) == '\0' || *(ptr + 3) == '.') { 255 if (*(ptr + 3) == '\0' || *(ptr + 3) == '.') {
271 copy_libs_for_exe(path); 256 parse_elf(path);
272 free(path); 257 free(path);
273 continue; 258 continue;
274 } 259 }
@@ -276,12 +261,21 @@ static void walk_directory(const char *dirname) {
276 261
277 // check directory 262 // check directory
278 // entry->d_type field is supported in glibc since version 2.19 (Feb 2014) 263 // entry->d_type field is supported in glibc since version 2.19 (Feb 2014)
279 // we'll use stat to check for directories 264 // we'll use stat to check for directories using the real path
265 // (sometimes the path is a double symlink to a real file and stat would fail)
266 char *rpath = realpath(path, NULL);
267 if (!rpath) {
268 free(path);
269 continue;
270 }
271 free(path);
272
280 struct stat s; 273 struct stat s;
281 if (stat(path, &s) == -1) 274 if (stat(rpath, &s) == -1)
282 errExit("stat"); 275 errExit("stat");
283 if (S_ISDIR(s.st_mode)) 276 if (S_ISDIR(s.st_mode))
284 walk_directory(path); 277 walk_directory(rpath);
278 free(rpath);
285 } 279 }
286 closedir(dir); 280 closedir(dir);
287 } 281 }
@@ -312,11 +306,13 @@ printf("\n");
312 } 306 }
313 307
314 308
315 if (strcmp(argv[1], "--help") == 0) { 309 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0) {
316 usage(); 310 usage();
317 return 0; 311 return 0;
318 } 312 }
319 313
314 warn_dumpable();
315
320 // check program access 316 // check program access
321 if (access(argv[1], R_OK)) { 317 if (access(argv[1], R_OK)) {
322 fprintf(stderr, "Error fldd: cannot access %s\n", argv[1]); 318 fprintf(stderr, "Error fldd: cannot access %s\n", argv[1]);
@@ -327,16 +323,11 @@ printf("\n");
327 if (quiet && strcmp(quiet, "yes") == 0) 323 if (quiet && strcmp(quiet, "yes") == 0)
328 arg_quiet = 1; 324 arg_quiet = 1;
329 325
330 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) {
331 usage();
332 return 0;
333 }
334
335 int fd = STDOUT_FILENO; 326 int fd = STDOUT_FILENO;
336 // attempt to open the file 327 // attempt to open the file
337 if (argc == 3) { 328 if (argc == 3) {
338 fd = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY, 0644); 329 fd = open(argv[2], O_CREAT | O_TRUNC | O_WRONLY, 0644);
339 if (!fd) { 330 if (fd == -1) {
340 fprintf(stderr, "Error fldd: invalid arguments\n"); 331 fprintf(stderr, "Error fldd: invalid arguments\n");
341 usage(); 332 usage();
342 exit(1); 333 exit(1);
@@ -352,8 +343,12 @@ printf("\n");
352 errExit("stat"); 343 errExit("stat");
353 if (S_ISDIR(s.st_mode)) 344 if (S_ISDIR(s.st_mode))
354 walk_directory(argv[1]); 345 walk_directory(argv[1]);
355 else 346 else {
356 copy_libs_for_exe(argv[1]); 347 if (is_lib_64(argv[1]))
348 parse_elf(argv[1]);
349 else
350 fprintf(stderr, "Warning fldd: %s is not a 64bit program/library\n", argv[1]);
351 }
357 352
358 353
359 // print libraries and exit 354 // print libraries and exit
diff --git a/src/floader/README.md b/src/floader/README.md
deleted file mode 100644
index c1e14b2a6..000000000
--- a/src/floader/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
1READ ME
2-------
3
4* Run 'make'
5* Add comma separated process names to ~/.loader.conf
6* export LD_PRELOAD=<path>./loader.so (ideally to .bashrc)
7* Run any application within shell
diff --git a/src/floader/loader.c b/src/floader/loader.c
deleted file mode 100644
index 6b9f92f18..000000000
--- a/src/floader/loader.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * Copyright (C) 2017 Madura A. (madura.x86@gmail.com)
3 *
4 */
5#include <sys/types.h>
6#include <sys/stat.h>
7#include <sys/mman.h>
8#include <fcntl.h>
9#include <unistd.h>
10
11#include <string.h>
12#include <stdio.h>
13#include <stdlib.h>
14#include <ctype.h>
15
16#define MAX_MATCHES 32
17#define MAX_ARGS 1024
18#define MAX_ARGS_LEN 4096
19static void loader_main() __attribute__((constructor));
20
21char cmdline[MAX_ARGS_LEN];
22char *args[MAX_ARGS];
23char loader[] = "firejail";
24char confFile[256];
25char *names[MAX_MATCHES];
26
27#ifdef DEBUG
28#define DBG printf
29#else
30#define DBG
31#endif
32void remove_trailing_spaces(char *str)
33{
34 while (!isspace(*str))
35 {
36 str++;
37 }
38
39 while (*str != '\0')
40 {
41 *str = '\0';
42 str++;
43 }
44}
45
46void read_cmdline()
47{
48 int fd = open("/proc/self/cmdline", O_RDONLY);
49 ssize_t ret = 0, total = 0;
50 char* wcmdbuf = cmdline;
51 while ((ret = read(fd, wcmdbuf, 1)) != 0)
52 {
53 wcmdbuf++;
54 total += ret;
55 if (total > MAX_ARGS_LEN)
56 {
57 printf("Not enough memory\n");
58 close(fd);
59 return ;
60 }
61 }
62 close(fd);
63}
64
65void make_args()
66{
67 int cI = 0, argI=0;
68 char* argstart = &cmdline[0];
69 for (;cI<MAX_ARGS_LEN;cI++)
70 {
71 if (cmdline[cI] == '\0')
72 {
73 args[argI]= argstart;
74 argstart = &cmdline[cI+1];
75 argI++;
76 if (*argstart == '\0')
77 {
78 break;
79 }
80 }
81 }
82 args[argI] = argstart;
83 argI++;
84 args[argI] = NULL;
85}
86
87void loader_main()
88{
89 snprintf(confFile, 255, "%s/.loader.conf", getenv("HOME"));
90
91 struct stat confFileStat;
92
93 stat(confFile, &confFileStat);
94
95 int confFd = open(confFile, O_RDONLY);
96
97 if (confFd == -1)
98 {
99 close(confFd);
100 return;
101 }
102 char* conf = (char*) malloc(confFileStat.st_size);
103 if (conf == NULL)
104 {
105 close(confFd);
106 return;
107 }
108 ssize_t ret = read(confFd, conf, confFileStat.st_size);
109 if (ret == -1)
110 {
111 close(confFd);
112 return;
113 }
114
115 close(confFd);
116 size_t fI = 0;
117 int matchId = 0;
118 names[matchId] = conf;
119 matchId++;
120 for (;fI < confFileStat.st_size-1;fI++)
121 {
122 if (conf[fI] == ',')
123 {
124 names[matchId] = &conf[fI+1];
125 conf[fI] = '\0';
126
127 matchId++;
128 }
129 }
130
131 remove_trailing_spaces(names[matchId-1]);
132
133 read_cmdline();
134
135 make_args();
136
137#ifdef DEBUG
138 int xarg=0;
139 while (args[xarg] != NULL)
140 {
141 DBG(".%s\n", args[xarg]);
142 xarg++;
143 }
144#endif
145
146 int x;
147
148 for (x = 0;x<matchId;x++)
149 {
150 DBG("%s\n",names[x]);
151 if (strstr(args[0], names[x]) != NULL)
152 {
153 DBG("highjack!\n");
154
155 free(conf);
156
157 execvp(loader, args );
158 }
159 }
160
161}
diff --git a/src/floader/makefile b/src/floader/makefile
deleted file mode 100644
index eeb96571d..000000000
--- a/src/floader/makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1all:
2 gcc -ggdb -shared -fPIC loader.c -o loader.so
3
4debug:
5 gcc -ggdb -shared -DDEBUG -fPIC loader.c -o loader.so
diff --git a/src/fnet/Makefile.in b/src/fnet/Makefile.in
index 3288e6354..7447c6d3f 100644
--- a/src/fnet/Makefile.in
+++ b/src/fnet/Makefile.in
@@ -1,45 +1,17 @@
1.PHONY: all
1all: fnet 2all: fnet
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8
9VERSION=@PACKAGE_VERSION@
10NAME=@PACKAGE_NAME@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
26HAVE_GCOV=@HAVE_GCOV@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28
29H_FILE_LIST = $(sort $(wildcard *.[h]))
30C_FILE_LIST = $(sort $(wildcard *.c))
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35 5
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/libnetlink.h 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/libnetlink.h
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
38 8
39fnet: $(OBJS) ../lib/libnetlink.o 9fnet: $(OBJS) ../lib/common.o ../lib/libnetlink.o
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/libnetlink.o $(LIBS) $(EXTRA_LDFLAGS) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/libnetlink.o $(LIBS) $(EXTRA_LDFLAGS)
41 11
42clean:; rm -f *.o fnet *.gcov *.gcda *.gcno 12.PHONY: clean
13clean:; rm -fr *.o fnet *.gcov *.gcda *.gcno *.plist
43 14
15.PHONY: distclean
44distclean: clean 16distclean: clean
45 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/fnet/arp.c b/src/fnet/arp.c
index 4736f3509..59798d32d 100644
--- a/src/fnet/arp.c
+++ b/src/fnet/arp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -60,7 +60,7 @@ void arp_scan(const char *dev, uint32_t ifip, uint32_t ifmask) {
60 errExit("socket"); 60 errExit("socket");
61 struct ifreq ifr; 61 struct ifreq ifr;
62 memset(&ifr, 0, sizeof (ifr)); 62 memset(&ifr, 0, sizeof (ifr));
63 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 63 strncpy(ifr.ifr_name, dev, IFNAMSIZ - 1);
64 if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) 64 if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0)
65 errExit("ioctl"); 65 errExit("ioctl");
66 close(sock); 66 close(sock);
@@ -124,7 +124,7 @@ void arp_scan(const char *dev, uint32_t ifip, uint32_t ifmask) {
124 errExit("if_nametoindex"); 124 errExit("if_nametoindex");
125 addr.sll_family = AF_PACKET; 125 addr.sll_family = AF_PACKET;
126 memcpy (addr.sll_addr, mac, 6); 126 memcpy (addr.sll_addr, mac, 6);
127 addr.sll_halen = htons(6); 127 addr.sll_halen = ETH_ALEN;
128 128
129 // build the arp packet header 129 // build the arp packet header
130 ArpHdr hdr; 130 ArpHdr hdr;
@@ -149,10 +149,8 @@ void arp_scan(const char *dev, uint32_t ifip, uint32_t ifmask) {
149 memcpy (frame + 14, &hdr, sizeof(hdr)); 149 memcpy (frame + 14, &hdr, sizeof(hdr));
150 150
151 // send packet 151 // send packet
152 int len; 152 if (sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr)) <= 0)
153 if ((len = sendto (sock, frame, 14 + sizeof(ArpHdr), 0, (struct sockaddr *) &addr, sizeof (addr))) <= 0)
154 errExit("send"); 153 errExit("send");
155//printf("send %d bytes to %d.%d.%d.%d\n", len, PRINT_IP(dest));
156 fflush(0); 154 fflush(0);
157 dest++; 155 dest++;
158 } 156 }
@@ -192,10 +190,10 @@ void arp_scan(const char *dev, uint32_t ifip, uint32_t ifmask) {
192 190
193 // printing 191 // printing
194 if (header_printed == 0) { 192 if (header_printed == 0) {
195 printf(" Network scan:\n"); 193 fmessage(" Network scan:\n");
196 header_printed = 1; 194 header_printed = 1;
197 } 195 }
198 printf(" %02x:%02x:%02x:%02x:%02x:%02x\t%d.%d.%d.%d\n", 196 fmessage(" %02x:%02x:%02x:%02x:%02x:%02x\t%d.%d.%d.%d\n",
199 PRINT_MAC(hdr.sender_mac), PRINT_IP(ip)); 197 PRINT_MAC(hdr.sender_mac), PRINT_IP(ip));
200 } 198 }
201 } 199 }
diff --git a/src/fnet/fnet.h b/src/fnet/fnet.h
index b4b7e6a37..c0154b53e 100644
--- a/src/fnet/fnet.h
+++ b/src/fnet/fnet.h
@@ -1,5 +1,5 @@
1 /* 1 /*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -20,18 +20,21 @@
20#ifndef FNET_H 20#ifndef FNET_H
21#define FNET_H 21#define FNET_H
22 22
23#include "../include/common.h"
23#include <stdio.h> 24#include <stdio.h>
24#include <stdlib.h> 25#include <stdlib.h>
25#include <string.h> 26#include <string.h>
26#include <assert.h> 27#include <assert.h>
27#include "../include/common.h" 28#include <stdarg.h>
28 29
29// main.c 30// main.c
30extern int arg_quiet; 31extern int arg_quiet;
32extern void fmessage(char* fmt, ...); // TODO: this function is duplicated in src/firejail/util.c
31 33
32// veth.c 34// veth.c
33int net_create_veth(const char *dev, const char *nsdev, unsigned pid); 35int net_create_veth(const char *dev, const char *nsdev, unsigned pid);
34int net_create_macvlan(const char *dev, const char *parent, unsigned pid); 36int net_create_macvlan(const char *dev, const char *parent, unsigned pid);
37int net_create_ipvlan(const char *dev, const char *parent, unsigned pid);
35int net_move_interface(const char *dev, unsigned pid); 38int net_move_interface(const char *dev, unsigned pid);
36 39
37// interface.c 40// interface.c
@@ -44,6 +47,7 @@ int net_get_mac(const char *ifname, unsigned char mac[6]);
44void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu); 47void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu);
45int net_if_mac(const char *ifname, const unsigned char mac[6]); 48int net_if_mac(const char *ifname, const unsigned char mac[6]);
46void net_if_ip6(const char *ifname, const char *addr6); 49void net_if_ip6(const char *ifname, const char *addr6);
50void net_if_waitll(const char *ifname);
47 51
48 52
49// arp.c 53// arp.c
diff --git a/src/fnet/interface.c b/src/fnet/interface.c
index 8c1fd6ca4..91d91360d 100644
--- a/src/fnet/interface.c
+++ b/src/fnet/interface.c
@@ -1,5 +1,5 @@
1 /* 1 /*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -28,6 +28,8 @@
28#include <net/if_arp.h> 28#include <net/if_arp.h>
29#include <net/route.h> 29#include <net/route.h>
30#include <linux/if_bridge.h> 30#include <linux/if_bridge.h>
31#include <linux/netlink.h>
32#include <linux/rtnetlink.h>
31 33
32static void check_if_name(const char *ifname) { 34static void check_if_name(const char *ifname) {
33 if (strlen(ifname) > IFNAMSIZ) { 35 if (strlen(ifname) > IFNAMSIZ) {
@@ -58,7 +60,7 @@ void net_bridge_add_interface(const char *bridge, const char *dev) {
58 errExit("socket"); 60 errExit("socket");
59 61
60 memset(&ifr, 0, sizeof(ifr)); 62 memset(&ifr, 0, sizeof(ifr));
61 strncpy(ifr.ifr_name, bridge, IFNAMSIZ); 63 strncpy(ifr.ifr_name, bridge, IFNAMSIZ - 1);
62#ifdef SIOCBRADDIF 64#ifdef SIOCBRADDIF
63 ifr.ifr_ifindex = ifindex; 65 ifr.ifr_ifindex = ifindex;
64 err = ioctl(sock, SIOCBRADDIF, &ifr); 66 err = ioctl(sock, SIOCBRADDIF, &ifr);
@@ -90,7 +92,7 @@ void net_if_up(const char *ifname) {
90 // get the existing interface flags 92 // get the existing interface flags
91 struct ifreq ifr; 93 struct ifreq ifr;
92 memset(&ifr, 0, sizeof(ifr)); 94 memset(&ifr, 0, sizeof(ifr));
93 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 95 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
94 ifr.ifr_addr.sa_family = AF_INET; 96 ifr.ifr_addr.sa_family = AF_INET;
95 97
96 // read the existing flags 98 // read the existing flags
@@ -135,7 +137,7 @@ int net_get_mtu(const char *ifname) {
135 137
136 memset(&ifr, 0, sizeof(ifr)); 138 memset(&ifr, 0, sizeof(ifr));
137 ifr.ifr_addr.sa_family = AF_INET; 139 ifr.ifr_addr.sa_family = AF_INET;
138 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 140 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
139 if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) == 0) 141 if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) == 0)
140 mtu = ifr.ifr_mtu; 142 mtu = ifr.ifr_mtu;
141 close(s); 143 close(s);
@@ -154,7 +156,7 @@ void net_set_mtu(const char *ifname, int mtu) {
154 156
155 memset(&ifr, 0, sizeof(ifr)); 157 memset(&ifr, 0, sizeof(ifr));
156 ifr.ifr_addr.sa_family = AF_INET; 158 ifr.ifr_addr.sa_family = AF_INET;
157 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 159 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
158 ifr.ifr_mtu = mtu; 160 ifr.ifr_mtu = mtu;
159 if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) != 0) { 161 if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) != 0) {
160 if (!arg_quiet) 162 if (!arg_quiet)
@@ -172,7 +174,7 @@ void net_ifprint(int scan) {
172 if (getifaddrs(&ifaddr) == -1) 174 if (getifaddrs(&ifaddr) == -1)
173 errExit("getifaddrs"); 175 errExit("getifaddrs");
174 176
175 printf("%-17.17s%-19.19s%-17.17s%-17.17s%-6.6s\n", 177 fmessage("%-17.17s%-19.19s%-17.17s%-17.17s%-6.6s\n",
176 "Interface", "MAC", "IP", "Mask", "Status"); 178 "Interface", "MAC", "IP", "Mask", "Status");
177 // walk through the linked list 179 // walk through the linked list
178 for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { 180 for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
@@ -208,7 +210,7 @@ void net_ifprint(int scan) {
208 sprintf(macstr, "%02x:%02x:%02x:%02x:%02x:%02x", PRINT_MAC(mac)); 210 sprintf(macstr, "%02x:%02x:%02x:%02x:%02x:%02x", PRINT_MAC(mac));
209 211
210 // print 212 // print
211 printf("%-17.17s%-19.19s%-17.17s%-17.17s%-6.6s\n", 213 fmessage("%-17.17s%-19.19s%-17.17s%-17.17s%-6.6s\n",
212 ifa->ifa_name, macstr, ipstr, maskstr, status); 214 ifa->ifa_name, macstr, ipstr, maskstr, status);
213 215
214 // network scanning 216 // network scanning
@@ -238,7 +240,7 @@ int net_get_mac(const char *ifname, unsigned char mac[6]) {
238 errExit("socket"); 240 errExit("socket");
239 241
240 memset(&ifr, 0, sizeof(ifr)); 242 memset(&ifr, 0, sizeof(ifr));
241 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 243 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
242 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; 244 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
243 245
244 if (ioctl(sock, SIOCGIFHWADDR, &ifr) == -1) 246 if (ioctl(sock, SIOCGIFHWADDR, &ifr) == -1)
@@ -258,7 +260,7 @@ void net_if_ip(const char *ifname, uint32_t ip, uint32_t mask, int mtu) {
258 260
259 struct ifreq ifr; 261 struct ifreq ifr;
260 memset(&ifr, 0, sizeof(ifr)); 262 memset(&ifr, 0, sizeof(ifr));
261 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 263 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
262 ifr.ifr_addr.sa_family = AF_INET; 264 ifr.ifr_addr.sa_family = AF_INET;
263 265
264 ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = htonl(ip); 266 ((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr = htonl(ip);
@@ -292,7 +294,7 @@ int net_if_mac(const char *ifname, const unsigned char mac[6]) {
292 errExit("socket"); 294 errExit("socket");
293 295
294 memset(&ifr, 0, sizeof(ifr)); 296 memset(&ifr, 0, sizeof(ifr));
295 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 297 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
296 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; 298 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
297 memcpy(ifr.ifr_hwaddr.sa_data, mac, 6); 299 memcpy(ifr.ifr_hwaddr.sa_data, mac, 6);
298 300
@@ -350,7 +352,7 @@ void net_if_ip6(const char *ifname, const char *addr6) {
350 // find interface index 352 // find interface index
351 struct ifreq ifr; 353 struct ifreq ifr;
352 memset(&ifr, 0, sizeof(ifr)); 354 memset(&ifr, 0, sizeof(ifr));
353 strncpy(ifr.ifr_name, ifname, IFNAMSIZ); 355 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
354 ifr.ifr_addr.sa_family = AF_INET; 356 ifr.ifr_addr.sa_family = AF_INET;
355 if (ioctl(sock, SIOGIFINDEX, &ifr) < 0) { 357 if (ioctl(sock, SIOGIFINDEX, &ifr) < 0) {
356 perror("ioctl SIOGIFINDEX"); 358 perror("ioctl SIOGIFINDEX");
@@ -370,3 +372,129 @@ void net_if_ip6(const char *ifname, const char *addr6) {
370 372
371 close(sock); 373 close(sock);
372} 374}
375
376static int net_netlink_address_tentative(struct nlmsghdr *current_header) {
377 struct ifaddrmsg *msg = NLMSG_DATA(current_header);
378 int has_flags = 0;
379#ifdef IFA_FLAGS
380 struct rtattr *rta = IFA_RTA(msg);
381 size_t msg_len = IFA_PAYLOAD(current_header);
382 while (RTA_OK(rta, msg_len)) {
383 if (rta->rta_type == IFA_FLAGS) {
384 has_flags = 1;
385 uint32_t *flags = RTA_DATA(rta);
386 if (*flags & IFA_F_TENTATIVE)
387 return 1;
388 }
389 rta = RTA_NEXT(rta, msg_len);
390 }
391#endif
392 // According to <linux/if_addr.h>, if an IFA_FLAGS attribute is present,
393 // the field ifa_flags should be ignored.
394 return !has_flags && (msg->ifa_flags & IFA_F_TENTATIVE);
395}
396
397static int net_netlink_if_has_ll(int sock, uint32_t index) {
398 struct {
399 struct nlmsghdr header;
400 struct ifaddrmsg message;
401 } req;
402 memset(&req, 0, sizeof(req));
403 req.header.nlmsg_len = NLMSG_LENGTH(sizeof(req.message));
404 req.header.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
405 req.header.nlmsg_type = RTM_GETADDR;
406 req.message.ifa_family = AF_INET6;
407 if (send(sock, &req, req.header.nlmsg_len, 0) != req.header.nlmsg_len)
408 errExit("send");
409
410 int found = 0;
411 int all_parts_processed = 0;
412 while (!all_parts_processed) {
413 char buf[16384];
414 ssize_t len = recv(sock, buf, sizeof(buf), 0);
415 if (len < 0)
416 errExit("recv");
417 if (len < (ssize_t) sizeof(struct nlmsghdr)) {
418 fprintf(stderr, "Received incomplete netlink message\n");
419 exit(1);
420 }
421
422 struct nlmsghdr *current_header = (struct nlmsghdr *) buf;
423 while (NLMSG_OK(current_header, len)) {
424 switch (current_header->nlmsg_type) {
425 case RTM_NEWADDR: {
426 struct ifaddrmsg *msg = NLMSG_DATA(current_header);
427 if (!found && msg->ifa_index == index && msg->ifa_scope == RT_SCOPE_LINK &&
428 !net_netlink_address_tentative(current_header))
429 found = 1;
430 }
431 break;
432 case NLMSG_NOOP:
433 break;
434 case NLMSG_DONE:
435 all_parts_processed = 1;
436 break;
437 case NLMSG_ERROR: {
438 struct nlmsgerr *err = NLMSG_DATA(current_header);
439 fprintf(stderr, "Netlink error: %d\n", err->error);
440 exit(1);
441 }
442 break;
443 default:
444 fprintf(stderr, "Unknown netlink message type: %u\n", current_header->nlmsg_type);
445 exit(1);
446 break;
447 }
448
449 current_header = NLMSG_NEXT(current_header, len);
450 }
451 }
452
453 return found;
454}
455
456// wait for a link-local IPv6 address for DHCPv6
457// ex: firejail --net=br0 --ip6=dhcp
458void net_if_waitll(const char *ifname) {
459 // find interface index
460 int inet6_sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP);
461 if (inet6_sock < 0) {
462 fprintf(stderr, "Error fnet: IPv6 is not supported on this system\n");
463 exit(1);
464 }
465 struct ifreq ifr;
466 memset(&ifr, 0, sizeof(ifr));
467 strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1);
468 ifr.ifr_addr.sa_family = AF_INET;
469 if (ioctl(inet6_sock, SIOGIFINDEX, &ifr) < 0) {
470 perror("ioctl SIOGIFINDEX");
471 exit(1);
472 }
473 close(inet6_sock);
474 if (ifr.ifr_ifindex < 0) {
475 fprintf(stderr, "Error fnet: interface index is negative\n");
476 exit(1);
477 }
478 uint32_t index = (uint32_t) ifr.ifr_ifindex;
479
480 // poll for link-local address
481 int netlink_sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
482 if (netlink_sock < 0)
483 errExit("socket");
484 int tries = 0;
485 int found = 0;
486 while (tries < 60 && !found) {
487 if (tries >= 1)
488 usleep(500000);
489
490 found = net_netlink_if_has_ll(netlink_sock, index);
491
492 tries++;
493 }
494 close(netlink_sock);
495
496 if (!found) {
497 fprintf(stderr, "Waiting for link-local IPv6 address of %s timed out\n", ifname);
498 exit(1);
499 }
500}
diff --git a/src/fnet/main.c b/src/fnet/main.c
index f44760b5c..df8f7226c 100644
--- a/src/fnet/main.c
+++ b/src/fnet/main.c
@@ -1,5 +1,5 @@
1 /* 1 /*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,8 +18,24 @@
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#include "fnet.h" 20#include "fnet.h"
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <sys/utsname.h>
24
21int arg_quiet = 0; 25int arg_quiet = 0;
22 26
27void fmessage(char* fmt, ...) { // TODO: this function is duplicated in src/firejail/util.c
28 if (arg_quiet)
29 return;
30
31 va_list args;
32 va_start(args,fmt);
33 vfprintf(stderr, fmt, args);
34 va_end(args);
35 fflush(0);
36}
37
38
23static void usage(void) { 39static void usage(void) {
24 printf("Usage:\n"); 40 printf("Usage:\n");
25 printf("\tfnet create veth dev1 dev2 bridge child\n"); 41 printf("\tfnet create veth dev1 dev2 bridge child\n");
@@ -29,8 +45,9 @@ static void usage(void) {
29 printf("\tfnet printif scan\n"); 45 printf("\tfnet printif scan\n");
30 printf("\tfnet config interface dev ip mask mtu\n"); 46 printf("\tfnet config interface dev ip mask mtu\n");
31 printf("\tfnet config mac addr\n"); 47 printf("\tfnet config mac addr\n");
32 printf("\tfnet config ipv6 dev ipn"); 48 printf("\tfnet config ipv6 dev ip\n");
33 printf("\tfmet ifup dev\n"); 49 printf("\tfnet ifup dev\n");
50 printf("\tfnet waitll dev\n");
34} 51}
35 52
36int main(int argc, char **argv) { 53int main(int argc, char **argv) {
@@ -47,16 +64,18 @@ printf("\n");
47 usage(); 64 usage();
48 return 1; 65 return 1;
49 } 66 }
67 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) {
68 usage();
69 return 0;
70 }
71
72 warn_dumpable();
50 73
51 char *quiet = getenv("FIREJAIL_QUIET"); 74 char *quiet = getenv("FIREJAIL_QUIET");
52 if (quiet && strcmp(quiet, "yes") == 0) 75 if (quiet && strcmp(quiet, "yes") == 0)
53 arg_quiet = 1; 76 arg_quiet = 1;
54 77
55 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) { 78 if (argc == 3 && strcmp(argv[1], "ifup") == 0) {
56 usage();
57 return 0;
58 }
59 else if (argc == 3 && strcmp(argv[1], "ifup") == 0) {
60 net_if_up(argv[2]); 79 net_if_up(argv[2]);
61 } 80 }
62 else if (argc == 2 && strcmp(argv[1], "printif") == 0) { 81 else if (argc == 2 && strcmp(argv[1], "printif") == 0) {
@@ -74,7 +93,33 @@ printf("\n");
74 net_if_up(argv[3]); 93 net_if_up(argv[3]);
75 } 94 }
76 else if (argc == 6 && strcmp(argv[1], "create") == 0 && strcmp(argv[2], "macvlan") == 0) { 95 else if (argc == 6 && strcmp(argv[1], "create") == 0 && strcmp(argv[2], "macvlan") == 0) {
77 net_create_macvlan(argv[3], argv[4], atoi(argv[5])); 96 // use ipvlan for wireless devices
97 // ipvlan driver was introduced in Linux kernel 3.19
98
99 // check kernel version
100 struct utsname u;
101 int rv = uname(&u);
102 if (rv != 0)
103 errExit("uname");
104 int major;
105 int minor;
106 if (2 != sscanf(u.release, "%d.%d", &major, &minor)) {
107 fprintf(stderr, "Error fnet: cannot extract Linux kernel version: %s\n", u.version);
108 exit(1);
109 }
110
111 if (major <= 3 && minor < 18)
112 net_create_macvlan(argv[3], argv[4], atoi(argv[5]));
113 else {
114 struct stat s;
115 char *fname;
116 if (asprintf(&fname, "/sys/class/net/%s/wireless", argv[4]) == -1)
117 errExit("asprintf");
118 if (stat(fname, &s) == 0) // wireless
119 net_create_ipvlan(argv[3], argv[4], atoi(argv[5]));
120 else // regular ethernet
121 net_create_macvlan(argv[3], argv[4], atoi(argv[5]));
122 }
78 } 123 }
79 else if (argc == 7 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "interface") == 0) { 124 else if (argc == 7 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "interface") == 0) {
80 char *dev = argv[3]; 125 char *dev = argv[3];
@@ -99,6 +144,9 @@ printf("\n");
99 else if (argc == 5 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "ipv6") == 0) { 144 else if (argc == 5 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "ipv6") == 0) {
100 net_if_ip6(argv[3], argv[4]); 145 net_if_ip6(argv[3], argv[4]);
101 } 146 }
147 else if (argc == 3 && strcmp(argv[1], "waitll") == 0) {
148 net_if_waitll(argv[2]);
149 }
102 else { 150 else {
103 fprintf(stderr, "Error fnet: invalid arguments\n"); 151 fprintf(stderr, "Error fnet: invalid arguments\n");
104 return 1; 152 return 1;
diff --git a/src/fnet/veth.c b/src/fnet/veth.c
index d37c93a19..e09b1b1c5 100644
--- a/src/fnet/veth.c
+++ b/src/fnet/veth.c
@@ -3,10 +3,10 @@
3 * Original source code: 3 * Original source code:
4 * 4 *
5 * Information: 5 * Information:
6 * http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 6 * https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
7 * 7 *
8 * Download: 8 * Download:
9 * http://www.kernel.org/pub/linux/utils/net/iproute2/ 9 * https://www.kernel.org/pub/linux/utils/net/iproute2/
10 * 10 *
11 * Repository: 11 * Repository:
12 * git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git 12 * git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
@@ -26,7 +26,7 @@
26 * 26 *
27 */ 27 */
28 /* 28 /*
29 * Copyright (C) 2014-2017 Firejail Authors 29 * Copyright (C) 2014-2021 Firejail Authors
30 * 30 *
31 * This file is part of firejail project 31 * This file is part of firejail project
32 * 32 *
@@ -50,6 +50,13 @@
50#include <linux/veth.h> 50#include <linux/veth.h>
51#include <net/if.h> 51#include <net/if.h>
52 52
53// Debian Jessie and distributions before that don't have support for IPVLAN
54// in /usr/include/linux/if_link.h. We only need a definition for IPVLAN_MODE_L2.
55// The kernel version detection happens at run time.
56#ifndef IFLA_IPVLAN_MAX
57#define IPVLAN_MODE_L2 0
58#endif
59
53struct iplink_req 60struct iplink_req
54{ 61{
55 struct nlmsghdr n; 62 struct nlmsghdr n;
@@ -165,8 +172,66 @@ int net_create_macvlan(const char *dev, const char *parent, unsigned pid) {
165 addattr_l (&req.n, sizeof(req), IFLA_INFO_KIND, &macvlan_type, 4); 172 addattr_l (&req.n, sizeof(req), IFLA_INFO_KIND, &macvlan_type, 4);
166 173
167 data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data; 174 data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data;
168// req.n.nlmsg_len += sizeof(struct ifinfomsg); 175 linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
176
177 // send message
178 if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
179 exit(2);
180
181 rtnl_close(&rth);
182
183 return 0;
184}
185
186int net_create_ipvlan(const char *dev, const char *parent, unsigned pid) {
187 int len;
188 struct iplink_req req;
189 assert(dev);
190 assert(parent);
191
192 if (rtnl_open(&rth, 0) < 0) {
193 fprintf(stderr, "cannot open netlink\n");
194 exit(1);
195 }
196
197 memset(&req, 0, sizeof(req));
198
199 req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
200 req.n.nlmsg_flags = NLM_F_REQUEST|NLM_F_CREATE|NLM_F_EXCL;
201 req.n.nlmsg_type = RTM_NEWLINK;
202 req.i.ifi_family = 0;
169 203
204 // find parent ifindex
205 int parent_ifindex = if_nametoindex(parent);
206 if (parent_ifindex <= 0) {
207 fprintf(stderr, "Error: cannot find network device %s\n", parent);
208 exit(1);
209 }
210
211 // add parent
212 addattr_l(&req.n, sizeof(req), IFLA_LINK, &parent_ifindex, 4);
213
214 // add new interface name
215 len = strlen(dev) + 1;
216 addattr_l(&req.n, sizeof(req), IFLA_IFNAME, dev, len);
217
218 // place the interface in child namespace
219 addattr_l (&req.n, sizeof(req), IFLA_NET_NS_PID, &pid, 4);
220
221
222 // add link info for the new interface
223 struct rtattr *linkinfo = NLMSG_TAIL(&req.n);
224 addattr_l(&req.n, sizeof(req), IFLA_LINKINFO, NULL, 0);
225 addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, "ipvlan", strlen("ipvlan"));
226
227 // set macvlan bridge mode
228 struct rtattr * data = NLMSG_TAIL(&req.n);
229 addattr_l(&req.n, sizeof(req), IFLA_INFO_DATA, NULL, 0);
230 int macvlan_type = IPVLAN_MODE_L2;
231 addattr_l (&req.n, sizeof(req), IFLA_INFO_KIND, &macvlan_type, 2);
232
233 data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data;
234// req.n.nlmsg_len += sizeof(struct ifinfomsg);
170 235
171 data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data; 236 data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data;
172 linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo; 237 linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
diff --git a/src/fnetfilter/Makefile.in b/src/fnetfilter/Makefile.in
new file mode 100644
index 000000000..825262482
--- /dev/null
+++ b/src/fnetfilter/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: fnetfilter
3
4include ../common.mk
5
6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h
7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
8
9fnetfilter: $(OBJS) ../lib/common.o
10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o $(LIBS) $(EXTRA_LDFLAGS)
11
12.PHONY: clean
13clean:; rm -fr *.o fnetfilter *.gcov *.gcda *.gcno *.plist
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/fnetfilter/main.c b/src/fnetfilter/main.c
new file mode 100644
index 000000000..979f082d0
--- /dev/null
+++ b/src/fnetfilter/main.c
@@ -0,0 +1,212 @@
1 /*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "../include/common.h"
21
22#define MAXBUF 4098
23#define MAXARGS 16
24static char *args[MAXARGS] = {0};
25static int argcnt = 0;
26int arg_quiet = 0;
27
28
29static char *default_filter =
30"*filter\n"
31":INPUT DROP [0:0]\n"
32":FORWARD DROP [0:0]\n"
33":OUTPUT ACCEPT [0:0]\n"
34"-A INPUT -i lo -j ACCEPT\n"
35"-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n"
36"# echo replay is handled by -m state RELATED/ESTABLISHED above\n"
37"#-A INPUT -p icmp --icmp-type echo-reply -j ACCEPT\n"
38"-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT\n"
39"-A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT\n"
40"-A INPUT -p icmp --icmp-type echo-request -j ACCEPT \n"
41"# disable STUN\n"
42"-A OUTPUT -p udp --dport 3478 -j DROP\n"
43"-A OUTPUT -p udp --dport 3479 -j DROP\n"
44"-A OUTPUT -p tcp --dport 3478 -j DROP\n"
45"-A OUTPUT -p tcp --dport 3479 -j DROP\n"
46"COMMIT\n";
47
48static void usage(void) {
49 printf("Usage:\n");
50 printf("\tfnetfilter netfilter-command destination-file\n");
51}
52
53static void err_exit_cannot_open_file(const char *fname) {
54 fprintf(stderr, "Error fnetfilter: cannot open %s\n", fname);
55 exit(1);
56}
57
58
59static void copy(const char *src, const char *dest) {
60 FILE *fp1 = fopen(src, "r");
61 if (!fp1)
62 err_exit_cannot_open_file(src);
63
64 FILE *fp2 = fopen(dest, "w");
65 if (!fp2)
66 err_exit_cannot_open_file(dest);
67
68 char buf[MAXBUF];
69 while (fgets(buf, MAXBUF, fp1))
70 fprintf(fp2, "%s", buf);
71
72 fclose(fp1);
73 fclose(fp2);
74}
75
76static void process_template(char *src, const char *dest) {
77 char *arg_start = strchr(src, ',');
78 assert(arg_start);
79 *arg_start = '\0';
80 arg_start++;
81 if (*arg_start == '\0') {
82 fprintf(stderr, "Error fnetfilter: you need to provide at least one argument\n");
83 exit(1);
84 }
85
86 // extract the arguments from command line
87 char *token = strtok(arg_start, ",");
88 while (token) {
89 if (argcnt == MAXARGS) {
90 fprintf(stderr, "Error fnetfilter: only up to %u arguments are supported\n", (unsigned) MAXARGS);
91 exit(1);
92 }
93 // look for abnormal things
94 int len = strlen(token);
95 if (strcspn(token, "\\&!?\"'<>%^(){};,*[]") != (size_t)len) {
96 fprintf(stderr, "Error fnetfilter: invalid argument in netfilter command\n");
97 exit(1);
98 }
99 args[argcnt] = token;
100 argcnt++;
101 token = strtok(NULL, ",");
102 }
103#if 0
104{
105printf("argcnt %d\n", argcnt);
106int i;
107for (i = 0; i < argcnt; i++)
108 printf("%s\n", args[i]);
109}
110#endif
111
112 // open the files
113 FILE *fp1 = fopen(src, "r");
114 if (!fp1)
115 err_exit_cannot_open_file(src);
116
117 FILE *fp2 = fopen(dest, "w");
118 if (!fp2)
119 err_exit_cannot_open_file(dest);
120
121 int line = 0;
122 char buf[MAXBUF];
123 while (fgets(buf, MAXBUF, fp1)) {
124 line++;
125 char *ptr = buf;
126 while (*ptr != '\0') {
127 if (*ptr != '$')
128 fputc(*ptr, fp2);
129 else {
130 // parsing
131 int index = 0;
132 int rv = sscanf(ptr, "$ARG%d", &index) ;
133 if (rv != 1) {
134 fprintf(stderr, "Error fnetfilter: invalid template argument on line %d\n", line);
135 exit(1);
136 }
137
138 // print argument
139 if (index < 1 || index > argcnt) {
140 fprintf(stderr, "Error fnetfilter: $ARG%d on line %d was not defined\n", index, line);
141 exit(1);
142 }
143 fprintf(fp2, "%s", args[index - 1]);
144
145 // march to the end of argument
146 ptr += 4;
147 while (isdigit(*ptr))
148 ptr++;
149 ptr--;
150 }
151 ptr++;
152 }
153 }
154
155 fclose(fp1);
156 fclose(fp2);
157}
158
159int main(int argc, char **argv) {
160#if 0
161{
162system("cat /proc/self/status");
163int i;
164for (i = 0; i < argc; i++)
165 printf("*%s* ", argv[i]);
166printf("\n");
167}
168#endif
169
170 char *quiet = getenv("FIREJAIL_QUIET");
171 if (quiet && strcmp(quiet, "yes") == 0)
172 arg_quiet = 1;
173
174 if (argc > 1 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0)) {
175 usage();
176 return 0;
177 }
178
179 if (argc != 2 && argc != 3) {
180 usage();
181 return 1;
182 }
183
184 warn_dumpable();
185
186 char *destfile = (argc == 3)? argv[2]: argv[1];
187 char *command = (argc == 3)? argv[1]: NULL;
188//printf("command %s\n", command);
189//printf("destfile %s\n", destfile);
190 // destfile is a real filename
191 int len = strlen(destfile);
192 if (strcspn(destfile, "\\&!?\"'<>%^(){};,*[]") != (size_t)len)
193 err_exit_cannot_open_file(destfile);
194
195 // handle default config (command = NULL, destfile)
196 if (command == NULL) {
197 // create a default filter file
198 FILE *fp = fopen(destfile, "w");
199 if (!fp)
200 err_exit_cannot_open_file(destfile);
201 fprintf(fp, "%s\n", default_filter);
202 fclose(fp);
203 }
204 else {
205 if (strrchr(command, ','))
206 process_template(command, destfile);
207 else
208 copy(command, destfile);
209 }
210
211 return 0;
212}
diff --git a/src/fsec-optimize/Makefile.in b/src/fsec-optimize/Makefile.in
new file mode 100644
index 000000000..a2187e89c
--- /dev/null
+++ b/src/fsec-optimize/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: fsec-optimize
3
4include ../common.mk
5
6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/seccomp.h ../include/syscall.h
7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
8
9fsec-optimize: $(OBJS) ../lib/common.o ../lib/libnetlink.o
10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/errno.o $(LIBS) $(EXTRA_LDFLAGS)
11
12.PHONY: clean
13clean:; rm -fr *.o fsec-optimize *.gcov *.gcda *.gcno *.plist
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/fsec-optimize/fsec_optimize.h b/src/fsec-optimize/fsec_optimize.h
new file mode 100644
index 000000000..fc9dd7db8
--- /dev/null
+++ b/src/fsec-optimize/fsec_optimize.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#ifndef FSEC_OPTIMIZE_H
21#define FSEC_OPTIMIZE_H
22#include "../include/common.h"
23#include "../include/seccomp.h"
24#include <sys/mman.h>
25
26// optimize.c
27struct sock_filter *duplicate(struct sock_filter *filter, int entries);
28int optimize(struct sock_filter * filter, int entries);
29
30#endif
diff --git a/src/fsec-optimize/main.c b/src/fsec-optimize/main.c
new file mode 100644
index 000000000..84bf2d4f9
--- /dev/null
+++ b/src/fsec-optimize/main.c
@@ -0,0 +1,114 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fsec_optimize.h"
21#include "../include/syscall.h"
22
23int arg_seccomp_error_action = SECCOMP_RET_ERRNO | EPERM; // error action: errno, log or kill
24
25static void usage(void) {
26 printf("Usage:\n");
27 printf("\tfsec-optimize file - optimize seccomp filter\n");
28}
29
30int main(int argc, char **argv) {
31#if 0
32{
33//system("cat /proc/self/status");
34int i;
35for (i = 0; i < argc; i++)
36 printf("*%s* ", argv[i]);
37printf("\n");
38}
39#endif
40 if (argc != 2) {
41 usage();
42 return 1;
43 }
44
45 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0) {
46 usage();
47 return 0;
48 }
49
50 warn_dumpable();
51
52 char *error_action = getenv("FIREJAIL_SECCOMP_ERROR_ACTION");
53 if (error_action) {
54 if (strcmp(error_action, "kill") == 0)
55 arg_seccomp_error_action = SECCOMP_RET_KILL;
56 else if (strcmp(error_action, "log") == 0)
57 arg_seccomp_error_action = SECCOMP_RET_LOG;
58 else {
59 arg_seccomp_error_action = errno_find_name(error_action);
60 if (arg_seccomp_error_action == -1)
61 errExit("seccomp-error-action: unknown errno");
62 arg_seccomp_error_action |= SECCOMP_RET_ERRNO;
63 }
64 }
65
66 char *fname = argv[1];
67
68 // open input file
69 int fd = open(fname, O_RDONLY);
70 if (fd == -1)
71 goto errexit;
72
73 // calculate the number of entries
74 int size = lseek(fd, 0, SEEK_END);
75 if (size == -1) // todo: check maximum size of seccomp filter (4KB?)
76 goto errexit;
77 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter);
78
79 // read filter
80 struct sock_filter *filter = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
81 if (filter == MAP_FAILED)
82 goto errexit;
83 close(fd);
84
85 // duplicate the filter memory and unmap the file
86 struct sock_filter *outfilter = duplicate(filter, entries);
87 if (munmap(filter, size) == -1)
88 perror("Error un-mmapping the file");
89
90 // optimize filter
91 entries = optimize(outfilter, entries);
92
93 // write the new file and free memory
94 fd = open(argv[1], O_WRONLY | O_TRUNC | O_CREAT, 0755);
95 if (fd == -1) {
96 fprintf(stderr, "Error: cannot open output file\n");
97 return 1;
98 }
99 size = write(fd, outfilter, entries * sizeof(struct sock_filter));
100 if (size != (int) (entries * sizeof(struct sock_filter))) {
101 fprintf(stderr, "Error: cannot write output file\n");
102 return 1;
103 }
104 close(fd);
105 free(outfilter);
106
107 return 0;
108errexit:
109 if (fd != -1)
110 close(fd);
111 fprintf(stderr, "Error: cannot read %s\n", fname);
112 exit(1);
113
114}
diff --git a/src/fsec-optimize/optimizer.c b/src/fsec-optimize/optimizer.c
new file mode 100644
index 000000000..4c02de59d
--- /dev/null
+++ b/src/fsec-optimize/optimizer.c
@@ -0,0 +1,135 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fsec_optimize.h"
21
22// From /usr/include/linux/filter.h
23//struct sock_filter { /* Filter block */
24// __u16 code; /* Actual filter code */
25// __u8 jt; /* Jump true */
26// __u8 jf; /* Jump false */
27// __u32 k; /* Generic multiuse field */
28//};
29
30
31#define LIMIT_BLACKLISTS 4 // we optimize blacklists only if we have more than
32
33static inline int is_blacklist(struct sock_filter *bpf) {
34 if (bpf->code == BPF_JMP + BPF_JEQ + BPF_K &&
35 (bpf + 1)->code == BPF_RET + BPF_K &&
36 (bpf + 1)->k == (__u32)arg_seccomp_error_action)
37 return 1;
38 return 0;
39}
40
41static int count_blacklists(struct sock_filter *filter, int entries) {
42 int cnt = 0;
43 int i;
44
45 for (i = 0; i < (entries - 1); i++, filter++) { // is_blacklist works on two consecutive lines; using entries - 1
46 if (is_blacklist(filter))
47 cnt++;
48 }
49
50 return cnt;
51}
52
53typedef struct {
54 int to_remove;
55 int to_fix_jumps;
56} Action;
57
58static int optimize_blacklists(struct sock_filter *filter, int entries) {
59 assert(entries);
60 assert(filter);
61 int i;
62 int j;
63
64 // step1: extract information
65 Action action[entries];
66 memset(&action[0], 0, sizeof(Action) * entries);
67 int remove_cnt = 0;
68 for (i = 0; i < (entries - 1); i++) { // is_blacklist works on two consecutive lines; using entries - 1
69 if (is_blacklist(filter + i)) {
70 action[i]. to_fix_jumps = 1;
71 i++;
72 action[i].to_remove = 1;
73 remove_cnt++;
74 }
75 }
76
77 // step2: remove lines
78 struct sock_filter *filter_step2 = duplicate(filter, entries);
79 Action action_step2[entries];
80 memset(&action_step2[0], 0, sizeof(Action) * entries);
81 for (i = 0, j = 0; i < entries; i++) {
82 if (!action[i].to_remove) {
83 memcpy(&filter_step2[j], &filter[i], sizeof(struct sock_filter));
84 memcpy(&action_step2[j], &action[i], sizeof(Action));
85 j++;
86 }
87 else {
88 // do nothing, we are removing this line
89 }
90 }
91
92 // step 3: add the new ret KILL/LOG/ERRNO, and recalculate entries
93 filter_step2[j].code = BPF_RET + BPF_K;
94 filter_step2[j].k = arg_seccomp_error_action;
95 entries = j + 1;
96
97 // step 4: recalculate jumps
98 for (i = 0; i < entries; i++) {
99 if (action_step2[i].to_fix_jumps) {
100 filter_step2[i].jt = entries - i - 2;
101 filter_step2[i].jf = 0;
102 }
103 }
104
105 // update
106 memcpy(filter, filter_step2, entries * sizeof(struct sock_filter));
107 free(filter_step2);
108 return entries;
109}
110
111int optimize(struct sock_filter *filter, int entries) {
112 assert(filter);
113 assert(entries);
114
115 //**********************************
116 // optimize blacklist statements
117 //**********************************
118 // count "ret KILL"
119 int cnt = count_blacklists(filter, entries);
120 if (cnt > LIMIT_BLACKLISTS)
121 entries = optimize_blacklists(filter, entries);
122 return entries;
123}
124
125struct sock_filter *duplicate(struct sock_filter *filter, int entries) {
126 int len = sizeof(struct sock_filter) * entries;
127 struct sock_filter *rv = malloc(len);
128 if (!rv) {
129 errExit("malloc");
130 exit(1);
131 }
132
133 memcpy(rv, filter, len);
134 return rv;
135}
diff --git a/src/fsec-print/Makefile.in b/src/fsec-print/Makefile.in
new file mode 100644
index 000000000..824fb5daf
--- /dev/null
+++ b/src/fsec-print/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: fsec-print
3
4include ../common.mk
5
6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/seccomp.h ../include/syscall.h
7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
8
9fsec-print: $(OBJS) ../lib/common.o ../lib/libnetlink.o ../lib/errno.o ../lib/syscall.o
10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/errno.o ../lib/syscall.o $(LIBS) $(EXTRA_LDFLAGS)
11
12.PHONY: clean
13clean:; rm -fr *.o fsec-print *.gcov *.gcda *.gcno *.plist
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/libpostexecseccomp/libpostexecseccomp.h b/src/fsec-print/fsec_print.h
index c4aca540a..75a82c11a 100644
--- a/src/libpostexecseccomp/libpostexecseccomp.h
+++ b/src/fsec-print/fsec_print.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,9 +17,14 @@
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 LIBPOSTEXECSECCOMP_H 20#ifndef FSEC_PRINT_H
21#define LIBPOSTEXECSECCOMP_H 21#define FSEC_PRINT_H
22#include "../include/common.h"
23#include "../include/seccomp.h"
24#include "../include/syscall.h"
25#include <sys/mman.h>
22 26
23#define RUN_SECCOMP_POSTEXEC "/run/firejail/mnt/seccomp.postexec" 27// print.c
28void print(struct sock_filter *filter, int entries);
24 29
25#endif 30#endif
diff --git a/src/fsec-print/main.c b/src/fsec-print/main.c
new file mode 100644
index 000000000..5bca93d50
--- /dev/null
+++ b/src/fsec-print/main.c
@@ -0,0 +1,101 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fsec_print.h"
21
22static void usage(void) {
23 printf("Usage:\n");
24 printf("\tfsec-print file - disassemble seccomp filter\n");
25}
26
27int arg_quiet = 0;
28void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) {
29 (void) fd;
30 (void) syscall;
31 (void) arg;
32 (void) ptrarg;
33 (void) native;
34}
35
36void filter_add_blacklist_override(int fd, int syscall, int arg, void *ptrarg, bool native) {
37 (void) fd;
38 (void) syscall;
39 (void) arg;
40 (void) ptrarg;
41 (void) native;
42}
43
44int main(int argc, char **argv) {
45#if 0
46{
47//system("cat /proc/self/status");
48int i;
49for (i = 0; i < argc; i++)
50 printf("*%s* ", argv[i]);
51printf("\n");
52}
53#endif
54 if (argc != 2) {
55 usage();
56 return 1;
57 }
58
59 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0) {
60 usage();
61 return 0;
62 }
63
64 warn_dumpable();
65
66 char *fname = argv[1];
67
68 // open input file
69 int fd = open(fname, O_RDONLY);
70 if (fd == -1)
71 goto errexit;
72
73 // calculate the number of entries
74 int size = lseek(fd, 0, SEEK_END);
75 if (size == -1) // todo: check maximum size of seccomp filter (4KB?)
76 goto errexit;
77 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter);
78
79 // read filter
80 struct sock_filter *filter = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
81 if (filter == MAP_FAILED)
82 goto errexit;
83
84
85 // print filter
86 print(filter, entries);
87
88 // free mapped memory
89 if (munmap(filter, size) == -1)
90 perror("Error un-mmapping the file");
91
92 // close file
93 close(fd);
94 return 0;
95errexit:
96 if (fd != -1)
97 close(fd);
98 fprintf(stderr, "Error: cannot read %s\n", fname);
99 exit(1);
100
101}
diff --git a/src/fsec-print/print.c b/src/fsec-print/print.c
new file mode 100644
index 000000000..143a7a53e
--- /dev/null
+++ b/src/fsec-print/print.c
@@ -0,0 +1,332 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 *
21 *
22 * Parts of this code was lifted from libseccomp project, license LGPL 2.1.
23 * This is the original copyright notice in libseccomp code:
24 *
25 *
26 *
27 * BPF Disassembler
28 *
29 * Copyright (c) 2012 Red Hat <pmoore@redhat.com>
30 * Author: Paul Moore <paul@paul-moore.com>
31 *
32 * This library is free software; you can redistribute it and/or modify it
33 * under the terms of version 2.1 of the GNU Lesser General Public License as
34 * published by the Free Software Foundation.
35 *
36 * This library is distributed in the hope that it will be useful, but WITHOUT
37 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
38 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
39 * for more details.
40 *
41 * You should have received a copy of the GNU Lesser General Public License
42 * along with this library; if not, see <https://www.gnu.org/licenses>.
43 */
44
45#include "fsec_print.h"
46
47// From /usr/include/linux/filter.h
48//struct sock_filter { /* Filter block */
49// __u16 code; /* Actual filter code */
50// __u8 jt; /* Jump true */
51// __u8 jf; /* Jump false */
52// __u32 k; /* Generic multiuse field */
53//};
54
55
56static const char *bpf_decode_op(const struct sock_filter *bpf) {
57 switch (bpf->code) {
58 case BPF_LD+BPF_W+BPF_IMM:
59 case BPF_LD+BPF_W+BPF_ABS:
60 case BPF_LD+BPF_W+BPF_IND:
61 case BPF_LD+BPF_W+BPF_MEM:
62 case BPF_LD+BPF_W+BPF_LEN:
63 case BPF_LD+BPF_W+BPF_MSH:
64 return "ld";
65 case BPF_LD+BPF_H+BPF_IMM:
66 case BPF_LD+BPF_H+BPF_ABS:
67 case BPF_LD+BPF_H+BPF_IND:
68 case BPF_LD+BPF_H+BPF_MEM:
69 case BPF_LD+BPF_H+BPF_LEN:
70 case BPF_LD+BPF_H+BPF_MSH:
71 return "ldh";
72 case BPF_LD+BPF_B+BPF_IMM:
73 case BPF_LD+BPF_B+BPF_ABS:
74 case BPF_LD+BPF_B+BPF_IND:
75 case BPF_LD+BPF_B+BPF_MEM:
76 case BPF_LD+BPF_B+BPF_LEN:
77 case BPF_LD+BPF_B+BPF_MSH:
78 return "ldb";
79 case BPF_LDX+BPF_W+BPF_IMM:
80 case BPF_LDX+BPF_W+BPF_ABS:
81 case BPF_LDX+BPF_W+BPF_IND:
82 case BPF_LDX+BPF_W+BPF_MEM:
83 case BPF_LDX+BPF_W+BPF_LEN:
84 case BPF_LDX+BPF_W+BPF_MSH:
85 case BPF_LDX+BPF_H+BPF_IMM:
86 case BPF_LDX+BPF_H+BPF_ABS:
87 case BPF_LDX+BPF_H+BPF_IND:
88 case BPF_LDX+BPF_H+BPF_MEM:
89 case BPF_LDX+BPF_H+BPF_LEN:
90 case BPF_LDX+BPF_H+BPF_MSH:
91 case BPF_LDX+BPF_B+BPF_IMM:
92 case BPF_LDX+BPF_B+BPF_ABS:
93 case BPF_LDX+BPF_B+BPF_IND:
94 case BPF_LDX+BPF_B+BPF_MEM:
95 case BPF_LDX+BPF_B+BPF_LEN:
96 case BPF_LDX+BPF_B+BPF_MSH:
97 return "ldx";
98 case BPF_ST:
99 return "st";
100 case BPF_STX:
101 return "stx";
102 case BPF_ALU+BPF_ADD+BPF_K:
103 case BPF_ALU+BPF_ADD+BPF_X:
104 return "add";
105 case BPF_ALU+BPF_SUB+BPF_K:
106 case BPF_ALU+BPF_SUB+BPF_X:
107 return "sub";
108 case BPF_ALU+BPF_MUL+BPF_K:
109 case BPF_ALU+BPF_MUL+BPF_X:
110 return "mul";
111 case BPF_ALU+BPF_DIV+BPF_K:
112 case BPF_ALU+BPF_DIV+BPF_X:
113 return "div";
114 case BPF_ALU+BPF_OR+BPF_K:
115 case BPF_ALU+BPF_OR+BPF_X:
116 return "or";
117 case BPF_ALU+BPF_AND+BPF_K:
118 case BPF_ALU+BPF_AND+BPF_X:
119 return "and";
120 case BPF_ALU+BPF_LSH+BPF_K:
121 case BPF_ALU+BPF_LSH+BPF_X:
122 return "lsh";
123 case BPF_ALU+BPF_RSH+BPF_K:
124 case BPF_ALU+BPF_RSH+BPF_X:
125 return "rsh";
126 case BPF_ALU+BPF_NEG+BPF_K:
127 case BPF_ALU+BPF_NEG+BPF_X:
128 return "neg";
129 case BPF_ALU+BPF_MOD+BPF_K:
130 case BPF_ALU+BPF_MOD+BPF_X:
131 return "mod";
132 case BPF_ALU+BPF_XOR+BPF_K:
133 case BPF_ALU+BPF_XOR+BPF_X:
134 return "xor";
135 case BPF_JMP+BPF_JA+BPF_K:
136 case BPF_JMP+BPF_JA+BPF_X:
137 return "jmp";
138 case BPF_JMP+BPF_JEQ+BPF_K:
139 case BPF_JMP+BPF_JEQ+BPF_X:
140 return "jeq";
141 case BPF_JMP+BPF_JGT+BPF_K:
142 case BPF_JMP+BPF_JGT+BPF_X:
143 return "jgt";
144 case BPF_JMP+BPF_JGE+BPF_K:
145 case BPF_JMP+BPF_JGE+BPF_X:
146 return "jge";
147 case BPF_JMP+BPF_JSET+BPF_K:
148 case BPF_JMP+BPF_JSET+BPF_X:
149 return "jset";
150 case BPF_RET+BPF_K:
151 case BPF_RET+BPF_X:
152 case BPF_RET+BPF_A:
153 return "ret";
154 case BPF_MISC+BPF_TAX:
155 return "tax";
156 case BPF_MISC+BPF_TXA:
157 return "txa";
158 }
159 return "???";
160}
161
162static void bpf_decode_action(uint32_t k) {
163 uint32_t act = k & SECCOMP_RET_ACTION;
164 uint32_t data = k & SECCOMP_RET_DATA;
165
166 switch (act) {
167 case SECCOMP_RET_KILL:
168 printf("KILL");
169 break;
170 case SECCOMP_RET_TRAP:
171 printf("TRAP");
172 break;
173 case SECCOMP_RET_ERRNO:
174 printf("ERRNO(%u)", data);
175 break;
176 case SECCOMP_RET_TRACE:
177 printf("TRACE(%u)", data);
178 break;
179 case SECCOMP_RET_LOG:
180 printf("LOG");
181 break;
182 case SECCOMP_RET_ALLOW:
183 printf("ALLOW");
184 break;
185 default:
186 printf("0x%.8x", k);
187 }
188}
189
190
191// implementing a simple state machine around accumulator
192// in order to translate the syscall number
193int syscall_loaded = 0;
194int native_arch = 0;
195
196static void bpf_decode_args(const struct sock_filter *bpf, unsigned int line) {
197 switch (BPF_CLASS(bpf->code)) {
198 case BPF_LD:
199 case BPF_LDX:
200 switch (BPF_MODE(bpf->code)) {
201 case BPF_ABS:
202 syscall_loaded = 0;
203 if (bpf->k == offsetof(struct seccomp_data, arch))
204 printf("data.architecture");
205 else if (bpf->k == offsetof(struct seccomp_data, nr)) {
206 printf("data.syscall-number");
207 syscall_loaded = 1;
208 }
209 else if (bpf->k == offsetof(struct seccomp_data, instruction_pointer))
210 printf("data.instruction_pointer");
211 else {
212 int index = bpf->k - offsetof(struct seccomp_data, args);
213 printf("data.args[%x]", index);
214 }
215 break;
216 case BPF_MEM:
217 printf("$temp[%u]", bpf->k);
218 break;
219 case BPF_IMM:
220 printf("%x", bpf->k);
221 break;
222 case BPF_IND:
223 printf("$data[X + %x]", bpf->k);
224 break;
225 case BPF_LEN:
226 printf("len($data)");
227 break;
228 case BPF_MSH:
229 printf("4 * $data[%x] & 0x0f", bpf->k);
230 break;
231 }
232 break;
233 case BPF_ST:
234 case BPF_STX:
235 printf("$temp[%u]", bpf->k);
236 break;
237 case BPF_ALU:
238 if (BPF_SRC(bpf->code) == BPF_K) {
239 switch (BPF_OP(bpf->code)) {
240 case BPF_OR:
241 case BPF_AND:
242 printf("%.8x", bpf->k);
243 break;
244 default:
245 printf("%x", bpf->k);
246 }
247 }
248 else
249 printf("%u", bpf->k);
250 break;
251 case BPF_JMP:
252 if (BPF_OP(bpf->code) == BPF_JA) {
253 printf("%.4x", (line + 1) + bpf->k);
254 }
255 else {
256 const char *name = NULL;
257 if (syscall_loaded && native_arch)
258 name = syscall_find_nr(bpf->k);
259 if (bpf->k == ARCH_32) {
260 printf("ARCH_32 %.4x (false %.4x)",
261 (line + 1) + bpf->jt,
262 (line + 1) + bpf->jf);
263 native_arch = (ARCH_NR == ARCH_32)? 1: 0;
264 }
265 else if (bpf->k == ARCH_64) {
266 printf("ARCH_64 %.4x (false %.4x)",
267 (line + 1) + bpf->jt,
268 (line + 1) + bpf->jf);
269 native_arch = (ARCH_NR == ARCH_64)? 1: 0;
270 }
271 else if (bpf->k == X32_SYSCALL_BIT)
272 printf("X32_ABI %.4x (false %.4x)",
273 (line + 1) + bpf->jt,
274 (line + 1) + bpf->jf);
275 else if (name)
276 printf("%s %.4x (false %.4x)",
277 name,
278 (line + 1) + bpf->jt,
279 (line + 1) + bpf->jf);
280 else
281 printf("%x %.4x (false %.4x)",
282 bpf->k,
283 (line + 1) + bpf->jt,
284 (line + 1) + bpf->jf);
285 }
286 break;
287 case BPF_RET:
288 if (BPF_RVAL(bpf->code) == BPF_A) {
289 /* XXX - accumulator? */
290 printf("$acc");
291 }
292 else if (BPF_SRC(bpf->code) == BPF_K) {
293 bpf_decode_action(bpf->k);
294 }
295 else if (BPF_SRC(bpf->code) == BPF_X) {
296 /* XXX - any idea? */
297 printf("???");
298 }
299 break;
300 case BPF_MISC:
301 break;
302 default:
303 printf("???");
304 }
305}
306
307void print(struct sock_filter *filter, int entries) {
308 int i;
309
310 /* header */
311 printf(" line OP JT JF K\n");
312 printf("=================================\n");
313 struct sock_filter *bpf = filter;
314 for (i = 0; i < entries; i++, bpf++) {
315
316 /* convert the bpf statement */
317// bpf.code = ttoh16(arch, bpf.code);
318// bpf.k = ttoh32(arch, bpf.k);
319
320 /* display a hex dump */
321 printf(" %.4x: %.2x %.2x %.2x %.8x",
322 i, bpf->code, bpf->jt, bpf->jf, bpf->k);
323
324 /* display the assembler statements */
325 printf(" ");
326 printf("%-3s", bpf_decode_op(bpf));
327 printf(" ");
328 bpf_decode_args(bpf, i);
329
330 printf("\n");
331 }
332}
diff --git a/src/fseccomp/Makefile.in b/src/fseccomp/Makefile.in
index df4343d36..41abfce17 100644
--- a/src/fseccomp/Makefile.in
+++ b/src/fseccomp/Makefile.in
@@ -1,45 +1,17 @@
1.PHONY: all
1all: fseccomp 2all: fseccomp
2 3
3CC=@CC@ 4include ../common.mk
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6libdir=@libdir@
7sysconfdir=@sysconfdir@
8
9VERSION=@PACKAGE_VERSION@
10NAME=@PACKAGE_NAME@
11HAVE_SECCOMP_H=@HAVE_SECCOMP_H@
12HAVE_SECCOMP=@HAVE_SECCOMP@
13HAVE_CHROOT=@HAVE_CHROOT@
14HAVE_BIND=@HAVE_BIND@
15HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
16HAVE_NETWORK=@HAVE_NETWORK@
17HAVE_USERNS=@HAVE_USERNS@
18HAVE_X11=@HAVE_X11@
19HAVE_FILE_TRANSFER=@HAVE_FILE_TRANSFER@
20HAVE_WHITELIST=@HAVE_WHITELIST@
21HAVE_GLOBALCFG=@HAVE_GLOBALCFG@
22HAVE_APPARMOR=@HAVE_APPARMOR@
23HAVE_OVERLAYFS=@HAVE_OVERLAYFS@
24HAVE_PRIVATE_HOME=@HAVE_PRIVATE_HOME@
25EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
26HAVE_GCOV=@HAVE_GCOV@
27EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
28
29H_FILE_LIST = $(sort $(wildcard *.[h]))
30C_FILE_LIST = $(sort $(wildcard *.c))
31OBJS = $(C_FILE_LIST:.c=.o)
32BINOBJS = $(foreach file, $(OBJS), $file)
33CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' $(HAVE_X11) $(HAVE_PRIVATE_HOME) $(HAVE_APPARMOR) $(HAVE_OVERLAYFS) $(HAVE_SECCOMP) $(HAVE_GLOBALCFG) $(HAVE_SECCOMP_H) $(HAVE_CHROOT) $(HAVE_NETWORK) $(HAVE_USERNS) $(HAVE_BIND) $(HAVE_FILE_TRANSFER) $(HAVE_WHITELIST) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
34LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
35 5
36%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h 6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/syscall.h
37 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
38 8
39fseccomp: $(OBJS) 9fseccomp: $(OBJS) ../lib/common.o ../lib/errno.o ../lib/syscall.o
40 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/errno.o ../lib/syscall.o $(LIBS) $(EXTRA_LDFLAGS)
41 11
42clean:; rm -f *.o fseccomp *.gcov *.gcda *.gcno 12.PHONY: clean
13clean:; rm -fr *.o fseccomp *.gcov *.gcda *.gcno *.plist
43 14
15.PHONY: distclean
44distclean: clean 16distclean: clean
45 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/fseccomp/fseccomp.h b/src/fseccomp/fseccomp.h
index 2deb282f5..97eac9ed8 100644
--- a/src/fseccomp/fseccomp.h
+++ b/src/fseccomp/fseccomp.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -24,21 +24,11 @@
24#include <string.h> 24#include <string.h>
25#include <assert.h> 25#include <assert.h>
26#include "../include/common.h" 26#include "../include/common.h"
27#include "../include/syscall.h"
27 28
28// main.c 29// main.c
29extern int arg_quiet; 30extern int arg_quiet;
30 31
31// syscall.c
32void syscall_print(void);
33int syscall_check_list(const char *slist, void (*callback)(int fd, int syscall, int arg, void *ptrarg), int fd, int arg, void *ptrarg);
34const char *syscall_find_nr(int nr);
35void syscalls_in_list(const char *list, const char *slist, int fd, char **prelist, char **postlist);
36
37// errno.c
38void errno_print(void);
39int errno_find_name(const char *name);
40char *errno_find_nr(int nr);
41
42// protocol.c 32// protocol.c
43void protocol_print(void); 33void protocol_print(void);
44void protocol_build_filter(const char *prlist, const char *fname); 34void protocol_build_filter(const char *prlist, const char *fname);
@@ -49,25 +39,27 @@ void seccomp_secondary_32(const char *fname);
49void seccomp_secondary_block(const char *fname); 39void seccomp_secondary_block(const char *fname);
50 40
51// seccomp_file.c 41// seccomp_file.c
52void write_to_file(int fd, const void *data, int size); 42void write_to_file(int fd, const void *data, size_t size);
53void filter_init(int fd); 43void filter_init(int fd, bool native);
54void filter_add_whitelist(int fd, int syscall, int arg, void *ptrarg); 44void filter_add_whitelist(int fd, int syscall, int arg, void *ptrarg, bool native);
55void filter_add_blacklist(int fd, int syscall, int arg, void *ptrarg); 45void filter_add_whitelist_for_excluded(int fd, int syscall, int arg, void *ptrarg, bool native);
56void filter_add_errno(int fd, int syscall, int arg, void *ptrarg); 46void filter_add_blacklist(int fd, int syscall, int arg, void *ptrarg, bool native);
47void filter_add_blacklist_for_excluded(int fd, int syscall, int arg, void *ptrarg, bool native);
57void filter_end_blacklist(int fd); 48void filter_end_blacklist(int fd);
58void filter_end_whitelist(int fd); 49void filter_end_whitelist(int fd);
59 50
60// seccomp.c 51// seccomp.c
61// default list 52// default list
62void seccomp_default(const char *fname, int allow_debuggers); 53void seccomp_default(const char *fname, int allow_debuggers, bool native);
63// drop list 54// drop list
64void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers); 55void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers, bool native);
65// default+drop list 56// default+drop list
66void seccomp_default_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers); 57void seccomp_default_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers, bool native);
67// whitelisted filter 58// whitelisted filter
68void seccomp_keep(const char *fname1, const char *fname2, char *list); 59void seccomp_keep(const char *fname1, const char *fname2, char *list, bool native);
69// block writable and executable memory 60// block writable and executable memory
70void memory_deny_write_execute(const char *fname); 61void memory_deny_write_execute(const char *fname);
62void memory_deny_write_execute_32(const char *fname);
71 63
72// seccomp_print 64// seccomp_print
73void filter_print(const char *fname); 65void filter_print(const char *fname);
diff --git a/src/fseccomp/main.c b/src/fseccomp/main.c
index ae0ae64ef..326c29a44 100644
--- a/src/fseccomp/main.c
+++ b/src/fseccomp/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,11 +18,14 @@
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#include "fseccomp.h" 20#include "fseccomp.h"
21#include "../include/seccomp.h"
21int arg_quiet = 0; 22int arg_quiet = 0;
23int arg_seccomp_error_action = SECCOMP_RET_ERRNO | EPERM; // error action: errno, log or kill
22 24
23static void usage(void) { 25static void usage(void) {
24 printf("Usage:\n"); 26 printf("Usage:\n");
25 printf("\tfseccomp debug-syscalls\n"); 27 printf("\tfseccomp debug-syscalls\n");
28 printf("\tfseccomp debug-syscalls32\n");
26 printf("\tfseccomp debug-errnos\n"); 29 printf("\tfseccomp debug-errnos\n");
27 printf("\tfseccomp debug-protocols\n"); 30 printf("\tfseccomp debug-protocols\n");
28 printf("\tfseccomp protocol build list file\n"); 31 printf("\tfseccomp protocol build list file\n");
@@ -31,13 +34,20 @@ static void usage(void) {
31 printf("\tfseccomp secondary block file\n"); 34 printf("\tfseccomp secondary block file\n");
32 printf("\tfseccomp default file\n"); 35 printf("\tfseccomp default file\n");
33 printf("\tfseccomp default file allow-debuggers\n"); 36 printf("\tfseccomp default file allow-debuggers\n");
37 printf("\tfseccomp default32 file\n");
38 printf("\tfseccomp default32 file allow-debuggers\n");
34 printf("\tfseccomp drop file1 file2 list\n"); 39 printf("\tfseccomp drop file1 file2 list\n");
35 printf("\tfseccomp drop file1 file2 list allow-debuggers\n"); 40 printf("\tfseccomp drop file1 file2 list allow-debuggers\n");
41 printf("\tfseccomp drop32 file1 file2 list\n");
42 printf("\tfseccomp drop32 file1 file2 list allow-debuggers\n");
36 printf("\tfseccomp default drop file1 file2 list\n"); 43 printf("\tfseccomp default drop file1 file2 list\n");
37 printf("\tfseccomp default drop file1 file2 list allow-debuggers\n"); 44 printf("\tfseccomp default drop file1 file2 list allow-debuggers\n");
45 printf("\tfseccomp default32 drop file1 file2 list\n");
46 printf("\tfseccomp default32 drop file1 file2 list allow-debuggers\n");
38 printf("\tfseccomp keep file1 file2 list\n"); 47 printf("\tfseccomp keep file1 file2 list\n");
48 printf("\tfseccomp keep32 file1 file2 list\n");
39 printf("\tfseccomp memory-deny-write-execute file\n"); 49 printf("\tfseccomp memory-deny-write-execute file\n");
40 printf("\tfseccomp print file\n"); 50 printf("\tfseccomp memory-deny-write-execute.32 file\n");
41} 51}
42 52
43int main(int argc, char **argv) { 53int main(int argc, char **argv) {
@@ -54,47 +64,77 @@ printf("\n");
54 usage(); 64 usage();
55 return 1; 65 return 1;
56 } 66 }
67 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) {
68 usage();
69 return 0;
70 }
71
72 warn_dumpable();
57 73
58 char *quiet = getenv("FIREJAIL_QUIET"); 74 char *quiet = getenv("FIREJAIL_QUIET");
59 if (quiet && strcmp(quiet, "yes") == 0) 75 if (quiet && strcmp(quiet, "yes") == 0)
60 arg_quiet = 1; 76 arg_quiet = 1;
61 77
62 if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") ==0) { 78 char *error_action = getenv("FIREJAIL_SECCOMP_ERROR_ACTION");
63 usage(); 79 if (error_action) {
64 return 0; 80 if (strcmp(error_action, "kill") == 0)
81 arg_seccomp_error_action = SECCOMP_RET_KILL;
82 else if (strcmp(error_action, "log") == 0)
83 arg_seccomp_error_action = SECCOMP_RET_LOG;
84 else {
85 arg_seccomp_error_action = errno_find_name(error_action);
86 if (arg_seccomp_error_action == -1)
87 errExit("seccomp-error-action: unknown errno");
88 arg_seccomp_error_action |= SECCOMP_RET_ERRNO;
89 }
65 } 90 }
66 else if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0) 91
92 if (argc == 2 && strcmp(argv[1], "debug-syscalls") == 0)
67 syscall_print(); 93 syscall_print();
94 else if (argc == 2 && strcmp(argv[1], "debug-syscalls32") == 0)
95 syscall_print_32();
68 else if (argc == 2 && strcmp(argv[1], "debug-errnos") == 0) 96 else if (argc == 2 && strcmp(argv[1], "debug-errnos") == 0)
69 errno_print(); 97 errno_print();
70 else if (argc == 2 && strcmp(argv[1], "debug-protocols") == 0) 98 else if (argc == 2 && strcmp(argv[1], "debug-protocols") == 0)
71 protocol_print(); 99 protocol_print();
72 else if (argc == 5 && strcmp(argv[1], "protocol") == 0 && strcmp(argv[2], "build") == 0) 100 else if (argc == 5 && strcmp(argv[1], "protocol") == 0 && strcmp(argv[2], "build") == 0)
73 protocol_build_filter(argv[3], argv[4]); 101 protocol_build_filter(argv[3], argv[4]);
74 else if (argc == 4 && strcmp(argv[1], "secondary") == 0 && strcmp(argv[2], "64") == 0)
75 seccomp_secondary_64(argv[3]);
76 else if (argc == 4 && strcmp(argv[1], "secondary") == 0 && strcmp(argv[2], "32") == 0) 102 else if (argc == 4 && strcmp(argv[1], "secondary") == 0 && strcmp(argv[2], "32") == 0)
77 seccomp_secondary_32(argv[3]); 103 seccomp_secondary_32(argv[3]);
78 else if (argc == 4 && strcmp(argv[1], "secondary") == 0 && strcmp(argv[2], "block") == 0) 104 else if (argc == 4 && strcmp(argv[1], "secondary") == 0 && strcmp(argv[2], "block") == 0)
79 seccomp_secondary_block(argv[3]); 105 seccomp_secondary_block(argv[3]);
80 else if (argc == 3 && strcmp(argv[1], "default") == 0) 106 else if (argc == 3 && strcmp(argv[1], "default") == 0)
81 seccomp_default(argv[2], 0); 107 seccomp_default(argv[2], 0, true);
82 else if (argc == 4 && strcmp(argv[1], "default") == 0 && strcmp(argv[3], "allow-debuggers") == 0) 108 else if (argc == 4 && strcmp(argv[1], "default") == 0 && strcmp(argv[3], "allow-debuggers") == 0)
83 seccomp_default(argv[2], 1); 109 seccomp_default(argv[2], 1, true);
110 else if (argc == 3 && strcmp(argv[1], "default32") == 0)
111 seccomp_default(argv[2], 0, false);
112 else if (argc == 4 && strcmp(argv[1], "default32") == 0 && strcmp(argv[3], "allow-debuggers") == 0)
113 seccomp_default(argv[2], 1, false);
84 else if (argc == 5 && strcmp(argv[1], "drop") == 0) 114 else if (argc == 5 && strcmp(argv[1], "drop") == 0)
85 seccomp_drop(argv[2], argv[3], argv[4], 0); 115 seccomp_drop(argv[2], argv[3], argv[4], 0, true);
86 else if (argc == 6 && strcmp(argv[1], "drop") == 0 && strcmp(argv[5], "allow-debuggers") == 0) 116 else if (argc == 6 && strcmp(argv[1], "drop") == 0 && strcmp(argv[5], "allow-debuggers") == 0)
87 seccomp_drop(argv[2], argv[3], argv[4], 1); 117 seccomp_drop(argv[2], argv[3], argv[4], 1, true);
118 else if (argc == 5 && strcmp(argv[1], "drop32") == 0)
119 seccomp_drop(argv[2], argv[3], argv[4], 0, false);
120 else if (argc == 6 && strcmp(argv[1], "drop32") == 0 && strcmp(argv[5], "allow-debuggers") == 0)
121 seccomp_drop(argv[2], argv[3], argv[4], 1, false);
88 else if (argc == 6 && strcmp(argv[1], "default") == 0 && strcmp(argv[2], "drop") == 0) 122 else if (argc == 6 && strcmp(argv[1], "default") == 0 && strcmp(argv[2], "drop") == 0)
89 seccomp_default_drop(argv[3], argv[4], argv[5], 0); 123 seccomp_default_drop(argv[3], argv[4], argv[5], 0, true);
90 else if (argc == 7 && strcmp(argv[1], "default") == 0 && strcmp(argv[2], "drop") == 0 && strcmp(argv[6], "allow-debuggers") == 0) 124 else if (argc == 7 && strcmp(argv[1], "default") == 0 && strcmp(argv[2], "drop") == 0 && strcmp(argv[6], "allow-debuggers") == 0)
91 seccomp_default_drop(argv[3], argv[4], argv[5], 1); 125 seccomp_default_drop(argv[3], argv[4], argv[5], 1, true);
126 else if (argc == 6 && strcmp(argv[1], "default32") == 0 && strcmp(argv[2], "drop") == 0)
127 seccomp_default_drop(argv[3], argv[4], argv[5], 0, false);
128 else if (argc == 7 && strcmp(argv[1], "default32") == 0 && strcmp(argv[2], "drop") == 0 && strcmp(argv[6], "allow-debuggers") == 0)
129 seccomp_default_drop(argv[3], argv[4], argv[5], 1, false);
92 else if (argc == 5 && strcmp(argv[1], "keep") == 0) 130 else if (argc == 5 && strcmp(argv[1], "keep") == 0)
93 seccomp_keep(argv[2], argv[3], argv[4]); 131 seccomp_keep(argv[2], argv[3], argv[4], true);
132 else if (argc == 5 && strcmp(argv[1], "keep32") == 0)
133 seccomp_keep(argv[2], argv[3], argv[4], false);
94 else if (argc == 3 && strcmp(argv[1], "memory-deny-write-execute") == 0) 134 else if (argc == 3 && strcmp(argv[1], "memory-deny-write-execute") == 0)
95 memory_deny_write_execute(argv[2]); 135 memory_deny_write_execute(argv[2]);
96 else if (argc == 3 && strcmp(argv[1], "print") == 0) 136 else if (argc == 3 && strcmp(argv[1], "memory-deny-write-execute.32") == 0)
97 filter_print(argv[2]); 137 memory_deny_write_execute_32(argv[2]);
98 else { 138 else {
99 fprintf(stderr, "Error fseccomp: invalid arguments\n"); 139 fprintf(stderr, "Error fseccomp: invalid arguments\n");
100 return 1; 140 return 1;
diff --git a/src/fseccomp/protocol.c b/src/fseccomp/protocol.c
index 43bc3d562..48dda61dd 100644
--- a/src/fseccomp/protocol.c
+++ b/src/fseccomp/protocol.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -57,6 +57,7 @@ static char *protocol[] = {
57 "inet6", 57 "inet6",
58 "netlink", 58 "netlink",
59 "packet", 59 "packet",
60 "bluetooth",
60 NULL 61 NULL
61}; 62};
62 63
@@ -66,7 +67,8 @@ static struct sock_filter protocol_filter_command[] = {
66 WHITELIST(AF_INET), 67 WHITELIST(AF_INET),
67 WHITELIST(AF_INET6), 68 WHITELIST(AF_INET6),
68 WHITELIST(AF_NETLINK), 69 WHITELIST(AF_NETLINK),
69 WHITELIST(AF_PACKET) 70 WHITELIST(AF_PACKET),
71 WHITELIST(AF_BLUETOOTH)
70}; 72};
71#endif 73#endif
72// Note: protocol[] and protocol_filter_command are synchronized 74// Note: protocol[] and protocol_filter_command are synchronized
@@ -122,30 +124,27 @@ void protocol_build_filter(const char *prlist, const char *fname) {
122 124
123 // header 125 // header
124 struct sock_filter filter_start[] = { 126 struct sock_filter filter_start[] = {
125 VALIDATE_ARCHITECTURE, 127#if defined __x86_64__
126 EXAMINE_SYSCALL, 128 /* check for native arch */
127 ONLY(SYS_socket), 129 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))),
128 EXAMINE_ARGUMENT(0) 130 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1 + 2 + 1, 0),
131 /* i386 filter */
132 EXAMINE_SYSCALL, // 1
133 // checking SYS_socket only: filtering SYS_socketcall not possible with seccomp
134 ONLY(359), // 1 + 2
135 BPF_JUMP(BPF_JMP+BPF_JA+BPF_K, (3 + 1 + 2), 0, 0), // 1 + 2 + 1
136#else
137#warning 32 bit protocol filter not implemented yet for your architecture
138#endif
139 VALIDATE_ARCHITECTURE, // 3
140 EXAMINE_SYSCALL, // 3 + 1
141 ONLY(SYS_socket), // 3 + 1 + 2
142
143 EXAMINE_ARGUMENT(0) // 3 + 1 + 2 + 1
129 }; 144 };
130 memcpy(ptr, &filter_start[0], sizeof(filter_start)); 145 memcpy(ptr, &filter_start[0], sizeof(filter_start));
131 ptr += sizeof(filter_start); 146 ptr += sizeof(filter_start);
132 147
133#if 0
134printf("entries %u\n", (unsigned) (sizeof(filter_start) / sizeof(struct sock_filter)));
135{
136 unsigned j;
137 unsigned char *ptr2 = (unsigned char *) &filter[0];
138 for (j = 0; j < sizeof(filter); j++, ptr2++) {
139 if ((j % (sizeof(struct sock_filter))) == 0)
140 printf("\n%u: ", 1 + (unsigned) (j / (sizeof(struct sock_filter))));
141 printf("%02x, ", (*ptr2) & 0xff);
142 }
143 printf("\n");
144}
145printf("whitelist_len %u, struct sock_filter len %u\n", whitelist_len, (unsigned) sizeof(struct sock_filter));
146#endif
147
148
149 // parse list and add commands 148 // parse list and add commands
150 char *tmplist = strdup(prlist); 149 char *tmplist = strdup(prlist);
151 if (!tmplist) 150 if (!tmplist)
@@ -163,22 +162,6 @@ printf("whitelist_len %u, struct sock_filter len %u\n", whitelist_len, (unsigned
163 memcpy(ptr, domain, whitelist_len * sizeof(struct sock_filter)); 162 memcpy(ptr, domain, whitelist_len * sizeof(struct sock_filter));
164 ptr += whitelist_len * sizeof(struct sock_filter); 163 ptr += whitelist_len * sizeof(struct sock_filter);
165 token = strtok(NULL, ","); 164 token = strtok(NULL, ",");
166
167#if 0
168printf("entries %u\n", (unsigned) ((uint64_t) ptr - (uint64_t) (filter)) / (unsigned) sizeof(struct sock_filter));
169{
170 unsigned j;
171 unsigned char *ptr2 = (unsigned char *) &filter[0];
172 for (j = 0; j < sizeof(filter); j++, ptr2++) {
173 if ((j % (sizeof(struct sock_filter))) == 0)
174 printf("\n%u: ", 1 + (unsigned) (j / (sizeof(struct sock_filter))));
175 printf("%02x, ", (*ptr2) & 0xff);
176 }
177 printf("\n");
178}
179#endif
180
181
182 } 165 }
183 free(tmplist); 166 free(tmplist);
184 167
@@ -189,19 +172,6 @@ printf("entries %u\n", (unsigned) ((uint64_t) ptr - (uint64_t) (filter)) / (uns
189 memcpy(ptr, &filter_end[0], sizeof(filter_end)); 172 memcpy(ptr, &filter_end[0], sizeof(filter_end));
190 ptr += sizeof(filter_end); 173 ptr += sizeof(filter_end);
191 174
192#if 0
193printf("entries %u\n", (unsigned) ((uint64_t) ptr - (uint64_t) (filter)) / (unsigned) sizeof(struct sock_filter));
194{
195 unsigned j;
196 unsigned char *ptr2 = (unsigned char *) &filter[0];
197 for (j = 0; j < sizeof(filter); j++, ptr2++) {
198 if ((j % (sizeof(struct sock_filter))) == 0)
199 printf("\n%u: ", 1 + (unsigned) (j / (sizeof(struct sock_filter))));
200 printf("%02x, ", (*ptr2) & 0xff);
201 }
202 printf("\n");
203}
204#endif
205 // save filter to file 175 // save filter to file
206 int dst = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 176 int dst = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
207 if (dst < 0) { 177 if (dst < 0) {
diff --git a/src/fseccomp/seccomp.c b/src/fseccomp/seccomp.c
index e14a473fe..99e671799 100644
--- a/src/fseccomp/seccomp.c
+++ b/src/fseccomp/seccomp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -24,12 +24,12 @@
24#include <sys/syscall.h> 24#include <sys/syscall.h>
25#include <sys/types.h> 25#include <sys/types.h>
26 26
27static void add_default_list(int fd, int allow_debuggers) { 27static void add_default_list(int fd, int allow_debuggers, bool native) {
28 int r; 28 int r;
29 if (!allow_debuggers) 29 if (!allow_debuggers)
30 r = syscall_check_list("@default-nodebuggers", filter_add_blacklist, fd, 0, NULL); 30 r = syscall_check_list("@default-nodebuggers", filter_add_blacklist, fd, 0, NULL, native);
31 else 31 else
32 r = syscall_check_list("@default", filter_add_blacklist, fd, 0, NULL); 32 r = syscall_check_list("@default", filter_add_blacklist, fd, 0, NULL, native);
33 33
34 assert(r == 0); 34 assert(r == 0);
35//#ifdef SYS_mknod - emoved in 0.9.29 - it breaks Zotero extension 35//#ifdef SYS_mknod - emoved in 0.9.29 - it breaks Zotero extension
@@ -46,7 +46,7 @@ static void add_default_list(int fd, int allow_debuggers) {
46} 46}
47 47
48// default list 48// default list
49void seccomp_default(const char *fname, int allow_debuggers) { 49void seccomp_default(const char *fname, int allow_debuggers, bool native) {
50 assert(fname); 50 assert(fname);
51 51
52 // open file 52 // open file
@@ -57,8 +57,8 @@ void seccomp_default(const char *fname, int allow_debuggers) {
57 } 57 }
58 58
59 // build filter (no post-exec filter needed because default list is fine for us) 59 // build filter (no post-exec filter needed because default list is fine for us)
60 filter_init(fd); 60 filter_init(fd, native);
61 add_default_list(fd, allow_debuggers); 61 add_default_list(fd, allow_debuggers, native);
62 filter_end_blacklist(fd); 62 filter_end_blacklist(fd);
63 63
64 // close file 64 // close file
@@ -66,7 +66,7 @@ void seccomp_default(const char *fname, int allow_debuggers) {
66} 66}
67 67
68// drop list 68// drop list
69void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers) { 69void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers, bool native) {
70 assert(fname1); 70 assert(fname1);
71 assert(fname2); 71 assert(fname2);
72 (void) allow_debuggers; // todo: to implemnet it 72 (void) allow_debuggers; // todo: to implemnet it
@@ -79,11 +79,15 @@ void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_
79 } 79 }
80 80
81 // build pre-exec filter: don't blacklist any syscalls in @default-keep 81 // build pre-exec filter: don't blacklist any syscalls in @default-keep
82 filter_init(fd); 82 filter_init(fd, native);
83
84 // allow exceptions in form of !syscall
85 syscall_check_list(list, filter_add_whitelist_for_excluded, fd, 0, NULL, native);
86
83 char *prelist, *postlist; 87 char *prelist, *postlist;
84 syscalls_in_list(list, "@default-keep", fd, &prelist, &postlist); 88 syscalls_in_list(list, "@default-keep", fd, &prelist, &postlist, native);
85 if (prelist) 89 if (prelist)
86 if (syscall_check_list(prelist, filter_add_blacklist, fd, 0, NULL)) { 90 if (syscall_check_list(prelist, filter_add_blacklist, fd, 0, NULL, native)) {
87 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n"); 91 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n");
88 exit(1); 92 exit(1);
89 } 93 }
@@ -102,8 +106,8 @@ void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_
102 } 106 }
103 107
104 // build post-exec filter: blacklist remaining syscalls 108 // build post-exec filter: blacklist remaining syscalls
105 filter_init(fd); 109 filter_init(fd, native);
106 if (syscall_check_list(postlist, filter_add_blacklist, fd, 0, NULL)) { 110 if (syscall_check_list(postlist, filter_add_blacklist, fd, 0, NULL, native)) {
107 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n"); 111 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n");
108 exit(1); 112 exit(1);
109 } 113 }
@@ -114,7 +118,7 @@ void seccomp_drop(const char *fname1, const char *fname2, char *list, int allow_
114} 118}
115 119
116// default+drop 120// default+drop
117void seccomp_default_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers) { 121void seccomp_default_drop(const char *fname1, const char *fname2, char *list, int allow_debuggers, bool native) {
118 assert(fname1); 122 assert(fname1);
119 assert(fname2); 123 assert(fname2);
120 124
@@ -127,12 +131,16 @@ void seccomp_default_drop(const char *fname1, const char *fname2, char *list, in
127 131
128 // build pre-exec filter: blacklist @default, don't blacklist 132 // build pre-exec filter: blacklist @default, don't blacklist
129 // any listed syscalls in @default-keep 133 // any listed syscalls in @default-keep
130 filter_init(fd); 134 filter_init(fd, native);
131 add_default_list(fd, allow_debuggers); 135
136 // allow exceptions in form of !syscall
137 syscall_check_list(list, filter_add_whitelist_for_excluded, fd, 0, NULL, native);
138
139 add_default_list(fd, allow_debuggers, native);
132 char *prelist, *postlist; 140 char *prelist, *postlist;
133 syscalls_in_list(list, "@default-keep", fd, &prelist, &postlist); 141 syscalls_in_list(list, "@default-keep", fd, &prelist, &postlist, native);
134 if (prelist) 142 if (prelist)
135 if (syscall_check_list(prelist, filter_add_blacklist, fd, 0, NULL)) { 143 if (syscall_check_list(prelist, filter_add_blacklist, fd, 0, NULL, native)) {
136 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n"); 144 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n");
137 exit(1); 145 exit(1);
138 } 146 }
@@ -152,8 +160,8 @@ void seccomp_default_drop(const char *fname1, const char *fname2, char *list, in
152 } 160 }
153 161
154 // build post-exec filter: blacklist remaining syscalls 162 // build post-exec filter: blacklist remaining syscalls
155 filter_init(fd); 163 filter_init(fd, native);
156 if (syscall_check_list(postlist, filter_add_blacklist, fd, 0, NULL)) { 164 if (syscall_check_list(postlist, filter_add_blacklist, fd, 0, NULL, native)) {
157 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n"); 165 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n");
158 exit(1); 166 exit(1);
159 } 167 }
@@ -163,9 +171,9 @@ void seccomp_default_drop(const char *fname1, const char *fname2, char *list, in
163 close(fd); 171 close(fd);
164} 172}
165 173
166void seccomp_keep(const char *fname1, const char *fname2, char *list) { 174void seccomp_keep(const char *fname1, const char *fname2, char *list, bool native) {
167 (void) fname2; 175 (void) fname2;
168 176
169 // open file for pre-exec filter 177 // open file for pre-exec filter
170 int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 178 int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
171 if (fd < 0) { 179 if (fd < 0) {
@@ -174,13 +182,17 @@ void seccomp_keep(const char *fname1, const char *fname2, char *list) {
174 } 182 }
175 183
176 // build pre-exec filter: whitelist also @default-keep 184 // build pre-exec filter: whitelist also @default-keep
177 filter_init(fd); 185 filter_init(fd, native);
186
187 // allow exceptions in form of !syscall
188 syscall_check_list(list, filter_add_blacklist_for_excluded, fd, 0, NULL, native);
189
178 // these syscalls are used by firejail after the seccomp filter is initialized 190 // these syscalls are used by firejail after the seccomp filter is initialized
179 int r; 191 int r;
180 r = syscall_check_list("@default-keep", filter_add_whitelist, fd, 0, NULL); 192 r = syscall_check_list("@default-keep", filter_add_whitelist, fd, 0, NULL, native);
181 assert(r == 0); 193 assert(r == 0);
182 194
183 if (syscall_check_list(list, filter_add_whitelist, fd, 0, NULL)) { 195 if (syscall_check_list(list, filter_add_whitelist, fd, 0, NULL, native)) {
184 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n"); 196 fprintf(stderr, "Error fseccomp: cannot build seccomp filter\n");
185 exit(1); 197 exit(1);
186 } 198 }
@@ -194,6 +206,15 @@ void seccomp_keep(const char *fname1, const char *fname2, char *list) {
194#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) 206#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
195# define filter_syscall SYS_mmap 207# define filter_syscall SYS_mmap
196# undef block_syscall 208# undef block_syscall
209#if defined(__x86_64__)
210// i386 syscalls
211# define filter_syscall_32 192
212# define block_syscall_32 90
213# define mprotect_32 125
214# define pkey_mprotect_32 380
215# define shmat_32 397
216# define memfd_create_32 356
217#endif
197#elif defined(__i386__) 218#elif defined(__i386__)
198# define filter_syscall SYS_mmap2 219# define filter_syscall SYS_mmap2
199# define block_syscall SYS_mmap 220# define block_syscall SYS_mmap
@@ -204,6 +225,12 @@ void seccomp_keep(const char *fname1, const char *fname2, char *list) {
204# warning "Platform does not support seccomp memory-deny-write-execute filter yet" 225# warning "Platform does not support seccomp memory-deny-write-execute filter yet"
205# undef filter_syscall 226# undef filter_syscall
206# undef block_syscall 227# undef block_syscall
228# undef filter_syscall_32
229# undef block_syscall_32
230# undef mprotect_32
231# undef pkey_mprotect_32
232# undef shmat_32
233# undef memfd_create_32
207#endif 234#endif
208 235
209void memory_deny_write_execute(const char *fname) { 236void memory_deny_write_execute(const char *fname) {
@@ -214,10 +241,10 @@ void memory_deny_write_execute(const char *fname) {
214 exit(1); 241 exit(1);
215 } 242 }
216 243
217 filter_init(fd); 244 filter_init(fd, true);
218 245
219 // build filter 246 // build filter
220 static const struct sock_filter filter[] = { 247 struct sock_filter filter[] = {
221#ifdef block_syscall 248#ifdef block_syscall
222 // block old multiplexing mmap syscall for i386 249 // block old multiplexing mmap syscall for i386
223 BLACKLIST(block_syscall), 250 BLACKLIST(block_syscall),
@@ -228,7 +255,7 @@ void memory_deny_write_execute(const char *fname) {
228 EXAMINE_ARGUMENT(2), 255 EXAMINE_ARGUMENT(2),
229 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_WRITE|PROT_EXEC), 256 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_WRITE|PROT_EXEC),
230 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_WRITE|PROT_EXEC, 0, 1), 257 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_WRITE|PROT_EXEC, 0, 1),
231 KILL_PROCESS, 258 KILL_OR_RETURN_ERRNO,
232 RETURN_ALLOW, 259 RETURN_ALLOW,
233#endif 260#endif
234 261
@@ -237,9 +264,19 @@ void memory_deny_write_execute(const char *fname) {
237 EXAMINE_ARGUMENT(2), 264 EXAMINE_ARGUMENT(2),
238 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_EXEC), 265 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_EXEC),
239 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_EXEC, 0, 1), 266 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_EXEC, 0, 1),
240 KILL_PROCESS, 267 KILL_OR_RETURN_ERRNO,
241 RETURN_ALLOW, 268 RETURN_ALLOW,
242 269
270 // same for pkey_mprotect(,,PROT_EXEC), where available
271#ifdef SYS_pkey_mprotect
272 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SYS_pkey_mprotect, 0, 5),
273 EXAMINE_ARGUMENT(2),
274 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_EXEC),
275 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_EXEC, 0, 1),
276 KILL_OR_RETURN_ERRNO,
277 RETURN_ALLOW,
278#endif
279
243// shmat is not implemented as a syscall on some platforms (i386, powerpc64, powerpc64le) 280// shmat is not implemented as a syscall on some platforms (i386, powerpc64, powerpc64le)
244#ifdef SYS_shmat 281#ifdef SYS_shmat
245 // block shmat(,,x|SHM_EXEC) so W&X shared memory can't be created 282 // block shmat(,,x|SHM_EXEC) so W&X shared memory can't be created
@@ -247,7 +284,15 @@ void memory_deny_write_execute(const char *fname) {
247 EXAMINE_ARGUMENT(2), 284 EXAMINE_ARGUMENT(2),
248 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, SHM_EXEC), 285 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, SHM_EXEC),
249 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SHM_EXEC, 0, 1), 286 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SHM_EXEC, 0, 1),
250 KILL_PROCESS, 287 KILL_OR_RETURN_ERRNO,
288 RETURN_ALLOW,
289#endif
290#ifdef SYS_memfd_create
291 // block memfd_create as it can be used to create
292 // arbitrary memory contents which can be later mapped
293 // as executable
294 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SYS_memfd_create, 0, 1),
295 KILL_OR_RETURN_ERRNO,
251 RETURN_ALLOW 296 RETURN_ALLOW
252#endif 297#endif
253 }; 298 };
@@ -258,3 +303,75 @@ void memory_deny_write_execute(const char *fname) {
258 // close file 303 // close file
259 close(fd); 304 close(fd);
260} 305}
306
307void memory_deny_write_execute_32(const char *fname) {
308 // open file
309 int fd = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
310 if (fd < 0) {
311 fprintf(stderr, "Error fseccomp: cannot open %s file\n", fname);
312 exit(1);
313 }
314
315 filter_init(fd, false);
316
317 // build filter
318 struct sock_filter filter[] = {
319#if defined(__x86_64__)
320#ifdef block_syscall_32
321 // block old multiplexing mmap syscall for i386
322 BLACKLIST(block_syscall_32),
323#endif
324#ifdef filter_syscall_32
325 // block mmap(,,x|PROT_WRITE|PROT_EXEC) so W&X memory can't be created
326 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, filter_syscall_32, 0, 5),
327 EXAMINE_ARGUMENT(2),
328 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_WRITE|PROT_EXEC),
329 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_WRITE|PROT_EXEC, 0, 1),
330 KILL_OR_RETURN_ERRNO,
331 RETURN_ALLOW,
332#endif
333#ifdef mprotect_32
334 // block mprotect(,,PROT_EXEC) so writable memory can't be turned into executable
335 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, mprotect_32, 0, 5),
336 EXAMINE_ARGUMENT(2),
337 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_EXEC),
338 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_EXEC, 0, 1),
339 KILL_OR_RETURN_ERRNO,
340 RETURN_ALLOW,
341#endif
342#ifdef pkey_mprotect_32
343 // same for pkey_mprotect(,,PROT_EXEC), where available
344 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, pkey_mprotect_32, 0, 5),
345 EXAMINE_ARGUMENT(2),
346 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, PROT_EXEC),
347 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, PROT_EXEC, 0, 1),
348 KILL_OR_RETURN_ERRNO,
349 RETURN_ALLOW,
350#endif
351
352#ifdef shmat_32
353 // block shmat(,,x|SHM_EXEC) so W&X shared memory can't be created
354 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, shmat_32, 0, 5),
355 EXAMINE_ARGUMENT(2),
356 BPF_STMT(BPF_ALU+BPF_AND+BPF_K, SHM_EXEC),
357 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SHM_EXEC, 0, 1),
358 KILL_OR_RETURN_ERRNO,
359 RETURN_ALLOW,
360#endif
361#ifdef memfd_create_32
362 // block memfd_create as it can be used to create
363 // arbitrary memory contents which can be later mapped
364 // as executable
365 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, memfd_create_32, 0, 1),
366 KILL_OR_RETURN_ERRNO,
367#endif
368#endif
369 RETURN_ALLOW
370 };
371 write_to_file(fd, filter, sizeof(filter));
372
373 filter_end_blacklist(fd);
374
375 // close file
376 close(fd);
377}
diff --git a/src/fseccomp/seccomp_file.c b/src/fseccomp/seccomp_file.c
index 2d5ee115d..846c7f335 100644
--- a/src/fseccomp/seccomp_file.c
+++ b/src/fseccomp/seccomp_file.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -21,11 +21,11 @@
21#include "../include/seccomp.h" 21#include "../include/seccomp.h"
22#include <sys/syscall.h> 22#include <sys/syscall.h>
23 23
24void write_to_file(int fd, const void *data, int size) { 24void write_to_file(int fd, const void *data, size_t size) {
25 assert(data); 25 assert(data);
26 assert(size); 26 assert(size);
27 27
28 int written = 0; 28 size_t written = 0;
29 while (written < size) { 29 while (written < size) {
30 int rv = write(fd, (unsigned char *) data + written, size - written); 30 int rv = write(fd, (unsigned char *) data + written, size - written);
31 if (rv == -1) { 31 if (rv == -1) {
@@ -36,8 +36,8 @@ void write_to_file(int fd, const void *data, int size) {
36 } 36 }
37} 37}
38 38
39void filter_init(int fd) { 39void filter_init(int fd, bool native) {
40 struct sock_filter filter[] = { 40 struct sock_filter filter_native[] = {
41 VALIDATE_ARCHITECTURE, 41 VALIDATE_ARCHITECTURE,
42#if defined(__x86_64__) 42#if defined(__x86_64__)
43 EXAMINE_SYSCALL, 43 EXAMINE_SYSCALL,
@@ -46,6 +46,10 @@ void filter_init(int fd) {
46 EXAMINE_SYSCALL 46 EXAMINE_SYSCALL
47#endif 47#endif
48 }; 48 };
49 struct sock_filter filter_32[] = {
50 VALIDATE_ARCHITECTURE_32,
51 EXAMINE_SYSCALL
52 };
49 53
50#if 0 54#if 0
51{ 55{
@@ -57,31 +61,85 @@ void filter_init(int fd) {
57} 61}
58#endif 62#endif
59 63
60 write_to_file(fd, filter, sizeof(filter)); 64 if (native)
65 write_to_file(fd, filter_native, sizeof(filter_native));
66 else
67 write_to_file(fd, filter_32, sizeof(filter_32));
61} 68}
62 69
63void filter_add_whitelist(int fd, int syscall, int arg, void *ptrarg) { 70static void write_whitelist(int fd, int syscall) {
64 (void) arg;
65 (void) ptrarg;
66
67 struct sock_filter filter[] = { 71 struct sock_filter filter[] = {
68 WHITELIST(syscall) 72 WHITELIST(syscall)
69 }; 73 };
70 write_to_file(fd, filter, sizeof(filter)); 74 write_to_file(fd, filter, sizeof(filter));
71} 75}
72 76
73void filter_add_blacklist(int fd, int syscall, int arg, void *ptrarg) { 77static void write_blacklist(int fd, int syscall) {
74 (void) arg;
75 (void) ptrarg;
76
77 struct sock_filter filter[] = { 78 struct sock_filter filter[] = {
78 BLACKLIST(syscall) 79 BLACKLIST(syscall)
79 }; 80 };
80 write_to_file(fd, filter, sizeof(filter)); 81 write_to_file(fd, filter, sizeof(filter));
81} 82}
82 83
83void filter_add_errno(int fd, int syscall, int arg, void *ptrarg) { 84void filter_add_whitelist(int fd, int syscall, int arg, void *ptrarg, bool native) {
85 (void) arg;
84 (void) ptrarg; 86 (void) ptrarg;
87 (void) native;
88
89 if (syscall >= 0) {
90 write_whitelist(fd, syscall);
91 }
92}
93
94// handle seccomp list exceptions (seccomp x,y,!z)
95void filter_add_whitelist_for_excluded(int fd, int syscall, int arg, void *ptrarg, bool native) {
96 (void) arg;
97 (void) ptrarg;
98 (void) native;
99
100 if (syscall < 0) {
101 write_whitelist(fd, -syscall);
102 }
103}
104
105void filter_add_blacklist(int fd, int syscall, int arg, void *ptrarg, bool native) {
106 (void) arg;
107 (void) ptrarg;
108 (void) native;
109
110 if (syscall >= 0) {
111 write_blacklist(fd, syscall);
112 }
113}
114
115void filter_add_blacklist_override(int fd, int syscall, int arg, void *ptrarg, bool native) {
116 (void) arg;
117 (void) ptrarg;
118 (void) native;
119
120 if (syscall >= 0) {
121 int saved_error_action = arg_seccomp_error_action;
122 arg_seccomp_error_action = SECCOMP_RET_KILL;
123 write_blacklist(fd, syscall);
124 arg_seccomp_error_action = saved_error_action;
125 }
126}
127
128// handle seccomp list exceptions (seccomp x,y,!z)
129void filter_add_blacklist_for_excluded(int fd, int syscall, int arg, void *ptrarg, bool native) {
130 (void) arg;
131 (void) ptrarg;
132 (void) native;
133
134 if (syscall < 0) {
135 write_blacklist(fd, -syscall);
136 }
137}
138
139void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native) {
140 (void) ptrarg;
141 (void) native;
142
85 struct sock_filter filter[] = { 143 struct sock_filter filter[] = {
86 BLACKLIST_ERRNO(syscall, arg) 144 BLACKLIST_ERRNO(syscall, arg)
87 }; 145 };
@@ -97,7 +155,7 @@ void filter_end_blacklist(int fd) {
97 155
98void filter_end_whitelist(int fd) { 156void filter_end_whitelist(int fd) {
99 struct sock_filter filter[] = { 157 struct sock_filter filter[] = {
100 KILL_PROCESS 158 KILL_OR_RETURN_ERRNO
101 }; 159 };
102 write_to_file(fd, filter, sizeof(filter)); 160 write_to_file(fd, filter, sizeof(filter));
103} 161}
diff --git a/src/fseccomp/seccomp_print.c b/src/fseccomp/seccomp_print.c
deleted file mode 100644
index e8df2bda5..000000000
--- a/src/fseccomp/seccomp_print.c
+++ /dev/null
@@ -1,183 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "fseccomp.h"
21#include "../include/seccomp.h"
22#include <sys/syscall.h>
23
24static struct sock_filter *filter = NULL;
25static int filter_cnt = 0;
26
27static void load_seccomp(const char *fname) {
28 assert(fname);
29
30 // open filter file
31 int fd = open(fname, O_RDONLY);
32 if (fd == -1)
33 goto errexit;
34
35 // calculate the number of entries
36 int size = lseek(fd, 0, SEEK_END);
37 if (size == -1)
38 goto errexit;
39 if (lseek(fd, 0 , SEEK_SET) == -1)
40 goto errexit;
41 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter);
42 filter_cnt = entries;
43
44 // read filter
45 filter = malloc(size);
46 if (filter == NULL)
47 goto errexit;
48 memset(filter, 0, size);
49 int rd = 0;
50 while (rd < size) {
51 int rv = read(fd, (unsigned char *) filter + rd, size - rd);
52 if (rv == -1)
53 goto errexit;
54 rd += rv;
55 }
56
57 // close file
58 close(fd);
59 return;
60
61errexit:
62 fprintf(stderr, "Error fseccomp: cannot read %s\n", fname);
63 exit(1);
64}
65
66static int detect_filter_type(void) {
67 // the filter ishould already be load in filter variable
68 assert(filter);
69
70 printf("SECCOMP Filter\n");
71
72 // testing for main seccomp filter, protocol, mdwe - platform architecture
73 const struct sock_filter start_main[] = {
74 VALIDATE_ARCHITECTURE,
75#if defined(__x86_64__)
76 EXAMINE_SYSCALL,
77 HANDLE_X32
78#else
79 EXAMINE_SYSCALL
80#endif
81 };
82
83 if (memcmp(&start_main[0], filter, sizeof(start_main)) == 0) {
84 printf(" VALIDATE_ARCHITECTURE\n");
85 printf(" EXAMINE_SYSCALL\n");
86#if defined(__x86_64__)
87 printf(" HANDLE_X32\n");
88#endif
89 return sizeof(start_main) / sizeof(struct sock_filter);
90 }
91
92
93 // testing for secondary 64 bit filter
94 const struct sock_filter start_secondary_64[] = {
95 VALIDATE_ARCHITECTURE_64,
96 EXAMINE_SYSCALL,
97 };
98
99 if (memcmp(&start_secondary_64[0], filter, sizeof(start_secondary_64)) == 0) {
100 printf(" VALIDATE_ARCHITECTURE_64\n");
101 printf(" EXAMINE_SYSCALL\n");
102 return sizeof(start_secondary_64) / sizeof(struct sock_filter);
103 }
104
105 // testing for secondary 32 bit filter
106 const struct sock_filter start_secondary_32[] = {
107 VALIDATE_ARCHITECTURE_32,
108 EXAMINE_SYSCALL,
109 };
110
111 if (memcmp(&start_secondary_32[0], filter, sizeof(start_secondary_32)) == 0) {
112 printf(" VALIDATE_ARCHITECTURE_32\n");
113 printf(" EXAMINE_SYSCALL\n");
114 return sizeof(start_secondary_32) / sizeof(struct sock_filter);
115 }
116
117 const struct sock_filter start_secondary_block[] = {
118 VALIDATE_ARCHITECTURE_KILL,
119#if defined(__x86_64__)
120 EXAMINE_SYSCALL,
121 HANDLE_X32_KILL,
122#else
123 EXAMINE_SYSCALL
124#endif
125 };
126
127 if (memcmp(&start_secondary_block[0], filter, sizeof(start_secondary_block)) == 0) {
128 printf(" VALIDATE_ARCHITECTURE_KILL\n");
129 printf(" EXAMINE_SYSCALL\n");
130#if defined(__x86_64__)
131 printf(" HANDLE_X32_KILL\n");
132#endif
133 return sizeof(start_secondary_block) / sizeof(struct sock_filter);
134 }
135
136 return 0; // filter unrecognized
137}
138
139// debug filter
140void filter_print(const char *fname) {
141 assert(fname);
142 load_seccomp(fname);
143
144 int i = detect_filter_type();
145 if (i == 0) {
146 printf("Invalid seccomp filter %s\n", fname);
147 return;
148 }
149
150 // loop trough the rest of commands
151 while (i < filter_cnt) {
152 // minimal parsing!
153 struct sock_filter *s = (struct sock_filter *) &filter[i];
154 if (s->code == BPF_JMP+BPF_JEQ+BPF_K && (s + 1)->code == BPF_RET+BPF_K && (s + 1)->k == SECCOMP_RET_ALLOW ) {
155 printf(" WHITELIST %d %s\n", s->k, syscall_find_nr(s->k));
156 i += 2;
157 }
158 else if (s->code == BPF_JMP+BPF_JEQ+BPF_K && (s + 1)->code == BPF_RET+BPF_K && (s + 1)->k == SECCOMP_RET_KILL ) {
159 printf(" BLACKLIST %d %s\n", s->k, syscall_find_nr(s->k));
160 i += 2;
161 }
162 else if (s->code == BPF_JMP+BPF_JEQ+BPF_K && (s + 1)->code == BPF_RET+BPF_K && ((s + 1)->k & ~SECCOMP_RET_DATA) == SECCOMP_RET_ERRNO) {
163 printf(" BLACKLIST_ERRNO %d %s %d %s\n", s->k, syscall_find_nr(s->k), (s + 1)->k & SECCOMP_RET_DATA, errno_find_nr((s + 1)->k & SECCOMP_RET_DATA));
164 i += 2;
165 }
166 else if (s->code == BPF_RET+BPF_K && (s->k & ~SECCOMP_RET_DATA) == SECCOMP_RET_ERRNO) {
167 printf(" RETURN_ERRNO %d %s\n", s->k & SECCOMP_RET_DATA, errno_find_nr(s->k & SECCOMP_RET_DATA));
168 i++;
169 }
170 else if (s->code == BPF_RET+BPF_K && s->k == SECCOMP_RET_KILL) {
171 printf(" KILL_PROCESS\n");
172 i++;
173 }
174 else if (s->code == BPF_RET+BPF_K && s->k == SECCOMP_RET_ALLOW) {
175 printf(" RETURN_ALLOW\n");
176 i++;
177 }
178 else {
179 printf(" UNKNOWN ENTRY %x!\n", s->code);
180 i++;
181 }
182 }
183}
diff --git a/src/fseccomp/seccomp_secondary.c b/src/fseccomp/seccomp_secondary.c
index da6a693e6..540892026 100644
--- a/src/fseccomp/seccomp_secondary.c
+++ b/src/fseccomp/seccomp_secondary.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -42,71 +42,6 @@ static void write_filter(const char *fname, size_t size, const void *filter) {
42 close(dst); 42 close(dst);
43} 43}
44 44
45void seccomp_secondary_64(const char *fname) {
46 // hardcoded syscall values
47 struct sock_filter filter[] = {
48 VALIDATE_ARCHITECTURE_64,
49 EXAMINE_SYSCALL,
50 BLACKLIST(165), // mount
51 BLACKLIST(166), // umount2
52// todo: implement --allow-debuggers
53 BLACKLIST(101), // ptrace
54 BLACKLIST(246), // kexec_load
55 BLACKLIST(304), // open_by_handle_at
56 BLACKLIST(303), // name_to_handle_at
57 BLACKLIST(174), // create_module
58 BLACKLIST(175), // init_module
59 BLACKLIST(313), // finit_module
60 BLACKLIST(176), // delete_module
61 BLACKLIST(172), // iopl
62 BLACKLIST(173), // ioperm
63 BLACKLIST(251), // ioprio_set
64 BLACKLIST(167), // swapon
65 BLACKLIST(168), // swapoff
66 BLACKLIST(103), // syslog
67 BLACKLIST(310), // process_vm_readv
68 BLACKLIST(311), // process_vm_writev
69 BLACKLIST(139), // sysfs
70 BLACKLIST(156), // _sysctl
71 BLACKLIST(159), // adjtimex
72 BLACKLIST(305), // clock_adjtime
73 BLACKLIST(212), // lookup_dcookie
74 BLACKLIST(298), // perf_event_open
75 BLACKLIST(300), // fanotify_init
76 BLACKLIST(312), // kcmp
77 BLACKLIST(248), // add_key
78 BLACKLIST(249), // request_key
79 BLACKLIST(250), // keyctl
80 BLACKLIST(134), // uselib
81 BLACKLIST(163), // acct
82 BLACKLIST(154), // modify_ldt
83 BLACKLIST(155), // pivot_root
84 BLACKLIST(206), // io_setup
85 BLACKLIST(207), // io_destroy
86 BLACKLIST(208), // io_getevents
87 BLACKLIST(209), // io_submit
88 BLACKLIST(210), // io_cancel
89 BLACKLIST(216), // remap_file_pages
90 BLACKLIST(237), // mbind
91// breaking Firefox nightly when playing youtube videos
92// TODO: test again when firefox sandbox is finally released
93// BLACKLIST(239), // get_mempolicy
94 BLACKLIST(238), // set_mempolicy
95 BLACKLIST(256), // migrate_pages
96 BLACKLIST(279), // move_pages
97 BLACKLIST(278), // vmsplice
98 BLACKLIST(161), // chroot
99 BLACKLIST(184), // tuxcall
100 BLACKLIST(169), // reboot
101 BLACKLIST(180), // nfsservctl
102 BLACKLIST(177), // get_kernel_syms
103
104 RETURN_ALLOW
105 };
106
107 // save filter to file
108 write_filter(fname, sizeof(filter), filter);
109}
110 45
111// 32 bit arch filter installed on 64 bit architectures 46// 32 bit arch filter installed on 64 bit architectures
112void seccomp_secondary_32(const char *fname) { 47void seccomp_secondary_32(const char *fname) {
@@ -191,7 +126,7 @@ void seccomp_secondary_block(const char *fname) {
191 EXAMINE_SYSCALL, 126 EXAMINE_SYSCALL,
192#if defined(__x86_64__) 127#if defined(__x86_64__)
193 // block x32 128 // block x32
194 HANDLE_X32_KILL, 129 HANDLE_X32,
195#endif 130#endif
196 // block personality(2) where domain != PER_LINUX or 0xffffffff (query current personality) 131 // block personality(2) where domain != PER_LINUX or 0xffffffff (query current personality)
197 // 0: if personality(2), continue to 1, else goto 7 (allow) 132 // 0: if personality(2), continue to 1, else goto 7 (allow)
@@ -207,7 +142,7 @@ void seccomp_secondary_block(const char *fname) {
207 // 5: if MSW(arg0) == 0, goto 7 (allow) else continue to 6 (kill) 142 // 5: if MSW(arg0) == 0, goto 7 (allow) else continue to 6 (kill)
208 BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, jmp_from_to(5, 7), 0), 143 BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0, jmp_from_to(5, 7), 0),
209 // 6: 144 // 6:
210 KILL_PROCESS, 145 KILL_OR_RETURN_ERRNO,
211 // 7: 146 // 7:
212 RETURN_ALLOW 147 RETURN_ALLOW
213 }; 148 };
diff --git a/src/fseccomp/syscall.c b/src/fseccomp/syscall.c
deleted file mode 100644
index 69b6e5271..000000000
--- a/src/fseccomp/syscall.c
+++ /dev/null
@@ -1,590 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#define _GNU_SOURCE
21#include "fseccomp.h"
22#include <stdio.h>
23#include <sys/syscall.h>
24
25typedef struct {
26 const char * const name;
27 int nr;
28} SyscallEntry;
29
30typedef struct {
31 const char * const name;
32 const char * const list;
33} SyscallGroupList;
34
35typedef struct {
36 const char *slist;
37 char *prelist, *postlist;
38 bool found;
39 int syscall;
40} SyscallCheckList;
41
42static const SyscallEntry syslist[] = {
43//
44// code generated using tools/extract-syscall
45//
46#include "../include/syscall.h"
47//
48// end of generated code
49//
50}; // end of syslist
51
52static const SyscallGroupList sysgroups[] = {
53 { .name = "@clock", .list =
54#ifdef SYS_adjtimex
55 "adjtimex,"
56#endif
57#ifdef SYS_clock_adjtime
58 "clock_adjtime,"
59#endif
60#ifdef SYS_clock_settime
61 "clock_settime,"
62#endif
63#ifdef SYS_settimeofday
64 "settimeofday,"
65#endif
66#ifdef SYS_stime
67 "stime"
68#endif
69 },
70 { .name = "@cpu-emulation", .list =
71#ifdef SYS_modify_ldt
72 "modify_ldt,"
73#endif
74#ifdef SYS_subpage_prot
75 "subpage_prot,"
76#endif
77#ifdef SYS_switch_endian
78 "switch_endian,"
79#endif
80#ifdef SYS_vm86
81 "vm86,"
82#endif
83#ifdef SYS_vm86old
84 "vm86old"
85#endif
86#if !defined(SYS_modify_ldt) && !defined(SYS_subpage_prot) && !defined(SYS_switch_endian) && !defined(SYS_vm86) && !defined(SYS_vm86old)
87 "__dummy_syscall__" // workaround for arm64, s390x and sparc64 which don't have any of above defined and empty syscall lists are not allowed
88#endif
89 },
90 { .name = "@debug", .list =
91#ifdef SYS_lookup_dcookie
92 "lookup_dcookie,"
93#endif
94#ifdef SYS_perf_event_open
95 "perf_event_open,"
96#endif
97#ifdef SYS_process_vm_writev
98 "process_vm_writev,"
99#endif
100#ifdef SYS_rtas
101 "rtas,"
102#endif
103#ifdef SYS_s390_runtime_instr
104 "s390_runtime_instr,"
105#endif
106#ifdef SYS_sys_debug_setcontext
107 "sys_debug_setcontext,"
108#endif
109 },
110 { .name = "@default", .list =
111 "@cpu-emulation,"
112 "@debug,"
113 "@obsolete,"
114 "@privileged,"
115 "@resources,"
116#ifdef SYS_open_by_handle_at
117 "open_by_handle_at,"
118#endif
119#ifdef SYS_name_to_handle_at
120 "name_to_handle_at,"
121#endif
122#ifdef SYS_ioprio_set
123 "ioprio_set,"
124#endif
125#ifdef SYS_ni_syscall
126 "ni_syscall,"
127#endif
128#ifdef SYS_syslog
129 "syslog,"
130#endif
131#ifdef SYS_fanotify_init
132 "fanotify_init,"
133#endif
134#ifdef SYS_kcmp
135 "kcmp,"
136#endif
137#ifdef SYS_add_key
138 "add_key,"
139#endif
140#ifdef SYS_request_key
141 "request_key,"
142#endif
143#ifdef SYS_keyctl
144 "keyctl,"
145#endif
146#ifdef SYS_io_setup
147 "io_setup,"
148#endif
149#ifdef SYS_io_destroy
150 "io_destroy,"
151#endif
152#ifdef SYS_io_getevents
153 "io_getevents,"
154#endif
155#ifdef SYS_io_submit
156 "io_submit,"
157#endif
158#ifdef SYS_io_cancel
159 "io_cancel,"
160#endif
161#ifdef SYS_remap_file_pages
162 "remap_file_pages,"
163#endif
164#ifdef SYS_vmsplice
165 "vmsplice,"
166#endif
167#ifdef SYS_personality
168 "personality,"
169#endif
170#ifdef SYS_umount
171 "umount,"
172#endif
173#ifdef SYS_userfaultfd
174 "userfaultfd"
175#endif
176 },
177 { .name = "@default-nodebuggers", .list =
178 "@default,"
179#ifdef SYS_ptrace
180 "ptrace,"
181#endif
182#ifdef SYS_process_vm_readv
183 "process_vm_readv"
184#endif
185 },
186 { .name = "@default-keep", .list =
187 "execve,"
188 "prctl"
189 },
190 { .name = "@module", .list =
191#ifdef SYS_delete_module
192 "delete_module,"
193#endif
194#ifdef SYS_finit_module
195 "finit_module,"
196#endif
197#ifdef SYS_init_module
198 "init_module"
199#endif
200 },
201 { .name = "@obsolete", .list =
202#ifdef SYS__sysctl
203 "_sysctl,"
204#endif
205#ifdef SYS_afs_syscall
206 "afs_syscall,"
207#endif
208#ifdef SYS_bdflush
209 "bdflush,"
210#endif
211#ifdef SYS_break
212 "break,"
213#endif
214#ifdef SYS_create_module
215 "create_module,"
216#endif
217#ifdef SYS_ftime
218 "ftime,"
219#endif
220#ifdef SYS_get_kernel_syms
221 "get_kernel_syms,"
222#endif
223#ifdef SYS_getpmsg
224 "getpmsg,"
225#endif
226#ifdef SYS_gtty
227 "gtty,"
228#endif
229#ifdef SYS_lock
230 "lock,"
231#endif
232#ifdef SYS_mpx
233 "mpx,"
234#endif
235#ifdef SYS_prof
236 "prof,"
237#endif
238#ifdef SYS_profil
239 "profil,"
240#endif
241#ifdef SYS_putpmsg
242 "putpmsg,"
243#endif
244#ifdef SYS_query_module
245 "query_module,"
246#endif
247#ifdef SYS_security
248 "security,"
249#endif
250#ifdef SYS_sgetmask
251 "sgetmask,"
252#endif
253#ifdef SYS_ssetmask
254 "ssetmask,"
255#endif
256#ifdef SYS_stty
257 "stty,"
258#endif
259#ifdef SYS_sysfs
260 "sysfs,"
261#endif
262#ifdef SYS_tuxcall
263 "tuxcall,"
264#endif
265#ifdef SYS_ulimit
266 "ulimit,"
267#endif
268#ifdef SYS_uselib
269 "uselib,"
270#endif
271#ifdef SYS_ustat
272 "ustat,"
273#endif
274#ifdef SYS_vserver
275 "vserver"
276#endif
277#if !defined(SYS__sysctl) && !defined(SYS_afs_syscall) && !defined(SYS_bdflush) && !defined(SYS_break) && !defined(SYS_create_module) && !defined(SYS_ftime) && !defined(SYS_get_kernel_syms) && !defined(SYS_getpmsg) && !defined(SYS_gtty) && !defined(SYS_lock) && !defined(SYS_mpx) && !defined(SYS_prof) && !defined(SYS_profil) && !defined(SYS_putpmsg) && !defined(SYS_query_module) && !defined(SYS_security) && !defined(SYS_sgetmask) && !defined(SYS_ssetmask) && !defined(SYS_stty) && !defined(SYS_sysfs) && !defined(SYS_tuxcall) && !defined(SYS_ulimit) && !defined(SYS_uselib) && !defined(SYS_ustat) && !defined(SYS_vserver)
278 "__dummy_syscall__" // workaround for arm64 which doesn't have any of above defined and empty syscall lists are not allowed
279#endif
280 },
281 { .name = "@privileged", .list =
282 "@clock,"
283 "@module,"
284 "@raw-io,"
285 "@reboot,"
286 "@swap,"
287#ifdef SYS_acct
288 "acct,"
289#endif
290#ifdef SYS_bpf
291 "bpf,"
292#endif
293#ifdef SYS_chroot
294 "chroot,"
295#endif
296#ifdef SYS_mount
297 "mount,"
298#endif
299#ifdef SYS_nfsservctl
300 "nfsservctl,"
301#endif
302#ifdef SYS_pivot_root
303 "pivot_root,"
304#endif
305#ifdef SYS_setdomainname
306 "setdomainname,"
307#endif
308#ifdef SYS_sethostname
309 "sethostname,"
310#endif
311#ifdef SYS_umount2
312 "umount2,"
313#endif
314#ifdef SYS_vhangup
315 "vhangup"
316#endif
317 },
318 { .name = "@raw-io", .list =
319#ifdef SYS_ioperm
320 "ioperm,"
321#endif
322#ifdef SYS_iopl
323 "iopl,"
324#endif
325#ifdef SYS_pciconfig_iobase
326 "pciconfig_iobase,"
327#endif
328#ifdef SYS_pciconfig_read
329 "pciconfig_read,"
330#endif
331#ifdef SYS_pciconfig_write
332 "pciconfig_write,"
333#endif
334#ifdef SYS_s390_mmio_read
335 "s390_mmio_read,"
336#endif
337#ifdef SYS_s390_mmio_write
338 "s390_mmio_write"
339#endif
340#if !defined(SYS_ioperm) && !defined(SYS_iopl) && !defined(SYS_pciconfig_iobase) && !defined(SYS_pciconfig_read) && !defined(SYS_pciconfig_write) && !defined(SYS_s390_mmio_read) && !defined(SYS_s390_mmio_write)
341 "__dummy_syscall__" // workaround for s390x which doesn't have any of above defined and empty syscall lists are not allowed
342#endif
343 },
344 { .name = "@reboot", .list =
345#ifdef SYS_kexec_load
346 "kexec_load,"
347#endif
348#ifdef SYS_kexec_file_load
349 "kexec_file_load,"
350#endif
351#ifdef SYS_reboot
352 "reboot,"
353#endif
354 },
355 { .name = "@resources", .list =
356#ifdef SYS_set_mempolicy
357 "set_mempolicy,"
358#endif
359#ifdef SYS_migrate_pages
360 "migrate_pages,"
361#endif
362#ifdef SYS_move_pages
363 "move_pages,"
364#endif
365#ifdef SYS_mbind
366 "mbind"
367#endif
368 },
369 { .name = "@swap", .list =
370#ifdef SYS_swapon
371 "swapon,"
372#endif
373#ifdef SYS_swapoff
374 "swapoff"
375#endif
376 }
377};
378
379// return -1 if error, or syscall number
380static int syscall_find_name(const char *name) {
381 int i;
382 int elems = sizeof(syslist) / sizeof(syslist[0]);
383 for (i = 0; i < elems; i++) {
384 if (strcmp(name, syslist[i].name) == 0)
385 return syslist[i].nr;
386 }
387
388 return -1;
389}
390
391const char *syscall_find_nr(int nr) {
392 int i;
393 int elems = sizeof(syslist) / sizeof(syslist[0]);
394 for (i = 0; i < elems; i++) {
395 if (nr == syslist[i].nr)
396 return syslist[i].name;
397 }
398
399 return "unknown";
400}
401
402void syscall_print(void) {
403 int i;
404 int elems = sizeof(syslist) / sizeof(syslist[0]);
405 for (i = 0; i < elems; i++) {
406 printf("%d\t- %s\n", syslist[i].nr, syslist[i].name);
407 }
408 printf("\n");
409}
410
411static const char *syscall_find_group(const char *name) {
412 int i;
413 int elems = sizeof(sysgroups) / sizeof(sysgroups[0]);
414 for (i = 0; i < elems; i++) {
415 if (strcmp(name, sysgroups[i].name) == 0)
416 return sysgroups[i].list;
417 }
418
419 return NULL;
420}
421
422// allowed input:
423// - syscall
424// - syscall(error)
425static void syscall_process_name(const char *name, int *syscall_nr, int *error_nr) {
426 assert(name);
427 if (strlen(name) == 0)
428 goto error;
429 *error_nr = -1;
430
431 // syntax check
432 char *str = strdup(name);
433 if (!str)
434 errExit("strdup");
435
436 char *syscall_name = str;
437 char *error_name = strchr(str, ':');
438 if (error_name) {
439 *error_name = '\0';
440 error_name++;
441 }
442 if (strlen(syscall_name) == 0) {
443 free(str);
444 goto error;
445 }
446
447 if (*syscall_name == '$')
448 *syscall_nr = strtol(syscall_name + 1, NULL, 0);
449 else
450 *syscall_nr = syscall_find_name(syscall_name);
451 if (error_name) {
452 *error_nr = errno_find_name(error_name);
453 if (*error_nr == -1)
454 *syscall_nr = -1;
455 }
456
457 free(str);
458 return;
459
460error:
461 fprintf(stderr, "Error fseccomp: invalid syscall list entry %s\n", name);
462 exit(1);
463}
464
465// return 1 if error, 0 if OK
466int syscall_check_list(const char *slist, void (*callback)(int fd, int syscall, int arg, void *ptrarg), int fd, int arg, void *ptrarg) {
467 // don't allow empty lists
468 if (slist == NULL || *slist == '\0') {
469 fprintf(stderr, "Error fseccomp: empty syscall lists are not allowed\n");
470 exit(1);
471 }
472
473 // work on a copy of the string
474 char *str = strdup(slist);
475 if (!str)
476 errExit("strdup");
477
478 char *saveptr;
479 char *ptr = strtok_r(str, ",", &saveptr);
480 if (ptr == NULL) {
481 fprintf(stderr, "Error fseccomp: empty syscall lists are not allowed\n");
482 exit(1);
483 }
484
485 while (ptr) {
486 int syscall_nr;
487 int error_nr;
488 if (*ptr == '@') {
489 const char *new_list = syscall_find_group(ptr);
490 if (!new_list) {
491 fprintf(stderr, "Error fseccomp: unknown syscall group %s\n", ptr);
492 exit(1);
493 }
494 syscall_check_list(new_list, callback, fd, arg, ptrarg);
495 }
496 else {
497 syscall_process_name(ptr, &syscall_nr, &error_nr);
498 if (syscall_nr == -1) {
499 if (!arg_quiet)
500 fprintf(stderr, "Warning fseccomp: syscall \"%s\" not available on this platform\n", ptr);
501 }
502 else if (callback != NULL) {
503 if (error_nr != -1 && fd != 0) {
504 filter_add_errno(fd, syscall_nr, error_nr, ptrarg);
505 }
506 else if (error_nr != -1 && fd == 0) {
507 callback(fd, syscall_nr, error_nr, ptrarg);
508 }
509 else {
510 callback(fd, syscall_nr, arg, ptrarg);
511 }
512 }
513 }
514 ptr = strtok_r(NULL, ",", &saveptr);
515 }
516
517 free(str);
518 return 0;
519}
520
521static void find_syscall(int fd, int syscall, int arg, void *ptrarg) {
522 (void)fd;
523 (void) arg;
524 SyscallCheckList *ptr = ptrarg;
525 if (syscall == ptr->syscall)
526 ptr->found = true;
527}
528
529// go through list2 and find matches for problem syscall
530static void syscall_in_list(int fd, int syscall, int arg, void *ptrarg) {
531 (void) fd;
532 (void)arg;
533 SyscallCheckList *ptr = ptrarg;
534 SyscallCheckList sl;
535 sl.found = false;
536 sl.syscall = syscall;
537 syscall_check_list(ptr->slist, find_syscall, fd, 0, &sl);
538 // if found in the problem list, add to post-exec list
539 if (sl.found) {
540 if (ptr->postlist) {
541 if (asprintf(&ptr->postlist, "%s,%s", ptr->postlist, syscall_find_nr(syscall)) == -1)
542 errExit("asprintf");
543 }
544 else
545 ptr->postlist = strdup(syscall_find_nr(syscall));
546 }
547 else { // no problem, add to pre-exec list
548 // build syscall:error_no
549 char *newcall;
550 if (arg != 0) {
551 if (asprintf(&newcall, "%s:%s", syscall_find_nr(syscall), errno_find_nr(arg)) == -1)
552 errExit("asprintf");
553 }
554 else {
555 newcall = strdup(syscall_find_nr(syscall));
556 if (!newcall)
557 errExit("strdup");
558 }
559
560 if (ptr->prelist) {
561 if (asprintf(&ptr->prelist, "%s,%s", ptr->prelist, newcall) == -1)
562 errExit("asprintf");
563 }
564 else
565 ptr->prelist = newcall;
566 }
567}
568
569// go through list and find matches for syscalls in list @default-keep
570void syscalls_in_list(const char *list, const char *slist, int fd, char **prelist, char **postlist) {
571 (void) fd;
572 SyscallCheckList sl;
573 // these syscalls are used by firejail after the seccomp filter is initialized
574 sl.slist = slist;
575 sl.prelist = NULL;
576 sl.postlist = NULL;
577 syscall_check_list(list, syscall_in_list, 0, 0, &sl);
578 if (!arg_quiet) {
579 printf("Seccomp list in: %s,", list);
580 if (sl.slist)
581 printf(" check list: %s,", sl.slist);
582 if (sl.prelist)
583 printf(" prelist: %s,", sl.prelist);
584 if (sl.postlist)
585 printf(" postlist: %s", sl.postlist);
586 printf("\n");
587 }
588 *prelist = sl.prelist;
589 *postlist = sl.postlist;
590}
diff --git a/src/fshaper/fshaper.sh b/src/fshaper/fshaper.sh
index 470137895..f9a6c4f06 100755
--- a/src/fshaper/fshaper.sh
+++ b/src/fshaper/fshaper.sh
@@ -1,4 +1,17 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6TCFILE=""
7if [ -x "/usr/sbin/tc" ]; then
8 TCFILE="/usr/sbin/tc"
9elif [ -x "/sbin/tc" ]; then
10 TCFILE="/sbin/tc";
11else
12 echo "Error: traffic control utility (tc) not found";
13 exit 1
14fi
2 15
3usage() { 16usage() {
4 echo "Usage:" 17 echo "Usage:"
@@ -8,8 +21,8 @@ usage() {
8} 21}
9 22
10if [ "$1" = "--status" ]; then 23if [ "$1" = "--status" ]; then
11 /sbin/tc -s qdisc ls 24 $TCFILE -s qdisc ls
12 /sbin/tc -s class ls 25 $TCFILE -s class ls
13 exit 26 exit
14fi 27fi
15 28
@@ -21,17 +34,17 @@ if [ "$1" = "--clear" ]; then
21 fi 34 fi
22 35
23 DEV=$2 36 DEV=$2
24 echo "Removing bandwith limits" 37 echo "Removing bandwidth limits"
25 /sbin/tc qdisc del dev $DEV root 2> /dev/null > /dev/null 38 $TCFILE qdisc del dev $DEV root 2> /dev/null > /dev/null
26 /sbin/tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null 39 $TCFILE qdisc del dev $DEV ingress 2> /dev/null > /dev/null
27 exit 40 exit
28 41
29fi 42fi
30 43
31if [ "$1" = "--set" ]; then 44if [ "$1" = "--set" ]; then
32 DEV=$2 45 DEV=$2
33 echo "Removing bandwith limit" 46 echo "Removing bandwidth limit"
34 /sbin/tc qdisc del dev $DEV ingress #2> /dev/null > /dev/null 47 $TCFILE qdisc del dev $DEV ingress #2> /dev/null > /dev/null
35 48
36 if [ $# -ne 4 ]; then 49 if [ $# -ne 4 ]; then
37 echo "Error: missing parameters" 50 echo "Error: missing parameters"
@@ -51,16 +64,16 @@ if [ "$1" = "--set" ]; then
51 echo "Upload speed ${OUT}kbps" 64 echo "Upload speed ${OUT}kbps"
52 65
53 echo "cleaning limits" 66 echo "cleaning limits"
54 /sbin/tc qdisc del dev $DEV root 2> /dev/null > /dev/null 67 $TCFILE qdisc del dev $DEV root 2> /dev/null > /dev/null
55 /sbin/tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null 68 $TCFILE qdisc del dev $DEV ingress 2> /dev/null > /dev/null
56 69
57 echo "configuring tc ingress" 70 echo "configuring tc ingress"
58 /sbin/tc qdisc add dev $DEV handle ffff: ingress #2> /dev/null > /dev/null 71 $TCFILE qdisc add dev $DEV handle ffff: ingress #2> /dev/null > /dev/null
59 /sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \ 72 $TCFILE filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
60 0.0.0.0/0 police rate ${IN}kbit burst 10k drop flowid :1 #2> /dev/null > /dev/null 73 0.0.0.0/0 police rate ${IN}kbit burst 10k drop flowid :1 #2> /dev/null > /dev/null
61 74
62 echo "configuring tc egress" 75 echo "configuring tc egress"
63 /sbin/tc qdisc add dev $DEV root tbf rate ${OUT}kbit latency 25ms burst 10k #2> /dev/null > /dev/null 76 $TCFILE qdisc add dev $DEV root tbf rate ${OUT}kbit latency 25ms burst 10k #2> /dev/null > /dev/null
64 exit 77 exit
65fi 78fi
66 79
diff --git a/src/ftee/Makefile.in b/src/ftee/Makefile.in
index fd39f0cb7..05caf81be 100644
--- a/src/ftee/Makefile.in
+++ b/src/ftee/Makefile.in
@@ -1,27 +1,17 @@
1.PHONY: all
1all: ftee 2all: ftee
2 3
3CC=@CC@ 4include ../common.mk
4PREFIX=@prefix@
5VERSION=@PACKAGE_VERSION@
6NAME=@PACKAGE_NAME@
7HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
8HAVE_GCOV=@HAVE_GCOV@
9EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
10
11H_FILE_LIST = $(sort $(wildcard *.[h]))
12C_FILE_LIST = $(sort $(wildcard *.c))
13OBJS = $(C_FILE_LIST:.c=.o)
14BINOBJS = $(foreach file, $(OBJS), $file)
15CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -DPREFIX='"$(PREFIX)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -pie -Wformat -Wformat-security
16LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
17 5
18%.o : %.c $(H_FILE_LIST) 6%.o : %.c $(H_FILE_LIST)
19 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
20 8
21ftee: $(OBJS) 9ftee: $(OBJS)
22 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(EXTRA_LDFLAGS) 10 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS)
23 11
24clean:; rm -f *.o ftee *.gcov *.gcda *.gcno 12.PHONY: clean
13clean:; rm -fr *.o ftee *.gcov *.gcda *.gcno *.plist
25 14
15.PHONY: distclean
26distclean: clean 16distclean: clean
27 rm -fr Makefile 17 rm -fr Makefile
diff --git a/src/ftee/ftee.h b/src/ftee/ftee.h
index 48f3b5fdf..a556efb75 100644
--- a/src/ftee/ftee.h
+++ b/src/ftee/ftee.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
diff --git a/src/ftee/main.c b/src/ftee/main.c
index 2f6adb9c8..4d447f2c4 100644
--- a/src/ftee/main.c
+++ b/src/ftee/main.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
diff --git a/src/include/common.h b/src/include/common.h
index 4c517e427..5bcbaad88 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -32,7 +32,11 @@
32#include <ctype.h> 32#include <ctype.h>
33#include <assert.h> 33#include <assert.h>
34 34
35#define errExit(msg) do { char msgout[500]; sprintf(msgout, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __FUNCTION__); perror(msgout); exit(1);} while (0) 35// dbus proxy path used by firejail and firemon
36#define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy"
37
38
39#define errExit(msg) do { char msgout[500]; snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __FUNCTION__); perror(msgout); exit(1);} while (0)
36 40
37// macro to print ip addresses in a printf statement 41// macro to print ip addresses in a printf statement
38#define PRINT_IP(A) \ 42#define PRINT_IP(A) \
@@ -109,25 +113,14 @@ static inline int mac_not_zero(const unsigned char mac[6]) {
109 return 0; 113 return 0;
110} 114}
111 115
112// rtdsc timestamp on x86-64/amd64 processors 116void timetrace_start(void);
113static inline unsigned long long getticks(void) { 117float timetrace_end(void);
114#if defined(__x86_64__)
115 unsigned a, d;
116 asm volatile("rdtsc" : "=a" (a), "=d" (d));
117 return ((unsigned long long)a) | (((unsigned long long)d) << 32);
118#elif defined(__i386__)
119 unsigned long long ret;
120 __asm__ __volatile__("rdtsc" : "=A" (ret));
121 return ret;
122#else
123 return 0; // not implemented
124#endif
125}
126
127int join_namespace(pid_t pid, char *type); 118int join_namespace(pid_t pid, char *type);
128int name2pid(const char *name, pid_t *pid); 119int name2pid(const char *name, pid_t *pid);
129char *pid_proc_comm(const pid_t pid); 120char *pid_proc_comm(const pid_t pid);
130char *pid_proc_cmdline(const pid_t pid); 121char *pid_proc_cmdline(const pid_t pid);
131int pid_proc_cmdline_x11_xpra_xephyr(const pid_t pid); 122int pid_proc_cmdline_x11_xpra_xephyr(const pid_t pid);
132int pid_hidepid(void); 123int pid_hidepid(void);
124void warn_dumpable(void);
125const char *gnu_basename(const char *path);
133#endif 126#endif
diff --git a/src/include/euid_common.h b/src/include/euid_common.h
index 4e6db514d..8d8dd95f6 100644
--- a/src/include/euid_common.h
+++ b/src/include/euid_common.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
diff --git a/src/include/firejail_user.h b/src/include/firejail_user.h
new file mode 100644
index 000000000..cf17fa0cf
--- /dev/null
+++ b/src/include/firejail_user.h
@@ -0,0 +1,32 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20#ifndef FIREJAIL_USER_H
21#define FIREJAIL_USER_H
22
23extern int uid_min;
24extern int gid_min;
25
26// returns 1 if the user is found in the database or if the database was not created
27int firejail_user_check(const char *name);
28
29// add a user to the database
30void firejail_user_add(const char *name);
31
32#endif
diff --git a/src/include/gcov_wrapper.h b/src/include/gcov_wrapper.h
new file mode 100644
index 000000000..4aafb8e18
--- /dev/null
+++ b/src/include/gcov_wrapper.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef GCOV_WRAPPER_H
22#define GCOV_WRAPPER_H
23
24#ifdef HAS_GCOV
25#include <gcov.h>
26
27/*
28 * __gcov_flush was removed on gcc 11.1.0 (as it's no longer needed), but it
29 * appears to be the safe/"correct" way to do things on previous versions (as
30 * it ensured proper locking, which is now done elsewhere). Thus, keep using
31 * it in the code and ensure that it exists, in order to support gcc <11.1.0
32 * and gcc >=11.1.0, respectively.
33 */
34#if __GNUC__ > 11 || (__GNUC__ == 11 && __GNUC_MINOR__ >= 1)
35static void __gcov_flush(void) {
36 __gcov_dump();
37 __gcov_reset();
38}
39#endif
40#else
41#define __gcov_dump() ((void)0)
42#define __gcov_reset() ((void)0)
43#define __gcov_flush() ((void)0)
44#endif /* HAS_GCOV */
45
46#endif /* GCOV_WRAPPER_H */
diff --git a/src/include/ldd_utils.h b/src/include/ldd_utils.h
new file mode 100644
index 000000000..ffd6e189f
--- /dev/null
+++ b/src/include/ldd_utils.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#ifndef LDD_UTILS_H
22#define LDD_UTILS_H
23
24#include "../include/common.h"
25#include <elf.h>
26
27#ifdef __LP64__
28#define Elf_Ehdr Elf64_Ehdr
29#define Elf_Phdr Elf64_Phdr
30#define Elf_Shdr Elf64_Shdr
31#define Elf_Dyn Elf64_Dyn
32#else
33#define Elf_Ehdr Elf32_Ehdr
34#define Elf_Phdr Elf32_Phdr
35#define Elf_Shdr Elf32_Shdr
36#define Elf_Dyn Elf32_Dyn
37#endif
38
39extern const char * const default_lib_paths[];
40
41// return 1 if this is a 64 bit program/library
42int is_lib_64(const char *exe);
43
44
45
46#endif
diff --git a/src/include/libnetlink.h b/src/include/libnetlink.h
index 01fd2675d..0310ecad3 100644
--- a/src/include/libnetlink.h
+++ b/src/include/libnetlink.h
@@ -3,10 +3,10 @@
3 * Original source code: 3 * Original source code:
4 * 4 *
5 * Information: 5 * Information:
6 * http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 6 * https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
7 * 7 *
8 * Download: 8 * Download:
9 * http://www.kernel.org/pub/linux/utils/net/iproute2/ 9 * https://www.kernel.org/pub/linux/utils/net/iproute2/
10 * 10 *
11 * Repository: 11 * Repository:
12 * git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git 12 * git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
diff --git a/src/include/pid.h b/src/include/pid.h
index ca152f972..17e51f660 100644
--- a/src/include/pid.h
+++ b/src/include/pid.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
diff --git a/src/include/rundefs.h b/src/include/rundefs.h
new file mode 100644
index 000000000..3db750da3
--- /dev/null
+++ b/src/include/rundefs.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#ifndef RUNDEFS_H
22#define RUNDEFS_H
23// filesystem
24#define RUN_FIREJAIL_BASEDIR "/run"
25#define RUN_FIREJAIL_DIR RUN_FIREJAIL_BASEDIR "/firejail"
26#define RUN_FIREJAIL_APPIMAGE_DIR RUN_FIREJAIL_DIR "/appimage"
27#define RUN_FIREJAIL_NAME_DIR RUN_FIREJAIL_DIR "/name" // also used in src/lib/pid.c - todo: move it in a common place
28#define RUN_FIREJAIL_LIB_DIR RUN_FIREJAIL_DIR "/lib"
29#define RUN_FIREJAIL_X11_DIR RUN_FIREJAIL_DIR "/x11"
30#define RUN_FIREJAIL_NETWORK_DIR RUN_FIREJAIL_DIR "/network"
31#define RUN_FIREJAIL_BANDWIDTH_DIR RUN_FIREJAIL_DIR "/bandwidth"
32#define RUN_FIREJAIL_PROFILE_DIR RUN_FIREJAIL_DIR "/profile"
33#define RUN_FIREJAIL_DBUS_DIR RUN_FIREJAIL_DIR "/dbus"
34#define RUN_NETWORK_LOCK_FILE RUN_FIREJAIL_DIR "/firejail-network.lock"
35#define RUN_DIRECTORY_LOCK_FILE RUN_FIREJAIL_DIR "/firejail-run.lock"
36#define RUN_RO_DIR RUN_FIREJAIL_DIR "/firejail.ro.dir"
37#define RUN_RO_FILE RUN_FIREJAIL_DIR "/firejail.ro.file"
38#define RUN_MNT_DIR RUN_FIREJAIL_DIR "/mnt" // a tmpfs is mounted on this directory before any of the files below are created
39#define RUN_CGROUP_CFG RUN_MNT_DIR "/cgroup"
40#define RUN_CPU_CFG RUN_MNT_DIR "/cpu"
41#define RUN_GROUPS_CFG RUN_MNT_DIR "/groups"
42#define RUN_PROTOCOL_CFG RUN_MNT_DIR "/protocol"
43#define RUN_NONEWPRIVS_CFG RUN_MNT_DIR "/nonewprivs"
44#define RUN_HOME_DIR RUN_MNT_DIR "/home"
45#define RUN_ETC_DIR RUN_MNT_DIR "/etc"
46#define RUN_USR_ETC_DIR RUN_MNT_DIR "/usretc"
47#define RUN_OPT_DIR RUN_MNT_DIR "/opt"
48#define RUN_SRV_DIR RUN_MNT_DIR "/srv"
49#define RUN_BIN_DIR RUN_MNT_DIR "/bin"
50#define RUN_PULSE_DIR RUN_MNT_DIR "/pulse"
51#define RUN_LIB_DIR RUN_MNT_DIR "/lib"
52#define RUN_LIB_FILE RUN_MNT_DIR "/libfiles"
53#define RUN_DNS_ETC RUN_MNT_DIR "/dns-etc"
54#define RUN_DHCLIENT_DIR RUN_MNT_DIR "/dhclient-dir"
55#define RUN_DHCLIENT_4_LEASES_FILE RUN_DHCLIENT_DIR "/dhclient.leases"
56#define RUN_DHCLIENT_6_LEASES_FILE RUN_DHCLIENT_DIR "/dhclient6.leases"
57#define RUN_DHCLIENT_4_LEASES_FILE RUN_DHCLIENT_DIR "/dhclient.leases"
58#define RUN_DHCLIENT_4_PID_FILE RUN_DHCLIENT_DIR "/dhclient.pid"
59#define RUN_DHCLIENT_6_PID_FILE RUN_DHCLIENT_DIR "/dhclient6.pid"
60#define RUN_DBUS_DIR RUN_MNT_DIR "/dbus"
61#define RUN_DBUS_USER_SOCKET RUN_DBUS_DIR "/user"
62#define RUN_DBUS_SYSTEM_SOCKET RUN_DBUS_DIR "/system"
63
64#define RUN_SECCOMP_DIR RUN_MNT_DIR "/seccomp"
65#define RUN_SECCOMP_LIST RUN_SECCOMP_DIR "/seccomp.list" // list of seccomp files installed
66#define RUN_SECCOMP_PROTOCOL RUN_SECCOMP_DIR "/seccomp.protocol" // protocol filter
67#define RUN_SECCOMP_CFG RUN_SECCOMP_DIR "/seccomp" // configured filter
68#define RUN_SECCOMP_32 RUN_SECCOMP_DIR "/seccomp.32" // 32bit arch filter installed on 64bit architectures
69#define RUN_SECCOMP_MDWX RUN_SECCOMP_DIR "/seccomp.mdwx" // filter for memory-deny-write-execute
70#define RUN_SECCOMP_MDWX_32 RUN_SECCOMP_DIR "/seccomp.mdwx.32"
71#define RUN_SECCOMP_BLOCK_SECONDARY RUN_SECCOMP_DIR "/seccomp.block_secondary" // secondary arch blocking filter
72#define RUN_SECCOMP_POSTEXEC RUN_SECCOMP_DIR "/seccomp.postexec" // filter for post-exec library
73#define RUN_SECCOMP_POSTEXEC_32 RUN_SECCOMP_DIR "/seccomp.postexec32" // filter for post-exec library
74#define PATH_SECCOMP_DEFAULT LIBDIR "/firejail/seccomp" // default filter built during make
75#define PATH_SECCOMP_DEFAULT_DEBUG LIBDIR "/firejail/seccomp.debug" // debug filter built during make
76#define PATH_SECCOMP_32 LIBDIR "/firejail/seccomp.32" // 32bit arch filter built during make
77#define PATH_SECCOMP_DEBUG_32 LIBDIR "/firejail/seccomp.debug32" // 32bit arch debug filter built during make
78#define PATH_SECCOMP_MDWX LIBDIR "/firejail/seccomp.mdwx" // filter for memory-deny-write-execute built during make
79#define PATH_SECCOMP_MDWX_32 LIBDIR "/firejail/seccomp.mdwx.32"
80#define PATH_SECCOMP_BLOCK_SECONDARY LIBDIR "/firejail/seccomp.block_secondary" // secondary arch blocking filter built during make
81
82#define RUN_DEV_DIR RUN_MNT_DIR "/dev"
83#define RUN_DEVLOG_FILE RUN_MNT_DIR "/devlog"
84#define RUN_XAUTHORITY_FILE RUN_MNT_DIR "/.Xauthority" // private options
85#define RUN_XAUTH_FILE RUN_MNT_DIR "/xauth" // x11=xorg
86#define RUN_XAUTHORITY_SEC_DIR RUN_MNT_DIR "/.sec.Xauthority" // x11=xorg
87#define RUN_ASOUNDRC_FILE RUN_MNT_DIR "/.asoundrc"
88#define RUN_HOSTNAME_FILE RUN_MNT_DIR "/hostname"
89#define RUN_HOSTS_FILE RUN_MNT_DIR "/hosts"
90#define RUN_MACHINEID RUN_MNT_DIR "/machine-id"
91#define RUN_LDPRELOAD_FILE RUN_MNT_DIR "/ld.so.preload"
92#define RUN_UTMP_FILE RUN_MNT_DIR "/utmp"
93#define RUN_PASSWD_FILE RUN_MNT_DIR "/passwd"
94#define RUN_GROUP_FILE RUN_MNT_DIR "/group"
95#define RUN_FSLOGGER_FILE RUN_MNT_DIR "/fslogger"
96#define RUN_TRACE_FILE RUN_MNT_DIR "/trace"
97#define RUN_UMASK_FILE RUN_MNT_DIR "/umask"
98#define RUN_JOIN_FILE RUN_MNT_DIR "/join"
99#define RUN_OVERLAY_ROOT RUN_MNT_DIR "/oroot"
100
101#endif
diff --git a/src/include/seccomp.h b/src/include/seccomp.h
index b8bfce96b..43bb73a04 100644
--- a/src/include/seccomp.h
+++ b/src/include/seccomp.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -67,28 +67,41 @@
67#include <sys/stat.h> 67#include <sys/stat.h>
68#include <fcntl.h> 68#include <fcntl.h>
69 69
70// From /usr/include/linux/filter.h
71//struct sock_filter { /* Filter block */
72// __u16 code; /* Actual filter code */
73// __u8 jt; /* Jump true */
74// __u8 jf; /* Jump false */
75// __u32 k; /* Generic multiuse field */
76//};
77
78// for old platforms (Debian "wheezy", etc.)
79#ifndef BPF_MOD
80#define BPF_MOD 0x90
81#endif
82#ifndef BPF_XOR
83#define BPF_XOR 0xa0
84#endif
85#ifndef SECCOMP_RET_ACTION
86#define SECCOMP_RET_ACTION 0x7fff0000U
87#endif
88#ifndef SECCOMP_RET_TRACE
89#define SECCOMP_RET_TRACE 0x7ff00000U
90#endif
91
92
93
70#include <sys/prctl.h> 94#include <sys/prctl.h>
71#ifndef PR_SET_NO_NEW_PRIVS 95#ifndef PR_SET_NO_NEW_PRIVS
72# define PR_SET_NO_NEW_PRIVS 38 96# define PR_SET_NO_NEW_PRIVS 38
73#endif 97#endif
74 98
75#if HAVE_SECCOMP_H
76#include <linux/seccomp.h> 99#include <linux/seccomp.h>
77#else 100#ifndef SECCOMP_RET_LOG
78#define SECCOMP_MODE_FILTER 2 101#define SECCOMP_RET_LOG 0x7ffc0000U
79#define SECCOMP_RET_KILL 0x00000000U
80#define SECCOMP_RET_TRAP 0x00030000U
81#define SECCOMP_RET_ALLOW 0x7fff0000U
82#define SECCOMP_RET_ERRNO 0x00050000U
83#define SECCOMP_RET_DATA 0x0000ffffU
84struct seccomp_data {
85 int nr;
86 __u32 arch;
87 __u64 instruction_pointer;
88 __u64 args[6];
89};
90#endif 102#endif
91 103
104
92#if defined(__i386__) 105#if defined(__i386__)
93# define ARCH_NR AUDIT_ARCH_I386 106# define ARCH_NR AUDIT_ARCH_I386
94# define ARCH_32 AUDIT_ARCH_I386 107# define ARCH_32 AUDIT_ARCH_I386
@@ -188,7 +201,7 @@ struct seccomp_data {
188#define VALIDATE_ARCHITECTURE_KILL \ 201#define VALIDATE_ARCHITECTURE_KILL \
189 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \ 202 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \
190 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1, 0), \ 203 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1, 0), \
191 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL) 204 KILL_OR_RETURN_ERRNO
192 205
193#define VALIDATE_ARCHITECTURE_64 \ 206#define VALIDATE_ARCHITECTURE_64 \
194 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \ 207 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \
@@ -200,17 +213,16 @@ struct seccomp_data {
200 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_32, 1, 0), \ 213 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_32, 1, 0), \
201 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW) 214 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
202 215
216#ifndef X32_SYSCALL_BIT
217#define X32_SYSCALL_BIT 0x40000000
218#endif
219
203#if defined(__x86_64__) 220#if defined(__x86_64__)
204// handle X32 ABI 221// handle X32 ABI
205#define X32_SYSCALL_BIT 0x40000000
206#define HANDLE_X32 \ 222#define HANDLE_X32 \
207 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, X32_SYSCALL_BIT, 1, 0), \ 223 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, X32_SYSCALL_BIT, 1, 0), \
208 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0, 1, 0), \ 224 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0, 1, 0), \
209 RETURN_ERRNO(EPERM) 225 KILL_OR_RETURN_ERRNO
210#define HANDLE_X32_KILL \
211 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, X32_SYSCALL_BIT, 1, 0), \
212 BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0, 1, 0), \
213 KILL_PROCESS
214#endif 226#endif
215 227
216#define EXAMINE_SYSCALL BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \ 228#define EXAMINE_SYSCALL BPF_STMT(BPF_LD+BPF_W+BPF_ABS, \
@@ -225,7 +237,7 @@ struct seccomp_data {
225 237
226#define BLACKLIST(syscall_nr) \ 238#define BLACKLIST(syscall_nr) \
227 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, syscall_nr, 0, 1), \ 239 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, syscall_nr, 0, 1), \
228 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL) 240 KILL_OR_RETURN_ERRNO
229 241
230#define WHITELIST(syscall_nr) \ 242#define WHITELIST(syscall_nr) \
231 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, syscall_nr, 0, 1), \ 243 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, syscall_nr, 0, 1), \
@@ -241,7 +253,10 @@ struct seccomp_data {
241#define RETURN_ERRNO(nr) \ 253#define RETURN_ERRNO(nr) \
242 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ERRNO | nr) 254 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ERRNO | nr)
243 255
244#define KILL_PROCESS \ 256extern int arg_seccomp_error_action; // error action: errno, log or kill
245 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL) 257#define DEFAULT_SECCOMP_ERROR_ACTION EPERM
258
259#define KILL_OR_RETURN_ERRNO \
260 BPF_STMT(BPF_RET+BPF_K, arg_seccomp_error_action)
246 261
247#endif 262#endif
diff --git a/src/include/syscall.h b/src/include/syscall.h
index df9a03ffb..015dd01b9 100644
--- a/src/include/syscall.h
+++ b/src/include/syscall.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,5130 +17,29 @@
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 SYSCALL_H
21#define SYSCALL_H
22
23#include <stdbool.h>
24
25// main.c
26extern int arg_quiet;
27
28// seccomp_file.c or dummy versions in firejail/main.c and fsec-print/main.c
29void filter_add_errno(int fd, int syscall, int arg, void *ptrarg, bool native);
30void filter_add_blacklist_override(int fd, int syscall, int arg, void *ptrarg, bool native);
31
32// errno.c
33void errno_print(void);
34int errno_find_name(const char *name);
35const char *errno_find_nr(int nr);
36
37// syscall.c
38void syscall_print(void);
39void syscall_print_32(void);
40typedef void (filter_fn)(int fd, int syscall, int arg, void *ptrarg, bool native);
41int syscall_check_list(const char *slist, filter_fn *callback, int fd, int arg, void *ptrarg, bool native);
42const char *syscall_find_nr(int nr);
43void syscalls_in_list(const char *list, const char *slist, int fd, char **prelist, char **postlist, bool native);
20 44
21// content extracted from /bits/syscall.h file form glibc 2.22
22// using ../tools/extract_syscall tool
23#if !defined __x86_64__
24#ifdef SYS__llseek
25#ifdef __NR__llseek
26 {"_llseek", __NR__llseek},
27#endif
28#endif
29#ifdef SYS__newselect
30#ifdef __NR__newselect
31 {"_newselect", __NR__newselect},
32#endif
33#endif
34#ifdef SYS__sysctl
35#ifdef __NR__sysctl
36 {"_sysctl", __NR__sysctl},
37#endif
38#endif
39#ifdef SYS_accept4
40#ifdef __NR_accept4
41 {"accept4", __NR_accept4},
42#endif
43#endif
44#ifdef SYS_access
45#ifdef __NR_access
46 {"access", __NR_access},
47#endif
48#endif
49#ifdef SYS_acct
50#ifdef __NR_acct
51 {"acct", __NR_acct},
52#endif
53#endif
54#ifdef SYS_add_key
55#ifdef __NR_add_key
56 {"add_key", __NR_add_key},
57#endif
58#endif
59#ifdef SYS_adjtimex
60#ifdef __NR_adjtimex
61 {"adjtimex", __NR_adjtimex},
62#endif
63#endif
64#ifdef SYS_afs_syscall
65#ifdef __NR_afs_syscall
66 {"afs_syscall", __NR_afs_syscall},
67#endif
68#endif
69#ifdef SYS_alarm
70#ifdef __NR_alarm
71 {"alarm", __NR_alarm},
72#endif
73#endif
74#ifdef SYS_bdflush
75#ifdef __NR_bdflush
76 {"bdflush", __NR_bdflush},
77#endif
78#endif
79#ifdef SYS_bind
80#ifdef __NR_bind
81 {"bind", __NR_bind},
82#endif
83#endif
84#ifdef SYS_bpf
85#ifdef __NR_bpf
86 {"bpf", __NR_bpf},
87#endif
88#endif
89#ifdef SYS_break
90#ifdef __NR_break
91 {"break", __NR_break},
92#endif
93#endif
94#ifdef SYS_brk
95#ifdef __NR_brk
96 {"brk", __NR_brk},
97#endif
98#endif
99#ifdef SYS_capget
100#ifdef __NR_capget
101 {"capget", __NR_capget},
102#endif
103#endif
104#ifdef SYS_capset
105#ifdef __NR_capset
106 {"capset", __NR_capset},
107#endif
108#endif
109#ifdef SYS_chdir
110#ifdef __NR_chdir
111 {"chdir", __NR_chdir},
112#endif
113#endif
114#ifdef SYS_chmod
115#ifdef __NR_chmod
116 {"chmod", __NR_chmod},
117#endif
118#endif
119#ifdef SYS_chown
120#ifdef __NR_chown
121 {"chown", __NR_chown},
122#endif
123#endif
124#ifdef SYS_chown32
125#ifdef __NR_chown32
126 {"chown32", __NR_chown32},
127#endif
128#endif
129#ifdef SYS_chroot
130#ifdef __NR_chroot
131 {"chroot", __NR_chroot},
132#endif
133#endif
134#ifdef SYS_clock_adjtime
135#ifdef __NR_clock_adjtime
136 {"clock_adjtime", __NR_clock_adjtime},
137#endif
138#endif
139#ifdef SYS_clock_getres
140#ifdef __NR_clock_getres
141 {"clock_getres", __NR_clock_getres},
142#endif
143#endif
144#ifdef SYS_clock_gettime
145#ifdef __NR_clock_gettime
146 {"clock_gettime", __NR_clock_gettime},
147#endif
148#endif
149#ifdef SYS_clock_nanosleep
150#ifdef __NR_clock_nanosleep
151 {"clock_nanosleep", __NR_clock_nanosleep},
152#endif
153#endif
154#ifdef SYS_clock_settime
155#ifdef __NR_clock_settime
156 {"clock_settime", __NR_clock_settime},
157#endif
158#endif
159#ifdef SYS_clone
160#ifdef __NR_clone
161 {"clone", __NR_clone},
162#endif
163#endif
164#ifdef SYS_close
165#ifdef __NR_close
166 {"close", __NR_close},
167#endif
168#endif
169#ifdef SYS_connect
170#ifdef __NR_connect
171 {"connect", __NR_connect},
172#endif
173#endif
174#ifdef SYS_copy_file_range
175#ifdef __NR_copy_file_range
176 {"copy_file_range", __NR_copy_file_range},
177#endif
178#endif
179#ifdef SYS_creat
180#ifdef __NR_creat
181 {"creat", __NR_creat},
182#endif
183#endif
184#ifdef SYS_create_module
185#ifdef __NR_create_module
186 {"create_module", __NR_create_module},
187#endif
188#endif
189#ifdef SYS_delete_module
190#ifdef __NR_delete_module
191 {"delete_module", __NR_delete_module},
192#endif
193#endif
194#ifdef SYS_dup
195#ifdef __NR_dup
196 {"dup", __NR_dup},
197#endif
198#endif
199#ifdef SYS_dup2
200#ifdef __NR_dup2
201 {"dup2", __NR_dup2},
202#endif
203#endif
204#ifdef SYS_dup3
205#ifdef __NR_dup3
206 {"dup3", __NR_dup3},
207#endif
208#endif
209#ifdef SYS_epoll_create
210#ifdef __NR_epoll_create
211 {"epoll_create", __NR_epoll_create},
212#endif
213#endif
214#ifdef SYS_epoll_create1
215#ifdef __NR_epoll_create1
216 {"epoll_create1", __NR_epoll_create1},
217#endif
218#endif
219#ifdef SYS_epoll_ctl
220#ifdef __NR_epoll_ctl
221 {"epoll_ctl", __NR_epoll_ctl},
222#endif
223#endif
224#ifdef SYS_epoll_pwait
225#ifdef __NR_epoll_pwait
226 {"epoll_pwait", __NR_epoll_pwait},
227#endif
228#endif
229#ifdef SYS_epoll_wait
230#ifdef __NR_epoll_wait
231 {"epoll_wait", __NR_epoll_wait},
232#endif
233#endif
234#ifdef SYS_eventfd
235#ifdef __NR_eventfd
236 {"eventfd", __NR_eventfd},
237#endif
238#endif
239#ifdef SYS_eventfd2
240#ifdef __NR_eventfd2
241 {"eventfd2", __NR_eventfd2},
242#endif
243#endif
244#ifdef SYS_execve
245#ifdef __NR_execve
246 {"execve", __NR_execve},
247#endif
248#endif
249#ifdef SYS_execveat
250#ifdef __NR_execveat
251 {"execveat", __NR_execveat},
252#endif
253#endif
254#ifdef SYS_exit
255#ifdef __NR_exit
256 {"exit", __NR_exit},
257#endif
258#endif
259#ifdef SYS_exit_group
260#ifdef __NR_exit_group
261 {"exit_group", __NR_exit_group},
262#endif
263#endif
264#ifdef SYS_faccessat
265#ifdef __NR_faccessat
266 {"faccessat", __NR_faccessat},
267#endif
268#endif
269#ifdef SYS_fadvise64
270#ifdef __NR_fadvise64
271 {"fadvise64", __NR_fadvise64},
272#endif
273#endif
274#ifdef SYS_fadvise64_64
275#ifdef __NR_fadvise64_64
276 {"fadvise64_64", __NR_fadvise64_64},
277#endif
278#endif
279#ifdef SYS_fallocate
280#ifdef __NR_fallocate
281 {"fallocate", __NR_fallocate},
282#endif
283#endif
284#ifdef SYS_fanotify_init
285#ifdef __NR_fanotify_init
286 {"fanotify_init", __NR_fanotify_init},
287#endif
288#endif
289#ifdef SYS_fanotify_mark
290#ifdef __NR_fanotify_mark
291 {"fanotify_mark", __NR_fanotify_mark},
292#endif
293#endif
294#ifdef SYS_fchdir
295#ifdef __NR_fchdir
296 {"fchdir", __NR_fchdir},
297#endif
298#endif
299#ifdef SYS_fchmod
300#ifdef __NR_fchmod
301 {"fchmod", __NR_fchmod},
302#endif
303#endif
304#ifdef SYS_fchmodat
305#ifdef __NR_fchmodat
306 {"fchmodat", __NR_fchmodat},
307#endif
308#endif
309#ifdef SYS_fchown
310#ifdef __NR_fchown
311 {"fchown", __NR_fchown},
312#endif
313#endif
314#ifdef SYS_fchown32
315#ifdef __NR_fchown32
316 {"fchown32", __NR_fchown32},
317#endif
318#endif
319#ifdef SYS_fchownat
320#ifdef __NR_fchownat
321 {"fchownat", __NR_fchownat},
322#endif
323#endif
324#ifdef SYS_fcntl
325#ifdef __NR_fcntl
326 {"fcntl", __NR_fcntl},
327#endif
328#endif
329#ifdef SYS_fcntl64
330#ifdef __NR_fcntl64
331 {"fcntl64", __NR_fcntl64},
332#endif
333#endif
334#ifdef SYS_fdatasync
335#ifdef __NR_fdatasync
336 {"fdatasync", __NR_fdatasync},
337#endif
338#endif
339#ifdef SYS_fgetxattr
340#ifdef __NR_fgetxattr
341 {"fgetxattr", __NR_fgetxattr},
342#endif
343#endif
344#ifdef SYS_finit_module
345#ifdef __NR_finit_module
346 {"finit_module", __NR_finit_module},
347#endif
348#endif
349#ifdef SYS_flistxattr
350#ifdef __NR_flistxattr
351 {"flistxattr", __NR_flistxattr},
352#endif
353#endif
354#ifdef SYS_flock
355#ifdef __NR_flock
356 {"flock", __NR_flock},
357#endif
358#endif
359#ifdef SYS_fork
360#ifdef __NR_fork
361 {"fork", __NR_fork},
362#endif
363#endif
364#ifdef SYS_fremovexattr
365#ifdef __NR_fremovexattr
366 {"fremovexattr", __NR_fremovexattr},
367#endif
368#endif
369#ifdef SYS_fsetxattr
370#ifdef __NR_fsetxattr
371 {"fsetxattr", __NR_fsetxattr},
372#endif
373#endif
374#ifdef SYS_fstat
375#ifdef __NR_fstat
376 {"fstat", __NR_fstat},
377#endif
378#endif
379#ifdef SYS_fstat64
380#ifdef __NR_fstat64
381 {"fstat64", __NR_fstat64},
382#endif
383#endif
384#ifdef SYS_fstatat64
385#ifdef __NR_fstatat64
386 {"fstatat64", __NR_fstatat64},
387#endif
388#endif
389#ifdef SYS_fstatfs
390#ifdef __NR_fstatfs
391 {"fstatfs", __NR_fstatfs},
392#endif
393#endif
394#ifdef SYS_fstatfs64
395#ifdef __NR_fstatfs64
396 {"fstatfs64", __NR_fstatfs64},
397#endif
398#endif
399#ifdef SYS_fsync
400#ifdef __NR_fsync
401 {"fsync", __NR_fsync},
402#endif
403#endif
404#ifdef SYS_ftime
405#ifdef __NR_ftime
406 {"ftime", __NR_ftime},
407#endif
408#endif
409#ifdef SYS_ftruncate
410#ifdef __NR_ftruncate
411 {"ftruncate", __NR_ftruncate},
412#endif
413#endif
414#ifdef SYS_ftruncate64
415#ifdef __NR_ftruncate64
416 {"ftruncate64", __NR_ftruncate64},
417#endif
418#endif
419#ifdef SYS_futex
420#ifdef __NR_futex
421 {"futex", __NR_futex},
422#endif
423#endif
424#ifdef SYS_futimesat
425#ifdef __NR_futimesat
426 {"futimesat", __NR_futimesat},
427#endif
428#endif
429#ifdef SYS_get_kernel_syms
430#ifdef __NR_get_kernel_syms
431 {"get_kernel_syms", __NR_get_kernel_syms},
432#endif
433#endif
434#ifdef SYS_get_mempolicy
435#ifdef __NR_get_mempolicy
436 {"get_mempolicy", __NR_get_mempolicy},
437#endif
438#endif
439#ifdef SYS_get_robust_list
440#ifdef __NR_get_robust_list
441 {"get_robust_list", __NR_get_robust_list},
442#endif
443#endif
444#ifdef SYS_get_thread_area
445#ifdef __NR_get_thread_area
446 {"get_thread_area", __NR_get_thread_area},
447#endif
448#endif
449#ifdef SYS_getcpu
450#ifdef __NR_getcpu
451 {"getcpu", __NR_getcpu},
452#endif
453#endif
454#ifdef SYS_getcwd
455#ifdef __NR_getcwd
456 {"getcwd", __NR_getcwd},
457#endif
458#endif
459#ifdef SYS_getdents
460#ifdef __NR_getdents
461 {"getdents", __NR_getdents},
462#endif
463#endif
464#ifdef SYS_getdents64
465#ifdef __NR_getdents64
466 {"getdents64", __NR_getdents64},
467#endif
468#endif
469#ifdef SYS_getegid
470#ifdef __NR_getegid
471 {"getegid", __NR_getegid},
472#endif
473#endif
474#ifdef SYS_getegid32
475#ifdef __NR_getegid32
476 {"getegid32", __NR_getegid32},
477#endif
478#endif
479#ifdef SYS_geteuid
480#ifdef __NR_geteuid
481 {"geteuid", __NR_geteuid},
482#endif
483#endif
484#ifdef SYS_geteuid32
485#ifdef __NR_geteuid32
486 {"geteuid32", __NR_geteuid32},
487#endif
488#endif
489#ifdef SYS_getgid
490#ifdef __NR_getgid
491 {"getgid", __NR_getgid},
492#endif
493#endif
494#ifdef SYS_getgid32
495#ifdef __NR_getgid32
496 {"getgid32", __NR_getgid32},
497#endif
498#endif
499#ifdef SYS_getgroups
500#ifdef __NR_getgroups
501 {"getgroups", __NR_getgroups},
502#endif
503#endif
504#ifdef SYS_getgroups32
505#ifdef __NR_getgroups32
506 {"getgroups32", __NR_getgroups32},
507#endif
508#endif
509#ifdef SYS_getitimer
510#ifdef __NR_getitimer
511 {"getitimer", __NR_getitimer},
512#endif
513#endif
514#ifdef SYS_getpeername
515#ifdef __NR_getpeername
516 {"getpeername", __NR_getpeername},
517#endif
518#endif
519#ifdef SYS_getpgid
520#ifdef __NR_getpgid
521 {"getpgid", __NR_getpgid},
522#endif
523#endif
524#ifdef SYS_getpgrp
525#ifdef __NR_getpgrp
526 {"getpgrp", __NR_getpgrp},
527#endif
528#endif
529#ifdef SYS_getpid
530#ifdef __NR_getpid
531 {"getpid", __NR_getpid},
532#endif
533#endif
534#ifdef SYS_getpmsg
535#ifdef __NR_getpmsg
536 {"getpmsg", __NR_getpmsg},
537#endif
538#endif
539#ifdef SYS_getppid
540#ifdef __NR_getppid
541 {"getppid", __NR_getppid},
542#endif
543#endif
544#ifdef SYS_getpriority
545#ifdef __NR_getpriority
546 {"getpriority", __NR_getpriority},
547#endif
548#endif
549#ifdef SYS_getrandom
550#ifdef __NR_getrandom
551 {"getrandom", __NR_getrandom},
552#endif
553#endif
554#ifdef SYS_getresgid
555#ifdef __NR_getresgid
556 {"getresgid", __NR_getresgid},
557#endif
558#endif
559#ifdef SYS_getresgid32
560#ifdef __NR_getresgid32
561 {"getresgid32", __NR_getresgid32},
562#endif
563#endif
564#ifdef SYS_getresuid
565#ifdef __NR_getresuid
566 {"getresuid", __NR_getresuid},
567#endif
568#endif
569#ifdef SYS_getresuid32
570#ifdef __NR_getresuid32
571 {"getresuid32", __NR_getresuid32},
572#endif
573#endif
574#ifdef SYS_getrlimit
575#ifdef __NR_getrlimit
576 {"getrlimit", __NR_getrlimit},
577#endif
578#endif
579#ifdef SYS_getrusage
580#ifdef __NR_getrusage
581 {"getrusage", __NR_getrusage},
582#endif
583#endif
584#ifdef SYS_getsid
585#ifdef __NR_getsid
586 {"getsid", __NR_getsid},
587#endif
588#endif
589#ifdef SYS_getsockname
590#ifdef __NR_getsockname
591 {"getsockname", __NR_getsockname},
592#endif
593#endif
594#ifdef SYS_getsockopt
595#ifdef __NR_getsockopt
596 {"getsockopt", __NR_getsockopt},
597#endif
598#endif
599#ifdef SYS_gettid
600#ifdef __NR_gettid
601 {"gettid", __NR_gettid},
602#endif
603#endif
604#ifdef SYS_gettimeofday
605#ifdef __NR_gettimeofday
606 {"gettimeofday", __NR_gettimeofday},
607#endif
608#endif
609#ifdef SYS_getuid
610#ifdef __NR_getuid
611 {"getuid", __NR_getuid},
612#endif
613#endif
614#ifdef SYS_getuid32
615#ifdef __NR_getuid32
616 {"getuid32", __NR_getuid32},
617#endif
618#endif
619#ifdef SYS_getxattr
620#ifdef __NR_getxattr
621 {"getxattr", __NR_getxattr},
622#endif
623#endif
624#ifdef SYS_gtty
625#ifdef __NR_gtty
626 {"gtty", __NR_gtty},
627#endif
628#endif
629#ifdef SYS_idle
630#ifdef __NR_idle
631 {"idle", __NR_idle},
632#endif
633#endif
634#ifdef SYS_init_module
635#ifdef __NR_init_module
636 {"init_module", __NR_init_module},
637#endif
638#endif
639#ifdef SYS_inotify_add_watch
640#ifdef __NR_inotify_add_watch
641 {"inotify_add_watch", __NR_inotify_add_watch},
642#endif
643#endif
644#ifdef SYS_inotify_init
645#ifdef __NR_inotify_init
646 {"inotify_init", __NR_inotify_init},
647#endif
648#endif
649#ifdef SYS_inotify_init1
650#ifdef __NR_inotify_init1
651 {"inotify_init1", __NR_inotify_init1},
652#endif
653#endif
654#ifdef SYS_inotify_rm_watch
655#ifdef __NR_inotify_rm_watch
656 {"inotify_rm_watch", __NR_inotify_rm_watch},
657#endif
658#endif
659#ifdef SYS_io_cancel
660#ifdef __NR_io_cancel
661 {"io_cancel", __NR_io_cancel},
662#endif
663#endif
664#ifdef SYS_io_destroy
665#ifdef __NR_io_destroy
666 {"io_destroy", __NR_io_destroy},
667#endif
668#endif
669#ifdef SYS_io_getevents
670#ifdef __NR_io_getevents
671 {"io_getevents", __NR_io_getevents},
672#endif
673#endif
674#ifdef SYS_io_setup
675#ifdef __NR_io_setup
676 {"io_setup", __NR_io_setup},
677#endif
678#endif
679#ifdef SYS_io_submit
680#ifdef __NR_io_submit
681 {"io_submit", __NR_io_submit},
682#endif
683#endif
684#ifdef SYS_ioctl
685#ifdef __NR_ioctl
686 {"ioctl", __NR_ioctl},
687#endif
688#endif
689#ifdef SYS_ioperm
690#ifdef __NR_ioperm
691 {"ioperm", __NR_ioperm},
692#endif
693#endif
694#ifdef SYS_iopl
695#ifdef __NR_iopl
696 {"iopl", __NR_iopl},
697#endif
698#endif
699#ifdef SYS_ioprio_get
700#ifdef __NR_ioprio_get
701 {"ioprio_get", __NR_ioprio_get},
702#endif
703#endif
704#ifdef SYS_ioprio_set
705#ifdef __NR_ioprio_set
706 {"ioprio_set", __NR_ioprio_set},
707#endif
708#endif
709#ifdef SYS_ipc
710#ifdef __NR_ipc
711 {"ipc", __NR_ipc},
712#endif
713#endif
714#ifdef SYS_kcmp
715#ifdef __NR_kcmp
716 {"kcmp", __NR_kcmp},
717#endif
718#endif
719#ifdef SYS_kexec_load
720#ifdef __NR_kexec_load
721 {"kexec_load", __NR_kexec_load},
722#endif
723#endif
724#ifdef SYS_keyctl
725#ifdef __NR_keyctl
726 {"keyctl", __NR_keyctl},
727#endif
728#endif
729#ifdef SYS_kill
730#ifdef __NR_kill
731 {"kill", __NR_kill},
732#endif
733#endif
734#ifdef SYS_lchown
735#ifdef __NR_lchown
736 {"lchown", __NR_lchown},
737#endif
738#endif
739#ifdef SYS_lchown32
740#ifdef __NR_lchown32
741 {"lchown32", __NR_lchown32},
742#endif
743#endif
744#ifdef SYS_lgetxattr
745#ifdef __NR_lgetxattr
746 {"lgetxattr", __NR_lgetxattr},
747#endif
748#endif
749#ifdef SYS_link
750#ifdef __NR_link
751 {"link", __NR_link},
752#endif
753#endif
754#ifdef SYS_linkat
755#ifdef __NR_linkat
756 {"linkat", __NR_linkat},
757#endif
758#endif
759#ifdef SYS_listen
760#ifdef __NR_listen
761 {"listen", __NR_listen},
762#endif
763#endif
764#ifdef SYS_listxattr
765#ifdef __NR_listxattr
766 {"listxattr", __NR_listxattr},
767#endif
768#endif
769#ifdef SYS_llistxattr
770#ifdef __NR_llistxattr
771 {"llistxattr", __NR_llistxattr},
772#endif
773#endif
774#ifdef SYS_lock
775#ifdef __NR_lock
776 {"lock", __NR_lock},
777#endif
778#endif
779#ifdef SYS_lookup_dcookie
780#ifdef __NR_lookup_dcookie
781 {"lookup_dcookie", __NR_lookup_dcookie},
782#endif
783#endif
784#ifdef SYS_lremovexattr
785#ifdef __NR_lremovexattr
786 {"lremovexattr", __NR_lremovexattr},
787#endif
788#endif
789#ifdef SYS_lseek
790#ifdef __NR_lseek
791 {"lseek", __NR_lseek},
792#endif
793#endif
794#ifdef SYS_lsetxattr
795#ifdef __NR_lsetxattr
796 {"lsetxattr", __NR_lsetxattr},
797#endif
798#endif
799#ifdef SYS_lstat
800#ifdef __NR_lstat
801 {"lstat", __NR_lstat},
802#endif
803#endif
804#ifdef SYS_lstat64
805#ifdef __NR_lstat64
806 {"lstat64", __NR_lstat64},
807#endif
808#endif
809#ifdef SYS_madvise
810#ifdef __NR_madvise
811 {"madvise", __NR_madvise},
812#endif
813#endif
814#ifdef SYS_mbind
815#ifdef __NR_mbind
816 {"mbind", __NR_mbind},
817#endif
818#endif
819#ifdef SYS_membarrier
820#ifdef __NR_membarrier
821 {"membarrier", __NR_membarrier},
822#endif
823#endif
824#ifdef SYS_memfd_create
825#ifdef __NR_memfd_create
826 {"memfd_create", __NR_memfd_create},
827#endif
828#endif
829#ifdef SYS_migrate_pages
830#ifdef __NR_migrate_pages
831 {"migrate_pages", __NR_migrate_pages},
832#endif
833#endif
834#ifdef SYS_mincore
835#ifdef __NR_mincore
836 {"mincore", __NR_mincore},
837#endif
838#endif
839#ifdef SYS_mkdir
840#ifdef __NR_mkdir
841 {"mkdir", __NR_mkdir},
842#endif
843#endif
844#ifdef SYS_mkdirat
845#ifdef __NR_mkdirat
846 {"mkdirat", __NR_mkdirat},
847#endif
848#endif
849#ifdef SYS_mknod
850#ifdef __NR_mknod
851 {"mknod", __NR_mknod},
852#endif
853#endif
854#ifdef SYS_mknodat
855#ifdef __NR_mknodat
856 {"mknodat", __NR_mknodat},
857#endif
858#endif
859#ifdef SYS_mlock
860#ifdef __NR_mlock
861 {"mlock", __NR_mlock},
862#endif
863#endif
864#ifdef SYS_mlock2
865#ifdef __NR_mlock2
866 {"mlock2", __NR_mlock2},
867#endif
868#endif
869#ifdef SYS_mlockall
870#ifdef __NR_mlockall
871 {"mlockall", __NR_mlockall},
872#endif
873#endif
874#ifdef SYS_mmap
875#ifdef __NR_mmap
876 {"mmap", __NR_mmap},
877#endif
878#endif
879#ifdef SYS_mmap2
880#ifdef __NR_mmap2
881 {"mmap2", __NR_mmap2},
882#endif
883#endif
884#ifdef SYS_modify_ldt
885#ifdef __NR_modify_ldt
886 {"modify_ldt", __NR_modify_ldt},
887#endif
888#endif
889#ifdef SYS_mount
890#ifdef __NR_mount
891 {"mount", __NR_mount},
892#endif
893#endif
894#ifdef SYS_move_pages
895#ifdef __NR_move_pages
896 {"move_pages", __NR_move_pages},
897#endif
898#endif
899#ifdef SYS_mprotect
900#ifdef __NR_mprotect
901 {"mprotect", __NR_mprotect},
902#endif
903#endif
904#ifdef SYS_mpx
905#ifdef __NR_mpx
906 {"mpx", __NR_mpx},
907#endif
908#endif
909#ifdef SYS_mq_getsetattr
910#ifdef __NR_mq_getsetattr
911 {"mq_getsetattr", __NR_mq_getsetattr},
912#endif
913#endif
914#ifdef SYS_mq_notify
915#ifdef __NR_mq_notify
916 {"mq_notify", __NR_mq_notify},
917#endif
918#endif
919#ifdef SYS_mq_open
920#ifdef __NR_mq_open
921 {"mq_open", __NR_mq_open},
922#endif
923#endif
924#ifdef SYS_mq_timedreceive
925#ifdef __NR_mq_timedreceive
926 {"mq_timedreceive", __NR_mq_timedreceive},
927#endif
928#endif
929#ifdef SYS_mq_timedsend
930#ifdef __NR_mq_timedsend
931 {"mq_timedsend", __NR_mq_timedsend},
932#endif
933#endif
934#ifdef SYS_mq_unlink
935#ifdef __NR_mq_unlink
936 {"mq_unlink", __NR_mq_unlink},
937#endif
938#endif
939#ifdef SYS_mremap
940#ifdef __NR_mremap
941 {"mremap", __NR_mremap},
942#endif
943#endif
944#ifdef SYS_msync
945#ifdef __NR_msync
946 {"msync", __NR_msync},
947#endif
948#endif
949#ifdef SYS_munlock
950#ifdef __NR_munlock
951 {"munlock", __NR_munlock},
952#endif
953#endif
954#ifdef SYS_munlockall
955#ifdef __NR_munlockall
956 {"munlockall", __NR_munlockall},
957#endif
958#endif
959#ifdef SYS_munmap
960#ifdef __NR_munmap
961 {"munmap", __NR_munmap},
962#endif
963#endif
964#ifdef SYS_name_to_handle_at
965#ifdef __NR_name_to_handle_at
966 {"name_to_handle_at", __NR_name_to_handle_at},
967#endif
968#endif
969#ifdef SYS_nanosleep
970#ifdef __NR_nanosleep
971 {"nanosleep", __NR_nanosleep},
972#endif
973#endif
974#ifdef SYS_nfsservctl
975#ifdef __NR_nfsservctl
976 {"nfsservctl", __NR_nfsservctl},
977#endif
978#endif
979#ifdef SYS_nice
980#ifdef __NR_nice
981 {"nice", __NR_nice},
982#endif
983#endif
984#ifdef SYS_oldfstat
985#ifdef __NR_oldfstat
986 {"oldfstat", __NR_oldfstat},
987#endif
988#endif
989#ifdef SYS_oldlstat
990#ifdef __NR_oldlstat
991 {"oldlstat", __NR_oldlstat},
992#endif
993#endif
994#ifdef SYS_oldolduname
995#ifdef __NR_oldolduname
996 {"oldolduname", __NR_oldolduname},
997#endif
998#endif
999#ifdef SYS_oldstat
1000#ifdef __NR_oldstat
1001 {"oldstat", __NR_oldstat},
1002#endif
1003#endif
1004#ifdef SYS_olduname
1005#ifdef __NR_olduname
1006 {"olduname", __NR_olduname},
1007#endif
1008#endif
1009#ifdef SYS_open
1010#ifdef __NR_open
1011 {"open", __NR_open},
1012#endif
1013#endif
1014#ifdef SYS_open_by_handle_at
1015#ifdef __NR_open_by_handle_at
1016 {"open_by_handle_at", __NR_open_by_handle_at},
1017#endif
1018#endif
1019#ifdef SYS_openat
1020#ifdef __NR_openat
1021 {"openat", __NR_openat},
1022#endif
1023#endif
1024#ifdef SYS_pause
1025#ifdef __NR_pause
1026 {"pause", __NR_pause},
1027#endif
1028#endif
1029#ifdef SYS_perf_event_open
1030#ifdef __NR_perf_event_open
1031 {"perf_event_open", __NR_perf_event_open},
1032#endif
1033#endif
1034#ifdef SYS_personality
1035#ifdef __NR_personality
1036 {"personality", __NR_personality},
1037#endif
1038#endif
1039#ifdef SYS_pipe
1040#ifdef __NR_pipe
1041 {"pipe", __NR_pipe},
1042#endif
1043#endif
1044#ifdef SYS_pipe2
1045#ifdef __NR_pipe2
1046 {"pipe2", __NR_pipe2},
1047#endif
1048#endif
1049#ifdef SYS_pivot_root
1050#ifdef __NR_pivot_root
1051 {"pivot_root", __NR_pivot_root},
1052#endif
1053#endif
1054#ifdef SYS_poll
1055#ifdef __NR_poll
1056 {"poll", __NR_poll},
1057#endif
1058#endif
1059#ifdef SYS_ppoll
1060#ifdef __NR_ppoll
1061 {"ppoll", __NR_ppoll},
1062#endif
1063#endif
1064#ifdef SYS_prctl
1065#ifdef __NR_prctl
1066 {"prctl", __NR_prctl},
1067#endif
1068#endif
1069#ifdef SYS_pread64
1070#ifdef __NR_pread64
1071 {"pread64", __NR_pread64},
1072#endif
1073#endif
1074#ifdef SYS_preadv
1075#ifdef __NR_preadv
1076 {"preadv", __NR_preadv},
1077#endif
1078#endif
1079#ifdef SYS_preadv2
1080#ifdef __NR_preadv2
1081 {"preadv2", __NR_preadv2},
1082#endif
1083#endif
1084#ifdef SYS_prlimit64
1085#ifdef __NR_prlimit64
1086 {"prlimit64", __NR_prlimit64},
1087#endif
1088#endif
1089#ifdef SYS_process_vm_readv
1090#ifdef __NR_process_vm_readv
1091 {"process_vm_readv", __NR_process_vm_readv},
1092#endif
1093#endif
1094#ifdef SYS_process_vm_writev
1095#ifdef __NR_process_vm_writev
1096 {"process_vm_writev", __NR_process_vm_writev},
1097#endif
1098#endif
1099#ifdef SYS_prof
1100#ifdef __NR_prof
1101 {"prof", __NR_prof},
1102#endif
1103#endif
1104#ifdef SYS_profil
1105#ifdef __NR_profil
1106 {"profil", __NR_profil},
1107#endif
1108#endif
1109#ifdef SYS_pselect6
1110#ifdef __NR_pselect6
1111 {"pselect6", __NR_pselect6},
1112#endif
1113#endif
1114#ifdef SYS_ptrace
1115#ifdef __NR_ptrace
1116 {"ptrace", __NR_ptrace},
1117#endif
1118#endif
1119#ifdef SYS_putpmsg
1120#ifdef __NR_putpmsg
1121 {"putpmsg", __NR_putpmsg},
1122#endif
1123#endif
1124#ifdef SYS_pwrite64
1125#ifdef __NR_pwrite64
1126 {"pwrite64", __NR_pwrite64},
1127#endif
1128#endif
1129#ifdef SYS_pwritev
1130#ifdef __NR_pwritev
1131 {"pwritev", __NR_pwritev},
1132#endif
1133#endif
1134#ifdef SYS_pwritev2
1135#ifdef __NR_pwritev2
1136 {"pwritev2", __NR_pwritev2},
1137#endif
1138#endif
1139#ifdef SYS_query_module
1140#ifdef __NR_query_module
1141 {"query_module", __NR_query_module},
1142#endif
1143#endif
1144#ifdef SYS_quotactl
1145#ifdef __NR_quotactl
1146 {"quotactl", __NR_quotactl},
1147#endif
1148#endif
1149#ifdef SYS_read
1150#ifdef __NR_read
1151 {"read", __NR_read},
1152#endif
1153#endif
1154#ifdef SYS_readahead
1155#ifdef __NR_readahead
1156 {"readahead", __NR_readahead},
1157#endif
1158#endif
1159#ifdef SYS_readdir
1160#ifdef __NR_readdir
1161 {"readdir", __NR_readdir},
1162#endif
1163#endif
1164#ifdef SYS_readlink
1165#ifdef __NR_readlink
1166 {"readlink", __NR_readlink},
1167#endif
1168#endif
1169#ifdef SYS_readlinkat
1170#ifdef __NR_readlinkat
1171 {"readlinkat", __NR_readlinkat},
1172#endif
1173#endif
1174#ifdef SYS_readv
1175#ifdef __NR_readv
1176 {"readv", __NR_readv},
1177#endif
1178#endif
1179#ifdef SYS_reboot
1180#ifdef __NR_reboot
1181 {"reboot", __NR_reboot},
1182#endif
1183#endif
1184#ifdef SYS_recvfrom
1185#ifdef __NR_recvfrom
1186 {"recvfrom", __NR_recvfrom},
1187#endif
1188#endif
1189#ifdef SYS_recvmmsg
1190#ifdef __NR_recvmmsg
1191 {"recvmmsg", __NR_recvmmsg},
1192#endif
1193#endif
1194#ifdef SYS_recvmsg
1195#ifdef __NR_recvmsg
1196 {"recvmsg", __NR_recvmsg},
1197#endif
1198#endif
1199#ifdef SYS_remap_file_pages
1200#ifdef __NR_remap_file_pages
1201 {"remap_file_pages", __NR_remap_file_pages},
1202#endif
1203#endif
1204#ifdef SYS_removexattr
1205#ifdef __NR_removexattr
1206 {"removexattr", __NR_removexattr},
1207#endif
1208#endif
1209#ifdef SYS_rename
1210#ifdef __NR_rename
1211 {"rename", __NR_rename},
1212#endif
1213#endif
1214#ifdef SYS_renameat
1215#ifdef __NR_renameat
1216 {"renameat", __NR_renameat},
1217#endif
1218#endif
1219#ifdef SYS_renameat2
1220#ifdef __NR_renameat2
1221 {"renameat2", __NR_renameat2},
1222#endif
1223#endif
1224#ifdef SYS_request_key
1225#ifdef __NR_request_key
1226 {"request_key", __NR_request_key},
1227#endif
1228#endif
1229#ifdef SYS_restart_syscall
1230#ifdef __NR_restart_syscall
1231 {"restart_syscall", __NR_restart_syscall},
1232#endif
1233#endif
1234#ifdef SYS_rmdir
1235#ifdef __NR_rmdir
1236 {"rmdir", __NR_rmdir},
1237#endif
1238#endif
1239#ifdef SYS_rt_sigaction
1240#ifdef __NR_rt_sigaction
1241 {"rt_sigaction", __NR_rt_sigaction},
1242#endif
1243#endif
1244#ifdef SYS_rt_sigpending
1245#ifdef __NR_rt_sigpending
1246 {"rt_sigpending", __NR_rt_sigpending},
1247#endif
1248#endif
1249#ifdef SYS_rt_sigprocmask
1250#ifdef __NR_rt_sigprocmask
1251 {"rt_sigprocmask", __NR_rt_sigprocmask},
1252#endif
1253#endif
1254#ifdef SYS_rt_sigqueueinfo
1255#ifdef __NR_rt_sigqueueinfo
1256 {"rt_sigqueueinfo", __NR_rt_sigqueueinfo},
1257#endif
1258#endif
1259#ifdef SYS_rt_sigreturn
1260#ifdef __NR_rt_sigreturn
1261 {"rt_sigreturn", __NR_rt_sigreturn},
1262#endif
1263#endif
1264#ifdef SYS_rt_sigsuspend
1265#ifdef __NR_rt_sigsuspend
1266 {"rt_sigsuspend", __NR_rt_sigsuspend},
1267#endif
1268#endif
1269#ifdef SYS_rt_sigtimedwait
1270#ifdef __NR_rt_sigtimedwait
1271 {"rt_sigtimedwait", __NR_rt_sigtimedwait},
1272#endif
1273#endif
1274#ifdef SYS_rt_tgsigqueueinfo
1275#ifdef __NR_rt_tgsigqueueinfo
1276 {"rt_tgsigqueueinfo", __NR_rt_tgsigqueueinfo},
1277#endif
1278#endif
1279#ifdef SYS_sched_get_priority_max
1280#ifdef __NR_sched_get_priority_max
1281 {"sched_get_priority_max", __NR_sched_get_priority_max},
1282#endif
1283#endif
1284#ifdef SYS_sched_get_priority_min
1285#ifdef __NR_sched_get_priority_min
1286 {"sched_get_priority_min", __NR_sched_get_priority_min},
1287#endif
1288#endif
1289#ifdef SYS_sched_getaffinity
1290#ifdef __NR_sched_getaffinity
1291 {"sched_getaffinity", __NR_sched_getaffinity},
1292#endif
1293#endif
1294#ifdef SYS_sched_getattr
1295#ifdef __NR_sched_getattr
1296 {"sched_getattr", __NR_sched_getattr},
1297#endif
1298#endif
1299#ifdef SYS_sched_getparam
1300#ifdef __NR_sched_getparam
1301 {"sched_getparam", __NR_sched_getparam},
1302#endif
1303#endif
1304#ifdef SYS_sched_getscheduler
1305#ifdef __NR_sched_getscheduler
1306 {"sched_getscheduler", __NR_sched_getscheduler},
1307#endif
1308#endif
1309#ifdef SYS_sched_rr_get_interval
1310#ifdef __NR_sched_rr_get_interval
1311 {"sched_rr_get_interval", __NR_sched_rr_get_interval},
1312#endif
1313#endif
1314#ifdef SYS_sched_setaffinity
1315#ifdef __NR_sched_setaffinity
1316 {"sched_setaffinity", __NR_sched_setaffinity},
1317#endif
1318#endif
1319#ifdef SYS_sched_setattr
1320#ifdef __NR_sched_setattr
1321 {"sched_setattr", __NR_sched_setattr},
1322#endif
1323#endif
1324#ifdef SYS_sched_setparam
1325#ifdef __NR_sched_setparam
1326 {"sched_setparam", __NR_sched_setparam},
1327#endif
1328#endif
1329#ifdef SYS_sched_setscheduler
1330#ifdef __NR_sched_setscheduler
1331 {"sched_setscheduler", __NR_sched_setscheduler},
1332#endif
1333#endif
1334#ifdef SYS_sched_yield
1335#ifdef __NR_sched_yield
1336 {"sched_yield", __NR_sched_yield},
1337#endif
1338#endif
1339#ifdef SYS_seccomp
1340#ifdef __NR_seccomp
1341 {"seccomp", __NR_seccomp},
1342#endif
1343#endif
1344#ifdef SYS_select
1345#ifdef __NR_select
1346 {"select", __NR_select},
1347#endif
1348#endif
1349#ifdef SYS_sendfile
1350#ifdef __NR_sendfile
1351 {"sendfile", __NR_sendfile},
1352#endif
1353#endif
1354#ifdef SYS_sendfile64
1355#ifdef __NR_sendfile64
1356 {"sendfile64", __NR_sendfile64},
1357#endif
1358#endif
1359#ifdef SYS_sendmmsg
1360#ifdef __NR_sendmmsg
1361 {"sendmmsg", __NR_sendmmsg},
1362#endif
1363#endif
1364#ifdef SYS_sendmsg
1365#ifdef __NR_sendmsg
1366 {"sendmsg", __NR_sendmsg},
1367#endif
1368#endif
1369#ifdef SYS_sendto
1370#ifdef __NR_sendto
1371 {"sendto", __NR_sendto},
1372#endif
1373#endif
1374#ifdef SYS_set_mempolicy
1375#ifdef __NR_set_mempolicy
1376 {"set_mempolicy", __NR_set_mempolicy},
1377#endif
1378#endif
1379#ifdef SYS_set_robust_list
1380#ifdef __NR_set_robust_list
1381 {"set_robust_list", __NR_set_robust_list},
1382#endif
1383#endif
1384#ifdef SYS_set_thread_area
1385#ifdef __NR_set_thread_area
1386 {"set_thread_area", __NR_set_thread_area},
1387#endif
1388#endif
1389#ifdef SYS_set_tid_address
1390#ifdef __NR_set_tid_address
1391 {"set_tid_address", __NR_set_tid_address},
1392#endif
1393#endif
1394#ifdef SYS_setdomainname
1395#ifdef __NR_setdomainname
1396 {"setdomainname", __NR_setdomainname},
1397#endif
1398#endif
1399#ifdef SYS_setfsgid
1400#ifdef __NR_setfsgid
1401 {"setfsgid", __NR_setfsgid},
1402#endif
1403#endif
1404#ifdef SYS_setfsgid32
1405#ifdef __NR_setfsgid32
1406 {"setfsgid32", __NR_setfsgid32},
1407#endif
1408#endif
1409#ifdef SYS_setfsuid
1410#ifdef __NR_setfsuid
1411 {"setfsuid", __NR_setfsuid},
1412#endif
1413#endif
1414#ifdef SYS_setfsuid32
1415#ifdef __NR_setfsuid32
1416 {"setfsuid32", __NR_setfsuid32},
1417#endif
1418#endif
1419#ifdef SYS_setgid
1420#ifdef __NR_setgid
1421 {"setgid", __NR_setgid},
1422#endif
1423#endif
1424#ifdef SYS_setgid32
1425#ifdef __NR_setgid32
1426 {"setgid32", __NR_setgid32},
1427#endif
1428#endif
1429#ifdef SYS_setgroups
1430#ifdef __NR_setgroups
1431 {"setgroups", __NR_setgroups},
1432#endif
1433#endif
1434#ifdef SYS_setgroups32
1435#ifdef __NR_setgroups32
1436 {"setgroups32", __NR_setgroups32},
1437#endif
1438#endif
1439#ifdef SYS_sethostname
1440#ifdef __NR_sethostname
1441 {"sethostname", __NR_sethostname},
1442#endif
1443#endif
1444#ifdef SYS_setitimer
1445#ifdef __NR_setitimer
1446 {"setitimer", __NR_setitimer},
1447#endif
1448#endif
1449#ifdef SYS_setns
1450#ifdef __NR_setns
1451 {"setns", __NR_setns},
1452#endif
1453#endif
1454#ifdef SYS_setpgid
1455#ifdef __NR_setpgid
1456 {"setpgid", __NR_setpgid},
1457#endif
1458#endif
1459#ifdef SYS_setpriority
1460#ifdef __NR_setpriority
1461 {"setpriority", __NR_setpriority},
1462#endif
1463#endif
1464#ifdef SYS_setregid
1465#ifdef __NR_setregid
1466 {"setregid", __NR_setregid},
1467#endif
1468#endif
1469#ifdef SYS_setregid32
1470#ifdef __NR_setregid32
1471 {"setregid32", __NR_setregid32},
1472#endif
1473#endif
1474#ifdef SYS_setresgid
1475#ifdef __NR_setresgid
1476 {"setresgid", __NR_setresgid},
1477#endif
1478#endif
1479#ifdef SYS_setresgid32
1480#ifdef __NR_setresgid32
1481 {"setresgid32", __NR_setresgid32},
1482#endif
1483#endif
1484#ifdef SYS_setresuid
1485#ifdef __NR_setresuid
1486 {"setresuid", __NR_setresuid},
1487#endif
1488#endif
1489#ifdef SYS_setresuid32
1490#ifdef __NR_setresuid32
1491 {"setresuid32", __NR_setresuid32},
1492#endif
1493#endif
1494#ifdef SYS_setreuid
1495#ifdef __NR_setreuid
1496 {"setreuid", __NR_setreuid},
1497#endif
1498#endif
1499#ifdef SYS_setreuid32
1500#ifdef __NR_setreuid32
1501 {"setreuid32", __NR_setreuid32},
1502#endif
1503#endif
1504#ifdef SYS_setrlimit
1505#ifdef __NR_setrlimit
1506 {"setrlimit", __NR_setrlimit},
1507#endif
1508#endif
1509#ifdef SYS_setsid
1510#ifdef __NR_setsid
1511 {"setsid", __NR_setsid},
1512#endif
1513#endif
1514#ifdef SYS_setsockopt
1515#ifdef __NR_setsockopt
1516 {"setsockopt", __NR_setsockopt},
1517#endif
1518#endif
1519#ifdef SYS_settimeofday
1520#ifdef __NR_settimeofday
1521 {"settimeofday", __NR_settimeofday},
1522#endif
1523#endif
1524#ifdef SYS_setuid
1525#ifdef __NR_setuid
1526 {"setuid", __NR_setuid},
1527#endif
1528#endif
1529#ifdef SYS_setuid32
1530#ifdef __NR_setuid32
1531 {"setuid32", __NR_setuid32},
1532#endif
1533#endif
1534#ifdef SYS_setxattr
1535#ifdef __NR_setxattr
1536 {"setxattr", __NR_setxattr},
1537#endif
1538#endif
1539#ifdef SYS_sgetmask
1540#ifdef __NR_sgetmask
1541 {"sgetmask", __NR_sgetmask},
1542#endif
1543#endif
1544#ifdef SYS_shutdown
1545#ifdef __NR_shutdown
1546 {"shutdown", __NR_shutdown},
1547#endif
1548#endif
1549#ifdef SYS_sigaction
1550#ifdef __NR_sigaction
1551 {"sigaction", __NR_sigaction},
1552#endif
1553#endif
1554#ifdef SYS_sigaltstack
1555#ifdef __NR_sigaltstack
1556 {"sigaltstack", __NR_sigaltstack},
1557#endif
1558#endif
1559#ifdef SYS_signal
1560#ifdef __NR_signal
1561 {"signal", __NR_signal},
1562#endif
1563#endif
1564#ifdef SYS_signalfd
1565#ifdef __NR_signalfd
1566 {"signalfd", __NR_signalfd},
1567#endif
1568#endif
1569#ifdef SYS_signalfd4
1570#ifdef __NR_signalfd4
1571 {"signalfd4", __NR_signalfd4},
1572#endif
1573#endif
1574#ifdef SYS_sigpending
1575#ifdef __NR_sigpending
1576 {"sigpending", __NR_sigpending},
1577#endif
1578#endif
1579#ifdef SYS_sigprocmask
1580#ifdef __NR_sigprocmask
1581 {"sigprocmask", __NR_sigprocmask},
1582#endif
1583#endif
1584#ifdef SYS_sigreturn
1585#ifdef __NR_sigreturn
1586 {"sigreturn", __NR_sigreturn},
1587#endif
1588#endif
1589#ifdef SYS_sigsuspend
1590#ifdef __NR_sigsuspend
1591 {"sigsuspend", __NR_sigsuspend},
1592#endif
1593#endif
1594#ifdef SYS_socket
1595#ifdef __NR_socket
1596 {"socket", __NR_socket},
1597#endif
1598#endif
1599#ifdef SYS_socketcall
1600#ifdef __NR_socketcall
1601 {"socketcall", __NR_socketcall},
1602#endif
1603#endif
1604#ifdef SYS_socketpair
1605#ifdef __NR_socketpair
1606 {"socketpair", __NR_socketpair},
1607#endif
1608#endif
1609#ifdef SYS_splice
1610#ifdef __NR_splice
1611 {"splice", __NR_splice},
1612#endif
1613#endif
1614#ifdef SYS_ssetmask
1615#ifdef __NR_ssetmask
1616 {"ssetmask", __NR_ssetmask},
1617#endif
1618#endif
1619#ifdef SYS_stat
1620#ifdef __NR_stat
1621 {"stat", __NR_stat},
1622#endif
1623#endif
1624#ifdef SYS_stat64
1625#ifdef __NR_stat64
1626 {"stat64", __NR_stat64},
1627#endif
1628#endif
1629#ifdef SYS_statfs
1630#ifdef __NR_statfs
1631 {"statfs", __NR_statfs},
1632#endif
1633#endif
1634#ifdef SYS_statfs64
1635#ifdef __NR_statfs64
1636 {"statfs64", __NR_statfs64},
1637#endif
1638#endif
1639#ifdef SYS_stime
1640#ifdef __NR_stime
1641 {"stime", __NR_stime},
1642#endif
1643#endif
1644#ifdef SYS_stty
1645#ifdef __NR_stty
1646 {"stty", __NR_stty},
1647#endif
1648#endif
1649#ifdef SYS_swapoff
1650#ifdef __NR_swapoff
1651 {"swapoff", __NR_swapoff},
1652#endif
1653#endif
1654#ifdef SYS_swapon
1655#ifdef __NR_swapon
1656 {"swapon", __NR_swapon},
1657#endif
1658#endif
1659#ifdef SYS_symlink
1660#ifdef __NR_symlink
1661 {"symlink", __NR_symlink},
1662#endif
1663#endif
1664#ifdef SYS_symlinkat
1665#ifdef __NR_symlinkat
1666 {"symlinkat", __NR_symlinkat},
1667#endif
1668#endif
1669#ifdef SYS_sync
1670#ifdef __NR_sync
1671 {"sync", __NR_sync},
1672#endif
1673#endif
1674#ifdef SYS_sync_file_range
1675#ifdef __NR_sync_file_range
1676 {"sync_file_range", __NR_sync_file_range},
1677#endif
1678#endif
1679#ifdef SYS_syncfs
1680#ifdef __NR_syncfs
1681 {"syncfs", __NR_syncfs},
1682#endif
1683#endif
1684#ifdef SYS_sysfs
1685#ifdef __NR_sysfs
1686 {"sysfs", __NR_sysfs},
1687#endif
1688#endif
1689#ifdef SYS_sysinfo
1690#ifdef __NR_sysinfo
1691 {"sysinfo", __NR_sysinfo},
1692#endif
1693#endif
1694#ifdef SYS_syslog
1695#ifdef __NR_syslog
1696 {"syslog", __NR_syslog},
1697#endif
1698#endif
1699#ifdef SYS_tee
1700#ifdef __NR_tee
1701 {"tee", __NR_tee},
1702#endif
1703#endif
1704#ifdef SYS_tgkill
1705#ifdef __NR_tgkill
1706 {"tgkill", __NR_tgkill},
1707#endif
1708#endif
1709#ifdef SYS_time
1710#ifdef __NR_time
1711 {"time", __NR_time},
1712#endif
1713#endif
1714#ifdef SYS_timer_create
1715#ifdef __NR_timer_create
1716 {"timer_create", __NR_timer_create},
1717#endif
1718#endif
1719#ifdef SYS_timer_delete
1720#ifdef __NR_timer_delete
1721 {"timer_delete", __NR_timer_delete},
1722#endif
1723#endif
1724#ifdef SYS_timer_getoverrun
1725#ifdef __NR_timer_getoverrun
1726 {"timer_getoverrun", __NR_timer_getoverrun},
1727#endif
1728#endif
1729#ifdef SYS_timer_gettime
1730#ifdef __NR_timer_gettime
1731 {"timer_gettime", __NR_timer_gettime},
1732#endif
1733#endif
1734#ifdef SYS_timer_settime
1735#ifdef __NR_timer_settime
1736 {"timer_settime", __NR_timer_settime},
1737#endif
1738#endif
1739#ifdef SYS_timerfd_create
1740#ifdef __NR_timerfd_create
1741 {"timerfd_create", __NR_timerfd_create},
1742#endif
1743#endif
1744#ifdef SYS_timerfd_gettime
1745#ifdef __NR_timerfd_gettime
1746 {"timerfd_gettime", __NR_timerfd_gettime},
1747#endif
1748#endif
1749#ifdef SYS_timerfd_settime
1750#ifdef __NR_timerfd_settime
1751 {"timerfd_settime", __NR_timerfd_settime},
1752#endif
1753#endif
1754#ifdef SYS_times
1755#ifdef __NR_times
1756 {"times", __NR_times},
1757#endif
1758#endif
1759#ifdef SYS_tkill
1760#ifdef __NR_tkill
1761 {"tkill", __NR_tkill},
1762#endif
1763#endif
1764#ifdef SYS_truncate
1765#ifdef __NR_truncate
1766 {"truncate", __NR_truncate},
1767#endif
1768#endif
1769#ifdef SYS_truncate64
1770#ifdef __NR_truncate64
1771 {"truncate64", __NR_truncate64},
1772#endif
1773#endif
1774#ifdef SYS_ugetrlimit
1775#ifdef __NR_ugetrlimit
1776 {"ugetrlimit", __NR_ugetrlimit},
1777#endif
1778#endif
1779#ifdef SYS_ulimit
1780#ifdef __NR_ulimit
1781 {"ulimit", __NR_ulimit},
1782#endif
1783#endif
1784#ifdef SYS_umask
1785#ifdef __NR_umask
1786 {"umask", __NR_umask},
1787#endif
1788#endif
1789#ifdef SYS_umount
1790#ifdef __NR_umount
1791 {"umount", __NR_umount},
1792#endif
1793#endif
1794#ifdef SYS_umount2
1795#ifdef __NR_umount2
1796 {"umount2", __NR_umount2},
1797#endif
1798#endif
1799#ifdef SYS_uname
1800#ifdef __NR_uname
1801 {"uname", __NR_uname},
1802#endif
1803#endif
1804#ifdef SYS_unlink
1805#ifdef __NR_unlink
1806 {"unlink", __NR_unlink},
1807#endif
1808#endif
1809#ifdef SYS_unlinkat
1810#ifdef __NR_unlinkat
1811 {"unlinkat", __NR_unlinkat},
1812#endif
1813#endif
1814#ifdef SYS_unshare
1815#ifdef __NR_unshare
1816 {"unshare", __NR_unshare},
1817#endif
1818#endif
1819#ifdef SYS_uselib
1820#ifdef __NR_uselib
1821 {"uselib", __NR_uselib},
1822#endif
1823#endif
1824#ifdef SYS_userfaultfd
1825#ifdef __NR_userfaultfd
1826 {"userfaultfd", __NR_userfaultfd},
1827#endif
1828#endif
1829#ifdef SYS_ustat
1830#ifdef __NR_ustat
1831 {"ustat", __NR_ustat},
1832#endif
1833#endif
1834#ifdef SYS_utime
1835#ifdef __NR_utime
1836 {"utime", __NR_utime},
1837#endif
1838#endif
1839#ifdef SYS_utimensat
1840#ifdef __NR_utimensat
1841 {"utimensat", __NR_utimensat},
1842#endif
1843#endif
1844#ifdef SYS_utimes
1845#ifdef __NR_utimes
1846 {"utimes", __NR_utimes},
1847#endif
1848#endif
1849#ifdef SYS_vfork
1850#ifdef __NR_vfork
1851 {"vfork", __NR_vfork},
1852#endif
1853#endif
1854#ifdef SYS_vhangup
1855#ifdef __NR_vhangup
1856 {"vhangup", __NR_vhangup},
1857#endif
1858#endif
1859#ifdef SYS_vm86
1860#ifdef __NR_vm86
1861 {"vm86", __NR_vm86},
1862#endif
1863#endif
1864#ifdef SYS_vm86old
1865#ifdef __NR_vm86old
1866 {"vm86old", __NR_vm86old},
1867#endif
1868#endif
1869#ifdef SYS_vmsplice
1870#ifdef __NR_vmsplice
1871 {"vmsplice", __NR_vmsplice},
1872#endif
1873#endif
1874#ifdef SYS_vserver
1875#ifdef __NR_vserver
1876 {"vserver", __NR_vserver},
1877#endif
1878#endif
1879#ifdef SYS_wait4
1880#ifdef __NR_wait4
1881 {"wait4", __NR_wait4},
1882#endif
1883#endif
1884#ifdef SYS_waitid
1885#ifdef __NR_waitid
1886 {"waitid", __NR_waitid},
1887#endif
1888#endif
1889#ifdef SYS_waitpid
1890#ifdef __NR_waitpid
1891 {"waitpid", __NR_waitpid},
1892#endif
1893#endif
1894#ifdef SYS_write
1895#ifdef __NR_write
1896 {"write", __NR_write},
1897#endif
1898#endif
1899#ifdef SYS_writev
1900#ifdef __NR_writev
1901 {"writev", __NR_writev},
1902#endif
1903#endif
1904#endif
1905//#endif
1906#if defined __x86_64__ && defined __LP64__
1907#ifdef SYS__sysctl
1908#ifdef __NR__sysctl
1909 {"_sysctl", __NR__sysctl},
1910#endif
1911#endif
1912#ifdef SYS_accept
1913#ifdef __NR_accept
1914 {"accept", __NR_accept},
1915#endif
1916#endif
1917#ifdef SYS_accept4
1918#ifdef __NR_accept4
1919 {"accept4", __NR_accept4},
1920#endif
1921#endif
1922#ifdef SYS_access
1923#ifdef __NR_access
1924 {"access", __NR_access},
1925#endif
1926#endif
1927#ifdef SYS_acct
1928#ifdef __NR_acct
1929 {"acct", __NR_acct},
1930#endif
1931#endif
1932#ifdef SYS_add_key
1933#ifdef __NR_add_key
1934 {"add_key", __NR_add_key},
1935#endif
1936#endif
1937#ifdef SYS_adjtimex
1938#ifdef __NR_adjtimex
1939 {"adjtimex", __NR_adjtimex},
1940#endif
1941#endif
1942#ifdef SYS_afs_syscall
1943#ifdef __NR_afs_syscall
1944 {"afs_syscall", __NR_afs_syscall},
1945#endif
1946#endif
1947#ifdef SYS_alarm
1948#ifdef __NR_alarm
1949 {"alarm", __NR_alarm},
1950#endif
1951#endif
1952#ifdef SYS_arch_prctl
1953#ifdef __NR_arch_prctl
1954 {"arch_prctl", __NR_arch_prctl},
1955#endif
1956#endif
1957#ifdef SYS_bind
1958#ifdef __NR_bind
1959 {"bind", __NR_bind},
1960#endif
1961#endif
1962#ifdef SYS_bpf
1963#ifdef __NR_bpf
1964 {"bpf", __NR_bpf},
1965#endif
1966#endif
1967#ifdef SYS_brk
1968#ifdef __NR_brk
1969 {"brk", __NR_brk},
1970#endif
1971#endif
1972#ifdef SYS_capget
1973#ifdef __NR_capget
1974 {"capget", __NR_capget},
1975#endif
1976#endif
1977#ifdef SYS_capset
1978#ifdef __NR_capset
1979 {"capset", __NR_capset},
1980#endif
1981#endif
1982#ifdef SYS_chdir
1983#ifdef __NR_chdir
1984 {"chdir", __NR_chdir},
1985#endif
1986#endif
1987#ifdef SYS_chmod
1988#ifdef __NR_chmod
1989 {"chmod", __NR_chmod},
1990#endif
1991#endif
1992#ifdef SYS_chown
1993#ifdef __NR_chown
1994 {"chown", __NR_chown},
1995#endif
1996#endif
1997#ifdef SYS_chroot
1998#ifdef __NR_chroot
1999 {"chroot", __NR_chroot},
2000#endif
2001#endif
2002#ifdef SYS_clock_adjtime
2003#ifdef __NR_clock_adjtime
2004 {"clock_adjtime", __NR_clock_adjtime},
2005#endif
2006#endif
2007#ifdef SYS_clock_getres
2008#ifdef __NR_clock_getres
2009 {"clock_getres", __NR_clock_getres},
2010#endif
2011#endif
2012#ifdef SYS_clock_gettime
2013#ifdef __NR_clock_gettime
2014 {"clock_gettime", __NR_clock_gettime},
2015#endif
2016#endif
2017#ifdef SYS_clock_nanosleep
2018#ifdef __NR_clock_nanosleep
2019 {"clock_nanosleep", __NR_clock_nanosleep},
2020#endif
2021#endif
2022#ifdef SYS_clock_settime
2023#ifdef __NR_clock_settime
2024 {"clock_settime", __NR_clock_settime},
2025#endif
2026#endif
2027#ifdef SYS_clone
2028#ifdef __NR_clone
2029 {"clone", __NR_clone},
2030#endif
2031#endif
2032#ifdef SYS_close
2033#ifdef __NR_close
2034 {"close", __NR_close},
2035#endif
2036#endif
2037#ifdef SYS_connect
2038#ifdef __NR_connect
2039 {"connect", __NR_connect},
2040#endif
2041#endif
2042#ifdef SYS_copy_file_range
2043#ifdef __NR_copy_file_range
2044 {"copy_file_range", __NR_copy_file_range},
2045#endif
2046#endif
2047#ifdef SYS_creat
2048#ifdef __NR_creat
2049 {"creat", __NR_creat},
2050#endif
2051#endif
2052#ifdef SYS_create_module
2053#ifdef __NR_create_module
2054 {"create_module", __NR_create_module},
2055#endif
2056#endif
2057#ifdef SYS_delete_module
2058#ifdef __NR_delete_module
2059 {"delete_module", __NR_delete_module},
2060#endif
2061#endif
2062#ifdef SYS_dup
2063#ifdef __NR_dup
2064 {"dup", __NR_dup},
2065#endif
2066#endif
2067#ifdef SYS_dup2
2068#ifdef __NR_dup2
2069 {"dup2", __NR_dup2},
2070#endif
2071#endif
2072#ifdef SYS_dup3
2073#ifdef __NR_dup3
2074 {"dup3", __NR_dup3},
2075#endif
2076#endif
2077#ifdef SYS_epoll_create
2078#ifdef __NR_epoll_create
2079 {"epoll_create", __NR_epoll_create},
2080#endif
2081#endif
2082#ifdef SYS_epoll_create1
2083#ifdef __NR_epoll_create1
2084 {"epoll_create1", __NR_epoll_create1},
2085#endif
2086#endif
2087#ifdef SYS_epoll_ctl
2088#ifdef __NR_epoll_ctl
2089 {"epoll_ctl", __NR_epoll_ctl},
2090#endif
2091#endif
2092#ifdef SYS_epoll_ctl_old
2093#ifdef __NR_epoll_ctl_old
2094 {"epoll_ctl_old", __NR_epoll_ctl_old},
2095#endif
2096#endif
2097#ifdef SYS_epoll_pwait
2098#ifdef __NR_epoll_pwait
2099 {"epoll_pwait", __NR_epoll_pwait},
2100#endif
2101#endif
2102#ifdef SYS_epoll_wait
2103#ifdef __NR_epoll_wait
2104 {"epoll_wait", __NR_epoll_wait},
2105#endif
2106#endif
2107#ifdef SYS_epoll_wait_old
2108#ifdef __NR_epoll_wait_old
2109 {"epoll_wait_old", __NR_epoll_wait_old},
2110#endif
2111#endif
2112#ifdef SYS_eventfd
2113#ifdef __NR_eventfd
2114 {"eventfd", __NR_eventfd},
2115#endif
2116#endif
2117#ifdef SYS_eventfd2
2118#ifdef __NR_eventfd2
2119 {"eventfd2", __NR_eventfd2},
2120#endif
2121#endif
2122#ifdef SYS_execve
2123#ifdef __NR_execve
2124 {"execve", __NR_execve},
2125#endif
2126#endif
2127#ifdef SYS_execveat
2128#ifdef __NR_execveat
2129 {"execveat", __NR_execveat},
2130#endif
2131#endif
2132#ifdef SYS_exit
2133#ifdef __NR_exit
2134 {"exit", __NR_exit},
2135#endif
2136#endif
2137#ifdef SYS_exit_group
2138#ifdef __NR_exit_group
2139 {"exit_group", __NR_exit_group},
2140#endif
2141#endif
2142#ifdef SYS_faccessat
2143#ifdef __NR_faccessat
2144 {"faccessat", __NR_faccessat},
2145#endif
2146#endif
2147#ifdef SYS_fadvise64
2148#ifdef __NR_fadvise64
2149 {"fadvise64", __NR_fadvise64},
2150#endif
2151#endif
2152#ifdef SYS_fallocate
2153#ifdef __NR_fallocate
2154 {"fallocate", __NR_fallocate},
2155#endif
2156#endif
2157#ifdef SYS_fanotify_init
2158#ifdef __NR_fanotify_init
2159 {"fanotify_init", __NR_fanotify_init},
2160#endif
2161#endif
2162#ifdef SYS_fanotify_mark
2163#ifdef __NR_fanotify_mark
2164 {"fanotify_mark", __NR_fanotify_mark},
2165#endif
2166#endif
2167#ifdef SYS_fchdir
2168#ifdef __NR_fchdir
2169 {"fchdir", __NR_fchdir},
2170#endif
2171#endif
2172#ifdef SYS_fchmod
2173#ifdef __NR_fchmod
2174 {"fchmod", __NR_fchmod},
2175#endif
2176#endif
2177#ifdef SYS_fchmodat
2178#ifdef __NR_fchmodat
2179 {"fchmodat", __NR_fchmodat},
2180#endif
2181#endif
2182#ifdef SYS_fchown
2183#ifdef __NR_fchown
2184 {"fchown", __NR_fchown},
2185#endif
2186#endif
2187#ifdef SYS_fchownat
2188#ifdef __NR_fchownat
2189 {"fchownat", __NR_fchownat},
2190#endif
2191#endif
2192#ifdef SYS_fcntl
2193#ifdef __NR_fcntl
2194 {"fcntl", __NR_fcntl},
2195#endif
2196#endif
2197#ifdef SYS_fdatasync
2198#ifdef __NR_fdatasync
2199 {"fdatasync", __NR_fdatasync},
2200#endif
2201#endif
2202#ifdef SYS_fgetxattr
2203#ifdef __NR_fgetxattr
2204 {"fgetxattr", __NR_fgetxattr},
2205#endif
2206#endif
2207#ifdef SYS_finit_module
2208#ifdef __NR_finit_module
2209 {"finit_module", __NR_finit_module},
2210#endif
2211#endif
2212#ifdef SYS_flistxattr
2213#ifdef __NR_flistxattr
2214 {"flistxattr", __NR_flistxattr},
2215#endif
2216#endif
2217#ifdef SYS_flock
2218#ifdef __NR_flock
2219 {"flock", __NR_flock},
2220#endif
2221#endif
2222#ifdef SYS_fork
2223#ifdef __NR_fork
2224 {"fork", __NR_fork},
2225#endif
2226#endif
2227#ifdef SYS_fremovexattr
2228#ifdef __NR_fremovexattr
2229 {"fremovexattr", __NR_fremovexattr},
2230#endif
2231#endif
2232#ifdef SYS_fsetxattr
2233#ifdef __NR_fsetxattr
2234 {"fsetxattr", __NR_fsetxattr},
2235#endif
2236#endif
2237#ifdef SYS_fstat
2238#ifdef __NR_fstat
2239 {"fstat", __NR_fstat},
2240#endif
2241#endif
2242#ifdef SYS_fstatfs
2243#ifdef __NR_fstatfs
2244 {"fstatfs", __NR_fstatfs},
2245#endif
2246#endif
2247#ifdef SYS_fsync
2248#ifdef __NR_fsync
2249 {"fsync", __NR_fsync},
2250#endif
2251#endif
2252#ifdef SYS_ftruncate
2253#ifdef __NR_ftruncate
2254 {"ftruncate", __NR_ftruncate},
2255#endif
2256#endif
2257#ifdef SYS_futex
2258#ifdef __NR_futex
2259 {"futex", __NR_futex},
2260#endif
2261#endif
2262#ifdef SYS_futimesat
2263#ifdef __NR_futimesat
2264 {"futimesat", __NR_futimesat},
2265#endif
2266#endif
2267#ifdef SYS_get_kernel_syms
2268#ifdef __NR_get_kernel_syms
2269 {"get_kernel_syms", __NR_get_kernel_syms},
2270#endif
2271#endif
2272#ifdef SYS_get_mempolicy
2273#ifdef __NR_get_mempolicy
2274 {"get_mempolicy", __NR_get_mempolicy},
2275#endif
2276#endif
2277#ifdef SYS_get_robust_list
2278#ifdef __NR_get_robust_list
2279 {"get_robust_list", __NR_get_robust_list},
2280#endif
2281#endif
2282#ifdef SYS_get_thread_area
2283#ifdef __NR_get_thread_area
2284 {"get_thread_area", __NR_get_thread_area},
2285#endif
2286#endif
2287#ifdef SYS_getcpu
2288#ifdef __NR_getcpu
2289 {"getcpu", __NR_getcpu},
2290#endif
2291#endif
2292#ifdef SYS_getcwd
2293#ifdef __NR_getcwd
2294 {"getcwd", __NR_getcwd},
2295#endif
2296#endif
2297#ifdef SYS_getdents
2298#ifdef __NR_getdents
2299 {"getdents", __NR_getdents},
2300#endif
2301#endif
2302#ifdef SYS_getdents64
2303#ifdef __NR_getdents64
2304 {"getdents64", __NR_getdents64},
2305#endif
2306#endif
2307#ifdef SYS_getegid
2308#ifdef __NR_getegid
2309 {"getegid", __NR_getegid},
2310#endif
2311#endif
2312#ifdef SYS_geteuid
2313#ifdef __NR_geteuid
2314 {"geteuid", __NR_geteuid},
2315#endif
2316#endif
2317#ifdef SYS_getgid
2318#ifdef __NR_getgid
2319 {"getgid", __NR_getgid},
2320#endif
2321#endif
2322#ifdef SYS_getgroups
2323#ifdef __NR_getgroups
2324 {"getgroups", __NR_getgroups},
2325#endif
2326#endif
2327#ifdef SYS_getitimer
2328#ifdef __NR_getitimer
2329 {"getitimer", __NR_getitimer},
2330#endif
2331#endif
2332#ifdef SYS_getpeername
2333#ifdef __NR_getpeername
2334 {"getpeername", __NR_getpeername},
2335#endif
2336#endif
2337#ifdef SYS_getpgid
2338#ifdef __NR_getpgid
2339 {"getpgid", __NR_getpgid},
2340#endif
2341#endif
2342#ifdef SYS_getpgrp
2343#ifdef __NR_getpgrp
2344 {"getpgrp", __NR_getpgrp},
2345#endif
2346#endif
2347#ifdef SYS_getpid
2348#ifdef __NR_getpid
2349 {"getpid", __NR_getpid},
2350#endif
2351#endif
2352#ifdef SYS_getpmsg
2353#ifdef __NR_getpmsg
2354 {"getpmsg", __NR_getpmsg},
2355#endif
2356#endif
2357#ifdef SYS_getppid
2358#ifdef __NR_getppid
2359 {"getppid", __NR_getppid},
2360#endif
2361#endif
2362#ifdef SYS_getpriority
2363#ifdef __NR_getpriority
2364 {"getpriority", __NR_getpriority},
2365#endif
2366#endif
2367#ifdef SYS_getrandom
2368#ifdef __NR_getrandom
2369 {"getrandom", __NR_getrandom},
2370#endif
2371#endif
2372#ifdef SYS_getresgid
2373#ifdef __NR_getresgid
2374 {"getresgid", __NR_getresgid},
2375#endif
2376#endif
2377#ifdef SYS_getresuid
2378#ifdef __NR_getresuid
2379 {"getresuid", __NR_getresuid},
2380#endif
2381#endif
2382#ifdef SYS_getrlimit
2383#ifdef __NR_getrlimit
2384 {"getrlimit", __NR_getrlimit},
2385#endif
2386#endif
2387#ifdef SYS_getrusage
2388#ifdef __NR_getrusage
2389 {"getrusage", __NR_getrusage},
2390#endif
2391#endif
2392#ifdef SYS_getsid
2393#ifdef __NR_getsid
2394 {"getsid", __NR_getsid},
2395#endif
2396#endif
2397#ifdef SYS_getsockname
2398#ifdef __NR_getsockname
2399 {"getsockname", __NR_getsockname},
2400#endif
2401#endif
2402#ifdef SYS_getsockopt
2403#ifdef __NR_getsockopt
2404 {"getsockopt", __NR_getsockopt},
2405#endif
2406#endif
2407#ifdef SYS_gettid
2408#ifdef __NR_gettid
2409 {"gettid", __NR_gettid},
2410#endif
2411#endif
2412#ifdef SYS_gettimeofday
2413#ifdef __NR_gettimeofday
2414 {"gettimeofday", __NR_gettimeofday},
2415#endif
2416#endif
2417#ifdef SYS_getuid
2418#ifdef __NR_getuid
2419 {"getuid", __NR_getuid},
2420#endif
2421#endif
2422#ifdef SYS_getxattr
2423#ifdef __NR_getxattr
2424 {"getxattr", __NR_getxattr},
2425#endif
2426#endif
2427#ifdef SYS_init_module
2428#ifdef __NR_init_module
2429 {"init_module", __NR_init_module},
2430#endif
2431#endif
2432#ifdef SYS_inotify_add_watch
2433#ifdef __NR_inotify_add_watch
2434 {"inotify_add_watch", __NR_inotify_add_watch},
2435#endif
2436#endif
2437#ifdef SYS_inotify_init
2438#ifdef __NR_inotify_init
2439 {"inotify_init", __NR_inotify_init},
2440#endif
2441#endif
2442#ifdef SYS_inotify_init1
2443#ifdef __NR_inotify_init1
2444 {"inotify_init1", __NR_inotify_init1},
2445#endif
2446#endif
2447#ifdef SYS_inotify_rm_watch
2448#ifdef __NR_inotify_rm_watch
2449 {"inotify_rm_watch", __NR_inotify_rm_watch},
2450#endif
2451#endif
2452#ifdef SYS_io_cancel
2453#ifdef __NR_io_cancel
2454 {"io_cancel", __NR_io_cancel},
2455#endif
2456#endif
2457#ifdef SYS_io_destroy
2458#ifdef __NR_io_destroy
2459 {"io_destroy", __NR_io_destroy},
2460#endif
2461#endif
2462#ifdef SYS_io_getevents
2463#ifdef __NR_io_getevents
2464 {"io_getevents", __NR_io_getevents},
2465#endif
2466#endif
2467#ifdef SYS_io_setup
2468#ifdef __NR_io_setup
2469 {"io_setup", __NR_io_setup},
2470#endif
2471#endif
2472#ifdef SYS_io_submit
2473#ifdef __NR_io_submit
2474 {"io_submit", __NR_io_submit},
2475#endif
2476#endif
2477#ifdef SYS_ioctl
2478#ifdef __NR_ioctl
2479 {"ioctl", __NR_ioctl},
2480#endif
2481#endif
2482#ifdef SYS_ioperm
2483#ifdef __NR_ioperm
2484 {"ioperm", __NR_ioperm},
2485#endif
2486#endif
2487#ifdef SYS_iopl
2488#ifdef __NR_iopl
2489 {"iopl", __NR_iopl},
2490#endif
2491#endif
2492#ifdef SYS_ioprio_get
2493#ifdef __NR_ioprio_get
2494 {"ioprio_get", __NR_ioprio_get},
2495#endif
2496#endif
2497#ifdef SYS_ioprio_set
2498#ifdef __NR_ioprio_set
2499 {"ioprio_set", __NR_ioprio_set},
2500#endif
2501#endif
2502#ifdef SYS_kcmp
2503#ifdef __NR_kcmp
2504 {"kcmp", __NR_kcmp},
2505#endif
2506#endif
2507#ifdef SYS_kexec_file_load
2508#ifdef __NR_kexec_file_load
2509 {"kexec_file_load", __NR_kexec_file_load},
2510#endif
2511#endif
2512#ifdef SYS_kexec_load
2513#ifdef __NR_kexec_load
2514 {"kexec_load", __NR_kexec_load},
2515#endif
2516#endif
2517#ifdef SYS_keyctl
2518#ifdef __NR_keyctl
2519 {"keyctl", __NR_keyctl},
2520#endif
2521#endif
2522#ifdef SYS_kill
2523#ifdef __NR_kill
2524 {"kill", __NR_kill},
2525#endif
2526#endif
2527#ifdef SYS_lchown
2528#ifdef __NR_lchown
2529 {"lchown", __NR_lchown},
2530#endif
2531#endif
2532#ifdef SYS_lgetxattr
2533#ifdef __NR_lgetxattr
2534 {"lgetxattr", __NR_lgetxattr},
2535#endif
2536#endif
2537#ifdef SYS_link
2538#ifdef __NR_link
2539 {"link", __NR_link},
2540#endif
2541#endif
2542#ifdef SYS_linkat
2543#ifdef __NR_linkat
2544 {"linkat", __NR_linkat},
2545#endif
2546#endif
2547#ifdef SYS_listen
2548#ifdef __NR_listen
2549 {"listen", __NR_listen},
2550#endif
2551#endif
2552#ifdef SYS_listxattr
2553#ifdef __NR_listxattr
2554 {"listxattr", __NR_listxattr},
2555#endif
2556#endif
2557#ifdef SYS_llistxattr
2558#ifdef __NR_llistxattr
2559 {"llistxattr", __NR_llistxattr},
2560#endif
2561#endif
2562#ifdef SYS_lookup_dcookie
2563#ifdef __NR_lookup_dcookie
2564 {"lookup_dcookie", __NR_lookup_dcookie},
2565#endif
2566#endif
2567#ifdef SYS_lremovexattr
2568#ifdef __NR_lremovexattr
2569 {"lremovexattr", __NR_lremovexattr},
2570#endif
2571#endif
2572#ifdef SYS_lseek
2573#ifdef __NR_lseek
2574 {"lseek", __NR_lseek},
2575#endif
2576#endif
2577#ifdef SYS_lsetxattr
2578#ifdef __NR_lsetxattr
2579 {"lsetxattr", __NR_lsetxattr},
2580#endif
2581#endif
2582#ifdef SYS_lstat
2583#ifdef __NR_lstat
2584 {"lstat", __NR_lstat},
2585#endif
2586#endif
2587#ifdef SYS_madvise
2588#ifdef __NR_madvise
2589 {"madvise", __NR_madvise},
2590#endif
2591#endif
2592#ifdef SYS_mbind
2593#ifdef __NR_mbind
2594 {"mbind", __NR_mbind},
2595#endif
2596#endif
2597#ifdef SYS_membarrier
2598#ifdef __NR_membarrier
2599 {"membarrier", __NR_membarrier},
2600#endif
2601#endif
2602#ifdef SYS_memfd_create
2603#ifdef __NR_memfd_create
2604 {"memfd_create", __NR_memfd_create},
2605#endif
2606#endif
2607#ifdef SYS_migrate_pages
2608#ifdef __NR_migrate_pages
2609 {"migrate_pages", __NR_migrate_pages},
2610#endif
2611#endif
2612#ifdef SYS_mincore
2613#ifdef __NR_mincore
2614 {"mincore", __NR_mincore},
2615#endif
2616#endif
2617#ifdef SYS_mkdir
2618#ifdef __NR_mkdir
2619 {"mkdir", __NR_mkdir},
2620#endif
2621#endif
2622#ifdef SYS_mkdirat
2623#ifdef __NR_mkdirat
2624 {"mkdirat", __NR_mkdirat},
2625#endif
2626#endif
2627#ifdef SYS_mknod
2628#ifdef __NR_mknod
2629 {"mknod", __NR_mknod},
2630#endif
2631#endif
2632#ifdef SYS_mknodat
2633#ifdef __NR_mknodat
2634 {"mknodat", __NR_mknodat},
2635#endif
2636#endif
2637#ifdef SYS_mlock
2638#ifdef __NR_mlock
2639 {"mlock", __NR_mlock},
2640#endif
2641#endif
2642#ifdef SYS_mlock2
2643#ifdef __NR_mlock2
2644 {"mlock2", __NR_mlock2},
2645#endif
2646#endif
2647#ifdef SYS_mlockall
2648#ifdef __NR_mlockall
2649 {"mlockall", __NR_mlockall},
2650#endif
2651#endif
2652#ifdef SYS_mmap
2653#ifdef __NR_mmap
2654 {"mmap", __NR_mmap},
2655#endif
2656#endif
2657#ifdef SYS_modify_ldt
2658#ifdef __NR_modify_ldt
2659 {"modify_ldt", __NR_modify_ldt},
2660#endif
2661#endif
2662#ifdef SYS_mount
2663#ifdef __NR_mount
2664 {"mount", __NR_mount},
2665#endif
2666#endif
2667#ifdef SYS_move_pages
2668#ifdef __NR_move_pages
2669 {"move_pages", __NR_move_pages},
2670#endif
2671#endif
2672#ifdef SYS_mprotect
2673#ifdef __NR_mprotect
2674 {"mprotect", __NR_mprotect},
2675#endif
2676#endif
2677#ifdef SYS_mq_getsetattr
2678#ifdef __NR_mq_getsetattr
2679 {"mq_getsetattr", __NR_mq_getsetattr},
2680#endif
2681#endif
2682#ifdef SYS_mq_notify
2683#ifdef __NR_mq_notify
2684 {"mq_notify", __NR_mq_notify},
2685#endif
2686#endif
2687#ifdef SYS_mq_open
2688#ifdef __NR_mq_open
2689 {"mq_open", __NR_mq_open},
2690#endif
2691#endif
2692#ifdef SYS_mq_timedreceive
2693#ifdef __NR_mq_timedreceive
2694 {"mq_timedreceive", __NR_mq_timedreceive},
2695#endif
2696#endif
2697#ifdef SYS_mq_timedsend
2698#ifdef __NR_mq_timedsend
2699 {"mq_timedsend", __NR_mq_timedsend},
2700#endif
2701#endif
2702#ifdef SYS_mq_unlink
2703#ifdef __NR_mq_unlink
2704 {"mq_unlink", __NR_mq_unlink},
2705#endif
2706#endif
2707#ifdef SYS_mremap
2708#ifdef __NR_mremap
2709 {"mremap", __NR_mremap},
2710#endif
2711#endif
2712#ifdef SYS_msgctl
2713#ifdef __NR_msgctl
2714 {"msgctl", __NR_msgctl},
2715#endif
2716#endif
2717#ifdef SYS_msgget
2718#ifdef __NR_msgget
2719 {"msgget", __NR_msgget},
2720#endif
2721#endif
2722#ifdef SYS_msgrcv
2723#ifdef __NR_msgrcv
2724 {"msgrcv", __NR_msgrcv},
2725#endif
2726#endif
2727#ifdef SYS_msgsnd
2728#ifdef __NR_msgsnd
2729 {"msgsnd", __NR_msgsnd},
2730#endif
2731#endif
2732#ifdef SYS_msync
2733#ifdef __NR_msync
2734 {"msync", __NR_msync},
2735#endif
2736#endif
2737#ifdef SYS_munlock
2738#ifdef __NR_munlock
2739 {"munlock", __NR_munlock},
2740#endif
2741#endif
2742#ifdef SYS_munlockall
2743#ifdef __NR_munlockall
2744 {"munlockall", __NR_munlockall},
2745#endif
2746#endif
2747#ifdef SYS_munmap
2748#ifdef __NR_munmap
2749 {"munmap", __NR_munmap},
2750#endif
2751#endif
2752#ifdef SYS_name_to_handle_at
2753#ifdef __NR_name_to_handle_at
2754 {"name_to_handle_at", __NR_name_to_handle_at},
2755#endif
2756#endif
2757#ifdef SYS_nanosleep
2758#ifdef __NR_nanosleep
2759 {"nanosleep", __NR_nanosleep},
2760#endif
2761#endif
2762#ifdef SYS_newfstatat
2763#ifdef __NR_newfstatat
2764 {"newfstatat", __NR_newfstatat},
2765#endif
2766#endif
2767#ifdef SYS_nfsservctl
2768#ifdef __NR_nfsservctl
2769 {"nfsservctl", __NR_nfsservctl},
2770#endif
2771#endif
2772#ifdef SYS_open
2773#ifdef __NR_open
2774 {"open", __NR_open},
2775#endif
2776#endif
2777#ifdef SYS_open_by_handle_at
2778#ifdef __NR_open_by_handle_at
2779 {"open_by_handle_at", __NR_open_by_handle_at},
2780#endif
2781#endif
2782#ifdef SYS_openat
2783#ifdef __NR_openat
2784 {"openat", __NR_openat},
2785#endif
2786#endif
2787#ifdef SYS_pause
2788#ifdef __NR_pause
2789 {"pause", __NR_pause},
2790#endif
2791#endif
2792#ifdef SYS_perf_event_open
2793#ifdef __NR_perf_event_open
2794 {"perf_event_open", __NR_perf_event_open},
2795#endif
2796#endif
2797#ifdef SYS_personality
2798#ifdef __NR_personality
2799 {"personality", __NR_personality},
2800#endif
2801#endif
2802#ifdef SYS_pipe
2803#ifdef __NR_pipe
2804 {"pipe", __NR_pipe},
2805#endif
2806#endif
2807#ifdef SYS_pipe2
2808#ifdef __NR_pipe2
2809 {"pipe2", __NR_pipe2},
2810#endif
2811#endif
2812#ifdef SYS_pivot_root
2813#ifdef __NR_pivot_root
2814 {"pivot_root", __NR_pivot_root},
2815#endif
2816#endif
2817#ifdef SYS_poll
2818#ifdef __NR_poll
2819 {"poll", __NR_poll},
2820#endif
2821#endif
2822#ifdef SYS_ppoll
2823#ifdef __NR_ppoll
2824 {"ppoll", __NR_ppoll},
2825#endif
2826#endif
2827#ifdef SYS_prctl
2828#ifdef __NR_prctl
2829 {"prctl", __NR_prctl},
2830#endif
2831#endif
2832#ifdef SYS_pread64
2833#ifdef __NR_pread64
2834 {"pread64", __NR_pread64},
2835#endif
2836#endif
2837#ifdef SYS_preadv
2838#ifdef __NR_preadv
2839 {"preadv", __NR_preadv},
2840#endif
2841#endif
2842#ifdef SYS_preadv2
2843#ifdef __NR_preadv2
2844 {"preadv2", __NR_preadv2},
2845#endif
2846#endif
2847#ifdef SYS_prlimit64
2848#ifdef __NR_prlimit64
2849 {"prlimit64", __NR_prlimit64},
2850#endif
2851#endif
2852#ifdef SYS_process_vm_readv
2853#ifdef __NR_process_vm_readv
2854 {"process_vm_readv", __NR_process_vm_readv},
2855#endif
2856#endif
2857#ifdef SYS_process_vm_writev
2858#ifdef __NR_process_vm_writev
2859 {"process_vm_writev", __NR_process_vm_writev},
2860#endif
2861#endif
2862#ifdef SYS_pselect6
2863#ifdef __NR_pselect6
2864 {"pselect6", __NR_pselect6},
2865#endif
2866#endif
2867#ifdef SYS_ptrace
2868#ifdef __NR_ptrace
2869 {"ptrace", __NR_ptrace},
2870#endif
2871#endif
2872#ifdef SYS_putpmsg
2873#ifdef __NR_putpmsg
2874 {"putpmsg", __NR_putpmsg},
2875#endif
2876#endif
2877#ifdef SYS_pwrite64
2878#ifdef __NR_pwrite64
2879 {"pwrite64", __NR_pwrite64},
2880#endif
2881#endif
2882#ifdef SYS_pwritev
2883#ifdef __NR_pwritev
2884 {"pwritev", __NR_pwritev},
2885#endif
2886#endif
2887#ifdef SYS_pwritev2
2888#ifdef __NR_pwritev2
2889 {"pwritev2", __NR_pwritev2},
2890#endif
2891#endif
2892#ifdef SYS_query_module
2893#ifdef __NR_query_module
2894 {"query_module", __NR_query_module},
2895#endif
2896#endif
2897#ifdef SYS_quotactl
2898#ifdef __NR_quotactl
2899 {"quotactl", __NR_quotactl},
2900#endif
2901#endif
2902#ifdef SYS_read
2903#ifdef __NR_read
2904 {"read", __NR_read},
2905#endif
2906#endif
2907#ifdef SYS_readahead
2908#ifdef __NR_readahead
2909 {"readahead", __NR_readahead},
2910#endif
2911#endif
2912#ifdef SYS_readlink
2913#ifdef __NR_readlink
2914 {"readlink", __NR_readlink},
2915#endif
2916#endif
2917#ifdef SYS_readlinkat
2918#ifdef __NR_readlinkat
2919 {"readlinkat", __NR_readlinkat},
2920#endif
2921#endif
2922#ifdef SYS_readv
2923#ifdef __NR_readv
2924 {"readv", __NR_readv},
2925#endif
2926#endif
2927#ifdef SYS_reboot
2928#ifdef __NR_reboot
2929 {"reboot", __NR_reboot},
2930#endif
2931#endif
2932#ifdef SYS_recvfrom
2933#ifdef __NR_recvfrom
2934 {"recvfrom", __NR_recvfrom},
2935#endif
2936#endif
2937#ifdef SYS_recvmmsg
2938#ifdef __NR_recvmmsg
2939 {"recvmmsg", __NR_recvmmsg},
2940#endif
2941#endif
2942#ifdef SYS_recvmsg
2943#ifdef __NR_recvmsg
2944 {"recvmsg", __NR_recvmsg},
2945#endif
2946#endif
2947#ifdef SYS_remap_file_pages
2948#ifdef __NR_remap_file_pages
2949 {"remap_file_pages", __NR_remap_file_pages},
2950#endif
2951#endif
2952#ifdef SYS_removexattr
2953#ifdef __NR_removexattr
2954 {"removexattr", __NR_removexattr},
2955#endif
2956#endif
2957#ifdef SYS_rename
2958#ifdef __NR_rename
2959 {"rename", __NR_rename},
2960#endif
2961#endif
2962#ifdef SYS_renameat
2963#ifdef __NR_renameat
2964 {"renameat", __NR_renameat},
2965#endif
2966#endif
2967#ifdef SYS_renameat2
2968#ifdef __NR_renameat2
2969 {"renameat2", __NR_renameat2},
2970#endif
2971#endif
2972#ifdef SYS_request_key
2973#ifdef __NR_request_key
2974 {"request_key", __NR_request_key},
2975#endif
2976#endif
2977#ifdef SYS_restart_syscall
2978#ifdef __NR_restart_syscall
2979 {"restart_syscall", __NR_restart_syscall},
2980#endif
2981#endif
2982#ifdef SYS_rmdir
2983#ifdef __NR_rmdir
2984 {"rmdir", __NR_rmdir},
2985#endif
2986#endif
2987#ifdef SYS_rt_sigaction
2988#ifdef __NR_rt_sigaction
2989 {"rt_sigaction", __NR_rt_sigaction},
2990#endif
2991#endif
2992#ifdef SYS_rt_sigpending
2993#ifdef __NR_rt_sigpending
2994 {"rt_sigpending", __NR_rt_sigpending},
2995#endif
2996#endif
2997#ifdef SYS_rt_sigprocmask
2998#ifdef __NR_rt_sigprocmask
2999 {"rt_sigprocmask", __NR_rt_sigprocmask},
3000#endif
3001#endif
3002#ifdef SYS_rt_sigqueueinfo
3003#ifdef __NR_rt_sigqueueinfo
3004 {"rt_sigqueueinfo", __NR_rt_sigqueueinfo},
3005#endif
3006#endif
3007#ifdef SYS_rt_sigreturn
3008#ifdef __NR_rt_sigreturn
3009 {"rt_sigreturn", __NR_rt_sigreturn},
3010#endif
3011#endif
3012#ifdef SYS_rt_sigsuspend
3013#ifdef __NR_rt_sigsuspend
3014 {"rt_sigsuspend", __NR_rt_sigsuspend},
3015#endif
3016#endif
3017#ifdef SYS_rt_sigtimedwait
3018#ifdef __NR_rt_sigtimedwait
3019 {"rt_sigtimedwait", __NR_rt_sigtimedwait},
3020#endif
3021#endif
3022#ifdef SYS_rt_tgsigqueueinfo
3023#ifdef __NR_rt_tgsigqueueinfo
3024 {"rt_tgsigqueueinfo", __NR_rt_tgsigqueueinfo},
3025#endif
3026#endif
3027#ifdef SYS_sched_get_priority_max
3028#ifdef __NR_sched_get_priority_max
3029 {"sched_get_priority_max", __NR_sched_get_priority_max},
3030#endif
3031#endif
3032#ifdef SYS_sched_get_priority_min
3033#ifdef __NR_sched_get_priority_min
3034 {"sched_get_priority_min", __NR_sched_get_priority_min},
3035#endif
3036#endif
3037#ifdef SYS_sched_getaffinity
3038#ifdef __NR_sched_getaffinity
3039 {"sched_getaffinity", __NR_sched_getaffinity},
3040#endif
3041#endif
3042#ifdef SYS_sched_getattr
3043#ifdef __NR_sched_getattr
3044 {"sched_getattr", __NR_sched_getattr},
3045#endif
3046#endif
3047#ifdef SYS_sched_getparam
3048#ifdef __NR_sched_getparam
3049 {"sched_getparam", __NR_sched_getparam},
3050#endif
3051#endif
3052#ifdef SYS_sched_getscheduler
3053#ifdef __NR_sched_getscheduler
3054 {"sched_getscheduler", __NR_sched_getscheduler},
3055#endif
3056#endif
3057#ifdef SYS_sched_rr_get_interval
3058#ifdef __NR_sched_rr_get_interval
3059 {"sched_rr_get_interval", __NR_sched_rr_get_interval},
3060#endif
3061#endif
3062#ifdef SYS_sched_setaffinity
3063#ifdef __NR_sched_setaffinity
3064 {"sched_setaffinity", __NR_sched_setaffinity},
3065#endif
3066#endif
3067#ifdef SYS_sched_setattr
3068#ifdef __NR_sched_setattr
3069 {"sched_setattr", __NR_sched_setattr},
3070#endif
3071#endif
3072#ifdef SYS_sched_setparam
3073#ifdef __NR_sched_setparam
3074 {"sched_setparam", __NR_sched_setparam},
3075#endif
3076#endif
3077#ifdef SYS_sched_setscheduler
3078#ifdef __NR_sched_setscheduler
3079 {"sched_setscheduler", __NR_sched_setscheduler},
3080#endif
3081#endif
3082#ifdef SYS_sched_yield
3083#ifdef __NR_sched_yield
3084 {"sched_yield", __NR_sched_yield},
3085#endif
3086#endif
3087#ifdef SYS_seccomp
3088#ifdef __NR_seccomp
3089 {"seccomp", __NR_seccomp},
3090#endif
3091#endif
3092#ifdef SYS_security
3093#ifdef __NR_security
3094 {"security", __NR_security},
3095#endif
3096#endif
3097#ifdef SYS_select
3098#ifdef __NR_select
3099 {"select", __NR_select},
3100#endif
3101#endif
3102#ifdef SYS_semctl
3103#ifdef __NR_semctl
3104 {"semctl", __NR_semctl},
3105#endif
3106#endif
3107#ifdef SYS_semget
3108#ifdef __NR_semget
3109 {"semget", __NR_semget},
3110#endif
3111#endif
3112#ifdef SYS_semop
3113#ifdef __NR_semop
3114 {"semop", __NR_semop},
3115#endif
3116#endif
3117#ifdef SYS_semtimedop
3118#ifdef __NR_semtimedop
3119 {"semtimedop", __NR_semtimedop},
3120#endif
3121#endif
3122#ifdef SYS_sendfile
3123#ifdef __NR_sendfile
3124 {"sendfile", __NR_sendfile},
3125#endif
3126#endif
3127#ifdef SYS_sendmmsg
3128#ifdef __NR_sendmmsg
3129 {"sendmmsg", __NR_sendmmsg},
3130#endif
3131#endif
3132#ifdef SYS_sendmsg
3133#ifdef __NR_sendmsg
3134 {"sendmsg", __NR_sendmsg},
3135#endif
3136#endif
3137#ifdef SYS_sendto
3138#ifdef __NR_sendto
3139 {"sendto", __NR_sendto},
3140#endif
3141#endif
3142#ifdef SYS_set_mempolicy
3143#ifdef __NR_set_mempolicy
3144 {"set_mempolicy", __NR_set_mempolicy},
3145#endif
3146#endif
3147#ifdef SYS_set_robust_list
3148#ifdef __NR_set_robust_list
3149 {"set_robust_list", __NR_set_robust_list},
3150#endif
3151#endif
3152#ifdef SYS_set_thread_area
3153#ifdef __NR_set_thread_area
3154 {"set_thread_area", __NR_set_thread_area},
3155#endif
3156#endif
3157#ifdef SYS_set_tid_address
3158#ifdef __NR_set_tid_address
3159 {"set_tid_address", __NR_set_tid_address},
3160#endif
3161#endif
3162#ifdef SYS_setdomainname
3163#ifdef __NR_setdomainname
3164 {"setdomainname", __NR_setdomainname},
3165#endif
3166#endif
3167#ifdef SYS_setfsgid
3168#ifdef __NR_setfsgid
3169 {"setfsgid", __NR_setfsgid},
3170#endif
3171#endif
3172#ifdef SYS_setfsuid
3173#ifdef __NR_setfsuid
3174 {"setfsuid", __NR_setfsuid},
3175#endif
3176#endif
3177#ifdef SYS_setgid
3178#ifdef __NR_setgid
3179 {"setgid", __NR_setgid},
3180#endif
3181#endif
3182#ifdef SYS_setgroups
3183#ifdef __NR_setgroups
3184 {"setgroups", __NR_setgroups},
3185#endif
3186#endif
3187#ifdef SYS_sethostname
3188#ifdef __NR_sethostname
3189 {"sethostname", __NR_sethostname},
3190#endif
3191#endif
3192#ifdef SYS_setitimer
3193#ifdef __NR_setitimer
3194 {"setitimer", __NR_setitimer},
3195#endif
3196#endif
3197#ifdef SYS_setns
3198#ifdef __NR_setns
3199 {"setns", __NR_setns},
3200#endif
3201#endif
3202#ifdef SYS_setpgid
3203#ifdef __NR_setpgid
3204 {"setpgid", __NR_setpgid},
3205#endif
3206#endif
3207#ifdef SYS_setpriority
3208#ifdef __NR_setpriority
3209 {"setpriority", __NR_setpriority},
3210#endif
3211#endif
3212#ifdef SYS_setregid
3213#ifdef __NR_setregid
3214 {"setregid", __NR_setregid},
3215#endif
3216#endif
3217#ifdef SYS_setresgid
3218#ifdef __NR_setresgid
3219 {"setresgid", __NR_setresgid},
3220#endif
3221#endif
3222#ifdef SYS_setresuid
3223#ifdef __NR_setresuid
3224 {"setresuid", __NR_setresuid},
3225#endif
3226#endif
3227#ifdef SYS_setreuid
3228#ifdef __NR_setreuid
3229 {"setreuid", __NR_setreuid},
3230#endif
3231#endif
3232#ifdef SYS_setrlimit
3233#ifdef __NR_setrlimit
3234 {"setrlimit", __NR_setrlimit},
3235#endif
3236#endif
3237#ifdef SYS_setsid
3238#ifdef __NR_setsid
3239 {"setsid", __NR_setsid},
3240#endif
3241#endif
3242#ifdef SYS_setsockopt
3243#ifdef __NR_setsockopt
3244 {"setsockopt", __NR_setsockopt},
3245#endif
3246#endif
3247#ifdef SYS_settimeofday
3248#ifdef __NR_settimeofday
3249 {"settimeofday", __NR_settimeofday},
3250#endif
3251#endif
3252#ifdef SYS_setuid
3253#ifdef __NR_setuid
3254 {"setuid", __NR_setuid},
3255#endif
3256#endif
3257#ifdef SYS_setxattr
3258#ifdef __NR_setxattr
3259 {"setxattr", __NR_setxattr},
3260#endif
3261#endif
3262#ifdef SYS_shmat
3263#ifdef __NR_shmat
3264 {"shmat", __NR_shmat},
3265#endif
3266#endif
3267#ifdef SYS_shmctl
3268#ifdef __NR_shmctl
3269 {"shmctl", __NR_shmctl},
3270#endif
3271#endif
3272#ifdef SYS_shmdt
3273#ifdef __NR_shmdt
3274 {"shmdt", __NR_shmdt},
3275#endif
3276#endif
3277#ifdef SYS_shmget
3278#ifdef __NR_shmget
3279 {"shmget", __NR_shmget},
3280#endif
3281#endif
3282#ifdef SYS_shutdown
3283#ifdef __NR_shutdown
3284 {"shutdown", __NR_shutdown},
3285#endif
3286#endif
3287#ifdef SYS_sigaltstack
3288#ifdef __NR_sigaltstack
3289 {"sigaltstack", __NR_sigaltstack},
3290#endif
3291#endif
3292#ifdef SYS_signalfd
3293#ifdef __NR_signalfd
3294 {"signalfd", __NR_signalfd},
3295#endif
3296#endif
3297#ifdef SYS_signalfd4
3298#ifdef __NR_signalfd4
3299 {"signalfd4", __NR_signalfd4},
3300#endif
3301#endif
3302#ifdef SYS_socket
3303#ifdef __NR_socket
3304 {"socket", __NR_socket},
3305#endif
3306#endif
3307#ifdef SYS_socketpair
3308#ifdef __NR_socketpair
3309 {"socketpair", __NR_socketpair},
3310#endif
3311#endif
3312#ifdef SYS_splice
3313#ifdef __NR_splice
3314 {"splice", __NR_splice},
3315#endif
3316#endif
3317#ifdef SYS_stat
3318#ifdef __NR_stat
3319 {"stat", __NR_stat},
3320#endif
3321#endif
3322#ifdef SYS_statfs
3323#ifdef __NR_statfs
3324 {"statfs", __NR_statfs},
3325#endif
3326#endif
3327#ifdef SYS_swapoff
3328#ifdef __NR_swapoff
3329 {"swapoff", __NR_swapoff},
3330#endif
3331#endif
3332#ifdef SYS_swapon
3333#ifdef __NR_swapon
3334 {"swapon", __NR_swapon},
3335#endif
3336#endif
3337#ifdef SYS_symlink
3338#ifdef __NR_symlink
3339 {"symlink", __NR_symlink},
3340#endif
3341#endif
3342#ifdef SYS_symlinkat
3343#ifdef __NR_symlinkat
3344 {"symlinkat", __NR_symlinkat},
3345#endif
3346#endif
3347#ifdef SYS_sync
3348#ifdef __NR_sync
3349 {"sync", __NR_sync},
3350#endif
3351#endif
3352#ifdef SYS_sync_file_range
3353#ifdef __NR_sync_file_range
3354 {"sync_file_range", __NR_sync_file_range},
3355#endif
3356#endif
3357#ifdef SYS_syncfs
3358#ifdef __NR_syncfs
3359 {"syncfs", __NR_syncfs},
3360#endif
3361#endif
3362#ifdef SYS_sysfs
3363#ifdef __NR_sysfs
3364 {"sysfs", __NR_sysfs},
3365#endif
3366#endif
3367#ifdef SYS_sysinfo
3368#ifdef __NR_sysinfo
3369 {"sysinfo", __NR_sysinfo},
3370#endif
3371#endif
3372#ifdef SYS_syslog
3373#ifdef __NR_syslog
3374 {"syslog", __NR_syslog},
3375#endif
3376#endif
3377#ifdef SYS_tee
3378#ifdef __NR_tee
3379 {"tee", __NR_tee},
3380#endif
3381#endif
3382#ifdef SYS_tgkill
3383#ifdef __NR_tgkill
3384 {"tgkill", __NR_tgkill},
3385#endif
3386#endif
3387#ifdef SYS_time
3388#ifdef __NR_time
3389 {"time", __NR_time},
3390#endif
3391#endif
3392#ifdef SYS_timer_create
3393#ifdef __NR_timer_create
3394 {"timer_create", __NR_timer_create},
3395#endif
3396#endif
3397#ifdef SYS_timer_delete
3398#ifdef __NR_timer_delete
3399 {"timer_delete", __NR_timer_delete},
3400#endif
3401#endif
3402#ifdef SYS_timer_getoverrun
3403#ifdef __NR_timer_getoverrun
3404 {"timer_getoverrun", __NR_timer_getoverrun},
3405#endif
3406#endif
3407#ifdef SYS_timer_gettime
3408#ifdef __NR_timer_gettime
3409 {"timer_gettime", __NR_timer_gettime},
3410#endif
3411#endif
3412#ifdef SYS_timer_settime
3413#ifdef __NR_timer_settime
3414 {"timer_settime", __NR_timer_settime},
3415#endif
3416#endif
3417#ifdef SYS_timerfd_create
3418#ifdef __NR_timerfd_create
3419 {"timerfd_create", __NR_timerfd_create},
3420#endif
3421#endif
3422#ifdef SYS_timerfd_gettime
3423#ifdef __NR_timerfd_gettime
3424 {"timerfd_gettime", __NR_timerfd_gettime},
3425#endif
3426#endif
3427#ifdef SYS_timerfd_settime
3428#ifdef __NR_timerfd_settime
3429 {"timerfd_settime", __NR_timerfd_settime},
3430#endif
3431#endif
3432#ifdef SYS_times
3433#ifdef __NR_times
3434 {"times", __NR_times},
3435#endif
3436#endif
3437#ifdef SYS_tkill
3438#ifdef __NR_tkill
3439 {"tkill", __NR_tkill},
3440#endif
3441#endif
3442#ifdef SYS_truncate
3443#ifdef __NR_truncate
3444 {"truncate", __NR_truncate},
3445#endif
3446#endif
3447#ifdef SYS_tuxcall
3448#ifdef __NR_tuxcall
3449 {"tuxcall", __NR_tuxcall},
3450#endif
3451#endif
3452#ifdef SYS_umask
3453#ifdef __NR_umask
3454 {"umask", __NR_umask},
3455#endif
3456#endif
3457#ifdef SYS_umount2
3458#ifdef __NR_umount2
3459 {"umount2", __NR_umount2},
3460#endif
3461#endif
3462#ifdef SYS_uname
3463#ifdef __NR_uname
3464 {"uname", __NR_uname},
3465#endif
3466#endif
3467#ifdef SYS_unlink
3468#ifdef __NR_unlink
3469 {"unlink", __NR_unlink},
3470#endif
3471#endif
3472#ifdef SYS_unlinkat
3473#ifdef __NR_unlinkat
3474 {"unlinkat", __NR_unlinkat},
3475#endif
3476#endif
3477#ifdef SYS_unshare
3478#ifdef __NR_unshare
3479 {"unshare", __NR_unshare},
3480#endif
3481#endif
3482#ifdef SYS_uselib
3483#ifdef __NR_uselib
3484 {"uselib", __NR_uselib},
3485#endif
3486#endif
3487#ifdef SYS_userfaultfd
3488#ifdef __NR_userfaultfd
3489 {"userfaultfd", __NR_userfaultfd},
3490#endif
3491#endif
3492#ifdef SYS_ustat
3493#ifdef __NR_ustat
3494 {"ustat", __NR_ustat},
3495#endif
3496#endif
3497#ifdef SYS_utime
3498#ifdef __NR_utime
3499 {"utime", __NR_utime},
3500#endif
3501#endif
3502#ifdef SYS_utimensat
3503#ifdef __NR_utimensat
3504 {"utimensat", __NR_utimensat},
3505#endif
3506#endif
3507#ifdef SYS_utimes
3508#ifdef __NR_utimes
3509 {"utimes", __NR_utimes},
3510#endif
3511#endif
3512#ifdef SYS_vfork
3513#ifdef __NR_vfork
3514 {"vfork", __NR_vfork},
3515#endif
3516#endif
3517#ifdef SYS_vhangup
3518#ifdef __NR_vhangup
3519 {"vhangup", __NR_vhangup},
3520#endif
3521#endif
3522#ifdef SYS_vmsplice
3523#ifdef __NR_vmsplice
3524 {"vmsplice", __NR_vmsplice},
3525#endif
3526#endif
3527#ifdef SYS_vserver
3528#ifdef __NR_vserver
3529 {"vserver", __NR_vserver},
3530#endif
3531#endif
3532#ifdef SYS_wait4
3533#ifdef __NR_wait4
3534 {"wait4", __NR_wait4},
3535#endif
3536#endif
3537#ifdef SYS_waitid
3538#ifdef __NR_waitid
3539 {"waitid", __NR_waitid},
3540#endif
3541#endif
3542#ifdef SYS_write
3543#ifdef __NR_write
3544 {"write", __NR_write},
3545#endif
3546#endif
3547#ifdef SYS_writev
3548#ifdef __NR_writev
3549 {"writev", __NR_writev},
3550#endif
3551#endif
3552#endif
3553//#endif
3554#if defined __x86_64__ && defined __ILP32__
3555#ifdef SYS_accept
3556#ifdef __NR_accept
3557 {"accept", __NR_accept},
3558#endif
3559#endif
3560#ifdef SYS_accept4
3561#ifdef __NR_accept4
3562 {"accept4", __NR_accept4},
3563#endif
3564#endif
3565#ifdef SYS_access
3566#ifdef __NR_access
3567 {"access", __NR_access},
3568#endif
3569#endif
3570#ifdef SYS_acct
3571#ifdef __NR_acct
3572 {"acct", __NR_acct},
3573#endif
3574#endif
3575#ifdef SYS_add_key
3576#ifdef __NR_add_key
3577 {"add_key", __NR_add_key},
3578#endif
3579#endif
3580#ifdef SYS_adjtimex
3581#ifdef __NR_adjtimex
3582 {"adjtimex", __NR_adjtimex},
3583#endif
3584#endif
3585#ifdef SYS_afs_syscall
3586#ifdef __NR_afs_syscall
3587 {"afs_syscall", __NR_afs_syscall},
3588#endif
3589#endif
3590#ifdef SYS_alarm
3591#ifdef __NR_alarm
3592 {"alarm", __NR_alarm},
3593#endif
3594#endif
3595#ifdef SYS_arch_prctl
3596#ifdef __NR_arch_prctl
3597 {"arch_prctl", __NR_arch_prctl},
3598#endif
3599#endif
3600#ifdef SYS_bind
3601#ifdef __NR_bind
3602 {"bind", __NR_bind},
3603#endif
3604#endif
3605#ifdef SYS_bpf
3606#ifdef __NR_bpf
3607 {"bpf", __NR_bpf},
3608#endif
3609#endif
3610#ifdef SYS_brk
3611#ifdef __NR_brk
3612 {"brk", __NR_brk},
3613#endif
3614#endif
3615#ifdef SYS_capget
3616#ifdef __NR_capget
3617 {"capget", __NR_capget},
3618#endif
3619#endif
3620#ifdef SYS_capset
3621#ifdef __NR_capset
3622 {"capset", __NR_capset},
3623#endif
3624#endif
3625#ifdef SYS_chdir
3626#ifdef __NR_chdir
3627 {"chdir", __NR_chdir},
3628#endif
3629#endif
3630#ifdef SYS_chmod
3631#ifdef __NR_chmod
3632 {"chmod", __NR_chmod},
3633#endif
3634#endif
3635#ifdef SYS_chown
3636#ifdef __NR_chown
3637 {"chown", __NR_chown},
3638#endif
3639#endif
3640#ifdef SYS_chroot
3641#ifdef __NR_chroot
3642 {"chroot", __NR_chroot},
3643#endif
3644#endif
3645#ifdef SYS_clock_adjtime
3646#ifdef __NR_clock_adjtime
3647 {"clock_adjtime", __NR_clock_adjtime},
3648#endif
3649#endif
3650#ifdef SYS_clock_getres
3651#ifdef __NR_clock_getres
3652 {"clock_getres", __NR_clock_getres},
3653#endif
3654#endif
3655#ifdef SYS_clock_gettime
3656#ifdef __NR_clock_gettime
3657 {"clock_gettime", __NR_clock_gettime},
3658#endif
3659#endif
3660#ifdef SYS_clock_nanosleep
3661#ifdef __NR_clock_nanosleep
3662 {"clock_nanosleep", __NR_clock_nanosleep},
3663#endif
3664#endif
3665#ifdef SYS_clock_settime
3666#ifdef __NR_clock_settime
3667 {"clock_settime", __NR_clock_settime},
3668#endif
3669#endif
3670#ifdef SYS_clone
3671#ifdef __NR_clone
3672 {"clone", __NR_clone},
3673#endif
3674#endif
3675#ifdef SYS_close
3676#ifdef __NR_close
3677 {"close", __NR_close},
3678#endif
3679#endif
3680#ifdef SYS_connect
3681#ifdef __NR_connect
3682 {"connect", __NR_connect},
3683#endif
3684#endif
3685#ifdef SYS_copy_file_range
3686#ifdef __NR_copy_file_range
3687 {"copy_file_range", __NR_copy_file_range},
3688#endif
3689#endif
3690#ifdef SYS_creat
3691#ifdef __NR_creat
3692 {"creat", __NR_creat},
3693#endif
3694#endif
3695#ifdef SYS_delete_module
3696#ifdef __NR_delete_module
3697 {"delete_module", __NR_delete_module},
3698#endif
3699#endif
3700#ifdef SYS_dup
3701#ifdef __NR_dup
3702 {"dup", __NR_dup},
3703#endif
3704#endif
3705#ifdef SYS_dup2
3706#ifdef __NR_dup2
3707 {"dup2", __NR_dup2},
3708#endif
3709#endif
3710#ifdef SYS_dup3
3711#ifdef __NR_dup3
3712 {"dup3", __NR_dup3},
3713#endif
3714#endif
3715#ifdef SYS_epoll_create
3716#ifdef __NR_epoll_create
3717 {"epoll_create", __NR_epoll_create},
3718#endif
3719#endif
3720#ifdef SYS_epoll_create1
3721#ifdef __NR_epoll_create1
3722 {"epoll_create1", __NR_epoll_create1},
3723#endif
3724#endif
3725#ifdef SYS_epoll_ctl
3726#ifdef __NR_epoll_ctl
3727 {"epoll_ctl", __NR_epoll_ctl},
3728#endif
3729#endif
3730#ifdef SYS_epoll_pwait
3731#ifdef __NR_epoll_pwait
3732 {"epoll_pwait", __NR_epoll_pwait},
3733#endif
3734#endif
3735#ifdef SYS_epoll_wait
3736#ifdef __NR_epoll_wait
3737 {"epoll_wait", __NR_epoll_wait},
3738#endif
3739#endif
3740#ifdef SYS_eventfd
3741#ifdef __NR_eventfd
3742 {"eventfd", __NR_eventfd},
3743#endif
3744#endif
3745#ifdef SYS_eventfd2
3746#ifdef __NR_eventfd2
3747 {"eventfd2", __NR_eventfd2},
3748#endif
3749#endif
3750#ifdef SYS_execve
3751#ifdef __NR_execve
3752 {"execve", __NR_execve},
3753#endif
3754#endif
3755#ifdef SYS_execveat
3756#ifdef __NR_execveat
3757 {"execveat", __NR_execveat},
3758#endif
3759#endif
3760#ifdef SYS_exit
3761#ifdef __NR_exit
3762 {"exit", __NR_exit},
3763#endif
3764#endif
3765#ifdef SYS_exit_group
3766#ifdef __NR_exit_group
3767 {"exit_group", __NR_exit_group},
3768#endif
3769#endif
3770#ifdef SYS_faccessat
3771#ifdef __NR_faccessat
3772 {"faccessat", __NR_faccessat},
3773#endif
3774#endif
3775#ifdef SYS_fadvise64
3776#ifdef __NR_fadvise64
3777 {"fadvise64", __NR_fadvise64},
3778#endif
3779#endif
3780#ifdef SYS_fallocate
3781#ifdef __NR_fallocate
3782 {"fallocate", __NR_fallocate},
3783#endif
3784#endif
3785#ifdef SYS_fanotify_init
3786#ifdef __NR_fanotify_init
3787 {"fanotify_init", __NR_fanotify_init},
3788#endif
3789#endif
3790#ifdef SYS_fanotify_mark
3791#ifdef __NR_fanotify_mark
3792 {"fanotify_mark", __NR_fanotify_mark},
3793#endif
3794#endif
3795#ifdef SYS_fchdir
3796#ifdef __NR_fchdir
3797 {"fchdir", __NR_fchdir},
3798#endif
3799#endif
3800#ifdef SYS_fchmod
3801#ifdef __NR_fchmod
3802 {"fchmod", __NR_fchmod},
3803#endif
3804#endif
3805#ifdef SYS_fchmodat
3806#ifdef __NR_fchmodat
3807 {"fchmodat", __NR_fchmodat},
3808#endif
3809#endif
3810#ifdef SYS_fchown
3811#ifdef __NR_fchown
3812 {"fchown", __NR_fchown},
3813#endif
3814#endif
3815#ifdef SYS_fchownat
3816#ifdef __NR_fchownat
3817 {"fchownat", __NR_fchownat},
3818#endif
3819#endif
3820#ifdef SYS_fcntl
3821#ifdef __NR_fcntl
3822 {"fcntl", __NR_fcntl},
3823#endif
3824#endif
3825#ifdef SYS_fdatasync
3826#ifdef __NR_fdatasync
3827 {"fdatasync", __NR_fdatasync},
3828#endif
3829#endif
3830#ifdef SYS_fgetxattr
3831#ifdef __NR_fgetxattr
3832 {"fgetxattr", __NR_fgetxattr},
3833#endif
3834#endif
3835#ifdef SYS_finit_module
3836#ifdef __NR_finit_module
3837 {"finit_module", __NR_finit_module},
3838#endif
3839#endif
3840#ifdef SYS_flistxattr
3841#ifdef __NR_flistxattr
3842 {"flistxattr", __NR_flistxattr},
3843#endif
3844#endif
3845#ifdef SYS_flock
3846#ifdef __NR_flock
3847 {"flock", __NR_flock},
3848#endif
3849#endif
3850#ifdef SYS_fork
3851#ifdef __NR_fork
3852 {"fork", __NR_fork},
3853#endif
3854#endif
3855#ifdef SYS_fremovexattr
3856#ifdef __NR_fremovexattr
3857 {"fremovexattr", __NR_fremovexattr},
3858#endif
3859#endif
3860#ifdef SYS_fsetxattr
3861#ifdef __NR_fsetxattr
3862 {"fsetxattr", __NR_fsetxattr},
3863#endif
3864#endif
3865#ifdef SYS_fstat
3866#ifdef __NR_fstat
3867 {"fstat", __NR_fstat},
3868#endif
3869#endif
3870#ifdef SYS_fstatfs
3871#ifdef __NR_fstatfs
3872 {"fstatfs", __NR_fstatfs},
3873#endif
3874#endif
3875#ifdef SYS_fsync
3876#ifdef __NR_fsync
3877 {"fsync", __NR_fsync},
3878#endif
3879#endif
3880#ifdef SYS_ftruncate
3881#ifdef __NR_ftruncate
3882 {"ftruncate", __NR_ftruncate},
3883#endif
3884#endif
3885#ifdef SYS_futex
3886#ifdef __NR_futex
3887 {"futex", __NR_futex},
3888#endif
3889#endif
3890#ifdef SYS_futimesat
3891#ifdef __NR_futimesat
3892 {"futimesat", __NR_futimesat},
3893#endif
3894#endif
3895#ifdef SYS_get_mempolicy
3896#ifdef __NR_get_mempolicy
3897 {"get_mempolicy", __NR_get_mempolicy},
3898#endif
3899#endif
3900#ifdef SYS_get_robust_list
3901#ifdef __NR_get_robust_list
3902 {"get_robust_list", __NR_get_robust_list},
3903#endif
3904#endif
3905#ifdef SYS_getcpu
3906#ifdef __NR_getcpu
3907 {"getcpu", __NR_getcpu},
3908#endif
3909#endif
3910#ifdef SYS_getcwd
3911#ifdef __NR_getcwd
3912 {"getcwd", __NR_getcwd},
3913#endif
3914#endif
3915#ifdef SYS_getdents
3916#ifdef __NR_getdents
3917 {"getdents", __NR_getdents},
3918#endif
3919#endif
3920#ifdef SYS_getdents64
3921#ifdef __NR_getdents64
3922 {"getdents64", __NR_getdents64},
3923#endif
3924#endif
3925#ifdef SYS_getegid
3926#ifdef __NR_getegid
3927 {"getegid", __NR_getegid},
3928#endif
3929#endif
3930#ifdef SYS_geteuid
3931#ifdef __NR_geteuid
3932 {"geteuid", __NR_geteuid},
3933#endif
3934#endif
3935#ifdef SYS_getgid
3936#ifdef __NR_getgid
3937 {"getgid", __NR_getgid},
3938#endif
3939#endif
3940#ifdef SYS_getgroups
3941#ifdef __NR_getgroups
3942 {"getgroups", __NR_getgroups},
3943#endif
3944#endif
3945#ifdef SYS_getitimer
3946#ifdef __NR_getitimer
3947 {"getitimer", __NR_getitimer},
3948#endif
3949#endif
3950#ifdef SYS_getpeername
3951#ifdef __NR_getpeername
3952 {"getpeername", __NR_getpeername},
3953#endif
3954#endif
3955#ifdef SYS_getpgid
3956#ifdef __NR_getpgid
3957 {"getpgid", __NR_getpgid},
3958#endif
3959#endif
3960#ifdef SYS_getpgrp
3961#ifdef __NR_getpgrp
3962 {"getpgrp", __NR_getpgrp},
3963#endif
3964#endif
3965#ifdef SYS_getpid
3966#ifdef __NR_getpid
3967 {"getpid", __NR_getpid},
3968#endif
3969#endif
3970#ifdef SYS_getpmsg
3971#ifdef __NR_getpmsg
3972 {"getpmsg", __NR_getpmsg},
3973#endif
3974#endif
3975#ifdef SYS_getppid
3976#ifdef __NR_getppid
3977 {"getppid", __NR_getppid},
3978#endif
3979#endif
3980#ifdef SYS_getpriority
3981#ifdef __NR_getpriority
3982 {"getpriority", __NR_getpriority},
3983#endif
3984#endif
3985#ifdef SYS_getrandom
3986#ifdef __NR_getrandom
3987 {"getrandom", __NR_getrandom},
3988#endif
3989#endif
3990#ifdef SYS_getresgid
3991#ifdef __NR_getresgid
3992 {"getresgid", __NR_getresgid},
3993#endif
3994#endif
3995#ifdef SYS_getresuid
3996#ifdef __NR_getresuid
3997 {"getresuid", __NR_getresuid},
3998#endif
3999#endif
4000#ifdef SYS_getrlimit
4001#ifdef __NR_getrlimit
4002 {"getrlimit", __NR_getrlimit},
4003#endif
4004#endif
4005#ifdef SYS_getrusage
4006#ifdef __NR_getrusage
4007 {"getrusage", __NR_getrusage},
4008#endif
4009#endif
4010#ifdef SYS_getsid
4011#ifdef __NR_getsid
4012 {"getsid", __NR_getsid},
4013#endif
4014#endif
4015#ifdef SYS_getsockname
4016#ifdef __NR_getsockname
4017 {"getsockname", __NR_getsockname},
4018#endif
4019#endif
4020#ifdef SYS_getsockopt
4021#ifdef __NR_getsockopt
4022 {"getsockopt", __NR_getsockopt},
4023#endif
4024#endif
4025#ifdef SYS_gettid
4026#ifdef __NR_gettid
4027 {"gettid", __NR_gettid},
4028#endif
4029#endif
4030#ifdef SYS_gettimeofday
4031#ifdef __NR_gettimeofday
4032 {"gettimeofday", __NR_gettimeofday},
4033#endif
4034#endif
4035#ifdef SYS_getuid
4036#ifdef __NR_getuid
4037 {"getuid", __NR_getuid},
4038#endif
4039#endif
4040#ifdef SYS_getxattr
4041#ifdef __NR_getxattr
4042 {"getxattr", __NR_getxattr},
4043#endif
4044#endif
4045#ifdef SYS_init_module
4046#ifdef __NR_init_module
4047 {"init_module", __NR_init_module},
4048#endif
4049#endif
4050#ifdef SYS_inotify_add_watch
4051#ifdef __NR_inotify_add_watch
4052 {"inotify_add_watch", __NR_inotify_add_watch},
4053#endif
4054#endif
4055#ifdef SYS_inotify_init
4056#ifdef __NR_inotify_init
4057 {"inotify_init", __NR_inotify_init},
4058#endif
4059#endif
4060#ifdef SYS_inotify_init1
4061#ifdef __NR_inotify_init1
4062 {"inotify_init1", __NR_inotify_init1},
4063#endif
4064#endif
4065#ifdef SYS_inotify_rm_watch
4066#ifdef __NR_inotify_rm_watch
4067 {"inotify_rm_watch", __NR_inotify_rm_watch},
4068#endif
4069#endif
4070#ifdef SYS_io_cancel
4071#ifdef __NR_io_cancel
4072 {"io_cancel", __NR_io_cancel},
4073#endif
4074#endif
4075#ifdef SYS_io_destroy
4076#ifdef __NR_io_destroy
4077 {"io_destroy", __NR_io_destroy},
4078#endif
4079#endif
4080#ifdef SYS_io_getevents
4081#ifdef __NR_io_getevents
4082 {"io_getevents", __NR_io_getevents},
4083#endif
4084#endif
4085#ifdef SYS_io_setup
4086#ifdef __NR_io_setup
4087 {"io_setup", __NR_io_setup},
4088#endif
4089#endif
4090#ifdef SYS_io_submit
4091#ifdef __NR_io_submit
4092 {"io_submit", __NR_io_submit},
4093#endif
4094#endif
4095#ifdef SYS_ioctl
4096#ifdef __NR_ioctl
4097 {"ioctl", __NR_ioctl},
4098#endif
4099#endif
4100#ifdef SYS_ioperm
4101#ifdef __NR_ioperm
4102 {"ioperm", __NR_ioperm},
4103#endif
4104#endif
4105#ifdef SYS_iopl
4106#ifdef __NR_iopl
4107 {"iopl", __NR_iopl},
4108#endif
4109#endif
4110#ifdef SYS_ioprio_get
4111#ifdef __NR_ioprio_get
4112 {"ioprio_get", __NR_ioprio_get},
4113#endif
4114#endif
4115#ifdef SYS_ioprio_set
4116#ifdef __NR_ioprio_set
4117 {"ioprio_set", __NR_ioprio_set},
4118#endif
4119#endif
4120#ifdef SYS_kcmp
4121#ifdef __NR_kcmp
4122 {"kcmp", __NR_kcmp},
4123#endif
4124#endif
4125#ifdef SYS_kexec_file_load
4126#ifdef __NR_kexec_file_load
4127 {"kexec_file_load", __NR_kexec_file_load},
4128#endif
4129#endif
4130#ifdef SYS_kexec_load
4131#ifdef __NR_kexec_load
4132 {"kexec_load", __NR_kexec_load},
4133#endif
4134#endif
4135#ifdef SYS_keyctl
4136#ifdef __NR_keyctl
4137 {"keyctl", __NR_keyctl},
4138#endif
4139#endif
4140#ifdef SYS_kill
4141#ifdef __NR_kill
4142 {"kill", __NR_kill},
4143#endif
4144#endif
4145#ifdef SYS_lchown
4146#ifdef __NR_lchown
4147 {"lchown", __NR_lchown},
4148#endif
4149#endif
4150#ifdef SYS_lgetxattr
4151#ifdef __NR_lgetxattr
4152 {"lgetxattr", __NR_lgetxattr},
4153#endif
4154#endif
4155#ifdef SYS_link
4156#ifdef __NR_link
4157 {"link", __NR_link},
4158#endif
4159#endif
4160#ifdef SYS_linkat
4161#ifdef __NR_linkat
4162 {"linkat", __NR_linkat},
4163#endif
4164#endif
4165#ifdef SYS_listen
4166#ifdef __NR_listen
4167 {"listen", __NR_listen},
4168#endif
4169#endif
4170#ifdef SYS_listxattr
4171#ifdef __NR_listxattr
4172 {"listxattr", __NR_listxattr},
4173#endif
4174#endif
4175#ifdef SYS_llistxattr
4176#ifdef __NR_llistxattr
4177 {"llistxattr", __NR_llistxattr},
4178#endif
4179#endif
4180#ifdef SYS_lookup_dcookie
4181#ifdef __NR_lookup_dcookie
4182 {"lookup_dcookie", __NR_lookup_dcookie},
4183#endif
4184#endif
4185#ifdef SYS_lremovexattr
4186#ifdef __NR_lremovexattr
4187 {"lremovexattr", __NR_lremovexattr},
4188#endif
4189#endif
4190#ifdef SYS_lseek
4191#ifdef __NR_lseek
4192 {"lseek", __NR_lseek},
4193#endif
4194#endif
4195#ifdef SYS_lsetxattr
4196#ifdef __NR_lsetxattr
4197 {"lsetxattr", __NR_lsetxattr},
4198#endif
4199#endif
4200#ifdef SYS_lstat
4201#ifdef __NR_lstat
4202 {"lstat", __NR_lstat},
4203#endif
4204#endif
4205#ifdef SYS_madvise
4206#ifdef __NR_madvise
4207 {"madvise", __NR_madvise},
4208#endif
4209#endif
4210#ifdef SYS_mbind
4211#ifdef __NR_mbind
4212 {"mbind", __NR_mbind},
4213#endif
4214#endif
4215#ifdef SYS_membarrier
4216#ifdef __NR_membarrier
4217 {"membarrier", __NR_membarrier},
4218#endif
4219#endif
4220#ifdef SYS_memfd_create
4221#ifdef __NR_memfd_create
4222 {"memfd_create", __NR_memfd_create},
4223#endif
4224#endif
4225#ifdef SYS_migrate_pages
4226#ifdef __NR_migrate_pages
4227 {"migrate_pages", __NR_migrate_pages},
4228#endif
4229#endif
4230#ifdef SYS_mincore
4231#ifdef __NR_mincore
4232 {"mincore", __NR_mincore},
4233#endif
4234#endif
4235#ifdef SYS_mkdir
4236#ifdef __NR_mkdir
4237 {"mkdir", __NR_mkdir},
4238#endif
4239#endif
4240#ifdef SYS_mkdirat
4241#ifdef __NR_mkdirat
4242 {"mkdirat", __NR_mkdirat},
4243#endif
4244#endif
4245#ifdef SYS_mknod
4246#ifdef __NR_mknod
4247 {"mknod", __NR_mknod},
4248#endif
4249#endif
4250#ifdef SYS_mknodat
4251#ifdef __NR_mknodat
4252 {"mknodat", __NR_mknodat},
4253#endif
4254#endif
4255#ifdef SYS_mlock
4256#ifdef __NR_mlock
4257 {"mlock", __NR_mlock},
4258#endif
4259#endif
4260#ifdef SYS_mlock2
4261#ifdef __NR_mlock2
4262 {"mlock2", __NR_mlock2},
4263#endif
4264#endif
4265#ifdef SYS_mlockall
4266#ifdef __NR_mlockall
4267 {"mlockall", __NR_mlockall},
4268#endif
4269#endif
4270#ifdef SYS_mmap
4271#ifdef __NR_mmap
4272 {"mmap", __NR_mmap},
4273#endif
4274#endif
4275#ifdef SYS_modify_ldt
4276#ifdef __NR_modify_ldt
4277 {"modify_ldt", __NR_modify_ldt},
4278#endif
4279#endif
4280#ifdef SYS_mount
4281#ifdef __NR_mount
4282 {"mount", __NR_mount},
4283#endif
4284#endif
4285#ifdef SYS_move_pages
4286#ifdef __NR_move_pages
4287 {"move_pages", __NR_move_pages},
4288#endif
4289#endif
4290#ifdef SYS_mprotect
4291#ifdef __NR_mprotect
4292 {"mprotect", __NR_mprotect},
4293#endif
4294#endif
4295#ifdef SYS_mq_getsetattr
4296#ifdef __NR_mq_getsetattr
4297 {"mq_getsetattr", __NR_mq_getsetattr},
4298#endif
4299#endif
4300#ifdef SYS_mq_notify
4301#ifdef __NR_mq_notify
4302 {"mq_notify", __NR_mq_notify},
4303#endif
4304#endif
4305#ifdef SYS_mq_open
4306#ifdef __NR_mq_open
4307 {"mq_open", __NR_mq_open},
4308#endif
4309#endif
4310#ifdef SYS_mq_timedreceive
4311#ifdef __NR_mq_timedreceive
4312 {"mq_timedreceive", __NR_mq_timedreceive},
4313#endif
4314#endif
4315#ifdef SYS_mq_timedsend
4316#ifdef __NR_mq_timedsend
4317 {"mq_timedsend", __NR_mq_timedsend},
4318#endif
4319#endif
4320#ifdef SYS_mq_unlink
4321#ifdef __NR_mq_unlink
4322 {"mq_unlink", __NR_mq_unlink},
4323#endif
4324#endif
4325#ifdef SYS_mremap
4326#ifdef __NR_mremap
4327 {"mremap", __NR_mremap},
4328#endif
4329#endif
4330#ifdef SYS_msgctl
4331#ifdef __NR_msgctl
4332 {"msgctl", __NR_msgctl},
4333#endif
4334#endif
4335#ifdef SYS_msgget
4336#ifdef __NR_msgget
4337 {"msgget", __NR_msgget},
4338#endif
4339#endif
4340#ifdef SYS_msgrcv
4341#ifdef __NR_msgrcv
4342 {"msgrcv", __NR_msgrcv},
4343#endif
4344#endif
4345#ifdef SYS_msgsnd
4346#ifdef __NR_msgsnd
4347 {"msgsnd", __NR_msgsnd},
4348#endif
4349#endif
4350#ifdef SYS_msync
4351#ifdef __NR_msync
4352 {"msync", __NR_msync},
4353#endif
4354#endif
4355#ifdef SYS_munlock
4356#ifdef __NR_munlock
4357 {"munlock", __NR_munlock},
4358#endif
4359#endif
4360#ifdef SYS_munlockall
4361#ifdef __NR_munlockall
4362 {"munlockall", __NR_munlockall},
4363#endif
4364#endif
4365#ifdef SYS_munmap
4366#ifdef __NR_munmap
4367 {"munmap", __NR_munmap},
4368#endif
4369#endif
4370#ifdef SYS_name_to_handle_at
4371#ifdef __NR_name_to_handle_at
4372 {"name_to_handle_at", __NR_name_to_handle_at},
4373#endif
4374#endif
4375#ifdef SYS_nanosleep
4376#ifdef __NR_nanosleep
4377 {"nanosleep", __NR_nanosleep},
4378#endif
4379#endif
4380#ifdef SYS_newfstatat
4381#ifdef __NR_newfstatat
4382 {"newfstatat", __NR_newfstatat},
4383#endif
4384#endif
4385#ifdef SYS_open
4386#ifdef __NR_open
4387 {"open", __NR_open},
4388#endif
4389#endif
4390#ifdef SYS_open_by_handle_at
4391#ifdef __NR_open_by_handle_at
4392 {"open_by_handle_at", __NR_open_by_handle_at},
4393#endif
4394#endif
4395#ifdef SYS_openat
4396#ifdef __NR_openat
4397 {"openat", __NR_openat},
4398#endif
4399#endif
4400#ifdef SYS_pause
4401#ifdef __NR_pause
4402 {"pause", __NR_pause},
4403#endif
4404#endif
4405#ifdef SYS_perf_event_open
4406#ifdef __NR_perf_event_open
4407 {"perf_event_open", __NR_perf_event_open},
4408#endif
4409#endif
4410#ifdef SYS_personality
4411#ifdef __NR_personality
4412 {"personality", __NR_personality},
4413#endif
4414#endif
4415#ifdef SYS_pipe
4416#ifdef __NR_pipe
4417 {"pipe", __NR_pipe},
4418#endif
4419#endif
4420#ifdef SYS_pipe2
4421#ifdef __NR_pipe2
4422 {"pipe2", __NR_pipe2},
4423#endif
4424#endif
4425#ifdef SYS_pivot_root
4426#ifdef __NR_pivot_root
4427 {"pivot_root", __NR_pivot_root},
4428#endif
4429#endif
4430#ifdef SYS_poll
4431#ifdef __NR_poll
4432 {"poll", __NR_poll},
4433#endif
4434#endif
4435#ifdef SYS_ppoll
4436#ifdef __NR_ppoll
4437 {"ppoll", __NR_ppoll},
4438#endif
4439#endif
4440#ifdef SYS_prctl
4441#ifdef __NR_prctl
4442 {"prctl", __NR_prctl},
4443#endif
4444#endif
4445#ifdef SYS_pread64
4446#ifdef __NR_pread64
4447 {"pread64", __NR_pread64},
4448#endif
4449#endif
4450#ifdef SYS_preadv
4451#ifdef __NR_preadv
4452 {"preadv", __NR_preadv},
4453#endif
4454#endif
4455#ifdef SYS_preadv2
4456#ifdef __NR_preadv2
4457 {"preadv2", __NR_preadv2},
4458#endif
4459#endif
4460#ifdef SYS_prlimit64
4461#ifdef __NR_prlimit64
4462 {"prlimit64", __NR_prlimit64},
4463#endif
4464#endif
4465#ifdef SYS_process_vm_readv
4466#ifdef __NR_process_vm_readv
4467 {"process_vm_readv", __NR_process_vm_readv},
4468#endif
4469#endif
4470#ifdef SYS_process_vm_writev
4471#ifdef __NR_process_vm_writev
4472 {"process_vm_writev", __NR_process_vm_writev},
4473#endif
4474#endif
4475#ifdef SYS_pselect6
4476#ifdef __NR_pselect6
4477 {"pselect6", __NR_pselect6},
4478#endif
4479#endif
4480#ifdef SYS_ptrace
4481#ifdef __NR_ptrace
4482 {"ptrace", __NR_ptrace},
4483#endif
4484#endif
4485#ifdef SYS_putpmsg
4486#ifdef __NR_putpmsg
4487 {"putpmsg", __NR_putpmsg},
4488#endif
4489#endif
4490#ifdef SYS_pwrite64
4491#ifdef __NR_pwrite64
4492 {"pwrite64", __NR_pwrite64},
4493#endif
4494#endif
4495#ifdef SYS_pwritev
4496#ifdef __NR_pwritev
4497 {"pwritev", __NR_pwritev},
4498#endif
4499#endif
4500#ifdef SYS_pwritev2
4501#ifdef __NR_pwritev2
4502 {"pwritev2", __NR_pwritev2},
4503#endif
4504#endif
4505#ifdef SYS_quotactl
4506#ifdef __NR_quotactl
4507 {"quotactl", __NR_quotactl},
4508#endif
4509#endif
4510#ifdef SYS_read
4511#ifdef __NR_read
4512 {"read", __NR_read},
4513#endif
4514#endif
4515#ifdef SYS_readahead
4516#ifdef __NR_readahead
4517 {"readahead", __NR_readahead},
4518#endif
4519#endif
4520#ifdef SYS_readlink
4521#ifdef __NR_readlink
4522 {"readlink", __NR_readlink},
4523#endif
4524#endif
4525#ifdef SYS_readlinkat
4526#ifdef __NR_readlinkat
4527 {"readlinkat", __NR_readlinkat},
4528#endif
4529#endif
4530#ifdef SYS_readv
4531#ifdef __NR_readv
4532 {"readv", __NR_readv},
4533#endif
4534#endif
4535#ifdef SYS_reboot
4536#ifdef __NR_reboot
4537 {"reboot", __NR_reboot},
4538#endif
4539#endif
4540#ifdef SYS_recvfrom
4541#ifdef __NR_recvfrom
4542 {"recvfrom", __NR_recvfrom},
4543#endif
4544#endif
4545#ifdef SYS_recvmmsg
4546#ifdef __NR_recvmmsg
4547 {"recvmmsg", __NR_recvmmsg},
4548#endif
4549#endif
4550#ifdef SYS_recvmsg
4551#ifdef __NR_recvmsg
4552 {"recvmsg", __NR_recvmsg},
4553#endif
4554#endif
4555#ifdef SYS_remap_file_pages
4556#ifdef __NR_remap_file_pages
4557 {"remap_file_pages", __NR_remap_file_pages},
4558#endif
4559#endif
4560#ifdef SYS_removexattr
4561#ifdef __NR_removexattr
4562 {"removexattr", __NR_removexattr},
4563#endif
4564#endif
4565#ifdef SYS_rename
4566#ifdef __NR_rename
4567 {"rename", __NR_rename},
4568#endif
4569#endif
4570#ifdef SYS_renameat
4571#ifdef __NR_renameat
4572 {"renameat", __NR_renameat},
4573#endif
4574#endif
4575#ifdef SYS_renameat2
4576#ifdef __NR_renameat2
4577 {"renameat2", __NR_renameat2},
4578#endif
4579#endif
4580#ifdef SYS_request_key
4581#ifdef __NR_request_key
4582 {"request_key", __NR_request_key},
4583#endif
4584#endif
4585#ifdef SYS_restart_syscall
4586#ifdef __NR_restart_syscall
4587 {"restart_syscall", __NR_restart_syscall},
4588#endif
4589#endif
4590#ifdef SYS_rmdir
4591#ifdef __NR_rmdir
4592 {"rmdir", __NR_rmdir},
4593#endif
4594#endif
4595#ifdef SYS_rt_sigaction
4596#ifdef __NR_rt_sigaction
4597 {"rt_sigaction", __NR_rt_sigaction},
4598#endif
4599#endif
4600#ifdef SYS_rt_sigpending
4601#ifdef __NR_rt_sigpending
4602 {"rt_sigpending", __NR_rt_sigpending},
4603#endif
4604#endif
4605#ifdef SYS_rt_sigprocmask
4606#ifdef __NR_rt_sigprocmask
4607 {"rt_sigprocmask", __NR_rt_sigprocmask},
4608#endif
4609#endif
4610#ifdef SYS_rt_sigqueueinfo
4611#ifdef __NR_rt_sigqueueinfo
4612 {"rt_sigqueueinfo", __NR_rt_sigqueueinfo},
4613#endif
4614#endif
4615#ifdef SYS_rt_sigreturn
4616#ifdef __NR_rt_sigreturn
4617 {"rt_sigreturn", __NR_rt_sigreturn},
4618#endif
4619#endif
4620#ifdef SYS_rt_sigsuspend
4621#ifdef __NR_rt_sigsuspend
4622 {"rt_sigsuspend", __NR_rt_sigsuspend},
4623#endif
4624#endif
4625#ifdef SYS_rt_sigtimedwait
4626#ifdef __NR_rt_sigtimedwait
4627 {"rt_sigtimedwait", __NR_rt_sigtimedwait},
4628#endif
4629#endif
4630#ifdef SYS_rt_tgsigqueueinfo
4631#ifdef __NR_rt_tgsigqueueinfo
4632 {"rt_tgsigqueueinfo", __NR_rt_tgsigqueueinfo},
4633#endif
4634#endif
4635#ifdef SYS_sched_get_priority_max
4636#ifdef __NR_sched_get_priority_max
4637 {"sched_get_priority_max", __NR_sched_get_priority_max},
4638#endif
4639#endif
4640#ifdef SYS_sched_get_priority_min
4641#ifdef __NR_sched_get_priority_min
4642 {"sched_get_priority_min", __NR_sched_get_priority_min},
4643#endif
4644#endif
4645#ifdef SYS_sched_getaffinity
4646#ifdef __NR_sched_getaffinity
4647 {"sched_getaffinity", __NR_sched_getaffinity},
4648#endif
4649#endif
4650#ifdef SYS_sched_getattr
4651#ifdef __NR_sched_getattr
4652 {"sched_getattr", __NR_sched_getattr},
4653#endif
4654#endif
4655#ifdef SYS_sched_getparam
4656#ifdef __NR_sched_getparam
4657 {"sched_getparam", __NR_sched_getparam},
4658#endif
4659#endif
4660#ifdef SYS_sched_getscheduler
4661#ifdef __NR_sched_getscheduler
4662 {"sched_getscheduler", __NR_sched_getscheduler},
4663#endif
4664#endif
4665#ifdef SYS_sched_rr_get_interval
4666#ifdef __NR_sched_rr_get_interval
4667 {"sched_rr_get_interval", __NR_sched_rr_get_interval},
4668#endif
4669#endif
4670#ifdef SYS_sched_setaffinity
4671#ifdef __NR_sched_setaffinity
4672 {"sched_setaffinity", __NR_sched_setaffinity},
4673#endif
4674#endif
4675#ifdef SYS_sched_setattr
4676#ifdef __NR_sched_setattr
4677 {"sched_setattr", __NR_sched_setattr},
4678#endif
4679#endif
4680#ifdef SYS_sched_setparam
4681#ifdef __NR_sched_setparam
4682 {"sched_setparam", __NR_sched_setparam},
4683#endif
4684#endif
4685#ifdef SYS_sched_setscheduler
4686#ifdef __NR_sched_setscheduler
4687 {"sched_setscheduler", __NR_sched_setscheduler},
4688#endif
4689#endif
4690#ifdef SYS_sched_yield
4691#ifdef __NR_sched_yield
4692 {"sched_yield", __NR_sched_yield},
4693#endif
4694#endif
4695#ifdef SYS_seccomp
4696#ifdef __NR_seccomp
4697 {"seccomp", __NR_seccomp},
4698#endif
4699#endif
4700#ifdef SYS_security
4701#ifdef __NR_security
4702 {"security", __NR_security},
4703#endif
4704#endif
4705#ifdef SYS_select
4706#ifdef __NR_select
4707 {"select", __NR_select},
4708#endif
4709#endif
4710#ifdef SYS_semctl
4711#ifdef __NR_semctl
4712 {"semctl", __NR_semctl},
4713#endif
4714#endif
4715#ifdef SYS_semget
4716#ifdef __NR_semget
4717 {"semget", __NR_semget},
4718#endif
4719#endif
4720#ifdef SYS_semop
4721#ifdef __NR_semop
4722 {"semop", __NR_semop},
4723#endif
4724#endif
4725#ifdef SYS_semtimedop
4726#ifdef __NR_semtimedop
4727 {"semtimedop", __NR_semtimedop},
4728#endif
4729#endif
4730#ifdef SYS_sendfile
4731#ifdef __NR_sendfile
4732 {"sendfile", __NR_sendfile},
4733#endif
4734#endif
4735#ifdef SYS_sendmmsg
4736#ifdef __NR_sendmmsg
4737 {"sendmmsg", __NR_sendmmsg},
4738#endif
4739#endif
4740#ifdef SYS_sendmsg
4741#ifdef __NR_sendmsg
4742 {"sendmsg", __NR_sendmsg},
4743#endif
4744#endif
4745#ifdef SYS_sendto
4746#ifdef __NR_sendto
4747 {"sendto", __NR_sendto},
4748#endif
4749#endif
4750#ifdef SYS_set_mempolicy
4751#ifdef __NR_set_mempolicy
4752 {"set_mempolicy", __NR_set_mempolicy},
4753#endif
4754#endif
4755#ifdef SYS_set_robust_list
4756#ifdef __NR_set_robust_list
4757 {"set_robust_list", __NR_set_robust_list},
4758#endif
4759#endif
4760#ifdef SYS_set_tid_address
4761#ifdef __NR_set_tid_address
4762 {"set_tid_address", __NR_set_tid_address},
4763#endif
4764#endif
4765#ifdef SYS_setdomainname
4766#ifdef __NR_setdomainname
4767 {"setdomainname", __NR_setdomainname},
4768#endif
4769#endif
4770#ifdef SYS_setfsgid
4771#ifdef __NR_setfsgid
4772 {"setfsgid", __NR_setfsgid},
4773#endif
4774#endif
4775#ifdef SYS_setfsuid
4776#ifdef __NR_setfsuid
4777 {"setfsuid", __NR_setfsuid},
4778#endif
4779#endif
4780#ifdef SYS_setgid
4781#ifdef __NR_setgid
4782 {"setgid", __NR_setgid},
4783#endif
4784#endif
4785#ifdef SYS_setgroups
4786#ifdef __NR_setgroups
4787 {"setgroups", __NR_setgroups},
4788#endif
4789#endif
4790#ifdef SYS_sethostname
4791#ifdef __NR_sethostname
4792 {"sethostname", __NR_sethostname},
4793#endif
4794#endif
4795#ifdef SYS_setitimer
4796#ifdef __NR_setitimer
4797 {"setitimer", __NR_setitimer},
4798#endif
4799#endif
4800#ifdef SYS_setns
4801#ifdef __NR_setns
4802 {"setns", __NR_setns},
4803#endif
4804#endif
4805#ifdef SYS_setpgid
4806#ifdef __NR_setpgid
4807 {"setpgid", __NR_setpgid},
4808#endif
4809#endif
4810#ifdef SYS_setpriority
4811#ifdef __NR_setpriority
4812 {"setpriority", __NR_setpriority},
4813#endif
4814#endif
4815#ifdef SYS_setregid
4816#ifdef __NR_setregid
4817 {"setregid", __NR_setregid},
4818#endif
4819#endif
4820#ifdef SYS_setresgid
4821#ifdef __NR_setresgid
4822 {"setresgid", __NR_setresgid},
4823#endif
4824#endif
4825#ifdef SYS_setresuid
4826#ifdef __NR_setresuid
4827 {"setresuid", __NR_setresuid},
4828#endif
4829#endif
4830#ifdef SYS_setreuid
4831#ifdef __NR_setreuid
4832 {"setreuid", __NR_setreuid},
4833#endif
4834#endif
4835#ifdef SYS_setrlimit
4836#ifdef __NR_setrlimit
4837 {"setrlimit", __NR_setrlimit},
4838#endif
4839#endif
4840#ifdef SYS_setsid
4841#ifdef __NR_setsid
4842 {"setsid", __NR_setsid},
4843#endif
4844#endif
4845#ifdef SYS_setsockopt
4846#ifdef __NR_setsockopt
4847 {"setsockopt", __NR_setsockopt},
4848#endif
4849#endif
4850#ifdef SYS_settimeofday
4851#ifdef __NR_settimeofday
4852 {"settimeofday", __NR_settimeofday},
4853#endif
4854#endif
4855#ifdef SYS_setuid
4856#ifdef __NR_setuid
4857 {"setuid", __NR_setuid},
4858#endif
4859#endif
4860#ifdef SYS_setxattr
4861#ifdef __NR_setxattr
4862 {"setxattr", __NR_setxattr},
4863#endif
4864#endif
4865#ifdef SYS_shmat
4866#ifdef __NR_shmat
4867 {"shmat", __NR_shmat},
4868#endif
4869#endif
4870#ifdef SYS_shmctl
4871#ifdef __NR_shmctl
4872 {"shmctl", __NR_shmctl},
4873#endif
4874#endif
4875#ifdef SYS_shmdt
4876#ifdef __NR_shmdt
4877 {"shmdt", __NR_shmdt},
4878#endif
4879#endif
4880#ifdef SYS_shmget
4881#ifdef __NR_shmget
4882 {"shmget", __NR_shmget},
4883#endif
4884#endif
4885#ifdef SYS_shutdown
4886#ifdef __NR_shutdown
4887 {"shutdown", __NR_shutdown},
4888#endif
4889#endif
4890#ifdef SYS_sigaltstack
4891#ifdef __NR_sigaltstack
4892 {"sigaltstack", __NR_sigaltstack},
4893#endif
4894#endif
4895#ifdef SYS_signalfd
4896#ifdef __NR_signalfd
4897 {"signalfd", __NR_signalfd},
4898#endif
4899#endif
4900#ifdef SYS_signalfd4
4901#ifdef __NR_signalfd4
4902 {"signalfd4", __NR_signalfd4},
4903#endif
4904#endif
4905#ifdef SYS_socket
4906#ifdef __NR_socket
4907 {"socket", __NR_socket},
4908#endif
4909#endif
4910#ifdef SYS_socketpair
4911#ifdef __NR_socketpair
4912 {"socketpair", __NR_socketpair},
4913#endif
4914#endif
4915#ifdef SYS_splice
4916#ifdef __NR_splice
4917 {"splice", __NR_splice},
4918#endif
4919#endif
4920#ifdef SYS_stat
4921#ifdef __NR_stat
4922 {"stat", __NR_stat},
4923#endif
4924#endif
4925#ifdef SYS_statfs
4926#ifdef __NR_statfs
4927 {"statfs", __NR_statfs},
4928#endif
4929#endif
4930#ifdef SYS_swapoff
4931#ifdef __NR_swapoff
4932 {"swapoff", __NR_swapoff},
4933#endif
4934#endif
4935#ifdef SYS_swapon
4936#ifdef __NR_swapon
4937 {"swapon", __NR_swapon},
4938#endif
4939#endif
4940#ifdef SYS_symlink
4941#ifdef __NR_symlink
4942 {"symlink", __NR_symlink},
4943#endif
4944#endif
4945#ifdef SYS_symlinkat
4946#ifdef __NR_symlinkat
4947 {"symlinkat", __NR_symlinkat},
4948#endif
4949#endif
4950#ifdef SYS_sync
4951#ifdef __NR_sync
4952 {"sync", __NR_sync},
4953#endif
4954#endif
4955#ifdef SYS_sync_file_range
4956#ifdef __NR_sync_file_range
4957 {"sync_file_range", __NR_sync_file_range},
4958#endif
4959#endif
4960#ifdef SYS_syncfs
4961#ifdef __NR_syncfs
4962 {"syncfs", __NR_syncfs},
4963#endif
4964#endif
4965#ifdef SYS_sysfs
4966#ifdef __NR_sysfs
4967 {"sysfs", __NR_sysfs},
4968#endif
4969#endif
4970#ifdef SYS_sysinfo
4971#ifdef __NR_sysinfo
4972 {"sysinfo", __NR_sysinfo},
4973#endif
4974#endif
4975#ifdef SYS_syslog
4976#ifdef __NR_syslog
4977 {"syslog", __NR_syslog},
4978#endif
4979#endif
4980#ifdef SYS_tee
4981#ifdef __NR_tee
4982 {"tee", __NR_tee},
4983#endif
4984#endif
4985#ifdef SYS_tgkill
4986#ifdef __NR_tgkill
4987 {"tgkill", __NR_tgkill},
4988#endif
4989#endif
4990#ifdef SYS_time
4991#ifdef __NR_time
4992 {"time", __NR_time},
4993#endif
4994#endif
4995#ifdef SYS_timer_create
4996#ifdef __NR_timer_create
4997 {"timer_create", __NR_timer_create},
4998#endif
4999#endif
5000#ifdef SYS_timer_delete
5001#ifdef __NR_timer_delete
5002 {"timer_delete", __NR_timer_delete},
5003#endif
5004#endif
5005#ifdef SYS_timer_getoverrun
5006#ifdef __NR_timer_getoverrun
5007 {"timer_getoverrun", __NR_timer_getoverrun},
5008#endif
5009#endif
5010#ifdef SYS_timer_gettime
5011#ifdef __NR_timer_gettime
5012 {"timer_gettime", __NR_timer_gettime},
5013#endif
5014#endif
5015#ifdef SYS_timer_settime
5016#ifdef __NR_timer_settime
5017 {"timer_settime", __NR_timer_settime},
5018#endif
5019#endif
5020#ifdef SYS_timerfd_create
5021#ifdef __NR_timerfd_create
5022 {"timerfd_create", __NR_timerfd_create},
5023#endif
5024#endif
5025#ifdef SYS_timerfd_gettime
5026#ifdef __NR_timerfd_gettime
5027 {"timerfd_gettime", __NR_timerfd_gettime},
5028#endif
5029#endif
5030#ifdef SYS_timerfd_settime
5031#ifdef __NR_timerfd_settime
5032 {"timerfd_settime", __NR_timerfd_settime},
5033#endif
5034#endif
5035#ifdef SYS_times
5036#ifdef __NR_times
5037 {"times", __NR_times},
5038#endif
5039#endif
5040#ifdef SYS_tkill
5041#ifdef __NR_tkill
5042 {"tkill", __NR_tkill},
5043#endif
5044#endif
5045#ifdef SYS_truncate
5046#ifdef __NR_truncate
5047 {"truncate", __NR_truncate},
5048#endif
5049#endif
5050#ifdef SYS_tuxcall
5051#ifdef __NR_tuxcall
5052 {"tuxcall", __NR_tuxcall},
5053#endif
5054#endif
5055#ifdef SYS_umask
5056#ifdef __NR_umask
5057 {"umask", __NR_umask},
5058#endif
5059#endif
5060#ifdef SYS_umount2
5061#ifdef __NR_umount2
5062 {"umount2", __NR_umount2},
5063#endif
5064#endif
5065#ifdef SYS_uname
5066#ifdef __NR_uname
5067 {"uname", __NR_uname},
5068#endif
5069#endif
5070#ifdef SYS_unlink
5071#ifdef __NR_unlink
5072 {"unlink", __NR_unlink},
5073#endif
5074#endif
5075#ifdef SYS_unlinkat
5076#ifdef __NR_unlinkat
5077 {"unlinkat", __NR_unlinkat},
5078#endif
5079#endif
5080#ifdef SYS_unshare
5081#ifdef __NR_unshare
5082 {"unshare", __NR_unshare},
5083#endif
5084#endif
5085#ifdef SYS_userfaultfd
5086#ifdef __NR_userfaultfd
5087 {"userfaultfd", __NR_userfaultfd},
5088#endif
5089#endif
5090#ifdef SYS_ustat
5091#ifdef __NR_ustat
5092 {"ustat", __NR_ustat},
5093#endif
5094#endif
5095#ifdef SYS_utime
5096#ifdef __NR_utime
5097 {"utime", __NR_utime},
5098#endif
5099#endif
5100#ifdef SYS_utimensat
5101#ifdef __NR_utimensat
5102 {"utimensat", __NR_utimensat},
5103#endif
5104#endif
5105#ifdef SYS_utimes
5106#ifdef __NR_utimes
5107 {"utimes", __NR_utimes},
5108#endif
5109#endif
5110#ifdef SYS_vfork
5111#ifdef __NR_vfork
5112 {"vfork", __NR_vfork},
5113#endif
5114#endif
5115#ifdef SYS_vhangup
5116#ifdef __NR_vhangup
5117 {"vhangup", __NR_vhangup},
5118#endif
5119#endif
5120#ifdef SYS_vmsplice
5121#ifdef __NR_vmsplice
5122 {"vmsplice", __NR_vmsplice},
5123#endif
5124#endif
5125#ifdef SYS_wait4
5126#ifdef __NR_wait4
5127 {"wait4", __NR_wait4},
5128#endif
5129#endif
5130#ifdef SYS_waitid
5131#ifdef __NR_waitid
5132 {"waitid", __NR_waitid},
5133#endif
5134#endif
5135#ifdef SYS_write
5136#ifdef __NR_write
5137 {"write", __NR_write},
5138#endif
5139#endif
5140#ifdef SYS_writev
5141#ifdef __NR_writev
5142 {"writev", __NR_writev},
5143#endif
5144#endif
5145#endif 45#endif
5146//#endif
diff --git a/src/include/syscall_armeabi.h b/src/include/syscall_armeabi.h
new file mode 100644
index 000000000..3b574f875
--- /dev/null
+++ b/src/include/syscall_armeabi.h
@@ -0,0 +1,355 @@
1{ "accept", 285 },
2{ "accept4", 366 },
3{ "access", 33 },
4{ "acct", 51 },
5{ "add_key", 309 },
6{ "adjtimex", 124 },
7{ "alarm", 27 },
8{ "arm_fadvise64_64", 270 },
9{ "arm_sync_file_range", 341 },
10{ "bdflush", 134 },
11{ "bind", 282 },
12{ "bpf", 386 },
13{ "brk", 45 },
14{ "capget", 184 },
15{ "capset", 185 },
16{ "chdir", 12 },
17{ "chmod", 15 },
18{ "chown", 182 },
19{ "chown32", 212 },
20{ "chroot", 61 },
21{ "clock_adjtime", 372 },
22{ "clock_getres", 264 },
23{ "clock_gettime", 263 },
24{ "clock_nanosleep", 265 },
25{ "clock_settime", 262 },
26{ "clone", 120 },
27{ "close", 6 },
28{ "connect", 283 },
29{ "creat", 8 },
30{ "delete_module", 129 },
31{ "dup2", 63 },
32{ "dup3", 358 },
33{ "dup", 41 },
34{ "epoll_create1", 357 },
35{ "epoll_create", 250 },
36{ "epoll_ctl", 251 },
37{ "epoll_pwait", 346 },
38{ "epoll_wait", 252 },
39{ "eventfd2", 356 },
40{ "eventfd", 351 },
41{ "execve", 11 },
42{ "exit", 1 },
43{ "exit_group", 248 },
44{ "faccessat", 334 },
45{ "faccessat2", 439 },
46{ "fallocate", 352 },
47{ "fanotify_init", 367 },
48{ "fanotify_mark", 368 },
49{ "fchdir", 133 },
50{ "fchmod", 94 },
51{ "fchmodat", 333 },
52{ "fchown32", 207 },
53{ "fchown", 95 },
54{ "fchownat", 325 },
55{ "fcntl", 55 },
56{ "fcntl64", 221 },
57{ "fdatasync", 148 },
58{ "fgetxattr", 231 },
59{ "finit_module", 379 },
60{ "flistxattr", 234 },
61{ "flock", 143 },
62{ "fork", 2 },
63{ "fremovexattr", 237 },
64{ "fsetxattr", 228 },
65{ "fstat", 108 },
66{ "fstat64", 197 },
67{ "fstatat64", 327 },
68{ "fstatfs", 100 },
69{ "fstatfs64", 267 },
70{ "fsync", 118 },
71{ "ftruncate64", 194 },
72{ "ftruncate", 93 },
73{ "futex", 240 },
74{ "futimesat", 326 },
75{ "getcpu", 345 },
76{ "getcwd", 183 },
77{ "getdents", 141 },
78{ "getdents64", 217 },
79{ "getegid32", 202 },
80{ "getegid", 50 },
81{ "geteuid32", 201 },
82{ "geteuid", 49 },
83{ "getgid32", 200 },
84{ "getgid", 47 },
85{ "getgroups32", 205 },
86{ "getgroups", 80 },
87{ "getitimer", 105 },
88{ "get_mempolicy", 320 },
89{ "getpeername", 287 },
90{ "getpgid", 132 },
91{ "getpgrp", 65 },
92{ "getpid", 20 },
93{ "getppid", 64 },
94{ "getpriority", 96 },
95{ "getrandom", 384 },
96{ "getresgid", 171 },
97{ "getresgid32", 211 },
98{ "getresuid", 165 },
99{ "getresuid32", 209 },
100{ "getrlimit", 76 },
101{ "get_robust_list", 339 },
102{ "getrusage", 77 },
103{ "getsid", 147 },
104{ "getsockname", 286 },
105{ "getsockopt", 295 },
106{ "gettid", 224 },
107{ "gettimeofday", 78 },
108{ "getuid", 24 },
109{ "getuid32", 199 },
110{ "getxattr", 229 },
111{ "init_module", 128 },
112{ "inotify_add_watch", 317 },
113{ "inotify_init1", 360 },
114{ "inotify_init", 316 },
115{ "inotify_rm_watch", 318 },
116{ "io_cancel", 247 },
117{ "ioctl", 54 },
118{ "io_destroy", 244 },
119{ "io_getevents", 245 },
120{ "ioprio_get", 315 },
121{ "ioprio_set", 314 },
122{ "io_setup", 243 },
123{ "io_submit", 246 },
124{ "ipc", 117 },
125{ "kcmp", 378 },
126{ "kexec_load", 347 },
127{ "keyctl", 311 },
128{ "kill", 37 },
129{ "lchown", 16 },
130{ "lchown32", 198 },
131{ "lgetxattr", 230 },
132{ "link", 9 },
133{ "linkat", 330 },
134{ "listen", 284 },
135{ "listxattr", 232 },
136{ "llistxattr", 233 },
137{ "_llseek", 140 },
138{ "lookup_dcookie", 249 },
139{ "lremovexattr", 236 },
140{ "lseek", 19 },
141{ "lsetxattr", 227 },
142{ "lstat", 107 },
143{ "lstat64", 196 },
144{ "madvise", 220 },
145{ "mbind", 319 },
146{ "memfd_create", 385 },
147{ "mincore", 219 },
148{ "mkdir", 39 },
149{ "mkdirat", 323 },
150{ "mknod", 14 },
151{ "mknodat", 324 },
152{ "mlock", 150 },
153{ "mlockall", 152 },
154{ "mmap2", 192 },
155{ "mmap", 90 },
156{ "mount", 21 },
157{ "move_pages", 344 },
158{ "mprotect", 125 },
159{ "mq_getsetattr", 279 },
160{ "mq_notify", 278 },
161{ "mq_open", 274 },
162{ "mq_timedreceive", 277 },
163{ "mq_timedsend", 276 },
164{ "mq_unlink", 275 },
165{ "mremap", 163 },
166{ "msgctl", 304 },
167{ "msgget", 303 },
168{ "msgrcv", 302 },
169{ "msgsnd", 301 },
170{ "msync", 144 },
171{ "munlock", 151 },
172{ "munlockall", 153 },
173{ "munmap", 91 },
174{ "name_to_handle_at", 370 },
175{ "nanosleep", 162 },
176{ "_newselect", 142 },
177{ "nfsservctl", 169 },
178{ "nice", 34 },
179{ "open", 5 },
180{ "openat", 322 },
181{ "open_by_handle_at", 371 },
182{ "pause", 29 },
183{ "pciconfig_iobase", 271 },
184{ "pciconfig_read", 272 },
185{ "pciconfig_write", 273 },
186{ "perf_event_open", 364 },
187{ "personality", 136 },
188{ "pipe2", 359 },
189{ "pipe", 42 },
190{ "pivot_root", 218 },
191{ "poll", 168 },
192{ "ppoll", 336 },
193{ "prctl", 172 },
194{ "pread64", 180 },
195{ "preadv", 361 },
196{ "prlimit64", 369 },
197{ "process_vm_readv", 376 },
198{ "process_vm_writev", 377 },
199{ "pselect6", 335 },
200{ "ptrace", 26 },
201{ "pwrite64", 181 },
202{ "pwritev", 362 },
203{ "quotactl", 131 },
204{ "read", 3 },
205{ "readahead", 225 },
206{ "readdir", 89 },
207{ "readlink", 85 },
208{ "readlinkat", 332 },
209{ "readv", 145 },
210{ "reboot", 88 },
211{ "recv", 291 },
212{ "recvfrom", 292 },
213{ "recvmmsg", 365 },
214{ "recvmsg", 297 },
215{ "remap_file_pages", 253 },
216{ "removexattr", 235 },
217{ "rename", 38 },
218{ "renameat2", 382 },
219{ "renameat", 329 },
220{ "request_key", 310 },
221{ "rmdir", 40 },
222{ "rt_sigaction", 174 },
223{ "rt_sigpending", 176 },
224{ "rt_sigprocmask", 175 },
225{ "rt_sigqueueinfo", 178 },
226{ "rt_sigreturn", 173 },
227{ "rt_sigsuspend", 179 },
228{ "rt_sigtimedwait", 177 },
229{ "rt_tgsigqueueinfo", 363 },
230{ "sched_getaffinity", 242 },
231{ "sched_getattr", 381 },
232{ "sched_getparam", 155 },
233{ "sched_get_priority_max", 159 },
234{ "sched_get_priority_min", 160 },
235{ "sched_getscheduler", 157 },
236{ "sched_rr_get_interval", 161 },
237{ "sched_setaffinity", 241 },
238{ "sched_setattr", 380 },
239{ "sched_setparam", 154 },
240{ "sched_setscheduler", 156 },
241{ "sched_yield", 158 },
242{ "seccomp", 383 },
243{ "select", 82 },
244{ "semctl", 300 },
245{ "semget", 299 },
246{ "semop", 298 },
247{ "semtimedop", 312 },
248{ "send", 289 },
249{ "sendfile", 187 },
250{ "sendfile64", 239 },
251{ "sendmmsg", 374 },
252{ "sendmsg", 296 },
253{ "sendto", 290 },
254{ "setdomainname", 121 },
255{ "setfsgid", 139 },
256{ "setfsgid32", 216 },
257{ "setfsuid", 138 },
258{ "setfsuid32", 215 },
259{ "setgid32", 214 },
260{ "setgid", 46 },
261{ "setgroups32", 206 },
262{ "setgroups", 81 },
263{ "sethostname", 74 },
264{ "setitimer", 104 },
265{ "set_mempolicy", 321 },
266{ "setns", 375 },
267{ "setpgid", 57 },
268{ "setpriority", 97 },
269{ "setregid32", 204 },
270{ "setregid", 71 },
271{ "setresgid", 170 },
272{ "setresgid32", 210 },
273{ "setresuid", 164 },
274{ "setresuid32", 208 },
275{ "setreuid32", 203 },
276{ "setreuid", 70 },
277{ "setrlimit", 75 },
278{ "set_robust_list", 338 },
279{ "setsid", 66 },
280{ "setsockopt", 294 },
281{ "set_tid_address", 256 },
282{ "settimeofday", 79 },
283{ "setuid", 23 },
284{ "setuid32", 213 },
285{ "setxattr", 226 },
286{ "shmat", 305 },
287{ "shmctl", 308 },
288{ "shmdt", 306 },
289{ "shmget", 307 },
290{ "shutdown", 293 },
291{ "sigaction", 67 },
292{ "sigaltstack", 186 },
293{ "signalfd", 349 },
294{ "signalfd4", 355 },
295{ "sigpending", 73 },
296{ "sigprocmask", 126 },
297{ "sigreturn", 119 },
298{ "sigsuspend", 72 },
299{ "socket", 281 },
300{ "socketcall", 102 },
301{ "socketpair", 288 },
302{ "splice", 340 },
303{ "stat", 106 },
304{ "stat64", 195 },
305{ "statfs64", 266 },
306{ "statfs", 99 },
307{ "stime", 25 },
308{ "swapoff", 115 },
309{ "swapon", 87 },
310{ "symlink", 83 },
311{ "symlinkat", 331 },
312{ "sync", 36 },
313{ "sync_file_range2", 341 },
314{ "syncfs", 373 },
315{ "syscall", 113 },
316{ "_sysctl", 149 },
317{ "sysfs", 135 },
318{ "sysinfo", 116 },
319{ "syslog", 103 },
320{ "tee", 342 },
321{ "tgkill", 268 },
322{ "time", 13 },
323{ "timer_create", 257 },
324{ "timer_delete", 261 },
325{ "timerfd_create", 350 },
326{ "timerfd_gettime", 354 },
327{ "timerfd_settime", 353 },
328{ "timer_getoverrun", 260 },
329{ "timer_gettime", 259 },
330{ "timer_settime", 258 },
331{ "times", 43 },
332{ "tkill", 238 },
333{ "truncate64", 193 },
334{ "truncate", 92 },
335{ "ugetrlimit", 191 },
336{ "umask", 60 },
337{ "umount", 22 },
338{ "umount2", 52 },
339{ "uname", 122 },
340{ "unlink", 10 },
341{ "unlinkat", 328 },
342{ "unshare", 337 },
343{ "uselib", 86 },
344{ "ustat", 62 },
345{ "utime", 30 },
346{ "utimensat", 348 },
347{ "utimes", 269 },
348{ "vfork", 190 },
349{ "vhangup", 111 },
350{ "vmsplice", 343 },
351{ "vserver", 313 },
352{ "wait4", 114 },
353{ "waitid", 280 },
354{ "write", 4 },
355{ "writev", 146 },
diff --git a/src/include/syscall_i386.h b/src/include/syscall_i386.h
new file mode 100644
index 000000000..752e11f24
--- /dev/null
+++ b/src/include/syscall_i386.h
@@ -0,0 +1,426 @@
1{ "_llseek", 140 },
2{ "_newselect", 142 },
3{ "_sysctl", 149 },
4{ "accept4", 364 },
5{ "access", 33 },
6{ "acct", 51 },
7{ "add_key", 286 },
8{ "adjtimex", 124 },
9{ "afs_syscall", 137 },
10{ "alarm", 27 },
11{ "arch_prctl", 384 },
12{ "bdflush", 134 },
13{ "bind", 361 },
14{ "bpf", 357 },
15{ "break", 17 },
16{ "brk", 45 },
17{ "capget", 184 },
18{ "capset", 185 },
19{ "chdir", 12 },
20{ "chmod", 15 },
21{ "chown", 182 },
22{ "chown32", 212 },
23{ "chroot", 61 },
24{ "clock_adjtime", 343 },
25{ "clock_adjtime64", 405 },
26{ "clock_getres", 266 },
27{ "clock_getres_time64", 406 },
28{ "clock_gettime", 265 },
29{ "clock_gettime64", 403 },
30{ "clock_nanosleep", 267 },
31{ "clock_nanosleep_time64", 407 },
32{ "clock_settime", 264 },
33{ "clock_settime64", 404 },
34{ "clone", 120 },
35{ "clone3", 435 },
36{ "close", 6 },
37{ "connect", 362 },
38{ "copy_file_range", 377 },
39{ "creat", 8 },
40{ "create_module", 127 },
41{ "delete_module", 129 },
42{ "dup", 41 },
43{ "dup2", 63 },
44{ "dup3", 330 },
45{ "epoll_create", 254 },
46{ "epoll_create1", 329 },
47{ "epoll_ctl", 255 },
48{ "epoll_pwait", 319 },
49{ "epoll_wait", 256 },
50{ "eventfd", 323 },
51{ "eventfd2", 328 },
52{ "execve", 11 },
53{ "execveat", 358 },
54{ "exit", 1 },
55{ "exit_group", 252 },
56{ "faccessat", 307 },
57{ "faccessat2", 439 },
58{ "fadvise64", 250 },
59{ "fadvise64_64", 272 },
60{ "fallocate", 324 },
61{ "fanotify_init", 338 },
62{ "fanotify_mark", 339 },
63{ "fchdir", 133 },
64{ "fchmod", 94 },
65{ "fchmodat", 306 },
66{ "fchown", 95 },
67{ "fchown32", 207 },
68{ "fchownat", 298 },
69{ "fcntl", 55 },
70{ "fcntl64", 221 },
71{ "fdatasync", 148 },
72{ "fgetxattr", 231 },
73{ "finit_module", 350 },
74{ "flistxattr", 234 },
75{ "flock", 143 },
76{ "fork", 2 },
77{ "fremovexattr", 237 },
78{ "fsconfig", 431 },
79{ "fsetxattr", 228 },
80{ "fsmount", 432 },
81{ "fsopen", 430 },
82{ "fspick", 433 },
83{ "fstat", 108 },
84{ "fstat64", 197 },
85{ "fstatat64", 300 },
86{ "fstatfs", 100 },
87{ "fstatfs64", 269 },
88{ "fsync", 118 },
89{ "ftime", 35 },
90{ "ftruncate", 93 },
91{ "ftruncate64", 194 },
92{ "futex", 240 },
93{ "futex_time64", 422 },
94{ "futimesat", 299 },
95{ "get_kernel_syms", 130 },
96{ "get_mempolicy", 275 },
97{ "get_robust_list", 312 },
98{ "get_thread_area", 244 },
99{ "getcpu", 318 },
100{ "getcwd", 183 },
101{ "getdents", 141 },
102{ "getdents64", 220 },
103{ "getegid", 50 },
104{ "getegid32", 202 },
105{ "geteuid", 49 },
106{ "geteuid32", 201 },
107{ "getgid", 47 },
108{ "getgid32", 200 },
109{ "getgroups", 80 },
110{ "getgroups32", 205 },
111{ "getitimer", 105 },
112{ "getpeername", 368 },
113{ "getpgid", 132 },
114{ "getpgrp", 65 },
115{ "getpid", 20 },
116{ "getpmsg", 188 },
117{ "getppid", 64 },
118{ "getpriority", 96 },
119{ "getrandom", 355 },
120{ "getresgid", 171 },
121{ "getresgid32", 211 },
122{ "getresuid", 165 },
123{ "getresuid32", 209 },
124{ "getrlimit", 76 },
125{ "getrusage", 77 },
126{ "getsid", 147 },
127{ "getsockname", 367 },
128{ "getsockopt", 365 },
129{ "gettid", 224 },
130{ "gettimeofday", 78 },
131{ "getuid", 24 },
132{ "getuid32", 199 },
133{ "getxattr", 229 },
134{ "gtty", 32 },
135{ "idle", 112 },
136{ "init_module", 128 },
137{ "inotify_add_watch", 292 },
138{ "inotify_init", 291 },
139{ "inotify_init1", 332 },
140{ "inotify_rm_watch", 293 },
141{ "io_cancel", 249 },
142{ "io_destroy", 246 },
143{ "io_getevents", 247 },
144{ "io_pgetevents", 385 },
145{ "io_pgetevents_time64", 416 },
146{ "io_setup", 245 },
147{ "io_submit", 248 },
148{ "io_uring_enter", 426 },
149{ "io_uring_register", 427 },
150{ "io_uring_setup", 425 },
151{ "ioctl", 54 },
152{ "ioperm", 101 },
153{ "iopl", 110 },
154{ "ioprio_get", 290 },
155{ "ioprio_set", 289 },
156{ "ipc", 117 },
157{ "kcmp", 349 },
158{ "kexec_load", 283 },
159{ "keyctl", 288 },
160{ "kill", 37 },
161{ "lchown", 16 },
162{ "lchown32", 198 },
163{ "lgetxattr", 230 },
164{ "link", 9 },
165{ "linkat", 303 },
166{ "listen", 363 },
167{ "listxattr", 232 },
168{ "llistxattr", 233 },
169{ "lock", 53 },
170{ "lookup_dcookie", 253 },
171{ "lremovexattr", 236 },
172{ "lseek", 19 },
173{ "lsetxattr", 227 },
174{ "lstat", 107 },
175{ "lstat64", 196 },
176{ "madvise", 219 },
177{ "mbind", 274 },
178{ "membarrier", 375 },
179{ "memfd_create", 356 },
180{ "migrate_pages", 294 },
181{ "mincore", 218 },
182{ "mkdir", 39 },
183{ "mkdirat", 296 },
184{ "mknod", 14 },
185{ "mknodat", 297 },
186{ "mlock", 150 },
187{ "mlock2", 376 },
188{ "mlockall", 152 },
189{ "mmap", 90 },
190{ "mmap2", 192 },
191{ "modify_ldt", 123 },
192{ "mount", 21 },
193{ "move_mount", 429 },
194{ "move_pages", 317 },
195{ "mprotect", 125 },
196{ "mpx", 56 },
197{ "mq_getsetattr", 282 },
198{ "mq_notify", 281 },
199{ "mq_open", 277 },
200{ "mq_timedreceive", 280 },
201{ "mq_timedreceive_time64", 419 },
202{ "mq_timedsend", 279 },
203{ "mq_timedsend_time64", 418 },
204{ "mq_unlink", 278 },
205{ "mremap", 163 },
206{ "msgctl", 402 },
207{ "msgget", 399 },
208{ "msgrcv", 401 },
209{ "msgsnd", 400 },
210{ "msync", 144 },
211{ "munlock", 151 },
212{ "munlockall", 153 },
213{ "munmap", 91 },
214{ "name_to_handle_at", 341 },
215{ "nanosleep", 162 },
216{ "nfsservctl", 169 },
217{ "nice", 34 },
218{ "oldfstat", 28 },
219{ "oldlstat", 84 },
220{ "oldolduname", 59 },
221{ "oldstat", 18 },
222{ "olduname", 109 },
223{ "open", 5 },
224{ "open_by_handle_at", 342 },
225{ "open_tree", 428 },
226{ "openat", 295 },
227{ "pause", 29 },
228{ "perf_event_open", 336 },
229{ "personality", 136 },
230{ "pidfd_open", 434 },
231{ "pidfd_send_signal", 424 },
232{ "pipe", 42 },
233{ "pipe2", 331 },
234{ "pivot_root", 217 },
235{ "pkey_alloc", 381 },
236{ "pkey_free", 382 },
237{ "pkey_mprotect", 380 },
238{ "poll", 168 },
239{ "ppoll", 309 },
240{ "ppoll_time64", 414 },
241{ "prctl", 172 },
242{ "pread64", 180 },
243{ "preadv", 333 },
244{ "preadv2", 378 },
245{ "prlimit64", 340 },
246{ "process_vm_readv", 347 },
247{ "process_vm_writev", 348 },
248{ "prof", 44 },
249{ "profil", 98 },
250{ "pselect6", 308 },
251{ "pselect6_time64", 413 },
252{ "ptrace", 26 },
253{ "putpmsg", 189 },
254{ "pwrite64", 181 },
255{ "pwritev", 334 },
256{ "pwritev2", 379 },
257{ "query_module", 167 },
258{ "quotactl", 131 },
259{ "read", 3 },
260{ "readahead", 225 },
261{ "readdir", 89 },
262{ "readlink", 85 },
263{ "readlinkat", 305 },
264{ "readv", 145 },
265{ "reboot", 88 },
266{ "recvfrom", 371 },
267{ "recvmmsg", 337 },
268{ "recvmmsg_time64", 417 },
269{ "recvmsg", 372 },
270{ "remap_file_pages", 257 },
271{ "removexattr", 235 },
272{ "rename", 38 },
273{ "renameat", 302 },
274{ "renameat2", 353 },
275{ "request_key", 287 },
276{ "restart_syscall", 0 },
277{ "rmdir", 40 },
278{ "rseq", 386 },
279{ "rt_sigaction", 174 },
280{ "rt_sigpending", 176 },
281{ "rt_sigprocmask", 175 },
282{ "rt_sigqueueinfo", 178 },
283{ "rt_sigreturn", 173 },
284{ "rt_sigsuspend", 179 },
285{ "rt_sigtimedwait", 177 },
286{ "rt_sigtimedwait_time64", 421 },
287{ "rt_tgsigqueueinfo", 335 },
288{ "sched_get_priority_max", 159 },
289{ "sched_get_priority_min", 160 },
290{ "sched_getaffinity", 242 },
291{ "sched_getattr", 352 },
292{ "sched_getparam", 155 },
293{ "sched_getscheduler", 157 },
294{ "sched_rr_get_interval", 161 },
295{ "sched_rr_get_interval_time64", 423 },
296{ "sched_setaffinity", 241 },
297{ "sched_setattr", 351 },
298{ "sched_setparam", 154 },
299{ "sched_setscheduler", 156 },
300{ "sched_yield", 158 },
301{ "seccomp", 354 },
302{ "select", 82 },
303{ "semctl", 394 },
304{ "semget", 393 },
305{ "semtimedop_time64", 420 },
306{ "sendfile", 187 },
307{ "sendfile64", 239 },
308{ "sendmmsg", 345 },
309{ "sendmsg", 370 },
310{ "sendto", 369 },
311{ "set_mempolicy", 276 },
312{ "set_robust_list", 311 },
313{ "set_thread_area", 243 },
314{ "set_tid_address", 258 },
315{ "setdomainname", 121 },
316{ "setfsgid", 139 },
317{ "setfsgid32", 216 },
318{ "setfsuid", 138 },
319{ "setfsuid32", 215 },
320{ "setgid", 46 },
321{ "setgid32", 214 },
322{ "setgroups", 81 },
323{ "setgroups32", 206 },
324{ "sethostname", 74 },
325{ "setitimer", 104 },
326{ "setns", 346 },
327{ "setpgid", 57 },
328{ "setpriority", 97 },
329{ "setregid", 71 },
330{ "setregid32", 204 },
331{ "setresgid", 170 },
332{ "setresgid32", 210 },
333{ "setresuid", 164 },
334{ "setresuid32", 208 },
335{ "setreuid", 70 },
336{ "setreuid32", 203 },
337{ "setrlimit", 75 },
338{ "setsid", 66 },
339{ "setsockopt", 366 },
340{ "settimeofday", 79 },
341{ "setuid", 23 },
342{ "setuid32", 213 },
343{ "setxattr", 226 },
344{ "sgetmask", 68 },
345{ "shmat", 397 },
346{ "shmctl", 396 },
347{ "shmdt", 398 },
348{ "shmget", 395 },
349{ "shutdown", 373 },
350{ "sigaction", 67 },
351{ "sigaltstack", 186 },
352{ "signal", 48 },
353{ "signalfd", 321 },
354{ "signalfd4", 327 },
355{ "sigpending", 73 },
356{ "sigprocmask", 126 },
357{ "sigreturn", 119 },
358{ "sigsuspend", 72 },
359{ "socket", 359 },
360{ "socketcall", 102 },
361{ "socketpair", 360 },
362{ "splice", 313 },
363{ "ssetmask", 69 },
364{ "stat", 106 },
365{ "stat64", 195 },
366{ "statfs", 99 },
367{ "statfs64", 268 },
368{ "statx", 383 },
369{ "stime", 25 },
370{ "stty", 31 },
371{ "swapoff", 115 },
372{ "swapon", 87 },
373{ "symlink", 83 },
374{ "symlinkat", 304 },
375{ "sync", 36 },
376{ "sync_file_range", 314 },
377{ "syncfs", 344 },
378{ "sysfs", 135 },
379{ "sysinfo", 116 },
380{ "syslog", 103 },
381{ "tee", 315 },
382{ "tgkill", 270 },
383{ "time", 13 },
384{ "timer_create", 259 },
385{ "timer_delete", 263 },
386{ "timer_getoverrun", 262 },
387{ "timer_gettime", 261 },
388{ "timer_gettime64", 408 },
389{ "timer_settime", 260 },
390{ "timer_settime64", 409 },
391{ "timerfd_create", 322 },
392{ "timerfd_gettime", 326 },
393{ "timerfd_gettime64", 410 },
394{ "timerfd_settime", 325 },
395{ "timerfd_settime64", 411 },
396{ "times", 43 },
397{ "tkill", 238 },
398{ "truncate", 92 },
399{ "truncate64", 193 },
400{ "ugetrlimit", 191 },
401{ "ulimit", 58 },
402{ "umask", 60 },
403{ "umount", 22 },
404{ "umount2", 52 },
405{ "uname", 122 },
406{ "unlink", 10 },
407{ "unlinkat", 301 },
408{ "unshare", 310 },
409{ "uselib", 86 },
410{ "userfaultfd", 374 },
411{ "ustat", 62 },
412{ "utime", 30 },
413{ "utimensat", 320 },
414{ "utimensat_time64", 412 },
415{ "utimes", 271 },
416{ "vfork", 190 },
417{ "vhangup", 111 },
418{ "vm86", 166 },
419{ "vm86old", 113 },
420{ "vmsplice", 316 },
421{ "vserver", 273 },
422{ "wait4", 114 },
423{ "waitid", 284 },
424{ "waitpid", 7 },
425{ "write", 4 },
426{ "writev", 146 },
diff --git a/src/include/syscall_x86_64.h b/src/include/syscall_x86_64.h
new file mode 100644
index 000000000..97f2762b1
--- /dev/null
+++ b/src/include/syscall_x86_64.h
@@ -0,0 +1,348 @@
1{ "_sysctl", 156 },
2{ "accept", 43 },
3{ "accept4", 288 },
4{ "access", 21 },
5{ "acct", 163 },
6{ "add_key", 248 },
7{ "adjtimex", 159 },
8{ "afs_syscall", 183 },
9{ "alarm", 37 },
10{ "arch_prctl", 158 },
11{ "bind", 49 },
12{ "bpf", 321 },
13{ "brk", 12 },
14{ "capget", 125 },
15{ "capset", 126 },
16{ "chdir", 80 },
17{ "chmod", 90 },
18{ "chown", 92 },
19{ "chroot", 161 },
20{ "clock_adjtime", 305 },
21{ "clock_getres", 229 },
22{ "clock_gettime", 228 },
23{ "clock_nanosleep", 230 },
24{ "clock_settime", 227 },
25{ "clone", 56 },
26{ "clone3", 435 },
27{ "close", 3 },
28{ "connect", 42 },
29{ "copy_file_range", 326 },
30{ "creat", 85 },
31{ "create_module", 174 },
32{ "delete_module", 176 },
33{ "dup", 32 },
34{ "dup2", 33 },
35{ "dup3", 292 },
36{ "epoll_create", 213 },
37{ "epoll_create1", 291 },
38{ "epoll_ctl", 233 },
39{ "epoll_ctl_old", 214 },
40{ "epoll_pwait", 281 },
41{ "epoll_wait", 232 },
42{ "epoll_wait_old", 215 },
43{ "eventfd", 284 },
44{ "eventfd2", 290 },
45{ "execve", 59 },
46{ "execveat", 322 },
47{ "exit", 60 },
48{ "exit_group", 231 },
49{ "faccessat", 269 },
50{ "faccessat2", 439 },
51{ "fadvise64", 221 },
52{ "fallocate", 285 },
53{ "fanotify_init", 300 },
54{ "fanotify_mark", 301 },
55{ "fchdir", 81 },
56{ "fchmod", 91 },
57{ "fchmodat", 268 },
58{ "fchown", 93 },
59{ "fchownat", 260 },
60{ "fcntl", 72 },
61{ "fdatasync", 75 },
62{ "fgetxattr", 193 },
63{ "finit_module", 313 },
64{ "flistxattr", 196 },
65{ "flock", 73 },
66{ "fork", 57 },
67{ "fremovexattr", 199 },
68{ "fsconfig", 431 },
69{ "fsetxattr", 190 },
70{ "fsmount", 432 },
71{ "fsopen", 430 },
72{ "fspick", 433 },
73{ "fstat", 5 },
74{ "fstatfs", 138 },
75{ "fsync", 74 },
76{ "ftruncate", 77 },
77{ "futex", 202 },
78{ "futimesat", 261 },
79{ "get_kernel_syms", 177 },
80{ "get_mempolicy", 239 },
81{ "get_robust_list", 274 },
82{ "get_thread_area", 211 },
83{ "getcpu", 309 },
84{ "getcwd", 79 },
85{ "getdents", 78 },
86{ "getdents64", 217 },
87{ "getegid", 108 },
88{ "geteuid", 107 },
89{ "getgid", 104 },
90{ "getgroups", 115 },
91{ "getitimer", 36 },
92{ "getpeername", 52 },
93{ "getpgid", 121 },
94{ "getpgrp", 111 },
95{ "getpid", 39 },
96{ "getpmsg", 181 },
97{ "getppid", 110 },
98{ "getpriority", 140 },
99{ "getrandom", 318 },
100{ "getresgid", 120 },
101{ "getresuid", 118 },
102{ "getrlimit", 97 },
103{ "getrusage", 98 },
104{ "getsid", 124 },
105{ "getsockname", 51 },
106{ "getsockopt", 55 },
107{ "gettid", 186 },
108{ "gettimeofday", 96 },
109{ "getuid", 102 },
110{ "getxattr", 191 },
111{ "init_module", 175 },
112{ "inotify_add_watch", 254 },
113{ "inotify_init", 253 },
114{ "inotify_init1", 294 },
115{ "inotify_rm_watch", 255 },
116{ "io_cancel", 210 },
117{ "io_destroy", 207 },
118{ "io_getevents", 208 },
119{ "io_pgetevents", 333 },
120{ "io_setup", 206 },
121{ "io_submit", 209 },
122{ "io_uring_enter", 426 },
123{ "io_uring_register", 427 },
124{ "io_uring_setup", 425 },
125{ "ioctl", 16 },
126{ "ioperm", 173 },
127{ "iopl", 172 },
128{ "ioprio_get", 252 },
129{ "ioprio_set", 251 },
130{ "kcmp", 312 },
131{ "kexec_file_load", 320 },
132{ "kexec_load", 246 },
133{ "keyctl", 250 },
134{ "kill", 62 },
135{ "lchown", 94 },
136{ "lgetxattr", 192 },
137{ "link", 86 },
138{ "linkat", 265 },
139{ "listen", 50 },
140{ "listxattr", 194 },
141{ "llistxattr", 195 },
142{ "lookup_dcookie", 212 },
143{ "lremovexattr", 198 },
144{ "lseek", 8 },
145{ "lsetxattr", 189 },
146{ "lstat", 6 },
147{ "madvise", 28 },
148{ "mbind", 237 },
149{ "membarrier", 324 },
150{ "memfd_create", 319 },
151{ "migrate_pages", 256 },
152{ "mincore", 27 },
153{ "mkdir", 83 },
154{ "mkdirat", 258 },
155{ "mknod", 133 },
156{ "mknodat", 259 },
157{ "mlock", 149 },
158{ "mlock2", 325 },
159{ "mlockall", 151 },
160{ "mmap", 9 },
161{ "modify_ldt", 154 },
162{ "mount", 165 },
163{ "move_mount", 429 },
164{ "move_pages", 279 },
165{ "mprotect", 10 },
166{ "mq_getsetattr", 245 },
167{ "mq_notify", 244 },
168{ "mq_open", 240 },
169{ "mq_timedreceive", 243 },
170{ "mq_timedsend", 242 },
171{ "mq_unlink", 241 },
172{ "mremap", 25 },
173{ "msgctl", 71 },
174{ "msgget", 68 },
175{ "msgrcv", 70 },
176{ "msgsnd", 69 },
177{ "msync", 26 },
178{ "munlock", 150 },
179{ "munlockall", 152 },
180{ "munmap", 11 },
181{ "name_to_handle_at", 303 },
182{ "nanosleep", 35 },
183{ "newfstatat", 262 },
184{ "nfsservctl", 180 },
185{ "open", 2 },
186{ "open_by_handle_at", 304 },
187{ "open_tree", 428 },
188{ "openat", 257 },
189{ "pause", 34 },
190{ "perf_event_open", 298 },
191{ "personality", 135 },
192{ "pidfd_open", 434 },
193{ "pidfd_send_signal", 424 },
194{ "pipe", 22 },
195{ "pipe2", 293 },
196{ "pivot_root", 155 },
197{ "pkey_alloc", 330 },
198{ "pkey_free", 331 },
199{ "pkey_mprotect", 329 },
200{ "poll", 7 },
201{ "ppoll", 271 },
202{ "prctl", 157 },
203{ "pread64", 17 },
204{ "preadv", 295 },
205{ "preadv2", 327 },
206{ "prlimit64", 302 },
207{ "process_vm_readv", 310 },
208{ "process_vm_writev", 311 },
209{ "pselect6", 270 },
210{ "ptrace", 101 },
211{ "putpmsg", 182 },
212{ "pwrite64", 18 },
213{ "pwritev", 296 },
214{ "pwritev2", 328 },
215{ "query_module", 178 },
216{ "quotactl", 179 },
217{ "read", 0 },
218{ "readahead", 187 },
219{ "readlink", 89 },
220{ "readlinkat", 267 },
221{ "readv", 19 },
222{ "reboot", 169 },
223{ "recvfrom", 45 },
224{ "recvmmsg", 299 },
225{ "recvmsg", 47 },
226{ "remap_file_pages", 216 },
227{ "removexattr", 197 },
228{ "rename", 82 },
229{ "renameat", 264 },
230{ "renameat2", 316 },
231{ "request_key", 249 },
232{ "restart_syscall", 219 },
233{ "rmdir", 84 },
234{ "rseq", 334 },
235{ "rt_sigaction", 13 },
236{ "rt_sigpending", 127 },
237{ "rt_sigprocmask", 14 },
238{ "rt_sigqueueinfo", 129 },
239{ "rt_sigreturn", 15 },
240{ "rt_sigsuspend", 130 },
241{ "rt_sigtimedwait", 128 },
242{ "rt_tgsigqueueinfo", 297 },
243{ "sched_get_priority_max", 146 },
244{ "sched_get_priority_min", 147 },
245{ "sched_getaffinity", 204 },
246{ "sched_getattr", 315 },
247{ "sched_getparam", 143 },
248{ "sched_getscheduler", 145 },
249{ "sched_rr_get_interval", 148 },
250{ "sched_setaffinity", 203 },
251{ "sched_setattr", 314 },
252{ "sched_setparam", 142 },
253{ "sched_setscheduler", 144 },
254{ "sched_yield", 24 },
255{ "seccomp", 317 },
256{ "security", 185 },
257{ "select", 23 },
258{ "semctl", 66 },
259{ "semget", 64 },
260{ "semop", 65 },
261{ "semtimedop", 220 },
262{ "sendfile", 40 },
263{ "sendmmsg", 307 },
264{ "sendmsg", 46 },
265{ "sendto", 44 },
266{ "set_mempolicy", 238 },
267{ "set_robust_list", 273 },
268{ "set_thread_area", 205 },
269{ "set_tid_address", 218 },
270{ "setdomainname", 171 },
271{ "setfsgid", 123 },
272{ "setfsuid", 122 },
273{ "setgid", 106 },
274{ "setgroups", 116 },
275{ "sethostname", 170 },
276{ "setitimer", 38 },
277{ "setns", 308 },
278{ "setpgid", 109 },
279{ "setpriority", 141 },
280{ "setregid", 114 },
281{ "setresgid", 119 },
282{ "setresuid", 117 },
283{ "setreuid", 113 },
284{ "setrlimit", 160 },
285{ "setsid", 112 },
286{ "setsockopt", 54 },
287{ "settimeofday", 164 },
288{ "setuid", 105 },
289{ "setxattr", 188 },
290{ "shmat", 30 },
291{ "shmctl", 31 },
292{ "shmdt", 67 },
293{ "shmget", 29 },
294{ "shutdown", 48 },
295{ "sigaltstack", 131 },
296{ "signalfd", 282 },
297{ "signalfd4", 289 },
298{ "socket", 41 },
299{ "socketpair", 53 },
300{ "splice", 275 },
301{ "stat", 4 },
302{ "statfs", 137 },
303{ "statx", 332 },
304{ "swapoff", 168 },
305{ "swapon", 167 },
306{ "symlink", 88 },
307{ "symlinkat", 266 },
308{ "sync", 162 },
309{ "sync_file_range", 277 },
310{ "syncfs", 306 },
311{ "sysfs", 139 },
312{ "sysinfo", 99 },
313{ "syslog", 103 },
314{ "tee", 276 },
315{ "tgkill", 234 },
316{ "time", 201 },
317{ "timer_create", 222 },
318{ "timer_delete", 226 },
319{ "timer_getoverrun", 225 },
320{ "timer_gettime", 224 },
321{ "timer_settime", 223 },
322{ "timerfd_create", 283 },
323{ "timerfd_gettime", 287 },
324{ "timerfd_settime", 286 },
325{ "times", 100 },
326{ "tkill", 200 },
327{ "truncate", 76 },
328{ "tuxcall", 184 },
329{ "umask", 95 },
330{ "umount2", 166 },
331{ "uname", 63 },
332{ "unlink", 87 },
333{ "unlinkat", 263 },
334{ "unshare", 272 },
335{ "uselib", 134 },
336{ "userfaultfd", 323 },
337{ "ustat", 136 },
338{ "utime", 132 },
339{ "utimensat", 280 },
340{ "utimes", 235 },
341{ "vfork", 58 },
342{ "vhangup", 153 },
343{ "vmsplice", 278 },
344{ "vserver", 236 },
345{ "wait4", 61 },
346{ "waitid", 247 },
347{ "write", 1 },
348{ "writev", 20 },
diff --git a/src/jailcheck/Makefile.in b/src/jailcheck/Makefile.in
new file mode 100644
index 000000000..d218c1f90
--- /dev/null
+++ b/src/jailcheck/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: jailcheck
3
4include ../common.mk
5
6%.o : %.c $(H_FILE_LIST) ../include/common.h ../include/pid.h
7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
8
9jailcheck: $(OBJS)
10 $(CC) $(LDFLAGS) -o $@ $(OBJS) ../lib/common.o ../lib/pid.o $(LIBS) $(EXTRA_LDFLAGS)
11
12.PHONY: clean
13clean:; rm -fr *.o jailcheck *.gcov *.gcda *.gcno *.plist
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/jailcheck/access.c b/src/jailcheck/access.c
new file mode 100644
index 000000000..3c2f46495
--- /dev/null
+++ b/src/jailcheck/access.c
@@ -0,0 +1,143 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include <dirent.h>
22#include <sys/wait.h>
23
24typedef struct {
25 char *tfile;
26 char *tdir;
27} TestDir;
28
29#define MAX_TEST_FILES 16
30TestDir td[MAX_TEST_FILES];
31static int files_cnt = 0;
32
33void access_setup(const char *directory) {
34 // I am root!
35 assert(directory);
36 assert(user_home_dir);
37
38 if (files_cnt >= MAX_TEST_FILES) {
39 fprintf(stderr, "Error: maximum number of test directories exceeded\n");
40 exit(1);
41 }
42
43 char *fname = strdup(directory);
44 if (!fname)
45 errExit("strdup");
46 if (strncmp(fname, "~/", 2) == 0) {
47 free(fname);
48 if (asprintf(&fname, "%s/%s", user_home_dir, directory + 2) == -1)
49 errExit("asprintf");
50 }
51
52 char *path = realpath(fname, NULL);
53 free(fname);
54 if (path == NULL) {
55 fprintf(stderr, "Warning: invalid directory %s, skipping...\n", directory);
56 return;
57 }
58
59 // file in home directory
60 if (strncmp(path, user_home_dir, strlen(user_home_dir)) != 0) {
61 fprintf(stderr, "Warning: file %s is not in user home directory, skipping...\n", directory);
62 free(path);
63 return;
64 }
65
66 // try to open the dir as root
67 DIR *dir = opendir(path);
68 if (!dir) {
69 fprintf(stderr, "Warning: directory %s not found, skipping\n", directory);
70 free(path);
71 return;
72 }
73 closedir(dir);
74
75 // create a test file
76 char *test_file;
77 if (asprintf(&test_file, "%s/jailcheck-access-%d", path, getpid()) == -1)
78 errExit("asprintf");
79
80 FILE *fp = fopen(test_file, "w");
81 if (!fp) {
82 printf("Warning: I cannot create test file in directory %s, skipping...\n", directory);
83 return;
84 }
85 fprintf(fp, "this file was created by firetest utility, you can safely delete it\n");
86 fclose(fp);
87 int rv = chown(test_file, user_uid, user_gid);
88 if (rv)
89 errExit("chown");
90
91 char *dname = strdup(directory);
92 if (!dname)
93 errExit("strdup");
94 td[files_cnt].tdir = dname;
95 td[files_cnt].tfile = test_file;
96 files_cnt++;
97}
98
99void access_destroy(void) {
100 // remove test files
101 int i;
102
103 for (i = 0; i < files_cnt; i++) {
104 int rv = unlink(td[i].tfile);
105 (void) rv;
106 }
107 files_cnt = 0;
108}
109
110void access_test(void) {
111 // I am root in sandbox mount namespace
112 assert(user_uid);
113 int i;
114
115 pid_t child = fork();
116 if (child == -1)
117 errExit("fork");
118
119 if (child == 0) { // child
120 // drop privileges
121 if (setgid(user_gid) != 0)
122 errExit("setgid");
123 if (setuid(user_uid) != 0)
124 errExit("setuid");
125
126 for (i = 0; i < files_cnt; i++) {
127 assert(td[i].tfile);
128
129 // try to open the file for reading
130 FILE *fp = fopen(td[i].tfile, "r");
131 if (fp) {
132
133 printf(" Warning: I can read %s\n", td[i].tdir);
134 fclose(fp);
135 }
136 }
137 exit(0);
138 }
139
140 // wait for the child to finish
141 int status;
142 wait(&status);
143}
diff --git a/src/jailcheck/apparmor.c b/src/jailcheck/apparmor.c
new file mode 100644
index 000000000..64f278046
--- /dev/null
+++ b/src/jailcheck/apparmor.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21
22#ifdef HAVE_APPARMOR
23#include <sys/apparmor.h>
24
25void apparmor_test(pid_t pid) {
26 char *label = NULL;
27 char *mode = NULL;
28 int rv = aa_gettaskcon(pid, &label, &mode);
29 if (rv == -1 || mode == NULL)
30 printf(" Warning: AppArmor not enabled\n");
31}
32
33
34#else
35void apparmor_test(pid_t pid) {
36 (void) pid;
37 return;
38}
39#endif
40
diff --git a/src/jailcheck/jailcheck.h b/src/jailcheck/jailcheck.h
new file mode 100644
index 000000000..be3104da3
--- /dev/null
+++ b/src/jailcheck/jailcheck.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#ifndef JAILCHECK_H
21#define JAILCHECK_H
22
23#include "../include/common.h"
24
25// main.c
26extern uid_t user_uid;
27extern gid_t user_gid;
28extern char *user_name;
29extern char *user_home_dir;
30extern char *user_run_dir;
31
32// access.c
33void access_setup(const char *directory);
34void access_test(void);
35void access_destroy(void);
36
37// noexec.c
38void noexec_setup(void);
39void noexec_test(const char *msg);
40
41// sysfiles.c
42void sysfiles_setup(const char *file);
43void sysfiles_test(void);
44
45// virtual.c
46void virtual_setup(const char *directory);
47void virtual_destroy(void);
48void virtual_test(void);
49
50// apparmor.c
51void apparmor_test(pid_t pid);
52
53// seccomp.c
54void seccomp_test(pid_t pid);
55
56// network.c
57void network_test(void);
58// utils.c
59char *get_sudo_user(void);
60char *get_homedir(const char *user, uid_t *uid, gid_t *gid);
61int find_child(pid_t pid);
62pid_t switch_to_child(pid_t pid);
63
64#endif \ No newline at end of file
diff --git a/src/jailcheck/main.c b/src/jailcheck/main.c
new file mode 100644
index 000000000..812ac5808
--- /dev/null
+++ b/src/jailcheck/main.c
@@ -0,0 +1,215 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include "../include/firejail_user.h"
22#include "../include/pid.h"
23#include <sys/wait.h>
24
25uid_t user_uid = 0;
26gid_t user_gid = 0;
27char *user_name = NULL;
28char *user_home_dir = NULL;
29char *user_run_dir = NULL;
30int arg_debug = 0;
31
32static char *usage_str =
33 "Usage: jailcheck [options] directory [directory]\n\n"
34 "Options:\n"
35 " --debug - print debug messages.\n"
36 " --help, -? - this help screen.\n"
37 " --version - print program version and exit.\n";
38
39
40static void usage(void) {
41 printf("firetest - version %s\n\n", VERSION);
42 puts(usage_str);
43}
44
45static void cleanup(void) {
46 // running only as root
47 if (getuid() == 0) {
48 if (arg_debug)
49 printf("cleaning up!\n");
50 access_destroy();
51 virtual_destroy();
52 }
53}
54
55int main(int argc, char **argv) {
56 int i;
57 int findex = 0;
58
59 for (i = 1; i < argc; i++) {
60 if (strcmp(argv[i], "-?") == 0 || strcmp(argv[i], "--help") == 0) {
61 usage();
62 return 0;
63 }
64 else if (strcmp(argv[i], "--version") == 0) {
65 printf("firetest version %s\n\n", VERSION);
66 return 0;
67 }
68 else if (strncmp(argv[i], "--hello=", 8) == 0) { // used by noexec test
69 printf(" Warning: I can run programs in %s\n", argv[i] + 8);
70 return 0;
71 }
72 else if (strcmp(argv[i], "--debug") == 0)
73 arg_debug = 1;
74 else if (strncmp(argv[i], "--", 2) == 0) {
75 fprintf(stderr, "Error: invalid option\n");
76 return 1;
77 }
78 else {
79 findex = i;
80 break;
81 }
82 }
83
84 // user setup
85 if (getuid() != 0) {
86 fprintf(stderr, "Error: you need to be root (via sudo) to run this program\n");
87 exit(1);
88 }
89 user_name = get_sudo_user();
90 assert(user_name);
91 user_home_dir = get_homedir(user_name, &user_uid, &user_gid);
92 if (user_uid == 0) {
93 fprintf(stderr, "Error: root user not supported\n");
94 exit(1);
95 }
96 if (asprintf(&user_run_dir, "/run/user/%d", user_uid) == -1)
97 errExit("asprintf");
98
99 // test setup
100 atexit(cleanup);
101 access_setup("~/.ssh");
102 access_setup("~/.gnupg");
103 if (findex > 0) {
104 for (i = findex; i < argc; i++)
105 access_setup(argv[i]);
106 }
107
108 noexec_setup();
109 virtual_setup(user_home_dir);
110 virtual_setup("/tmp");
111 virtual_setup("/var/tmp");
112 virtual_setup("/dev");
113 virtual_setup("/etc");
114 virtual_setup("/bin");
115 virtual_setup("/usr/share");
116 virtual_setup(user_run_dir);
117 // basic sysfiles
118 sysfiles_setup("/etc/shadow");
119 sysfiles_setup("/etc/gshadow");
120 sysfiles_setup("/usr/bin/mount");
121 sysfiles_setup("/usr/bin/su");
122 sysfiles_setup("/usr/bin/ksu");
123 sysfiles_setup("/usr/bin/sudo");
124 sysfiles_setup("/usr/bin/strace");
125 // X11
126 sysfiles_setup("/usr/bin/xev");
127 sysfiles_setup("/usr/bin/xinput");
128 // compilers
129 sysfiles_setup("/usr/bin/gcc");
130 sysfiles_setup("/usr/bin/clang");
131 // networking
132 sysfiles_setup("/usr/bin/dig");
133 sysfiles_setup("/usr/bin/nslookup");
134 sysfiles_setup("/usr/bin/resolvectl");
135 sysfiles_setup("/usr/bin/nc");
136 sysfiles_setup("/usr/bin/ncat");
137 sysfiles_setup("/usr/bin/nmap");
138 sysfiles_setup("/usr/sbin/tcpdump");
139 // terminals
140 sysfiles_setup("/usr/bin/gnome-terminal");
141 sysfiles_setup("/usr/bin/xfce4-terminal");
142 sysfiles_setup("/usr/bin/lxterminal");
143
144 // print processes
145 pid_read(0);
146 for (i = 0; i < max_pids; i++) {
147 if (pids[i].level == 1) {
148 uid_t uid = pid_get_uid(i);
149 if (uid != user_uid) // not interested in other user sandboxes
150 continue;
151
152 // in case the pid is that of a firejail process, use the pid of the first child process
153 uid_t pid = find_child(i);
154 printf("\n");
155 pid_print_list(i, 0); // no wrapping
156 apparmor_test(pid);
157 seccomp_test(pid);
158 fflush(0);
159
160 // filesystem tests
161 pid_t child = fork();
162 if (child == -1)
163 errExit("fork");
164 if (child == 0) {
165 int rv = join_namespace(pid, "mnt");
166 if (rv == 0) {
167 virtual_test();
168 noexec_test(user_home_dir);
169 noexec_test("/tmp");
170 noexec_test("/var/tmp");
171 noexec_test(user_run_dir);
172 access_test();
173 sysfiles_test();
174 }
175 else {
176 printf(" Error: I cannot join the process mount space\n");
177 exit(1);
178 }
179
180 // drop privileges in order not to trigger cleanup()
181 if (setgid(user_gid) != 0)
182 errExit("setgid");
183 if (setuid(user_uid) != 0)
184 errExit("setuid");
185 return 0;
186 }
187 int status;
188 wait(&status);
189
190 // network test
191 child = fork();
192 if (child == -1)
193 errExit("fork");
194 if (child == 0) {
195 int rv = join_namespace(pid, "net");
196 if (rv == 0)
197 network_test();
198 else {
199 printf(" Error: I cannot join the process network stack\n");
200 exit(1);
201 }
202
203 // drop privileges in order not to trigger cleanup()
204 if (setgid(user_gid) != 0)
205 errExit("setgid");
206 if (setuid(user_uid) != 0)
207 errExit("setuid");
208 return 0;
209 }
210 wait(&status);
211 }
212 }
213
214 return 0;
215}
diff --git a/src/jailcheck/network.c b/src/jailcheck/network.c
new file mode 100644
index 000000000..636344e77
--- /dev/null
+++ b/src/jailcheck/network.c
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include <netdb.h>
22#include <arpa/inet.h>
23#include <ifaddrs.h>
24#include <net/if.h>
25#include <linux/connector.h>
26#include <linux/netlink.h>
27#include <linux/if_link.h>
28#include <linux/sockios.h>
29#include <sys/ioctl.h>
30
31
32void network_test(void) {
33 // I am root running in a network namespace
34 struct ifaddrs *ifaddr, *ifa;
35 int found = 0;
36
37 // walk through the linked list
38 if (getifaddrs(&ifaddr) == -1)
39 errExit("getifaddrs");
40 for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
41 if (strcmp(ifa->ifa_name, "lo") == 0)
42 continue;
43 found = 1;
44 break;
45 }
46
47 freeifaddrs(ifaddr);
48
49 if (found)
50 printf(" Networking: enabled\n");
51 else
52 printf(" Networking: disabled\n");
53}
54
55
56
diff --git a/src/jailcheck/noexec.c b/src/jailcheck/noexec.c
new file mode 100644
index 000000000..7f994d6a1
--- /dev/null
+++ b/src/jailcheck/noexec.c
@@ -0,0 +1,113 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include <sys/wait.h>
22#include <sys/stat.h>
23#include <fcntl.h>
24
25static unsigned char *execfile = NULL;
26static int execfile_len = 0;
27
28void noexec_setup(void) {
29 // grab a copy of myself
30 char *self = realpath("/proc/self/exe", NULL);
31 if (self) {
32 struct stat s;
33 if (access(self, X_OK) == 0 && stat(self, &s) == 0) {
34 assert(s.st_size);
35 execfile = malloc(s.st_size);
36
37 int fd = open(self, O_RDONLY);
38 if (fd == -1)
39 errExit("open");
40 int len = 0;
41 do {
42 int rv = read(fd, execfile + len, s.st_size - len);
43 if (rv == -1)
44 errExit("read");
45 if (rv == 0) {
46 // something went wrong!
47 free(execfile);
48 execfile = NULL;
49 printf("Warning: I cannot grab a copy of myself, skipping noexec test...\n");
50 break;
51 }
52 len += rv;
53 }
54 while (len < s.st_size);
55 execfile_len = s.st_size;
56 close(fd);
57 }
58 }
59}
60
61
62void noexec_test(const char *path) {
63 assert(user_uid);
64
65 // I am root in sandbox mount namespace
66 if (!execfile)
67 return;
68
69 char *fname;
70 if (asprintf(&fname, "%s/jailcheck-noexec-%d", path, getpid()) == -1)
71 errExit("asprintf");
72
73 pid_t child = fork();
74 if (child == -1)
75 errExit("fork");
76
77 if (child == 0) { // child
78 // drop privileges
79 if (setgid(user_gid) != 0)
80 errExit("setgid");
81 if (setuid(user_uid) != 0)
82 errExit("setuid");
83 int fd = open(fname, O_CREAT | O_TRUNC | O_WRONLY, 0700);
84 if (fd == -1) {
85 printf(" I cannot create files in %s, skipping noexec...\n", path);
86 exit(1);
87 }
88
89 int len = 0;
90 while (len < execfile_len) {
91 int rv = write(fd, execfile + len, execfile_len - len);
92 if (rv == -1 || rv == 0) {
93 printf(" I cannot create files in %s, skipping noexec....\n", path);
94 exit(1);
95 }
96 len += rv;
97 }
98 fchmod(fd, 0700);
99 close(fd);
100
101 char *arg;
102 if (asprintf(&arg, "--hello=%s", path) == -1)
103 errExit("asprintf");
104 int rv = execl(fname, fname, arg, NULL);
105 (void) rv; // if we get here execl failed
106 exit(0);
107 }
108
109 int status;
110 wait(&status);
111 int rv = unlink(fname);
112 (void) rv;
113} \ No newline at end of file
diff --git a/src/faudit/dev.c b/src/jailcheck/seccomp.c
index 6bafaf93e..9345eb970 100644
--- a/src/faudit/dev.c
+++ b/src/jailcheck/seccomp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,31 +17,31 @@
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#include "faudit.h" 20#include "jailcheck.h"
21#include <dirent.h> 21#define MAXBUF 4096
22 22
23void dev_test(void) { 23void seccomp_test(pid_t pid) {
24 DIR *dir; 24 char *file;
25 if (!(dir = opendir("/dev"))) { 25 if (asprintf(&file, "/proc/%d/status", pid) == -1)
26 fprintf(stderr, "Error: cannot open /dev directory\n"); 26 errExit("asprintf");
27
28 FILE *fp = fopen(file, "r");
29 if (!fp) {
30 printf(" Error: cannot open %s\n", file);
31 free(file);
27 return; 32 return;
28 } 33 }
29 34
30 struct dirent *entry; 35 char buf[MAXBUF];
31 printf("INFO: files visible in /dev directory: "); 36 while (fgets(buf, MAXBUF, fp)) {
32 int cnt = 0; 37 if (strncmp(buf, "Seccomp:", 8) == 0) {
33 while ((entry = readdir(dir)) != NULL) { 38 int val = -1;
34 if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) 39 int rv = sscanf(buf + 8, "\t%d", &val);
35 continue; 40 if (rv != 1 || val == 0)
36 41 printf(" Warning: seccomp not enabled\n");
37 printf("%s, ", entry->d_name); 42 break;
38 cnt++; 43 }
39 } 44 }
40 printf("\n"); 45 fclose(fp);
41 46 free(file);
42 if (cnt > 20)
43 printf("MAYBE: /dev directory seems to be fully populated. Use --private-dev or --whitelist to restrict the access.\n");
44 else
45 printf("GOOD: Access to /dev directory is restricted.\n");
46 closedir(dir);
47} 47}
diff --git a/src/jailcheck/sysfiles.c b/src/jailcheck/sysfiles.c
new file mode 100644
index 000000000..9a0d6350e
--- /dev/null
+++ b/src/jailcheck/sysfiles.c
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include <dirent.h>
22#include <sys/wait.h>
23
24typedef struct {
25 char *tfile;
26} TestFile;
27
28#define MAX_TEST_FILES 32
29TestFile tf[MAX_TEST_FILES];
30static int files_cnt = 0;
31
32void sysfiles_setup(const char *file) {
33 // I am root!
34 assert(file);
35
36 if (files_cnt >= MAX_TEST_FILES) {
37 fprintf(stderr, "Error: maximum number of system test files exceeded\n");
38 exit(1);
39 }
40
41 if (access(file, F_OK)) {
42 // no such file
43 return;
44 }
45
46
47 char *fname = strdup(file);
48 if (!fname)
49 errExit("strdup");
50
51 tf[files_cnt].tfile = fname;
52 files_cnt++;
53}
54
55void sysfiles_test(void) {
56 // I am root in sandbox mount namespace
57 assert(user_uid);
58 int i;
59
60 pid_t child = fork();
61 if (child == -1)
62 errExit("fork");
63
64 if (child == 0) { // child
65 // drop privileges
66 if (setgid(user_gid) != 0)
67 errExit("setgid");
68 if (setuid(user_uid) != 0)
69 errExit("setuid");
70
71 for (i = 0; i < files_cnt; i++) {
72 assert(tf[i].tfile);
73
74 // try to open the file for reading
75 FILE *fp = fopen(tf[i].tfile, "r");
76 if (fp) {
77
78 printf(" Warning: I can access %s\n", tf[i].tfile);
79 fclose(fp);
80 }
81 }
82 exit(0);
83 }
84
85 // wait for the child to finish
86 int status;
87 wait(&status);
88}
diff --git a/src/jailcheck/utils.c b/src/jailcheck/utils.c
new file mode 100644
index 000000000..c3aaae298
--- /dev/null
+++ b/src/jailcheck/utils.c
@@ -0,0 +1,102 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include "../include/pid.h"
22#include <errno.h>
23#include <pwd.h>
24#include <dirent.h>
25
26#define BUFLEN 4096
27
28char *get_sudo_user(void) {
29 char *user = getenv("SUDO_USER");
30 if (!user) {
31 user = getpwuid(getuid())->pw_name;
32 if (!user) {
33 fprintf(stderr, "Error: cannot detect login user\n");
34 exit(1);
35 }
36 }
37
38 return user;
39}
40
41char *get_homedir(const char *user, uid_t *uid, gid_t *gid) {
42 // find home directory
43 struct passwd *pw = getpwnam(user);
44 if (!pw)
45 goto errexit;
46
47 char *home = pw->pw_dir;
48 if (!home)
49 goto errexit;
50
51 *uid = pw->pw_uid;
52 *gid = pw->pw_gid;
53
54 return home;
55
56errexit:
57 fprintf(stderr, "Error: cannot find home directory for user %s\n", user);
58 exit(1);
59}
60
61// find the second child process for the specified pid
62// return -1 if not found
63//
64// Example:
65//14776:netblue:/usr/bin/firejail /usr/bin/transmission-qt
66// 14777:netblue:/usr/bin/firejail /usr/bin/transmission-qt
67// 14792:netblue:/usr/bin/transmission-qt
68// We need 14792, the first real sandboxed process
69// duplicate from src/firemon/main.c
70int find_child(int id) {
71 int i;
72 int first_child = -1;
73
74 // find the first child
75 for (i = 0; i < max_pids; i++) {
76 if (pids[i].level == 2 && pids[i].parent == id) {
77 // skip /usr/bin/xdg-dbus-proxy (started by firejail for dbus filtering)
78 char *cmdline = pid_proc_cmdline(i);
79 if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) == 0) {
80 free(cmdline);
81 continue;
82 }
83 free(cmdline);
84 first_child = i;
85 break;
86 }
87 }
88
89 if (first_child == -1)
90 return -1;
91
92 // find the second-level child
93 for (i = 0; i < max_pids; i++) {
94 if (pids[i].level == 3 && pids[i].parent == first_child)
95 return i;
96 }
97
98 // if a second child is not found, return the first child pid
99 // this happens for processes sandboxed with --join
100 return first_child;
101}
102
diff --git a/src/jailcheck/virtual.c b/src/jailcheck/virtual.c
new file mode 100644
index 000000000..09092f9ce
--- /dev/null
+++ b/src/jailcheck/virtual.c
@@ -0,0 +1,125 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include "jailcheck.h"
21#include <dirent.h>
22#include <sys/wait.h>
23
24
25#define MAX_TEST_FILES 16
26static char *dirs[MAX_TEST_FILES];
27static char *files[MAX_TEST_FILES];
28static int files_cnt = 0;
29
30void virtual_setup(const char *directory) {
31 // I am root!
32 assert(directory);
33 assert(*directory == '/');
34 assert(files_cnt < MAX_TEST_FILES);
35
36 // try to open the dir as root
37 DIR *dir = opendir(directory);
38 if (!dir) {
39 fprintf(stderr, "Warning: directory %s not found, skipping\n", directory);
40 return;
41 }
42 closedir(dir);
43
44 // create a test file
45 char *test_file;
46 if (asprintf(&test_file, "%s/jailcheck-private-%d", directory, getpid()) == -1)
47 errExit("asprintf");
48
49 FILE *fp = fopen(test_file, "w");
50 if (!fp) {
51 printf("Warning: I cannot create test file in directory %s, skipping...\n", directory);
52 return;
53 }
54 fprintf(fp, "this file was created by firetest utility, you can safely delete it\n");
55 fclose(fp);
56 if (strcmp(directory, user_home_dir) == 0) {
57 int rv = chown(test_file, user_uid, user_gid);
58 if (rv)
59 errExit("chown");
60 }
61
62 char *dname = strdup(directory);
63 if (!dname)
64 errExit("strdup");
65 dirs[files_cnt] = dname;
66 files[files_cnt] = test_file;
67 files_cnt++;
68}
69
70void virtual_destroy(void) {
71 // remove test files
72 int i;
73
74 for (i = 0; i < files_cnt; i++) {
75 int rv = unlink(files[i]);
76 (void) rv;
77 }
78 files_cnt = 0;
79}
80
81void virtual_test(void) {
82 // I am root in sandbox mount namespace
83 assert(user_uid);
84 int i;
85
86 int cnt = 0;
87 cnt += printf(" Virtual dirs: "); fflush(0);
88
89 for (i = 0; i < files_cnt; i++) {
90 assert(files[i]);
91
92 // I am root!
93 pid_t child = fork();
94 if (child == -1)
95 errExit("fork");
96
97 if (child == 0) { // child
98 // drop privileges
99 if (setgid(user_gid) != 0)
100 errExit("setgid");
101 if (setuid(user_uid) != 0)
102 errExit("setuid");
103
104 // try to open the file for reading
105 FILE *fp = fopen(files[i], "r");
106 if (fp)
107 fclose(fp);
108 else {
109 if (cnt == 0)
110 cnt += printf("\n ");
111 cnt += printf("%s, ", dirs[i]);
112 if (cnt > 60)
113 cnt = 0;
114 }
115 fflush(0);
116 exit(cnt);
117 }
118
119 // wait for the child to finish
120 int status;
121 wait(&status);
122 cnt = WEXITSTATUS(status);
123 }
124 printf("\n");
125}
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 63b0ad56d..49c8057b3 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -1,24 +1,14 @@
1CC=@CC@ 1include ../common.mk
2PREFIX=@prefix@
3VERSION=@PACKAGE_VERSION@
4NAME=@PACKAGE_NAME@
5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
6HAVE_GCOV=@HAVE_GCOV@
7EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
8
9H_FILE_LIST = $(sort $(wildcard *.[h]))
10C_FILE_LIST = $(sort $(wildcard *.c))
11OBJS = $(C_FILE_LIST:.c=.o)
12BINOBJS = $(foreach file, $(OBJS), $file)
13CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
14LDFLAGS:=-pic -Wl,-z,relro -Wl,-z,now
15 2
3.PHONY: all
16all: $(OBJS) 4all: $(OBJS)
17 5
18%.o : %.c $(H_FILE_LIST) 6%.o : %.c $(H_FILE_LIST)
19 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
20 8
21clean:; rm -f $(OBJS) *.gcov *.gcda *.gcno 9.PHONY: clean
10clean:; rm -fr $(OBJS) *.gcov *.gcda *.gcno *.plist
22 11
12.PHONY: distclean
23distclean: clean 13distclean: clean
24 rm -fr Makefile 14 rm -fr Makefile
diff --git a/src/lib/common.c b/src/lib/common.c
index b44563733..f1bd7a6fe 100644
--- a/src/lib/common.c
+++ b/src/lib/common.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -30,6 +30,7 @@
30#include <signal.h> 30#include <signal.h>
31#include <dirent.h> 31#include <dirent.h>
32#include <string.h> 32#include <string.h>
33#include <time.h>
33#include "../include/common.h" 34#include "../include/common.h"
34#define BUFLEN 4096 35#define BUFLEN 4096
35 36
@@ -53,7 +54,7 @@ int join_namespace(pid_t pid, char *type) {
53 54
54errout: 55errout:
55 free(path); 56 free(path);
56 fprintf(stderr, "Error: cannot join namespace %s\\n", type); 57 fprintf(stderr, "Error: cannot join namespace %s\n", type);
57 return -1; 58 return -1;
58 59
59} 60}
@@ -129,7 +130,7 @@ char *pid_proc_comm(const pid_t pid) {
129 // open /proc/pid/cmdline file 130 // open /proc/pid/cmdline file
130 char *fname; 131 char *fname;
131 int fd; 132 int fd;
132 if (asprintf(&fname, "/proc/%d//comm", pid) == -1) 133 if (asprintf(&fname, "/proc/%d/comm", pid) == -1)
133 return NULL; 134 return NULL;
134 if ((fd = open(fname, O_RDONLY)) < 0) { 135 if ((fd = open(fname, O_RDONLY)) < 0) {
135 free(fname); 136 free(fname);
@@ -154,6 +155,8 @@ char *pid_proc_comm(const pid_t pid) {
154 155
155 // return a malloc copy of the command line 156 // return a malloc copy of the command line
156 char *rv = strdup(buffer); 157 char *rv = strdup(buffer);
158 if (!rv)
159 return NULL;
157 if (strlen(rv) == 0) { 160 if (strlen(rv) == 0) {
158 free(rv); 161 free(rv);
159 return NULL; 162 return NULL;
@@ -192,6 +195,8 @@ char *pid_proc_cmdline(const pid_t pid) {
192 195
193 // return a malloc copy of the command line 196 // return a malloc copy of the command line
194 char *rv = strdup((char *) buffer); 197 char *rv = strdup((char *) buffer);
198 if (!rv)
199 return NULL;
195 if (strlen(rv) == 0) { 200 if (strlen(rv) == 0) {
196 free(rv); 201 free(rv);
197 return NULL; 202 return NULL;
@@ -250,7 +255,7 @@ int pid_proc_cmdline_x11_xpra_xephyr(const pid_t pid) {
250 if (strncmp(arg, "--", 2) != 0) 255 if (strncmp(arg, "--", 2) != 0)
251 break; 256 break;
252 257
253 if (strcmp(arg, "--x11=xorg") == 0) 258 if (strcmp(arg, "--x11=xorg") == 0 || strcmp(arg, "--x11=none") == 0)
254 return 0; 259 return 0;
255 260
256 // check x11 xpra or xephyr 261 // check x11 xpra or xephyr
@@ -262,7 +267,6 @@ int pid_proc_cmdline_x11_xpra_xephyr(const pid_t pid) {
262} 267}
263 268
264// return 1 if /proc is mounted hidepid, or if /proc/mouns access is denied 269// return 1 if /proc is mounted hidepid, or if /proc/mouns access is denied
265#define BUFLEN 4096
266int pid_hidepid(void) { 270int pid_hidepid(void) {
267 FILE *fp = fopen("/proc/mounts", "r"); 271 FILE *fp = fopen("/proc/mounts", "r");
268 if (!fp) 272 if (!fp)
@@ -273,7 +277,7 @@ int pid_hidepid(void) {
273 if (strstr(buf, "proc /proc proc")) { 277 if (strstr(buf, "proc /proc proc")) {
274 fclose(fp); 278 fclose(fp);
275 // check hidepid 279 // check hidepid
276 if (strstr(buf, "hidepid=2") || strstr(buf, "hidepid=1")) 280 if (strstr(buf, "hidepid="))
277 return 1; 281 return 1;
278 return 0; 282 return 0;
279 } 283 }
@@ -282,3 +286,79 @@ int pid_hidepid(void) {
282 fclose(fp); 286 fclose(fp);
283 return 0; 287 return 0;
284} 288}
289
290// print error if unprivileged users can trace the process
291void warn_dumpable(void) {
292 if (getuid() != 0 && prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getenv("FIREJAIL_PLUGIN")) {
293 fprintf(stderr, "Error: dumpable process\n");
294
295 // best effort to provide detailed debug information
296 // cannot use process name, it is just a file descriptor number
297 char path[BUFLEN];
298 ssize_t len = readlink("/proc/self/exe", path, BUFLEN - 1);
299 if (len < 0)
300 return;
301 path[len] = '\0';
302 // path can refer to a sandbox mount namespace, use basename only
303 const char *base = gnu_basename(path);
304
305 struct stat s;
306 if (stat("/proc/self/exe", &s) == 0 && s.st_uid != 0)
307 fprintf(stderr, "Change owner of %s executable to root\n", base);
308 else if (access("/proc/self/exe", R_OK) == 0)
309 fprintf(stderr, "Remove read permission on %s executable\n", base);
310 }
311}
312
313// Equivalent to the GNU version of basename, which is incompatible with
314// the POSIX basename. A few lines of code saves any portability pain.
315// https://www.gnu.org/software/libc/manual/html_node/Finding-Tokens-in-a-String.html#index-basename
316const char *gnu_basename(const char *path) {
317 const char *last_slash = strrchr(path, '/');
318 if (!last_slash)
319 return path;
320 return last_slash+1;
321}
322
323//**************************
324// time trace based on getticks function
325//**************************
326typedef struct list_entry_t {
327 struct list_entry_t *next;
328 struct timespec ts;
329} ListEntry;
330
331static ListEntry *ts_list = NULL;
332
333static inline float msdelta(struct timespec *start, struct timespec *end) {
334 unsigned sec = end->tv_sec - start->tv_sec;
335 long nsec = end->tv_nsec - start->tv_nsec;
336 return (float) sec * 1000 + (float) nsec / 1000000;
337}
338
339void timetrace_start(void) {
340 ListEntry *t = malloc(sizeof(ListEntry));
341 if (!t)
342 errExit("malloc");
343 memset(t, 0, sizeof(ListEntry));
344 clock_gettime(CLOCK_MONOTONIC, &t->ts);
345
346 // add it to the list
347 t->next = ts_list;
348 ts_list = t;
349}
350
351float timetrace_end(void) {
352 if (!ts_list)
353 return 0;
354
355 // remove start time from the list
356 ListEntry *t = ts_list;
357 ts_list = t->next;
358
359 struct timespec end;
360 clock_gettime(CLOCK_MONOTONIC, &end);
361 float rv = msdelta(&t->ts, &end);
362 free(t);
363 return rv;
364}
diff --git a/src/fseccomp/errno.c b/src/lib/errno.c
index e5cd4e226..9edb44c22 100644
--- a/src/fseccomp/errno.c
+++ b/src/lib/errno.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,9 +17,11 @@
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#include "fseccomp.h" 20#include "../include/syscall.h"
21 21
22#include <errno.h> 22#include <errno.h>
23#include <stdio.h>
24#include <string.h>
23//#include <attr/xattr.h> 25//#include <attr/xattr.h>
24 26
25typedef struct { 27typedef struct {
@@ -181,7 +183,7 @@ int errno_find_name(const char *name) {
181 return -1; 183 return -1;
182} 184}
183 185
184char *errno_find_nr(int nr) { 186const char *errno_find_nr(int nr) {
185 int i; 187 int i;
186 int elems = sizeof(errnolist) / sizeof(errnolist[0]); 188 int elems = sizeof(errnolist) / sizeof(errnolist[0]);
187 for (i = 0; i < elems; i++) { 189 for (i = 0; i < elems; i++) {
diff --git a/src/lib/firejail_user.c b/src/lib/firejail_user.c
new file mode 100644
index 000000000..d6a3c71ab
--- /dev/null
+++ b/src/lib/firejail_user.c
@@ -0,0 +1,192 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21//
22// Firejail access database inplementation
23//
24// The database is a simple list of users allowed to run firejail SUID executable
25// It is usually stored in /etc/firejail/firejail.users
26// One username per line in the file
27
28#include "../include/common.h"
29#include "../include/firejail_user.h"
30#include <sys/types.h>
31#include <pwd.h>
32#include <errno.h>
33
34#define MAXBUF 4098
35
36// minimum values for uid and gid extracted from /etc/login.defs
37int uid_min = 0;
38int gid_min = 0;
39
40static void init_uid_gid_min(void) {
41 if (uid_min != 0 && gid_min != 0)
42 return;
43
44 // read the real values from login.def
45 FILE *fp = fopen("/etc/login.defs", "r");
46 if (!fp) {
47 fp = fopen("/usr/etc/login.defs", "r"); // openSUSE
48 if (!fp)
49 goto errexit;
50 }
51
52 char buf[MAXBUF];
53 while (fgets(buf, MAXBUF, fp)) {
54 // comments
55 if (*buf == '#')
56 continue;
57 // skip empty space
58 char *ptr = buf;
59 while (*ptr == ' ' || *ptr == '\t')
60 ptr++;
61
62 if (strncmp(ptr, "UID_MIN", 7) == 0) {
63 int rv = sscanf(ptr + 7, "%d", &uid_min);
64 if (rv != 1 || uid_min < 0) {
65 fclose(fp);
66 goto errexit;
67 }
68 }
69 else if (strncmp(ptr, "GID_MIN", 7) == 0) {
70 int rv = sscanf(ptr + 7, "%d", &gid_min);
71 if (rv != 1 || gid_min < 0) {
72 fclose(fp);
73 goto errexit;
74 }
75 }
76
77 if (uid_min != 0 && gid_min != 0)
78 break;
79
80 }
81 fclose(fp);
82
83 if (uid_min == 0 || gid_min == 0)
84 goto errexit;
85//printf("uid_min %d, gid_min %d\n", uid_min, gid_min);
86
87 return;
88
89errexit:
90 fprintf(stderr, "Error: cannot read UID_MIN and/or GID_MIN from /etc/login.defs, using 1000 by default\n");
91 uid_min = 1000;
92 gid_min = 1000;
93}
94
95
96
97static inline char *get_fname(void) {
98 char *fname;
99 if (asprintf(&fname, "%s/firejail.users", SYSCONFDIR) == -1)
100 errExit("asprintf");
101 return fname;
102}
103
104
105// returns 1 if the user is found in the database or if the database was not created
106int firejail_user_check(const char *name) {
107 assert(name);
108 init_uid_gid_min();
109
110 // root is allowed to run firejail by default
111 if (strcmp(name, "root") == 0)
112 return 1;
113
114 // user nobody is never allowed
115 if (strcmp(name, "nobody") == 0)
116 return 0;
117
118 // check file existence
119 char *fname = get_fname();
120 assert(fname);
121 if (access(fname, F_OK) == -1 && errno == ENOENT) {
122 // assume the user doesn't care about access checking
123 free(fname);
124 return 1;
125 }
126
127 FILE *fp = fopen(fname, "r");
128 if (!fp) {
129 fprintf(stderr, "Error: cannot read %s\n", fname);
130 perror("fopen");
131 exit(1);
132 }
133 free(fname);
134
135 char buf[MAXBUF];
136 while (fgets(buf, MAXBUF, fp)) {
137 // lines starting with # are comments
138 if (*buf == '#')
139 continue;
140
141 // remove \n
142 char *ptr = strchr(buf, '\n');
143 if (ptr)
144 *ptr = '\0';
145
146 // compare
147 if (strcmp(buf, name) == 0) {
148 fclose(fp);
149 return 1;
150 }
151 }
152
153 fclose(fp);
154 return 0;
155}
156
157// add a user to the database
158void firejail_user_add(const char *name) {
159 assert(name);
160
161 // is this a real user?
162 struct passwd *pw = getpwnam(name);
163 if (!pw) {
164 fprintf(stderr, "Error: user %s not found on this system.\n", name);
165 exit(1);
166 }
167
168 // check the user is not already in the database
169 char *fname = get_fname();
170 assert(fname);
171 if (access(fname, F_OK) == 0) {
172 if (firejail_user_check(name)) {
173 printf("User %s already in the database\n", name);
174 free(fname);
175 return;
176 }
177 }
178 else
179 printf("Creating %s\n", fname);
180
181 FILE *fp = fopen(fname, "a+");
182 if (!fp) {
183 fprintf(stderr, "Error: cannot open %s\n", fname);
184 perror("fopen");
185 free(fname);
186 return;
187 }
188 free(fname);
189
190 fprintf(fp, "%s\n", name);
191 fclose(fp);
192}
diff --git a/src/lib/ldd_utils.c b/src/lib/ldd_utils.c
new file mode 100644
index 000000000..c5dde85b0
--- /dev/null
+++ b/src/lib/ldd_utils.c
@@ -0,0 +1,65 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "../include/ldd_utils.h"
22#include <sys/types.h>
23#include <sys/stat.h>
24#include <fcntl.h>
25
26// todo: resolve overlap with masked_lib_dirs[] array from fs_lib.c
27const char * const default_lib_paths[] = {
28 "/usr/lib/x86_64-linux-gnu", // Debian & friends
29 "/lib/x86_64-linux-gnu", // CentOS, Fedora
30 "/usr/lib64",
31 "/lib64",
32 "/usr/lib",
33 "/lib",
34 LIBDIR,
35 "/usr/local/lib64",
36 "/usr/local/lib",
37 "/usr/lib/x86_64-linux-gnu/mesa", // libGL.so is sometimes a symlink into this directory
38 "/usr/lib/x86_64-linux-gnu/mesa-egl", // libGL.so is sometimes a symlink into this directory
39// "/usr/lib/x86_64-linux-gnu/plasma-discover",
40 NULL
41};
42
43// return 1 if this is a 64 bit program/library
44int is_lib_64(const char *exe) {
45 int retval = 0;
46 int fd = open(exe, O_RDONLY);
47 if (fd < 0)
48 return 0;
49
50 unsigned char buf[EI_NIDENT];
51 ssize_t len = 0;
52 while (len < EI_NIDENT) {
53 ssize_t sz = read(fd, buf + len, EI_NIDENT - len);
54 if (sz <= 0)
55 goto doexit;
56 len += sz;
57 }
58
59 if (buf[EI_CLASS] == ELFCLASS64)
60 retval = 1;
61
62doexit:
63 close(fd);
64 return retval;
65}
diff --git a/src/lib/libnetlink.c b/src/lib/libnetlink.c
index d2975bd57..5f6ecd95c 100644
--- a/src/lib/libnetlink.c
+++ b/src/lib/libnetlink.c
@@ -3,10 +3,10 @@
3 * Original source code: 3 * Original source code:
4 * 4 *
5 * Information: 5 * Information:
6 * http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 6 * https://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
7 * 7 *
8 * Download: 8 * Download:
9 * http://www.kernel.org/pub/linux/utils/net/iproute2/ 9 * https://www.kernel.org/pub/linux/utils/net/iproute2/
10 * 10 *
11 * Repository: 11 * Repository:
12 * git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git 12 * git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git
diff --git a/src/lib/pid.c b/src/lib/pid.c
index 5f19944b6..ca62aaa42 100644
--- a/src/lib/pid.c
+++ b/src/lib/pid.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,10 +17,12 @@
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
20#include "../include/common.h" 21#include "../include/common.h"
21#include "../include/pid.h" 22#include "../include/pid.h"
22#include <string.h> 23#include <string.h>
23#include <sys/types.h> 24#include <sys/types.h>
25#include <sys/stat.h>
24#include <pwd.h> 26#include <pwd.h>
25#include <sys/ioctl.h> 27#include <sys/ioctl.h>
26#include <dirent.h> 28#include <dirent.h>
@@ -148,7 +150,7 @@ uid_t pid_get_uid(pid_t pid) {
148 char buf[PIDS_BUFLEN]; 150 char buf[PIDS_BUFLEN];
149 while (fgets(buf, PIDS_BUFLEN - 1, fp)) { 151 while (fgets(buf, PIDS_BUFLEN - 1, fp)) {
150 if (strncmp(buf, "Uid:", 4) == 0) { 152 if (strncmp(buf, "Uid:", 4) == 0) {
151 char *ptr = buf + 5; 153 char *ptr = buf + 4;
152 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) { 154 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) {
153 ptr++; 155 ptr++;
154 } 156 }
@@ -165,6 +167,10 @@ doexit:
165 return rv; 167 return rv;
166} 168}
167 169
170// todo: RUN_FIREJAIL_NAME_DIR is borrowed from src/firejail/firejail.h
171// move it in a common place
172#define RUN_FIREJAIL_NAME_DIR "/run/firejail/name"
173
168static void print_elem(unsigned index, int nowrap) { 174static void print_elem(unsigned index, int nowrap) {
169 // get terminal size 175 // get terminal size
170 struct winsize sz; 176 struct winsize sz;
@@ -183,15 +189,43 @@ static void print_elem(unsigned index, int nowrap) {
183 uid_t uid = pids[index].uid; 189 uid_t uid = pids[index].uid;
184 char *cmd = pid_proc_cmdline(index); 190 char *cmd = pid_proc_cmdline(index);
185 char *user = pid_get_user_name(uid); 191 char *user = pid_get_user_name(uid);
186 char *allocated = user; 192 char *user_allocated = user;
193
194 // extract sandbox name - pid == index
195 char *sandbox_name = "";
196 char *sandbox_name_allocated = NULL;
197 char *fname;
198 if (asprintf(&fname, "%s/%d", RUN_FIREJAIL_NAME_DIR, index) == -1)
199 errExit("asprintf");
200 struct stat s;
201 if (stat(fname, &s) == 0) {
202 FILE *fp = fopen(fname, "r");
203 if (fp) {
204 sandbox_name = malloc(s.st_size + 1);
205 if (!sandbox_name)
206 errExit("malloc");
207 sandbox_name_allocated = sandbox_name;
208 char *rv = fgets(sandbox_name, s.st_size + 1, fp);
209 if (!rv)
210 *sandbox_name = '\0';
211 else {
212 char *ptr = strchr(sandbox_name, '\n');
213 if (ptr)
214 *ptr = '\0';
215 }
216 fclose(fp);
217 }
218 }
219 free(fname);
220
187 if (user ==NULL) 221 if (user ==NULL)
188 user = ""; 222 user = "";
189 if (cmd) { 223 if (cmd) {
190 if (col < 4 || nowrap) 224 if (col < 4 || nowrap)
191 printf("%s%u:%s:%s\n", indent, index, user, cmd); 225 printf("%s%u:%s:%s:%s\n", indent, index, user, sandbox_name, cmd);
192 else { 226 else {
193 char *out; 227 char *out;
194 if (asprintf(&out, "%s%u:%s:%s\n", indent, index, user, cmd) == -1) 228 if (asprintf(&out, "%s%u:%s:%s:%s\n", indent, index, user, sandbox_name, cmd) == -1)
195 errExit("asprintf"); 229 errExit("asprintf");
196 int len = strlen(out); 230 int len = strlen(out);
197 if (len > col) { 231 if (len > col) {
@@ -210,8 +244,10 @@ static void print_elem(unsigned index, int nowrap) {
210 else 244 else
211 printf("%s%u:\n", indent, index); 245 printf("%s%u:\n", indent, index);
212 } 246 }
213 if (allocated) 247 if (user_allocated)
214 free(allocated); 248 free(user_allocated);
249 if (sandbox_name_allocated)
250 free(sandbox_name_allocated);
215} 251}
216 252
217// recursivity!!! 253// recursivity!!!
@@ -294,10 +330,9 @@ void pid_read(pid_t mon_pid) {
294 } 330 }
295 } 331 }
296 332
297 pid_t child = -1;
298 struct dirent *entry; 333 struct dirent *entry;
299 char *end; 334 char *end;
300 while (child < 0 && (entry = readdir(dir))) { 335 while ((entry = readdir(dir))) {
301 pid_t pid = strtol(entry->d_name, &end, 10); 336 pid_t pid = strtol(entry->d_name, &end, 10);
302 pid %= max_pids; 337 pid %= max_pids;
303 if (end == entry->d_name || *end) 338 if (end == entry->d_name || *end)
@@ -324,7 +359,10 @@ void pid_read(pid_t mon_pid) {
324 char buf[PIDS_BUFLEN]; 359 char buf[PIDS_BUFLEN];
325 while (fgets(buf, PIDS_BUFLEN - 1, fp)) { 360 while (fgets(buf, PIDS_BUFLEN - 1, fp)) {
326 if (strncmp(buf, "Name:", 5) == 0) { 361 if (strncmp(buf, "Name:", 5) == 0) {
327 char *ptr = buf + 5; 362 char *ptr = strchr(buf, '\n');
363 if (ptr)
364 *ptr = '\0';
365 ptr = buf + 5;
328 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) { 366 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) {
329 ptr++; 367 ptr++;
330 } 368 }
@@ -333,7 +371,7 @@ void pid_read(pid_t mon_pid) {
333 exit(1); 371 exit(1);
334 } 372 }
335 373
336 if ((strncmp(ptr, "firejail", 8) == 0) && (mon_pid == 0 || mon_pid == pid)) { 374 if ((strcmp(ptr, "firejail") == 0) && (mon_pid == 0 || mon_pid == pid)) {
337 if (pid_proc_cmdline_x11_xpra_xephyr(pid)) 375 if (pid_proc_cmdline_x11_xpra_xephyr(pid))
338 pids[pid].level = -1; 376 pids[pid].level = -1;
339 else 377 else
@@ -363,7 +401,7 @@ void pid_read(pid_t mon_pid) {
363 pids[pid].parent = parent; 401 pids[pid].parent = parent;
364 } 402 }
365 else if (strncmp(buf, "Uid:", 4) == 0) { 403 else if (strncmp(buf, "Uid:", 4) == 0) {
366 char *ptr = buf + 5; 404 char *ptr = buf + 4;
367 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) { 405 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) {
368 ptr++; 406 ptr++;
369 } 407 }
diff --git a/src/lib/syscall.c b/src/lib/syscall.c
new file mode 100644
index 000000000..d0d9ff5aa
--- /dev/null
+++ b/src/lib/syscall.c
@@ -0,0 +1,1692 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#define _GNU_SOURCE
21#include "../include/syscall.h"
22#include <assert.h>
23#include <limits.h>
24#include <stdbool.h>
25#include <stdio.h>
26#include <string.h>
27#include <sys/syscall.h>
28#include "../include/common.h"
29#include "../include/seccomp.h"
30
31#define SYSCALL_ERROR INT_MAX
32#define ERRNO_KILL -2
33
34typedef struct {
35 const char * const name;
36 int nr;
37} SyscallEntry;
38
39typedef struct {
40 const char * const name;
41 const char * const list;
42} SyscallGroupList;
43
44typedef struct {
45 const char *slist;
46 char *prelist, *postlist;
47 bool found;
48 int syscall;
49} SyscallCheckList;
50
51// Native syscalls (64 bit versions for 64 bit arch etc)
52static const SyscallEntry syslist[] = {
53#if defined(__x86_64__)
54// code generated using
55// awk '/__NR_/ { print "{ \"" gensub("__NR_", "", "g", $2) "\", " $3 " },"; }' < /usr/include/x86_64-linux-gnu/asm/unistd_64.h
56#include "../include/syscall_x86_64.h"
57#elif defined(__i386__)
58// awk '/__NR_/ { print "{ \"" gensub("__NR_", "", "g", $2) "\", " $3 " },"; }' < /usr/include/x86_64-linux-gnu/asm/unistd_32.h
59#include "../include/syscall_i386.h"
60#elif defined(__arm__)
61#include "../include/syscall_armeabi.h"
62#else
63#warning "Please submit a syscall table for your architecture"
64#endif
65};
66
67// 32 bit syscalls for 64 bit arch
68static const SyscallEntry syslist32[] = {
69#if defined(__x86_64__)
70#include "../include/syscall_i386.h"
71// TODO for other 64 bit archs
72#elif defined(__i386__) || defined(__arm__) || defined(__powerpc__)
73// no secondary arch for 32 bit archs
74#endif
75};
76
77static const SyscallGroupList sysgroups[] = {
78 { .name = "@aio", .list =
79#ifdef SYS_io_cancel
80 "io_cancel,"
81#endif
82#ifdef SYS_io_destroy
83 "io_destroy,"
84#endif
85#ifdef SYS_io_getevents
86 "io_getevents,"
87#endif
88#ifdef SYS_io_pgetevents
89 "io_pgetevents,"
90#endif
91#ifdef SYS_io_setup
92 "io_setup,"
93#endif
94#ifdef SYS_io_submit
95 "io_submit"
96#endif
97 },
98 { .name = "@basic-io", .list =
99#ifdef SYS__llseek
100 "_llseek,"
101#endif
102#ifdef SYS_close
103 "close,"
104#endif
105#ifdef SYS_dup
106 "dup,"
107#endif
108#ifdef SYS_dup2
109 "dup2,"
110#endif
111#ifdef SYS_dup3
112 "dup3,"
113#endif
114#ifdef SYS_lseek
115 "lseek,"
116#endif
117#ifdef SYS_pread64
118 "pread64,"
119#endif
120#ifdef SYS_preadv
121 "preadv,"
122#endif
123#ifdef SYS_preadv2
124 "preadv2,"
125#endif
126#ifdef SYS_pwrite64
127 "pwrite64,"
128#endif
129#ifdef SYS_pwritev
130 "pwritev,"
131#endif
132#ifdef SYS_pwritev2
133 "pwritev2,"
134#endif
135#ifdef SYS_read
136 "read,"
137#endif
138#ifdef SYS_readv
139 "readv,"
140#endif
141#ifdef SYS_write
142 "write,"
143#endif
144#ifdef SYS_writev
145 "writev"
146#endif
147 },
148 { .name = "@chown", .list =
149#ifdef SYS_chown
150 "chown,"
151#endif
152#ifdef SYS_chown32
153 "chown32,"
154#endif
155#ifdef SYS_fchown
156 "fchown,"
157#endif
158#ifdef SYS_fchown32
159 "fchown32,"
160#endif
161#ifdef SYS_fchownat
162 "fchownat,"
163#endif
164#ifdef SYS_lchown
165 "lchown,"
166#endif
167#ifdef SYS_lchown32
168 "lchown32"
169#endif
170 },
171 { .name = "@clock", .list =
172#ifdef SYS_adjtimex
173 "adjtimex,"
174#endif
175#ifdef SYS_clock_adjtime
176 "clock_adjtime,"
177#endif
178#ifdef SYS_clock_settime
179 "clock_settime,"
180#endif
181#ifdef SYS_settimeofday
182 "settimeofday,"
183#endif
184#ifdef SYS_stime
185 "stime"
186#endif
187 },
188 { .name = "@cpu-emulation", .list =
189#ifdef SYS_modify_ldt
190 "modify_ldt,"
191#endif
192#ifdef SYS_subpage_prot
193 "subpage_prot,"
194#endif
195#ifdef SYS_switch_endian
196 "switch_endian,"
197#endif
198#ifdef SYS_vm86
199 "vm86,"
200#endif
201#ifdef SYS_vm86old
202 "vm86old"
203#endif
204#if !defined(SYS_modify_ldt) && !defined(SYS_subpage_prot) && !defined(SYS_switch_endian) && !defined(SYS_vm86) && !defined(SYS_vm86old)
205 "__dummy_syscall__" // workaround for arm64, s390x and sparc64 which don't have any of above defined and empty syscall lists are not allowed
206#endif
207 },
208 { .name = "@debug", .list =
209#ifdef SYS_lookup_dcookie
210 "lookup_dcookie,"
211#endif
212#ifdef SYS_perf_event_open
213 "perf_event_open,"
214#endif
215#ifdef SYS_process_vm_writev
216 "process_vm_writev,"
217#endif
218#ifdef SYS_rtas
219 "rtas,"
220#endif
221#ifdef SYS_s390_runtime_instr
222 "s390_runtime_instr,"
223#endif
224#ifdef SYS_sys_debug_setcontext
225 "sys_debug_setcontext,"
226#endif
227 },
228 { .name = "@default", .list =
229 "@clock,"
230 "@cpu-emulation,"
231 "@debug,"
232 "@module,"
233 "@mount,"
234 "@obsolete,"
235 "@raw-io,"
236 "@reboot,"
237 "@swap,"
238#ifdef SYS_open_by_handle_at
239 "open_by_handle_at,"
240#endif
241#ifdef SYS_name_to_handle_at
242 "name_to_handle_at,"
243#endif
244#ifdef SYS_ioprio_set
245 "ioprio_set,"
246#endif
247#ifdef SYS_ni_syscall
248 "ni_syscall,"
249#endif
250#ifdef SYS_syslog
251 "syslog,"
252#endif
253#ifdef SYS_fanotify_init
254 "fanotify_init,"
255#endif
256#ifdef SYS_add_key
257 "add_key,"
258#endif
259#ifdef SYS_request_key
260 "request_key,"
261#endif
262#ifdef SYS_mbind
263 "mbind,"
264#endif
265#ifdef SYS_migrate_pages
266 "migrate_pages,"
267#endif
268#ifdef SYS_move_pages
269 "move_pages,"
270#endif
271#ifdef SYS_keyctl
272 "keyctl,"
273#endif
274#ifdef SYS_io_setup
275 "io_setup,"
276#endif
277#ifdef SYS_io_destroy
278 "io_destroy,"
279#endif
280#ifdef SYS_io_getevents
281 "io_getevents,"
282#endif
283#ifdef SYS_io_submit
284 "io_submit,"
285#endif
286#ifdef SYS_io_cancel
287 "io_cancel,"
288#endif
289#ifdef SYS_remap_file_pages
290 "remap_file_pages,"
291#endif
292#ifdef SYS_set_mempolicy
293 "set_mempolicy"
294#endif
295#ifdef SYS_vmsplice
296 "vmsplice,"
297#endif
298#ifdef SYS_userfaultfd
299 "userfaultfd,"
300#endif
301#ifdef SYS_acct
302 "acct,"
303#endif
304#ifdef SYS_bpf
305 "bpf,"
306#endif
307#ifdef SYS_nfsservctl
308 "nfsservctl,"
309#endif
310#ifdef SYS_setdomainname
311 "setdomainname,"
312#endif
313#ifdef SYS_sethostname
314 "sethostname,"
315#endif
316#ifdef SYS_vhangup
317 "vhangup"
318#endif
319//#ifdef SYS_mincore // 0.9.57 - problem fixed in Linux kernel 5.0; on 4.x it will break kodi, mpv, totem
320// "mincore"
321//#endif
322 },
323 { .name = "@default-nodebuggers", .list =
324 "@default,"
325#ifdef SYS_ptrace
326 "ptrace,"
327#endif
328#ifdef SYS_personality
329 "personality,"
330#endif
331#ifdef SYS_process_vm_readv
332 "process_vm_readv"
333#endif
334 },
335 { .name = "@default-keep", .list =
336 "execveat," // commonly used by fexecve
337 "execve,"
338 "prctl"
339 },
340 { .name = "@file-system", .list =
341#ifdef SYS_access
342 "access,"
343#endif
344#ifdef SYS_chdir
345 "chdir,"
346#endif
347#ifdef SYS_chmod
348 "chmod,"
349#endif
350#ifdef SYS_close
351 "close,"
352#endif
353#ifdef SYS_creat
354 "creat,"
355#endif
356#ifdef SYS_faccessat
357 "faccessat,"
358#endif
359#ifdef SYS_faccessat2
360 "faccessat2,"
361#endif
362#ifdef SYS_fallocate
363 "fallocate,"
364#endif
365#ifdef SYS_fchdir
366 "fchdir,"
367#endif
368#ifdef SYS_fchmod
369 "fchmod,"
370#endif
371#ifdef SYS_fchmodat
372 "fchmodat,"
373#endif
374#ifdef SYS_fcntl
375 "fcntl,"
376#endif
377#ifdef SYS_fcntl64
378 "fcntl64,"
379#endif
380#ifdef SYS_fgetxattr
381 "fgetxattr,"
382#endif
383#ifdef SYS_flistxattr
384 "flistxattr,"
385#endif
386#ifdef SYS_fremovexattr
387 "fremovexattr,"
388#endif
389#ifdef SYS_fsetxattr
390 "fsetxattr,"
391#endif
392#ifdef SYS_fstat
393 "fstat,"
394#endif
395#ifdef SYS_fstat64
396 "fstat64,"
397#endif
398#ifdef SYS_fstatat64
399 "fstatat64,"
400#endif
401#ifdef SYS_fstatfs
402 "fstatfs,"
403#endif
404#ifdef SYS_fstatfs64
405 "fstatfs64,"
406#endif
407#ifdef SYS_ftruncate
408 "ftruncate,"
409#endif
410#ifdef SYS_ftruncate64
411 "ftruncate64,"
412#endif
413#ifdef SYS_futimesat
414 "futimesat,"
415#endif
416#ifdef SYS_getcwd
417 "getcwd,"
418#endif
419#ifdef SYS_getdents
420 "getdents,"
421#endif
422#ifdef SYS_getdents64
423 "getdents64,"
424#endif
425#ifdef SYS_getxattr
426 "getxattr,"
427#endif
428#ifdef SYS_inotify_add_watch
429 "inotify_add_watch,"
430#endif
431#ifdef SYS_inotify_init
432 "inotify_init,"
433#endif
434#ifdef SYS_inotify_init1
435 "inotify_init1,"
436#endif
437#ifdef SYS_inotify_rm_watch
438 "inotify_rm_watch,"
439#endif
440#ifdef SYS_lgetxattr
441 "lgetxattr,"
442#endif
443#ifdef SYS_link
444 "link,"
445#endif
446#ifdef SYS_linkat
447 "linkat,"
448#endif
449#ifdef SYS_listxattr
450 "listxattr,"
451#endif
452#ifdef SYS_llistxattr
453 "llistxattr,"
454#endif
455#ifdef SYS_lremovexattr
456 "lremovexattr,"
457#endif
458#ifdef SYS_lsetxattr
459 "lsetxattr,"
460#endif
461#ifdef SYS_lstat
462 "lstat,"
463#endif
464#ifdef SYS_lstat64
465 "lstat64,"
466#endif
467#ifdef SYS_mkdir
468 "mkdir,"
469#endif
470#ifdef SYS_mkdirat
471 "mkdirat,"
472#endif
473#ifdef SYS_mknod
474 "mknod,"
475#endif
476#ifdef SYS_mknodat
477 "mknodat,"
478#endif
479#ifdef SYS_mmap
480 "mmap,"
481#endif
482#ifdef SYS_mmap2
483 "mmap2,"
484#endif
485#ifdef SYS_munmap
486 "munmap,"
487#endif
488#ifdef SYS_newfstatat
489 "newfstatat,"
490#endif
491#ifdef SYS_oldfstat
492 "oldfstat,"
493#endif
494#ifdef SYS_oldlstat
495 "oldlstat,"
496#endif
497#ifdef SYS_oldstat
498 "oldstat,"
499#endif
500#ifdef SYS_open
501 "open,"
502#endif
503#ifdef SYS_openat
504 "openat,"
505#endif
506#ifdef SYS_readlink
507 "readlink,"
508#endif
509#ifdef SYS_readlinkat
510 "readlinkat,"
511#endif
512#ifdef SYS_removexattr
513 "removexattr,"
514#endif
515#ifdef SYS_rename
516 "rename,"
517#endif
518#ifdef SYS_renameat
519 "renameat,"
520#endif
521#ifdef SYS_renameat2
522 "renameat2,"
523#endif
524#ifdef SYS_rmdir
525 "rmdir,"
526#endif
527#ifdef SYS_setxattr
528 "setxattr,"
529#endif
530#ifdef SYS_stat
531 "stat,"
532#endif
533#ifdef SYS_stat64
534 "stat64,"
535#endif
536#ifdef SYS_statfs
537 "statfs,"
538#endif
539#ifdef SYS_statfs64
540 "statfs64,"
541#endif
542#ifdef SYS_statx
543 "statx,"
544#endif
545#ifdef SYS_symlink
546 "symlink,"
547#endif
548#ifdef SYS_symlinkat
549 "symlinkat,"
550#endif
551#ifdef SYS_truncate
552 "truncate,"
553#endif
554#ifdef SYS_truncate64
555 "truncate64,"
556#endif
557#ifdef SYS_unlink
558 "unlink,"
559#endif
560#ifdef SYS_unlinkat
561 "unlinkat,"
562#endif
563#ifdef SYS_utime
564 "utime,"
565#endif
566#ifdef SYS_utimensat
567 "utimensat,"
568#endif
569#ifdef SYS_utimes
570 "utimes"
571#endif
572 },
573 { .name = "@io-event", .list =
574#ifdef SYS__newselect
575 "_newselect,"
576#endif
577#ifdef SYS_epoll_create
578 "epoll_create,"
579#endif
580#ifdef SYS_epoll_create1
581 "epoll_create1,"
582#endif
583#ifdef SYS_epoll_ctl
584 "epoll_ctl,"
585#endif
586#ifdef SYS_epoll_ctl_old
587 "epoll_ctl_old,"
588#endif
589#ifdef SYS_epoll_pwait
590 "epoll_pwait,"
591#endif
592#ifdef SYS_epoll_wait
593 "epoll_wait,"
594#endif
595#ifdef SYS_epoll_wait_old
596 "epoll_wait_old,"
597#endif
598#ifdef SYS_eventfd
599 "eventfd,"
600#endif
601#ifdef SYS_eventfd2
602 "eventfd2,"
603#endif
604#ifdef SYS_poll
605 "poll,"
606#endif
607#ifdef SYS_ppoll
608 "ppoll,"
609#endif
610#ifdef SYS_pselect6
611 "pselect6,"
612#endif
613#ifdef SYS_select
614 "select"
615#endif
616 },
617 { .name = "@ipc", .list =
618#ifdef SYS_ipc
619 "ipc,"
620#endif
621#ifdef SYS_memfd_create
622 "memfd_create,"
623#endif
624#ifdef SYS_mq_getsetattr
625 "mq_getsetattr,"
626#endif
627#ifdef SYS_mq_notify
628 "mq_notify,"
629#endif
630#ifdef SYS_mq_open
631 "mq_open,"
632#endif
633#ifdef SYS_mq_timedreceive
634 "mq_timedreceive,"
635#endif
636#ifdef SYS_mq_timedsend
637 "mq_timedsend,"
638#endif
639#ifdef SYS_mq_unlink
640 "mq_unlink,"
641#endif
642#ifdef SYS_msgctl
643 "msgctl,"
644#endif
645#ifdef SYS_msgget
646 "msgget,"
647#endif
648#ifdef SYS_msgrcv
649 "msgrcv,"
650#endif
651#ifdef SYS_msgsnd
652 "msgsnd,"
653#endif
654#ifdef SYS_pipe
655 "pipe,"
656#endif
657#ifdef SYS_pipe2
658 "pipe2,"
659#endif
660#ifdef SYS_process_vm_readv
661 "process_vm_readv,"
662#endif
663#ifdef SYS_process_vm_writev
664 "process_vm_writev,"
665#endif
666#ifdef SYS_semctl
667 "semctl,"
668#endif
669#ifdef SYS_semget
670 "semget,"
671#endif
672#ifdef SYS_semop
673 "semop,"
674#endif
675#ifdef SYS_semtimedop
676 "semtimedop,"
677#endif
678#ifdef SYS_shmat
679 "shmat,"
680#endif
681#ifdef SYS_shmctl
682 "shmctl,"
683#endif
684#ifdef SYS_shmdt
685 "shmdt,"
686#endif
687#ifdef SYS_shmget
688 "shmget"
689#endif
690 },
691 { .name = "@keyring", .list =
692#ifdef SYS_add_key
693 "add_key,"
694#endif
695#ifdef SYS_keyctl
696 "keyctl,"
697#endif
698#ifdef SYS_request_key
699 "request_key"
700#endif
701 },
702 { .name = "@memlock", .list =
703#ifdef SYS_mlock
704 "mlock,"
705#endif
706#ifdef SYS_mlock2
707 "mlock2,"
708#endif
709#ifdef SYS_mlockall
710 "mlockall,"
711#endif
712#ifdef SYS_munlock
713 "munlock,"
714#endif
715#ifdef SYS_munlockall
716 "munlockall"
717#endif
718 },
719 { .name = "@module", .list =
720#ifdef SYS_delete_module
721 "delete_module,"
722#endif
723#ifdef SYS_finit_module
724 "finit_module,"
725#endif
726#ifdef SYS_init_module
727 "init_module"
728#endif
729 },
730 { .name = "@mount", .list =
731#ifdef SYS_chroot
732 "chroot,"
733#endif
734#ifdef SYS_mount
735 "mount,"
736#endif
737#ifdef SYS_pivot_root
738 "pivot_root,"
739#endif
740#ifdef SYS_umount
741 "umount,"
742#endif
743#ifdef SYS_umount2
744 "umount2"
745#endif
746 },
747 { .name = "@network-io", .list =
748#ifdef SYS_accept
749 "accept,"
750#endif
751#ifdef SYS_accept4
752 "accept4,"
753#endif
754#ifdef SYS_bind
755 "bind,"
756#endif
757#ifdef SYS_connect
758 "connect,"
759#endif
760#ifdef SYS_getpeername
761 "getpeername,"
762#endif
763#ifdef SYS_getsockname
764 "getsockname,"
765#endif
766#ifdef SYS_getsockopt
767 "getsockopt,"
768#endif
769#ifdef SYS_listen
770 "listen,"
771#endif
772#ifdef SYS_recv
773 "recv,"
774#endif
775#ifdef SYS_recvfrom
776 "recvfrom,"
777#endif
778#ifdef SYS_recvmmsg
779 "recvmmsg,"
780#endif
781#ifdef SYS_recvmsg
782 "recvmsg,"
783#endif
784#ifdef SYS_send
785 "send,"
786#endif
787#ifdef SYS_sendmmsg
788 "sendmmsg,"
789#endif
790#ifdef SYS_sendmsg
791 "sendmsg,"
792#endif
793#ifdef SYS_sendto
794 "sendto,"
795#endif
796#ifdef SYS_setsockopt
797 "setsockopt,"
798#endif
799#ifdef SYS_shutdown
800 "shutdown,"
801#endif
802#ifdef SYS_socket
803 "socket,"
804#endif
805#ifdef SYS_socketcall
806 "socketcall,"
807#endif
808#ifdef SYS_socketpair
809 "socketpair"
810#endif
811 },
812 { .name = "@obsolete", .list =
813#ifdef SYS__sysctl
814 "_sysctl,"
815#endif
816#ifdef SYS_afs_syscall
817 "afs_syscall,"
818#endif
819#ifdef SYS_bdflush
820 "bdflush,"
821#endif
822#ifdef SYS_break
823 "break,"
824#endif
825#ifdef SYS_create_module
826 "create_module,"
827#endif
828#ifdef SYS_ftime
829 "ftime,"
830#endif
831#ifdef SYS_get_kernel_syms
832 "get_kernel_syms,"
833#endif
834#ifdef SYS_getpmsg
835 "getpmsg,"
836#endif
837#ifdef SYS_gtty
838 "gtty,"
839#endif
840#ifdef SYS_idle
841 "idle,"
842#endif
843#ifdef SYS_lock
844 "lock,"
845#endif
846#ifdef SYS_mpx
847 "mpx,"
848#endif
849#ifdef SYS_prof
850 "prof,"
851#endif
852#ifdef SYS_profil
853 "profil,"
854#endif
855#ifdef SYS_putpmsg
856 "putpmsg,"
857#endif
858#ifdef SYS_query_module
859 "query_module,"
860#endif
861#ifdef SYS_security
862 "security,"
863#endif
864#ifdef SYS_sgetmask
865 "sgetmask,"
866#endif
867#ifdef SYS_ssetmask
868 "ssetmask,"
869#endif
870#ifdef SYS_stty
871 "stty,"
872#endif
873#ifdef SYS_sysfs
874 "sysfs,"
875#endif
876#ifdef SYS_tuxcall
877 "tuxcall,"
878#endif
879#ifdef SYS_ulimit
880 "ulimit,"
881#endif
882#ifdef SYS_uselib
883 "uselib,"
884#endif
885#ifdef SYS_ustat
886 "ustat,"
887#endif
888#ifdef SYS_vserver
889 "vserver"
890#endif
891#if !defined(SYS__sysctl) && !defined(SYS_afs_syscall) && !defined(SYS_bdflush) && !defined(SYS_break) && !defined(SYS_create_module) && !defined(SYS_ftime) && !defined(SYS_get_kernel_syms) && !defined(SYS_getpmsg) && !defined(SYS_gtty) && !defined(SYS_lock) && !defined(SYS_mpx) && !defined(SYS_prof) && !defined(SYS_profil) && !defined(SYS_putpmsg) && !defined(SYS_query_module) && !defined(SYS_security) && !defined(SYS_sgetmask) && !defined(SYS_ssetmask) && !defined(SYS_stty) && !defined(SYS_sysfs) && !defined(SYS_tuxcall) && !defined(SYS_ulimit) && !defined(SYS_uselib) && !defined(SYS_ustat) && !defined(SYS_vserver)
892 "__dummy_syscall__" // workaround for arm64 which doesn't have any of above defined and empty syscall lists are not allowed
893#endif
894 },
895 { .name = "@privileged", .list =
896 "@chown,"
897 "@clock,"
898 "@module,"
899 "@raw-io,"
900 "@reboot,"
901 "@swap,"
902#ifdef SYS__sysctl
903 "_sysctl,"
904#endif
905#ifdef SYS_acct
906 "acct,"
907#endif
908#ifdef SYS_bpf
909 "bpf,"
910#endif
911#ifdef SYS_capset
912 "capset,"
913#endif
914#ifdef SYS_chroot
915 "chroot,"
916#endif
917#ifdef SYS_fanotify_init
918 "fanotify_init,"
919#endif
920#ifdef SYS_mount
921 "mount,"
922#endif
923#ifdef SYS_nfsservctl
924 "nfsservctl,"
925#endif
926#ifdef SYS_open_by_handle_at
927 "open_by_handle_at,"
928#endif
929#ifdef SYS_pivot_root
930 "pivot_root,"
931#endif
932#ifdef SYS_quotactl
933 "quotactl,"
934#endif
935#ifdef SYS_setdomainname
936 "setdomainname,"
937#endif
938#ifdef SYS_setfsuid
939 "setfsuid,"
940#endif
941#ifdef SYS_setfsuid32
942 "setfsuid32,"
943#endif
944#ifdef SYS_setgroups
945 "setgroups,"
946#endif
947#ifdef SYS_setgroups32
948 "setgroups32,"
949#endif
950#ifdef SYS_sethostname
951 "sethostname,"
952#endif
953#ifdef SYS_setresuid
954 "setresuid,"
955#endif
956#ifdef SYS_setresuid32
957 "setresuid32,"
958#endif
959#ifdef SYS_setreuid
960 "setreuid,"
961#endif
962#ifdef SYS_setreuid32
963 "setreuid32,"
964#endif
965#ifdef SYS_setuid
966 "setuid,"
967#endif
968#ifdef SYS_setuid32
969 "setuid32,"
970#endif
971#ifdef SYS_umount2
972 "umount2,"
973#endif
974#ifdef SYS_vhangup
975 "vhangup"
976#endif
977 },
978 { .name = "@process", .list =
979#ifdef SYS_arch_prctl
980 "arch_prctl,"
981#endif
982#ifdef SYS_capget
983 "capget,"
984#endif
985#ifdef SYS_clone
986 "clone,"
987#endif
988#ifdef SYS_execveat
989 "execveat,"
990#endif
991#ifdef SYS_fork
992 "fork,"
993#endif
994#ifdef SYS_getrusage
995 "getrusage,"
996#endif
997#ifdef SYS_kill
998 "kill,"
999#endif
1000#ifdef SYS_pidfd_send_signal
1001 "pidfd_send_signal,"
1002#endif
1003#ifdef SYS_prctl
1004 "prctl,"
1005#endif
1006#ifdef SYS_rt_sigqueueinfo
1007 "rt_sigqueueinfo,"
1008#endif
1009#ifdef SYS_rt_tgsigqueueinfo
1010 "rt_tgsigqueueinfo,"
1011#endif
1012#ifdef SYS_setns
1013 "setns,"
1014#endif
1015#ifdef SYS_swapcontext
1016 "swapcontext,"
1017#endif
1018#ifdef SYS_tgkill
1019 "tgkill,"
1020#endif
1021#ifdef SYS_times
1022 "times,"
1023#endif
1024#ifdef SYS_tkill
1025 "tkill,"
1026#endif
1027#ifdef SYS_unshare
1028 "unshare,"
1029#endif
1030#ifdef SYS_vfork
1031 "vfork,"
1032#endif
1033#ifdef SYS_wait4
1034 "wait4,"
1035#endif
1036#ifdef SYS_waitid
1037 "waitid,"
1038#endif
1039#ifdef SYS_waitpid
1040 "waitpid"
1041#endif
1042 },
1043 { .name = "@raw-io", .list =
1044#ifdef SYS_ioperm
1045 "ioperm,"
1046#endif
1047#ifdef SYS_iopl
1048 "iopl,"
1049#endif
1050#ifdef SYS_pciconfig_iobase
1051 "pciconfig_iobase,"
1052#endif
1053#ifdef SYS_pciconfig_read
1054 "pciconfig_read,"
1055#endif
1056#ifdef SYS_pciconfig_write
1057 "pciconfig_write,"
1058#endif
1059#ifdef SYS_s390_mmio_read
1060 "s390_mmio_read,"
1061#endif
1062#ifdef SYS_s390_mmio_write
1063 "s390_mmio_write"
1064#endif
1065#if !defined(SYS_ioperm) && !defined(SYS_iopl) && !defined(SYS_pciconfig_iobase) && !defined(SYS_pciconfig_read) && !defined(SYS_pciconfig_write) && !defined(SYS_s390_mmio_read) && !defined(SYS_s390_mmio_write)
1066 "__dummy_syscall__" // workaround for s390x which doesn't have any of above defined and empty syscall lists are not allowed
1067#endif
1068 },
1069 { .name = "@reboot", .list =
1070#ifdef SYS_kexec_load
1071 "kexec_load,"
1072#endif
1073#ifdef SYS_kexec_file_load
1074 "kexec_file_load,"
1075#endif
1076#ifdef SYS_reboot
1077 "reboot,"
1078#endif
1079 },
1080 { .name = "@resources", .list =
1081#ifdef SYS_ioprio_set
1082 "ioprio_set,"
1083#endif
1084#ifdef SYS_mbind
1085 "mbind,"
1086#endif
1087#ifdef SYS_migrate_pages
1088 "migrate_pages,"
1089#endif
1090#ifdef SYS_move_pages
1091 "move_pages,"
1092#endif
1093#ifdef SYS_nice
1094 "nice,"
1095#endif
1096#ifdef SYS_sched_setaffinity
1097 "sched_setaffinity,"
1098#endif
1099#ifdef SYS_sched_setattr
1100 "sched_setattr,"
1101#endif
1102#ifdef SYS_sched_setparam
1103 "sched_setparam,"
1104#endif
1105#ifdef SYS_sched_setscheduler
1106 "sched_setscheduler,"
1107#endif
1108#ifdef SYS_set_mempolicy
1109 "set_mempolicy"
1110#endif
1111 },
1112 { .name = "@setuid", .list =
1113#ifdef SYS_setgid
1114 "setgid,"
1115#endif
1116#ifdef SYS_setgid32
1117 "setgid32,"
1118#endif
1119#ifdef SYS_setgroups
1120 "setgroups,"
1121#endif
1122#ifdef SYS_setgroups32
1123 "setgroups32,"
1124#endif
1125#ifdef SYS_setregid
1126 "setregid,"
1127#endif
1128#ifdef SYS_setregid32
1129 "setregid32,"
1130#endif
1131#ifdef SYS_setresgid
1132 "setresgid,"
1133#endif
1134#ifdef SYS_setresgid32
1135 "setresgid32,"
1136#endif
1137#ifdef SYS_setresuid
1138 "setresuid,"
1139#endif
1140#ifdef SYS_setresuid32
1141 "setresuid32,"
1142#endif
1143#ifdef SYS_setreuid
1144 "setreuid,"
1145#endif
1146#ifdef SYS_setreuid32
1147 "setreuid32,"
1148#endif
1149#ifdef SYS_setuid
1150 "setuid,"
1151#endif
1152#ifdef SYS_setuid32
1153 "setuid32"
1154#endif
1155 },
1156 { .name = "@signal", .list =
1157#ifdef SYS_rt_sigaction
1158 "rt_sigaction,"
1159#endif
1160#ifdef SYS_rt_sigpending
1161 "rt_sigpending,"
1162#endif
1163#ifdef SYS_rt_sigprocmask
1164 "rt_sigprocmask,"
1165#endif
1166#ifdef SYS_rt_sigsuspend
1167 "rt_sigsuspend,"
1168#endif
1169#ifdef SYS_rt_sigtimedwait
1170 "rt_sigtimedwait,"
1171#endif
1172#ifdef SYS_sigaction
1173 "sigaction,"
1174#endif
1175#ifdef SYS_sigaltstack
1176 "sigaltstack,"
1177#endif
1178#ifdef SYS_signal
1179 "signal,"
1180#endif
1181#ifdef SYS_signalfd
1182 "signalfd,"
1183#endif
1184#ifdef SYS_signalfd4
1185 "signalfd4,"
1186#endif
1187#ifdef SYS_sigpending
1188 "sigpending,"
1189#endif
1190#ifdef SYS_sigprocmask
1191 "sigprocmask,"
1192#endif
1193#ifdef SYS_sigsuspend
1194 "sigsuspend"
1195#endif
1196 },
1197 { .name = "@swap", .list =
1198#ifdef SYS_swapon
1199 "swapon,"
1200#endif
1201#ifdef SYS_swapoff
1202 "swapoff"
1203#endif
1204 },
1205 { .name = "@sync", .list =
1206#ifdef SYS_fdatasync
1207 "fdatasync,"
1208#endif
1209#ifdef SYS_fsync
1210 "fsync,"
1211#endif
1212#ifdef SYS_msync
1213 "msync,"
1214#endif
1215#ifdef SYS_sync
1216 "sync,"
1217#endif
1218#ifdef SYS_sync_file_range
1219 "sync_file_range,"
1220#endif
1221#ifdef SYS_sync_file_range2
1222 "sync_file_range2,"
1223#endif
1224#ifdef SYS_syncfs
1225 "syncfs"
1226#endif
1227 },
1228 { .name = "@system-service", .list =
1229 "@aio,"
1230 "@basic-io,"
1231 "@chown,"
1232 "@default,"
1233 "@file-system,"
1234 "@io-event,"
1235 "@ipc,"
1236 "@keyring,"
1237 "@memlock,"
1238 "@network-io,"
1239 "@process,"
1240 "@resources,"
1241 "@setuid,"
1242 "@signal,"
1243 "@sync,"
1244 "@timer,"
1245#ifdef SYS_brk
1246 "brk,"
1247#endif
1248#ifdef SYS_capget
1249 "capget,"
1250#endif
1251#ifdef SYS_capset
1252 "capset,"
1253#endif
1254#ifdef SYS_copy_file_range
1255 "copy_file_range,"
1256#endif
1257#ifdef SYS_fadvise64
1258 "fadvise64,"
1259#endif
1260#ifdef SYS_fadvise64_64
1261 "fadvise64_64,"
1262#endif
1263#ifdef SYS_flock
1264 "flock,"
1265#endif
1266#ifdef SYS_get_mempolicy
1267 "get_mempolicy,"
1268#endif
1269#ifdef SYS_getcpu
1270 "getcpu,"
1271#endif
1272#ifdef SYS_getpriority
1273 "getpriority,"
1274#endif
1275#ifdef SYS_getrandom
1276 "getrandom,"
1277#endif
1278#ifdef SYS_ioctl
1279 "ioctl,"
1280#endif
1281#ifdef SYS_ioprio_get
1282 "ioprio_get,"
1283#endif
1284#ifdef SYS_kcmp
1285 "kcmp,"
1286#endif
1287#ifdef SYS_madvise
1288 "madvise,"
1289#endif
1290#ifdef SYS_mprotect
1291 "mprotect,"
1292#endif
1293#ifdef SYS_mremap
1294 "mremap,"
1295#endif
1296#ifdef SYS_name_to_handle_at
1297 "name_to_handle_at,"
1298#endif
1299#ifdef SYS_oldolduname
1300 "oldolduname,"
1301#endif
1302#ifdef SYS_olduname
1303 "olduname,"
1304#endif
1305#ifdef SYS_personality
1306 "personality,"
1307#endif
1308#ifdef SYS_readahead
1309 "readahead,"
1310#endif
1311#ifdef SYS_readdir
1312 "readdir,"
1313#endif
1314#ifdef SYS_remap_file_pages
1315 "remap_file_pages,"
1316#endif
1317#ifdef SYS_sched_get_priority_max
1318 "sched_get_priority_max,"
1319#endif
1320#ifdef SYS_sched_get_priority_min
1321 "sched_get_priority_min,"
1322#endif
1323#ifdef SYS_sched_getaffinity
1324 "sched_getaffinity,"
1325#endif
1326#ifdef SYS_sched_getattr
1327 "sched_getattr,"
1328#endif
1329#ifdef SYS_sched_getparam
1330 "sched_getparam,"
1331#endif
1332#ifdef SYS_sched_getscheduler
1333 "sched_getscheduler,"
1334#endif
1335#ifdef SYS_sched_rr_get_interval
1336 "sched_rr_get_interval,"
1337#endif
1338#ifdef SYS_sched_yield
1339 "sched_yield,"
1340#endif
1341#ifdef SYS_sendfile
1342 "sendfile,"
1343#endif
1344#ifdef SYS_sendfile64
1345 "sendfile64,"
1346#endif
1347#ifdef SYS_setfsgid
1348 "setfsgid,"
1349#endif
1350#ifdef SYS_setfsgid32
1351 "setfsgid32,"
1352#endif
1353#ifdef SYS_setfsuid
1354 "setfsuid,"
1355#endif
1356#ifdef SYS_setfsuid32
1357 "setfsuid32,"
1358#endif
1359#ifdef SYS_setpgid
1360 "setpgid,"
1361#endif
1362#ifdef SYS_setsid
1363 "setsid,"
1364#endif
1365#ifdef SYS_splice
1366 "splice,"
1367#endif
1368#ifdef SYS_sysinfo
1369 "sysinfo,"
1370#endif
1371#ifdef SYS_tee
1372 "tee,"
1373#endif
1374#ifdef SYS_umask
1375 "umask,"
1376#endif
1377#ifdef SYS_uname
1378 "uname,"
1379#endif
1380#ifdef SYS_userfaultfd
1381 "userfaultfd,"
1382#endif
1383#ifdef SYS_vmsplice
1384 "vmsplice"
1385#endif
1386 },
1387 { .name = "@timer", .list =
1388#ifdef SYS_alarm
1389 "alarm,"
1390#endif
1391#ifdef SYS_getitimer
1392 "getitimer,"
1393#endif
1394#ifdef SYS_setitimer
1395 "setitimer,"
1396#endif
1397#ifdef SYS_timer_create
1398 "timer_create,"
1399#endif
1400#ifdef SYS_timer_delete
1401 "timer_delete,"
1402#endif
1403#ifdef SYS_timer_getoverrun
1404 "timer_getoverrun,"
1405#endif
1406#ifdef SYS_timer_gettime
1407 "timer_gettime,"
1408#endif
1409#ifdef SYS_timer_settime
1410 "timer_settime,"
1411#endif
1412#ifdef SYS_timerfd_create
1413 "timerfd_create,"
1414#endif
1415#ifdef SYS_timerfd_gettime
1416 "timerfd_gettime,"
1417#endif
1418#ifdef SYS_timerfd_settime
1419 "timerfd_settime,"
1420#endif
1421#ifdef SYS_times
1422 "times"
1423#endif
1424 }
1425};
1426
1427// return SYSCALL_ERROR if error, or syscall number
1428static int syscall_find_name(const char *name) {
1429 int i;
1430 int elems = sizeof(syslist) / sizeof(syslist[0]);
1431 for (i = 0; i < elems; i++) {
1432 if (strcmp(name, syslist[i].name) == 0)
1433 return syslist[i].nr;
1434 }
1435
1436 return SYSCALL_ERROR;
1437}
1438
1439static int syscall_find_name_32(const char *name) {
1440 int i;
1441 int elems = sizeof(syslist32) / sizeof(syslist32[0]);
1442 for (i = 0; i < elems; i++) {
1443 if (strcmp(name, syslist32[i].name) == 0)
1444 return syslist32[i].nr;
1445 }
1446
1447 return SYSCALL_ERROR;
1448}
1449
1450const char *syscall_find_nr(int nr) {
1451 int i;
1452 int elems = sizeof(syslist) / sizeof(syslist[0]);
1453 for (i = 0; i < elems; i++) {
1454 if (nr == syslist[i].nr)
1455 return syslist[i].name;
1456 }
1457
1458 return "unknown";
1459}
1460
1461const char *syscall_find_nr_32(int nr) {
1462 int i;
1463 int elems = sizeof(syslist32) / sizeof(syslist32[0]);
1464 for (i = 0; i < elems; i++) {
1465 if (nr == syslist32[i].nr)
1466 return syslist32[i].name;
1467 }
1468
1469 return "unknown";
1470}
1471
1472void syscall_print(void) {
1473 int i;
1474 int elems = sizeof(syslist) / sizeof(syslist[0]);
1475 for (i = 0; i < elems; i++) {
1476 printf("%d\t- %s\n", syslist[i].nr, syslist[i].name);
1477 }
1478 printf("\n");
1479}
1480
1481void syscall_print_32(void) {
1482 int i;
1483 int elems = sizeof(syslist32) / sizeof(syslist32[0]);
1484 for (i = 0; i < elems; i++) {
1485 printf("%d\t- %s\n", syslist32[i].nr, syslist32[i].name);
1486 }
1487 printf("\n");
1488}
1489
1490static const char *syscall_find_group(const char *name) {
1491 int i;
1492 int elems = sizeof(sysgroups) / sizeof(sysgroups[0]);
1493 for (i = 0; i < elems; i++) {
1494 if (strcmp(name, sysgroups[i].name) == 0)
1495 return sysgroups[i].list;
1496 }
1497
1498 return NULL;
1499}
1500
1501// allowed input:
1502// - syscall
1503// - syscall(error)
1504static void syscall_process_name(const char *name, int *syscall_nr, int *error_nr, bool native) {
1505 assert(name);
1506 if (strlen(name) == 0)
1507 goto error;
1508 *error_nr = -1;
1509
1510 // syntax check
1511 char *str = strdup(name);
1512 if (!str)
1513 errExit("strdup");
1514
1515 char *syscall_name = str;
1516 char *error_name = strchr(str, ':');
1517 if (error_name) {
1518 *error_name = '\0';
1519 error_name++;
1520 }
1521 if (strlen(syscall_name) == 0) {
1522 free(str);
1523 goto error;
1524 }
1525
1526 if (*syscall_name == '$')
1527 *syscall_nr = strtol(syscall_name + 1, NULL, 0);
1528 else {
1529 if (native)
1530 *syscall_nr = syscall_find_name(syscall_name);
1531 else
1532 *syscall_nr = syscall_find_name_32(syscall_name);
1533 }
1534 if (error_name) {
1535 if (strcmp(error_name, "kill") == 0)
1536 *error_nr = ERRNO_KILL;
1537 else {
1538 *error_nr = errno_find_name(error_name);
1539 if (*error_nr == -1)
1540 *syscall_nr = SYSCALL_ERROR;
1541 }
1542 }
1543
1544 free(str);
1545 return;
1546
1547error:
1548 fprintf(stderr, "Error fseccomp: invalid syscall list entry %s\n", name);
1549 exit(1);
1550}
1551
1552// return 1 if error, 0 if OK
1553int syscall_check_list(const char *slist, filter_fn *callback, int fd, int arg, void *ptrarg, bool native) {
1554 // don't allow empty lists
1555 if (slist == NULL || *slist == '\0') {
1556 fprintf(stderr, "Error fseccomp: empty syscall lists are not allowed\n");
1557 exit(1);
1558 }
1559
1560 // work on a copy of the string
1561 char *str = strdup(slist);
1562 if (!str)
1563 errExit("strdup");
1564
1565 char *saveptr;
1566 char *ptr = strtok_r(str, ",", &saveptr);
1567 if (ptr == NULL) {
1568 fprintf(stderr, "Error fseccomp: empty syscall lists are not allowed\n");
1569 exit(1);
1570 }
1571
1572 while (ptr) {
1573 int syscall_nr;
1574 int error_nr;
1575 if (*ptr == '@') {
1576 const char *new_list = syscall_find_group(ptr);
1577 if (!new_list) {
1578 fprintf(stderr, "Error fseccomp: unknown syscall group %s\n", ptr);
1579 exit(1);
1580 }
1581 syscall_check_list(new_list, callback, fd, arg, ptrarg, native);
1582 }
1583 else {
1584 bool negate = false;
1585 if (*ptr == '!') {
1586 negate = true;
1587 ptr++;
1588 }
1589 syscall_process_name(ptr, &syscall_nr, &error_nr, native);
1590 if (syscall_nr != SYSCALL_ERROR && callback != NULL) {
1591 if (negate) {
1592 syscall_nr = -syscall_nr;
1593 }
1594 if (error_nr >= 0 && fd > 0)
1595 filter_add_errno(fd, syscall_nr, error_nr, ptrarg, native);
1596 else if (error_nr == ERRNO_KILL && fd > 0)
1597 filter_add_blacklist_override(fd, syscall_nr, 0, ptrarg, native);
1598 else if (error_nr >= 0 && fd == 0) {
1599 callback(fd, syscall_nr, error_nr, ptrarg, native);
1600 }
1601 else {
1602 callback(fd, syscall_nr, arg, ptrarg, native);
1603 }
1604 }
1605 }
1606 ptr = strtok_r(NULL, ",", &saveptr);
1607 }
1608
1609 free(str);
1610 return 0;
1611}
1612
1613static void find_syscall(int fd, int syscall, int arg, void *ptrarg, bool native) {
1614 (void)fd;
1615 (void) arg;
1616 (void)native;
1617 SyscallCheckList *ptr = ptrarg;
1618 if (abs(syscall) == ptr->syscall)
1619 ptr->found = true;
1620}
1621
1622// go through list2 and find matches for problem syscall
1623static void syscall_in_list(int fd, int syscall, int arg, void *ptrarg, bool native) {
1624 (void) fd;
1625 (void)arg;
1626 SyscallCheckList *ptr = ptrarg;
1627 SyscallCheckList sl;
1628 const char *name;
1629
1630 sl.found = false;
1631 sl.syscall = syscall;
1632 syscall_check_list(ptr->slist, find_syscall, fd, 0, &sl, native);
1633
1634 if (native)
1635 name = syscall_find_nr(syscall);
1636 else
1637 name = syscall_find_nr_32(syscall);
1638
1639 // if found in the problem list, add to post-exec list
1640 if (sl.found) {
1641 if (ptr->postlist) {
1642 if (asprintf(&ptr->postlist, "%s,%s", ptr->postlist, name) == -1)
1643 errExit("asprintf");
1644 }
1645 else
1646 ptr->postlist = strdup(name);
1647 }
1648 else { // no problem, add to pre-exec list
1649 // build syscall:error_no
1650 char *newcall = NULL;
1651 if (arg != 0) {
1652 if (asprintf(&newcall, "%s:%s", name, errno_find_nr(arg)) == -1)
1653 errExit("asprintf");
1654 }
1655 else {
1656 newcall = strdup(name);
1657 if (!newcall)
1658 errExit("strdup");
1659 }
1660
1661 if (ptr->prelist) {
1662 if (asprintf(&ptr->prelist, "%s,%s", ptr->prelist, newcall) == -1)
1663 errExit("asprintf");
1664 free(newcall);
1665 }
1666 else
1667 ptr->prelist = newcall;
1668 }
1669}
1670
1671// go through list and find matches for syscalls in list @default-keep
1672void syscalls_in_list(const char *list, const char *slist, int fd, char **prelist, char **postlist, bool native) {
1673 (void) fd;
1674 SyscallCheckList sl;
1675 // these syscalls are used by firejail after the seccomp filter is initialized
1676 sl.slist = slist;
1677 sl.prelist = NULL;
1678 sl.postlist = NULL;
1679 syscall_check_list(list, syscall_in_list, 0, 0, &sl, native);
1680 if (!arg_quiet) {
1681 printf("Seccomp list in: %s,", list);
1682 if (sl.slist)
1683 printf(" check list: %s,", sl.slist);
1684 if (sl.prelist)
1685 printf(" prelist: %s,", sl.prelist);
1686 if (sl.postlist)
1687 printf(" postlist: %s", sl.postlist);
1688 printf("\n");
1689 }
1690 *prelist = sl.prelist;
1691 *postlist = sl.postlist;
1692}
diff --git a/src/libpostexecseccomp/Makefile.in b/src/libpostexecseccomp/Makefile.in
index 92803342c..c08ae78ce 100644
--- a/src/libpostexecseccomp/Makefile.in
+++ b/src/libpostexecseccomp/Makefile.in
@@ -4,23 +4,25 @@ VERSION=@PACKAGE_VERSION@
4NAME=@PACKAGE_NAME@ 4NAME=@PACKAGE_NAME@
5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ 5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
6 6
7H_FILE_LIST = $(sort $(wildcard *.[h])) 7H_FILE_LIST = $(sort $(wildcard *.h))
8C_FILE_LIST = $(sort $(wildcard *.c)) 8C_FILE_LIST = $(sort $(wildcard *.c))
9OBJS = $(C_FILE_LIST:.c=.o) 9OBJS = $(C_FILE_LIST:.c=.o)
10BINOBJS = $(foreach file, $(OBJS), $file) 10BINOBJS = $(foreach file, $(OBJS), $file)
11CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security 11CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now 12LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
13 13
14.PHONY: all
14all: libpostexecseccomp.so 15all: libpostexecseccomp.so
15 16
16%.o : %.c $(H_FILE_LIST) 17%.o : %.c $(H_FILE_LIST) ../include/seccomp.h ../include/rundefs.h
17 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 18 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
18 19
19libpostexecseccomp.so: $(OBJS) 20libpostexecseccomp.so: $(OBJS)
20 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl 21 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
21 22
23.PHONY: clean
24clean:; rm -fr $(OBJS) libpostexecseccomp.so *.plist
22 25
23clean:; rm -f $(OBJS) libpostexecseccomp.so 26.PHONY: distclean
24
25distclean: clean 27distclean: clean
26 rm -fr Makefile 28 rm -fr Makefile
diff --git a/src/libpostexecseccomp/libpostexecseccomp.c b/src/libpostexecseccomp/libpostexecseccomp.c
index 2c9d02c84..1d1eb283b 100644
--- a/src/libpostexecseccomp/libpostexecseccomp.c
+++ b/src/libpostexecseccomp/libpostexecseccomp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,30 +17,36 @@
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#include "libpostexecseccomp.h"
21#include "../include/seccomp.h" 20#include "../include/seccomp.h"
21#include "../include/rundefs.h"
22#include <fcntl.h> 22#include <fcntl.h>
23#include <linux/filter.h> 23#include <linux/filter.h>
24#include <sys/mman.h> 24#include <sys/mman.h>
25#include <sys/prctl.h> 25#include <sys/prctl.h>
26#include <unistd.h> 26#include <unistd.h>
27#include <stdio.h>
27 28
28__attribute__((constructor)) 29__attribute__((constructor))
29static void load_seccomp(void) { 30static void load_seccomp(void) {
30 int fd = open(RUN_SECCOMP_POSTEXEC, O_RDONLY); 31 int fd = open(RUN_SECCOMP_POSTEXEC, O_RDONLY);
31 if (fd == -1) 32 if (fd == -1) {
33 fprintf(stderr, "Error: cannot open seccomp postexec filter file %s\n", RUN_SECCOMP_POSTEXEC);
32 return; 34 return;
35 }
33 36
34 int size = lseek(fd, 0, SEEK_END); 37 off_t size = lseek(fd, 0, SEEK_END);
38 if (size <= 0) {
39 close(fd);
40 return;
41 }
35 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter); 42 unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter);
36 struct sock_filter *filter = MAP_FAILED; 43 struct sock_filter *filter = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
37 if (size != 0)
38 filter = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
39
40 close(fd); 44 close(fd);
41 45
42 if (size == 0 || filter == MAP_FAILED) 46 if (filter == MAP_FAILED) {
47 fprintf(stderr, "Error: cannot map seccomp postexec filter data\n");
43 return; 48 return;
49 }
44 50
45 // install filter 51 // install filter
46 struct sock_fprog prog = { 52 struct sock_fprog prog = {
diff --git a/src/libtrace/Makefile.in b/src/libtrace/Makefile.in
index 6ae078f46..804671ee2 100644
--- a/src/libtrace/Makefile.in
+++ b/src/libtrace/Makefile.in
@@ -4,13 +4,14 @@ VERSION=@PACKAGE_VERSION@
4NAME=@PACKAGE_NAME@ 4NAME=@PACKAGE_NAME@
5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ 5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
6 6
7H_FILE_LIST = $(sort $(wildcard *.[h])) 7H_FILE_LIST = $(sort $(wildcard *.h))
8C_FILE_LIST = $(sort $(wildcard *.c)) 8C_FILE_LIST = $(sort $(wildcard *.c))
9OBJS = $(C_FILE_LIST:.c=.o) 9OBJS = $(C_FILE_LIST:.c=.o)
10BINOBJS = $(foreach file, $(OBJS), $file) 10BINOBJS = $(foreach file, $(OBJS), $file)
11CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security 11CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now 12LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
13 13
14.PHONY: all
14all: libtrace.so 15all: libtrace.so
15 16
16%.o : %.c $(H_FILE_LIST) 17%.o : %.c $(H_FILE_LIST)
@@ -19,8 +20,9 @@ all: libtrace.so
19libtrace.so: $(OBJS) 20libtrace.so: $(OBJS)
20 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl 21 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
21 22
23.PHONY: clean
24clean:; rm -fr $(OBJS) libtrace.so *.plist
22 25
23clean:; rm -f $(OBJS) libtrace.so 26.PHONY: distclean
24
25distclean: clean 27distclean: clean
26 rm -fr Makefile 28 rm -fr Makefile
diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c
index 04cf64997..d88512b0a 100644
--- a/src/libtrace/libtrace.c
+++ b/src/libtrace/libtrace.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -23,69 +23,97 @@
23#include <string.h> 23#include <string.h>
24#include <dlfcn.h> 24#include <dlfcn.h>
25#include <sys/types.h> 25#include <sys/types.h>
26#include <limits.h>
26#include <unistd.h> 27#include <unistd.h>
27#include <sys/socket.h> 28#include <sys/socket.h>
28#include <netinet/in.h> 29#include <netinet/in.h>
29#include <arpa/inet.h> 30#include <arpa/inet.h>
30#include <sys/un.h> 31#include <sys/un.h>
31#include <sys/stat.h> 32#include <sys/stat.h>
33#include <syslog.h>
32#include <dirent.h> 34#include <dirent.h>
35#include "../include/rundefs.h"
36
37#define tprintf(fp, args...) \
38 do { \
39 if (!fp)\
40 init(); \
41 fprintf(fp, args); \
42 } while(0)
33 43
34// break recursivity on fopen call 44// break recursivity on fopen call
35typedef FILE *(*orig_fopen_t)(const char *pathname, const char *mode); 45typedef FILE *(*orig_fopen_t)(const char *pathname, const char *mode);
36static orig_fopen_t orig_fopen = NULL; 46static orig_fopen_t orig_fopen = NULL;
37typedef FILE *(*orig_fopen64_t)(const char *pathname, const char *mode); 47typedef FILE *(*orig_fopen64_t)(const char *pathname, const char *mode);
38static orig_fopen64_t orig_fopen64 = NULL; 48static orig_fopen64_t orig_fopen64 = NULL;
49typedef int (*orig_access_t)(const char *pathname, int mode);
50static orig_access_t orig_access = NULL;
39 51
40// 52//
41// pid 53// library constructor/destructor
42// 54//
55// Using fprintf to /dev/tty instead of printf in order to fix #561
56static FILE *ftty = NULL;
43static pid_t mypid = 0; 57static pid_t mypid = 0;
44static inline pid_t pid(void) { 58#define MAXNAME 16 // 8 or larger
45 if (!mypid) 59static char myname[MAXNAME] = "unknown";
46 mypid = getpid(); 60
47 return mypid; 61static void init(void) __attribute__((constructor));
48} 62void init(void) {
63 if (ftty)
64 return;
65
66 orig_fopen = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen");
67 orig_access = (orig_access_t)dlsym(RTLD_NEXT, "access");
68
69 // allow environment variable to override defaults
70 char *logfile = getenv("FIREJAIL_TRACEFILE");
71 if (!logfile) {
72 // if exists, log to trace file
73 logfile = RUN_TRACE_FILE;
74 if (orig_access(logfile, F_OK))
75 // else log to associated tty
76 logfile = "/dev/tty";
77 }
49 78
50// 79 // logfile
51// process name 80 unsigned cnt = 0;
52// 81 while ((ftty = orig_fopen(logfile, "a")) == NULL) {
53#define MAXNAME 16 82 if (++cnt > 10) { // 10 sec
54static char myname[MAXNAME]; 83 perror("Cannot open trace log file");
55static int nameinit = 0; 84 exit(1);
56static char *name(void) {
57 if (!nameinit) {
58 // initialize the name of the process based on /proc/PID/comm
59 memset(myname, 0, MAXNAME);
60
61 pid_t p = pid();
62 char *fname;
63 if (asprintf(&fname, "/proc/%u/comm", p) == -1)
64 return "unknown";
65
66 // read file
67 if (!orig_fopen)
68 orig_fopen = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen");
69 FILE *fp = orig_fopen(fname, "r");
70 if (!fp)
71 return "unknown";
72 if (fgets(myname, MAXNAME, fp) == NULL) {
73 fclose(fp);
74 free(fname);
75 return "unknown";
76 } 85 }
86 sleep(1);
87 }
88 // line buffered stream
89 setvbuf(ftty, NULL, _IOLBF, BUFSIZ);
77 90
78 // clean '\n' 91 // pid
79 char *ptr = strchr(myname, '\n'); 92 mypid = getpid();
80 if (ptr)
81 *ptr = '\0';
82 93
83 fclose(fp); 94 // process name
95 char *fname;
96 if (asprintf(&fname, "/proc/%u/comm", mypid) != -1) {
97 FILE *fp = orig_fopen(fname, "r");
84 free(fname); 98 free(fname);
85 nameinit = 1; 99 if (fp) {
100 if (fgets(myname, MAXNAME, fp) == NULL)
101 strcpy(myname, "unknown");
102 fclose(fp);
103 }
86 } 104 }
87 105
88 return myname; 106 // clean '\n'
107 char *ptr = strchr(myname, '\n');
108 if (ptr)
109 *ptr = '\0';
110
111// tprintf(ftty, "=== tracelib init() [%d:%s] === \n", mypid, myname);
112}
113
114static void fini(void) __attribute__((destructor));
115void fini(void) {
116 fclose(ftty);
89} 117}
90 118
91// 119//
@@ -232,23 +260,23 @@ static char *translate(XTable *table, int val) {
232static void print_sockaddr(int sockfd, const char *call, const struct sockaddr *addr, int rv) { 260static void print_sockaddr(int sockfd, const char *call, const struct sockaddr *addr, int rv) {
233 if (addr->sa_family == AF_INET) { 261 if (addr->sa_family == AF_INET) {
234 struct sockaddr_in *a = (struct sockaddr_in *) addr; 262 struct sockaddr_in *a = (struct sockaddr_in *) addr;
235 printf("%u:%s:%s %d %s port %u:%d\n", pid(), name(), call, sockfd, inet_ntoa(a->sin_addr), ntohs(a->sin_port), rv); 263 tprintf(ftty, "%u:%s:%s %d %s port %u:%d\n", mypid, myname, call, sockfd, inet_ntoa(a->sin_addr), ntohs(a->sin_port), rv);
236 } 264 }
237 else if (addr->sa_family == AF_INET6) { 265 else if (addr->sa_family == AF_INET6) {
238 struct sockaddr_in6 *a = (struct sockaddr_in6 *) addr; 266 struct sockaddr_in6 *a = (struct sockaddr_in6 *) addr;
239 char str[INET6_ADDRSTRLEN]; 267 char str[INET6_ADDRSTRLEN];
240 inet_ntop(AF_INET6, &(a->sin6_addr), str, INET6_ADDRSTRLEN); 268 inet_ntop(AF_INET6, &(a->sin6_addr), str, INET6_ADDRSTRLEN);
241 printf("%u:%s:%s %d %s:%d\n", pid(), name(), call, sockfd, str, rv); 269 tprintf(ftty, "%u:%s:%s %d %s:%d\n", mypid, myname, call, sockfd, str, rv);
242 } 270 }
243 else if (addr->sa_family == AF_UNIX) { 271 else if (addr->sa_family == AF_UNIX) {
244 struct sockaddr_un *a = (struct sockaddr_un *) addr; 272 struct sockaddr_un *a = (struct sockaddr_un *) addr;
245 if (a->sun_path[0]) 273 if (a->sun_path[0])
246 printf("%u:%s:%s %d %s:%d\n", pid(), name(), call, sockfd, a->sun_path, rv); 274 tprintf(ftty, "%u:%s:%s %d %s:%d\n", mypid, myname, call, sockfd, a->sun_path, rv);
247 else 275 else
248 printf("%u:%s:%s %d @%s:%d\n", pid(), name(), call, sockfd, a->sun_path + 1, rv); 276 tprintf(ftty, "%u:%s:%s %d @%s:%d\n", mypid, myname, call, sockfd, a->sun_path + 1, rv);
249 } 277 }
250 else { 278 else {
251 printf("%u:%s:%s %d family %d:%d\n", pid(), name(), call, sockfd, addr->sa_family, rv); 279 tprintf(ftty, "%u:%s:%s %d family %d:%d\n", mypid, myname, call, sockfd, addr->sa_family, rv);
252 } 280 }
253} 281}
254 282
@@ -264,7 +292,7 @@ int open(const char *pathname, int flags, mode_t mode) {
264 orig_open = (orig_open_t)dlsym(RTLD_NEXT, "open"); 292 orig_open = (orig_open_t)dlsym(RTLD_NEXT, "open");
265 293
266 int rv = orig_open(pathname, flags, mode); 294 int rv = orig_open(pathname, flags, mode);
267 printf("%u:%s:open %s:%d\n", pid(), name(), pathname, rv); 295 tprintf(ftty, "%u:%s:open %s:%d\n", mypid, myname, pathname, rv);
268 return rv; 296 return rv;
269} 297}
270 298
@@ -275,7 +303,7 @@ int open64(const char *pathname, int flags, mode_t mode) {
275 orig_open64 = (orig_open64_t)dlsym(RTLD_NEXT, "open64"); 303 orig_open64 = (orig_open64_t)dlsym(RTLD_NEXT, "open64");
276 304
277 int rv = orig_open64(pathname, flags, mode); 305 int rv = orig_open64(pathname, flags, mode);
278 printf("%u:%s:open64 %s:%d\n", pid(), name(), pathname, rv); 306 tprintf(ftty, "%u:%s:open64 %s:%d\n", mypid, myname, pathname, rv);
279 return rv; 307 return rv;
280} 308}
281 309
@@ -287,7 +315,7 @@ int openat(int dirfd, const char *pathname, int flags, mode_t mode) {
287 orig_openat = (orig_openat_t)dlsym(RTLD_NEXT, "openat"); 315 orig_openat = (orig_openat_t)dlsym(RTLD_NEXT, "openat");
288 316
289 int rv = orig_openat(dirfd, pathname, flags, mode); 317 int rv = orig_openat(dirfd, pathname, flags, mode);
290 printf("%u:%s:openat %s:%d\n", pid(), name(), pathname, rv); 318 tprintf(ftty, "%u:%s:openat %s:%d\n", mypid, myname, pathname, rv);
291 return rv; 319 return rv;
292} 320}
293 321
@@ -298,7 +326,7 @@ int openat64(int dirfd, const char *pathname, int flags, mode_t mode) {
298 orig_openat64 = (orig_openat64_t)dlsym(RTLD_NEXT, "openat64"); 326 orig_openat64 = (orig_openat64_t)dlsym(RTLD_NEXT, "openat64");
299 327
300 int rv = orig_openat64(dirfd, pathname, flags, mode); 328 int rv = orig_openat64(dirfd, pathname, flags, mode);
301 printf("%u:%s:openat64 %s:%d\n", pid(), name(), pathname, rv); 329 tprintf(ftty, "%u:%s:openat64 %s:%d\n", mypid, myname, pathname, rv);
302 return rv; 330 return rv;
303} 331}
304 332
@@ -309,7 +337,7 @@ FILE *fopen(const char *pathname, const char *mode) {
309 orig_fopen = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen"); 337 orig_fopen = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen");
310 338
311 FILE *rv = orig_fopen(pathname, mode); 339 FILE *rv = orig_fopen(pathname, mode);
312 printf("%u:%s:fopen %s:%p\n", pid(), name(), pathname, rv); 340 tprintf(ftty, "%u:%s:fopen %s:%p\n", mypid, myname, pathname, rv);
313 return rv; 341 return rv;
314} 342}
315 343
@@ -319,7 +347,7 @@ FILE *fopen64(const char *pathname, const char *mode) {
319 orig_fopen64 = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen64"); 347 orig_fopen64 = (orig_fopen_t)dlsym(RTLD_NEXT, "fopen64");
320 348
321 FILE *rv = orig_fopen64(pathname, mode); 349 FILE *rv = orig_fopen64(pathname, mode);
322 printf("%u:%s:fopen64 %s:%p\n", pid(), name(), pathname, rv); 350 tprintf(ftty, "%u:%s:fopen64 %s:%p\n", mypid, myname, pathname, rv);
323 return rv; 351 return rv;
324} 352}
325#endif /* __GLIBC__ */ 353#endif /* __GLIBC__ */
@@ -333,7 +361,7 @@ FILE *freopen(const char *pathname, const char *mode, FILE *stream) {
333 orig_freopen = (orig_freopen_t)dlsym(RTLD_NEXT, "freopen"); 361 orig_freopen = (orig_freopen_t)dlsym(RTLD_NEXT, "freopen");
334 362
335 FILE *rv = orig_freopen(pathname, mode, stream); 363 FILE *rv = orig_freopen(pathname, mode, stream);
336 printf("%u:%s:freopen %s:%p\n", pid(), name(), pathname, rv); 364 tprintf(ftty, "%u:%s:freopen %s:%p\n", mypid, myname, pathname, rv);
337 return rv; 365 return rv;
338} 366}
339 367
@@ -345,7 +373,7 @@ FILE *freopen64(const char *pathname, const char *mode, FILE *stream) {
345 orig_freopen64 = (orig_freopen64_t)dlsym(RTLD_NEXT, "freopen64"); 373 orig_freopen64 = (orig_freopen64_t)dlsym(RTLD_NEXT, "freopen64");
346 374
347 FILE *rv = orig_freopen64(pathname, mode, stream); 375 FILE *rv = orig_freopen64(pathname, mode, stream);
348 printf("%u:%s:freopen64 %s:%p\n", pid(), name(), pathname, rv); 376 tprintf(ftty, "%u:%s:freopen64 %s:%p\n", mypid, myname, pathname, rv);
349 return rv; 377 return rv;
350} 378}
351#endif /* __GLIBC__ */ 379#endif /* __GLIBC__ */
@@ -358,7 +386,7 @@ int unlink(const char *pathname) {
358 orig_unlink = (orig_unlink_t)dlsym(RTLD_NEXT, "unlink"); 386 orig_unlink = (orig_unlink_t)dlsym(RTLD_NEXT, "unlink");
359 387
360 int rv = orig_unlink(pathname); 388 int rv = orig_unlink(pathname);
361 printf("%u:%s:unlink %s:%d\n", pid(), name(), pathname, rv); 389 tprintf(ftty, "%u:%s:unlink %s:%d\n", mypid, myname, pathname, rv);
362 return rv; 390 return rv;
363} 391}
364 392
@@ -369,7 +397,7 @@ int unlinkat(int dirfd, const char *pathname, int flags) {
369 orig_unlinkat = (orig_unlinkat_t)dlsym(RTLD_NEXT, "unlinkat"); 397 orig_unlinkat = (orig_unlinkat_t)dlsym(RTLD_NEXT, "unlinkat");
370 398
371 int rv = orig_unlinkat(dirfd, pathname, flags); 399 int rv = orig_unlinkat(dirfd, pathname, flags);
372 printf("%u:%s:unlinkat %s:%d\n", pid(), name(), pathname, rv); 400 tprintf(ftty, "%u:%s:unlinkat %s:%d\n", mypid, myname, pathname, rv);
373 return rv; 401 return rv;
374} 402}
375 403
@@ -381,7 +409,7 @@ int mkdir(const char *pathname, mode_t mode) {
381 orig_mkdir = (orig_mkdir_t)dlsym(RTLD_NEXT, "mkdir"); 409 orig_mkdir = (orig_mkdir_t)dlsym(RTLD_NEXT, "mkdir");
382 410
383 int rv = orig_mkdir(pathname, mode); 411 int rv = orig_mkdir(pathname, mode);
384 printf("%u:%s:mkdir %s:%d\n", pid(), name(), pathname, rv); 412 tprintf(ftty, "%u:%s:mkdir %s:%d\n", mypid, myname, pathname, rv);
385 return rv; 413 return rv;
386} 414}
387 415
@@ -392,7 +420,7 @@ int mkdirat(int dirfd, const char *pathname, mode_t mode) {
392 orig_mkdirat = (orig_mkdirat_t)dlsym(RTLD_NEXT, "mkdirat"); 420 orig_mkdirat = (orig_mkdirat_t)dlsym(RTLD_NEXT, "mkdirat");
393 421
394 int rv = orig_mkdirat(dirfd, pathname, mode); 422 int rv = orig_mkdirat(dirfd, pathname, mode);
395 printf("%u:%s:mkdirat %s:%d\n", pid(), name(), pathname, rv); 423 tprintf(ftty, "%u:%s:mkdirat %s:%d\n", mypid, myname, pathname, rv);
396 return rv; 424 return rv;
397} 425}
398 426
@@ -403,56 +431,56 @@ int rmdir(const char *pathname) {
403 orig_rmdir = (orig_rmdir_t)dlsym(RTLD_NEXT, "rmdir"); 431 orig_rmdir = (orig_rmdir_t)dlsym(RTLD_NEXT, "rmdir");
404 432
405 int rv = orig_rmdir(pathname); 433 int rv = orig_rmdir(pathname);
406 printf("%u:%s:rmdir %s:%d\n", pid(), name(), pathname, rv); 434 tprintf(ftty, "%u:%s:rmdir %s:%d\n", mypid, myname, pathname, rv);
407 return rv; 435 return rv;
408} 436}
409 437
410// stat 438// stat
411typedef int (*orig_stat_t)(const char *pathname, struct stat *buf); 439typedef int (*orig_stat_t)(const char *pathname, struct stat *statbuf);
412static orig_stat_t orig_stat = NULL; 440static orig_stat_t orig_stat = NULL;
413int stat(const char *pathname, struct stat *buf) { 441int stat(const char *pathname, struct stat *statbuf) {
414 if (!orig_stat) 442 if (!orig_stat)
415 orig_stat = (orig_stat_t)dlsym(RTLD_NEXT, "stat"); 443 orig_stat = (orig_stat_t)dlsym(RTLD_NEXT, "stat");
416 444
417 int rv = orig_stat(pathname, buf); 445 int rv = orig_stat(pathname, statbuf);
418 printf("%u:%s:stat %s:%d\n", pid(), name(), pathname, rv); 446 tprintf(ftty, "%u:%s:stat %s:%d\n", mypid, myname, pathname, rv);
419 return rv; 447 return rv;
420} 448}
421 449
422#ifdef __GLIBC__ 450#ifdef __GLIBC__
423typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *buf); 451typedef int (*orig_stat64_t)(const char *pathname, struct stat64 *statbuf);
424static orig_stat64_t orig_stat64 = NULL; 452static orig_stat64_t orig_stat64 = NULL;
425int stat64(const char *pathname, struct stat64 *buf) { 453int stat64(const char *pathname, struct stat64 *statbuf) {
426 if (!orig_stat64) 454 if (!orig_stat64)
427 orig_stat64 = (orig_stat64_t)dlsym(RTLD_NEXT, "stat64"); 455 orig_stat64 = (orig_stat64_t)dlsym(RTLD_NEXT, "stat64");
428 456
429 int rv = orig_stat64(pathname, buf); 457 int rv = orig_stat64(pathname, statbuf);
430 printf("%u:%s:stat64 %s:%d\n", pid(), name(), pathname, rv); 458 tprintf(ftty, "%u:%s:stat64 %s:%d\n", mypid, myname, pathname, rv);
431 return rv; 459 return rv;
432} 460}
433#endif /* __GLIBC__ */ 461#endif /* __GLIBC__ */
434 462
435// lstat 463// lstat
436typedef int (*orig_lstat_t)(const char *pathname, struct stat *buf); 464typedef int (*orig_lstat_t)(const char *pathname, struct stat *statbuf);
437static orig_lstat_t orig_lstat = NULL; 465static orig_lstat_t orig_lstat = NULL;
438int lstat(const char *pathname, struct stat *buf) { 466int lstat(const char *pathname, struct stat *statbuf) {
439 if (!orig_lstat) 467 if (!orig_lstat)
440 orig_lstat = (orig_lstat_t)dlsym(RTLD_NEXT, "lstat"); 468 orig_lstat = (orig_lstat_t)dlsym(RTLD_NEXT, "lstat");
441 469
442 int rv = orig_lstat(pathname, buf); 470 int rv = orig_lstat(pathname, statbuf);
443 printf("%u:%s:lstat %s:%d\n", pid(), name(), pathname, rv); 471 tprintf(ftty, "%u:%s:lstat %s:%d\n", mypid, myname, pathname, rv);
444 return rv; 472 return rv;
445} 473}
446 474
447#ifdef __GLIBC__ 475#ifdef __GLIBC__
448typedef int (*orig_lstat64_t)(const char *pathname, struct stat64 *buf); 476typedef int (*orig_lstat64_t)(const char *pathname, struct stat64 *statbuf);
449static orig_lstat64_t orig_lstat64 = NULL; 477static orig_lstat64_t orig_lstat64 = NULL;
450int lstat64(const char *pathname, struct stat64 *buf) { 478int lstat64(const char *pathname, struct stat64 *statbuf) {
451 if (!orig_lstat64) 479 if (!orig_lstat64)
452 orig_lstat64 = (orig_lstat64_t)dlsym(RTLD_NEXT, "lstat64"); 480 orig_lstat64 = (orig_lstat64_t)dlsym(RTLD_NEXT, "lstat64");
453 481
454 int rv = orig_lstat64(pathname, buf); 482 int rv = orig_lstat64(pathname, statbuf);
455 printf("%u:%s:lstat64 %s:%d\n", pid(), name(), pathname, rv); 483 tprintf(ftty, "%u:%s:lstat64 %s:%d\n", mypid, myname, pathname, rv);
456 return rv; 484 return rv;
457} 485}
458#endif /* __GLIBC__ */ 486#endif /* __GLIBC__ */
@@ -465,19 +493,17 @@ DIR *opendir(const char *pathname) {
465 orig_opendir = (orig_opendir_t)dlsym(RTLD_NEXT, "opendir"); 493 orig_opendir = (orig_opendir_t)dlsym(RTLD_NEXT, "opendir");
466 494
467 DIR *rv = orig_opendir(pathname); 495 DIR *rv = orig_opendir(pathname);
468 printf("%u:%s:opendir %s:%p\n", pid(), name(), pathname, rv); 496 tprintf(ftty, "%u:%s:opendir %s:%p\n", mypid, myname, pathname, rv);
469 return rv; 497 return rv;
470} 498}
471 499
472// access 500// access
473typedef int (*orig_access_t)(const char *pathname, int mode);
474static orig_access_t orig_access = NULL;
475int access(const char *pathname, int mode) { 501int access(const char *pathname, int mode) {
476 if (!orig_access) 502 if (!orig_access)
477 orig_access = (orig_access_t)dlsym(RTLD_NEXT, "access"); 503 orig_access = (orig_access_t)dlsym(RTLD_NEXT, "access");
478 504
479 int rv = orig_access(pathname, mode); 505 int rv = orig_access(pathname, mode);
480 printf("%u:%s:access %s:%d\n", pid(), name(), pathname, rv); 506 tprintf(ftty, "%u:%s:access %s:%d\n", mypid, myname, pathname, rv);
481 return rv; 507 return rv;
482} 508}
483 509
@@ -498,14 +524,14 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
498// socket 524// socket
499typedef int (*orig_socket_t)(int domain, int type, int protocol); 525typedef int (*orig_socket_t)(int domain, int type, int protocol);
500static orig_socket_t orig_socket = NULL; 526static orig_socket_t orig_socket = NULL;
501static char buf[1024]; 527static char socketbuf[1024];
502int socket(int domain, int type, int protocol) { 528int socket(int domain, int type, int protocol) {
503 if (!orig_socket) 529 if (!orig_socket)
504 orig_socket = (orig_socket_t)dlsym(RTLD_NEXT, "socket"); 530 orig_socket = (orig_socket_t)dlsym(RTLD_NEXT, "socket");
505 531
506 int rv = orig_socket(domain, type, protocol); 532 int rv = orig_socket(domain, type, protocol);
507 char *ptr = buf; 533 char *ptr = socketbuf;
508 ptr += sprintf(ptr, "%u:%s:socket ", pid(), name()); 534 ptr += sprintf(ptr, "%u:%s:socket ", mypid, myname);
509 char *str = translate(socket_domain, domain); 535 char *str = translate(socket_domain, domain);
510 if (str == NULL) 536 if (str == NULL)
511 ptr += sprintf(ptr, "%d ", domain); 537 ptr += sprintf(ptr, "%d ", domain);
@@ -535,7 +561,7 @@ int socket(int domain, int type, int protocol) {
535 sprintf(ptr, "%s", str); 561 sprintf(ptr, "%s", str);
536 } 562 }
537 563
538 printf("%s:%d\n", buf, rv); 564 tprintf(ftty, "%s:%d\n", socketbuf, rv);
539 return rv; 565 return rv;
540} 566}
541 567
@@ -573,7 +599,7 @@ int system(const char *command) {
573 orig_system = (orig_system_t)dlsym(RTLD_NEXT, "system"); 599 orig_system = (orig_system_t)dlsym(RTLD_NEXT, "system");
574 600
575 int rv = orig_system(command); 601 int rv = orig_system(command);
576 printf("%u:%s:system %s:%d\n", pid(), name(), command, rv); 602 tprintf(ftty, "%u:%s:system %s:%d\n", mypid, myname, command, rv);
577 603
578 return rv; 604 return rv;
579} 605}
@@ -585,7 +611,7 @@ int setuid(uid_t uid) {
585 orig_setuid = (orig_setuid_t)dlsym(RTLD_NEXT, "setuid"); 611 orig_setuid = (orig_setuid_t)dlsym(RTLD_NEXT, "setuid");
586 612
587 int rv = orig_setuid(uid); 613 int rv = orig_setuid(uid);
588 printf("%u:%s:setuid %d:%d\n", pid(), name(), uid, rv); 614 tprintf(ftty, "%u:%s:setuid %d:%d\n", mypid, myname, uid, rv);
589 615
590 return rv; 616 return rv;
591} 617}
@@ -597,7 +623,7 @@ int setgid(gid_t gid) {
597 orig_setgid = (orig_setgid_t)dlsym(RTLD_NEXT, "setgid"); 623 orig_setgid = (orig_setgid_t)dlsym(RTLD_NEXT, "setgid");
598 624
599 int rv = orig_setgid(gid); 625 int rv = orig_setgid(gid);
600 printf("%u:%s:setgid %d:%d\n", pid(), name(), gid, rv); 626 tprintf(ftty, "%u:%s:setgid %d:%d\n", mypid, myname, gid, rv);
601 627
602 return rv; 628 return rv;
603} 629}
@@ -609,7 +635,7 @@ int setfsuid(uid_t uid) {
609 orig_setfsuid = (orig_setfsuid_t)dlsym(RTLD_NEXT, "setfsuid"); 635 orig_setfsuid = (orig_setfsuid_t)dlsym(RTLD_NEXT, "setfsuid");
610 636
611 int rv = orig_setfsuid(uid); 637 int rv = orig_setfsuid(uid);
612 printf("%u:%s:setfsuid %d:%d\n", pid(), name(), uid, rv); 638 tprintf(ftty, "%u:%s:setfsuid %d:%d\n", mypid, myname, uid, rv);
613 639
614 return rv; 640 return rv;
615} 641}
@@ -621,7 +647,7 @@ int setfsgid(gid_t gid) {
621 orig_setfsgid = (orig_setfsgid_t)dlsym(RTLD_NEXT, "setfsgid"); 647 orig_setfsgid = (orig_setfsgid_t)dlsym(RTLD_NEXT, "setfsgid");
622 648
623 int rv = orig_setfsgid(gid); 649 int rv = orig_setfsgid(gid);
624 printf("%u:%s:setfsgid %d:%d\n", pid(), name(), gid, rv); 650 tprintf(ftty, "%u:%s:setfsgid %d:%d\n", mypid, myname, gid, rv);
625 651
626 return rv; 652 return rv;
627} 653}
@@ -633,7 +659,7 @@ int setreuid(uid_t ruid, uid_t euid) {
633 orig_setreuid = (orig_setreuid_t)dlsym(RTLD_NEXT, "setreuid"); 659 orig_setreuid = (orig_setreuid_t)dlsym(RTLD_NEXT, "setreuid");
634 660
635 int rv = orig_setreuid(ruid, euid); 661 int rv = orig_setreuid(ruid, euid);
636 printf("%u:%s:setreuid %d %d:%d\n", pid(), name(), ruid, euid, rv); 662 tprintf(ftty, "%u:%s:setreuid %d %d:%d\n", mypid, myname, ruid, euid, rv);
637 663
638 return rv; 664 return rv;
639} 665}
@@ -645,7 +671,7 @@ int setregid(gid_t rgid, gid_t egid) {
645 orig_setregid = (orig_setregid_t)dlsym(RTLD_NEXT, "setregid"); 671 orig_setregid = (orig_setregid_t)dlsym(RTLD_NEXT, "setregid");
646 672
647 int rv = orig_setregid(rgid, egid); 673 int rv = orig_setregid(rgid, egid);
648 printf("%u:%s:setregid %d %d:%d\n", pid(), name(), rgid, egid, rv); 674 tprintf(ftty, "%u:%s:setregid %d %d:%d\n", mypid, myname, rgid, egid, rv);
649 675
650 return rv; 676 return rv;
651} 677}
@@ -657,7 +683,7 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
657 orig_setresuid = (orig_setresuid_t)dlsym(RTLD_NEXT, "setresuid"); 683 orig_setresuid = (orig_setresuid_t)dlsym(RTLD_NEXT, "setresuid");
658 684
659 int rv = orig_setresuid(ruid, euid, suid); 685 int rv = orig_setresuid(ruid, euid, suid);
660 printf("%u:%s:setresuid %d %d %d:%d\n", pid(), name(), ruid, euid, suid, rv); 686 tprintf(ftty, "%u:%s:setresuid %d %d %d:%d\n", mypid, myname, ruid, euid, suid, rv);
661 687
662 return rv; 688 return rv;
663} 689}
@@ -669,7 +695,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
669 orig_setresgid = (orig_setresgid_t)dlsym(RTLD_NEXT, "setresgid"); 695 orig_setresgid = (orig_setresgid_t)dlsym(RTLD_NEXT, "setresgid");
670 696
671 int rv = orig_setresgid(rgid, egid, sgid); 697 int rv = orig_setresgid(rgid, egid, sgid);
672 printf("%u:%s:setresgid %d %d %d:%d\n", pid(), name(), rgid, egid, sgid, rv); 698 tprintf(ftty, "%u:%s:setresgid %d %d %d:%d\n", mypid, myname, rgid, egid, sgid, rv);
673 699
674 return rv; 700 return rv;
675} 701}
@@ -678,10 +704,12 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
678// it can be used to build things like private-bin 704// it can be used to build things like private-bin
679__attribute__((constructor)) 705__attribute__((constructor))
680static void log_exec(int argc, char** argv) { 706static void log_exec(int argc, char** argv) {
707 (void) argc;
708 (void) argv;
681 static char buf[PATH_MAX + 1]; 709 static char buf[PATH_MAX + 1];
682 int rv = readlink("/proc/self/exe", buf, PATH_MAX); 710 int rv = readlink("/proc/self/exe", buf, PATH_MAX);
683 if (rv != -1) { 711 if (rv != -1) {
684 buf[rv] = '\0'; // readlink does not add a '\0' at the end 712 buf[rv] = '\0'; // readlink does not add a '\0' at the end
685 printf("%u:%s:exec %s:0\n", pid(), name(), buf); 713 tprintf(ftty, "%u:%s:exec %s:0\n", mypid, myname, buf);
686 } 714 }
687} 715}
diff --git a/src/libtracelog/Makefile.in b/src/libtracelog/Makefile.in
index 3927c762a..aea1b11f2 100644
--- a/src/libtracelog/Makefile.in
+++ b/src/libtracelog/Makefile.in
@@ -4,23 +4,25 @@ VERSION=@PACKAGE_VERSION@
4NAME=@PACKAGE_NAME@ 4NAME=@PACKAGE_NAME@
5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@ 5HAVE_FATAL_WARNINGS=@HAVE_FATAL_WARNINGS@
6 6
7H_FILE_LIST = $(sort $(wildcard *.[h])) 7H_FILE_LIST = $(sort $(wildcard *.h))
8C_FILE_LIST = $(sort $(wildcard *.c)) 8C_FILE_LIST = $(sort $(wildcard *.c))
9OBJS = $(C_FILE_LIST:.c=.o) 9OBJS = $(C_FILE_LIST:.c=.o)
10BINOBJS = $(foreach file, $(OBJS), $file) 10BINOBJS = $(foreach file, $(OBJS), $file)
11CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security 11CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
12LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now 12LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
13 13
14.PHONY: all
14all: libtracelog.so 15all: libtracelog.so
15 16
16%.o : %.c $(H_FILE_LIST) 17%.o : %.c $(H_FILE_LIST) ../include/rundefs.h
17 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 18 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
18 19
19libtracelog.so: $(OBJS) 20libtracelog.so: $(OBJS)
20 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl 21 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
21 22
23.PHONY: clean
24clean:; rm -fr $(OBJS) libtracelog.so *.plist
22 25
23clean:; rm -f $(OBJS) libtracelog.so 26.PHONY: distclean
24
25distclean: clean 27distclean: clean
26 rm -fr Makefile 28 rm -fr Makefile
diff --git a/src/libtracelog/libtracelog.c b/src/libtracelog/libtracelog.c
index dc68b0620..b946cc889 100644
--- a/src/libtracelog/libtracelog.c
+++ b/src/libtracelog/libtracelog.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -32,6 +32,7 @@
32#include <syslog.h> 32#include <syslog.h>
33#include <dirent.h> 33#include <dirent.h>
34#include <limits.h> 34#include <limits.h>
35#include "../include/rundefs.h"
35 36
36//#define DEBUG 37//#define DEBUG
37 38
@@ -64,9 +65,6 @@ static inline uint32_t hash(const char *str) {
64} 65}
65 66
66static void storage_add(const char *str) { 67static void storage_add(const char *str) {
67#ifdef DEBUG
68 printf("add %s\n", str);
69#endif
70 if (!str) { 68 if (!str) {
71#ifdef DEBUG 69#ifdef DEBUG
72 printf("null pointer passed to storage_add\n"); 70 printf("null pointer passed to storage_add\n");
@@ -74,6 +72,10 @@ static void storage_add(const char *str) {
74 return; 72 return;
75 } 73 }
76 74
75#ifdef DEBUG
76 printf("add %s\n", str);
77#endif
78
77 ListElem *ptr = malloc(sizeof(ListElem)); 79 ListElem *ptr = malloc(sizeof(ListElem));
78 if (!ptr) { 80 if (!ptr) {
79 fprintf(stderr, "Error: cannot allocate memory\n"); 81 fprintf(stderr, "Error: cannot allocate memory\n");
@@ -96,15 +98,17 @@ static void storage_add(const char *str) {
96static char* cwd = NULL; 98static char* cwd = NULL;
97 99
98static char *storage_find(const char *str) { 100static char *storage_find(const char *str) {
99#ifdef DEBUG
100 printf("storage find %s\n", str);
101#endif
102 if (!str) { 101 if (!str) {
103#ifdef DEBUG 102#ifdef DEBUG
104 printf("null pointer passed to storage_find\n"); 103 printf("null pointer passed to storage_find\n");
105#endif 104#endif
106 return NULL; 105 return NULL;
107 } 106 }
107
108#ifdef DEBUG
109 printf("storage find %s\n", str);
110#endif
111
108 const char *tofind = str; 112 const char *tofind = str;
109 int allocated = 0; 113 int allocated = 0;
110 114
@@ -160,7 +164,6 @@ static char *storage_find(const char *str) {
160// 164//
161// load blacklist form /run/firejail/mnt/fslogger 165// load blacklist form /run/firejail/mnt/fslogger
162// 166//
163#define RUN_FSLOGGER_FILE "/run/firejail/mnt/fslogger"
164#define MAXBUF 4096 167#define MAXBUF 4096
165static int blacklist_loaded = 0; 168static int blacklist_loaded = 0;
166static char *sandbox_pid_str = NULL; 169static char *sandbox_pid_str = NULL;
@@ -178,7 +181,9 @@ static void load_blacklist(void) {
178 181
179 // extract blacklists 182 // extract blacklists
180 char buf[MAXBUF]; 183 char buf[MAXBUF];
184#ifdef DEBUG
181 int cnt = 0; 185 int cnt = 0;
186#endif
182 while (fgets(buf, MAXBUF, fp)) { 187 while (fgets(buf, MAXBUF, fp)) {
183 if (strncmp(buf, "sandbox pid: ", 13) == 0) { 188 if (strncmp(buf, "sandbox pid: ", 13) == 0) {
184 char *ptr = strchr(buf, '\n'); 189 char *ptr = strchr(buf, '\n');
@@ -199,7 +204,9 @@ static void load_blacklist(void) {
199 if (ptr) 204 if (ptr)
200 *ptr = '\0'; 205 *ptr = '\0';
201 storage_add(buf + 10); 206 storage_add(buf + 10);
207#ifdef DEBUG
202 cnt++; 208 cnt++;
209#endif
203 } 210 }
204 } 211 }
205 fclose(fp); 212 fclose(fp);
diff --git a/src/man/Makefile.in b/src/man/Makefile.in
new file mode 100644
index 000000000..fbd2d795e
--- /dev/null
+++ b/src/man/Makefile.in
@@ -0,0 +1,14 @@
1.PHONY: all
2all: firecfg.man firejail.man firejail-login.man firejail-users.man firejail-profile.man firemon.man jailcheck.man
3
4include ../common.mk
5
6%.man: %.txt
7 gawk -f ./preproc.awk -- $(MANFLAGS) < $< > $@
8
9.PHONY: clean
10clean:; rm -fr *.man
11
12.PHONY: distclean
13distclean: clean
14 rm -fr Makefile
diff --git a/src/man/firecfg.txt b/src/man/firecfg.txt
index f99704579..7e0a57f92 100644
--- a/src/man/firecfg.txt
+++ b/src/man/firecfg.txt
@@ -30,9 +30,41 @@ installing new programs. If the program is supported by Firejail, the symbolic l
30will be created. For a full list of programs supported by default run "cat /usr/lib/firejail/firecfg.config". 30will be created. For a full list of programs supported by default run "cat /usr/lib/firejail/firecfg.config".
31 31
32For user-driven manual integration, see \fBDESKTOP INTEGRATION\fR section in \fBman 1 firejail\fR. 32For user-driven manual integration, see \fBDESKTOP INTEGRATION\fR section in \fBman 1 firejail\fR.
33.SH DEFAULT ACTIONS
34The following actions are implemented by default by running sudo firecfg:
35
36.RS
37- set or update the symbolic links for desktop integration;
38.br
39
40.br
41- add the current user to Firejail user access database (firecfg --add-users);
42.br
43
44.br
45- fix desktop files in $HOME/.local/share/applications/ (firecfg --fix).
46.br
47#ifdef HAVE_APPARMOR
48.br
49- automatically loads and forces the AppArmor profile "firejail-default".
50#endif
51.RE
33 52
34.SH OPTIONS 53.SH OPTIONS
35.TP 54.TP
55\fB\-\-add-users user [user]
56Add the list of users to Firejail user access database.
57
58Example:
59.br
60$ sudo firecfg --add-users dustin lucas mike eleven
61
62.TP
63\fB\-\-bindir=directory
64Create and search symbolic links in directory instead of the default location /usr/local/bin.
65Directory should precede /usr/bin and /bin in the PATH environment variable.
66
67.TP
36\fB\-\-clean 68\fB\-\-clean
37Remove all firejail symbolic links. 69Remove all firejail symbolic links.
38 70
@@ -96,9 +128,11 @@ $ sudo firecfg --clean
96.SH LICENSE 128.SH LICENSE
97This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 129This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
98.PP 130.PP
99Homepage: http://firejail.wordpress.com 131Homepage: https://firejail.wordpress.com
100.SH SEE ALSO 132.SH SEE ALSO
101\&\flfirejail\fR\|(1), 133.BR firejail (1),
102\&\flfiremon\fR\|(1), 134.BR firemon (1),
103\&\flfirejail-profile\fR\|(5), 135.BR firejail-profile (5),
104\&\flfirejail-login\fR\|(5) 136.BR firejail-login (5),
137.BR firejail-users (5),
138.BR jailcheck (1)
diff --git a/src/man/firejail-login.txt b/src/man/firejail-login.txt
index cb192b450..05afd55b5 100644
--- a/src/man/firejail-login.txt
+++ b/src/man/firejail-login.txt
@@ -1,9 +1,9 @@
1.TH FIREJAIL-LOGIN 5 "MONTH YEAR" "VERSION" "firejail login.users man page" 1.TH FIREJAIL-LOGIN 5 "MONTH YEAR" "VERSION" "login.users man page"
2.SH NAME 2.SH NAME
3login.users \- Login file syntax for Firejail 3login.users \- Login file syntax for Firejail
4 4
5.SH DESCRIPTION 5.SH DESCRIPTION
6/etc/firejail/login.users file describes additional arguments passed to firejail executable 6/etc/firejail/login.users file describes additional arguments passed to the firejail executable
7upon user logging into a Firejail restricted shell. Each user entry in the file consists of 7upon user logging into a Firejail restricted shell. Each user entry in the file consists of
8a user name followed by the arguments passed to firejail. The format is as follows: 8a user name followed by the arguments passed to firejail. The format is as follows:
9 9
@@ -11,7 +11,7 @@ a user name followed by the arguments passed to firejail. The format is as follo
11 11
12Example: 12Example:
13 13
14 netblue:--net=none --protocol=unix 14 netblue: --net=none --protocol=unix
15 15
16Wildcard patterns are accepted in the user name field: 16Wildcard patterns are accepted in the user name field:
17 17
@@ -19,8 +19,8 @@ Wildcard patterns are accepted in the user name field:
19 19
20.SH RESTRICTED SHELL 20.SH RESTRICTED SHELL
21To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in 21To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in
22/etc/passwd file for each user that needs to be restricted. Alternatively, 22the /etc/passwd file for each user that needs to be restricted. Alternatively,
23you can specify /usr/bin/firejail using adduser or usermod commands: 23you can specify /usr/bin/firejail using the `adduser` or `usermod` commands:
24 24
25adduser \-\-shell /usr/bin/firejail username 25adduser \-\-shell /usr/bin/firejail username
26.br 26.br
@@ -32,9 +32,11 @@ usermod \-\-shell /usr/bin/firejail username
32.SH LICENSE 32.SH LICENSE
33Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 33Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
34.PP 34.PP
35Homepage: http://firejail.wordpress.com 35Homepage: https://firejail.wordpress.com
36.SH SEE ALSO 36.SH SEE ALSO
37\&\flfirejail\fR\|(1), 37.BR firejail (1),
38\&\flfiremon\fR\|(1), 38.BR firemon (1),
39\&\flfirecfg\fR\|(1), 39.BR firecfg (1),
40\&\flfirejail-profile\fR\|(5) 40.BR firejail-profile (5),
41.BR firejail-users (5),
42.BR jailcheck (1)
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt
index 14485d5c1..a768829a1 100644
--- a/src/man/firejail-profile.txt
+++ b/src/man/firejail-profile.txt
@@ -1,16 +1,84 @@
1.TH FIREJAIL-PROFILE 5 "MONTH YEAR" "VERSION" "firejail profiles man page" 1.TH FIREJAIL-PROFILE 5 "MONTH YEAR" "VERSION" "firejail profiles man page"
2.SH NAME 2.SH NAME
3profile \- Security profile file syntax for Firejail 3profile \- Security profile file syntax, and information about building new application profiles.
4 4
5.SH USAGE 5.SH SYNOPSIS
6
7Using a specific profile:
8.PP
9.RS
10.TP
11\fBfirejail \-\-profile=filename.profile
12.br
13
14.br
15Example:
16.br
17$ firejail --profile=/etc/firejail/kdenlive.profile --appimage kdenlive.appimage
18.br
19
20.br
6.TP 21.TP
7firejail \-\-profile=filename.profile 22\fBfirejail \-\-profile=profile_name
23.br
24
25.br
26Example:
27.br
28$ firejail --profile=kdenlive --appimage kdenlive.appimage
29.br
30
31.br
32.RE
33.PP
34
35
36
37Building a profile manually:
38.PP
39.RS
40Start with the template in /usr/share/doc/firejail/profile.template and modify it in a text editor.
41To integrate the program in your desktop environment copy the profile file in ~/.config/firejail
42directory and run "sudo firecfg".
43.RE
44.PP
45
46Aliases and redirections:
47.PP
48.RS
49In some cases the same profile can be used for several applications.
50One such example is LibreOffice.
51Build a regular profile for the main application, and for the rest use
52/usr/share/doc/firejail/redirect_alias-profile.template.
53.RE
54.PP
55
56Running the profile builder:
57.PP
58.RS
59.TP
60\fBfirejail \-\-build=appname.profile appname
61.br
62
63.br
64Example:
65.br
66$ firejail --build=blobby.profile blobby
67.br
68
69.br
70Run the program in "firejail \-\-build" and try to exercise as many program features as possible.
71The profile is extracted and saved in the current directory. Open it in a text editor and add or remove
72sandboxing options as necessary. Test again after modifying the profile. To integrate the program
73in your desktop environment copy the profile file in ~/.config/firejail directory and run "sudo firecfg".
74.RE
75.PP
8 76
9.SH DESCRIPTION 77.SH DESCRIPTION
10Several command line options can be passed to the program using 78Several command line options can be passed to the program using
11profile files. Firejail chooses the profile file as follows: 79profile files. Firejail chooses the profile file as follows:
12 80
13\fB1.\fR If a profile file is provided by the user with \-\-profile option, the profile file is loaded. 81\fB1.\fR If a profile file is provided by the user with \-\-profile option, the profile file is loaded. If a profile name is given, it is searched for first in the ~/.config/firejail directory and if not found then in /etc/firejail directory. Profile names do not include the .profile suffix.
14Example: 82Example:
15.PP 83.PP
16.RS 84.RS
@@ -21,6 +89,15 @@ Reading profile /home/netblue/icecat.profile
21[...] 89[...]
22.RE 90.RE
23 91
92.PP
93.RS
94$ firejail --profile=icecat icecat-wrapper.sh
95.br
96Reading profile /etc/firejail/icecat.profile
97.br
98[...]
99.RE
100
24\fB2.\fR If a profile file with the same name as the application is present in ~/.config/firejail directory or 101\fB2.\fR If a profile file with the same name as the application is present in ~/.config/firejail directory or
25in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example: 102in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example:
26.PP 103.PP
@@ -63,6 +140,15 @@ Child process initialized
63[...] 140[...]
64.RE 141.RE
65 142
143.SH Templates
144In /usr/share/doc/firejail there are two templates to write new profiles.
145.RS
146profile.template - for regular profiles
147.br
148redirect_alias-profile.template - for aliasing/redirecting profiles
149.RE
150
151
66.SH Scripting 152.SH Scripting
67Scripting commands: 153Scripting commands:
68 154
@@ -74,6 +160,24 @@ Example: "blacklist ~/My Virtual Machines"
74 160
75.TP 161.TP
76\fB# this is a comment 162\fB# this is a comment
163Example:
164
165# disable networking
166.br
167net none # this command creates an empty network namespace
168
169.TP
170\fB?CONDITIONAL: profile line
171Conditionally add profile line.
172
173Example: "?HAS_APPIMAGE: whitelist ${HOME}/special/appimage/dir"
174
175This example will load the whitelist profile line only if the \-\-appimage option has been specified on the command line.
176
177Currently the only conditionals supported this way are HAS_APPIMAGE, HAS_NET, HAS_NODBUS, HAS_NOSOUND, HAS_PRIVATE and HAS_X11. The conditionals BROWSER_DISABLE_U2F and BROWSER_ALLOW_DRM
178can be enabled or disabled globally in Firejail's configuration file.
179
180The profile line may be any profile line that you would normally use in a profile \fBexcept\fR for "quiet" and "include" lines.
77 181
78.TP 182.TP
79\fBinclude other.profile 183\fBinclude other.profile
@@ -90,6 +194,10 @@ Example: "include ${HOME}/myprofiles/profile1" will load "~/myprofiles/profile1"
90 194
91Example: "include ${CFG}/firefox.profile" will load "/etc/firejail/firefox.profile" file. 195Example: "include ${CFG}/firefox.profile" will load "/etc/firejail/firefox.profile" file.
92 196
197The file name may also be just the name without the leading directory components. In this case, first the user config directory (${HOME}/.config/firejail) is searched for the file name and if not found then the system configuration directory is search for the file name. Note: Unlike the \-\-profile option which takes a profile name without the '.profile' suffix, include must be given the full file name.
198
199Example: "include firefox.profile" will load "${HOME}/.config/firejail/firefox.profile" file and if it does not exist "${CFG}/firefox.profile" will be loaded.
200
93System configuration files in ${CFG} are overwritten during software installation. 201System configuration files in ${CFG} are overwritten during software installation.
94Persistent configuration at system level is handled in ".local" files. For every 202Persistent configuration at system level is handled in ".local" files. For every
95profile file in ${CFG} directory, the user can create a corresponding .local file 203profile file in ${CFG} directory, the user can create a corresponding .local file
@@ -113,7 +221,10 @@ Example: "nowhitelist ~/.config"
113Ignore command. 221Ignore command.
114 222
115Example: "ignore seccomp" 223Example: "ignore seccomp"
116 224#ifdef HAVE_NETWORK
225.br
226Example: "ignore net eth0"
227#endif
117.TP 228.TP
118\fBquiet 229\fBquiet
119Disable Firejail's output. This should be the first uncommented command in the profile file. 230Disable Firejail's output. This should be the first uncommented command in the profile file.
@@ -122,12 +233,13 @@ Example: "quiet"
122 233
123.SH Filesystem 234.SH Filesystem
124These profile entries define a chroot filesystem built on top of the existing 235These profile entries define a chroot filesystem built on top of the existing
125host filesystem. Each line describes a file element that is removed from 236host filesystem. Each line describes a file/directory that is inaccessible
126the filesystem (\fBblacklist\fR), a read-only file or directory (\fBread-only\fR), 237(\fBblacklist\fR), a read-only file or directory (\fBread-only\fR),
127a tmpfs mounted on top of an existing directory (\fBtmpfs\fR), 238a tmpfs mounted on top of an existing directory (\fBtmpfs\fR),
128or mount-bind a directory or file on top of another directory or file (\fBbind\fR). 239or mount-bind a directory or file on top of another directory or file (\fBbind\fR).
129Use \fBprivate\fR to set private mode. 240Use \fBprivate\fR to set private mode. File globbing is supported, and PATH and
130File globbing is supported, and PATH and HOME directories are searched. 241HOME directories are searched, see the \fBfirejail\f(1) \fBFILE GLOBBING\fR section
242for more details.
131Examples: 243Examples:
132.TP 244.TP
133\fBblacklist file_or_directory 245\fBblacklist file_or_directory
@@ -164,8 +276,18 @@ Mount-bind file1 on top of file2. This option is only available when running as
164\fBdisable-mnt 276\fBdisable-mnt
165Disable /mnt, /media, /run/mount and /run/media access. 277Disable /mnt, /media, /run/mount and /run/media access.
166.TP 278.TP
279\fBkeep-config-pulse
280Disable automatic ~/.config/pulse init, for complex setups such as remote
281pulse servers or non-standard socket paths.
282.TP
283\fBkeep-dev-shm
284/dev/shm directory is untouched (even with private-dev).
285.TP
286\fBkeep-var-tmp
287/var/tmp directory is untouched.
288.TP
167\fBmkdir directory 289\fBmkdir directory
168Create a directory in user home or under /tmp before the sandbox is started. 290Create a directory in user home, under /tmp, or under /run/user/<UID> before the sandbox is started.
169The directory is created if it doesn't already exist. 291The directory is created if it doesn't already exist.
170.br 292.br
171 293
@@ -184,13 +306,22 @@ whitelist ~/.mozilla
184mkdir ~/.cache/mozilla/firefox 306mkdir ~/.cache/mozilla/firefox
185.br 307.br
186whitelist ~/.cache/mozilla/firefox 308whitelist ~/.cache/mozilla/firefox
309.br
310
311.br
312For files in /run/user/<PID> use ${RUNUSER} macro:
313.br
314
315.br
316mkdir ${RUNUSER}/firejail-testing
187.TP 317.TP
188\fBmkfile file 318\fBmkfile file
189Similar to mkdir, this command creates a file in user home or under /tmp before the sandbox is started. 319Similar to mkdir, this command creates an empty file in user home, or /tmp, or under /run/user/<UID>
190The file is created if it doesn't already exist. 320before the sandbox is started. The file is created if it doesn't already exist.
191.TP 321.TP
192\fBnoexec file_or_directory 322\fBnoexec file_or_directory
193Remount the file or the directory noexec, nodev and nosuid. 323Remount the file or the directory noexec, nodev and nosuid.
324#ifdef HAVE_OVERLAYFS
194.TP 325.TP
195\fBoverlay 326\fBoverlay
196Mount a filesystem overlay on top of the current filesystem. 327Mount a filesystem overlay on top of the current filesystem.
@@ -203,6 +334,7 @@ The overlay is stored in $HOME/.firejail/name directory.
203\fBoverlay-tmpfs 334\fBoverlay-tmpfs
204Mount a filesystem overlay on top of the current filesystem. 335Mount a filesystem overlay on top of the current filesystem.
205All filesystem modifications are discarded when the sandbox is closed. 336All filesystem modifications are discarded when the sandbox is closed.
337#endif
206.TP 338.TP
207\fBprivate 339\fBprivate
208Mount new /root and /home/user directories in temporary 340Mount new /root and /home/user directories in temporary
@@ -212,36 +344,70 @@ closed.
212\fBprivate directory 344\fBprivate directory
213Use directory as user home. 345Use directory as user home.
214.TP 346.TP
215\fBprivate-home file,directory
216Build a new user home in a temporary
217filesystem, and copy the files and directories in the list in the
218new home. All modifications are discarded when the sandbox is
219closed.
220.TP
221\fBprivate-bin file,file 347\fBprivate-bin file,file
222Build a new /bin in a temporary filesystem, and copy the programs in the list. 348Build a new /bin in a temporary filesystem, and copy the programs in the list.
349The files in the list must be expressed as relative to the /bin,
350/sbin, /usr/bin, /usr/sbin, or /usr/local/bin directories.
223The same directory is also bind-mounted over /sbin, /usr/bin and /usr/sbin. 351The same directory is also bind-mounted over /sbin, /usr/bin and /usr/sbin.
224.TP 352.TP
353\fBprivate-cache
354Mount an empty temporary filesystem on top of the .cache directory in user home. All
355modifications are discarded when the sandbox is closed.
356.TP
357\fBprivate-cwd
358Set working directory inside jail to the home directory, and failing that, the root directory.
359.TP
360\fBprivate-cwd directory
361Set working directory inside the jail.
362.TP
225\fBprivate-dev 363\fBprivate-dev
226Create a new /dev directory. Only dri, null, full, zero, tty, pts, ptmx, random, urandom, log and shm devices are available. 364Create a new /dev directory. Only disc, dri, dvb, hidraw, null, full, zero, tty, pts, ptmx,
365random, snd, urandom, video, log, shm and usb devices are available.
366Use the options no3d, nodvd, nosound, notv, nou2f and novideo for additional restrictions.
367
227.TP 368.TP
228\fBprivate-etc file,directory 369\fBprivate-etc file,directory
229Build a new /etc in a temporary 370Build a new /etc in a temporary
230filesystem, and copy the files and directories in the list. 371filesystem, and copy the files and directories in the list.
372The files and directories in the list must be expressed as relative to
373the /etc directory, and must not contain the / character
374(e.g., /etc/foo must be expressed as foo, but /etc/foo/bar --
375expressed as foo/bar -- is disallowed).
231All modifications are discarded when the sandbox is closed. 376All modifications are discarded when the sandbox is closed.
377#ifdef HAVE_PRIVATE_HOME
378.TP
379\fBprivate-home file,directory
380Build a new user home in a temporary
381filesystem, and copy the files and directories in the list in the
382new home.
383The files and directories in the list must be expressed as relative to
384the current user's home directory.
385All modifications are discarded when the sandbox is
386closed.
387#endif
232.TP 388.TP
233\fBprivate-lib file,directory 389\fBprivate-lib file,directory
234Build a new /lib directory and bring in the libraries required by the application to run. 390Build a new /lib directory and bring in the libraries required by the application to run.
235This feature is still under development, see man 1 firejail for some examples. 391The files and directories in the list must be expressed as relative to
392the /lib directory.
393This feature is still under development, see \fBman 1 firejail\fR for some examples.
236.TP 394.TP
237\fBprivate-opt file,directory 395\fBprivate-opt file,directory
238Build a new /optin a temporary 396Build a new /opt in a temporary
239filesystem, and copy the files and directories in the list. 397filesystem, and copy the files and directories in the list.
398The files and directories in the list must be expressed as relative to
399the /opt directory, and must not contain the / character
400(e.g., /opt/foo must be expressed as foo, but /opt/foo/bar --
401expressed as foo/bar -- is disallowed).
240All modifications are discarded when the sandbox is closed. 402All modifications are discarded when the sandbox is closed.
241.TP 403.TP
242\fBprivate-srv file,directory 404\fBprivate-srv file,directory
243Build a new /srv in a temporary 405Build a new /srv in a temporary
244filesystem, and copy the files and directories in the list. 406filesystem, and copy the files and directories in the list.
407The files and directories in the list must be expressed as relative to
408the /srv directory, and must not contain the / character
409(e.g., /srv/foo must be expressed as foo, but /srv/foo/bar --
410expressed as foo/bar -- is disallowed).
245All modifications are discarded when the sandbox is closed. 411All modifications are discarded when the sandbox is closed.
246.TP 412.TP
247\fBprivate-tmp 413\fBprivate-tmp
@@ -254,7 +420,7 @@ Make directory or file read-only.
254Make directory or file read-write. 420Make directory or file read-write.
255.TP 421.TP
256\fBtmpfs directory 422\fBtmpfs directory
257Mount an empty tmpfs filesystem on top of directory. This option is available only when running the sandbox as root. 423Mount an empty tmpfs filesystem on top of directory. Directories outside user home or not owned by the user are not allowed. Sandboxes running as root are exempt from these restrictions.
258.TP 424.TP
259\fBtracelog 425\fBtracelog
260Blacklist violations logged to syslog. 426Blacklist violations logged to syslog.
@@ -262,8 +428,9 @@ Blacklist violations logged to syslog.
262\fBwhitelist file_or_directory 428\fBwhitelist file_or_directory
263Whitelist directory or file. A temporary file system is mounted on the top directory, and the 429Whitelist directory or file. A temporary file system is mounted on the top directory, and the
264whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent, 430whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent,
265everything else is discarded when the sandbox is closed. The top directory could be 431everything else is discarded when the sandbox is closed. The top directory can be
266user home, /dev, /media, /mnt, /opt, /srv, /var, and /tmp. 432all directories in / (except /proc and /sys), /sys/module, /run/user/$UID, $HOME and
433all directories in /usr.
267.br 434.br
268 435
269.br 436.br
@@ -287,56 +454,81 @@ directory, and a skeleton filesystem is created based on the original /var/log.
287The following security filters are currently implemented: 454The following security filters are currently implemented:
288 455
289.TP 456.TP
457\fBallow-debuggers
458Allow tools such as strace and gdb inside the sandbox by whitelisting system calls ptrace and process_vm_readv.
459#ifdef HAVE_APPARMOR
460.TP
290\fBapparmor 461\fBapparmor
291Enable AppArmor confinement. 462Enable AppArmor confinement.
463#endif
292.TP 464.TP
293\fBcaps 465\fBcaps
294Enable default Linux capabilities filter. 466Enable default Linux capabilities filter.
295.TP 467.TP
296\fBcaps.drop all
297Blacklist all Linux capabilities.
298.TP
299\fBcaps.drop capability,capability,capability 468\fBcaps.drop capability,capability,capability
300Blacklist given Linux capabilities. 469Blacklist given Linux capabilities.
301.TP 470.TP
471\fBcaps.drop all
472Blacklist all Linux capabilities.
473.TP
302\fBcaps.keep capability,capability,capability 474\fBcaps.keep capability,capability,capability
303Whitelist given Linux capabilities. 475Whitelist given Linux capabilities.
304.TP 476.TP
477\fBmemory-deny-write-execute
478Install a seccomp filter to block attempts to create memory mappings
479that are both writable and executable, to change mappings to be
480executable or to create executable shared memory.
481.TP
482\fBnonewprivs
483Sets the NO_NEW_PRIVS prctl. This ensures that child processes
484cannot acquire new privileges using execve(2); in particular,
485this means that calling a suid binary (or one with file capabilities)
486does not result in an increase of privilege.
487#ifdef HAVE_USERNS
488.TP
489\fBnoroot
490Use this command to enable an user namespace. The namespace has only one user, the current user.
491There is no root account (uid 0) defined in the namespace.
492#endif
493.TP
305\fBprotocol protocol1,protocol2,protocol3 494\fBprotocol protocol1,protocol2,protocol3
306Enable protocol filter. The filter is based on seccomp and checks the 495Enable protocol filter. The filter is based on seccomp and checks the
307first argument to socket system call. Recognized values: \fBunix\fR, 496first argument to socket system call. Recognized values: \fBunix\fR,
308\fBinet\fR, \fBinet6\fR, \fBnetlink\fR and \fBpacket\fR. 497\fBinet\fR, \fBinet6\fR, \fBnetlink\fR, \fBpacket\fR and \fBbluetooth\fR.
309.TP 498.TP
310\fBseccomp 499\fBseccomp
311Enable seccomp filter and blacklist the syscalls in the default list. See man 1 firejail for more details. 500Enable seccomp filter and blacklist the syscalls in the default list. See man 1 firejail for more details.
312.TP 501.TP
502\fBseccomp.32
503Enable seccomp filter and blacklist the syscalls in the default list for 32 bit system calls on a 64 bit architecture system.
504.TP
313\fBseccomp syscall,syscall,syscall 505\fBseccomp syscall,syscall,syscall
314Enable seccomp filter and blacklist the system calls in the list on top of default seccomp filter. 506Enable seccomp filter and blacklist the system calls in the list on top of default seccomp filter.
315.TP 507.TP
508\fBseccomp.32 syscall,syscall,syscall
509Enable seccomp filter and blacklist the system calls in the list on top of default seccomp filter for 32 bit system calls on a 64 bit architecture system.
510.TP
316\fBseccomp.block-secondary 511\fBseccomp.block-secondary
317Enable seccomp filter and filter system call architectures 512Enable seccomp filter and filter system call architectures
318so that only the native architecture is allowed. 513so that only the native architecture is allowed.
319.TP 514.TP
320\fBseccomp.drop syscall,syscall,syscall 515\fBseccomp.drop syscall,syscall,syscall
321Enable seccomp filter and blacklist the system calls in the list. 516Enable seccomp filter and blacklist the system calls in the list.
517.TP
518\fBseccomp.32.drop syscall,syscall,syscall
519Enable seccomp filter and blacklist the system calls in the list for 32 bit system calls on a 64 bit architecture system.
322.TP 520.TP
323\fBseccomp.keep syscall,syscall,syscall 521\fBseccomp.keep syscall,syscall,syscall
324Enable seccomp filter and whitelist the system calls in the list. 522Enable seccomp filter and whitelist the system calls in the list.
325.TP 523.TP
326\fBmemory-deny-write-execute 524\fBseccomp.32.keep syscall,syscall,syscall
327Install a seccomp filter to block attempts to create memory mappings 525Enable seccomp filter and whitelist the system calls in the list for 32 bit system calls on a 64 bit architecture system.
328that are both writable and executable, to change mappings to be
329executable or to create executable shared memory.
330.TP
331\fBnonewprivs
332Sets the NO_NEW_PRIVS prctl. This ensures that child processes
333cannot acquire new privileges using execve(2); in particular,
334this means that calling a suid binary (or one with file capabilities)
335does not result in an increase of privilege.
336.TP 526.TP
337\fBnoroot 527\fBseccomp-error-action kill | log | ERRNO
338Use this command to enable an user namespace. The namespace has only one user, the current user. 528Return a different error instead of EPERM to the process, kill it when
339There is no root account (uid 0) defined in the namespace. 529an attempt is made to call a blocked system call, or allow but log the
530attempt.
531#ifdef HAVE_X11
340.TP 532.TP
341\fBx11 533\fBx11
342Enable X11 sandboxing. 534Enable X11 sandboxing.
@@ -370,9 +562,103 @@ Example:
370xephyr-screen 640x480 562xephyr-screen 640x480
371.br 563.br
372x11 xephyr 564x11 xephyr
565#endif
566#ifdef HAVE_DBUSPROXY
567.SH DBus filtering
373 568
569Access to the session and system DBus UNIX sockets can be allowed, filtered or
570disabled. To disable the abstract sockets (and force applications to use the
571filtered UNIX socket) you would need to request a new network namespace using
572\-\-net command. Another option is to remove unix from the \-\-protocol set.
573.br
374 574
575.br
576Filtering requires installing the xdg-dbus-proxy utility. Filter rules can be
577specified for well-known DBus names, but they are also propagated to the owning
578unique name, too. The permissions are "sticky" and are kept even if the
579corresponding well-known name is released (however, applications rarely release
580well-known names in practice). Names may have a .* suffix to match all names
581underneath them, including themselves (e.g. "foo.bar.*" matches "foo.bar",
582"foo.bar.baz" and "foo.bar.baz.quux", but not "foobar"). For more information,
583see xdg-dbus-proxy(1).
584.br
375 585
586.br
587Examples:
588
589.TP
590\fBdbus-system filter
591Enable filtered access to the system DBus. Filters can be specified with the dbus-system.talk and dbus-system.own commands.
592.TP
593\fBdbus-system none
594Disable access to the system DBus. Once access is disabled, it cannot be relaxed to filtering.
595.TP
596\fBdbus-system.own org.gnome.ghex.*
597Allow the application to own the name org.gnome.ghex and all names underneath in on the system DBus.
598.TP
599\fBdbus-system.talk org.freedesktop.Notifications
600Allow the application to talk to the name org.freedesktop.Notifications on the system DBus.
601.TP
602\fBdbus-system.see org.freedesktop.Notifications
603Allow the application to see but not talk to the name org.freedesktop.Notifications on the system DBus.
604.TP
605\fBdbus-system.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications
606Allow the application to call methods of the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus.
607.TP
608\fBdbus-system.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications
609Allow the application to receive broadcast signals from the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus.
610.TP
611\fBdbus-user filter
612Enable filtered access to the session DBus. Filters can be specified with the dbus-user.talk and dbus-user.own commands.
613.TP
614\fBdbus-user none
615Disable access to the session DBus. Once access is disabled, it cannot be relaxed to filtering.
616.TP
617\fBdbus-user.own org.gnome.ghex.*
618Allow the application to own the name org.gnome.ghex and all names underneath in on the session DBus.
619.TP
620\fBdbus-user.talk org.freedesktop.Notifications
621Allow the application to talk to the name org.freedesktop.Notifications on the session DBus.
622.TP
623\fBdbus-user.see org.freedesktop.Notifications
624Allow the application to see but not talk to the name org.freedesktop.Notifications on the session DBus.
625.TP
626\fBdbus-user.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications
627Allow the application to call methods of the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus.
628.TP
629\fBdbus-user.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications
630Allow the application to receive broadcast signals from the the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus.
631.TP
632\fBnodbus \fR(deprecated)
633Disable D-Bus access (both system and session buses). Equivalent to dbus-system none and dbus-user none.
634.TP
635.br
636
637.br
638Individual filters can be overridden via the \-\-ignore command. Supposing a profile has
639.br
640[...]
641.br
642dbus-user filter
643.br
644dbus-user.own org.mozilla.firefox.*
645.br
646dbus-user.talk org.freedesktop.Notifications
647.br
648dbus-system none
649.br
650[...]
651.br
652
653.br
654and the user wants to disable notifications, this can be achieved by putting the below in a local override file:
655.br
656[...]
657.br
658ignore dbus-user.talk org.freedesktop.Notifications
659.br
660[...]
661#endif
376.SH Resource limits, CPU affinity, Control Groups 662.SH Resource limits, CPU affinity, Control Groups
377These profile entries define the limits on system resources (rlimits) for the processes inside the sandbox. 663These profile entries define the limits on system resources (rlimits) for the processes inside the sandbox.
378The limits can be modified inside the sandbox using the regular \fBulimit\fR command. \fBcpu\fR command 664The limits can be modified inside the sandbox using the regular \fBulimit\fR command. \fBcpu\fR command
@@ -382,6 +668,21 @@ place the sandbox in an existing control group.
382Examples: 668Examples:
383 669
384.TP 670.TP
671\fBcgroup /sys/fs/cgroup/g1/tasks
672The sandbox is placed in g1 control group.
673.TP
674\fBcpu 0,1,2
675Use only CPU cores 0, 1 and 2.
676.TP
677\fBnice -5
678Set a nice value of -5 to all processes running inside the sandbox.
679.TP
680\fBrlimit-as 123456789012
681Set the maximum size of the process's virtual memory to 123456789012 bytes.
682.TP
683\fBrlimit-cpu 123
684Set the maximum CPU time in seconds.
685.TP
385\fBrlimit-fsize 1024 686\fBrlimit-fsize 1024
386Set the maximum file size that can be created by a process to 1024 bytes. 687Set the maximum file size that can be created by a process to 1024 bytes.
387.TP 688.TP
@@ -394,14 +695,8 @@ Set the maximum number of files that can be opened by a process to 500.
394\fBrlimit-sigpending 200 695\fBrlimit-sigpending 200
395Set the maximum number of processes that can be created for the real user ID of the calling process to 200. 696Set the maximum number of processes that can be created for the real user ID of the calling process to 200.
396.TP 697.TP
397\fBcpu 0,1,2 698\fBtimeout hh:mm:ss
398Use only CPU cores 0, 1 and 2. 699Kill the sandbox automatically after the time has elapsed. The time is specified in hours/minutes/seconds format.
399.TP
400\fBnice -5
401Set a nice value of -5 to all processes running inside the sandbox.
402.TP
403\fBcgroup /sys/fs/cgroup/g1/tasks
404The sandbox is placed in g1 control group.
405 700
406.SH User Environment 701.SH User Environment
407.TP 702.TP
@@ -409,14 +704,6 @@ The sandbox is placed in g1 control group.
409All user home directories are visible inside the sandbox. By default, only current user home directory is visible. 704All user home directories are visible inside the sandbox. By default, only current user home directory is visible.
410 705
411.TP 706.TP
412\fBname sandboxname
413Set sandbox name. Example:
414.br
415
416.br
417name browser
418
419.TP
420\fBenv name=value 707\fBenv name=value
421Set environment variable. Examples: 708Set environment variable. Examples:
422.br 709.br
@@ -427,17 +714,31 @@ env LD_LIBRARY_PATH=/opt/test/lib
427env CFLAGS="-W -Wall -Werror" 714env CFLAGS="-W -Wall -Werror"
428 715
429.TP 716.TP
717\fBipc-namespace
718Enable IPC namespace.
719.TP
720\fBname sandboxname
721Set sandbox name. Example:
722.br
723
724.br
725name browser
726
727.TP
728\fBno3d
729Disable 3D hardware acceleration.
730.TP
731\fBnoautopulse \fR(deprecated)
732See keep-config-pulse.
733.TP
430\fBnodvd 734\fBnodvd
431Disable DVD and audio CD devices. 735Disable DVD and audio CD devices.
432.TP 736.TP
433\fBnogroups 737\fBnogroups
434Disable supplementary user groups 738Disable supplementary user groups
435.TP 739.TP
436\fBshell none 740\fBnoinput
437Run the program directly, without a shell. 741Disable input devices.
438.TP
439\fBipc-namespace
440Enable IPC namespace.
441.TP 742.TP
442\fBnosound 743\fBnosound
443Disable sound system. 744Disable sound system.
@@ -445,12 +746,20 @@ Disable sound system.
445\fBnotv 746\fBnotv
446Disable DVB (Digital Video Broadcasting) TV devices. 747Disable DVB (Digital Video Broadcasting) TV devices.
447.TP 748.TP
749\fBnou2f
750Disable U2F devices.
751.TP
448\fBnovideo 752\fBnovideo
449Disable video devices. 753Disable video capture devices.
450.TP 754.TP
451\fBno3d 755\fBmachine-id
452Disable 3D hardware acceleration. 756Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox.
757.TP
758\fBshell none
759Run the program directly, without a shell.
453 760
761
762#ifdef HAVE_NETWORK
454.SH Networking 763.SH Networking
455Networking features available in profile files. 764Networking features available in profile files.
456 765
@@ -498,6 +807,33 @@ net eth0
498ip none 807ip none
499 808
500.TP 809.TP
810\fBip dhcp
811Acquire an IP address and default gateway for the last interface defined by a
812net command, as well as set the DNS servers according to the DHCP response.
813This command requires the ISC dhclient DHCP client to be installed and will start
814it automatically inside the sandbox.
815.br
816
817.br
818Example:
819.br
820net br0
821.br
822ip dhcp
823.br
824
825.br
826This command should not be used in conjunction with the dns command if the
827DHCP server is set to configure DNS servers for the clients, because the
828manually specified DNS servers will be overwritten.
829
830.br
831The DHCP client will NOT release the DHCP lease when the sandbox terminates.
832If your DHCP server requires leases to be explicitly released, consider running
833a DHCP client and releasing the lease manually in conjunction with the
834net none command.
835
836.TP
501\fBip6 address 837\fBip6 address
502Assign IPv6 addresses to the last network interface defined by a net command. 838Assign IPv6 addresses to the last network interface defined by a net command.
503.br 839.br
@@ -510,6 +846,32 @@ net eth0
510ip6 2001:0db8:0:f101::1/64 846ip6 2001:0db8:0:f101::1/64
511 847
512.TP 848.TP
849\fBip6 dhcp
850Acquire an IPv6 address and default gateway for the last interface defined by a
851net command, as well as set the DNS servers according to the DHCP response.
852This command requires the ISC dhclient DHCP client to be installed and will start
853it automatically inside the sandbox.
854.br
855
856.br
857Example:
858.br
859net br0
860.br
861ip6 dhcp
862.br
863
864.br
865This command should not be used in conjunction with the dns command if the
866DHCP server is set to configure DNS servers for the clients, because the
867manually specified DNS servers will be overwritten.
868
869.br
870The DHCP client will NOT release the DHCP lease when the sandbox terminates.
871If your DHCP server requires leases to be explicitly released, consider running
872a DHCP client and releasing the lease manually.
873
874.TP
513\fBiprange address,address 875\fBiprange address,address
514Assign an IP address in the provided range to the last network 876Assign an IP address in the provided range to the last network
515interface defined by a net command. A default gateway is assigned by default. 877interface defined by a net command. A default gateway is assigned by default.
@@ -530,23 +892,9 @@ iprange 192.168.1.150,192.168.1.160
530Assign MAC addresses to the last network interface defined by a net command. 892Assign MAC addresses to the last network interface defined by a net command.
531 893
532.TP 894.TP
533\fBmachine-id
534Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox.
535
536.TP
537\fBmtu number 895\fBmtu number
538Assign a MTU value to the last network interface defined by a net command. 896Assign a MTU value to the last network interface defined by a net command.
539 897
540
541
542.TP
543\fBnetfilter
544If a new network namespace is created, enabled default network filter.
545
546.TP
547\fBnetfilter filename
548If a new network namespace is created, enabled the network filter in filename.
549
550.TP 898.TP
551\fBnet bridge_interface 899\fBnet bridge_interface
552Enable a new network namespace and connect it to this bridge interface. 900Enable a new network namespace and connect it to this bridge interface.
@@ -556,16 +904,15 @@ configured as default gateway is the bridge device IP address. Up to four \-\-ne
556bridge devices can be defined. Mixing bridge and macvlan devices is allowed. 904bridge devices can be defined. Mixing bridge and macvlan devices is allowed.
557 905
558.TP 906.TP
559\fBnet ethernet_interface 907\fBnet ethernet_interface|wireless_interface
560Enable a new network namespace and connect it 908Enable a new network namespace and connect it
561to this ethernet interface using the standard Linux macvlan 909to this ethernet interface using the standard Linux macvlan or ipvlan
562driver. Unless specified with option \-\-ip and \-\-defaultgw, an 910driver. Unless specified with option \-\-ip and \-\-defaultgw, an
563IP address and a default gateway will be assigned automatically 911IP address and a default gateway will be assigned automatically
564to the sandbox. The IP address is verified using ARP before 912to the sandbox. The IP address is verified using ARP before
565assignment. The address configured as default gateway is the 913assignment. The address configured as default gateway is the
566default gateway of the host. Up to four \-\-net devices can 914default gateway of the host. Up to four \-\-net devices can
567be defined. Mixing bridge and macvlan devices is allowed. 915be defined. Mixing bridge and macvlan devices is allowed.
568Note: wlan devices are not supported for this option.
569 916
570.TP 917.TP
571\fBnet none 918\fBnet none
@@ -575,56 +922,76 @@ Use this option to deny network access to programs that don't
575really need network access. 922really need network access.
576 923
577.TP 924.TP
925\fBnet tap_interface
926Enable a new network namespace and connect it
927to this ethernet tap interface using the standard Linux macvlan
928driver. If the tap interface is not configured, the sandbox
929will not try to configure the interface inside the sandbox.
930Please use ip, netmask and defaultgw to specify the configuration.
931
932.TP
933\fBnetfilter
934If a new network namespace is created, enabled default network filter.
935
936.TP
937\fBnetfilter filename
938If a new network namespace is created, enabled the network filter in filename.
939
940
941.TP
942\fBnetmask address
943Use this option when you want to assign an IP address in a new namespace and
944the parent interface specified by --net is not configured. An IP address and
945a default gateway address also have to be added.
946
947.TP
948\fBnetns namespace
949Run the program in a named, persistent network namespace. These can
950be created and configured using "ip netns".
951
952.TP
578\fBveth-name name 953\fBveth-name name
579Use this name for the interface connected to the bridge for --net=bridge_interface commands, 954Use this name for the interface connected to the bridge for --net=bridge_interface commands,
580instead of the default one. 955instead of the default one.
581 956#endif
582.SH Other 957.SH Other
583.TP 958.TP
959\fBdeterministic-exit-code
960Always 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.
961
962.TP
584\fBjoin-or-start sandboxname 963\fBjoin-or-start sandboxname
585Join the sandbox identified by name or start a new one. 964Join the sandbox identified by name or start a new one.
586Same as "firejail --join=sandboxname" command if sandbox with specified name exists, otherwise same as "name sandboxname". 965Same as "firejail --join=sandboxname" command if sandbox with specified name exists, otherwise same as "name sandboxname".
587 966
588.SH RELOCATING PROFILES 967.SH FILES
589For various reasons some users might want to keep the profile files in a different directory. 968.TP
590Using \fB--profile-path\fR command line option, Firejail can be instructed to look for profiles 969\fB/etc/firejail/appname.profile
591into this directory. 970Global Firejail configuration consisting mainly of profiles for each application supported by default.
592
593This is an example of relocating the profile files into a new
594directory, /home/netblue/myprofiles. Start by creating the new directory and copy all
595the profile files in:
596.br
597
598.br
599$ mkdir ~/myprofiles && cd ~/myprofiles && cp /etc/firejail/* .
600.br
601
602.br
603Using \fBsed\fR utility, modify the absolute paths for \fBinclude\fR commands:
604.br
605
606.br
607$ sed -i "s/\\/etc\\/firejail/\\/home\\/netblue\\/myprofiles/g" *.profile
608.br
609$ sed -i "s/\\/etc\\/firejail/\\/home\\/netblue\\/myprofiles/g" *.inc
610.br
611 971
612.br 972.TP
613Start Firejail using the new path: 973\fB$HOME/.config/firejail/appname.profile
614.br 974User application profiles, will take precedence over the global profiles.
615 975
616.br 976.TP
617$ firejail --profile-path=~/myprofiles 977\fB/usr/share/doc/firejail/profile.template
978Template for building new profiles.
618 979
619.SH FILES 980.TP
620/etc/firejail/filename.profile, $HOME/.config/firejail/filename.profile 981\fB/usr/share/doc/firejail/redirect_alias-profile.template
982Template for aliasing/redirecting profiles.
621 983
622.SH LICENSE 984.SH LICENSE
623Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 985Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
624.PP 986.PP
625Homepage: http://firejail.wordpress.com 987Homepage: https://firejail.wordpress.com
626.SH SEE ALSO 988.SH SEE ALSO
627\&\flfirejail\fR\|(1), 989.BR firejail (1),
628\&\flfiremon\fR\|(1), 990.BR firemon (1),
629\&\flfirecfg\fR\|(1), 991.BR firecfg (1),
630\&\flfirejail-login\fR\|(5) 992.BR firejail-login (5),
993.BR firejail-users (5),
994.BR jailcheck (1)
995
996.UR https://github.com/netblue30/firejail/wiki/Creating-Profiles
997.UE
diff --git a/src/man/firejail-users.txt b/src/man/firejail-users.txt
new file mode 100644
index 000000000..e3cce7ed5
--- /dev/null
+++ b/src/man/firejail-users.txt
@@ -0,0 +1,62 @@
1.TH FIREJAIL-USERS 5 "MONTH YEAR" "VERSION" "firejail.users man page"
2.SH NAME
3firejail.users \- Firejail user access database
4
5.SH DESCRIPTION
6/etc/firejail/firejail.users lists the users allowed to run firejail SUID executable.
7root user is allowed by default, user nobody is never allowed.
8
9If the user is not allowed to start the sandbox, Firejail will attempt to run the
10program without sandboxing it.
11
12If the file is not present in the system, all users are allowed to use the sandbox.
13
14Example:
15
16 $ cat /etc/firejail/firejail.users
17.br
18 dustin
19.br
20 lucas
21.br
22 mike
23.br
24 eleven
25
26Use a text editor to add or remove users from the list. You can also use firecfg \-\-add-users
27command. Example:
28
29 $ sudo firecfg --add-users dustin lucas mike eleven
30
31By default, running firecfg creates the file and adds the current user to the list. Example:
32
33 $ sudo firecfg
34
35See \fBman 1 firecfg\fR for details.
36
37.SH ALTERNATIVE SOLUTION
38An alternative way of restricting user access to firejail executable is to create a special firejail user group and
39allow only users in this group to run the sandbox:
40
41 # addgroup --system firejail
42.br
43 # chown root:firejail /usr/bin/firejail
44.br
45 # chmod 4750 /usr/bin/firejail
46
47
48.SH FILES
49/etc/firejail/firejail.users
50
51.SH LICENSE
52Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
53as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
54.PP
55Homepage: https://firejail.wordpress.com
56.SH SEE ALSO
57.BR firejail (1),
58.BR firemon (1),
59.BR firecfg (1),
60.BR firejail-profile (5),
61.BR firejail-login (5),
62.BR jailcheck (1)
diff --git a/src/man/firejail.txt b/src/man/firejail.txt
index 17ddd5c88..0462705c0 100644
--- a/src/man/firejail.txt
+++ b/src/man/firejail.txt
@@ -8,18 +8,28 @@ Start a sandbox:
8firejail [OPTIONS] [program and arguments] 8firejail [OPTIONS] [program and arguments]
9.RE 9.RE
10.PP 10.PP
11Start an AppImage program:
12.PP
13.RS
14firejail [OPTIONS] --appimage [appimage-file and arguments]
15.RE
16.PP
17#ifdef HAVE_FILE_TRANSFER
11File transfer from an existing sandbox 18File transfer from an existing sandbox
12.PP 19.PP
13.RS 20.RS
14firejail {\-\-ls | \-\-get | \-\-put} dir_or_filename 21firejail {\-\-ls | \-\-get | \-\-put | \-\-cat} dir_or_filename
15.RE 22.RE
16.PP 23.PP
24#endif
25#ifdef HAVE_NETWORK
17Network traffic shaping for an existing sandbox: 26Network traffic shaping for an existing sandbox:
18.PP 27.PP
19.RS 28.RS
20firejail \-\-bandwidth={name|pid} bandwidth-command 29firejail \-\-bandwidth={name|pid} bandwidth-command
21.RE 30.RE
22.PP 31.PP
32#endif
23Monitoring: 33Monitoring:
24.PP 34.PP
25.RS 35.RS
@@ -29,9 +39,18 @@ firejail {\-\-list | \-\-netstats | \-\-top | \-\-tree}
29Miscellaneous: 39Miscellaneous:
30.PP 40.PP
31.RS 41.RS
32firejail {\-? | \-\-debug-caps | \-\-debug-errnos | \-\-debug-syscalls | \-\-debug-protocols | \-\-help | \-\-version} 42firejail {\-? | \-\-debug-caps | \-\-debug-errnos | \-\-debug-syscalls | \-\-debug-syscalls32 | \-\-debug-protocols | \-\-help | \-\-version}
33.RE 43.RE
34.SH DESCRIPTION 44.SH DESCRIPTION
45#ifdef HAVE_LTS
46This is Firejail long-term support (LTS), an enterprise focused version of the software,
47LTS is usually supported for two or three years.
48During this time only bugs and the occasional documentation problems are fixed.
49The attack surface of the SUID executable was greatly reduced by removing some of the features.
50.br
51
52.br
53#endif
35Firejail is a SUID sandbox program that reduces the risk of security breaches by 54Firejail is a SUID sandbox program that reduces the risk of security breaches by
36restricting the running environment of untrusted applications using Linux 55restricting the running environment of untrusted applications using Linux
37namespaces, seccomp-bpf and Linux capabilities. 56namespaces, seccomp-bpf and Linux capabilities.
@@ -48,6 +67,10 @@ Firejail allows the user to manage application security using security profiles.
48Each profile defines a set of permissions for a specific application or group 67Each profile defines a set of permissions for a specific application or group
49of applications. The software includes security profiles for a number of more common 68of applications. The software includes security profiles for a number of more common
50Linux programs, such as Mozilla Firefox, Chromium, VLC, Transmission etc. 69Linux programs, such as Mozilla Firefox, Chromium, VLC, Transmission etc.
70.PP
71Alternative sandbox technologies like snap (https://snapcraft.io/) and flatpak (https://flatpak.org/)
72are not supported. Snap and flatpak packages have their own native management tools and will
73not work when sandboxed with Firejail.
51 74
52.SH USAGE 75.SH USAGE
53Without any options, the sandbox consists of a filesystem build in a new mount namespace, 76Without any options, the sandbox consists of a filesystem build in a new mount namespace,
@@ -56,15 +79,16 @@ command line options. The default Firejail filesystem is based on the host files
56system directories mounted read-only. These directories are /etc, /var, /usr, /bin, /sbin, /lib, /lib32, 79system directories mounted read-only. These directories are /etc, /var, /usr, /bin, /sbin, /lib, /lib32,
57/libx32 and /lib64. Only /home and /tmp are writable. 80/libx32 and /lib64. Only /home and /tmp are writable.
58.PP 81.PP
59As it starts up, Firejail tries to find a security profile based on the name of the application. 82Upon execution Firejail first looks in ~/.config/firejail/ for a profile and if it doesn't find one, it looks in /etc/firejail/.
83For profile resolution detail see https://github.com/netblue30/firejail/wiki/Creating-Profiles#locations-and-types.
60If an appropriate profile is not found, Firejail will use a default profile. 84If an appropriate profile is not found, Firejail will use a default profile.
61The default profile is quite restrictive. In case the application doesn't work, use --noprofile option 85The default profile is quite restrictive. In case the application doesn't work, use --noprofile option
62to disable it. For more information, please see \fBSECURITY PROFILES\fR section below. 86to disable it. For more information, please see \fBSECURITY PROFILES\fR section below.
63.PP 87.PP
64If a program argument is not specified, Firejail starts /bin/bash shell. 88If a program argument is not specified, Firejail starts the user's preferred shell.
65Examples: 89Examples:
66.PP 90.PP
67$ firejail [OPTIONS] # starting a /bin/bash shell 91$ firejail [OPTIONS] # starting the program specified in $SHELL, usually /bin/bash
68.PP 92.PP
69$ firejail [OPTIONS] firefox # starting Mozilla Firefox 93$ firejail [OPTIONS] firefox # starting Mozilla Firefox
70.PP 94.PP
@@ -87,15 +111,6 @@ Example:
87.br 111.br
88$ firejail --allow-debuggers --profile=/etc/firejail/firefox.profile strace -f firefox 112$ firejail --allow-debuggers --profile=/etc/firejail/firefox.profile strace -f firefox
89.TP 113.TP
90\fB\-\-allow-private-blacklist
91Allow blacklisting files in private home directory. By default these blacklists are disabled.
92.br
93
94.br
95Example:
96.br
97$ firejail --allow-private-blacklist --private=~/priv-dir --blacklist=~/.mozilla
98.TP
99\fB\-\-allusers 114\fB\-\-allusers
100All directories under /home are visible inside the sandbox. By default, only current user home directory is visible. 115All directories under /home are visible inside the sandbox. By default, only current user home directory is visible.
101.br 116.br
@@ -104,31 +119,46 @@ All directories under /home are visible inside the sandbox. By default, only cur
104Example: 119Example:
105.br 120.br
106$ firejail --allusers 121$ firejail --allusers
122#ifdef HAVE_APPARMOR
107.TP 123.TP
108\fB\-\-apparmor 124\fB\-\-apparmor
109Enable AppArmor confinement. For more information, please see \fBAPPARMOR\fR section below. 125Enable AppArmor confinement. For more information, please see \fBAPPARMOR\fR section below.
110.TP 126.TP
111\fB\-\-appimage 127\fB\-\-apparmor.print=name|pid
112Sandbox an AppImage (http://appimage.org/) application. 128Print the AppArmor confinement status for the sandbox identified by name or by PID.
113.br 129.br
114 130
115.br 131.br
116Example: 132Example:
117.br 133.br
118$ firejail --appimage krita-3.0-x86_64.appimage 134$ firejail \-\-apparmor.print=browser
119.br 135.br
120$ firejail --appimage --private krita-3.0-x86_64.appimage 1365074:netblue:/usr/bin/firejail /usr/bin/firefox-esr
121.br 137.br
122$ firejail --appimage --net=none --x11 krita-3.0-x86_64.appimage 138 AppArmor: firejail-default enforce
123.TP 139#endif
124\fB\-\-audit
125Audit the sandbox, see \fBAUDIT\fR section for more details.
126.TP 140.TP
127\fB\-\-audit=test-program 141\fB\-\-appimage
128Audit the sandbox, see \fBAUDIT\fR section for more details. 142Sandbox an AppImage (https://appimage.org/) application. If the sandbox is started
143as a regular user, nonewprivs and a default capabilities filter are enabled.
144private-bin and private-lib are disabled by default when running appimages.
145.br
146
147.br
148Example:
149.br
150$ firejail --appimage --profile=krita krita-3.0-x86_64.appimage
151.br
152$ firejail --appimage --private --profile=krita krita-3.0-x86_64.appimage
153.br
154#ifdef HAVE_X11
155$ firejail --appimage --net=none --x11 --profile=krita krita-3.0-x86_64.appimage
156#endif
129.TP 157.TP
158#ifdef HAVE_NETWORK
130\fB\-\-bandwidth=name|pid 159\fB\-\-bandwidth=name|pid
131Set bandwidth limits for the sandbox identified by name or PID, see \fBTRAFFIC SHAPING\fR section for more details. 160Set bandwidth limits for the sandbox identified by name or PID, see \fBTRAFFIC SHAPING\fR section for more details.
161#endif
132.TP 162.TP
133\fB\-\-bind=filename1,filename2 163\fB\-\-bind=filename1,filename2
134Mount-bind filename1 on top of filename2. This option is only available when running as root. 164Mount-bind filename1 on top of filename2. This option is only available when running as root.
@@ -140,7 +170,7 @@ Example:
140# firejail \-\-bind=/config/etc/passwd,/etc/passwd 170# firejail \-\-bind=/config/etc/passwd,/etc/passwd
141.TP 171.TP
142\fB\-\-blacklist=dirname_or_filename 172\fB\-\-blacklist=dirname_or_filename
143Blacklist directory or file. 173Blacklist directory or file. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
144.br 174.br
145 175
146.br 176.br
@@ -155,7 +185,7 @@ $ firejail "\-\-blacklist=/home/username/My Virtual Machines"
155$ firejail \-\-blacklist=/home/username/My\\ Virtual\\ Machines 185$ firejail \-\-blacklist=/home/username/My\\ Virtual\\ Machines
156.TP 186.TP
157\fB\-\-build 187\fB\-\-build
158The command builds a whitelisted profile. If /usr/bin/strace is installed on the system, it also 188The command builds a whitelisted profile. The profile is printed on the screen. If /usr/bin/strace is installed on the system, it also
159builds a whitelisted seccomp profile. The program is run in a very relaxed sandbox, 189builds a whitelisted seccomp profile. The program is run in a very relaxed sandbox,
160with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported 190with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported
161in order to allow strace to run. Chromium and Chromium-based browsers will not work. 191in order to allow strace to run. Chromium and Chromium-based browsers will not work.
@@ -166,8 +196,22 @@ Example:
166.br 196.br
167$ firejail --build vlc ~/Videos/test.mp4 197$ firejail --build vlc ~/Videos/test.mp4
168.TP 198.TP
199\fB\-\-build=profile-file
200The command builds a whitelisted profile, and saves it in profile-file. If /usr/bin/strace is installed on the system, it also
201builds a whitelisted seccomp profile. The program is run in a very relaxed sandbox,
202with only --caps.drop=all and --nonewprivs. Programs that raise user privileges are not supported
203in order to allow strace to run. Chromium and Chromium-based browsers will not work.
204.br
205
206.br
207Example:
208.br
209$ firejail --build=vlc.profile vlc ~/Videos/test.mp4
210.TP
169\fB\-c 211\fB\-c
170Execute command and exit. 212Login shell compatibility option. This option is use by some login programs when executing
213the login shell, such as when firejail is used as a restricted login shell. It currently does
214not change the execution of firejail.
171.TP 215.TP
172\fB\-\-caps 216\fB\-\-caps
173Linux capabilities is a kernel feature designed to split up the root privilege into a set of distinct privileges. 217Linux capabilities is a kernel feature designed to split up the root privilege into a set of distinct privileges.
@@ -236,10 +280,15 @@ Example:
236.br 280.br
237$ firejail \-\-list 281$ firejail \-\-list
238.br 282.br
2393272:netblue:firejail \-\-private firefox 2833272:netblue::firejail \-\-private firefox
240.br 284.br
241$ firejail \-\-caps.print=3272 285$ firejail \-\-caps.print=3272
242 286
287#ifdef HAVE_FILE_TRANSFER
288.TP
289\fB\-\-cat=name|pid filename
290Print content of file from sandbox container, see FILE TRANSFER section for more details.
291#endif
243.TP 292.TP
244\fB\-\-cgroup=tasks-file 293\fB\-\-cgroup=tasks-file
245Place the sandbox in the specified control group. tasks-file is the full path of cgroup tasks file. 294Place the sandbox in the specified control group. tasks-file is the full path of cgroup tasks file.
@@ -249,20 +298,19 @@ Place the sandbox in the specified control group. tasks-file is the full path of
249Example: 298Example:
250.br 299.br
251# firejail \-\-cgroup=/sys/fs/cgroup/g1/tasks 300# firejail \-\-cgroup=/sys/fs/cgroup/g1/tasks
252 301#ifdef HAVE_CHROOT
253.TP 302.TP
254\fB\-\-chroot=dirname 303\fB\-\-chroot=dirname
255Chroot the sandbox into a root filesystem. Unlike the regular filesystem container, 304Chroot the sandbox into a root filesystem. Unlike the regular filesystem container,
256the system directories are mounted read-write. If the sandbox is started as a 305the system directories are mounted read-write. If the sandbox is started as a
257regular user, default seccomp and capabilities filters are enabled. This 306regular user, nonewprivs and a default capabilities filter are enabled.
258option is not available on Grsecurity systems.
259.br 307.br
260 308
261.br 309.br
262Example: 310Example:
263.br 311.br
264$ firejail \-\-chroot=/media/ubuntu warzone2100 312$ firejail \-\-chroot=/media/ubuntu warzone2100
265 313#endif
266.TP 314.TP
267\fB\-\-cpu=cpu-number,cpu-number,cpu-number 315\fB\-\-cpu=cpu-number,cpu-number,cpu-number
268Set CPU affinity. 316Set CPU affinity.
@@ -291,19 +339,280 @@ Example:
291.br 339.br
292$ firejail \-\-list 340$ firejail \-\-list
293.br 341.br
2943272:netblue:firejail \-\-private firefox 3423272:netblue::firejail \-\-private firefox
295.br 343.br
296$ firejail \-\-cpu.print=3272 344$ firejail \-\-cpu.print=3272
345#ifdef HAVE_DBUSPROXY
346.TP
347\fB\-\-dbus-log=file
348Specify the location for the DBus log file.
349.br
350
351.br
352The log file contains events for both the system and session buses if both of
353the --dbus-system.log and --dbus-user.log options are specified. If no log file
354path is given, logs are written to the standard output instead.
355.br
356
357.br
358Example:
359.br
360$ firejail --dbus-system=filter --dbus-system.log \\
361.br
362--dbus-log=dbus.txt
363
364.TP
365\fB\-\-dbus-system=filter|none
366Set system DBus sandboxing policy.
367.br
368
369.br
370The \fBfilter\fR policy enables the system DBus filter. This option requires
371installing the xdg-dbus-proxy utility. Permissions for well-known can be
372specified with the --dbus-system.talk and --dbus-system.own options.
373.br
374
375.br
376The \fBnone\fR policy disables access to the system DBus.
377.br
378
379.br
380Only the regular system DBus UNIX socket is handled by this option. To disable
381the abstract sockets (and force applications to use the filtered UNIX socket)
382you would need to request a new network namespace using \-\-net command. Another
383option is to remove unix from the \-\-protocol set.
384.br
385
386.br
387Example:
388.br
389$ firejail \-\-dbus-system=none
297 390
298.TP 391.TP
299\fB\-\-csh 392\fB\-\-dbus-system.broadcast=name=[member][@path]
300Use /bin/csh as default user shell. 393Allows the application to receive broadcast signals from theindicated interface
394member at the indicated object path exposed by the indicated bus name on the
395system DBus.
396The name may have a .* suffix to match all names underneath it, including
397itself.
398The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
399The path may have a /* suffix to indicate all objects underneath it, including
400itself.
401Omitting the interface member or the object path will match all members and
402object paths, respectively.
301.br 403.br
302 404
303.br 405.br
304Example: 406Example:
305.br 407.br
306$ firejail \-\-csh 408$ firejail --dbus-system=filter --dbus-system.broadcast=\\
409.br
410org.freedesktop.Notifications=\\
411.br
412org.freedesktop.Notifications.*@/org/freedesktop/Notifications
413
414.TP
415\fB\-\-dbus-system.call=name=[member][@path]
416Allows the application to call the indicated interface member at the indicated
417object path exposed by the indicated bus name on the system DBus.
418The name may have a .* suffix to match all names underneath it, including
419itself.
420The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
421The path may have a /* suffix to indicate all objects underneath it, including
422itself.
423Omitting the interface member or the object path will match all members and
424object paths, respectively.
425.br
426
427.br
428Example:
429.br
430$ firejail --dbus-system=filter --dbus-system.call=\\
431.br
432org.freedesktop.Notifications=\\
433.br
434org.freedesktop.Notifications.*@/org/freedesktop/Notifications
435
436.TP
437\fB\-\-dbus-system.log
438Turn on DBus logging for the system DBus. This option requires --dbus-system=filter.
439
440.br
441Example:
442.br
443$ firejail --dbus-system=filter --dbus-system.log
444
445.TP
446\fB\-\-dbus-system.own=name
447Allows the application to own the specified well-known name on the system DBus.
448The name may have a .* suffix to match all names underneath it, including itself
449(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
450not "foobar").
451.br
452
453.br
454Example:
455.br
456$ firejail --dbus-system=filter --dbus-system.own=\\
457.br
458org.gnome.ghex.*
459
460.TP
461\fB\-\-dbus-system.see=name
462Allows the application to see, but not talk to the specified well-known name on
463the system DBus.
464The name may have a .* suffix to match all names underneath it, including itself
465(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
466not "foobar").
467.br
468
469.br
470Example:
471.br
472$ firejail --dbus-system=filter --dbus-system.see=\\
473.br
474org.freedesktop.Notifications
475
476.TP
477\fB\-\-dbus-system.talk=name
478Allows the application to talk to the specified well-known name on the system DBus.
479The name may have a .* suffix to match all names underneath it, including itself
480(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
481not "foobar").
482.br
483
484.br
485Example:
486.br
487$ firejail --dbus-system=filter --dbus-system.talk=\\
488.br
489org.freedesktop.Notifications
490
491.TP
492\fB\-\-dbus-user=filter|none
493Set session DBus sandboxing policy.
494.br
495
496.br
497The \fBfilter\fR policy enables the session DBus filter. This option requires
498installing the xdg-dbus-proxy utility. Permissions for well-known names can be
499added with the --dbus-user.talk and --dbus-user.own options.
500.br
501
502.br
503The \fBnone\fR policy disables access to the session DBus.
504.br
505
506.br
507Only the regular session DBus UNIX socket is handled by this option. To disable
508the abstract sockets (and force applications to use the filtered UNIX socket)
509you would need to request a new network namespace using \-\-net command. Another
510option is to remove unix from the \-\-protocol set.
511.br
512
513.br
514Example:
515.br
516$ firejail \-\-dbus-user=none
517
518.TP
519\fB\-\-dbus-user.broadcast=name=[member][@path]
520Allows the application to receive broadcast signals from theindicated interface
521member at the indicated object path exposed by the indicated bus name on the
522session DBus.
523The name may have a .* suffix to match all names underneath it, including
524itself.
525The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
526The path may have a /* suffix to indicate all objects underneath it, including
527itself.
528Omitting the interface member or the object path will match all members and
529object paths, respectively.
530.br
531
532.br
533Example:
534.br
535$ firejail --dbus-user=filter --dbus-user.broadcast=\\
536.br
537org.freedesktop.Notifications=\\
538.br
539org.freedesktop.Notifications.*@/org/freedesktop/Notifications
540
541.TP
542\fB\-\-dbus-user.call=name=[member][@path]
543Allows the application to call the indicated interface member at the indicated
544object path exposed by the indicated bus name on the session DBus.
545The name may have a .* suffix to match all names underneath it, including
546itself.
547The interface member may have a .* to match all members of an interface, or be * to match all interfaces.
548The path may have a /* suffix to indicate all objects underneath it, including
549itself.
550Omitting the interface member or the object path will match all members and
551object paths, respectively.
552.br
553
554.br
555Example:
556.br
557$ firejail --dbus-user=filter --dbus-user.call=\\
558.br
559org.freedesktop.Notifications=\\
560.br
561org.freedesktop.Notifications.*@/org/freedesktop/Notifications
562
563.TP
564\fB\-\-dbus-user.log
565Turn on DBus logging for the session DBus. This option requires --dbus-user=filter.
566
567.br
568Example:
569.br
570$ firejail --dbus-user=filter --dbus-user.log
571
572.TP
573\fB\-\-dbus-user.own=name
574Allows the application to own the specified well-known name on the session DBus.
575The name may have a .* suffix to match all names underneath it, including itself
576(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
577not "foobar").
578.br
579
580.br
581Example:
582.br
583$ firejail --dbus-user=filter --dbus-user.own=org.gnome.ghex.*
584
585.TP
586\fB\-\-dbus-user.talk=name
587Allows the application to talk to the specified well-known name on the session DBus.
588The name may have a .* suffix to match all names underneath it, including itself
589(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
590not "foobar").
591.br
592
593.br
594Example:
595.br
596$ firejail --dbus-user=filter --dbus-user.talk=\\
597.br
598org.freedesktop.Notifications
599
600.TP
601\fB\-\-dbus-user.see=name
602Allows the application to see, but not talk to the specified well-known name on
603the session DBus.
604The name may have a .* suffix to match all names underneath it, including itself
605(e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but
606not "foobar").
607.br
608
609.br
610Example:
611.br
612$ firejail --dbus-user=filter --dbus-user.see=\\
613.br
614org.freedesktop.Notifications
615#endif
307.TP 616.TP
308\fB\-\-debug\fR 617\fB\-\-debug\fR
309Print debug messages. 618Print debug messages.
@@ -333,15 +642,6 @@ Print all recognized capabilities in the current Firejail software build and exi
333Example: 642Example:
334.br 643.br
335$ firejail \-\-debug-caps 644$ firejail \-\-debug-caps
336.TP
337\fB\-\-debug-check-filename\fR
338Debug filename checking.
339.br
340
341.br
342Example:
343.br
344$ firejail \-\-debug-check-filename firefox
345 645
346.TP 646.TP
347\fB\-\-debug-errnos 647\fB\-\-debug-errnos
@@ -353,6 +653,9 @@ Example:
353.br 653.br
354$ firejail \-\-debug-errnos 654$ firejail \-\-debug-errnos
355.TP 655.TP
656\fB\-\-debug-private-lib
657Debug messages for --private-lib option.
658.TP
356\fB\-\-debug-protocols 659\fB\-\-debug-protocols
357Print all recognized protocols in the current Firejail software build and exit. 660Print all recognized protocols in the current Firejail software build and exit.
358.br 661.br
@@ -371,6 +674,10 @@ Example:
371.br 674.br
372$ firejail \-\-debug-syscalls 675$ firejail \-\-debug-syscalls
373.TP 676.TP
677\fB\-\-debug-syscalls32
678Print all recognized 32 bit system calls in the current Firejail software build and exit.
679.br
680.TP
374\fB\-\-debug-whitelists\fR 681\fB\-\-debug-whitelists\fR
375Debug whitelisting. 682Debug whitelisting.
376.br 683.br
@@ -379,7 +686,7 @@ Debug whitelisting.
379Example: 686Example:
380.br 687.br
381$ firejail \-\-debug-whitelists firefox 688$ firejail \-\-debug-whitelists firefox
382 689#ifdef HAVE_NETWORK
383.TP 690.TP
384\fB\-\-defaultgw=address 691\fB\-\-defaultgw=address
385Use this address as default gateway in the new network namespace. 692Use this address as default gateway in the new network namespace.
@@ -389,10 +696,14 @@ Use this address as default gateway in the new network namespace.
389Example: 696Example:
390.br 697.br
391$ firejail \-\-net=eth0 \-\-defaultgw=10.10.20.1 firefox 698$ firejail \-\-net=eth0 \-\-defaultgw=10.10.20.1 firefox
392 699#endif
700.TP
701\fB\-\-deterministic-exit-code
702Always 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.
703.br
393.TP 704.TP
394\fB\-\-disable-mnt 705\fB\-\-disable-mnt
395Disable /mnt, /media, /run/mount and /run/media access. 706Blacklist /mnt, /media, /run/mount and /run/media access.
396.br 707.br
397 708
398.br 709.br
@@ -410,7 +721,10 @@ Use this option if you don't trust the DNS setup on your network.
410Example: 721Example:
411.br 722.br
412$ firejail \-\-dns=8.8.8.8 \-\-dns=8.8.4.4 firefox 723$ firejail \-\-dns=8.8.8.8 \-\-dns=8.8.4.4 firefox
724.br
413 725
726.br
727Note: this feature is not supported on systemd-resolved setups.
414.TP 728.TP
415\fB\-\-dns.print=name|pid 729\fB\-\-dns.print=name|pid
416Print DNS configuration for a sandbox identified by name or by PID. 730Print DNS configuration for a sandbox identified by name or by PID.
@@ -429,7 +743,7 @@ Example:
429.br 743.br
430$ firejail \-\-list 744$ firejail \-\-list
431.br 745.br
4323272:netblue:firejail \-\-private firefox 7463272:netblue::firejail \-\-private firefox
433.br 747.br
434$ firejail \-\-dns.print=3272 748$ firejail \-\-dns.print=3272
435 749
@@ -444,14 +758,7 @@ Example:
444$ firejail \-\-env=LD_LIBRARY_PATH=/opt/test/lib 758$ firejail \-\-env=LD_LIBRARY_PATH=/opt/test/lib
445 759
446.TP 760.TP
447\fB\-\-force 761\fB\-\-fs.print=name|pid
448By default, if Firejail is started in an existing sandbox, it will run the program in a bash shell.
449This option disables this behavior, and attempts to start Firejail in the existing sandbox.
450There could be lots of reasons for it to fail, for example if the existing sandbox disables
451admin capabilities, SUID binaries, or if it runs seccomp.
452
453.TP
454\fB\-\-fs.print=name|print
455Print the filesystem log for the sandbox identified by name or by PID. 762Print the filesystem log for the sandbox identified by name or by PID.
456.br 763.br
457 764
@@ -468,47 +775,15 @@ Example:
468.br 775.br
469$ firejail \-\-list 776$ firejail \-\-list
470.br 777.br
4713272:netblue:firejail \-\-private firefox 7783272:netblue::firejail \-\-private firefox
472.br 779.br
473$ firejail \-\-fs.print=3272 780$ firejail \-\-fs.print=3272
474 781
782#ifdef HAVE_FILE_TRANSFER
475.TP 783.TP
476\fB\-\-get=name|pid filename 784\fB\-\-get=name|pid filename
477Get a file from sandbox container, see \fBFILE TRANSFER\fR section for more details. 785Get a file from sandbox container, see \fBFILE TRANSFER\fR section for more details.
478 786#endif
479
480.TP
481\fB\-\-git-install
482Download, compile and install mainline git version of Firejail from the official repository on GitHub.
483The software is installed in /usr/local/bin, and takes precedence over the (old) version
484installed in /usr/bin. If for any reason the new version doesn't work, the user can uninstall it
485using \-\-git-uninstall command and revert to the old version.
486.br
487
488.br
489Prerequisites: git and compile support are required for this command to work. On Debian/Ubuntu
490systems this support is installed using "sudo apt-get install build-essential git".
491.br
492
493.br
494Example:
495.br
496
497.br
498$ firejail \-\-git-install
499
500.TP
501\fB\-\-git-uninstall
502Remove the Firejail version previously installed in /usr/local/bin using \-\-git-install command.
503.br
504
505.br
506Example:
507.br
508
509.br
510$ firejail \-\-git-uninstall
511
512.TP 787.TP
513\fB\-?\fR, \fB\-\-help\fR 788\fB\-?\fR, \fB\-\-help\fR
514Print options end exit. 789Print options end exit.
@@ -543,8 +818,23 @@ Ignore command in profile file.
543Example: 818Example:
544.br 819.br
545$ firejail \-\-ignore=shell --ignore=seccomp firefox 820$ firejail \-\-ignore=shell --ignore=seccomp firefox
821#ifdef HAVE_NETWORK
822.br
823$ firejail \-\-ignore="net eth0" firefox
824#endif
546 825
547.TP 826.TP
827\fB\-\-\include=file.profile
828Include a profile file before the regular profiles are used.
829.br
830
831.br
832Example:
833.br
834$ firejail --include=/etc/firejail/disable-devel.inc gedit
835
836#ifdef HAVE_NETWORK
837.TP
548\fB\-\-interface=interface 838\fB\-\-interface=interface
549Move interface in a new network namespace. Up to four --interface options can be specified. 839Move interface in a new network namespace. Up to four --interface options can be specified.
550Note: wlan devices are not supported for this option. 840Note: wlan devices are not supported for this option.
@@ -584,6 +874,31 @@ If the corresponding interface doesn't have an IP address configured, this
584option is enabled by default. 874option is enabled by default.
585 875
586.TP 876.TP
877\fB\-\-ip=dhcp
878Acquire an IP address and default gateway for the last interface defined by a
879\-\-net option, as well as set the DNS servers according to the DHCP response.
880This option requires the ISC dhclient DHCP client to be installed and will start
881it automatically inside the sandbox.
882.br
883
884.br
885Example:
886.br
887$ firejail \-\-net=br0 \-\-ip=dhcp
888.br
889
890.br
891This option should not be used in conjunction with the \-\-dns option if the
892DHCP server is set to configure DNS servers for the clients, because the
893manually specified DNS servers will be overwritten.
894
895.br
896The DHCP client will NOT release the DHCP lease when the sandbox terminates.
897If your DHCP server requires leases to be explicitly released, consider running
898a DHCP client and releasing the lease manually in conjunction with the
899\-\-net=none option.
900
901.TP
587\fB\-\-ip6=address 902\fB\-\-ip6=address
588Assign IPv6 addresses to the last network interface defined by a \-\-net option. 903Assign IPv6 addresses to the last network interface defined by a \-\-net option.
589.br 904.br
@@ -596,6 +911,30 @@ $ firejail \-\-net=eth0 \-\-ip6=2001:0db8:0:f101::1/64 firefox
596Note: you don't need this option if you obtain your ip6 address from router via SLAAC (your ip6 address and default route will be configured by kernel automatically). 911Note: you don't need this option if you obtain your ip6 address from router via SLAAC (your ip6 address and default route will be configured by kernel automatically).
597 912
598.TP 913.TP
914\fB\-\-ip6=dhcp
915Acquire an IPv6 address and default gateway for the last interface defined by a
916\-\-net option, as well as set the DNS servers according to the DHCP response.
917This option requires the ISC dhclient DHCP client to be installed and will start
918it automatically inside the sandbox.
919.br
920
921.br
922Example:
923.br
924$ firejail \-\-net=br0 \-\-ip6=dhcp
925.br
926
927.br
928This option should not be used in conjunction with the \-\-dns option if the
929DHCP server is set to configure DNS servers for the clients, because the
930manually specified DNS servers will be overwritten.
931
932.br
933The DHCP client will NOT release the DHCP lease when the sandbox terminates.
934If your DHCP server requires leases to be explicitly released, consider running
935a DHCP client and releasing the lease manually.
936
937.TP
599\fB\-\-iprange=address,address 938\fB\-\-iprange=address,address
600Assign an IP address in the provided range to the last network interface defined by a \-\-net option. A 939Assign an IP address in the provided range to the last network interface defined by a \-\-net option. A
601default gateway is assigned by default. 940default gateway is assigned by default.
@@ -616,6 +955,7 @@ for sandboxes started as root.
616Example: 955Example:
617.br 956.br
618$ firejail \-\-ipc-namespace firefox 957$ firejail \-\-ipc-namespace firefox
958#endif
619.TP 959.TP
620\fB\-\-join=name|pid 960\fB\-\-join=name|pid
621Join the sandbox identified by name or by PID. By default a /bin/bash shell is started after joining the sandbox. 961Join the sandbox identified by name or by PID. By default a /bin/bash shell is started after joining the sandbox.
@@ -638,7 +978,7 @@ Example:
638.br 978.br
639$ firejail \-\-list 979$ firejail \-\-list
640.br 980.br
6413272:netblue:firejail \-\-private firefox 9813272:netblue::firejail \-\-private firefox
642.br 982.br
643$ firejail \-\-join=3272 983$ firejail \-\-join=3272
644 984
@@ -647,9 +987,9 @@ $ firejail \-\-join=3272
647Join the mount namespace of the sandbox identified by name or PID. By default a /bin/bash shell is started after joining the sandbox. 987Join the mount namespace of the sandbox identified by name or PID. By default a /bin/bash shell is started after joining the sandbox.
648If a program is specified, the program is run in the sandbox. This command is available only to root user. 988If a program is specified, the program is run in the sandbox. This command is available only to root user.
649Security filters, cgroups and cpus configurations are not applied to the process joining the sandbox. 989Security filters, cgroups and cpus configurations are not applied to the process joining the sandbox.
650 990#ifdef HAVE_NETWORK
651.TP 991.TP
652\fB\-\-join-network=name|PID 992\fB\-\-join-network=name|pid
653Join the network namespace of the sandbox identified by name. By default a /bin/bash shell is started after joining the sandbox. 993Join the network namespace of the sandbox identified by name. By default a /bin/bash shell is started after joining the sandbox.
654If a program is specified, the program is run in the sandbox. This command is available only to root user. 994If a program is specified, the program is run in the sandbox. This command is available only to root user.
655Security filters, cgroups and cpus configurations are not applied to the process joining the sandbox. Example: 995Security filters, cgroups and cpus configurations are not applied to the process joining the sandbox. Example:
@@ -703,7 +1043,7 @@ Switching to pid 1932, the first child process inside the sandbox
703 inet6 fe80::7458:14ff:fe42:78e4/64 scope link 1043 inet6 fe80::7458:14ff:fe42:78e4/64 scope link
704.br 1044.br
705 valid_lft forever preferred_lft forever 1045 valid_lft forever preferred_lft forever
706 1046#endif
707.TP 1047.TP
708\fB\-\-join-or-start=name 1048\fB\-\-join-or-start=name
709Join the sandbox identified by name or start a new one. 1049Join the sandbox identified by name or start a new one.
@@ -712,8 +1052,35 @@ Same as "firejail --join=name" if sandbox with specified name exists, otherwise
712Note that in contrary to other join options there is respective profile option. 1052Note that in contrary to other join options there is respective profile option.
713 1053
714.TP 1054.TP
715\fB\-\-ls=name|pid dir_or_filename 1055\fB\-\-keep-config-pulse
716List files in sandbox container, see \fBFILE TRANSFER\fR section for more details. 1056Disable automatic ~/.config/pulse init, for complex setups such as remote
1057pulse servers or non-standard socket paths.
1058.br
1059
1060.br
1061Example:
1062.br
1063$ firejail \-\-keep-config-pulse firefox
1064
1065.TP
1066\fB\-\-keep-dev-shm
1067/dev/shm directory is untouched (even with --private-dev)
1068.br
1069
1070.br
1071Example:
1072.br
1073$ firejail --keep-dev-shm --private-dev
1074
1075.TP
1076\fB\-\-keep-var-tmp
1077/var/tmp directory is untouched.
1078.br
1079
1080.br
1081Example:
1082.br
1083$ firejail --keep-var-tmp
717 1084
718.TP 1085.TP
719\fB\-\-list 1086\fB\-\-list
@@ -725,26 +1092,37 @@ Example:
725.br 1092.br
726$ firejail \-\-list 1093$ firejail \-\-list
727.br 1094.br
7287015:netblue:firejail firefox 10957015:netblue:browser:firejail firefox
1096#ifdef HAVE_NETWORK
729.br 1097.br
7307056:netblue:firejail \-\-net=eth0 transmission-gtk 10987056:netblue:torrent:firejail \-\-net=eth0 transmission-gtk
1099#endif
1100#ifdef HAVE_USERNS
731.br 1101.br
7327064:netblue:firejail \-\-noroot xterm 11027064:netblue::firejail \-\-noroot xterm
733.br 1103.br
734$ 1104#endif
1105#ifdef HAVE_FILE_TRANSFER
1106.TP
1107\fB\-\-ls=name|pid dir_or_filename
1108List files in sandbox container, see \fBFILE TRANSFER\fR section for more details.
1109#endif
1110#ifdef HAVE_NETWORK
735.TP 1111.TP
736\fB\-\-mac=address 1112\fB\-\-mac=address
737Assign MAC addresses to the last network interface defined by a \-\-net option. 1113Assign MAC addresses to the last network interface defined by a \-\-net option. This option
1114is not supported for wireless interfaces.
738.br 1115.br
739 1116
740.br 1117.br
741Example: 1118Example:
742.br 1119.br
743$ firejail \-\-net=eth0 \-\-mac=00:11:22:33:44:55 firefox 1120$ firejail \-\-net=eth0 \-\-mac=00:11:22:33:44:55 firefox
744 1121#endif
745.TP 1122.TP
746\fB\-\-machine-id 1123\fB\-\-machine-id
747Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox. 1124Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox.
1125Note that this breaks audio support. Enable it when sound is not required.
748.br 1126.br
749 1127
750.br 1128.br
@@ -753,19 +1131,40 @@ Example:
753$ firejail \-\-machine-id 1131$ firejail \-\-machine-id
754 1132
755.TP 1133.TP
1134\fB\-\-mkdir=dirname
1135Create a directory in user home. Parent directories are created as needed.
1136.br
1137
1138.br
1139Example:
1140.br
1141$ firejail --mkdir=~/work/project
1142
1143.TP
1144\fB\-\-mkfile=filename
1145Create an empty file in user home.
1146.br
1147
1148.br
1149Example:
1150.br
1151$ firejail --mkfile=~/work/project/readme
1152
1153.TP
756\fB\-\-memory-deny-write-execute 1154\fB\-\-memory-deny-write-execute
757Install a seccomp filter to block attempts to create memory mappings 1155Install a seccomp filter to block attempts to create memory mappings
758that are both writable and executable, to change mappings to be 1156that are both writable and executable, to change mappings to be
759executable, or to create executable shared memory. The filter examines 1157executable, or to create executable shared memory. The filter examines
760the arguments of mmap, mmap2, mprotect and shmat system calls 1158the arguments of mmap, mmap2, mprotect, pkey_mprotect, memfd_create
761and kills the process if necessary. 1159and shmat system calls and returns error EPERM to the process (or
1160kills it or log the attempt, see \-\-seccomp-error-action below) if necessary.
762.br 1161.br
763 1162
764.br 1163.br
765Note: shmat is not implemented 1164Note: shmat is not implemented
766as a system call on some platforms including i386, and it cannot be 1165as a system call on some platforms including i386, and it cannot be
767handled by seccomp-bpf. 1166handled by seccomp-bpf.
768 1167#ifdef HAVE_NETWORK
769.TP 1168.TP
770\fB\-\-mtu=number 1169\fB\-\-mtu=number
771Assign a MTU value to the last network interface defined by a \-\-net option. 1170Assign a MTU value to the last network interface defined by a \-\-net option.
@@ -775,25 +1174,39 @@ Assign a MTU value to the last network interface defined by a \-\-net option.
775Example: 1174Example:
776.br 1175.br
777$ firejail \-\-net=eth0 \-\-mtu=1492 1176$ firejail \-\-net=eth0 \-\-mtu=1492
778 1177#endif
779.TP 1178.TP
780\fB\-\-name=name 1179\fB\-\-name=name
781Set sandbox name. Several options, such as \-\-join and \-\-shutdown, can use 1180Set sandbox name. Several options, such as \-\-join and \-\-shutdown, can use
782this name to identify a sandbox. 1181this name to identify a sandbox.
1182
1183In case the name supplied by the user is already in use by another sandbox, Firejail will assign a
1184new name as "name-PID", where PID is the process ID of the sandbox. This functionality
1185can be disabled at run time in /etc/firejail/firejail.config file, by setting "name-change" flag to "no".
783.br 1186.br
784 1187
785.br 1188.br
786Example: 1189Example:
787.br 1190.br
788$ firejail \-\-name=mybrowser firefox 1191$ firejail \-\-name=browser firefox &
789 1192.br
1193$ firejail \-\-name=browser \-\-private \
1194firefox \-\-no-remote &
1195.br
1196$ firejail --list
1197.br
11981198:netblue:browser:firejail --name=browser firefox
1199.br
12001312:netblue:browser-1312:firejail --name=browser --private firefox --no-remote
1201.br
1202#ifdef HAVE_NETWORK
790.TP 1203.TP
791\fB\-\-net=bridge_interface 1204\fB\-\-net=bridge_interface
792Enable a new network namespace and connect it to this bridge interface. 1205Enable a new network namespace and connect it to this bridge interface.
793Unless specified with option \-\-ip and \-\-defaultgw, an IP address and a default gateway will be assigned 1206Unless specified with option \-\-ip and \-\-defaultgw, an IP address and a default gateway will be assigned
794automatically to the sandbox. The IP address is verified using ARP before assignment. The address 1207automatically to the sandbox. The IP address is verified using ARP before assignment. The address
795configured as default gateway is the bridge device IP address. Up to four \-\-net 1208configured as default gateway is the bridge device IP address. Up to four \-\-net
796bridge devices can be defined. Mixing bridge and macvlan devices is allowed. 1209options can be specified.
797.br 1210.br
798 1211
799.br 1212.br
@@ -810,23 +1223,24 @@ $ sudo ifconfig br1 10.10.30.1/24
810$ firejail \-\-net=br0 \-\-net=br1 1223$ firejail \-\-net=br0 \-\-net=br1
811 1224
812.TP 1225.TP
813\fB\-\-net=ethernet_interface 1226\fB\-\-net=ethernet_interface|wireless_interface
814Enable a new network namespace and connect it 1227Enable a new network namespace and connect it
815to this ethernet interface using the standard Linux macvlan 1228to this ethernet interface using the standard Linux macvlan|ipvaln
816driver. Unless specified with option \-\-ip and \-\-defaultgw, an 1229driver. Unless specified with option \-\-ip and \-\-defaultgw, an
817IP address and a default gateway will be assigned automatically 1230IP address and a default gateway will be assigned automatically
818to the sandbox. The IP address is verified using ARP before 1231to the sandbox. The IP address is verified using ARP before
819assignment. The address configured as default gateway is the 1232assignment. The address configured as default gateway is the
820default gateway of the host. Up to four \-\-net devices can 1233default gateway of the host. Up to four \-\-net options can be specified.
821be defined. Mixing bridge and macvlan devices is allowed. 1234Support for ipvlan driver was introduced in Linux kernel 3.19.
822Note: wlan devices are not supported for this option.
823.br 1235.br
824 1236
825.br 1237.br
826Example: 1238Example:
827.br 1239.br
828$ firejail \-\-net=eth0 \-\-ip=192.168.1.80 \-\-dns=8.8.8.8 firefox 1240$ firejail \-\-net=eth0 \-\-ip=192.168.1.80 \-\-dns=8.8.8.8 firefox
829 1241.br
1242$ firejail \-\-net=wlan0 firefox
1243#endif
830.TP 1244.TP
831\fB\-\-net=none 1245\fB\-\-net=none
832Enable a new, unconnected network namespace. The only interface 1246Enable a new, unconnected network namespace. The only interface
@@ -844,18 +1258,47 @@ $ firejail \-\-net=none vlc
844.br 1258.br
845Note: \-\-net=none can crash the application on some platforms. 1259Note: \-\-net=none can crash the application on some platforms.
846In these cases, it can be replaced with \-\-protocol=unix. 1260In these cases, it can be replaced with \-\-protocol=unix.
1261#ifdef HAVE_NETWORK
1262.TP
1263\fB\-\-net=tap_interface
1264Enable a new network namespace and connect it
1265to this ethernet tap interface using the standard Linux macvlan
1266driver. If the tap interface is not configured, the sandbox
1267will not try to configure the interface inside the sandbox.
1268Please use \-\-ip, \-\-netmask and \-\-defaultgw to specify the configuration.
1269.br
1270
1271.br
1272Example:
1273.br
1274$ firejail \-\-net=tap0 \-\-ip=10.10.20.80 \-\-netmask=255.255.255.0 \-\-defaultgw=10.10.20.1 firefox
847 1275
848.TP 1276.TP
849\fB\-\-netns=name 1277\fB\-\-net.print=name|pid
850Run the program in a named, persistent network namespace. These can 1278If a new network namespace is enabled, print network interface configuration for the sandbox specified by name or PID. Example:
851be created and configured using "ip netns". 1279.br
1280
1281.br
1282$ firejail --net.print=browser
1283.br
1284Switching to pid 1853, the first child process inside the sandbox
1285.br
1286Interface MAC IP Mask Status
1287.br
1288lo 127.0.0.1 255.0.0.0 UP
1289.br
1290eth0-1852 5e:fb:8e:27:29:26 192.168.1.186 255.255.255.0 UP
1291.br
852 1292
853.TP 1293.TP
854\fB\-\-netfilter 1294\fB\-\-netfilter
855Enable a default client network filter in the new network namespace. 1295Enable a default firewall if a new network namespace is created inside the sandbox.
856New network namespaces are created using \-\-net option. If a new network namespaces is not created, 1296This option has no effect for sandboxes using the system network namespace.
857\-\-netfilter option does nothing. 1297.br
858The default filter is as follows: 1298
1299.br
1300The default firewall is optimized for regular desktop applications. No incoming
1301connections are accepted:
859.br 1302.br
860 1303
861.br 1304.br
@@ -898,19 +1341,18 @@ Example:
898$ firejail \-\-net=eth0 \-\-netfilter firefox 1341$ firejail \-\-net=eth0 \-\-netfilter firefox
899.TP 1342.TP
900\fB\-\-netfilter=filename 1343\fB\-\-netfilter=filename
901Enable the network filter specified by filename in the new network namespace. The filter file format 1344Enable the firewall specified by filename if a new network namespace is created inside the sandbox.
902is the format of iptables-save and iptable-restore commands. 1345This option has no effect for sandboxes using the system network namespace.
903New network namespaces are created using \-\-net option. If a new network namespaces is not created,
904\-\-netfilter option does nothing.
905.br 1346.br
906 1347
907.br 1348.br
908The following filters are available in /etc/firejail directory: 1349Please use the regular iptables-save/iptables-restore format for the filter file. The following
1350examples are available in /etc/firejail directory:
909.br 1351.br
910 1352
911.br 1353.br
912.B webserver.net 1354.B webserver.net
913is a webserver filter that allows access only to TCP ports 80 and 443. 1355is a webserver firewall that allows access only to TCP ports 80 and 443.
914Example: 1356Example:
915.br 1357.br
916 1358
@@ -921,20 +1363,74 @@ $ firejail --netfilter=/etc/firejail/webserver.net --net=eth0 \\
921.br 1363.br
922 1364
923.br 1365.br
924.B nolocal.net 1366.B nolocal.net/nolocal6.net
925is a client filter that disable access to local network. Example: 1367is a desktop client firewall that disable access to local network. Example:
926.br 1368.br
927 1369
928.br 1370.br
929$ firejail --netfilter=/etc/firejail/nolocal.net \\ 1371$ firejail --netfilter=/etc/firejail/nolocal.net \\
930.br 1372.br
931--net=eth0 firefox 1373--net=eth0 firefox
1374
1375.TP
1376\fB\-\-netfilter=filename,arg1,arg2,arg3 ...
1377This is the template version of the previous command. $ARG1, $ARG2, $ARG3 ... in the firewall script
1378are replaced with arg1, arg2, arg3 ... passed on the command line. Up to 16 arguments are supported.
1379Example:
1380.br
1381
1382.br
1383$ firejail --net=eth0 --ip=192.168.1.105 \\
1384.br
1385--netfilter=/etc/firejail/tcpserver.net,5001 server-program
1386.br
1387
1388.TP
1389\fB\-\-netfilter.print=name|pid
1390Print the firewall installed in the sandbox specified by name or PID. Example:
1391.br
1392
1393.br
1394$ firejail --name=browser --net=eth0 --netfilter firefox &
1395.br
1396$ firejail --netfilter.print=browser
1397
932.TP 1398.TP
933\fB\-\-netfilter6=filename 1399\fB\-\-netfilter6=filename
934Enable the IPv6 network filter specified by filename in the new network namespace. The filter file format 1400Enable the IPv6 firewall specified by filename if a new network namespace is created inside the sandbox.
935is the format of ip6tables-save and ip6table-restore commands. 1401This option has no effect for sandboxes using the system network namespace.
936New network namespaces are created using \-\-net option. If a new network namespaces is not created, 1402Please use the regular iptables-save/iptables-restore format for the filter file.
937\-\-netfilter6 option does nothing. 1403
1404.TP
1405\fB\-\-netfilter6.print=name|pid
1406Print the IPv6 firewall installed in the sandbox specified by name or PID. Example:
1407.br
1408
1409.br
1410$ firejail --name=browser --net=eth0 --netfilter firefox &
1411.br
1412$ firejail --netfilter6.print=browser
1413
1414.TP
1415\fB\-\-netmask=address
1416Use this option when you want to assign an IP address in a new namespace and
1417the parent interface specified by --net is not configured. An IP address and
1418a default gateway address also have to be added. By default the new namespace
1419interface comes without IP address and default gateway configured. Example:
1420.br
1421
1422.br
1423$ sudo /sbin/brctl addbr br0
1424.br
1425$ sudo /sbin/ifconfig br0 up
1426.br
1427$ firejail --ip=10.10.20.67 --netmask=255.255.255.0 --defaultgw=10.10.20.1
1428
1429.TP
1430\fB\-\-netns=name
1431Run the program in a named, persistent network namespace. These can
1432be created and configured using "ip netns".
1433
938.TP 1434.TP
939\fB\-\-netstats 1435\fB\-\-netstats
940Monitor network namespace statistics, see \fBMONITORING\fR section for more details. 1436Monitor network namespace statistics, see \fBMONITORING\fR section for more details.
@@ -952,7 +1448,7 @@ PID User RX(KB/s) TX(KB/s) Command
9521294 netblue 53.355 1.473 firejail \-\-net=eth0 firefox 14481294 netblue 53.355 1.473 firejail \-\-net=eth0 firefox
953.br 1449.br
9547383 netblue 9.045 0.112 firejail \-\-net=eth0 transmission 14507383 netblue 9.045 0.112 firejail \-\-net=eth0 transmission
955 1451#endif
956.TP 1452.TP
957\fB\-\-nice=value 1453\fB\-\-nice=value
958Set nice value for all processes running inside the sandbox. 1454Set nice value for all processes running inside the sandbox.
@@ -975,6 +1471,10 @@ Example:
975$ firejail --no3d firefox 1471$ firejail --no3d firefox
976 1472
977.TP 1473.TP
1474\fB\-\-noautopulse \fR(deprecated)
1475See --keep-config-pulse.
1476
1477.TP
978\fB\-\-noblacklist=dirname_or_filename 1478\fB\-\-noblacklist=dirname_or_filename
979Disable blacklist for this directory or file. 1479Disable blacklist for this directory or file.
980.br 1480.br
@@ -999,6 +1499,17 @@ $ nc dict.org 2628
999220 pan.alephnull.com dictd 1.12.1/rf on Linux 3.14-1-amd64 1499220 pan.alephnull.com dictd 1.12.1/rf on Linux 3.14-1-amd64
1000.br 1500.br
1001.TP 1501.TP
1502\fB\-\-nodbus \fR(deprecated)
1503#ifdef HAVE_DBUSPROXY
1504Disable D-Bus access (both system and session buses). Equivalent to --dbus-system=none --dbus-user=none.
1505.br
1506
1507.br
1508Example:
1509.br
1510$ firejail \-\-nodbus \-\-net=none
1511#endif
1512.TP
1002\fB\-\-nodvd 1513\fB\-\-nodvd
1003Disable DVD and audio CD devices. 1514Disable DVD and audio CD devices.
1004.br 1515.br
@@ -1008,8 +1519,17 @@ Example:
1008.br 1519.br
1009$ firejail \-\-nodvd 1520$ firejail \-\-nodvd
1010.TP 1521.TP
1522\fB\-\-noinput
1523Disable input devices.
1524.br
1525
1526.br
1527Example:
1528.br
1529$ firejail \-\-noinput
1530.TP
1011\fB\-\-noexec=dirname_or_filename 1531\fB\-\-noexec=dirname_or_filename
1012Remount directory or file noexec, nodev and nosuid. 1532Remount directory or file noexec, nodev and nosuid. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
1013.br 1533.br
1014 1534
1015.br 1535.br
@@ -1019,8 +1539,7 @@ $ firejail \-\-noexec=/tmp
1019.br 1539.br
1020 1540
1021.br 1541.br
1022/etc and /var are noexec by default if the sandbox was started as a regular user. If there are more than one mount operation 1542/etc and /var are noexec by default if the sandbox was started as a regular user.
1023on the path of the file or directory, noexec should be applied to the last one. Always check if the change took effect inside the sandbox.
1024 1543
1025.TP 1544.TP
1026\fB\-\-nogroups 1545\fB\-\-nogroups
@@ -1053,6 +1572,14 @@ uid=1000(netblue) gid=1000(netblue) groups=1000(netblue)
1053$ 1572$
1054 1573
1055.TP 1574.TP
1575\fB\-\-nonewprivs
1576Sets the NO_NEW_PRIVS prctl. This ensures that child processes
1577cannot acquire new privileges using execve(2); in particular,
1578this means that calling a suid binary (or one with file capabilities)
1579does not result in an increase of privilege. This option
1580is enabled by default if seccomp filter is activated.
1581
1582.TP
1056\fB\-\-noprofile 1583\fB\-\-noprofile
1057Do not use a security profile. 1584Do not use a security profile.
1058.br 1585.br
@@ -1079,7 +1606,7 @@ Parent pid 8553, child pid 8554
1079Child process initialized 1606Child process initialized
1080.br 1607.br
1081[...] 1608[...]
1082 1609#ifdef HAVE_USERNS
1083.TP 1610.TP
1084\fB\-\-noroot 1611\fB\-\-noroot
1085Install a user namespace with a single user - the current user. 1612Install a user namespace with a single user - the current user.
@@ -1103,15 +1630,7 @@ $ ping google.com
1103ping: icmp open socket: Operation not permitted 1630ping: icmp open socket: Operation not permitted
1104.br 1631.br
1105$ 1632$
1106 1633#endif
1107.TP
1108\fB\-\-nonewprivs
1109Sets the NO_NEW_PRIVS prctl. This ensures that child processes
1110cannot acquire new privileges using execve(2); in particular,
1111this means that calling a suid binary (or one with file capabilities)
1112does not result in an increase of privilege. This option
1113is enabled by default if seccomp filter is activated.
1114
1115.TP 1634.TP
1116\fB\-\-nosound 1635\fB\-\-nosound
1117Disable sound system. 1636Disable sound system.
@@ -1133,6 +1652,16 @@ Example:
1133$ firejail \-\-notv vlc 1652$ firejail \-\-notv vlc
1134 1653
1135.TP 1654.TP
1655\fB\-\-nou2f
1656Disable U2F devices.
1657.br
1658
1659.br
1660Example:
1661.br
1662$ firejail \-\-nou2f
1663
1664.TP
1136\fB\-\-novideo 1665\fB\-\-novideo
1137Disable video devices. 1666Disable video devices.
1138.br 1667.br
@@ -1141,6 +1670,7 @@ Disable video devices.
1141\fB\-\-nowhitelist=dirname_or_filename 1670\fB\-\-nowhitelist=dirname_or_filename
1142Disable whitelist for this directory or file. 1671Disable whitelist for this directory or file.
1143 1672
1673#ifdef HAVE_OUTPUT
1144.TP 1674.TP
1145\fB\-\-output=logfile 1675\fB\-\-output=logfile
1146stdout logging and log rotation. Copy stdout to logfile, and keep the size of the file under 500KB using log 1676stdout logging and log rotation. Copy stdout to logfile, and keep the size of the file under 500KB using log
@@ -1171,12 +1701,15 @@ $ ls -l sandboxlog*
1171.TP 1701.TP
1172\fB\-\-output-stderr=logfile 1702\fB\-\-output-stderr=logfile
1173Similar to \-\-output, but stderr is also stored. 1703Similar to \-\-output, but stderr is also stored.
1704#endif
1174 1705
1706#ifdef HAVE_OVERLAYFS
1175.TP 1707.TP
1176\fB\-\-overlay 1708\fB\-\-overlay
1177Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container, 1709Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container,
1178the system directories are mounted read-write. All filesystem modifications go into the overlay. 1710the system directories are mounted read-write. All filesystem modifications go into the overlay.
1179The overlay is stored in $HOME/.firejail/<PID> directory. 1711Directories /run, /tmp and /dev are not covered by the overlay. The overlay is stored in $HOME/.firejail/<PID> directory.
1712If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
1180.br 1713.br
1181 1714
1182.br 1715.br
@@ -1191,11 +1724,22 @@ Example:
1191$ firejail \-\-overlay firefox 1724$ firejail \-\-overlay firefox
1192 1725
1193.TP 1726.TP
1727\fB\-\-overlay-clean
1728Clean all overlays stored in $HOME/.firejail directory.
1729.br
1730
1731.br
1732Example:
1733.br
1734$ firejail \-\-overlay-clean
1735
1736.TP
1194\fB\-\-overlay-named=name 1737\fB\-\-overlay-named=name
1195Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container, 1738Mount a filesystem overlay on top of the current filesystem. Unlike the regular filesystem container,
1196the system directories are mounted read-write. All filesystem modifications go into the overlay. 1739the system directories are mounted read-write. All filesystem modifications go into the overlay.
1197The overlay is stored in $HOME/.firejail/<NAME> directory. The created overlay can be reused between multiple 1740Directories /run, /tmp and /dev are not covered by the overlay. The overlay is stored in $HOME/.firejail/<NAME> directory.
1198sessions. 1741The created overlay can be reused between multiple sessions.
1742If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
1199.br 1743.br
1200 1744
1201.br 1745.br
@@ -1212,7 +1756,8 @@ $ firejail \-\-overlay-named=jail1 firefox
1212.TP 1756.TP
1213\fB\-\-overlay-tmpfs 1757\fB\-\-overlay-tmpfs
1214Mount a filesystem overlay on top of the current filesystem. All filesystem modifications 1758Mount a filesystem overlay on top of the current filesystem. All filesystem modifications
1215are discarded when the sandbox is closed. 1759are discarded when the sandbox is closed. Directories /run, /tmp and /dev are not covered by the overlay.
1760If the sandbox is started as a regular user, nonewprivs and a default capabilities filter are enabled.
1216.br 1761.br
1217 1762
1218.br 1763.br
@@ -1225,17 +1770,7 @@ This option is not available on Grsecurity systems.
1225Example: 1770Example:
1226.br 1771.br
1227$ firejail \-\-overlay-tmpfs firefox 1772$ firejail \-\-overlay-tmpfs firefox
1228 1773#endif
1229.TP
1230\fB\-\-overlay-clean
1231Clean all overlays stored in $HOME/.firejail directory.
1232.br
1233
1234.br
1235Example:
1236.br
1237$ firejail \-\-overlay-clean
1238
1239.TP 1774.TP
1240\fB\-\-private 1775\fB\-\-private
1241Mount new /root and /home/user directories in temporary 1776Mount new /root and /home/user directories in temporary
@@ -1247,9 +1782,11 @@ closed.
1247Example: 1782Example:
1248.br 1783.br
1249$ firejail \-\-private firefox 1784$ firejail \-\-private firefox
1785
1250.TP 1786.TP
1251\fB\-\-private=directory 1787\fB\-\-private=directory
1252Use directory as user home. 1788Use directory as user home.
1789--private and --private=directory cannot be used together.
1253.br 1790.br
1254 1791
1255.br 1792.br
@@ -1258,24 +1795,14 @@ Example:
1258$ firejail \-\-private=/home/netblue/firefox-home firefox 1795$ firejail \-\-private=/home/netblue/firefox-home firefox
1259 1796
1260.TP 1797.TP
1261\fB\-\-private-home=file,directory
1262Build a new user home in a temporary
1263filesystem, and copy the files and directories in the list in the
1264new home. All modifications are discarded when the sandbox is
1265closed.
1266.br
1267
1268.br
1269Example:
1270.br
1271$ firejail \-\-private-home=.mozilla firefox
1272
1273.TP
1274\fB\-\-private-bin=file,file 1798\fB\-\-private-bin=file,file
1275Build a new /bin in a temporary filesystem, and copy the programs in the list. 1799Build a new /bin in a temporary filesystem, and copy the programs in the list.
1276If no listed file is found, /bin directory will be empty. 1800The files in the list must be expressed as relative to the /bin,
1801/sbin, /usr/bin, /usr/sbin, or /usr/local/bin directories.
1802If no listed files are found, /bin directory will be empty.
1277The same directory is also bind-mounted over /sbin, /usr/bin, /usr/sbin and /usr/local/bin. 1803The same directory is also bind-mounted over /sbin, /usr/bin, /usr/sbin and /usr/local/bin.
1278All modifications are discarded when the sandbox is closed. 1804All modifications are discarded when the sandbox is closed. File globbing is supported,
1805see \fBFILE GLOBBING\fR section for more details.
1279.br 1806.br
1280 1807
1281.br 1808.br
@@ -1292,59 +1819,62 @@ $ ls /bin
1292bash cat ls sed 1819bash cat ls sed
1293 1820
1294.TP 1821.TP
1295\fB\-\-private-lib=file,directory 1822\fB\-\-private-cache
1296This feature is currently under heavy development. Only amd64 platforms are supported at this moment. 1823Mount an empty temporary filesystem on top of the .cache directory in user home. All
1297The idea is to build a new /lib in a temporary filesystem, 1824modifications are discarded when the sandbox is closed.
1298with only the library files necessary to run the application.
1299It could be as simple as:
1300.br 1825.br
1301 1826
1302.br 1827.br
1303$ firejail --private-lib galculator 1828Example:
1304.br 1829.br
1830$ firejail \-\-private-cache openbox
1305 1831
1832.TP
1833\fB\-\-private-cwd
1834Set working directory inside jail to the home directory, and failing that, the root directory.
1306.br 1835.br
1307but it gets complicated really fast: 1836Does not impact working directory of profile include paths.
1308.br 1837.br
1309 1838
1310.br 1839.br
1311$ firejail --private-lib=x86_64-linux-gnu/xed,x86_64-linux-gnu/gdk-pixbuf-2.0,libenchant.so.1,librsvg-2.so.2 xed 1840Example:
1312.br
1313
1314.br 1841.br
1315The feature is integrated with \-\-private-bin: 1842$ pwd
1316.br 1843.br
1317 1844/tmp
1318.br 1845.br
1319$ firejail --private-lib --private-bin=bash,ls,ps 1846$ firejail \-\-private-cwd
1320.br 1847.br
1321$ ls /lib 1848$ pwd
1322.br 1849.br
1323ld-linux-x86-64.so.2 libgpg-error.so.0 libprocps.so.6 libsystemd.so.0 1850/home/user
1324.br 1851.br
1325libc.so.6 liblz4.so.1 libpthread.so.0 libtinfo.so.5 1852
1853.TP
1854\fB\-\-private-cwd=directory
1855Set working directory inside the jail.
1326.br 1856.br
1327libdl.so.2 liblzma.so.5 librt.so.1 x86_64-linux-gnu 1857Does not impact working directory of profile include paths.
1328.br 1858.br
1329libgcrypt.so.20 libpcre.so.3 libselinux.so.1 1859
1330.br 1860.br
1331$ ps 1861Example:
1332.br 1862.br
1333 PID TTY TIME CMD 1863$ pwd
1334.br 1864.br
1335 1 pts/0 00:00:00 firejail 1865/tmp
1336.br 1866.br
1337 45 pts/0 00:00:00 bash 1867$ firejail \-\-private-cwd=/opt
1338.br 1868.br
1339 48 pts/0 00:00:00 ps 1869$ pwd
1340.br 1870.br
1341$ 1871/opt
1342.br 1872.br
1343 1873
1344
1345.TP 1874.TP
1346\fB\-\-private-dev 1875\fB\-\-private-dev
1347Create a new /dev directory. Only disc, dri, null, full, zero, tty, pts, ptmx, random, snd, urandom, video, log and shm devices are available. 1876Create a new /dev directory. Only disc, dri, dvb, hidraw, null, full, zero, tty, pts, ptmx, random, snd, urandom, video, log, shm and usb devices are available.
1877Use the options --no3d, --nodvd, --nosound, --notv, --nou2f and --novideo for additional restrictions.
1348.br 1878.br
1349 1879
1350.br 1880.br
@@ -1365,6 +1895,8 @@ $
1365\fB\-\-private-etc=file,directory 1895\fB\-\-private-etc=file,directory
1366Build a new /etc in a temporary 1896Build a new /etc in a temporary
1367filesystem, and copy the files and directories in the list. 1897filesystem, and copy the files and directories in the list.
1898The files and directories in the list must be expressed as relative to
1899the /etc directory (e.g., /etc/foo must be expressed as foo).
1368If no listed file is found, /etc directory will be empty. 1900If no listed file is found, /etc directory will be empty.
1369All modifications are discarded when the sandbox is closed. 1901All modifications are discarded when the sandbox is closed.
1370.br 1902.br
@@ -1375,11 +1907,83 @@ Example:
1375$ firejail --private-etc=group,hostname,localtime, \\ 1907$ firejail --private-etc=group,hostname,localtime, \\
1376.br 1908.br
1377nsswitch.conf,passwd,resolv.conf 1909nsswitch.conf,passwd,resolv.conf
1910#ifdef HAVE_PRIVATE_HOME
1911.TP
1912\fB\-\-private-home=file,directory
1913Build a new user home in a temporary
1914filesystem, and copy the files and directories in the list in the
1915new home.
1916The files and directories in the list must be expressed as relative to
1917the current user's home directory.
1918All modifications are discarded when the sandbox is
1919closed.
1920.br
1921
1922.br
1923Example:
1924.br
1925$ firejail \-\-private-home=.mozilla firefox
1926#endif
1927.TP
1928\fB\-\-private-lib=file,directory
1929This feature is currently under heavy development. Only amd64 platforms are supported at this moment.
1930The files and directories in the list must be expressed as relative to
1931the /lib directory.
1932The idea is to build a new /lib in a temporary filesystem,
1933with only the library files necessary to run the application.
1934It could be as simple as:
1935.br
1936
1937.br
1938$ firejail --private-lib galculator
1939.br
1940
1941.br
1942but it gets complicated really fast:
1943.br
1944
1945.br
1946$ firejail --private-lib=x86_64-linux-gnu/xed,x86_64-linux-gnu/gdk-pixbuf-2.0,libenchant.so.1,librsvg-2.so.2 xed
1947.br
1948
1949.br
1950The feature is integrated with \-\-private-bin:
1951.br
1952
1953.br
1954$ firejail --private-lib --private-bin=bash,ls,ps
1955.br
1956$ ls /lib
1957.br
1958ld-linux-x86-64.so.2 libgpg-error.so.0 libprocps.so.6 libsystemd.so.0
1959.br
1960libc.so.6 liblz4.so.1 libpthread.so.0 libtinfo.so.5
1961.br
1962libdl.so.2 liblzma.so.5 librt.so.1 x86_64-linux-gnu
1963.br
1964libgcrypt.so.20 libpcre.so.3 libselinux.so.1
1965.br
1966$ ps
1967.br
1968 PID TTY TIME CMD
1969.br
1970 1 pts/0 00:00:00 firejail
1971.br
1972 45 pts/0 00:00:00 bash
1973.br
1974 48 pts/0 00:00:00 ps
1975.br
1976$
1977.br
1378 1978
1379.TP 1979.TP
1380\fB\-\-private-opt=file,directory 1980\fB\-\-private-opt=file,directory
1381Build a new /opt in a temporary 1981Build a new /opt in a temporary
1382filesystem, and copy the files and directories in the list. 1982filesystem, and copy the files and directories in the list.
1983The files and directories in the list must be expressed as relative to
1984the /opt directory, and must not contain the / character
1985(e.g., /opt/foo must be expressed as foo, but /opt/foo/bar --
1986expressed as foo/bar -- is disallowed).
1383If no listed file is found, /opt directory will be empty. 1987If no listed file is found, /opt directory will be empty.
1384All modifications are discarded when the sandbox is closed. 1988All modifications are discarded when the sandbox is closed.
1385.br 1989.br
@@ -1393,6 +1997,10 @@ $ firejail --private-opt=firefox /opt/firefox/firefox
1393\fB\-\-private-srv=file,directory 1997\fB\-\-private-srv=file,directory
1394Build a new /srv in a temporary 1998Build a new /srv in a temporary
1395filesystem, and copy the files and directories in the list. 1999filesystem, and copy the files and directories in the list.
2000The files and directories in the list must be expressed as relative to
2001the /srv directory, and must not contain the / character
2002(e.g., /srv/foo must be expressed as foo, but /srv/foo/bar --
2003expressed as srv/bar -- is disallowed).
1396If no listed file is found, /srv directory will be empty. 2004If no listed file is found, /srv directory will be empty.
1397All modifications are discarded when the sandbox is closed. 2005All modifications are discarded when the sandbox is closed.
1398.br 2006.br
@@ -1423,9 +2031,8 @@ drwx------ 2 nobody nogroup 4096 Apr 30 10:52 pulse-PKdhtXMmr18n
1423drwxrwxrwt 2 nobody nogroup 4096 Apr 30 10:52 .X11-unix 2031drwxrwxrwt 2 nobody nogroup 4096 Apr 30 10:52 .X11-unix
1424.br 2032.br
1425 2033
1426
1427.TP 2034.TP
1428\fB\-\-profile=filename 2035\fB\-\-profile=filename_or_profilename
1429Load a custom security profile from filename. For filename use an absolute path or a path relative to the current path. 2036Load a custom security profile from filename. For filename use an absolute path or a path relative to the current path.
1430For more information, see \fBSECURITY PROFILES\fR section below. 2037For more information, see \fBSECURITY PROFILES\fR section below.
1431.br 2038.br
@@ -1447,25 +2054,10 @@ $ firejail \-\-profile.print=browser
1447.br 2054.br
1448/etc/firejail/firefox.profile 2055/etc/firejail/firefox.profile
1449.br 2056.br
1450
1451.TP
1452\fB\-\-profile-path=directory
1453Use this directory to look for profile files. Use an absolute path or a path in the home directory starting with ~/.
1454For more information, see \fBSECURITY PROFILES\fR section below and \fBRELOCATING PROFILE FILES\fR in
1455\fBman 5 firejail-profile\fR.
1456.br
1457
1458.br
1459Example:
1460.br
1461$ firejail \-\-profile-path=~/myprofiles
1462.br
1463$ firejail \-\-profile-path=/home/netblue/myprofiles
1464
1465.TP 2057.TP
1466\fB\-\-protocol=protocol,protocol,protocol 2058\fB\-\-protocol=protocol,protocol,protocol
1467Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call. 2059Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call.
1468Recognized values: unix, inet, inet6, netlink and packet. This option is not supported for i386 architecture. 2060Recognized values: unix, inet, inet6, netlink, packet and bluetooth. This option is not supported for i386 architecture.
1469.br 2061.br
1470 2062
1471.br 2063.br
@@ -1492,20 +2084,26 @@ Example:
1492.br 2084.br
1493$ firejail \-\-list 2085$ firejail \-\-list
1494.br 2086.br
14953272:netblue:firejail \-\-private firefox 20873272:netblue::firejail \-\-private firefox
1496.br 2088.br
1497$ firejail \-\-protocol.print=3272 2089$ firejail \-\-protocol.print=3272
1498.br 2090.br
1499unix,inet,inet6,netlink 2091unix,inet,inet6,netlink
2092#ifdef HAVE_FILE_TRANSFER
1500.TP 2093.TP
1501\fB\-\-put=name|pid src-filename dest-filename 2094\fB\-\-put=name|pid src-filename dest-filename
1502Put a file in sandbox container, see \fBFILE TRANSFER\fR section for more details. 2095Put a file in sandbox container, see \fBFILE TRANSFER\fR section for more details.
2096#endif
1503.TP 2097.TP
1504\fB\-\-quiet 2098\fB\-\-quiet
1505Turn off Firejail's output. 2099Turn off Firejail's output.
2100.br
2101
2102.br
2103The same effect can be obtained by setting an environment variable FIREJAIL_QUIET to yes.
1506.TP 2104.TP
1507\fB\-\-read-only=dirname_or_filename 2105\fB\-\-read-only=dirname_or_filename
1508Set directory or file read-only. 2106Set directory or file read-only. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
1509.br 2107.br
1510 2108
1511.br 2109.br
@@ -1513,20 +2111,11 @@ Example:
1513.br 2111.br
1514$ firejail \-\-read-only=~/.mozilla firefox 2112$ firejail \-\-read-only=~/.mozilla firefox
1515.br 2113.br
1516
1517.br
1518A short note about mixing \-\-whitelist and \-\-read-only options. Whitelisted directories
1519should be made read-only independently. Making a parent directory read-only, will not
1520make the whitelist read-only. Example:
1521.br
1522
1523.br
1524$ firejail --whitelist=~/work --read-only=~ --read-only=~/work
1525
1526.TP 2114.TP
1527\fB\-\-read-write=dirname_or_filename 2115\fB\-\-read-write=dirname_or_filename
1528Set directory or file read-write. Only files or directories belonging to the current user are allowed for 2116Set directory or file read-write. Only files or directories belonging to the current user are allowed for
1529this operation. Example: 2117this operation. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
2118Example:
1530.br 2119.br
1531 2120
1532.br 2121.br
@@ -1538,8 +2127,23 @@ $ firejail --read-only=~/test --read-write=~/test/a
1538 2127
1539 2128
1540.TP 2129.TP
2130\fB\-\-rlimit-as=number
2131Set the maximum size of the process's virtual memory (address space) in bytes.
2132Use k(ilobyte), m(egabyte) or g(igabyte) for size suffix (base 1024).
2133
2134.TP
2135\fB\-\-rlimit-cpu=number
2136Set the maximum limit, in seconds, for the amount of CPU time each
2137sandboxed process can consume. When the limit is reached, the processes are killed.
2138
2139The CPU limit is a limit on CPU seconds rather than elapsed time. CPU seconds is basically how many seconds
2140the CPU has been in use and does not necessarily directly relate to the elapsed time. Linux kernel keeps
2141track of CPU seconds for each process independently.
2142
2143.TP
1541\fB\-\-rlimit-fsize=number 2144\fB\-\-rlimit-fsize=number
1542Set the maximum file size that can be created by a process. 2145Set the maximum file size that can be created by a process.
2146Use k(ilobyte), m(egabyte) or g(igabyte) for size suffix (base 1024).
1543.TP 2147.TP
1544\fB\-\-rlimit-nofile=number 2148\fB\-\-rlimit-nofile=number
1545Set the maximum number of files that can be opened by a process. 2149Set the maximum number of files that can be opened by a process.
@@ -1559,7 +2163,7 @@ Remove environment variable in the new sandbox.
1559Example: 2163Example:
1560.br 2164.br
1561$ firejail \-\-rmenv=DBUS_SESSION_BUS_ADDRESS 2165$ firejail \-\-rmenv=DBUS_SESSION_BUS_ADDRESS
1562 2166#ifdef HAVE_NETWORK
1563.TP 2167.TP
1564\fB\-\-scan 2168\fB\-\-scan
1565ARP-scan all the networks from inside a network namespace. 2169ARP-scan all the networks from inside a network namespace.
@@ -1570,31 +2174,22 @@ This makes it possible to detect macvlan kernel device drivers running on the cu
1570Example: 2174Example:
1571.br 2175.br
1572$ firejail \-\-net=eth0 \-\-scan 2176$ firejail \-\-net=eth0 \-\-scan
2177#endif
1573.TP 2178.TP
1574\fB\-\-seccomp 2179\fB\-\-seccomp
1575Enable seccomp filter and blacklist the syscalls in the default list (@default). The default list is as follows: 2180Enable seccomp filter and blacklist the syscalls in the default list,
1576mount, umount2, ptrace, kexec_load, kexec_file_load, name_to_handle_at, open_by_handle_at, create_module, init_module, finit_module, delete_module, 2181which is @default-nodebuggers unless \-\-allow-debuggers is specified,
1577iopl, ioperm, ioprio_set, swapon, swapoff, syslog, process_vm_readv, process_vm_writev, 2182then it is @default.
1578sysfs,_sysctl, adjtimex, clock_adjtime, lookup_dcookie, perf_event_open, fanotify_init, kcmp,
1579add_key, request_key, keyctl, uselib, acct, modify_ldt, pivot_root, io_setup,
1580io_destroy, io_getevents, io_submit, io_cancel,
1581remap_file_pages, mbind, set_mempolicy,
1582migrate_pages, move_pages, vmsplice, chroot,
1583tuxcall, reboot, mfsservctl, get_kernel_syms,
1584bpf, clock_settime, personality, process_vm_writev, query_module,
1585settimeofday, stime, umount, userfaultfd, ustat, vm86, vm86old,
1586afs_syscall, bdflush, break, ftime, getpmsg, gtty, lock, mpx, pciconfig_iobase, pciconfig_read,
1587pciconfig_write, prof, profil, putpmsg, rtas, s390_runtime_instr, s390_mmio_read, s390_mmio_write,
1588security, setdomainname, sethostname, sgetmask, ssetmask, stty, subpage_prot, switch_endian,
1589ulimit, vhangup and vserver.
1590 2183
1591.br 2184.br
1592To help creating useful seccomp filters more easily, the following 2185To help creating useful seccomp filters more easily, the following
1593system call groups are defined: @clock, @cpu-emulation, @debug, 2186system call groups are defined: @aio, @basic-io, @chown, @clock,
1594@default, @default-nodebuggers, @default-keep, @module, @obsolete, 2187@cpu-emulation, @debug, @default, @default-nodebuggers, @default-keep,
1595@privileged, @raw-io, @reboot, @resources and @swap. In addtion, a 2188@file-system, @io-event, @ipc, @keyring, @memlock, @module, @mount,
1596system call can be specified by its number instead of name with prefix 2189@network-io, @obsolete, @privileged, @process, @raw-io, @reboot,
1597$, so for example $165 would be equal to mount on i386. 2190@resources, @setuid, @swap, @sync, @system-service and @timer.
2191More information about groups can be found in /usr/share/doc/firejail/syscalls.txt
2192.br
1598 2193
1599.br 2194.br
1600System architecture is strictly imposed only if flag 2195System architecture is strictly imposed only if flag
@@ -1611,9 +2206,18 @@ Firejail will print seccomp violations to the audit log if the kernel was compil
1611Example: 2206Example:
1612.br 2207.br
1613$ firejail \-\-seccomp 2208$ firejail \-\-seccomp
2209.br
2210
2211.br
2212The default list can be customized, see \-\-seccomp= for a description. It can be customized
2213also globally in /etc/firejail/firejail.config file.
2214
1614.TP 2215.TP
1615\fB\-\-seccomp=syscall,@group 2216\fB\-\-seccomp=syscall,@group,!syscall2
1616Enable seccomp filter, blacklist the default list (@default) and the syscalls or syscall groups specified by the command. 2217Enable seccomp filter, blacklist the default list and the syscalls or syscall groups
2218specified by the command, but don't blacklist "syscall2". On a 64 bit
2219architecture, an additional filter for 32 bit system calls can be
2220installed with \-\-seccomp.32.
1617.br 2221.br
1618 2222
1619.br 2223.br
@@ -1623,14 +2227,26 @@ $ firejail \-\-seccomp=utime,utimensat,utimes firefox
1623.br 2227.br
1624$ firejail \-\-seccomp=@clock,mkdir,unlinkat transmission-gtk 2228$ firejail \-\-seccomp=@clock,mkdir,unlinkat transmission-gtk
1625.br 2229.br
2230$ firejail '\-\-seccomp=@ipc,!pipe,!pipe2' audacious
2231.br
1626 2232
1627.br 2233.br
1628Instead of dropping the syscall, a specific error number can be returned 2234Syscalls can be specified by their number if prefix $ is added,
1629using \fBsyscall:errorno\fR syntax. 2235so for example $165 would be equal to mount on i386.
2236.br
2237
2238.br
2239Instead of dropping the syscall by returning EPERM, another error
2240number can be returned using \fBsyscall:errno\fR syntax. This can be
2241also changed globally with \-\-seccomp-error-action or
2242in /etc/firejail/firejail.config file. The process can also be killed
2243by using \fBsyscall:kill\fR syntax, or the attempt may be logged with
2244\fBsyscall:log\fR.
1630.br 2245.br
1631 2246
1632.br 2247.br
1633Example: 2248Example:
2249.br
1634$ firejail \-\-seccomp=unlinkat:ENOENT,utimensat,utimes 2250$ firejail \-\-seccomp=unlinkat:ENOENT,utimensat,utimes
1635.br 2251.br
1636Parent pid 10662, child pid 10663 2252Parent pid 10662, child pid 10663
@@ -1639,21 +2255,26 @@ Child process initialized
1639.br 2255.br
1640$ touch testfile 2256$ touch testfile
1641.br 2257.br
2258$ ls testfile
2259.br
2260testfile
2261.br
1642$ rm testfile 2262$ rm testfile
1643.br 2263.br
1644rm: cannot remove `testfile': Operation not permitted 2264rm: cannot remove `testfile': No such file or directory
1645.br 2265.br
1646 2266
1647.br 2267.br
1648If the blocked system calls would also block Firejail from operating, 2268If the blocked system calls would also block Firejail from operating,
1649they are handled by adding a preloaded library which performs seccomp 2269they are handled by adding a preloaded library which performs seccomp
1650system calls later. 2270system calls later. However, this is incompatible with 32 bit seccomp
2271filters.
1651.br 2272.br
1652 2273
1653.br 2274.br
1654Example: 2275Example:
1655.br 2276.br
1656$ firejail \-\-noprofile \-\-shell=none \-\-seccomp=execve bash 2277$ firejail \-\-noprofile \-\-shell=none \-\-seccomp=execve sh
1657.br 2278.br
1658Parent pid 32751, child pid 32752 2279Parent pid 32751, child pid 32752
1659.br 2280.br
@@ -1665,11 +2286,10 @@ Child process initialized in 46.44 ms
1665.br 2286.br
1666$ ls 2287$ ls
1667.br 2288.br
1668Bad system call 2289Operation not permitted
1669.br
1670 2290
1671.TP 2291.TP
1672\fB\-\-seccomp.block_secondary 2292\fB\-\-seccomp.block-secondary
1673Enable seccomp filter and filter system call architectures so that 2293Enable seccomp filter and filter system call architectures so that
1674only the native architecture is allowed. For example, on amd64, i386 2294only the native architecture is allowed. For example, on amd64, i386
1675and x32 system calls are blocked as well as changing the execution 2295and x32 system calls are blocked as well as changing the execution
@@ -1678,7 +2298,10 @@ domain with personality(2) system call.
1678 2298
1679.TP 2299.TP
1680\fB\-\-seccomp.drop=syscall,@group 2300\fB\-\-seccomp.drop=syscall,@group
1681Enable seccomp filter, and blacklist the syscalls or the syscall groups specified by the command. 2301Enable seccomp filter, and blacklist the syscalls or the syscall
2302groups specified by the command. On a 64 bit architecture, an
2303additional filter for 32 bit system calls can be installed with
2304\-\-seccomp.32.drop.
1682.br 2305.br
1683 2306
1684.br 2307.br
@@ -1688,8 +2311,12 @@ $ firejail \-\-seccomp.drop=utime,utimensat,utimes,@clock
1688.br 2311.br
1689 2312
1690.br 2313.br
1691Instead of dropping the syscall, a specific error number can be returned 2314Instead of dropping the syscall by returning EPERM, another error
1692using \fBsyscall:errorno\fR syntax. 2315number can be returned using \fBsyscall:errno\fR syntax. This can be
2316also changed globally with \-\-seccomp-error-action or
2317in /etc/firejail/firejail.config file. The process can also be killed
2318by using \fBsyscall:kill\fR syntax, or the attempt may be logged with
2319\fBsyscall:log\fR.
1693.br 2320.br
1694 2321
1695.br 2322.br
@@ -1703,20 +2330,22 @@ Child process initialized
1703.br 2330.br
1704$ touch testfile 2331$ touch testfile
1705.br 2332.br
2333$ ls testfile
2334.br
2335testfile
2336.br
1706$ rm testfile 2337$ rm testfile
1707.br 2338.br
1708rm: cannot remove `testfile': Operation not permitted 2339rm: cannot remove `testfile': No such file or directory
1709.br 2340.br
1710 2341
1711
1712
1713
1714
1715.TP 2342.TP
1716\fB\-\-seccomp.keep=syscall,syscall,syscall 2343\fB\-\-seccomp.keep=syscall,@group,!syscall2
1717Enable seccomp filter, and whitelist the syscalls specified by the 2344Enable seccomp filter, blacklist all syscall not listed and "syscall2".
1718command. The system calls needed by Firejail (group @default-keep: 2345The system calls needed by Firejail (group @default-keep: prctl, execve, execveat)
1719prctl, execve) are handled with the preload library. 2346are handled with the preload library. On a 64 bit architecture, an
2347additional filter for 32 bit system calls can be installed with
2348\-\-seccomp.32.keep.
1720.br 2349.br
1721 2350
1722.br 2351.br
@@ -1725,7 +2354,7 @@ Example:
1725$ firejail \-\-shell=none \-\-seccomp.keep=poll,select,[...] transmission-gtk 2354$ firejail \-\-shell=none \-\-seccomp.keep=poll,select,[...] transmission-gtk
1726 2355
1727.TP 2356.TP
1728\fB\-\-seccomp.print=name|PID 2357\fB\-\-seccomp.print=name|pid
1729Print the seccomp filter for the sandbox identified by name or PID. 2358Print the seccomp filter for the sandbox identified by name or PID.
1730.br 2359.br
1731 2360
@@ -1734,61 +2363,175 @@ Example:
1734.br 2363.br
1735$ firejail \-\-name=browser firefox & 2364$ firejail \-\-name=browser firefox &
1736.br 2365.br
1737$ firejail \-\-seccomp.print=browser 2366$ firejail --seccomp.print=browser
2367.br
2368 line OP JT JF K
2369.br
2370=================================
2371.br
2372 0000: 20 00 00 00000004 ld data.architecture
2373.br
2374 0001: 15 01 00 c000003e jeq ARCH_64 0003 (false 0002)
2375.br
2376 0002: 06 00 00 7fff0000 ret ALLOW
2377.br
2378 0003: 20 00 00 00000000 ld data.syscall-number
2379.br
2380 0004: 35 01 00 40000000 jge X32_ABI true:0006 (false 0005)
2381.br
2382 0005: 35 01 00 00000000 jge read 0007 (false 0006)
2383.br
2384 0006: 06 00 00 00050001 ret ERRNO(1)
2385.br
2386 0007: 15 41 00 0000009a jeq modify_ldt 0049 (false 0008)
2387.br
2388 0008: 15 40 00 000000d4 jeq lookup_dcookie 0049 (false 0009)
2389.br
2390 0009: 15 3f 00 0000012a jeq perf_event_open 0049 (false 000a)
2391.br
2392 000a: 15 3e 00 00000137 jeq process_vm_writev 0049 (false 000b)
2393.br
2394 000b: 15 3d 00 0000009c jeq _sysctl 0049 (false 000c)
2395.br
2396 000c: 15 3c 00 000000b7 jeq afs_syscall 0049 (false 000d)
2397.br
2398 000d: 15 3b 00 000000ae jeq create_module 0049 (false 000e)
2399.br
2400 000e: 15 3a 00 000000b1 jeq get_kernel_syms 0049 (false 000f)
2401.br
2402 000f: 15 39 00 000000b5 jeq getpmsg 0049 (false 0010)
2403.br
2404 0010: 15 38 00 000000b6 jeq putpmsg 0049 (false 0011)
1738.br 2405.br
1739SECCOMP Filter: 2406 0011: 15 37 00 000000b2 jeq query_module 0049 (false 0012)
1740.br 2407.br
1741 VALIDATE_ARCHITECTURE 2408 0012: 15 36 00 000000b9 jeq security 0049 (false 0013)
1742.br 2409.br
1743 EXAMINE_SYSCALL 2410 0013: 15 35 00 0000008b jeq sysfs 0049 (false 0014)
1744.br 2411.br
1745 BLACKLIST 165 mount 2412 0014: 15 34 00 000000b8 jeq tuxcall 0049 (false 0015)
1746.br 2413.br
1747 BLACKLIST 166 umount2 2414 0015: 15 33 00 00000086 jeq uselib 0049 (false 0016)
1748.br 2415.br
1749 BLACKLIST 101 ptrace 2416 0016: 15 32 00 00000088 jeq ustat 0049 (false 0017)
1750.br 2417.br
1751 BLACKLIST 246 kexec_load 2418 0017: 15 31 00 000000ec jeq vserver 0049 (false 0018)
1752.br 2419.br
1753 BLACKLIST 304 open_by_handle_at 2420 0018: 15 30 00 0000009f jeq adjtimex 0049 (false 0019)
1754.br 2421.br
1755 BLACKLIST 175 init_module 2422 0019: 15 2f 00 00000131 jeq clock_adjtime 0049 (false 001a)
1756.br 2423.br
1757 BLACKLIST 176 delete_module 2424 001a: 15 2e 00 000000e3 jeq clock_settime 0049 (false 001b)
1758.br 2425.br
1759 BLACKLIST 172 iopl 2426 001b: 15 2d 00 000000a4 jeq settimeofday 0049 (false 001c)
1760.br 2427.br
1761 BLACKLIST 173 ioperm 2428 001c: 15 2c 00 000000b0 jeq delete_module 0049 (false 001d)
1762.br 2429.br
1763 BLACKLIST 167 swapon 2430 001d: 15 2b 00 00000139 jeq finit_module 0049 (false 001e)
1764.br 2431.br
1765 BLACKLIST 168 swapoff 2432 001e: 15 2a 00 000000af jeq init_module 0049 (false 001f)
1766.br 2433.br
1767 BLACKLIST 103 syslog 2434 001f: 15 29 00 000000ad jeq ioperm 0049 (false 0020)
1768.br 2435.br
1769 BLACKLIST 310 process_vm_readv 2436 0020: 15 28 00 000000ac jeq iopl 0049 (false 0021)
1770.br 2437.br
1771 BLACKLIST 311 process_vm_writev 2438 0021: 15 27 00 000000f6 jeq kexec_load 0049 (false 0022)
1772.br 2439.br
1773 BLACKLIST 133 mknod 2440 0022: 15 26 00 00000140 jeq kexec_file_load 0049 (false 0023)
1774.br 2441.br
1775 BLACKLIST 139 sysfs 2442 0023: 15 25 00 000000a9 jeq reboot 0049 (false 0024)
1776.br 2443.br
1777 BLACKLIST 156 _sysctl 2444 0024: 15 24 00 000000a7 jeq swapon 0049 (false 0025)
1778.br 2445.br
1779 BLACKLIST 159 adjtimex 2446 0025: 15 23 00 000000a8 jeq swapoff 0049 (false 0026)
1780.br 2447.br
1781 BLACKLIST 305 clock_adjtime 2448 0026: 15 22 00 000000a3 jeq acct 0049 (false 0027)
1782.br 2449.br
1783 BLACKLIST 212 lookup_dcookie 2450 0027: 15 21 00 00000141 jeq bpf 0049 (false 0028)
1784.br 2451.br
1785 BLACKLIST 298 perf_event_open 2452 0028: 15 20 00 000000a1 jeq chroot 0049 (false 0029)
1786.br 2453.br
1787 BLACKLIST 300 fanotify_init 2454 0029: 15 1f 00 000000a5 jeq mount 0049 (false 002a)
1788.br 2455.br
1789 RETURN_ALLOW 2456 002a: 15 1e 00 000000b4 jeq nfsservctl 0049 (false 002b)
2457.br
2458 002b: 15 1d 00 0000009b jeq pivot_root 0049 (false 002c)
2459.br
2460 002c: 15 1c 00 000000ab jeq setdomainname 0049 (false 002d)
2461.br
2462 002d: 15 1b 00 000000aa jeq sethostname 0049 (false 002e)
2463.br
2464 002e: 15 1a 00 000000a6 jeq umount2 0049 (false 002f)
2465.br
2466 002f: 15 19 00 00000099 jeq vhangup 0049 (false 0030)
2467.br
2468 0030: 15 18 00 000000ee jeq set_mempolicy 0049 (false 0031)
2469.br
2470 0031: 15 17 00 00000100 jeq migrate_pages 0049 (false 0032)
2471.br
2472 0032: 15 16 00 00000117 jeq move_pages 0049 (false 0033)
2473.br
2474 0033: 15 15 00 000000ed jeq mbind 0049 (false 0034)
2475.br
2476 0034: 15 14 00 00000130 jeq open_by_handle_at 0049 (false 0035)
2477.br
2478 0035: 15 13 00 0000012f jeq name_to_handle_at 0049 (false 0036)
2479.br
2480 0036: 15 12 00 000000fb jeq ioprio_set 0049 (false 0037)
2481.br
2482 0037: 15 11 00 00000067 jeq syslog 0049 (false 0038)
2483.br
2484 0038: 15 10 00 0000012c jeq fanotify_init 0049 (false 0039)
2485.br
2486 0039: 15 0f 00 00000138 jeq kcmp 0049 (false 003a)
2487.br
2488 003a: 15 0e 00 000000f8 jeq add_key 0049 (false 003b)
2489.br
2490 003b: 15 0d 00 000000f9 jeq request_key 0049 (false 003c)
2491.br
2492 003c: 15 0c 00 000000fa jeq keyctl 0049 (false 003d)
2493.br
2494 003d: 15 0b 00 000000ce jeq io_setup 0049 (false 003e)
2495.br
2496 003e: 15 0a 00 000000cf jeq io_destroy 0049 (false 003f)
2497.br
2498 003f: 15 09 00 000000d0 jeq io_getevents 0049 (false 0040)
2499.br
2500 0040: 15 08 00 000000d1 jeq io_submit 0049 (false 0041)
2501.br
2502 0041: 15 07 00 000000d2 jeq io_cancel 0049 (false 0042)
2503.br
2504 0042: 15 06 00 000000d8 jeq remap_file_pages 0049 (false 0043)
2505.br
2506 0043: 15 05 00 00000116 jeq vmsplice 0049 (false 0044)
2507.br
2508 0044: 15 04 00 00000087 jeq personality 0049 (false 0045)
2509.br
2510 0045: 15 03 00 00000143 jeq userfaultfd 0049 (false 0046)
2511.br
2512 0046: 15 02 00 00000065 jeq ptrace 0049 (false 0047)
2513.br
2514 0047: 15 01 00 00000136 jeq process_vm_readv 0049 (false 0048)
2515.br
2516 0048: 06 00 00 7fff0000 ret ALLOW
2517.br
2518 0049: 06 00 01 00000000 ret KILL
1790.br 2519.br
1791$ 2520$
2521
2522.TP
2523\fB\-\-seccomp-error-action= kill | ERRNO | log
2524By default, if a seccomp filter blocks a system call, the process gets
2525EPERM as the error. With \-\-seccomp-error-action=error, another error
2526number can be returned, for example ENOSYS or EACCES. The process can
2527also be killed (like in versions <0.9.63 of Firejail) by using
2528\-\-seccomp-error-action=kill syntax, or the attempt may be logged
2529with \-\-seccomp-error-action=log. Not killing the process weakens
2530Firejail slightly when trying to contain intrusion, but it may also
2531allow tighter filters if the only alternative is to allow a system
2532call.
2533.br
2534
1792.TP 2535.TP
1793\fB\-\-shell=none 2536\fB\-\-shell=none
1794Run the program directly, without a user shell. 2537Run the program directly, without a user shell.
@@ -1802,15 +2545,14 @@ $ firejail \-\-shell=none script.sh
1802\fB\-\-shell=program 2545\fB\-\-shell=program
1803Set default user shell. Use this shell to run the application using \-c shell option. 2546Set default user shell. Use this shell to run the application using \-c shell option.
1804For example "firejail \-\-shell=/bin/dash firefox" will start Mozilla Firefox as "/bin/dash \-c firefox". 2547For example "firejail \-\-shell=/bin/dash firefox" will start Mozilla Firefox as "/bin/dash \-c firefox".
1805By default Bash shell (/bin/bash) is used. Options such as \-\-zsh and \-\-csh can also set the default 2548By default the user's preferred shell is used.
1806shell.
1807.br 2549.br
1808 2550
1809.br 2551.br
1810Example: 2552Example:
1811$firejail \-\-shell=/bin/dash script.sh 2553$firejail \-\-shell=/bin/dash script.sh
1812.TP 2554.TP
1813\fB\-\-shutdown=name|PID 2555\fB\-\-shutdown=name|pid
1814Shutdown the sandbox identified by name or PID. 2556Shutdown the sandbox identified by name or PID.
1815.br 2557.br
1816 2558
@@ -1827,18 +2569,25 @@ Example:
1827.br 2569.br
1828$ firejail \-\-list 2570$ firejail \-\-list
1829.br 2571.br
18303272:netblue:firejail \-\-private firefox 25723272:netblue::firejail \-\-private firefox
1831.br 2573.br
1832$ firejail \-\-shutdown=3272 2574$ firejail \-\-shutdown=3272
1833.TP 2575.TP
2576\fB\-\-timeout=hh:mm:ss
2577Kill the sandbox automatically after the time has elapsed. The time is specified in hours/minutes/seconds format.
2578.br
2579
2580.br
2581$ firejail \-\-timeout=01:30:00 firefox
2582.TP
1834\fB\-\-tmpfs=dirname 2583\fB\-\-tmpfs=dirname
1835Mount a tmpfs filesystem on directory dirname. This option is available only when running the sandbox as root. 2584Mount a writable tmpfs filesystem on directory dirname. Directories outside user home or not owned by the user are not allowed. Sandboxes running as root are exempt from these restrictions. File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
1836.br 2585.br
1837 2586
1838.br 2587.br
1839Example: 2588Example:
1840.br 2589.br
1841# firejail \-\-tmpfs=/var 2590$ firejail \-\-tmpfs=~/.local/share
1842.TP 2591.TP
1843\fB\-\-top 2592\fB\-\-top
1844Monitor the most CPU-intensive sandboxes, see \fBMONITORING\fR section for more details. 2593Monitor the most CPU-intensive sandboxes, see \fBMONITORING\fR section for more details.
@@ -1849,8 +2598,9 @@ Example:
1849.br 2598.br
1850$ firejail \-\-top 2599$ firejail \-\-top
1851.TP 2600.TP
1852\fB\-\-trace 2601\fB\-\-trace[=filename]
1853Trace open, access and connect system calls. 2602Trace open, access and connect system calls. If filename is specified, log
2603trace output to filename, otherwise log to console.
1854.br 2604.br
1855 2605
1856.br 2606.br
@@ -1916,14 +2666,38 @@ $ firejail \-\-tree
1916 11904:netblue:iceweasel 2666 11904:netblue:iceweasel
1917.br 2667.br
1918 11957:netblue:/usr/lib/iceweasel/plugin-container 2668 11957:netblue:/usr/lib/iceweasel/plugin-container
2669#ifdef HAVE_NETWORK
1919.br 2670.br
192011969:netblue:firejail \-\-net=eth0 transmission-gtk 267111969:netblue:firejail \-\-net=eth0 transmission-gtk
2672#endif
1921.br 2673.br
1922 11970:netblue:transmission-gtk 2674 11970:netblue:transmission-gtk
1923 2675
2676#ifdef HAVE_FIRETUNNEL
2677.TP
2678\fB\-\-tunnel[=devname]
2679Connect the sandbox to a network overlay/VPN tunnel created by firetunnel utility. This options
2680tries first the client side of the tunnel. If this fails, it tries the server side. If multiple tunnels are active,
2681please specify the tunnel device using \-\-tunnel=devname.
2682.br
2683
2684.br
2685The available tunnel devices are listed in /etc/firetunnel directory, one file for each device.
2686The files are regular firejail profile files containing the network configuration,
2687and are created and managed by firetunnel utility.
2688By default ftc is the client-side device and fts is the server-side device. For more information
2689please see man 1 firetunnel.
2690.br
2691
2692.br
2693Example:
2694.br
2695$ firejail --tunnel firefox
2696.br
2697#endif
1924.TP 2698.TP
1925\fB\-\-version 2699\fB\-\-version
1926Print program version and exit. 2700Print program version/compile time support and exit.
1927.br 2701.br
1928 2702
1929.br 2703.br
@@ -1933,6 +2707,21 @@ $ firejail \-\-version
1933.br 2707.br
1934firejail version 0.9.27 2708firejail version 0.9.27
1935 2709
2710Compile time support:
2711 - AppArmor support is enabled
2712 - AppImage support is enabled
2713 - chroot support is enabled
2714 - file and directory whitelisting support is enabled
2715 - file transfer support is enabled
2716 - firetunnel support is enabled
2717 - networking support is enabled
2718 - overlayfs support is enabled
2719 - private-home support is enabled
2720 - seccomp-bpf support is enabled
2721 - user namespace support is enabled
2722 - X11 sandboxing support is enabled
2723.br
2724#ifdef HAVE_NETWORK
1936.TP 2725.TP
1937\fB\-\-veth-name=name 2726\fB\-\-veth-name=name
1938Use this name for the interface connected to the bridge for --net=bridge_interface commands, 2727Use this name for the interface connected to the bridge for --net=bridge_interface commands,
@@ -1943,13 +2732,14 @@ instead of the default one.
1943Example: 2732Example:
1944.br 2733.br
1945$ firejail \-\-net=br0 --veth-name=if0 2734$ firejail \-\-net=br0 --veth-name=if0
1946 2735#endif
1947.TP 2736.TP
1948\fB\-\-whitelist=dirname_or_filename 2737\fB\-\-whitelist=dirname_or_filename
1949Whitelist directory or file. A temporary file system is mounted on the top directory, and the 2738Whitelist directory or file. A temporary file system is mounted on the top directory, and the
1950whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent, 2739whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent,
1951everything else is discarded when the sandbox is closed. The top directory could be 2740everything else is discarded when the sandbox is closed. The top directory can be
1952user home, /dev, /media, /mnt, /opt, /srv, /var, and /tmp. 2741all directories in / (except /proc and /sys), /sys/module, /run/user/$UID, $HOME and
2742all directories in /usr.
1953.br 2743.br
1954 2744
1955.br 2745.br
@@ -1958,6 +2748,10 @@ the same top directory. For user home, both the link and the real file should be
1958.br 2748.br
1959 2749
1960.br 2750.br
2751File globbing is supported, see \fBFILE GLOBBING\fR section for more details.
2752.br
2753
2754.br
1961Example: 2755Example:
1962.br 2756.br
1963$ firejail \-\-noprofile \-\-whitelist=~/.mozilla 2757$ firejail \-\-noprofile \-\-whitelist=~/.mozilla
@@ -1965,6 +2759,8 @@ $ firejail \-\-noprofile \-\-whitelist=~/.mozilla
1965$ firejail \-\-whitelist=/tmp/.X11-unix --whitelist=/dev/null 2759$ firejail \-\-whitelist=/tmp/.X11-unix --whitelist=/dev/null
1966.br 2760.br
1967$ firejail "\-\-whitelist=/home/username/My Virtual Machines" 2761$ firejail "\-\-whitelist=/home/username/My Virtual Machines"
2762.br
2763$ firejail \-\-whitelist=~/work* \-\-whitelist=/var/backups*
1968 2764
1969.TP 2765.TP
1970\fB\-\-writable-etc 2766\fB\-\-writable-etc
@@ -2007,13 +2803,13 @@ Example:
2007.br 2803.br
2008$ sudo firejail --writable-var-log 2804$ sudo firejail --writable-var-log
2009 2805
2010 2806#ifdef HAVE_X11
2011.TP 2807.TP
2012\fB\-\-x11 2808\fB\-\-x11
2013Sandbox the application using Xpra, Xephyr, Xvfb or Xorg security extension. 2809Sandbox the application using Xpra, Xephyr, Xvfb or Xorg security extension.
2014The sandbox will prevents screenshot and keylogger applications started inside the sandbox from accessing 2810The sandbox will prevent screenshot and keylogger applications started inside the sandbox from accessing
2015clients running outside the sandbox. 2811clients running outside the sandbox.
2016Firejail will try first Xpra, and if Xpra is not installed on the system, it will try to find Xephyr. 2812Firejail will try Xpra first, and if Xpra is not installed on the system, it will try to find Xephyr.
2017If all fails, Firejail will not attempt to use Xvfb or X11 security extension. 2813If all fails, Firejail will not attempt to use Xvfb or X11 security extension.
2018.br 2814.br
2019 2815
@@ -2082,7 +2878,7 @@ $ firejail \-\-x11=xorg firefox
2082 2878
2083.TP 2879.TP
2084\fB\-\-x11=xpra 2880\fB\-\-x11=xpra
2085Start Xpra (http://xpra.org) and attach the sandbox to this server. 2881Start Xpra (https://xpra.org) and attach the sandbox to this server.
2086Xpra is a persistent remote display server and client for forwarding X11 applications and desktop screens. 2882Xpra is a persistent remote display server and client for forwarding X11 applications and desktop screens.
2087A network namespace needs to be instantiated in order to deny access to X11 abstract Unix domain socket. 2883A network namespace needs to be instantiated in order to deny access to X11 abstract Unix domain socket.
2088.br 2884.br
@@ -2168,16 +2964,51 @@ Example:
2168.br 2964.br
2169$ firejail --net=eth0 --x11=xephyr --xephyr-screen=640x480 firefox 2965$ firejail --net=eth0 --x11=xephyr --xephyr-screen=640x480 firefox
2170.br 2966.br
2967#endif
2968#ifdef HAVE_APPARMOR
2969.SH APPARMOR
2970.TP
2971AppArmor support is disabled by default at compile time. Use --enable-apparmor configuration option to enable it:
2972.br
2171 2973
2974.br
2975$ ./configure --prefix=/usr --enable-apparmor
2172.TP 2976.TP
2173\fB\-\-zsh 2977During software install, a generic AppArmor profile file, firejail-default, is placed in /etc/apparmor.d directory. The local customizations must be placed in /etc/apparmor.d/local/firejail-local. The profile needs to be loaded into the kernel by reloading apparmor.service, rebooting the system or running the following command as root:
2174Use /usr/bin/zsh as default user shell.
2175.br 2978.br
2176 2979
2177.br 2980.br
2178Example: 2981# apparmor_parser -r /etc/apparmor.d/firejail-default
2982.TP
2983The installed profile is supplemental for main firejail functions and among other things does the following:
2984.br
2985
2986.br
2987- Disable ptrace. With ptrace it is possible to inspect and hijack running programs. Usually this is needed only for debugging. You should have no problems running Chromium or Firefox. This feature is available only on Ubuntu kernels.
2179.br 2988.br
2180$ firejail \-\-zsh 2989
2990.br
2991- Whitelist write access to several files under /run, /proc and /sys.
2992.br
2993
2994.br
2995- Allow running programs only from well-known system paths, such as /bin, /sbin, /usr/bin etc. Those paths are available as read-only. Running programs and scripts from user home or other directories writable by the user is not allowed.
2996.br
2997
2998.br
2999- Prevent using non-standard network sockets. Only unix, inet, inet6, netlink, raw and packet are allowed.
3000.br
3001
3002.br
3003- Deny access to known sensitive paths like .snapshots.
3004
3005.TP
3006To enable AppArmor confinement on top of your current Firejail security features, pass \fB\-\-apparmor\fR flag to Firejail command line. You can also include \fBapparmor\fR command in a Firejail profile file. Example:
3007.br
3008
3009.br
3010$ firejail --apparmor firefox
3011#endif
2181 3012
2182.SH DESKTOP INTEGRATION 3013.SH DESKTOP INTEGRATION
2183A symbolic link to /usr/bin/firejail under the name of a program, will start the program in Firejail sandbox. 3014A symbolic link to /usr/bin/firejail under the name of a program, will start the program in Firejail sandbox.
@@ -2192,7 +3023,7 @@ Make a firefox symlink to /usr/bin/firejail:
2192.br 3023.br
2193 3024
2194.br 3025.br
2195$ ln -s /usr/bin/firejail /usr/local/bin/firefox 3026$ sudo ln -s /usr/bin/firejail /usr/local/bin/firefox
2196.br 3027.br
2197 3028
2198.br 3029.br
@@ -2232,49 +3063,90 @@ $ firejail --tree
2232 1221:netblue:/usr/lib/firefox/firefox 3063 1221:netblue:/usr/lib/firefox/firefox
2233.RE 3064.RE
2234 3065
2235We provide a tool that automates all this integration, please see \fBman 1 firecfg\fR for more details. 3066We provide a tool that automates all this integration, please see \&\flfirecfg\fR\|(1) for more details.
2236 3067
2237.SH APPARMOR 3068.SH EXAMPLES
2238.TP 3069.TP
2239AppArmor support is disabled by default at compile time. Use --enable-apparmor configuration option to enable it: 3070\f\firejail
2240.br 3071Sandbox a regular shell session.
3072.TP
3073\f\firejail firefox
3074Start Mozilla Firefox.
3075.TP
3076\f\firejail \-\-debug firefox
3077Debug Firefox sandbox.
3078.TP
3079\f\firejail \-\-private firefox
3080Start Firefox with a new, empty home directory.
3081.TP
3082\f\firejail --net=none vlc
3083Start VLC in an unconnected network namespace.
3084#ifdef HAVE_NETWORK
3085.TP
3086\f\firejail \-\-net=eth0 firefox
3087Start Firefox in a new network namespace. An IP address is
3088assigned automatically.
3089.TP
3090\f\firejail \-\-net=br0 \-\-ip=10.10.20.5 \-\-net=br1 \-\-net=br2
3091Start a shell session in a new network namespace and connect it
3092to br0, br1, and br2 host bridge devices. IP addresses are assigned
3093automatically for the interfaces connected to br1 and b2
3094#endif
3095.TP
3096\f\firejail \-\-list
3097List all sandboxed processes.
2241 3098
2242.br 3099.SH FILE GLOBBING
2243$ ./configure --prefix=/usr --enable-apparmor
2244.TP 3100.TP
2245During software install, a generic AppArmor profile file, firejail-default, is placed in /etc/apparmor.d directory. The profile needs to be loaded into the kernel by running the following command as root: 3101Globbing is the operation that expands a wildcard pattern into the
3102list of pathnames matching the pattern. This pattern is matched at
3103firejail \fBstart\fR, and is NOT UPDATED at runtime. \fBFiles matching
3104a blacklist, but created after firejail start will be accessible within
3105the jail.\fR Matching is defined by:
2246.br 3106.br
2247 3107
2248.br 3108.br
2249# aa-enforce firejail-default 3109- '?' matches any character
2250.TP
2251The installed profile tries to replicate some advanced security features inspired by kernel-based Grsecurity:
2252.br 3110.br
2253 3111- '*' matches any string
3112.br
3113- '[' denotes a range of characters
2254.br 3114.br
2255- Prevent information leakage in /proc and /sys directories. The resulting filesystem is barely enough for running 3115.TP
2256commands such as "top" and "ps aux". 3116The globbing feature is implemented using glibc glob command. For
3117more information on the wildcard syntax see man 7 glob.
2257.br 3118.br
2258 3119
2259.br 3120.br
2260- Allow running programs only from well-known system paths, such as /bin, /sbin, /usr/bin etc. Running 3121.TP
2261programs and scripts from user home or other directories writable by the user is not allowed. 3122The following command line options are supported: \-\-blacklist,
3123\-\-private-bin, \-\-noexec, \-\-read-only, \-\-read-write,
3124\-\-tmpfs, and \-\-whitelist.
2262.br 3125.br
2263 3126
2264.br 3127.br
2265- Disable D-Bus. D-Bus has long been a huge security hole, and most programs don't use it anyway.
2266You should have no problems running Chromium or Firefox.
2267
2268.TP 3128.TP
2269To enable AppArmor confinement on top of your current Firejail security features, pass \fB\-\-apparmor\fR flag to Firejail command line. You can also include \fBapparmor\fR command in a Firejail profile file. Example: 3129Examples:
2270.br 3130.br
2271 3131
2272.br 3132.br
2273$ firejail --apparmor firefox 3133$ firejail --private-bin=sh,bash,python*
3134.br
3135$ firejail --blacklist=~/dir[1234]
3136.br
3137$ firejail --read-only=~/dir[1-4]
3138.br
2274 3139
3140#ifdef HAVE_FILE_TRANSFER
2275.SH FILE TRANSFER 3141.SH FILE TRANSFER
2276These features allow the user to inspect the filesystem container of an existing sandbox 3142These features allow the user to inspect the filesystem container of an existing sandbox
2277and transfer files from the container to the host filesystem. 3143and transfer files between the container and the host filesystem.
3144
3145.TP
3146\fB\-\-cat=name|pid filename
3147Write content of a container file to standard out. The container is specified by name or PID.
3148If standard out is a terminal, all ASCII control characters except new line and horizontal tab
3149are replaced.
2278 3150
2279.TP 3151.TP
2280\fB\-\-get=name|pid filename 3152\fB\-\-get=name|pid filename
@@ -2320,87 +3192,28 @@ $ firejail \-\-get=mybrowser ~/Downloads/xpra-clipboard.png
2320$ firejail \-\-put=mybrowser xpra-clipboard.png ~/Downloads/xpra-clipboard.png 3192$ firejail \-\-put=mybrowser xpra-clipboard.png ~/Downloads/xpra-clipboard.png
2321.br 3193.br
2322 3194
2323.SH TRAFFIC SHAPING
2324Network bandwidth is an expensive resource shared among all sandboxes running on a system.
2325Traffic shaping allows the user to increase network performance by controlling
2326the amount of data that flows into and out of the sandboxes.
2327
2328Firejail implements a simple rate-limiting shaper based on Linux command tc.
2329The shaper works at sandbox level, and can be used only for sandboxes configured with new network namespaces.
2330
2331Set rate-limits:
2332
2333 $ firejail --bandwidth=name|pid set network download upload
2334
2335Clear rate-limits:
2336
2337 $ firejail --bandwidth=name|pid clear network
2338
2339Status:
2340
2341 $ firejail --bandwidth=name|pid status
2342
2343where:
2344.br
2345 name - sandbox name
2346.br
2347 pid - sandbox pid
2348.br
2349 network - network interface as used by \-\-net option
2350.br
2351 download - download speed in KB/s (kilobyte per second)
2352.br
2353 upload - upload speed in KB/s (kilobyte per second)
2354
2355Example:
2356.br
2357 $ firejail \-\-name=mybrowser \-\-net=eth0 firefox &
2358.br
2359 $ firejail \-\-bandwidth=mybrowser set eth0 80 20
2360.br 3195.br
2361 $ firejail \-\-bandwidth=mybrowser status 3196$ firejail \-\-cat=mybrowser ~/.bashrc
2362.br 3197.br
2363 $ firejail \-\-bandwidth=mybrowser clear eth0 3198#endif
2364
2365.SH AUDIT
2366Audit feature allows the user to point out gaps in security profiles. The
2367implementation replaces the program to be sandboxed with a test program. By
2368default, we use faudit program distributed with Firejail. A custom test program
2369can also be supplied by the user. Examples:
2370
2371Running the default audit program:
2372.br
2373 $ firejail --audit transmission-gtk
2374
2375Running a custom audit program:
2376.br
2377 $ firejail --audit=~/sandbox-test transmission-gtk
2378
2379In the examples above, the sandbox configures transmission-gtk profile and
2380starts the test program. The real program, transmission-gtk, will not be
2381started.
2382
2383Limitations: audit feature is not implemented for --x11 commands.
2384
2385.SH MONITORING 3199.SH MONITORING
2386Option \-\-list prints a list of all sandboxes. The format 3200Option \-\-list prints a list of all sandboxes. The format
2387for each process entry is as follows: 3201for each process entry is as follows:
2388 3202
2389 PID:USER:Command 3203 PID:USER:Sandbox Name:Command
2390 3204
2391Option \-\-tree prints the tree of processes running in the sandbox. The format 3205Option \-\-tree prints the tree of processes running in the sandbox. The format
2392for each process entry is as follows: 3206for each process entry is as follows:
2393 3207
2394 PID:USER:Command 3208 PID:USER:Sandbox Name:Command
2395 3209
2396Option \-\-top is similar to the UNIX top command, however it applies only to 3210Option \-\-top is similar to the UNIX top command, however it applies only to
2397sandboxes. 3211sandboxes.
2398 3212
2399Option \-\-netstats prints network statistics for active sandboxes installing new network namespaces. 3213Option \-\-netstats prints network statistics for active sandboxes installing new network namespaces.
2400 3214
2401
2402Listed below are the available fields (columns) in alphabetical 3215Listed below are the available fields (columns) in alphabetical
2403order for \-\-top and \-\-netstat options: 3216order for \-\-top and \-\-netstats options:
2404 3217
2405.TP 3218.TP
2406Command 3219Command
@@ -2423,6 +3236,9 @@ It is a sum of the RES values for all processes running in the sandbox.
2423RX(KB/s) 3236RX(KB/s)
2424Network receive speed. 3237Network receive speed.
2425.TP 3238.TP
3239Sandbox Name
3240The name of the sandbox, if any.
3241.TP
2426SHR 3242SHR
2427Shared Memory Size (KiB), it reflects memory shared with other 3243Shared Memory Size (KiB), it reflects memory shared with other
2428processes. It is a sum of the SHR values for all processes running 3244processes. It is a sum of the SHR values for all processes running
@@ -2434,14 +3250,23 @@ Network transmit speed.
2434Uptime 3250Uptime
2435Sandbox running time in hours:minutes:seconds format. 3251Sandbox running time in hours:minutes:seconds format.
2436.TP 3252.TP
2437User 3253USER
2438The owner of the sandbox. 3254The owner of the sandbox.
2439 3255
3256.SH RESTRICTED SHELL
3257To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in
3258/etc/passwd file for each user that needs to be restricted. Alternatively,
3259you can specify /usr/bin/firejail in adduser command:
3260
3261adduser \-\-shell /usr/bin/firejail username
3262
3263Additional arguments passed to firejail executable upon login are declared in /etc/firejail/login.users file.
3264
2440.SH SECURITY PROFILES 3265.SH SECURITY PROFILES
2441Several command line options can be passed to the program using 3266Several command line options can be passed to the program using
2442profile files. Firejail chooses the profile file as follows: 3267profile files. Firejail chooses the profile file as follows:
2443 3268
24441. If a profile file is provided by the user with --profile option, the profile file is loaded. 32691. If a profile file is provided by the user with --profile=FILE option, the profile FILE is loaded. If a profile name is given, it is searched for first in the ~/.config/firejail directory and if not found then in /etc/firejail directory. Profile names do not include the .profile suffix. If there is a file with the same name as the given profile name, it will be used instead of doing the profile search. To force a profile search, prefix the profile name with a colon (:), eg. --profile=:PROFILE_NAME.
2445Example: 3270Example:
2446.PP 3271.PP
2447.RS 3272.RS
@@ -2452,6 +3277,15 @@ Reading profile /home/netblue/icecat.profile
2452[...] 3277[...]
2453.RE 3278.RE
2454 3279
3280.PP
3281.RS
3282$ firejail --profile=icecat icecat-wrapper.sh
3283.br
3284Reading profile /etc/firejail/icecat.profile
3285.br
3286[...]
3287.RE
3288
24552. If a profile file with the same name as the application is present in ~/.config/firejail directory or 32892. If a profile file with the same name as the application is present in ~/.config/firejail directory or
2456in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example: 3290in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example:
2457.PP 3291.PP
@@ -2494,51 +3328,63 @@ Child process initialized
2494[...] 3328[...]
2495.RE 3329.RE
2496 3330
2497See man 5 firejail-profile for profile file syntax information. 3331See \fBman 5 firejail-profile\fR for profile file syntax information.
3332#ifdef HAVE_NETWORK
3333.SH TRAFFIC SHAPING
3334Network bandwidth is an expensive resource shared among all sandboxes running on a system.
3335Traffic shaping allows the user to increase network performance by controlling
3336the amount of data that flows into and out of the sandboxes.
2498 3337
2499.SH RESTRICTED SHELL 3338Firejail implements a simple rate-limiting shaper based on Linux command tc.
2500To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in 3339The shaper works at sandbox level, and can be used only for sandboxes configured with new network namespaces.
2501/etc/passwd file for each user that needs to be restricted. Alternatively,
2502you can specify /usr/bin/firejail in adduser command:
2503 3340
2504adduser \-\-shell /usr/bin/firejail username 3341Set rate-limits:
2505 3342
2506Additional arguments passed to firejail executable upon login are declared in /etc/firejail/login.users file. 3343 $ firejail --bandwidth=name|pid set network download upload
2507 3344
2508.SH EXAMPLES 3345Clear rate-limits:
2509.TP 3346
2510\f\firejail 3347 $ firejail --bandwidth=name|pid clear network
2511Sandbox a regular /bin/bash session. 3348
2512.TP 3349Status:
2513\f\firejail firefox 3350
2514Start Mozilla Firefox. 3351 $ firejail --bandwidth=name|pid status
2515.TP 3352
2516\f\firejail \-\-debug firefox 3353where:
2517Debug Firefox sandbox. 3354.br
2518.TP 3355 name - sandbox name
2519\f\firejail \-\-private firefox 3356.br
2520Start Firefox with a new, empty home directory. 3357 pid - sandbox pid
2521.TP 3358.br
2522\f\firejail --net=none vlc 3359 network - network interface as used by \-\-net option
2523Start VLC in an unconnected network namespace. 3360.br
2524.TP 3361 download - download speed in KB/s (kilobyte per second)
2525\f\firejail \-\-net=eth0 firefox 3362.br
2526Start Firefox in a new network namespace. An IP address is 3363 upload - upload speed in KB/s (kilobyte per second)
2527assigned automatically. 3364
2528.TP 3365Example:
2529\f\firejail \-\-net=br0 \-\-ip=10.10.20.5 \-\-net=br1 \-\-net=br2 3366.br
2530Start a /bin/bash session in a new network namespace and connect it 3367 $ firejail \-\-name=mybrowser \-\-net=eth0 firefox &
2531to br0, br1, and br2 host bridge devices. IP addresses are assigned 3368.br
2532automatically for the interfaces connected to br1 and b2 3369 $ firejail \-\-bandwidth=mybrowser set eth0 80 20
2533.TP 3370.br
2534\f\firejail \-\-list 3371 $ firejail \-\-bandwidth=mybrowser status
2535List all sandboxed processes. 3372.br
3373 $ firejail \-\-bandwidth=mybrowser clear eth0
3374#endif
2536.SH LICENSE 3375.SH LICENSE
2537This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 3376This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
2538.PP 3377.PP
2539Homepage: http://firejail.wordpress.com 3378Homepage: https://firejail.wordpress.com
2540.SH SEE ALSO 3379.SH SEE ALSO
2541\&\flfiremon\fR\|(1), 3380.BR firemon (1),
2542\&\flfirecfg\fR\|(1), 3381.BR firecfg (1),
2543\&\flfirejail-profile\fR\|(5), 3382.BR firejail-profile (5),
2544\&\flfirejail-login\fR\|(5) 3383.BR firejail-login (5),
3384.BR firejail-users (5),
3385.BR jailcheck (1)
3386
3387.UR https://github.com/netblue30/firejail/wiki
3388.UE ,
3389.UR https://github.com/netblue30/firejail
3390.UE
diff --git a/src/man/firemon.txt b/src/man/firemon.txt
index 957a224c6..76b2f7be2 100644
--- a/src/man/firemon.txt
+++ b/src/man/firemon.txt
@@ -10,8 +10,13 @@ these processes are also being monitored. On Grsecurity systems only root user
10can run this program. 10can run this program.
11.SH OPTIONS 11.SH OPTIONS
12.TP 12.TP
13\fB\-\-apparmor
14Print AppArmor confinement status for each sandbox.
15#ifdef HAVE_NETWORK
16.TP
13\fB\-\-arp 17\fB\-\-arp
14Print ARP table for each sandbox. 18Print ARP table for each sandbox.
19#endif
15.TP 20.TP
16\fB\-\-caps 21\fB\-\-caps
17Print capabilities configuration for each sandbox. 22Print capabilities configuration for each sandbox.
@@ -22,6 +27,9 @@ Print control group information for each sandbox.
22\fB\-\-cpu 27\fB\-\-cpu
23Print CPU affinity for each sandbox. 28Print CPU affinity for each sandbox.
24.TP 29.TP
30\fB\-\-debug
31Print debug messages
32.TP
25\fB\-?\fR, \fB\-\-help\fR 33\fB\-?\fR, \fB\-\-help\fR
26Print options end exit. 34Print options end exit.
27.TP 35.TP
@@ -33,46 +41,42 @@ List all sandboxes.
33.TP 41.TP
34\fB\-\-name=name 42\fB\-\-name=name
35Print information only about named sandbox. 43Print information only about named sandbox.
44#ifdef HAVE_NETWORK
36.TP 45.TP
37\fB\-\-netstats 46\fB\-\-netstats
38Monitor network statistics for sandboxes creating a new network namespace. 47Monitor network statistics for sandboxes creating a new network namespace.
39.TP 48#endif
40\fB\-\-nowrap 49#ifdef HAVE_NETWORK
41Enable line wrapping in terminals. By default the lines are trimmed.
42.TP 50.TP
43\fB\-\-route 51\fB\-\-route
44Print route table for each sandbox. 52Print route table for each sandbox.
53#endif
45.TP 54.TP
46\fB\-\-seccomp 55\fB\-\-seccomp
47Print seccomp configuration for each sandbox. 56Print seccomp configuration for each sandbox.
48.TP 57.TP
49\fB\-\-top 58\fB\-\-top
50Monitor the most CPU-intensive sandboxes. 59Monitor the most CPU-intensive sandboxes. This command is similar to
60the regular UNIX top command, however it applies only to sandboxes.
51.TP 61.TP
52\fB\-\-tree 62\fB\-\-tree
53Print a tree of all sandboxed processes. 63Print a tree of all sandboxed processes.
54.TP 64.TP
55\fB\-\-version 65\fB\-\-version
56Print program version and exit. 66Print program version and exit.
57 67.TP
68\fB\-\-wrap
69Enable line wrapping in terminals. By default the lines are trimmed.
58.TP 70.TP
59\fB\-\-x11 71\fB\-\-x11
60Print X11 display number. 72Print X11 display number.
61 73
62.PP 74.PP
63Option \-\-list prints a list of all sandboxes. The format 75The format for each listed sandbox entry is as follows:
64for each entry is as follows:
65
66 PID:USER:Command
67 76
68Option \-\-tree prints the tree of processes running in the sandbox. The format 77 PID:USER:Sandbox Name:Command
69for each process entry is as follows:
70 78
71 PID:USER:Command 79Listed below are the available fields (columns) in various firemon commands in alphabetical order:
72
73Option \-\-top is similar to the UNIX top command, however it applies only to
74sandboxes. Listed below are the available fields (columns) in alphabetical
75order:
76 80
77.TP 81.TP
78Command 82Command
@@ -92,6 +96,9 @@ RES
92Resident Memory Size (KiB), sandbox non-swapped physical memory. 96Resident Memory Size (KiB), sandbox non-swapped physical memory.
93It is a sum of the RES values for all processes running in the sandbox. 97It is a sum of the RES values for all processes running in the sandbox.
94.TP 98.TP
99Sandbox Name
100The name of the sandbox, if any.
101.TP
95SHR 102SHR
96Shared Memory Size (KiB), it reflects memory shared with other 103Shared Memory Size (KiB), it reflects memory shared with other
97processes. It is a sum of the SHR values for all processes running 104processes. It is a sum of the SHR values for all processes running
@@ -100,15 +107,17 @@ in the sandbox, including the controlling process.
100Uptime 107Uptime
101Sandbox running time in hours:minutes:seconds format. 108Sandbox running time in hours:minutes:seconds format.
102.TP 109.TP
103User 110USER
104The owner of the sandbox. 111The owner of the sandbox.
105 112
106.SH LICENSE 113.SH LICENSE
107This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 114This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
108.PP 115.PP
109Homepage: http://firejail.wordpress.com 116Homepage: https://firejail.wordpress.com
110.SH SEE ALSO 117.SH SEE ALSO
111\&\flfirejail\fR\|(1), 118.BR firejail (1),
112\&\flfirecfg\fR\|(1), 119.BR firecfg (1),
113\&\flfirejail-profile\fR\|(5), 120.BR firejail-profile (5),
114\&\flfirejail-login\fR\|(5) 121.BR firejail-login (5),
122.BR firejail-users (5),
123.BR jailcheck (1)
diff --git a/src/man/jailcheck.txt b/src/man/jailcheck.txt
new file mode 100644
index 000000000..483f47fb9
--- /dev/null
+++ b/src/man/jailcheck.txt
@@ -0,0 +1,117 @@
1.TH JAILCHECK 1 "MONTH YEAR" "VERSION" "JAILCHECK man page"
2.SH NAME
3jailcheck \- Simple utility program to test running sandboxes
4.SH SYNOPSIS
5sudo jailcheck [OPTIONS] [directory]
6.SH DESCRIPTION
7jailcheck attaches itself to all sandboxes started by the user and performs some basic tests
8on the sandbox filesystem:
9.TP
10\fB1. Virtual directories
11jailcheck extracts a list with the main virtual directories installed by the sandbox.
12These directories are build by firejail at startup using --private* and --whitelist commands.
13.TP
14\fB2. Noexec test
15jailcheck inserts executable programs in /home/username, /tmp, and /var/tmp directories
16and tries to run them from inside the sandbox, thus testing if the directory is executable or not.
17.TP
18\fB3. Read access test
19jailcheck creates test files in the directories specified by the user and tries to read
20them from inside the sandbox.
21.TP
22\fB4. AppArmor test
23.TP
24\fB5. Seccomp test
25.TP
26\fB6. Networking test
27.TP
28The program is started as root using sudo.
29
30.SH OPTIONS
31.TP
32\fB\-\-debug
33Print debug messages.
34.TP
35\fB\-?\fR, \fB\-\-help\fR
36Print options and exit.
37.TP
38\fB\-\-version
39Print program version and exit.
40.TP
41\fB[directory]
42One or more directories in user home to test for read access. ~/.ssh and ~/.gnupg are tested by default.
43
44.SH OUTPUT
45For each sandbox detected we print the following line:
46
47 PID:USER:Sandbox Name:Command
48
49It is followed by relevant sandbox information, such as the virtual directories and various warnings.
50
51.SH EXAMPLE
52
53$ sudo jailcheck
54.br
552014:netblue::firejail /usr/bin/gimp
56.br
57 Virtual dirs: /tmp, /var/tmp, /dev, /usr/share,
58.br
59 Warning: I can run programs in /home/netblue
60.br
61 Networking: disabled
62.br
63
64.br
652055:netblue::firejail /usr/bin/ssh -X netblue@x.y.z.net
66.br
67 Virtual dirs: /var/tmp, /dev, /usr/share, /run/user/1000,
68.br
69 Warning: I can read ~/.ssh
70.br
71 Networking: enabled
72.br
73
74.br
752186:netblue:libreoffice:firejail --appimage /opt/LibreOffice-fresh.appimage
76.br
77 Virtual dirs: /tmp, /var/tmp, /dev,
78.br
79 Networking: enabled
80.br
81
82.br
8326090:netblue::/usr/bin/firejail /opt/firefox/firefox
84.br
85 Virtual dirs: /home/netblue, /tmp, /var/tmp, /dev, /etc, /usr/share,
86.br
87 /run/user/1000,
88.br
89 Networking: enabled
90.br
91
92.br
9326160:netblue:tor:firejail --private=~/tor-browser_en-US ./start-tor
94.br
95 Warning: AppArmor not enabled
96.br
97 Virtual dirs: /home/netblue, /tmp, /var/tmp, /dev, /etc, /bin,
98.br
99 /usr/share, /run/user/1000,
100.br
101 Warning: I can run programs in /home/netblue
102.br
103 Networking: enabled
104.br
105
106
107.SH LICENSE
108This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
109.PP
110Homepage: https://firejail.wordpress.com
111.SH SEE ALSO
112.BR firejail (1),
113.BR firemon (1),
114.BR firecfg (1),
115.BR firejail-profile (5),
116.BR firejail-login (5),
117.BR firejail-users (5),
diff --git a/src/man/preproc.awk b/src/man/preproc.awk
new file mode 100755
index 000000000..1ce5c82de
--- /dev/null
+++ b/src/man/preproc.awk
@@ -0,0 +1,55 @@
1#!/usr/bin/gawk -E
2
3# Copyright (c) 2019-2021 rusty-snake
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to deal
7# in the Software without restriction, including without limitation the rights
8# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9# copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in all
13# copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22
23BEGIN {
24 macros[0] = 0
25 for (arg in ARGV) {
26 if (ARGV[arg] ~ /^-D[A-Z0-9_]+$/) {
27 macros[length(macros) + 1] = substr(ARGV[arg], 3)
28 }
29 ARGV[arg] = ""
30 }
31
32 include = 1
33}
34/^#ifdef [A-Z0-9_]+$/ {
35 macro = substr($0, 8)
36 for (i in macros) {
37 if (macros[i] == macro) {
38 include = 1
39 next
40 }
41 }
42 include = 0
43}
44/^#if 0$/ {
45 include = 0
46 next
47}
48/^#endif$/ {
49 include = 1
50 next
51}
52{
53 if (include)
54 print
55}
diff --git a/src/profstats/Makefile.in b/src/profstats/Makefile.in
new file mode 100644
index 000000000..e025f5939
--- /dev/null
+++ b/src/profstats/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: profstats
3
4include ../common.mk
5
6%.o : %.c $(H_FILE_LIST)
7 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@
8
9profstats: $(OBJS)
10 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS)
11
12.PHONY: clean
13clean:; rm -fr *.o profstats *.gcov *.gcda *.gcno *.plist
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/profstats/main.c b/src/profstats/main.c
new file mode 100644
index 000000000..10e44bd65
--- /dev/null
+++ b/src/profstats/main.c
@@ -0,0 +1,378 @@
1 /*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include <stdio.h>
21#include <stdlib.h>
22#include <string.h>
23#include <assert.h>
24
25#define MAXBUF 2048
26// stats
27static int cnt_profiles = 0;
28static int cnt_apparmor = 0;
29static int cnt_seccomp = 0;
30static int cnt_caps = 0;
31static int cnt_dbus_system_none = 0;
32static int cnt_dbus_user_none = 0;
33static int cnt_dbus_system_filter = 0;
34static int cnt_dbus_user_filter = 0;
35static int cnt_dotlocal = 0;
36static int cnt_globalsdotlocal = 0;
37static int cnt_netnone = 0;
38static int cnt_noexec = 0; // include disable-exec.inc
39static int cnt_privatebin = 0;
40static int cnt_privatedev = 0;
41static int cnt_privatetmp = 0;
42static int cnt_privateetc = 0;
43static int cnt_whitelistvar = 0; // include whitelist-var-common.inc
44static int cnt_whitelistrunuser = 0; // include whitelist-runuser-common.inc
45static int cnt_whitelistusrshare = 0; // include whitelist-usr-share-common.inc
46static int cnt_ssh = 0;
47static int cnt_mdwx = 0;
48static int cnt_whitelisthome = 0;
49static int cnt_noroot = 0;
50
51static int level = 0;
52static int arg_debug = 0;
53static int arg_apparmor = 0;
54static int arg_caps = 0;
55static int arg_seccomp = 0;
56static int arg_noexec = 0;
57static int arg_privatebin = 0;
58static int arg_privatedev = 0;
59static int arg_privatetmp = 0;
60static int arg_privateetc = 0;
61static int arg_whitelistvar = 0;
62static int arg_whitelistrunuser = 0;
63static int arg_whitelistusrshare = 0;
64static int arg_ssh = 0;
65static int arg_mdwx = 0;
66static int arg_dbus_system_none = 0;
67static int arg_dbus_user_none = 0;
68static int arg_whitelisthome = 0;
69static int arg_noroot = 0;
70
71
72static char *profile = NULL;
73
74
75static void usage(void) {
76 printf("proftool - print profile statistics\n");
77 printf("Usage: proftool [options] file[s]\n");
78 printf("Options:\n");
79 printf(" --apparmor - print profiles without apparmor\n");
80 printf(" --caps - print profiles without caps\n");
81 printf(" --dbus-system-none - profiles without \"dbus-system none\"\n");
82 printf(" --dbus-user-none - profiles without \"dbus-user none\"\n");
83 printf(" --ssh - print profiles without \"include disable-common.inc\"\n");
84 printf(" --noexec - print profiles without \"include disable-exec.inc\"\n");
85 printf(" --noroot - print profiles without \"noroot\"\n");
86 printf(" --private-bin - print profiles without private-bin\n");
87 printf(" --private-dev - print profiles without private-dev\n");
88 printf(" --private-etc - print profiles without private-etc\n");
89 printf(" --private-tmp - print profiles without private-tmp\n");
90 printf(" --seccomp - print profiles without seccomp\n");
91 printf(" --memory-deny-write-execute - profile without \"memory-deny-write-execute\"\n");
92 printf(" --whitelist-home - print profiles whitelisting home directory\n");
93 printf(" --whitelist-var - print profiles without \"include whitelist-var-common.inc\"\n");
94 printf(" --whitelist-runuser - print profiles without \"include whitelist-runuser-common.inc\" or \"blacklist ${RUNUSER}\"\n");
95 printf(" --whitelist-usrshare - print profiles without \"include whitelist-usr-share-common.inc\"\n");
96 printf(" --debug\n");
97 printf("\n");
98}
99
100void process_file(const char *fname) {
101 assert(fname);
102
103 if (arg_debug)
104 printf("processing #%s#\n", fname);
105 level++;
106 assert(level < 32); // to do - check in firejail code
107
108 FILE *fp = fopen(fname, "r");
109 if (!fp) {
110 fprintf(stderr, "Warning: cannot open %s, while processing %s\n", fname, profile);
111 level--;
112 return;
113 }
114
115 int have_include_local = 0;
116 char buf[MAXBUF];
117 while (fgets(buf, MAXBUF, fp)) {
118 char *ptr = strchr(buf, '\n');
119 if (ptr)
120 *ptr = '\0';
121 ptr = buf;
122
123 while (*ptr == ' ' || *ptr == '\t')
124 ptr++;
125 if (*ptr == '\n' || *ptr == '#')
126 continue;
127
128 if (strncmp(ptr, "seccomp", 7) == 0)
129 cnt_seccomp++;
130 else if (strncmp(ptr, "caps", 4) == 0)
131 cnt_caps++;
132 else if (strncmp(ptr, "include disable-exec.inc", 24) == 0)
133 cnt_noexec++;
134 else if (strncmp(ptr, "noroot", 6) == 0)
135 cnt_noroot++;
136 else if (strncmp(ptr, "include whitelist-var-common.inc", 32) == 0)
137 cnt_whitelistvar++;
138 else if (strncmp(ptr, "include whitelist-runuser-common.inc", 36) == 0 ||
139 strncmp(ptr, "blacklist ${RUNUSER}", 20) == 0)
140 cnt_whitelistrunuser++;
141 else if (strncmp(ptr, "include whitelist-common.inc", 28) == 0)
142 cnt_whitelisthome++;
143 else if (strncmp(ptr, "include whitelist-usr-share-common.inc", 38) == 0)
144 cnt_whitelistusrshare++;
145 else if (strncmp(ptr, "include disable-common.inc", 26) == 0)
146 cnt_ssh++;
147 else if (strncmp(ptr, "memory-deny-write-execute", 25) == 0)
148 cnt_mdwx++;
149 else if (strncmp(ptr, "net none", 8) == 0)
150 cnt_netnone++;
151 else if (strncmp(ptr, "apparmor", 8) == 0)
152 cnt_apparmor++;
153 else if (strncmp(ptr, "private-bin", 11) == 0)
154 cnt_privatebin++;
155 else if (strncmp(ptr, "private-dev", 11) == 0)
156 cnt_privatedev++;
157 else if (strncmp(ptr, "private-tmp", 11) == 0)
158 cnt_privatetmp++;
159 else if (strncmp(ptr, "private-etc", 11) == 0)
160 cnt_privateetc++;
161 else if (strncmp(ptr, "dbus-system none", 16) == 0)
162 cnt_dbus_system_none++;
163 else if (strncmp(ptr, "dbus-system", 11) == 0)
164 cnt_dbus_system_filter++;
165 else if (strncmp(ptr, "dbus-user none", 14) == 0)
166 cnt_dbus_user_none++;
167 else if (strncmp(ptr, "dbus-user", 9) == 0)
168 cnt_dbus_user_filter++;
169 else if (strncmp(ptr, "include ", 8) == 0) {
170 // not processing .local files
171 if (strstr(ptr, ".local")) {
172 have_include_local = 1;
173//printf("dotlocal %d, level %d - #%s#, redirect #%s#\n", cnt_dotlocal, level, fname, buf + 8);
174 if (strstr(ptr, "globals.local"))
175 cnt_globalsdotlocal++;
176 else
177 cnt_dotlocal++;
178 continue;
179 }
180 // clean blanks
181 char *ptr = buf + 8;
182 while (*ptr != '\0' && *ptr != ' ' && *ptr != '\t')
183 ptr++;
184 *ptr = '\0';
185 process_file(buf + 8);
186 }
187 }
188
189 fclose(fp);
190 if (!have_include_local)
191 printf("No include .local found in %s\n", fname);
192 level--;
193}
194
195int main(int argc, char **argv) {
196 if (argc <= 1) {
197 usage();
198 return 1;
199 }
200
201 int start = 1;
202 int i;
203 for (i = 1; i < argc; i++) {
204 if (strcmp(argv[i], "--help") == 0) {
205 usage();
206 return 0;
207 }
208 else if (strcmp(argv[i], "--debug") == 0)
209 arg_debug = 1;
210 else if (strcmp(argv[i], "--apparmor") == 0)
211 arg_apparmor = 1;
212 else if (strcmp(argv[i], "--caps") == 0)
213 arg_caps = 1;
214 else if (strcmp(argv[i], "--seccomp") == 0)
215 arg_seccomp = 1;
216 else if (strcmp(argv[i], "--memory-deny-write-execute") == 0)
217 arg_mdwx = 1;
218 else if (strcmp(argv[i], "--noexec") == 0)
219 arg_noexec = 1;
220 else if (strcmp(argv[i], "--noroot") == 0)
221 arg_noroot = 1;
222 else if (strcmp(argv[i], "--private-bin") == 0)
223 arg_privatebin = 1;
224 else if (strcmp(argv[i], "--private-dev") == 0)
225 arg_privatedev = 1;
226 else if (strcmp(argv[i], "--private-tmp") == 0)
227 arg_privatetmp = 1;
228 else if (strcmp(argv[i], "--private-etc") == 0)
229 arg_privateetc = 1;
230 else if (strcmp(argv[i], "--whitelist-home") == 0)
231 arg_whitelisthome = 1;
232 else if (strcmp(argv[i], "--whitelist-var") == 0)
233 arg_whitelistvar = 1;
234 else if (strcmp(argv[i], "--whitelist-runuser") == 0)
235 arg_whitelistrunuser = 1;
236 else if (strcmp(argv[i], "--whitelist-usrshare") == 0)
237 arg_whitelistusrshare = 1;
238 else if (strcmp(argv[i], "--ssh") == 0)
239 arg_ssh = 1;
240 else if (strcmp(argv[i], "--dbus-system-none") == 0)
241 arg_dbus_system_none = 1;
242 else if (strcmp(argv[i], "--dbus-user-none") == 0)
243 arg_dbus_user_none = 1;
244 else if (*argv[i] == '-') {
245 fprintf(stderr, "Error: invalid option %s\n", argv[i]);
246 return 1;
247 }
248 else
249 break;
250 }
251
252 start = i;
253 if (i == argc) {
254 fprintf(stderr, "Error: no profile file specified\n");
255 return 1;
256 }
257
258 for (i = start; i < argc; i++) {
259 cnt_profiles++;
260
261 // watch seccomp
262 int seccomp = cnt_seccomp;
263 int caps = cnt_caps;
264 int apparmor = cnt_apparmor;
265 int noexec = cnt_noexec;
266 int noroot = cnt_noroot;
267 int privatebin = cnt_privatebin;
268 int privatetmp = cnt_privatetmp;
269 int privatedev = cnt_privatedev;
270 int privateetc = cnt_privateetc;
271 int dotlocal = cnt_dotlocal;
272 int globalsdotlocal = cnt_globalsdotlocal;
273 int whitelisthome = cnt_whitelisthome;
274 int whitelistvar = cnt_whitelistvar;
275 int whitelistrunuser = cnt_whitelistrunuser;
276 int whitelistusrshare = cnt_whitelistusrshare;
277 int dbussystemnone = cnt_dbus_system_none;
278 int dbussystemfilter = cnt_dbus_system_filter;
279 int dbususernone = cnt_dbus_user_none;
280 int dbususerfilter = cnt_dbus_user_filter;
281 int ssh = cnt_ssh;
282 int mdwx = cnt_mdwx;
283
284 // process file
285 profile = argv[i];
286 process_file(argv[i]);
287
288 // warnings
289 if ((caps + 2) <= cnt_caps) {
290 printf("Warning: multiple caps in %s\n", argv[i]);
291 cnt_caps = caps + 1;
292 }
293
294 // fix redirections
295 if (cnt_dotlocal > (dotlocal + 1))
296 cnt_dotlocal = dotlocal + 1;
297 if (cnt_globalsdotlocal > (globalsdotlocal + 1))
298 cnt_globalsdotlocal = globalsdotlocal + 1;
299 if (cnt_whitelistrunuser > (whitelistrunuser + 1))
300 cnt_whitelistrunuser = whitelistrunuser + 1;
301 if (cnt_seccomp > (seccomp + 1))
302 cnt_seccomp = seccomp + 1;
303 if (cnt_dbus_user_none > (dbususernone + 1))
304 cnt_dbus_user_none = dbususernone + 1;
305 if (cnt_dbus_user_filter > (dbususerfilter + 1))
306 cnt_dbus_user_filter = dbususerfilter + 1;
307 if (cnt_dbus_system_none > (dbussystemnone + 1))
308 cnt_dbus_system_none = dbussystemnone + 1;
309 if (cnt_dbus_system_filter > (dbussystemfilter + 1))
310 cnt_dbus_system_filter = dbussystemfilter + 1;
311
312 if (arg_dbus_system_none && dbussystemnone == cnt_dbus_system_none)
313 printf("No dbus-system none found in %s\n", argv[i]);
314 if (arg_dbus_user_none && dbususernone == cnt_dbus_user_none)
315 printf("No dbus-user none found in %s\n", argv[i]);
316 if (arg_apparmor && apparmor == cnt_apparmor)
317 printf("No apparmor found in %s\n", argv[i]);
318 if (arg_caps && caps == cnt_caps)
319 printf("No caps found in %s\n", argv[i]);
320 if (arg_seccomp && seccomp == cnt_seccomp)
321 printf("No seccomp found in %s\n", argv[i]);
322 if (arg_noexec && noexec == cnt_noexec)
323 printf("No include disable-exec.inc found in %s\n", argv[i]);
324 if (arg_noroot && noroot == cnt_noroot)
325 printf("No noroot found in %s\n", argv[i]);
326 if (arg_privatedev && privatedev == cnt_privatedev)
327 printf("No private-dev found in %s\n", argv[i]);
328 if (arg_privatebin && privatebin == cnt_privatebin)
329 printf("No private-bin found in %s\n", argv[i]);
330 if (arg_privatetmp && privatetmp == cnt_privatetmp)
331 printf("No private-tmp found in %s\n", argv[i]);
332 if (arg_privateetc && privateetc == cnt_privateetc)
333 printf("No private-etc found in %s\n", argv[i]);
334 if (arg_whitelisthome && whitelisthome == cnt_whitelisthome)
335 printf("Home directory not whitelisted in %s\n", argv[i]);
336 if (arg_whitelistvar && whitelistvar == cnt_whitelistvar)
337 printf("No include whitelist-var-common.inc found in %s\n", argv[i]);
338 if (arg_whitelistrunuser && whitelistrunuser == cnt_whitelistrunuser)
339 printf("No include whitelist-runuser-common.inc found in %s\n", argv[i]);
340 if (arg_whitelistusrshare && whitelistusrshare == cnt_whitelistusrshare)
341 printf("No include whitelist-usr-share-common.inc found in %s\n", argv[i]);
342 if (arg_ssh && ssh == cnt_ssh)
343 printf("No include disable-common.inc found in %s\n", argv[i]);
344 if (arg_mdwx && mdwx == cnt_mdwx)
345 printf("No memory-deny-write-execute found in %s\n", argv[i]);
346
347 assert(level == 0);
348 }
349
350 printf("\n");
351 printf("Stats:\n");
352 printf(" profiles\t\t\t%d\n", cnt_profiles);
353 printf(" include local profile\t%d (include profile-name.local)\n", cnt_dotlocal);
354 printf(" include globals\t\t%d (include globals.local)\n", cnt_globalsdotlocal);
355 printf(" blacklist ~/.ssh\t\t%d (include disable-common.inc)\n", cnt_ssh);
356 printf(" seccomp\t\t\t%d\n", cnt_seccomp);
357 printf(" capabilities\t\t%d\n", cnt_caps);
358 printf(" noexec\t\t\t%d (include disable-exec.inc)\n", cnt_noexec);
359 printf(" noroot\t\t\t%d\n", cnt_noroot);
360 printf(" memory-deny-write-execute\t%d\n", cnt_mdwx);
361 printf(" apparmor\t\t\t%d\n", cnt_apparmor);
362 printf(" private-bin\t\t\t%d\n", cnt_privatebin);
363 printf(" private-dev\t\t\t%d\n", cnt_privatedev);
364 printf(" private-etc\t\t\t%d\n", cnt_privateetc);
365 printf(" private-tmp\t\t\t%d\n", cnt_privatetmp);
366 printf(" whitelist home directory\t%d\n", cnt_whitelisthome);
367 printf(" whitelist var\t\t%d (include whitelist-var-common.inc)\n", cnt_whitelistvar);
368 printf(" whitelist run/user\t\t%d (include whitelist-runuser-common.inc\n", cnt_whitelistrunuser);
369 printf("\t\t\t\t\tor blacklist ${RUNUSER})\n");
370 printf(" whitelist usr/share\t\t%d (include whitelist-usr-share-common.inc\n", cnt_whitelistusrshare);
371 printf(" net none\t\t\t%d\n", cnt_netnone);
372 printf(" dbus-user none \t\t%d\n", cnt_dbus_user_none);
373 printf(" dbus-user filter \t\t%d\n", cnt_dbus_user_filter);
374 printf(" dbus-system none \t\t%d\n", cnt_dbus_system_none);
375 printf(" dbus-system filter \t\t%d\n", cnt_dbus_system_filter);
376 printf("\n");
377 return 0;
378}
diff --git a/src/tools/check-caps.sh b/src/tools/check-caps.sh
index 13525677b..b7026b1cd 100755
--- a/src/tools/check-caps.sh
+++ b/src/tools/check-caps.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3if [ $# -eq 0 ] 6if [ $# -eq 0 ]
4then 7then
diff --git a/src/tools/config-4.4.0-1-grsec-amd64 b/src/tools/config-4.4.0-1-grsec-amd64
deleted file mode 100644
index 82215c460..000000000
--- a/src/tools/config-4.4.0-1-grsec-amd64
+++ /dev/null
@@ -1,7430 +0,0 @@
1#
2# Automatically generated file; DO NOT EDIT.
3# Linux/x86 4.4.6 Kernel Configuration
4#
5CONFIG_64BIT=y
6CONFIG_X86_64=y
7CONFIG_X86=y
8CONFIG_INSTRUCTION_DECODER=y
9CONFIG_PERF_EVENTS_INTEL_UNCORE=y
10CONFIG_OUTPUT_FORMAT="elf64-x86-64"
11CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
12CONFIG_LOCKDEP_SUPPORT=y
13CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
15CONFIG_MMU=y
16CONFIG_NEED_DMA_MAP_STATE=y
17CONFIG_NEED_SG_DMA_LENGTH=y
18CONFIG_GENERIC_ISA_DMA=y
19CONFIG_GENERIC_BUG=y
20CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
21CONFIG_GENERIC_HWEIGHT=y
22CONFIG_ARCH_MAY_HAVE_PC_FDC=y
23CONFIG_RWSEM_XCHGADD_ALGORITHM=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_HAS_CPU_RELAX=y
26CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
27CONFIG_HAVE_SETUP_PER_CPU_AREA=y
28CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
29CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
30CONFIG_ARCH_HIBERNATION_POSSIBLE=y
31CONFIG_ARCH_SUSPEND_POSSIBLE=y
32CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
33CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
34CONFIG_ZONE_DMA32=y
35CONFIG_AUDIT_ARCH=y
36CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
37CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
38CONFIG_HAVE_INTEL_TXT=y
39CONFIG_X86_64_SMP=y
40CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
41CONFIG_ARCH_SUPPORTS_UPROBES=y
42CONFIG_FIX_EARLYCON_MEM=y
43CONFIG_PGTABLE_LEVELS=4
44CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
45CONFIG_IRQ_WORK=y
46CONFIG_BUILDTIME_EXTABLE_SORT=y
47
48#
49# General setup
50#
51CONFIG_INIT_ENV_ARG_LIMIT=32
52CONFIG_CROSS_COMPILE=""
53# CONFIG_COMPILE_TEST is not set
54CONFIG_LOCALVERSION=""
55# CONFIG_LOCALVERSION_AUTO is not set
56CONFIG_HAVE_KERNEL_GZIP=y
57CONFIG_HAVE_KERNEL_BZIP2=y
58CONFIG_HAVE_KERNEL_LZMA=y
59CONFIG_HAVE_KERNEL_XZ=y
60CONFIG_HAVE_KERNEL_LZO=y
61CONFIG_HAVE_KERNEL_LZ4=y
62# CONFIG_KERNEL_GZIP is not set
63# CONFIG_KERNEL_BZIP2 is not set
64# CONFIG_KERNEL_LZMA is not set
65CONFIG_KERNEL_XZ=y
66# CONFIG_KERNEL_LZO is not set
67# CONFIG_KERNEL_LZ4 is not set
68CONFIG_DEFAULT_HOSTNAME="(none)"
69CONFIG_SWAP=y
70CONFIG_SYSVIPC=y
71CONFIG_SYSVIPC_SYSCTL=y
72CONFIG_POSIX_MQUEUE=y
73CONFIG_POSIX_MQUEUE_SYSCTL=y
74CONFIG_CROSS_MEMORY_ATTACH=y
75CONFIG_FHANDLE=y
76CONFIG_AUDIT=y
77CONFIG_HAVE_ARCH_AUDITSYSCALL=y
78CONFIG_AUDITSYSCALL=y
79CONFIG_AUDIT_WATCH=y
80CONFIG_AUDIT_TREE=y
81
82#
83# IRQ subsystem
84#
85CONFIG_GENERIC_IRQ_PROBE=y
86CONFIG_GENERIC_IRQ_SHOW=y
87CONFIG_GENERIC_PENDING_IRQ=y
88CONFIG_GENERIC_IRQ_CHIP=y
89CONFIG_IRQ_DOMAIN=y
90CONFIG_IRQ_DOMAIN_HIERARCHY=y
91CONFIG_GENERIC_MSI_IRQ=y
92CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
93CONFIG_IRQ_FORCED_THREADING=y
94CONFIG_SPARSE_IRQ=y
95CONFIG_CLOCKSOURCE_WATCHDOG=y
96CONFIG_ARCH_CLOCKSOURCE_DATA=y
97CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y
98CONFIG_GENERIC_TIME_VSYSCALL=y
99CONFIG_GENERIC_CLOCKEVENTS=y
100CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
101CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
102CONFIG_GENERIC_CMOS_UPDATE=y
103
104#
105# Timers subsystem
106#
107CONFIG_TICK_ONESHOT=y
108CONFIG_NO_HZ_COMMON=y
109# CONFIG_HZ_PERIODIC is not set
110CONFIG_NO_HZ_IDLE=y
111# CONFIG_NO_HZ_FULL is not set
112# CONFIG_NO_HZ is not set
113CONFIG_HIGH_RES_TIMERS=y
114
115#
116# CPU/Task time and stats accounting
117#
118CONFIG_TICK_CPU_ACCOUNTING=y
119# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
120# CONFIG_IRQ_TIME_ACCOUNTING is not set
121CONFIG_BSD_PROCESS_ACCT=y
122CONFIG_BSD_PROCESS_ACCT_V3=y
123CONFIG_TASKSTATS=y
124CONFIG_TASK_DELAY_ACCT=y
125CONFIG_TASK_XACCT=y
126CONFIG_TASK_IO_ACCOUNTING=y
127
128#
129# RCU Subsystem
130#
131CONFIG_TREE_RCU=y
132# CONFIG_RCU_EXPERT is not set
133CONFIG_SRCU=y
134# CONFIG_TASKS_RCU is not set
135CONFIG_RCU_STALL_COMMON=y
136# CONFIG_RCU_EXPEDITE_BOOT is not set
137CONFIG_BUILD_BIN2C=y
138# CONFIG_IKCONFIG is not set
139CONFIG_LOG_BUF_SHIFT=17
140CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
141CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
142CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
143CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y
144CONFIG_NUMA_BALANCING=y
145# CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set
146CONFIG_CGROUPS=y
147# CONFIG_CGROUP_DEBUG is not set
148CONFIG_CGROUP_FREEZER=y
149CONFIG_CGROUP_PIDS=y
150CONFIG_CGROUP_DEVICE=y
151CONFIG_CPUSETS=y
152CONFIG_PROC_PID_CPUSET=y
153CONFIG_CGROUP_CPUACCT=y
154CONFIG_PAGE_COUNTER=y
155CONFIG_MEMCG=y
156CONFIG_MEMCG_DISABLED=y
157CONFIG_MEMCG_SWAP=y
158# CONFIG_MEMCG_SWAP_ENABLED is not set
159# CONFIG_MEMCG_KMEM is not set
160# CONFIG_CGROUP_HUGETLB is not set
161CONFIG_CGROUP_PERF=y
162CONFIG_CGROUP_SCHED=y
163CONFIG_FAIR_GROUP_SCHED=y
164CONFIG_CFS_BANDWIDTH=y
165# CONFIG_RT_GROUP_SCHED is not set
166CONFIG_BLK_CGROUP=y
167# CONFIG_DEBUG_BLK_CGROUP is not set
168CONFIG_CGROUP_WRITEBACK=y
169CONFIG_NAMESPACES=y
170CONFIG_UTS_NS=y
171CONFIG_IPC_NS=y
172CONFIG_USER_NS=y
173CONFIG_PID_NS=y
174CONFIG_NET_NS=y
175CONFIG_SCHED_AUTOGROUP=y
176# CONFIG_SYSFS_DEPRECATED is not set
177CONFIG_RELAY=y
178CONFIG_BLK_DEV_INITRD=y
179CONFIG_INITRAMFS_SOURCE=""
180CONFIG_RD_GZIP=y
181CONFIG_RD_BZIP2=y
182CONFIG_RD_LZMA=y
183CONFIG_RD_XZ=y
184CONFIG_RD_LZO=y
185CONFIG_RD_LZ4=y
186# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
187CONFIG_SYSCTL=y
188CONFIG_ANON_INODES=y
189CONFIG_HAVE_UID16=y
190CONFIG_SYSCTL_EXCEPTION_TRACE=y
191CONFIG_HAVE_PCSPKR_PLATFORM=y
192CONFIG_BPF=y
193CONFIG_EXPERT=y
194CONFIG_UID16=y
195CONFIG_MULTIUSER=y
196CONFIG_SGETMASK_SYSCALL=y
197CONFIG_SYSFS_SYSCALL=y
198# CONFIG_SYSCTL_SYSCALL is not set
199CONFIG_KALLSYMS=y
200CONFIG_KALLSYMS_ALL=y
201CONFIG_PRINTK=y
202CONFIG_BUG=y
203CONFIG_ELF_CORE=y
204CONFIG_PCSPKR_PLATFORM=y
205CONFIG_BASE_FULL=y
206CONFIG_FUTEX=y
207CONFIG_EPOLL=y
208CONFIG_SIGNALFD=y
209CONFIG_TIMERFD=y
210CONFIG_EVENTFD=y
211CONFIG_BPF_SYSCALL=y
212CONFIG_SHMEM=y
213CONFIG_AIO=y
214CONFIG_ADVISE_SYSCALLS=y
215# CONFIG_USERFAULTFD is not set
216CONFIG_PCI_QUIRKS=y
217CONFIG_MEMBARRIER=y
218# CONFIG_EMBEDDED is not set
219CONFIG_HAVE_PERF_EVENTS=y
220
221#
222# Kernel Performance Events And Counters
223#
224CONFIG_PERF_EVENTS=y
225# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
226CONFIG_VM_EVENT_COUNTERS=y
227# CONFIG_COMPAT_BRK is not set
228CONFIG_SLAB=y
229# CONFIG_SLUB is not set
230# CONFIG_SLOB is not set
231# CONFIG_SYSTEM_DATA_VERIFICATION is not set
232CONFIG_PROFILING=y
233CONFIG_OPROFILE=m
234# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
235CONFIG_HAVE_OPROFILE=y
236CONFIG_OPROFILE_NMI_TIMER=y
237CONFIG_KPROBES=y
238CONFIG_JUMP_LABEL=y
239# CONFIG_STATIC_KEYS_SELFTEST is not set
240CONFIG_OPTPROBES=y
241# CONFIG_UPROBES is not set
242# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
243CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
244CONFIG_ARCH_USE_BUILTIN_BSWAP=y
245CONFIG_KRETPROBES=y
246CONFIG_USER_RETURN_NOTIFIER=y
247CONFIG_HAVE_IOREMAP_PROT=y
248CONFIG_HAVE_KPROBES=y
249CONFIG_HAVE_KRETPROBES=y
250CONFIG_HAVE_OPTPROBES=y
251CONFIG_HAVE_KPROBES_ON_FTRACE=y
252CONFIG_HAVE_ARCH_TRACEHOOK=y
253CONFIG_HAVE_DMA_ATTRS=y
254CONFIG_HAVE_DMA_CONTIGUOUS=y
255CONFIG_GENERIC_SMP_IDLE_THREAD=y
256CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
257CONFIG_HAVE_CLK=y
258CONFIG_HAVE_DMA_API_DEBUG=y
259CONFIG_HAVE_HW_BREAKPOINT=y
260CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
261CONFIG_HAVE_USER_RETURN_NOTIFIER=y
262CONFIG_HAVE_PERF_EVENTS_NMI=y
263CONFIG_HAVE_PERF_REGS=y
264CONFIG_HAVE_PERF_USER_STACK_DUMP=y
265CONFIG_HAVE_ARCH_JUMP_LABEL=y
266CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
267CONFIG_HAVE_CMPXCHG_LOCAL=y
268CONFIG_HAVE_CMPXCHG_DOUBLE=y
269CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
270CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
271CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
272CONFIG_SECCOMP_FILTER=y
273CONFIG_HAVE_CC_STACKPROTECTOR=y
274CONFIG_CC_STACKPROTECTOR=y
275# CONFIG_CC_STACKPROTECTOR_NONE is not set
276# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
277CONFIG_CC_STACKPROTECTOR_STRONG=y
278CONFIG_HAVE_CONTEXT_TRACKING=y
279CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
280CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
281CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
282CONFIG_HAVE_ARCH_HUGE_VMAP=y
283CONFIG_HAVE_ARCH_SOFT_DIRTY=y
284CONFIG_MODULES_USE_ELF_RELA=y
285CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
286CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
287CONFIG_HAVE_COPY_THREAD_TLS=y
288CONFIG_OLD_SIGSUSPEND3=y
289CONFIG_COMPAT_OLD_SIGACTION=y
290
291#
292# GCOV-based kernel profiling
293#
294CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
295# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
296CONFIG_SLABINFO=y
297CONFIG_RT_MUTEXES=y
298CONFIG_BASE_SMALL=0
299CONFIG_MODULES=y
300CONFIG_MODULE_FORCE_LOAD=y
301CONFIG_MODULE_UNLOAD=y
302CONFIG_MODULE_FORCE_UNLOAD=y
303CONFIG_MODVERSIONS=y
304# CONFIG_MODULE_SRCVERSION_ALL is not set
305# CONFIG_MODULE_SIG is not set
306# CONFIG_MODULE_COMPRESS is not set
307CONFIG_MODULES_TREE_LOOKUP=y
308CONFIG_BLOCK=y
309CONFIG_BLK_DEV_BSG=y
310CONFIG_BLK_DEV_BSGLIB=y
311CONFIG_BLK_DEV_INTEGRITY=y
312CONFIG_BLK_DEV_THROTTLING=y
313# CONFIG_BLK_CMDLINE_PARSER is not set
314
315#
316# Partition Types
317#
318CONFIG_PARTITION_ADVANCED=y
319CONFIG_ACORN_PARTITION=y
320# CONFIG_ACORN_PARTITION_CUMANA is not set
321# CONFIG_ACORN_PARTITION_EESOX is not set
322CONFIG_ACORN_PARTITION_ICS=y
323# CONFIG_ACORN_PARTITION_ADFS is not set
324# CONFIG_ACORN_PARTITION_POWERTEC is not set
325CONFIG_ACORN_PARTITION_RISCIX=y
326# CONFIG_AIX_PARTITION is not set
327CONFIG_OSF_PARTITION=y
328CONFIG_AMIGA_PARTITION=y
329CONFIG_ATARI_PARTITION=y
330CONFIG_MAC_PARTITION=y
331CONFIG_MSDOS_PARTITION=y
332CONFIG_BSD_DISKLABEL=y
333CONFIG_MINIX_SUBPARTITION=y
334CONFIG_SOLARIS_X86_PARTITION=y
335CONFIG_UNIXWARE_DISKLABEL=y
336CONFIG_LDM_PARTITION=y
337# CONFIG_LDM_DEBUG is not set
338CONFIG_SGI_PARTITION=y
339CONFIG_ULTRIX_PARTITION=y
340CONFIG_SUN_PARTITION=y
341CONFIG_KARMA_PARTITION=y
342CONFIG_EFI_PARTITION=y
343# CONFIG_SYSV68_PARTITION is not set
344# CONFIG_CMDLINE_PARTITION is not set
345CONFIG_BLOCK_COMPAT=y
346
347#
348# IO Schedulers
349#
350CONFIG_IOSCHED_NOOP=y
351CONFIG_IOSCHED_DEADLINE=y
352CONFIG_IOSCHED_CFQ=y
353CONFIG_CFQ_GROUP_IOSCHED=y
354# CONFIG_DEFAULT_DEADLINE is not set
355CONFIG_DEFAULT_CFQ=y
356# CONFIG_DEFAULT_NOOP is not set
357CONFIG_DEFAULT_IOSCHED="cfq"
358CONFIG_PREEMPT_NOTIFIERS=y
359CONFIG_PADATA=y
360CONFIG_ASN1=m
361CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
362CONFIG_INLINE_READ_UNLOCK=y
363CONFIG_INLINE_READ_UNLOCK_IRQ=y
364CONFIG_INLINE_WRITE_UNLOCK=y
365CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
366CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
367CONFIG_MUTEX_SPIN_ON_OWNER=y
368CONFIG_RWSEM_SPIN_ON_OWNER=y
369CONFIG_LOCK_SPIN_ON_OWNER=y
370CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
371CONFIG_QUEUED_SPINLOCKS=y
372CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
373CONFIG_QUEUED_RWLOCKS=y
374CONFIG_FREEZER=y
375
376#
377# Processor type and features
378#
379# CONFIG_ZONE_DMA is not set
380CONFIG_SMP=y
381CONFIG_X86_FEATURE_NAMES=y
382CONFIG_X86_X2APIC=y
383CONFIG_X86_MPPARSE=y
384# CONFIG_X86_EXTENDED_PLATFORM is not set
385CONFIG_X86_INTEL_LPSS=y
386CONFIG_X86_AMD_PLATFORM_DEVICE=y
387CONFIG_IOSF_MBI=m
388CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
389CONFIG_SCHED_OMIT_FRAME_POINTER=y
390CONFIG_HYPERVISOR_GUEST=y
391CONFIG_PARAVIRT=y
392# CONFIG_PARAVIRT_DEBUG is not set
393CONFIG_PARAVIRT_SPINLOCKS=y
394# CONFIG_XEN is not set
395CONFIG_KVM_GUEST=y
396# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
397CONFIG_PARAVIRT_CLOCK=y
398CONFIG_NO_BOOTMEM=y
399# CONFIG_MK8 is not set
400# CONFIG_MPSC is not set
401# CONFIG_MCORE2 is not set
402# CONFIG_MATOM is not set
403CONFIG_GENERIC_CPU=y
404CONFIG_X86_INTERNODE_CACHE_SHIFT=6
405CONFIG_X86_L1_CACHE_SHIFT=6
406CONFIG_X86_TSC=y
407CONFIG_X86_CMPXCHG64=y
408CONFIG_X86_CMOV=y
409CONFIG_X86_MINIMUM_CPU_FAMILY=64
410CONFIG_X86_DEBUGCTLMSR=y
411# CONFIG_PROCESSOR_SELECT is not set
412CONFIG_CPU_SUP_INTEL=y
413CONFIG_CPU_SUP_AMD=y
414CONFIG_CPU_SUP_CENTAUR=y
415CONFIG_HPET_TIMER=y
416CONFIG_HPET_EMULATE_RTC=y
417CONFIG_DMI=y
418CONFIG_GART_IOMMU=y
419CONFIG_CALGARY_IOMMU=y
420CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
421CONFIG_SWIOTLB=y
422CONFIG_IOMMU_HELPER=y
423# CONFIG_MAXSMP is not set
424CONFIG_NR_CPUS=512
425CONFIG_SCHED_SMT=y
426CONFIG_SCHED_MC=y
427# CONFIG_PREEMPT_NONE is not set
428CONFIG_PREEMPT_VOLUNTARY=y
429# CONFIG_PREEMPT is not set
430CONFIG_X86_LOCAL_APIC=y
431CONFIG_X86_IO_APIC=y
432CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
433CONFIG_X86_MCE=y
434CONFIG_X86_MCE_INTEL=y
435CONFIG_X86_MCE_AMD=y
436CONFIG_X86_MCE_THRESHOLD=y
437CONFIG_X86_MCE_INJECT=m
438CONFIG_X86_THERMAL_VECTOR=y
439# CONFIG_VM86 is not set
440CONFIG_X86_VSYSCALL_EMULATION=y
441CONFIG_I8K=m
442CONFIG_MICROCODE=y
443CONFIG_MICROCODE_INTEL=y
444CONFIG_MICROCODE_AMD=y
445CONFIG_MICROCODE_OLD_INTERFACE=y
446CONFIG_X86_MSR=m
447CONFIG_X86_CPUID=m
448CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
449CONFIG_ARCH_DMA_ADDR_T_64BIT=y
450CONFIG_X86_DIRECT_GBPAGES=y
451CONFIG_NUMA=y
452CONFIG_AMD_NUMA=y
453CONFIG_X86_64_ACPI_NUMA=y
454CONFIG_NODES_SPAN_OTHER_NODES=y
455CONFIG_NUMA_EMU=y
456CONFIG_NODES_SHIFT=6
457CONFIG_ARCH_SPARSEMEM_ENABLE=y
458CONFIG_ARCH_SPARSEMEM_DEFAULT=y
459CONFIG_ARCH_SELECT_MEMORY_MODEL=y
460# CONFIG_ARCH_MEMORY_PROBE is not set
461CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
462CONFIG_SELECT_MEMORY_MODEL=y
463CONFIG_SPARSEMEM_MANUAL=y
464CONFIG_SPARSEMEM=y
465CONFIG_NEED_MULTIPLE_NODES=y
466CONFIG_HAVE_MEMORY_PRESENT=y
467CONFIG_SPARSEMEM_EXTREME=y
468CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
469CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER=y
470CONFIG_SPARSEMEM_VMEMMAP=y
471CONFIG_HAVE_MEMBLOCK=y
472CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
473CONFIG_ARCH_DISCARD_MEMBLOCK=y
474CONFIG_MEMORY_ISOLATION=y
475# CONFIG_MOVABLE_NODE is not set
476CONFIG_HAVE_BOOTMEM_INFO_NODE=y
477CONFIG_MEMORY_HOTPLUG=y
478CONFIG_MEMORY_HOTPLUG_SPARSE=y
479CONFIG_MEMORY_HOTREMOVE=y
480CONFIG_SPLIT_PTLOCK_CPUS=4
481CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
482CONFIG_MEMORY_BALLOON=y
483CONFIG_BALLOON_COMPACTION=y
484CONFIG_COMPACTION=y
485CONFIG_MIGRATION=y
486CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
487CONFIG_PHYS_ADDR_T_64BIT=y
488CONFIG_ZONE_DMA_FLAG=0
489CONFIG_VIRT_TO_BUS=y
490CONFIG_MMU_NOTIFIER=y
491CONFIG_KSM=y
492CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
493CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
494CONFIG_MEMORY_FAILURE=y
495CONFIG_TRANSPARENT_HUGEPAGE=y
496# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
497CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
498# CONFIG_CLEANCACHE is not set
499CONFIG_FRONTSWAP=y
500# CONFIG_CMA is not set
501CONFIG_ZSWAP=y
502CONFIG_ZPOOL=y
503CONFIG_ZBUD=y
504CONFIG_ZSMALLOC=m
505# CONFIG_PGTABLE_MAPPING is not set
506CONFIG_GENERIC_EARLY_IOREMAP=y
507CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y
508# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set
509# CONFIG_IDLE_PAGE_TRACKING is not set
510CONFIG_ZONE_DEVICE=y
511CONFIG_FRAME_VECTOR=y
512CONFIG_X86_PMEM_LEGACY_DEVICE=y
513CONFIG_X86_PMEM_LEGACY=m
514# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
515CONFIG_X86_RESERVE_LOW=64
516CONFIG_MTRR=y
517CONFIG_MTRR_SANITIZER=y
518CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
519CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
520CONFIG_X86_PAT=y
521CONFIG_ARCH_USES_PG_UNCACHED=y
522CONFIG_ARCH_RANDOM=y
523CONFIG_X86_SMAP=y
524CONFIG_X86_INTEL_MPX=y
525CONFIG_EFI=y
526CONFIG_EFI_STUB=y
527CONFIG_EFI_MIXED=y
528CONFIG_SECCOMP=y
529# CONFIG_HZ_100 is not set
530CONFIG_HZ_250=y
531# CONFIG_HZ_300 is not set
532# CONFIG_HZ_1000 is not set
533CONFIG_HZ=250
534CONFIG_SCHED_HRTICK=y
535# CONFIG_KEXEC_FILE is not set
536CONFIG_CRASH_DUMP=y
537CONFIG_PHYSICAL_START=0x1000000
538CONFIG_RELOCATABLE=y
539CONFIG_RANDOMIZE_BASE=y
540CONFIG_RANDOMIZE_BASE_MAX_OFFSET=0x40000000
541CONFIG_X86_NEED_RELOCS=y
542CONFIG_PHYSICAL_ALIGN=0x1000000
543CONFIG_HOTPLUG_CPU=y
544# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set
545# CONFIG_DEBUG_HOTPLUG_CPU0 is not set
546CONFIG_LEGACY_VSYSCALL_EMULATE=y
547# CONFIG_LEGACY_VSYSCALL_NONE is not set
548# CONFIG_CMDLINE_BOOL is not set
549CONFIG_MODIFY_LDT_SYSCALL=y
550CONFIG_DEFAULT_MODIFY_LDT_SYSCALL=y
551CONFIG_HAVE_LIVEPATCH=y
552CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
553CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
554CONFIG_USE_PERCPU_NUMA_NODE_ID=y
555
556#
557# Power management and ACPI options
558#
559CONFIG_SUSPEND=y
560CONFIG_SUSPEND_FREEZER=y
561# CONFIG_SUSPEND_SKIP_SYNC is not set
562CONFIG_PM_SLEEP=y
563CONFIG_PM_SLEEP_SMP=y
564# CONFIG_PM_AUTOSLEEP is not set
565# CONFIG_PM_WAKELOCKS is not set
566CONFIG_PM=y
567CONFIG_PM_DEBUG=y
568CONFIG_PM_ADVANCED_DEBUG=y
569# CONFIG_PM_TEST_SUSPEND is not set
570CONFIG_PM_SLEEP_DEBUG=y
571# CONFIG_DPM_WATCHDOG is not set
572# CONFIG_PM_TRACE_RTC is not set
573CONFIG_PM_CLK=y
574# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
575CONFIG_ACPI=y
576CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
577CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
578CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
579# CONFIG_ACPI_DEBUGGER is not set
580CONFIG_ACPI_SLEEP=y
581# CONFIG_ACPI_PROCFS_POWER is not set
582CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
583# CONFIG_ACPI_EC_DEBUGFS is not set
584CONFIG_ACPI_AC=m
585CONFIG_ACPI_BATTERY=m
586CONFIG_ACPI_BUTTON=m
587CONFIG_ACPI_VIDEO=m
588CONFIG_ACPI_FAN=m
589CONFIG_ACPI_DOCK=y
590CONFIG_ACPI_CPU_FREQ_PSS=y
591CONFIG_ACPI_PROCESSOR_IDLE=y
592CONFIG_ACPI_PROCESSOR=m
593CONFIG_ACPI_IPMI=m
594CONFIG_ACPI_HOTPLUG_CPU=y
595CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
596CONFIG_ACPI_THERMAL=m
597CONFIG_ACPI_NUMA=y
598# CONFIG_ACPI_CUSTOM_DSDT is not set
599CONFIG_ACPI_INITRD_TABLE_OVERRIDE=y
600# CONFIG_ACPI_DEBUG is not set
601CONFIG_ACPI_PCI_SLOT=y
602CONFIG_X86_PM_TIMER=y
603CONFIG_ACPI_CONTAINER=y
604CONFIG_ACPI_HOTPLUG_MEMORY=y
605CONFIG_ACPI_HOTPLUG_IOAPIC=y
606CONFIG_ACPI_SBS=m
607CONFIG_ACPI_HED=y
608CONFIG_ACPI_BGRT=y
609# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set
610CONFIG_ACPI_NFIT=m
611CONFIG_HAVE_ACPI_APEI=y
612CONFIG_HAVE_ACPI_APEI_NMI=y
613CONFIG_ACPI_APEI=y
614CONFIG_ACPI_APEI_GHES=y
615CONFIG_ACPI_APEI_PCIEAER=y
616CONFIG_ACPI_APEI_MEMORY_FAILURE=y
617# CONFIG_ACPI_APEI_ERST_DEBUG is not set
618CONFIG_ACPI_EXTLOG=y
619# CONFIG_PMIC_OPREGION is not set
620CONFIG_SFI=y
621
622#
623# CPU Frequency scaling
624#
625CONFIG_CPU_FREQ=y
626CONFIG_CPU_FREQ_GOV_COMMON=y
627CONFIG_CPU_FREQ_STAT=m
628# CONFIG_CPU_FREQ_STAT_DETAILS is not set
629# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
630# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
631# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
632CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
633# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
634CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
635CONFIG_CPU_FREQ_GOV_POWERSAVE=m
636CONFIG_CPU_FREQ_GOV_USERSPACE=m
637CONFIG_CPU_FREQ_GOV_ONDEMAND=y
638CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
639
640#
641# CPU frequency scaling drivers
642#
643CONFIG_X86_INTEL_PSTATE=y
644CONFIG_X86_PCC_CPUFREQ=m
645CONFIG_X86_ACPI_CPUFREQ=m
646CONFIG_X86_ACPI_CPUFREQ_CPB=y
647CONFIG_X86_POWERNOW_K8=m
648CONFIG_X86_AMD_FREQ_SENSITIVITY=m
649CONFIG_X86_SPEEDSTEP_CENTRINO=m
650CONFIG_X86_P4_CLOCKMOD=m
651
652#
653# shared options
654#
655CONFIG_X86_SPEEDSTEP_LIB=m
656
657#
658# CPU Idle
659#
660CONFIG_CPU_IDLE=y
661CONFIG_CPU_IDLE_GOV_LADDER=y
662CONFIG_CPU_IDLE_GOV_MENU=y
663# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
664CONFIG_INTEL_IDLE=y
665
666#
667# Memory power savings
668#
669CONFIG_I7300_IDLE_IOAT_CHANNEL=y
670CONFIG_I7300_IDLE=m
671
672#
673# Bus options (PCI etc.)
674#
675CONFIG_PCI=y
676CONFIG_PCI_DIRECT=y
677CONFIG_PCI_MMCONFIG=y
678CONFIG_PCI_DOMAINS=y
679# CONFIG_PCI_CNB20LE_QUIRK is not set
680CONFIG_PCIEPORTBUS=y
681CONFIG_HOTPLUG_PCI_PCIE=y
682CONFIG_PCIEAER=y
683# CONFIG_PCIE_ECRC is not set
684CONFIG_PCIEAER_INJECT=m
685CONFIG_PCIEASPM=y
686# CONFIG_PCIEASPM_DEBUG is not set
687CONFIG_PCIEASPM_DEFAULT=y
688# CONFIG_PCIEASPM_POWERSAVE is not set
689# CONFIG_PCIEASPM_PERFORMANCE is not set
690CONFIG_PCIE_PME=y
691CONFIG_PCI_BUS_ADDR_T_64BIT=y
692CONFIG_PCI_MSI=y
693CONFIG_PCI_MSI_IRQ_DOMAIN=y
694# CONFIG_PCI_DEBUG is not set
695CONFIG_PCI_REALLOC_ENABLE_AUTO=y
696CONFIG_PCI_STUB=m
697CONFIG_HT_IRQ=y
698CONFIG_PCI_ATS=y
699CONFIG_PCI_IOV=y
700CONFIG_PCI_PRI=y
701CONFIG_PCI_PASID=y
702CONFIG_PCI_LABEL=y
703
704#
705# PCI host controller drivers
706#
707CONFIG_ISA_DMA_API=y
708CONFIG_AMD_NB=y
709CONFIG_PCCARD=m
710CONFIG_PCMCIA=m
711CONFIG_PCMCIA_LOAD_CIS=y
712CONFIG_CARDBUS=y
713
714#
715# PC-card bridges
716#
717CONFIG_YENTA=m
718CONFIG_YENTA_O2=y
719CONFIG_YENTA_RICOH=y
720CONFIG_YENTA_TI=y
721CONFIG_YENTA_ENE_TUNE=y
722CONFIG_YENTA_TOSHIBA=y
723CONFIG_PD6729=m
724CONFIG_I82092=m
725CONFIG_PCCARD_NONSTATIC=y
726CONFIG_HOTPLUG_PCI=y
727CONFIG_HOTPLUG_PCI_ACPI=y
728CONFIG_HOTPLUG_PCI_ACPI_IBM=m
729CONFIG_HOTPLUG_PCI_CPCI=y
730CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
731CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
732CONFIG_HOTPLUG_PCI_SHPC=m
733# CONFIG_RAPIDIO is not set
734CONFIG_X86_SYSFB=y
735
736#
737# Executable file formats / Emulations
738#
739CONFIG_BINFMT_ELF=y
740CONFIG_COMPAT_BINFMT_ELF=y
741CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
742CONFIG_BINFMT_SCRIPT=y
743# CONFIG_HAVE_AOUT is not set
744CONFIG_BINFMT_MISC=m
745CONFIG_COREDUMP=y
746CONFIG_IA32_EMULATION=y
747CONFIG_IA32_AOUT=y
748# CONFIG_X86_X32 is not set
749CONFIG_COMPAT=y
750CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
751CONFIG_SYSVIPC_COMPAT=y
752CONFIG_KEYS_COMPAT=y
753CONFIG_X86_DEV_DMA_OPS=y
754CONFIG_PMC_ATOM=y
755CONFIG_NET=y
756CONFIG_COMPAT_NETLINK_MESSAGES=y
757CONFIG_NET_INGRESS=y
758
759#
760# Networking options
761#
762CONFIG_PACKET=y
763CONFIG_PACKET_DIAG=m
764CONFIG_UNIX=y
765CONFIG_UNIX_DIAG=m
766CONFIG_XFRM=y
767CONFIG_XFRM_ALGO=m
768CONFIG_XFRM_USER=m
769CONFIG_XFRM_SUB_POLICY=y
770CONFIG_XFRM_MIGRATE=y
771# CONFIG_XFRM_STATISTICS is not set
772CONFIG_XFRM_IPCOMP=m
773CONFIG_NET_KEY=m
774CONFIG_NET_KEY_MIGRATE=y
775CONFIG_INET=y
776CONFIG_IP_MULTICAST=y
777CONFIG_IP_ADVANCED_ROUTER=y
778CONFIG_IP_FIB_TRIE_STATS=y
779CONFIG_IP_MULTIPLE_TABLES=y
780CONFIG_IP_ROUTE_MULTIPATH=y
781CONFIG_IP_ROUTE_VERBOSE=y
782CONFIG_IP_ROUTE_CLASSID=y
783# CONFIG_IP_PNP is not set
784CONFIG_NET_IPIP=m
785CONFIG_NET_IPGRE_DEMUX=m
786CONFIG_NET_IP_TUNNEL=m
787CONFIG_NET_IPGRE=m
788CONFIG_NET_IPGRE_BROADCAST=y
789CONFIG_IP_MROUTE=y
790CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
791CONFIG_IP_PIMSM_V1=y
792CONFIG_IP_PIMSM_V2=y
793CONFIG_SYN_COOKIES=y
794CONFIG_NET_IPVTI=m
795CONFIG_NET_UDP_TUNNEL=m
796CONFIG_NET_FOU=m
797CONFIG_NET_FOU_IP_TUNNELS=y
798CONFIG_INET_AH=m
799CONFIG_INET_ESP=m
800CONFIG_INET_IPCOMP=m
801CONFIG_INET_XFRM_TUNNEL=m
802CONFIG_INET_TUNNEL=m
803CONFIG_INET_XFRM_MODE_TRANSPORT=m
804CONFIG_INET_XFRM_MODE_TUNNEL=m
805CONFIG_INET_XFRM_MODE_BEET=m
806CONFIG_INET_LRO=m
807CONFIG_INET_DIAG=m
808CONFIG_INET_TCP_DIAG=m
809CONFIG_INET_UDP_DIAG=m
810CONFIG_TCP_CONG_ADVANCED=y
811CONFIG_TCP_CONG_BIC=m
812CONFIG_TCP_CONG_CUBIC=y
813CONFIG_TCP_CONG_WESTWOOD=m
814CONFIG_TCP_CONG_HTCP=m
815CONFIG_TCP_CONG_HSTCP=m
816CONFIG_TCP_CONG_HYBLA=m
817CONFIG_TCP_CONG_VEGAS=m
818CONFIG_TCP_CONG_SCALABLE=m
819CONFIG_TCP_CONG_LP=m
820CONFIG_TCP_CONG_VENO=m
821CONFIG_TCP_CONG_YEAH=m
822CONFIG_TCP_CONG_ILLINOIS=m
823CONFIG_TCP_CONG_DCTCP=m
824CONFIG_TCP_CONG_CDG=m
825CONFIG_DEFAULT_CUBIC=y
826# CONFIG_DEFAULT_RENO is not set
827CONFIG_DEFAULT_TCP_CONG="cubic"
828CONFIG_TCP_MD5SIG=y
829CONFIG_IPV6=y
830CONFIG_IPV6_ROUTER_PREF=y
831CONFIG_IPV6_ROUTE_INFO=y
832CONFIG_IPV6_OPTIMISTIC_DAD=y
833CONFIG_INET6_AH=m
834CONFIG_INET6_ESP=m
835CONFIG_INET6_IPCOMP=m
836CONFIG_IPV6_MIP6=y
837# CONFIG_IPV6_ILA is not set
838CONFIG_INET6_XFRM_TUNNEL=m
839CONFIG_INET6_TUNNEL=m
840CONFIG_INET6_XFRM_MODE_TRANSPORT=m
841CONFIG_INET6_XFRM_MODE_TUNNEL=m
842CONFIG_INET6_XFRM_MODE_BEET=m
843CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
844CONFIG_IPV6_VTI=m
845CONFIG_IPV6_SIT=m
846CONFIG_IPV6_SIT_6RD=y
847CONFIG_IPV6_NDISC_NODETYPE=y
848CONFIG_IPV6_TUNNEL=m
849CONFIG_IPV6_GRE=m
850CONFIG_IPV6_MULTIPLE_TABLES=y
851CONFIG_IPV6_SUBTREES=y
852CONFIG_IPV6_MROUTE=y
853CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
854CONFIG_IPV6_PIMSM_V2=y
855# CONFIG_NETLABEL is not set
856CONFIG_NETWORK_SECMARK=y
857CONFIG_NET_PTP_CLASSIFY=y
858# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
859CONFIG_NETFILTER=y
860# CONFIG_NETFILTER_DEBUG is not set
861CONFIG_NETFILTER_ADVANCED=y
862CONFIG_BRIDGE_NETFILTER=m
863
864#
865# Core Netfilter Configuration
866#
867CONFIG_NETFILTER_INGRESS=y
868CONFIG_NETFILTER_NETLINK=m
869CONFIG_NETFILTER_NETLINK_ACCT=m
870CONFIG_NETFILTER_NETLINK_QUEUE=m
871CONFIG_NETFILTER_NETLINK_LOG=m
872CONFIG_NF_CONNTRACK=m
873CONFIG_NF_LOG_COMMON=m
874CONFIG_NF_CONNTRACK_MARK=y
875CONFIG_NF_CONNTRACK_SECMARK=y
876CONFIG_NF_CONNTRACK_ZONES=y
877CONFIG_NF_CONNTRACK_PROCFS=y
878CONFIG_NF_CONNTRACK_EVENTS=y
879CONFIG_NF_CONNTRACK_TIMEOUT=y
880CONFIG_NF_CONNTRACK_TIMESTAMP=y
881CONFIG_NF_CONNTRACK_LABELS=y
882CONFIG_NF_CT_PROTO_DCCP=m
883CONFIG_NF_CT_PROTO_GRE=m
884CONFIG_NF_CT_PROTO_SCTP=m
885CONFIG_NF_CT_PROTO_UDPLITE=m
886CONFIG_NF_CONNTRACK_AMANDA=m
887CONFIG_NF_CONNTRACK_FTP=m
888CONFIG_NF_CONNTRACK_H323=m
889CONFIG_NF_CONNTRACK_IRC=m
890CONFIG_NF_CONNTRACK_BROADCAST=m
891CONFIG_NF_CONNTRACK_NETBIOS_NS=m
892CONFIG_NF_CONNTRACK_SNMP=m
893CONFIG_NF_CONNTRACK_PPTP=m
894CONFIG_NF_CONNTRACK_SANE=m
895CONFIG_NF_CONNTRACK_SIP=m
896CONFIG_NF_CONNTRACK_TFTP=m
897CONFIG_NF_CT_NETLINK=m
898CONFIG_NF_CT_NETLINK_TIMEOUT=m
899CONFIG_NF_CT_NETLINK_HELPER=m
900CONFIG_NETFILTER_NETLINK_GLUE_CT=y
901CONFIG_NF_NAT=m
902CONFIG_NF_NAT_NEEDED=y
903CONFIG_NF_NAT_PROTO_DCCP=m
904CONFIG_NF_NAT_PROTO_UDPLITE=m
905CONFIG_NF_NAT_PROTO_SCTP=m
906CONFIG_NF_NAT_AMANDA=m
907CONFIG_NF_NAT_FTP=m
908CONFIG_NF_NAT_IRC=m
909CONFIG_NF_NAT_SIP=m
910CONFIG_NF_NAT_TFTP=m
911CONFIG_NF_NAT_REDIRECT=m
912CONFIG_NETFILTER_SYNPROXY=m
913CONFIG_NF_TABLES=m
914CONFIG_NF_TABLES_INET=m
915CONFIG_NF_TABLES_NETDEV=m
916CONFIG_NFT_EXTHDR=m
917CONFIG_NFT_META=m
918CONFIG_NFT_CT=m
919CONFIG_NFT_RBTREE=m
920CONFIG_NFT_HASH=m
921CONFIG_NFT_COUNTER=m
922CONFIG_NFT_LOG=m
923CONFIG_NFT_LIMIT=m
924CONFIG_NFT_MASQ=m
925CONFIG_NFT_REDIR=m
926CONFIG_NFT_NAT=m
927CONFIG_NFT_QUEUE=m
928CONFIG_NFT_REJECT=m
929CONFIG_NFT_REJECT_INET=m
930CONFIG_NFT_COMPAT=m
931CONFIG_NETFILTER_XTABLES=m
932
933#
934# Xtables combined modules
935#
936CONFIG_NETFILTER_XT_MARK=m
937CONFIG_NETFILTER_XT_CONNMARK=m
938CONFIG_NETFILTER_XT_SET=m
939
940#
941# Xtables targets
942#
943CONFIG_NETFILTER_XT_TARGET_AUDIT=m
944CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
945CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
946CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
947CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
948CONFIG_NETFILTER_XT_TARGET_CT=m
949CONFIG_NETFILTER_XT_TARGET_DSCP=m
950CONFIG_NETFILTER_XT_TARGET_HL=m
951CONFIG_NETFILTER_XT_TARGET_HMARK=m
952CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
953CONFIG_NETFILTER_XT_TARGET_LED=m
954CONFIG_NETFILTER_XT_TARGET_LOG=m
955CONFIG_NETFILTER_XT_TARGET_MARK=m
956CONFIG_NETFILTER_XT_NAT=m
957CONFIG_NETFILTER_XT_TARGET_NETMAP=m
958CONFIG_NETFILTER_XT_TARGET_NFLOG=m
959CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
960# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
961CONFIG_NETFILTER_XT_TARGET_RATEEST=m
962CONFIG_NETFILTER_XT_TARGET_REDIRECT=m
963CONFIG_NETFILTER_XT_TARGET_TEE=m
964CONFIG_NETFILTER_XT_TARGET_TPROXY=m
965CONFIG_NETFILTER_XT_TARGET_TRACE=m
966CONFIG_NETFILTER_XT_TARGET_SECMARK=m
967CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
968CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
969
970#
971# Xtables matches
972#
973CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
974CONFIG_NETFILTER_XT_MATCH_BPF=m
975CONFIG_NETFILTER_XT_MATCH_CGROUP=m
976CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
977CONFIG_NETFILTER_XT_MATCH_COMMENT=m
978CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
979CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
980CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
981CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
982CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
983CONFIG_NETFILTER_XT_MATCH_CPU=m
984CONFIG_NETFILTER_XT_MATCH_DCCP=m
985CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m
986CONFIG_NETFILTER_XT_MATCH_DSCP=m
987CONFIG_NETFILTER_XT_MATCH_ECN=m
988CONFIG_NETFILTER_XT_MATCH_ESP=m
989# CONFIG_NETFILTER_XT_MATCH_GRADM is not set
990CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
991CONFIG_NETFILTER_XT_MATCH_HELPER=m
992CONFIG_NETFILTER_XT_MATCH_HL=m
993CONFIG_NETFILTER_XT_MATCH_IPCOMP=m
994CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
995CONFIG_NETFILTER_XT_MATCH_IPVS=m
996CONFIG_NETFILTER_XT_MATCH_L2TP=m
997CONFIG_NETFILTER_XT_MATCH_LENGTH=m
998CONFIG_NETFILTER_XT_MATCH_LIMIT=m
999CONFIG_NETFILTER_XT_MATCH_MAC=m
1000CONFIG_NETFILTER_XT_MATCH_MARK=m
1001CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
1002CONFIG_NETFILTER_XT_MATCH_NFACCT=m
1003CONFIG_NETFILTER_XT_MATCH_OSF=m
1004CONFIG_NETFILTER_XT_MATCH_OWNER=m
1005CONFIG_NETFILTER_XT_MATCH_POLICY=m
1006CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
1007CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
1008CONFIG_NETFILTER_XT_MATCH_QUOTA=m
1009CONFIG_NETFILTER_XT_MATCH_RATEEST=m
1010CONFIG_NETFILTER_XT_MATCH_REALM=m
1011CONFIG_NETFILTER_XT_MATCH_RECENT=m
1012CONFIG_NETFILTER_XT_MATCH_SCTP=m
1013CONFIG_NETFILTER_XT_MATCH_SOCKET=m
1014CONFIG_NETFILTER_XT_MATCH_STATE=m
1015CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
1016CONFIG_NETFILTER_XT_MATCH_STRING=m
1017CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
1018CONFIG_NETFILTER_XT_MATCH_TIME=m
1019CONFIG_NETFILTER_XT_MATCH_U32=m
1020CONFIG_IP_SET=m
1021CONFIG_IP_SET_MAX=256
1022CONFIG_IP_SET_BITMAP_IP=m
1023CONFIG_IP_SET_BITMAP_IPMAC=m
1024CONFIG_IP_SET_BITMAP_PORT=m
1025CONFIG_IP_SET_HASH_IP=m
1026CONFIG_IP_SET_HASH_IPMARK=m
1027CONFIG_IP_SET_HASH_IPPORT=m
1028CONFIG_IP_SET_HASH_IPPORTIP=m
1029CONFIG_IP_SET_HASH_IPPORTNET=m
1030CONFIG_IP_SET_HASH_MAC=m
1031CONFIG_IP_SET_HASH_NETPORTNET=m
1032CONFIG_IP_SET_HASH_NET=m
1033CONFIG_IP_SET_HASH_NETNET=m
1034CONFIG_IP_SET_HASH_NETPORT=m
1035CONFIG_IP_SET_HASH_NETIFACE=m
1036CONFIG_IP_SET_LIST_SET=m
1037CONFIG_IP_VS=m
1038CONFIG_IP_VS_IPV6=y
1039# CONFIG_IP_VS_DEBUG is not set
1040CONFIG_IP_VS_TAB_BITS=12
1041
1042#
1043# IPVS transport protocol load balancing support
1044#
1045CONFIG_IP_VS_PROTO_TCP=y
1046CONFIG_IP_VS_PROTO_UDP=y
1047CONFIG_IP_VS_PROTO_AH_ESP=y
1048CONFIG_IP_VS_PROTO_ESP=y
1049CONFIG_IP_VS_PROTO_AH=y
1050CONFIG_IP_VS_PROTO_SCTP=y
1051
1052#
1053# IPVS scheduler
1054#
1055CONFIG_IP_VS_RR=m
1056CONFIG_IP_VS_WRR=m
1057CONFIG_IP_VS_LC=m
1058CONFIG_IP_VS_WLC=m
1059CONFIG_IP_VS_FO=m
1060CONFIG_IP_VS_OVF=m
1061CONFIG_IP_VS_LBLC=m
1062CONFIG_IP_VS_LBLCR=m
1063CONFIG_IP_VS_DH=m
1064CONFIG_IP_VS_SH=m
1065CONFIG_IP_VS_SED=m
1066CONFIG_IP_VS_NQ=m
1067
1068#
1069# IPVS SH scheduler
1070#
1071CONFIG_IP_VS_SH_TAB_BITS=8
1072
1073#
1074# IPVS application helper
1075#
1076CONFIG_IP_VS_FTP=m
1077CONFIG_IP_VS_NFCT=y
1078CONFIG_IP_VS_PE_SIP=m
1079
1080#
1081# IP: Netfilter Configuration
1082#
1083CONFIG_NF_DEFRAG_IPV4=m
1084CONFIG_NF_CONNTRACK_IPV4=m
1085CONFIG_NF_CONNTRACK_PROC_COMPAT=y
1086CONFIG_NF_TABLES_IPV4=m
1087CONFIG_NFT_CHAIN_ROUTE_IPV4=m
1088CONFIG_NFT_REJECT_IPV4=m
1089CONFIG_NFT_DUP_IPV4=m
1090CONFIG_NF_TABLES_ARP=m
1091CONFIG_NF_DUP_IPV4=m
1092CONFIG_NF_LOG_ARP=m
1093CONFIG_NF_LOG_IPV4=m
1094CONFIG_NF_REJECT_IPV4=m
1095CONFIG_NF_NAT_IPV4=m
1096CONFIG_NFT_CHAIN_NAT_IPV4=m
1097CONFIG_NF_NAT_MASQUERADE_IPV4=m
1098CONFIG_NFT_MASQ_IPV4=m
1099CONFIG_NFT_REDIR_IPV4=m
1100CONFIG_NF_NAT_SNMP_BASIC=m
1101CONFIG_NF_NAT_PROTO_GRE=m
1102CONFIG_NF_NAT_PPTP=m
1103CONFIG_NF_NAT_H323=m
1104CONFIG_IP_NF_IPTABLES=m
1105CONFIG_IP_NF_MATCH_AH=m
1106CONFIG_IP_NF_MATCH_ECN=m
1107CONFIG_IP_NF_MATCH_RPFILTER=m
1108CONFIG_IP_NF_MATCH_TTL=m
1109CONFIG_IP_NF_FILTER=m
1110CONFIG_IP_NF_TARGET_REJECT=m
1111CONFIG_IP_NF_TARGET_SYNPROXY=m
1112CONFIG_IP_NF_NAT=m
1113CONFIG_IP_NF_TARGET_MASQUERADE=m
1114CONFIG_IP_NF_TARGET_NETMAP=m
1115CONFIG_IP_NF_TARGET_REDIRECT=m
1116CONFIG_IP_NF_MANGLE=m
1117CONFIG_IP_NF_TARGET_CLUSTERIP=m
1118CONFIG_IP_NF_TARGET_ECN=m
1119CONFIG_IP_NF_TARGET_TTL=m
1120CONFIG_IP_NF_RAW=m
1121CONFIG_IP_NF_SECURITY=m
1122CONFIG_IP_NF_ARPTABLES=m
1123CONFIG_IP_NF_ARPFILTER=m
1124CONFIG_IP_NF_ARP_MANGLE=m
1125
1126#
1127# IPv6: Netfilter Configuration
1128#
1129CONFIG_NF_DEFRAG_IPV6=m
1130CONFIG_NF_CONNTRACK_IPV6=m
1131CONFIG_NF_TABLES_IPV6=m
1132CONFIG_NFT_CHAIN_ROUTE_IPV6=m
1133CONFIG_NFT_REJECT_IPV6=m
1134CONFIG_NFT_DUP_IPV6=m
1135CONFIG_NF_DUP_IPV6=m
1136CONFIG_NF_REJECT_IPV6=m
1137CONFIG_NF_LOG_IPV6=m
1138CONFIG_NF_NAT_IPV6=m
1139CONFIG_NFT_CHAIN_NAT_IPV6=m
1140CONFIG_NF_NAT_MASQUERADE_IPV6=m
1141CONFIG_NFT_MASQ_IPV6=m
1142CONFIG_NFT_REDIR_IPV6=m
1143CONFIG_IP6_NF_IPTABLES=m
1144CONFIG_IP6_NF_MATCH_AH=m
1145CONFIG_IP6_NF_MATCH_EUI64=m
1146CONFIG_IP6_NF_MATCH_FRAG=m
1147CONFIG_IP6_NF_MATCH_OPTS=m
1148CONFIG_IP6_NF_MATCH_HL=m
1149CONFIG_IP6_NF_MATCH_IPV6HEADER=m
1150CONFIG_IP6_NF_MATCH_MH=m
1151CONFIG_IP6_NF_MATCH_RPFILTER=m
1152CONFIG_IP6_NF_MATCH_RT=m
1153CONFIG_IP6_NF_TARGET_HL=m
1154CONFIG_IP6_NF_FILTER=m
1155CONFIG_IP6_NF_TARGET_REJECT=m
1156CONFIG_IP6_NF_TARGET_SYNPROXY=m
1157CONFIG_IP6_NF_MANGLE=m
1158CONFIG_IP6_NF_RAW=m
1159CONFIG_IP6_NF_SECURITY=m
1160CONFIG_IP6_NF_NAT=m
1161CONFIG_IP6_NF_TARGET_MASQUERADE=m
1162CONFIG_IP6_NF_TARGET_NPT=m
1163
1164#
1165# DECnet: Netfilter Configuration
1166#
1167CONFIG_DECNET_NF_GRABULATOR=m
1168CONFIG_NF_TABLES_BRIDGE=m
1169CONFIG_NFT_BRIDGE_META=m
1170CONFIG_NFT_BRIDGE_REJECT=m
1171CONFIG_NF_LOG_BRIDGE=m
1172CONFIG_BRIDGE_NF_EBTABLES=m
1173CONFIG_BRIDGE_EBT_BROUTE=m
1174CONFIG_BRIDGE_EBT_T_FILTER=m
1175CONFIG_BRIDGE_EBT_T_NAT=m
1176CONFIG_BRIDGE_EBT_802_3=m
1177CONFIG_BRIDGE_EBT_AMONG=m
1178CONFIG_BRIDGE_EBT_ARP=m
1179CONFIG_BRIDGE_EBT_IP=m
1180CONFIG_BRIDGE_EBT_IP6=m
1181CONFIG_BRIDGE_EBT_LIMIT=m
1182CONFIG_BRIDGE_EBT_MARK=m
1183CONFIG_BRIDGE_EBT_PKTTYPE=m
1184CONFIG_BRIDGE_EBT_STP=m
1185CONFIG_BRIDGE_EBT_VLAN=m
1186CONFIG_BRIDGE_EBT_ARPREPLY=m
1187CONFIG_BRIDGE_EBT_DNAT=m
1188CONFIG_BRIDGE_EBT_MARK_T=m
1189CONFIG_BRIDGE_EBT_REDIRECT=m
1190CONFIG_BRIDGE_EBT_SNAT=m
1191CONFIG_BRIDGE_EBT_LOG=m
1192CONFIG_BRIDGE_EBT_NFLOG=m
1193CONFIG_IP_DCCP=m
1194CONFIG_INET_DCCP_DIAG=m
1195
1196#
1197# DCCP CCIDs Configuration
1198#
1199# CONFIG_IP_DCCP_CCID2_DEBUG is not set
1200CONFIG_IP_DCCP_CCID3=y
1201# CONFIG_IP_DCCP_CCID3_DEBUG is not set
1202CONFIG_IP_DCCP_TFRC_LIB=y
1203
1204#
1205# DCCP Kernel Hacking
1206#
1207# CONFIG_IP_DCCP_DEBUG is not set
1208CONFIG_NET_DCCPPROBE=m
1209CONFIG_IP_SCTP=m
1210CONFIG_NET_SCTPPROBE=m
1211# CONFIG_SCTP_DBG_OBJCNT is not set
1212CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5=y
1213# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1 is not set
1214# CONFIG_SCTP_DEFAULT_COOKIE_HMAC_NONE is not set
1215CONFIG_SCTP_COOKIE_HMAC_MD5=y
1216CONFIG_SCTP_COOKIE_HMAC_SHA1=y
1217CONFIG_RDS=m
1218CONFIG_RDS_RDMA=m
1219CONFIG_RDS_TCP=m
1220# CONFIG_RDS_DEBUG is not set
1221CONFIG_TIPC=m
1222CONFIG_TIPC_MEDIA_IB=y
1223CONFIG_TIPC_MEDIA_UDP=y
1224CONFIG_ATM=m
1225CONFIG_ATM_CLIP=m
1226# CONFIG_ATM_CLIP_NO_ICMP is not set
1227CONFIG_ATM_LANE=m
1228CONFIG_ATM_MPOA=m
1229CONFIG_ATM_BR2684=m
1230# CONFIG_ATM_BR2684_IPFILTER is not set
1231CONFIG_L2TP=m
1232CONFIG_L2TP_V3=y
1233CONFIG_L2TP_IP=m
1234CONFIG_L2TP_ETH=m
1235CONFIG_STP=m
1236CONFIG_GARP=m
1237CONFIG_MRP=m
1238CONFIG_BRIDGE=m
1239CONFIG_BRIDGE_IGMP_SNOOPING=y
1240CONFIG_BRIDGE_VLAN_FILTERING=y
1241CONFIG_HAVE_NET_DSA=y
1242CONFIG_VLAN_8021Q=m
1243CONFIG_VLAN_8021Q_GVRP=y
1244CONFIG_VLAN_8021Q_MVRP=y
1245CONFIG_DECNET=m
1246# CONFIG_DECNET_ROUTER is not set
1247CONFIG_LLC=m
1248CONFIG_LLC2=m
1249CONFIG_IPX=m
1250# CONFIG_IPX_INTERN is not set
1251CONFIG_ATALK=m
1252CONFIG_DEV_APPLETALK=m
1253CONFIG_IPDDP=m
1254CONFIG_IPDDP_ENCAP=y
1255# CONFIG_X25 is not set
1256CONFIG_LAPB=m
1257CONFIG_PHONET=m
1258CONFIG_6LOWPAN=m
1259CONFIG_6LOWPAN_NHC=m
1260CONFIG_6LOWPAN_NHC_DEST=m
1261CONFIG_6LOWPAN_NHC_FRAGMENT=m
1262CONFIG_6LOWPAN_NHC_HOP=m
1263CONFIG_6LOWPAN_NHC_IPV6=m
1264CONFIG_6LOWPAN_NHC_MOBILITY=m
1265CONFIG_6LOWPAN_NHC_ROUTING=m
1266CONFIG_6LOWPAN_NHC_UDP=m
1267CONFIG_IEEE802154=m
1268# CONFIG_IEEE802154_NL802154_EXPERIMENTAL is not set
1269CONFIG_IEEE802154_SOCKET=m
1270CONFIG_IEEE802154_6LOWPAN=m
1271# CONFIG_MAC802154 is not set
1272CONFIG_NET_SCHED=y
1273
1274#
1275# Queueing/Scheduling
1276#
1277CONFIG_NET_SCH_CBQ=m
1278CONFIG_NET_SCH_HTB=m
1279CONFIG_NET_SCH_HFSC=m
1280CONFIG_NET_SCH_ATM=m
1281CONFIG_NET_SCH_PRIO=m
1282CONFIG_NET_SCH_MULTIQ=m
1283CONFIG_NET_SCH_RED=m
1284CONFIG_NET_SCH_SFB=m
1285CONFIG_NET_SCH_SFQ=m
1286CONFIG_NET_SCH_TEQL=m
1287CONFIG_NET_SCH_TBF=m
1288CONFIG_NET_SCH_GRED=m
1289CONFIG_NET_SCH_DSMARK=m
1290CONFIG_NET_SCH_NETEM=m
1291CONFIG_NET_SCH_DRR=m
1292CONFIG_NET_SCH_MQPRIO=m
1293CONFIG_NET_SCH_CHOKE=m
1294CONFIG_NET_SCH_QFQ=m
1295CONFIG_NET_SCH_CODEL=m
1296CONFIG_NET_SCH_FQ_CODEL=m
1297CONFIG_NET_SCH_FQ=m
1298CONFIG_NET_SCH_HHF=m
1299CONFIG_NET_SCH_PIE=m
1300CONFIG_NET_SCH_INGRESS=m
1301CONFIG_NET_SCH_PLUG=m
1302
1303#
1304# Classification
1305#
1306CONFIG_NET_CLS=y
1307CONFIG_NET_CLS_BASIC=m
1308CONFIG_NET_CLS_TCINDEX=m
1309CONFIG_NET_CLS_ROUTE4=m
1310CONFIG_NET_CLS_FW=m
1311CONFIG_NET_CLS_U32=m
1312CONFIG_CLS_U32_PERF=y
1313CONFIG_CLS_U32_MARK=y
1314CONFIG_NET_CLS_RSVP=m
1315CONFIG_NET_CLS_RSVP6=m
1316CONFIG_NET_CLS_FLOW=m
1317CONFIG_NET_CLS_CGROUP=m
1318CONFIG_NET_CLS_BPF=m
1319CONFIG_NET_CLS_FLOWER=m
1320CONFIG_NET_EMATCH=y
1321CONFIG_NET_EMATCH_STACK=32
1322CONFIG_NET_EMATCH_CMP=m
1323CONFIG_NET_EMATCH_NBYTE=m
1324CONFIG_NET_EMATCH_U32=m
1325CONFIG_NET_EMATCH_META=m
1326CONFIG_NET_EMATCH_TEXT=m
1327CONFIG_NET_EMATCH_CANID=m
1328CONFIG_NET_EMATCH_IPSET=m
1329CONFIG_NET_CLS_ACT=y
1330CONFIG_NET_ACT_POLICE=m
1331CONFIG_NET_ACT_GACT=m
1332CONFIG_GACT_PROB=y
1333CONFIG_NET_ACT_MIRRED=m
1334CONFIG_NET_ACT_IPT=m
1335CONFIG_NET_ACT_NAT=m
1336CONFIG_NET_ACT_PEDIT=m
1337CONFIG_NET_ACT_SIMP=m
1338CONFIG_NET_ACT_SKBEDIT=m
1339CONFIG_NET_ACT_CSUM=m
1340CONFIG_NET_ACT_VLAN=m
1341CONFIG_NET_ACT_BPF=m
1342CONFIG_NET_ACT_CONNMARK=m
1343CONFIG_NET_CLS_IND=y
1344CONFIG_NET_SCH_FIFO=y
1345CONFIG_DCB=y
1346CONFIG_DNS_RESOLVER=m
1347CONFIG_BATMAN_ADV=m
1348CONFIG_BATMAN_ADV_BLA=y
1349CONFIG_BATMAN_ADV_DAT=y
1350CONFIG_BATMAN_ADV_NC=y
1351CONFIG_BATMAN_ADV_MCAST=y
1352CONFIG_OPENVSWITCH=m
1353CONFIG_OPENVSWITCH_GRE=m
1354CONFIG_OPENVSWITCH_VXLAN=m
1355CONFIG_OPENVSWITCH_GENEVE=m
1356CONFIG_VSOCKETS=m
1357CONFIG_VMWARE_VMCI_VSOCKETS=m
1358CONFIG_NETLINK_MMAP=y
1359CONFIG_NETLINK_DIAG=m
1360CONFIG_MPLS=y
1361CONFIG_NET_MPLS_GSO=y
1362CONFIG_MPLS_ROUTING=m
1363CONFIG_MPLS_IPTUNNEL=m
1364# CONFIG_HSR is not set
1365# CONFIG_NET_SWITCHDEV is not set
1366CONFIG_NET_L3_MASTER_DEV=y
1367CONFIG_RPS=y
1368CONFIG_RFS_ACCEL=y
1369CONFIG_XPS=y
1370CONFIG_CGROUP_NET_PRIO=y
1371CONFIG_CGROUP_NET_CLASSID=y
1372CONFIG_NET_RX_BUSY_POLL=y
1373CONFIG_BQL=y
1374CONFIG_BPF_JIT=y
1375CONFIG_NET_FLOW_LIMIT=y
1376
1377#
1378# Network testing
1379#
1380CONFIG_NET_PKTGEN=m
1381# CONFIG_NET_TCPPROBE is not set
1382CONFIG_HAMRADIO=y
1383
1384#
1385# Packet Radio protocols
1386#
1387CONFIG_AX25=m
1388# CONFIG_AX25_DAMA_SLAVE is not set
1389CONFIG_NETROM=m
1390CONFIG_ROSE=m
1391
1392#
1393# AX.25 network device drivers
1394#
1395CONFIG_MKISS=m
1396CONFIG_6PACK=m
1397CONFIG_BPQETHER=m
1398CONFIG_BAYCOM_SER_FDX=m
1399CONFIG_BAYCOM_SER_HDX=m
1400CONFIG_BAYCOM_PAR=m
1401CONFIG_YAM=m
1402CONFIG_CAN=m
1403CONFIG_CAN_RAW=m
1404CONFIG_CAN_BCM=m
1405CONFIG_CAN_GW=m
1406
1407#
1408# CAN Device Drivers
1409#
1410CONFIG_CAN_VCAN=m
1411CONFIG_CAN_SLCAN=m
1412CONFIG_CAN_DEV=m
1413CONFIG_CAN_CALC_BITTIMING=y
1414# CONFIG_CAN_LEDS is not set
1415CONFIG_CAN_SJA1000=m
1416CONFIG_CAN_SJA1000_ISA=m
1417# CONFIG_CAN_SJA1000_PLATFORM is not set
1418CONFIG_CAN_EMS_PCMCIA=m
1419CONFIG_CAN_EMS_PCI=m
1420CONFIG_CAN_PEAK_PCMCIA=m
1421CONFIG_CAN_PEAK_PCI=m
1422CONFIG_CAN_PEAK_PCIEC=y
1423CONFIG_CAN_KVASER_PCI=m
1424CONFIG_CAN_PLX_PCI=m
1425# CONFIG_CAN_C_CAN is not set
1426# CONFIG_CAN_M_CAN is not set
1427# CONFIG_CAN_CC770 is not set
1428
1429#
1430# CAN SPI interfaces
1431#
1432# CONFIG_CAN_MCP251X is not set
1433
1434#
1435# CAN USB interfaces
1436#
1437CONFIG_CAN_EMS_USB=m
1438CONFIG_CAN_ESD_USB2=m
1439CONFIG_CAN_GS_USB=m
1440CONFIG_CAN_KVASER_USB=m
1441CONFIG_CAN_PEAK_USB=m
1442CONFIG_CAN_8DEV_USB=m
1443CONFIG_CAN_SOFTING=m
1444CONFIG_CAN_SOFTING_CS=m
1445# CONFIG_CAN_DEBUG_DEVICES is not set
1446CONFIG_IRDA=m
1447
1448#
1449# IrDA protocols
1450#
1451CONFIG_IRLAN=m
1452CONFIG_IRNET=m
1453CONFIG_IRCOMM=m
1454# CONFIG_IRDA_ULTRA is not set
1455
1456#
1457# IrDA options
1458#
1459CONFIG_IRDA_CACHE_LAST_LSAP=y
1460CONFIG_IRDA_FAST_RR=y
1461# CONFIG_IRDA_DEBUG is not set
1462
1463#
1464# Infrared-port device drivers
1465#
1466
1467#
1468# SIR device drivers
1469#
1470CONFIG_IRTTY_SIR=m
1471
1472#
1473# Dongle support
1474#
1475CONFIG_DONGLE=y
1476CONFIG_ESI_DONGLE=m
1477CONFIG_ACTISYS_DONGLE=m
1478CONFIG_TEKRAM_DONGLE=m
1479CONFIG_TOIM3232_DONGLE=m
1480CONFIG_LITELINK_DONGLE=m
1481CONFIG_MA600_DONGLE=m
1482CONFIG_GIRBIL_DONGLE=m
1483CONFIG_MCP2120_DONGLE=m
1484CONFIG_OLD_BELKIN_DONGLE=m
1485CONFIG_ACT200L_DONGLE=m
1486CONFIG_KINGSUN_DONGLE=m
1487CONFIG_KSDAZZLE_DONGLE=m
1488CONFIG_KS959_DONGLE=m
1489
1490#
1491# FIR device drivers
1492#
1493CONFIG_USB_IRDA=m
1494CONFIG_SIGMATEL_FIR=m
1495CONFIG_NSC_FIR=m
1496CONFIG_WINBOND_FIR=m
1497CONFIG_SMC_IRCC_FIR=m
1498CONFIG_ALI_FIR=m
1499CONFIG_VLSI_FIR=m
1500CONFIG_VIA_FIR=m
1501CONFIG_MCS_FIR=m
1502CONFIG_BT=m
1503CONFIG_BT_BREDR=y
1504CONFIG_BT_RFCOMM=m
1505CONFIG_BT_RFCOMM_TTY=y
1506CONFIG_BT_BNEP=m
1507CONFIG_BT_BNEP_MC_FILTER=y
1508CONFIG_BT_BNEP_PROTO_FILTER=y
1509CONFIG_BT_CMTP=m
1510CONFIG_BT_HIDP=m
1511CONFIG_BT_HS=y
1512CONFIG_BT_LE=y
1513CONFIG_BT_6LOWPAN=m
1514# CONFIG_BT_SELFTEST is not set
1515
1516#
1517# Bluetooth device drivers
1518#
1519CONFIG_BT_INTEL=m
1520CONFIG_BT_BCM=m
1521CONFIG_BT_RTL=m
1522CONFIG_BT_QCA=m
1523CONFIG_BT_HCIBTUSB=m
1524CONFIG_BT_HCIBTUSB_BCM=y
1525CONFIG_BT_HCIBTUSB_RTL=y
1526CONFIG_BT_HCIBTSDIO=m
1527CONFIG_BT_HCIUART=m
1528CONFIG_BT_HCIUART_H4=y
1529CONFIG_BT_HCIUART_BCSP=y
1530CONFIG_BT_HCIUART_ATH3K=y
1531CONFIG_BT_HCIUART_LL=y
1532CONFIG_BT_HCIUART_3WIRE=y
1533CONFIG_BT_HCIUART_INTEL=y
1534CONFIG_BT_HCIUART_BCM=y
1535CONFIG_BT_HCIUART_QCA=y
1536CONFIG_BT_HCIBCM203X=m
1537CONFIG_BT_HCIBPA10X=m
1538CONFIG_BT_HCIBFUSB=m
1539CONFIG_BT_HCIDTL1=m
1540CONFIG_BT_HCIBT3C=m
1541CONFIG_BT_HCIBLUECARD=m
1542# CONFIG_BT_HCIBTUART is not set
1543CONFIG_BT_HCIVHCI=m
1544CONFIG_BT_MRVL=m
1545CONFIG_BT_MRVL_SDIO=m
1546CONFIG_BT_ATH3K=m
1547CONFIG_AF_RXRPC=m
1548# CONFIG_AF_RXRPC_DEBUG is not set
1549CONFIG_RXKAD=m
1550CONFIG_FIB_RULES=y
1551CONFIG_WIRELESS=y
1552CONFIG_WIRELESS_EXT=y
1553CONFIG_WEXT_CORE=y
1554CONFIG_WEXT_PROC=y
1555CONFIG_WEXT_SPY=y
1556CONFIG_WEXT_PRIV=y
1557CONFIG_CFG80211=m
1558# CONFIG_NL80211_TESTMODE is not set
1559# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
1560# CONFIG_CFG80211_REG_DEBUG is not set
1561# CONFIG_CFG80211_CERTIFICATION_ONUS is not set
1562CONFIG_CFG80211_DEFAULT_PS=y
1563# CONFIG_CFG80211_INTERNAL_REGDB is not set
1564CONFIG_CFG80211_CRDA_SUPPORT=y
1565CONFIG_CFG80211_WEXT=y
1566CONFIG_CFG80211_WEXT_EXPORT=y
1567CONFIG_LIB80211=m
1568CONFIG_LIB80211_CRYPT_WEP=m
1569CONFIG_LIB80211_CRYPT_CCMP=m
1570CONFIG_LIB80211_CRYPT_TKIP=m
1571# CONFIG_LIB80211_DEBUG is not set
1572CONFIG_MAC80211=m
1573CONFIG_MAC80211_HAS_RC=y
1574CONFIG_MAC80211_RC_MINSTREL=y
1575CONFIG_MAC80211_RC_MINSTREL_HT=y
1576# CONFIG_MAC80211_RC_MINSTREL_VHT is not set
1577CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
1578CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
1579CONFIG_MAC80211_MESH=y
1580CONFIG_MAC80211_LEDS=y
1581# CONFIG_MAC80211_MESSAGE_TRACING is not set
1582# CONFIG_MAC80211_DEBUG_MENU is not set
1583CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
1584CONFIG_WIMAX=m
1585CONFIG_WIMAX_DEBUG_LEVEL=8
1586CONFIG_RFKILL=m
1587CONFIG_RFKILL_LEDS=y
1588CONFIG_RFKILL_INPUT=y
1589# CONFIG_RFKILL_GPIO is not set
1590CONFIG_NET_9P=m
1591CONFIG_NET_9P_VIRTIO=m
1592CONFIG_NET_9P_RDMA=m
1593# CONFIG_NET_9P_DEBUG is not set
1594# CONFIG_CAIF is not set
1595CONFIG_CEPH_LIB=m
1596# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
1597# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set
1598CONFIG_NFC=m
1599CONFIG_NFC_DIGITAL=m
1600# CONFIG_NFC_NCI is not set
1601CONFIG_NFC_HCI=m
1602# CONFIG_NFC_SHDLC is not set
1603
1604#
1605# Near Field Communication (NFC) devices
1606#
1607CONFIG_NFC_PN533=m
1608# CONFIG_NFC_TRF7970A is not set
1609CONFIG_NFC_MEI_PHY=m
1610CONFIG_NFC_SIM=m
1611CONFIG_NFC_PORT100=m
1612CONFIG_NFC_PN544=m
1613CONFIG_NFC_PN544_MEI=m
1614# CONFIG_NFC_MICROREAD_MEI is not set
1615# CONFIG_NFC_ST21NFCA is not set
1616CONFIG_LWTUNNEL=y
1617CONFIG_HAVE_BPF_JIT=y
1618
1619#
1620# Device Drivers
1621#
1622
1623#
1624# Generic Driver Options
1625#
1626# CONFIG_UEVENT_HELPER is not set
1627CONFIG_DEVTMPFS=y
1628# CONFIG_DEVTMPFS_MOUNT is not set
1629CONFIG_STANDALONE=y
1630CONFIG_PREVENT_FIRMWARE_BUILD=y
1631CONFIG_FW_LOADER=y
1632# CONFIG_FIRMWARE_IN_KERNEL is not set
1633CONFIG_EXTRA_FIRMWARE=""
1634CONFIG_FW_LOADER_USER_HELPER=y
1635# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
1636CONFIG_WANT_DEV_COREDUMP=y
1637CONFIG_ALLOW_DEV_COREDUMP=y
1638CONFIG_DEV_COREDUMP=y
1639# CONFIG_DEBUG_DRIVER is not set
1640# CONFIG_DEBUG_DEVRES is not set
1641# CONFIG_SYS_HYPERVISOR is not set
1642# CONFIG_GENERIC_CPU_DEVICES is not set
1643CONFIG_GENERIC_CPU_AUTOPROBE=y
1644CONFIG_REGMAP=y
1645CONFIG_REGMAP_I2C=m
1646CONFIG_REGMAP_SPI=m
1647CONFIG_DMA_SHARED_BUFFER=y
1648# CONFIG_FENCE_TRACE is not set
1649
1650#
1651# Bus devices
1652#
1653CONFIG_CONNECTOR=y
1654CONFIG_PROC_EVENTS=y
1655CONFIG_MTD=m
1656# CONFIG_MTD_TESTS is not set
1657CONFIG_MTD_REDBOOT_PARTS=m
1658CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
1659# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
1660# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
1661# CONFIG_MTD_CMDLINE_PARTS is not set
1662CONFIG_MTD_AR7_PARTS=m
1663
1664#
1665# User Modules And Translation Layers
1666#
1667CONFIG_MTD_BLKDEVS=m
1668CONFIG_MTD_BLOCK=m
1669CONFIG_MTD_BLOCK_RO=m
1670CONFIG_FTL=m
1671CONFIG_NFTL=m
1672CONFIG_NFTL_RW=y
1673CONFIG_INFTL=m
1674CONFIG_RFD_FTL=m
1675CONFIG_SSFDC=m
1676# CONFIG_SM_FTL is not set
1677CONFIG_MTD_OOPS=m
1678CONFIG_MTD_SWAP=m
1679# CONFIG_MTD_PARTITIONED_MASTER is not set
1680
1681#
1682# RAM/ROM/Flash chip drivers
1683#
1684CONFIG_MTD_CFI=m
1685CONFIG_MTD_JEDECPROBE=m
1686CONFIG_MTD_GEN_PROBE=m
1687# CONFIG_MTD_CFI_ADV_OPTIONS is not set
1688CONFIG_MTD_MAP_BANK_WIDTH_1=y
1689CONFIG_MTD_MAP_BANK_WIDTH_2=y
1690CONFIG_MTD_MAP_BANK_WIDTH_4=y
1691# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
1692# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
1693# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
1694CONFIG_MTD_CFI_I1=y
1695CONFIG_MTD_CFI_I2=y
1696# CONFIG_MTD_CFI_I4 is not set
1697# CONFIG_MTD_CFI_I8 is not set
1698CONFIG_MTD_CFI_INTELEXT=m
1699CONFIG_MTD_CFI_AMDSTD=m
1700CONFIG_MTD_CFI_STAA=m
1701CONFIG_MTD_CFI_UTIL=m
1702CONFIG_MTD_RAM=m
1703CONFIG_MTD_ROM=m
1704CONFIG_MTD_ABSENT=m
1705
1706#
1707# Mapping drivers for chip access
1708#
1709CONFIG_MTD_COMPLEX_MAPPINGS=y
1710CONFIG_MTD_PHYSMAP=m
1711# CONFIG_MTD_PHYSMAP_COMPAT is not set
1712CONFIG_MTD_SBC_GXX=m
1713# CONFIG_MTD_AMD76XROM is not set
1714# CONFIG_MTD_ICHXROM is not set
1715# CONFIG_MTD_ESB2ROM is not set
1716# CONFIG_MTD_CK804XROM is not set
1717# CONFIG_MTD_SCB2_FLASH is not set
1718CONFIG_MTD_NETtel=m
1719# CONFIG_MTD_L440GX is not set
1720CONFIG_MTD_PCI=m
1721CONFIG_MTD_PCMCIA=m
1722# CONFIG_MTD_PCMCIA_ANONYMOUS is not set
1723# CONFIG_MTD_GPIO_ADDR is not set
1724CONFIG_MTD_INTEL_VR_NOR=m
1725CONFIG_MTD_PLATRAM=m
1726# CONFIG_MTD_LATCH_ADDR is not set
1727
1728#
1729# Self-contained MTD device drivers
1730#
1731# CONFIG_MTD_PMC551 is not set
1732CONFIG_MTD_DATAFLASH=m
1733# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
1734# CONFIG_MTD_DATAFLASH_OTP is not set
1735CONFIG_MTD_M25P80=m
1736CONFIG_MTD_SST25L=m
1737CONFIG_MTD_SLRAM=m
1738CONFIG_MTD_PHRAM=m
1739CONFIG_MTD_MTDRAM=m
1740CONFIG_MTDRAM_TOTAL_SIZE=4096
1741CONFIG_MTDRAM_ERASE_SIZE=128
1742CONFIG_MTD_BLOCK2MTD=m
1743
1744#
1745# Disk-On-Chip Device Drivers
1746#
1747# CONFIG_MTD_DOCG3 is not set
1748CONFIG_MTD_NAND_ECC=m
1749# CONFIG_MTD_NAND_ECC_SMC is not set
1750CONFIG_MTD_NAND=m
1751CONFIG_MTD_NAND_BCH=m
1752CONFIG_MTD_NAND_ECC_BCH=y
1753CONFIG_MTD_SM_COMMON=m
1754# CONFIG_MTD_NAND_DENALI_PCI is not set
1755# CONFIG_MTD_NAND_DENALI_DT is not set
1756# CONFIG_MTD_NAND_GPIO is not set
1757# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
1758CONFIG_MTD_NAND_IDS=m
1759CONFIG_MTD_NAND_RICOH=m
1760CONFIG_MTD_NAND_DISKONCHIP=m
1761# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
1762CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
1763# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
1764# CONFIG_MTD_NAND_DOCG4 is not set
1765CONFIG_MTD_NAND_CAFE=m
1766CONFIG_MTD_NAND_NANDSIM=m
1767# CONFIG_MTD_NAND_PLATFORM is not set
1768# CONFIG_MTD_NAND_HISI504 is not set
1769CONFIG_MTD_ONENAND=m
1770CONFIG_MTD_ONENAND_VERIFY_WRITE=y
1771# CONFIG_MTD_ONENAND_GENERIC is not set
1772# CONFIG_MTD_ONENAND_OTP is not set
1773CONFIG_MTD_ONENAND_2X_PROGRAM=y
1774
1775#
1776# LPDDR & LPDDR2 PCM memory drivers
1777#
1778CONFIG_MTD_LPDDR=m
1779CONFIG_MTD_QINFO_PROBE=m
1780CONFIG_MTD_SPI_NOR=m
1781CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
1782CONFIG_MTD_UBI=m
1783CONFIG_MTD_UBI_WL_THRESHOLD=4096
1784CONFIG_MTD_UBI_BEB_LIMIT=20
1785# CONFIG_MTD_UBI_FASTMAP is not set
1786# CONFIG_MTD_UBI_GLUEBI is not set
1787CONFIG_MTD_UBI_BLOCK=y
1788# CONFIG_OF is not set
1789CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
1790CONFIG_PARPORT=m
1791CONFIG_PARPORT_PC=m
1792CONFIG_PARPORT_SERIAL=m
1793# CONFIG_PARPORT_PC_FIFO is not set
1794# CONFIG_PARPORT_PC_SUPERIO is not set
1795CONFIG_PARPORT_PC_PCMCIA=m
1796# CONFIG_PARPORT_GSC is not set
1797# CONFIG_PARPORT_AX88796 is not set
1798CONFIG_PARPORT_1284=y
1799CONFIG_PARPORT_NOT_PC=y
1800CONFIG_PNP=y
1801# CONFIG_PNP_DEBUG_MESSAGES is not set
1802
1803#
1804# Protocols
1805#
1806CONFIG_PNPACPI=y
1807CONFIG_BLK_DEV=y
1808CONFIG_BLK_DEV_NULL_BLK=m
1809CONFIG_BLK_DEV_FD=m
1810# CONFIG_PARIDE is not set
1811CONFIG_BLK_DEV_PCIESSD_MTIP32XX=m
1812CONFIG_ZRAM=m
1813CONFIG_ZRAM_LZ4_COMPRESS=y
1814CONFIG_BLK_CPQ_CISS_DA=m
1815CONFIG_CISS_SCSI_TAPE=y
1816CONFIG_BLK_DEV_DAC960=m
1817CONFIG_BLK_DEV_UMEM=m
1818# CONFIG_BLK_DEV_COW_COMMON is not set
1819CONFIG_BLK_DEV_LOOP=m
1820CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
1821# CONFIG_BLK_DEV_CRYPTOLOOP is not set
1822CONFIG_BLK_DEV_DRBD=m
1823# CONFIG_DRBD_FAULT_INJECTION is not set
1824CONFIG_BLK_DEV_NBD=m
1825CONFIG_BLK_DEV_SKD=m
1826CONFIG_BLK_DEV_OSD=m
1827CONFIG_BLK_DEV_SX8=m
1828CONFIG_BLK_DEV_RAM=m
1829CONFIG_BLK_DEV_RAM_COUNT=16
1830CONFIG_BLK_DEV_RAM_SIZE=16384
1831# CONFIG_BLK_DEV_RAM_DAX is not set
1832CONFIG_CDROM_PKTCDVD=m
1833CONFIG_CDROM_PKTCDVD_BUFFERS=8
1834# CONFIG_CDROM_PKTCDVD_WCACHE is not set
1835CONFIG_ATA_OVER_ETH=m
1836CONFIG_VIRTIO_BLK=m
1837# CONFIG_BLK_DEV_HD is not set
1838CONFIG_BLK_DEV_RBD=m
1839CONFIG_BLK_DEV_RSXX=m
1840CONFIG_BLK_DEV_NVME=m
1841
1842#
1843# Misc devices
1844#
1845CONFIG_SENSORS_LIS3LV02D=m
1846CONFIG_AD525X_DPOT=m
1847CONFIG_AD525X_DPOT_I2C=m
1848CONFIG_AD525X_DPOT_SPI=m
1849# CONFIG_DUMMY_IRQ is not set
1850CONFIG_IBM_ASM=m
1851CONFIG_PHANTOM=m
1852CONFIG_SGI_IOC4=m
1853CONFIG_TIFM_CORE=m
1854CONFIG_TIFM_7XX1=m
1855CONFIG_ICS932S401=m
1856CONFIG_ENCLOSURE_SERVICES=m
1857CONFIG_HP_ILO=m
1858CONFIG_APDS9802ALS=m
1859CONFIG_ISL29003=m
1860CONFIG_ISL29020=m
1861CONFIG_SENSORS_TSL2550=m
1862CONFIG_SENSORS_BH1780=m
1863CONFIG_SENSORS_BH1770=m
1864CONFIG_SENSORS_APDS990X=m
1865CONFIG_HMC6352=m
1866CONFIG_DS1682=m
1867CONFIG_TI_DAC7512=m
1868CONFIG_VMWARE_BALLOON=m
1869# CONFIG_BMP085_I2C is not set
1870# CONFIG_BMP085_SPI is not set
1871# CONFIG_USB_SWITCH_FSA9480 is not set
1872# CONFIG_LATTICE_ECP3_CONFIG is not set
1873# CONFIG_SRAM is not set
1874CONFIG_C2PORT=m
1875CONFIG_C2PORT_DURAMAR_2150=m
1876
1877#
1878# EEPROM support
1879#
1880CONFIG_EEPROM_AT24=m
1881CONFIG_EEPROM_AT25=m
1882CONFIG_EEPROM_LEGACY=m
1883CONFIG_EEPROM_MAX6875=m
1884CONFIG_EEPROM_93CX6=m
1885# CONFIG_EEPROM_93XX46 is not set
1886CONFIG_CB710_CORE=m
1887# CONFIG_CB710_DEBUG is not set
1888CONFIG_CB710_DEBUG_ASSUMPTIONS=y
1889
1890#
1891# Texas Instruments shared transport line discipline
1892#
1893# CONFIG_TI_ST is not set
1894CONFIG_SENSORS_LIS3_I2C=m
1895
1896#
1897# Altera FPGA firmware download module
1898#
1899CONFIG_ALTERA_STAPL=m
1900CONFIG_INTEL_MEI=m
1901CONFIG_INTEL_MEI_ME=m
1902# CONFIG_INTEL_MEI_TXE is not set
1903CONFIG_VMWARE_VMCI=m
1904
1905#
1906# Intel MIC Bus Driver
1907#
1908CONFIG_INTEL_MIC_BUS=m
1909
1910#
1911# SCIF Bus Driver
1912#
1913CONFIG_SCIF_BUS=m
1914
1915#
1916# Intel MIC Host Driver
1917#
1918CONFIG_INTEL_MIC_HOST=m
1919
1920#
1921# Intel MIC Card Driver
1922#
1923# CONFIG_INTEL_MIC_CARD is not set
1924
1925#
1926# SCIF Driver
1927#
1928CONFIG_SCIF=m
1929
1930#
1931# Intel MIC Coprocessor State Management (COSM) Drivers
1932#
1933CONFIG_MIC_COSM=m
1934# CONFIG_GENWQE is not set
1935# CONFIG_ECHO is not set
1936# CONFIG_CXL_BASE is not set
1937# CONFIG_CXL_KERNEL_API is not set
1938# CONFIG_CXL_EEH is not set
1939CONFIG_HAVE_IDE=y
1940# CONFIG_IDE is not set
1941
1942#
1943# SCSI device support
1944#
1945CONFIG_SCSI_MOD=m
1946CONFIG_RAID_ATTRS=m
1947CONFIG_SCSI=m
1948CONFIG_SCSI_DMA=y
1949CONFIG_SCSI_NETLINK=y
1950# CONFIG_SCSI_MQ_DEFAULT is not set
1951# CONFIG_SCSI_PROC_FS is not set
1952
1953#
1954# SCSI support type (disk, tape, CD-ROM)
1955#
1956CONFIG_BLK_DEV_SD=m
1957CONFIG_CHR_DEV_ST=m
1958CONFIG_CHR_DEV_OSST=m
1959CONFIG_BLK_DEV_SR=m
1960CONFIG_BLK_DEV_SR_VENDOR=y
1961CONFIG_CHR_DEV_SG=m
1962CONFIG_CHR_DEV_SCH=m
1963CONFIG_SCSI_ENCLOSURE=m
1964CONFIG_SCSI_CONSTANTS=y
1965CONFIG_SCSI_LOGGING=y
1966CONFIG_SCSI_SCAN_ASYNC=y
1967
1968#
1969# SCSI Transports
1970#
1971CONFIG_SCSI_SPI_ATTRS=m
1972CONFIG_SCSI_FC_ATTRS=m
1973CONFIG_SCSI_ISCSI_ATTRS=m
1974CONFIG_SCSI_SAS_ATTRS=m
1975CONFIG_SCSI_SAS_LIBSAS=m
1976CONFIG_SCSI_SAS_ATA=y
1977CONFIG_SCSI_SAS_HOST_SMP=y
1978CONFIG_SCSI_SRP_ATTRS=m
1979CONFIG_SCSI_LOWLEVEL=y
1980CONFIG_ISCSI_TCP=m
1981CONFIG_ISCSI_BOOT_SYSFS=m
1982CONFIG_SCSI_CXGB3_ISCSI=m
1983CONFIG_SCSI_CXGB4_ISCSI=m
1984CONFIG_SCSI_BNX2_ISCSI=m
1985CONFIG_SCSI_BNX2X_FCOE=m
1986CONFIG_BE2ISCSI=m
1987CONFIG_BLK_DEV_3W_XXXX_RAID=m
1988CONFIG_SCSI_HPSA=m
1989CONFIG_SCSI_3W_9XXX=m
1990CONFIG_SCSI_3W_SAS=m
1991CONFIG_SCSI_ACARD=m
1992CONFIG_SCSI_AACRAID=m
1993CONFIG_SCSI_AIC7XXX=m
1994CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
1995CONFIG_AIC7XXX_RESET_DELAY_MS=15000
1996CONFIG_AIC7XXX_DEBUG_ENABLE=y
1997CONFIG_AIC7XXX_DEBUG_MASK=0
1998CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
1999CONFIG_SCSI_AIC79XX=m
2000CONFIG_AIC79XX_CMDS_PER_DEVICE=32
2001CONFIG_AIC79XX_RESET_DELAY_MS=15000
2002CONFIG_AIC79XX_DEBUG_ENABLE=y
2003CONFIG_AIC79XX_DEBUG_MASK=0
2004CONFIG_AIC79XX_REG_PRETTY_PRINT=y
2005CONFIG_SCSI_AIC94XX=m
2006# CONFIG_AIC94XX_DEBUG is not set
2007CONFIG_SCSI_MVSAS=m
2008# CONFIG_SCSI_MVSAS_DEBUG is not set
2009# CONFIG_SCSI_MVSAS_TASKLET is not set
2010CONFIG_SCSI_MVUMI=m
2011CONFIG_SCSI_DPT_I2O=m
2012CONFIG_SCSI_ADVANSYS=m
2013CONFIG_SCSI_ARCMSR=m
2014CONFIG_SCSI_ESAS2R=m
2015CONFIG_MEGARAID_NEWGEN=y
2016CONFIG_MEGARAID_MM=m
2017CONFIG_MEGARAID_MAILBOX=m
2018CONFIG_MEGARAID_LEGACY=m
2019CONFIG_MEGARAID_SAS=m
2020CONFIG_SCSI_MPT3SAS=m
2021CONFIG_SCSI_MPT2SAS_MAX_SGE=128
2022CONFIG_SCSI_MPT3SAS_MAX_SGE=128
2023CONFIG_SCSI_MPT2SAS=m
2024CONFIG_SCSI_UFSHCD=m
2025CONFIG_SCSI_UFSHCD_PCI=m
2026# CONFIG_SCSI_UFSHCD_PLATFORM is not set
2027CONFIG_SCSI_HPTIOP=m
2028CONFIG_SCSI_BUSLOGIC=m
2029# CONFIG_SCSI_FLASHPOINT is not set
2030CONFIG_VMWARE_PVSCSI=m
2031CONFIG_HYPERV_STORAGE=m
2032CONFIG_LIBFC=m
2033CONFIG_LIBFCOE=m
2034CONFIG_FCOE=m
2035CONFIG_FCOE_FNIC=m
2036CONFIG_SCSI_SNIC=m
2037CONFIG_SCSI_DMX3191D=m
2038CONFIG_SCSI_EATA=m
2039CONFIG_SCSI_EATA_TAGGED_QUEUE=y
2040CONFIG_SCSI_EATA_LINKED_COMMANDS=y
2041CONFIG_SCSI_EATA_MAX_TAGS=16
2042CONFIG_SCSI_FUTURE_DOMAIN=m
2043CONFIG_SCSI_GDTH=m
2044CONFIG_SCSI_ISCI=m
2045CONFIG_SCSI_IPS=m
2046CONFIG_SCSI_INITIO=m
2047CONFIG_SCSI_INIA100=m
2048# CONFIG_SCSI_PPA is not set
2049# CONFIG_SCSI_IMM is not set
2050CONFIG_SCSI_STEX=m
2051CONFIG_SCSI_SYM53C8XX_2=m
2052CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
2053CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
2054CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
2055CONFIG_SCSI_SYM53C8XX_MMIO=y
2056CONFIG_SCSI_IPR=m
2057# CONFIG_SCSI_IPR_TRACE is not set
2058# CONFIG_SCSI_IPR_DUMP is not set
2059CONFIG_SCSI_QLOGIC_1280=m
2060CONFIG_SCSI_QLA_FC=m
2061CONFIG_TCM_QLA2XXX=m
2062CONFIG_SCSI_QLA_ISCSI=m
2063CONFIG_SCSI_LPFC=m
2064CONFIG_SCSI_DC395x=m
2065CONFIG_SCSI_AM53C974=m
2066CONFIG_SCSI_WD719X=m
2067CONFIG_SCSI_DEBUG=m
2068CONFIG_SCSI_PMCRAID=m
2069CONFIG_SCSI_PM8001=m
2070CONFIG_SCSI_BFA_FC=m
2071CONFIG_SCSI_VIRTIO=m
2072CONFIG_SCSI_CHELSIO_FCOE=m
2073CONFIG_SCSI_LOWLEVEL_PCMCIA=y
2074CONFIG_PCMCIA_AHA152X=m
2075CONFIG_PCMCIA_FDOMAIN=m
2076CONFIG_PCMCIA_QLOGIC=m
2077CONFIG_PCMCIA_SYM53C500=m
2078CONFIG_SCSI_DH=y
2079CONFIG_SCSI_DH_RDAC=m
2080CONFIG_SCSI_DH_HP_SW=m
2081CONFIG_SCSI_DH_EMC=m
2082CONFIG_SCSI_DH_ALUA=m
2083CONFIG_SCSI_OSD_INITIATOR=m
2084CONFIG_SCSI_OSD_ULD=m
2085CONFIG_SCSI_OSD_DPRINT_SENSE=1
2086# CONFIG_SCSI_OSD_DEBUG is not set
2087CONFIG_ATA=m
2088# CONFIG_ATA_NONSTANDARD is not set
2089CONFIG_ATA_VERBOSE_ERROR=y
2090CONFIG_ATA_ACPI=y
2091CONFIG_SATA_ZPODD=y
2092CONFIG_SATA_PMP=y
2093
2094#
2095# Controllers with non-SFF native interface
2096#
2097CONFIG_SATA_AHCI=m
2098# CONFIG_SATA_AHCI_PLATFORM is not set
2099# CONFIG_SATA_INIC162X is not set
2100CONFIG_SATA_ACARD_AHCI=m
2101CONFIG_SATA_SIL24=m
2102CONFIG_ATA_SFF=y
2103
2104#
2105# SFF controllers with custom DMA interface
2106#
2107CONFIG_PDC_ADMA=m
2108CONFIG_SATA_QSTOR=m
2109CONFIG_SATA_SX4=m
2110CONFIG_ATA_BMDMA=y
2111
2112#
2113# SATA SFF controllers with BMDMA
2114#
2115CONFIG_ATA_PIIX=m
2116CONFIG_SATA_MV=m
2117CONFIG_SATA_NV=m
2118CONFIG_SATA_PROMISE=m
2119CONFIG_SATA_SIL=m
2120CONFIG_SATA_SIS=m
2121CONFIG_SATA_SVW=m
2122CONFIG_SATA_ULI=m
2123CONFIG_SATA_VIA=m
2124CONFIG_SATA_VITESSE=m
2125
2126#
2127# PATA SFF controllers with BMDMA
2128#
2129CONFIG_PATA_ALI=m
2130CONFIG_PATA_AMD=m
2131CONFIG_PATA_ARTOP=m
2132CONFIG_PATA_ATIIXP=m
2133CONFIG_PATA_ATP867X=m
2134CONFIG_PATA_CMD64X=m
2135# CONFIG_PATA_CYPRESS is not set
2136CONFIG_PATA_EFAR=m
2137CONFIG_PATA_HPT366=m
2138CONFIG_PATA_HPT37X=m
2139# CONFIG_PATA_HPT3X2N is not set
2140# CONFIG_PATA_HPT3X3 is not set
2141CONFIG_PATA_IT8213=m
2142CONFIG_PATA_IT821X=m
2143CONFIG_PATA_JMICRON=m
2144CONFIG_PATA_MARVELL=m
2145CONFIG_PATA_NETCELL=m
2146CONFIG_PATA_NINJA32=m
2147CONFIG_PATA_NS87415=m
2148CONFIG_PATA_OLDPIIX=m
2149# CONFIG_PATA_OPTIDMA is not set
2150CONFIG_PATA_PDC2027X=m
2151CONFIG_PATA_PDC_OLD=m
2152# CONFIG_PATA_RADISYS is not set
2153CONFIG_PATA_RDC=m
2154CONFIG_PATA_SCH=m
2155CONFIG_PATA_SERVERWORKS=m
2156CONFIG_PATA_SIL680=m
2157CONFIG_PATA_SIS=m
2158CONFIG_PATA_TOSHIBA=m
2159CONFIG_PATA_TRIFLEX=m
2160CONFIG_PATA_VIA=m
2161# CONFIG_PATA_WINBOND is not set
2162
2163#
2164# PIO-only SFF controllers
2165#
2166# CONFIG_PATA_CMD640_PCI is not set
2167CONFIG_PATA_MPIIX=m
2168CONFIG_PATA_NS87410=m
2169# CONFIG_PATA_OPTI is not set
2170CONFIG_PATA_PCMCIA=m
2171# CONFIG_PATA_PLATFORM is not set
2172CONFIG_PATA_RZ1000=m
2173
2174#
2175# Generic fallback / legacy drivers
2176#
2177# CONFIG_PATA_ACPI is not set
2178CONFIG_ATA_GENERIC=m
2179# CONFIG_PATA_LEGACY is not set
2180CONFIG_MD=y
2181CONFIG_BLK_DEV_MD=m
2182CONFIG_MD_LINEAR=m
2183CONFIG_MD_RAID0=m
2184CONFIG_MD_RAID1=m
2185CONFIG_MD_RAID10=m
2186CONFIG_MD_RAID456=m
2187CONFIG_MD_MULTIPATH=m
2188CONFIG_MD_FAULTY=m
2189# CONFIG_MD_CLUSTER is not set
2190CONFIG_BCACHE=m
2191# CONFIG_BCACHE_DEBUG is not set
2192CONFIG_BLK_DEV_DM_BUILTIN=y
2193CONFIG_BLK_DEV_DM=m
2194# CONFIG_DM_MQ_DEFAULT is not set
2195# CONFIG_DM_DEBUG is not set
2196CONFIG_DM_BUFIO=m
2197CONFIG_DM_BIO_PRISON=m
2198CONFIG_DM_PERSISTENT_DATA=m
2199# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set
2200CONFIG_DM_CRYPT=m
2201CONFIG_DM_SNAPSHOT=m
2202CONFIG_DM_THIN_PROVISIONING=m
2203CONFIG_DM_CACHE=m
2204CONFIG_DM_CACHE_MQ=m
2205CONFIG_DM_CACHE_SMQ=m
2206CONFIG_DM_CACHE_CLEANER=m
2207CONFIG_DM_ERA=m
2208CONFIG_DM_MIRROR=m
2209CONFIG_DM_LOG_USERSPACE=m
2210CONFIG_DM_RAID=m
2211CONFIG_DM_ZERO=m
2212CONFIG_DM_MULTIPATH=m
2213CONFIG_DM_MULTIPATH_QL=m
2214CONFIG_DM_MULTIPATH_ST=m
2215CONFIG_DM_DELAY=m
2216CONFIG_DM_UEVENT=y
2217CONFIG_DM_FLAKEY=m
2218CONFIG_DM_VERITY=m
2219CONFIG_DM_SWITCH=m
2220CONFIG_DM_LOG_WRITES=m
2221CONFIG_TARGET_CORE=m
2222CONFIG_TCM_IBLOCK=m
2223CONFIG_TCM_FILEIO=m
2224CONFIG_TCM_PSCSI=m
2225CONFIG_TCM_USER2=m
2226CONFIG_LOOPBACK_TARGET=m
2227CONFIG_TCM_FC=m
2228CONFIG_ISCSI_TARGET=m
2229CONFIG_SBP_TARGET=m
2230CONFIG_FUSION=y
2231CONFIG_FUSION_SPI=m
2232CONFIG_FUSION_FC=m
2233CONFIG_FUSION_SAS=m
2234CONFIG_FUSION_MAX_SGE=128
2235CONFIG_FUSION_CTL=m
2236CONFIG_FUSION_LAN=m
2237# CONFIG_FUSION_LOGGING is not set
2238
2239#
2240# IEEE 1394 (FireWire) support
2241#
2242CONFIG_FIREWIRE=m
2243CONFIG_FIREWIRE_OHCI=m
2244CONFIG_FIREWIRE_SBP2=m
2245CONFIG_FIREWIRE_NET=m
2246CONFIG_FIREWIRE_NOSY=m
2247CONFIG_MACINTOSH_DRIVERS=y
2248CONFIG_MAC_EMUMOUSEBTN=y
2249CONFIG_NETDEVICES=y
2250CONFIG_MII=m
2251CONFIG_NET_CORE=y
2252CONFIG_BONDING=m
2253CONFIG_DUMMY=m
2254CONFIG_EQUALIZER=m
2255CONFIG_NET_FC=y
2256CONFIG_IFB=m
2257CONFIG_NET_TEAM=m
2258CONFIG_NET_TEAM_MODE_BROADCAST=m
2259CONFIG_NET_TEAM_MODE_ROUNDROBIN=m
2260CONFIG_NET_TEAM_MODE_RANDOM=m
2261CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m
2262CONFIG_NET_TEAM_MODE_LOADBALANCE=m
2263CONFIG_MACVLAN=m
2264CONFIG_MACVTAP=m
2265CONFIG_IPVLAN=m
2266CONFIG_VXLAN=m
2267CONFIG_GENEVE=m
2268CONFIG_NETCONSOLE=m
2269CONFIG_NETCONSOLE_DYNAMIC=y
2270CONFIG_NETPOLL=y
2271CONFIG_NET_POLL_CONTROLLER=y
2272CONFIG_TUN=m
2273# CONFIG_TUN_VNET_CROSS_LE is not set
2274CONFIG_VETH=m
2275CONFIG_VIRTIO_NET=m
2276CONFIG_NLMON=m
2277CONFIG_NET_VRF=m
2278CONFIG_SUNGEM_PHY=m
2279CONFIG_ARCNET=m
2280CONFIG_ARCNET_1201=m
2281CONFIG_ARCNET_1051=m
2282CONFIG_ARCNET_RAW=m
2283CONFIG_ARCNET_CAP=m
2284CONFIG_ARCNET_COM90xx=m
2285CONFIG_ARCNET_COM90xxIO=m
2286CONFIG_ARCNET_RIM_I=m
2287CONFIG_ARCNET_COM20020=m
2288CONFIG_ARCNET_COM20020_PCI=m
2289CONFIG_ARCNET_COM20020_CS=m
2290CONFIG_ATM_DRIVERS=y
2291CONFIG_ATM_DUMMY=m
2292CONFIG_ATM_TCP=m
2293CONFIG_ATM_LANAI=m
2294CONFIG_ATM_ENI=m
2295# CONFIG_ATM_ENI_DEBUG is not set
2296# CONFIG_ATM_ENI_TUNE_BURST is not set
2297CONFIG_ATM_FIRESTREAM=m
2298CONFIG_ATM_ZATM=m
2299# CONFIG_ATM_ZATM_DEBUG is not set
2300CONFIG_ATM_NICSTAR=m
2301CONFIG_ATM_NICSTAR_USE_SUNI=y
2302CONFIG_ATM_NICSTAR_USE_IDT77105=y
2303CONFIG_ATM_IDT77252=m
2304# CONFIG_ATM_IDT77252_DEBUG is not set
2305# CONFIG_ATM_IDT77252_RCV_ALL is not set
2306CONFIG_ATM_IDT77252_USE_SUNI=y
2307CONFIG_ATM_AMBASSADOR=m
2308# CONFIG_ATM_AMBASSADOR_DEBUG is not set
2309CONFIG_ATM_HORIZON=m
2310# CONFIG_ATM_HORIZON_DEBUG is not set
2311CONFIG_ATM_IA=m
2312# CONFIG_ATM_IA_DEBUG is not set
2313CONFIG_ATM_FORE200E=m
2314# CONFIG_ATM_FORE200E_USE_TASKLET is not set
2315CONFIG_ATM_FORE200E_TX_RETRY=16
2316CONFIG_ATM_FORE200E_DEBUG=0
2317CONFIG_ATM_HE=m
2318CONFIG_ATM_HE_USE_SUNI=y
2319CONFIG_ATM_SOLOS=m
2320
2321#
2322# CAIF transport drivers
2323#
2324CONFIG_VHOST_NET=m
2325CONFIG_VHOST_SCSI=m
2326CONFIG_VHOST_RING=m
2327CONFIG_VHOST=m
2328# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set
2329
2330#
2331# Distributed Switch Architecture drivers
2332#
2333# CONFIG_NET_DSA_MV88E6XXX is not set
2334# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
2335CONFIG_ETHERNET=y
2336CONFIG_MDIO=m
2337CONFIG_NET_VENDOR_3COM=y
2338CONFIG_PCMCIA_3C574=m
2339CONFIG_PCMCIA_3C589=m
2340CONFIG_VORTEX=m
2341CONFIG_TYPHOON=m
2342CONFIG_NET_VENDOR_ADAPTEC=y
2343CONFIG_ADAPTEC_STARFIRE=m
2344CONFIG_NET_VENDOR_AGERE=y
2345CONFIG_ET131X=m
2346CONFIG_NET_VENDOR_ALTEON=y
2347CONFIG_ACENIC=m
2348# CONFIG_ACENIC_OMIT_TIGON_I is not set
2349# CONFIG_ALTERA_TSE is not set
2350CONFIG_NET_VENDOR_AMD=y
2351CONFIG_AMD8111_ETH=m
2352CONFIG_PCNET32=m
2353CONFIG_PCMCIA_NMCLAN=m
2354# CONFIG_NET_VENDOR_ARC is not set
2355CONFIG_NET_VENDOR_ATHEROS=y
2356CONFIG_ATL2=m
2357CONFIG_ATL1=m
2358CONFIG_ATL1E=m
2359CONFIG_ATL1C=m
2360CONFIG_ALX=m
2361# CONFIG_NET_VENDOR_AURORA is not set
2362CONFIG_NET_CADENCE=y
2363# CONFIG_MACB is not set
2364CONFIG_NET_VENDOR_BROADCOM=y
2365CONFIG_B44=m
2366CONFIG_B44_PCI_AUTOSELECT=y
2367CONFIG_B44_PCICORE_AUTOSELECT=y
2368CONFIG_B44_PCI=y
2369# CONFIG_BCMGENET is not set
2370CONFIG_BNX2=m
2371CONFIG_CNIC=m
2372CONFIG_TIGON3=m
2373CONFIG_BNX2X=m
2374CONFIG_BNX2X_SRIOV=y
2375CONFIG_BNX2X_VXLAN=y
2376CONFIG_BNXT=m
2377CONFIG_BNXT_SRIOV=y
2378CONFIG_NET_VENDOR_BROCADE=y
2379CONFIG_BNA=m
2380CONFIG_NET_VENDOR_CAVIUM=y
2381# CONFIG_THUNDER_NIC_PF is not set
2382# CONFIG_THUNDER_NIC_VF is not set
2383# CONFIG_THUNDER_NIC_BGX is not set
2384CONFIG_LIQUIDIO=m
2385CONFIG_NET_VENDOR_CHELSIO=y
2386CONFIG_CHELSIO_T1=m
2387CONFIG_CHELSIO_T1_1G=y
2388CONFIG_CHELSIO_T3=m
2389CONFIG_CHELSIO_T4=m
2390CONFIG_CHELSIO_T4_DCB=y
2391# CONFIG_CHELSIO_T4_FCOE is not set
2392CONFIG_CHELSIO_T4VF=m
2393CONFIG_NET_VENDOR_CISCO=y
2394CONFIG_ENIC=m
2395# CONFIG_CX_ECAT is not set
2396# CONFIG_DNET is not set
2397CONFIG_NET_VENDOR_DEC=y
2398CONFIG_NET_TULIP=y
2399CONFIG_DE2104X=m
2400CONFIG_DE2104X_DSL=0
2401CONFIG_TULIP=m
2402# CONFIG_TULIP_MWI is not set
2403# CONFIG_TULIP_MMIO is not set
2404CONFIG_TULIP_NAPI=y
2405CONFIG_TULIP_NAPI_HW_MITIGATION=y
2406# CONFIG_DE4X5 is not set
2407CONFIG_WINBOND_840=m
2408CONFIG_DM9102=m
2409CONFIG_ULI526X=m
2410CONFIG_PCMCIA_XIRCOM=m
2411CONFIG_NET_VENDOR_DLINK=y
2412CONFIG_DL2K=m
2413CONFIG_SUNDANCE=m
2414# CONFIG_SUNDANCE_MMIO is not set
2415CONFIG_NET_VENDOR_EMULEX=y
2416CONFIG_BE2NET=m
2417CONFIG_BE2NET_HWMON=y
2418CONFIG_BE2NET_VXLAN=y
2419CONFIG_NET_VENDOR_EZCHIP=y
2420CONFIG_NET_VENDOR_EXAR=y
2421CONFIG_S2IO=m
2422CONFIG_VXGE=m
2423# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
2424CONFIG_NET_VENDOR_FUJITSU=y
2425CONFIG_PCMCIA_FMVJ18X=m
2426CONFIG_NET_VENDOR_HP=y
2427CONFIG_HP100=m
2428CONFIG_NET_VENDOR_INTEL=y
2429CONFIG_E100=m
2430CONFIG_E1000=m
2431CONFIG_E1000E=m
2432CONFIG_IGB=m
2433CONFIG_IGB_HWMON=y
2434CONFIG_IGB_DCA=y
2435CONFIG_IGBVF=m
2436CONFIG_IXGB=m
2437CONFIG_IXGBE=m
2438CONFIG_IXGBE_VXLAN=y
2439CONFIG_IXGBE_HWMON=y
2440CONFIG_IXGBE_DCA=y
2441CONFIG_IXGBE_DCB=y
2442CONFIG_IXGBEVF=m
2443CONFIG_I40E=m
2444CONFIG_I40E_VXLAN=y
2445CONFIG_I40E_DCB=y
2446CONFIG_I40E_FCOE=y
2447CONFIG_I40EVF=m
2448# CONFIG_FM10K is not set
2449CONFIG_NET_VENDOR_I825XX=y
2450CONFIG_JME=m
2451CONFIG_NET_VENDOR_MARVELL=y
2452# CONFIG_MVMDIO is not set
2453CONFIG_SKGE=m
2454CONFIG_SKGE_GENESIS=y
2455CONFIG_SKY2=m
2456CONFIG_NET_VENDOR_MELLANOX=y
2457CONFIG_MLX4_EN=m
2458CONFIG_MLX4_EN_DCB=y
2459CONFIG_MLX4_EN_VXLAN=y
2460CONFIG_MLX4_CORE=m
2461CONFIG_MLX4_DEBUG=y
2462CONFIG_MLX5_CORE=m
2463CONFIG_MLX5_CORE_EN=y
2464# CONFIG_MLXSW_CORE is not set
2465CONFIG_NET_VENDOR_MICREL=y
2466# CONFIG_KS8842 is not set
2467# CONFIG_KS8851 is not set
2468# CONFIG_KS8851_MLL is not set
2469CONFIG_KSZ884X_PCI=m
2470CONFIG_NET_VENDOR_MICROCHIP=y
2471# CONFIG_ENC28J60 is not set
2472# CONFIG_ENCX24J600 is not set
2473CONFIG_NET_VENDOR_MYRI=y
2474CONFIG_MYRI10GE=m
2475CONFIG_MYRI10GE_DCA=y
2476CONFIG_FEALNX=m
2477CONFIG_NET_VENDOR_NATSEMI=y
2478CONFIG_NATSEMI=m
2479CONFIG_NS83820=m
2480CONFIG_NET_VENDOR_8390=y
2481CONFIG_PCMCIA_AXNET=m
2482CONFIG_NE2K_PCI=m
2483CONFIG_PCMCIA_PCNET=m
2484CONFIG_NET_VENDOR_NVIDIA=y
2485CONFIG_FORCEDETH=m
2486CONFIG_NET_VENDOR_OKI=y
2487# CONFIG_ETHOC is not set
2488CONFIG_NET_PACKET_ENGINE=y
2489CONFIG_HAMACHI=m
2490CONFIG_YELLOWFIN=m
2491CONFIG_NET_VENDOR_QLOGIC=y
2492CONFIG_QLA3XXX=m
2493CONFIG_QLCNIC=m
2494CONFIG_QLCNIC_SRIOV=y
2495CONFIG_QLCNIC_DCB=y
2496CONFIG_QLCNIC_VXLAN=y
2497CONFIG_QLCNIC_HWMON=y
2498CONFIG_QLGE=m
2499CONFIG_NETXEN_NIC=m
2500CONFIG_QED=m
2501CONFIG_QEDE=m
2502CONFIG_NET_VENDOR_QUALCOMM=y
2503CONFIG_NET_VENDOR_REALTEK=y
2504# CONFIG_ATP is not set
2505CONFIG_8139CP=m
2506CONFIG_8139TOO=m
2507# CONFIG_8139TOO_PIO is not set
2508CONFIG_8139TOO_TUNE_TWISTER=y
2509CONFIG_8139TOO_8129=y
2510# CONFIG_8139_OLD_RX_RESET is not set
2511CONFIG_R8169=m
2512CONFIG_NET_VENDOR_RENESAS=y
2513CONFIG_NET_VENDOR_RDC=y
2514CONFIG_R6040=m
2515CONFIG_NET_VENDOR_ROCKER=y
2516CONFIG_NET_VENDOR_SAMSUNG=y
2517# CONFIG_SXGBE_ETH is not set
2518# CONFIG_NET_VENDOR_SEEQ is not set
2519CONFIG_NET_VENDOR_SILAN=y
2520CONFIG_SC92031=m
2521CONFIG_NET_VENDOR_SIS=y
2522CONFIG_SIS900=m
2523CONFIG_SIS190=m
2524CONFIG_SFC=m
2525CONFIG_SFC_MTD=y
2526CONFIG_SFC_MCDI_MON=y
2527CONFIG_SFC_SRIOV=y
2528CONFIG_SFC_MCDI_LOGGING=y
2529CONFIG_NET_VENDOR_SMSC=y
2530CONFIG_PCMCIA_SMC91C92=m
2531CONFIG_EPIC100=m
2532# CONFIG_SMSC911X is not set
2533CONFIG_SMSC9420=m
2534CONFIG_NET_VENDOR_STMICRO=y
2535# CONFIG_STMMAC_ETH is not set
2536CONFIG_NET_VENDOR_SUN=y
2537CONFIG_HAPPYMEAL=m
2538CONFIG_SUNGEM=m
2539CONFIG_CASSINI=m
2540CONFIG_NIU=m
2541CONFIG_NET_VENDOR_SYNOPSYS=y
2542CONFIG_NET_VENDOR_TEHUTI=y
2543CONFIG_TEHUTI=m
2544CONFIG_NET_VENDOR_TI=y
2545# CONFIG_TI_CPSW_ALE is not set
2546CONFIG_TLAN=m
2547CONFIG_NET_VENDOR_VIA=y
2548CONFIG_VIA_RHINE=m
2549# CONFIG_VIA_RHINE_MMIO is not set
2550CONFIG_VIA_VELOCITY=m
2551CONFIG_NET_VENDOR_WIZNET=y
2552# CONFIG_WIZNET_W5100 is not set
2553# CONFIG_WIZNET_W5300 is not set
2554CONFIG_NET_VENDOR_XIRCOM=y
2555CONFIG_PCMCIA_XIRC2PS=m
2556CONFIG_FDDI=y
2557CONFIG_DEFXX=m
2558# CONFIG_DEFXX_MMIO is not set
2559CONFIG_SKFP=m
2560CONFIG_HIPPI=y
2561CONFIG_ROADRUNNER=m
2562# CONFIG_ROADRUNNER_LARGE_RINGS is not set
2563CONFIG_NET_SB1000=m
2564CONFIG_PHYLIB=m
2565
2566#
2567# MII PHY device drivers
2568#
2569CONFIG_AQUANTIA_PHY=m
2570CONFIG_AT803X_PHY=m
2571CONFIG_AMD_PHY=m
2572CONFIG_MARVELL_PHY=m
2573CONFIG_DAVICOM_PHY=m
2574CONFIG_QSEMI_PHY=m
2575CONFIG_LXT_PHY=m
2576CONFIG_CICADA_PHY=m
2577CONFIG_VITESSE_PHY=m
2578CONFIG_TERANETICS_PHY=m
2579CONFIG_SMSC_PHY=m
2580CONFIG_BCM_NET_PHYLIB=m
2581CONFIG_BROADCOM_PHY=m
2582# CONFIG_BCM7XXX_PHY is not set
2583CONFIG_BCM87XX_PHY=m
2584CONFIG_ICPLUS_PHY=m
2585CONFIG_REALTEK_PHY=m
2586CONFIG_NATIONAL_PHY=m
2587CONFIG_STE10XP=m
2588CONFIG_LSI_ET1011C_PHY=m
2589CONFIG_MICREL_PHY=m
2590CONFIG_DP83848_PHY=m
2591CONFIG_DP83867_PHY=m
2592CONFIG_MICROCHIP_PHY=m
2593# CONFIG_FIXED_PHY is not set
2594# CONFIG_MDIO_BITBANG is not set
2595# CONFIG_MDIO_OCTEON is not set
2596# CONFIG_MDIO_BCM_UNIMAC is not set
2597# CONFIG_MICREL_KS8995MA is not set
2598CONFIG_PLIP=m
2599CONFIG_PPP=m
2600CONFIG_PPP_BSDCOMP=m
2601CONFIG_PPP_DEFLATE=m
2602CONFIG_PPP_FILTER=y
2603CONFIG_PPP_MPPE=m
2604CONFIG_PPP_MULTILINK=y
2605CONFIG_PPPOATM=m
2606CONFIG_PPPOE=m
2607CONFIG_PPTP=m
2608CONFIG_PPPOL2TP=m
2609CONFIG_PPP_ASYNC=m
2610CONFIG_PPP_SYNC_TTY=m
2611CONFIG_SLIP=m
2612CONFIG_SLHC=m
2613CONFIG_SLIP_COMPRESSED=y
2614CONFIG_SLIP_SMART=y
2615CONFIG_SLIP_MODE_SLIP6=y
2616
2617#
2618# Host-side USB support is needed for USB Network Adapter support
2619#
2620CONFIG_USB_NET_DRIVERS=m
2621CONFIG_USB_CATC=m
2622CONFIG_USB_KAWETH=m
2623CONFIG_USB_PEGASUS=m
2624CONFIG_USB_RTL8150=m
2625CONFIG_USB_RTL8152=m
2626CONFIG_USB_LAN78XX=m
2627CONFIG_USB_USBNET=m
2628CONFIG_USB_NET_AX8817X=m
2629CONFIG_USB_NET_AX88179_178A=m
2630CONFIG_USB_NET_CDCETHER=m
2631CONFIG_USB_NET_CDC_EEM=m
2632CONFIG_USB_NET_CDC_NCM=m
2633CONFIG_USB_NET_HUAWEI_CDC_NCM=m
2634CONFIG_USB_NET_CDC_MBIM=m
2635CONFIG_USB_NET_DM9601=m
2636CONFIG_USB_NET_SR9700=m
2637CONFIG_USB_NET_SR9800=m
2638CONFIG_USB_NET_SMSC75XX=m
2639CONFIG_USB_NET_SMSC95XX=m
2640CONFIG_USB_NET_GL620A=m
2641CONFIG_USB_NET_NET1080=m
2642CONFIG_USB_NET_PLUSB=m
2643CONFIG_USB_NET_MCS7830=m
2644CONFIG_USB_NET_RNDIS_HOST=m
2645CONFIG_USB_NET_CDC_SUBSET=m
2646CONFIG_USB_ALI_M5632=y
2647CONFIG_USB_AN2720=y
2648CONFIG_USB_BELKIN=y
2649CONFIG_USB_ARMLINUX=y
2650CONFIG_USB_EPSON2888=y
2651CONFIG_USB_KC2190=y
2652CONFIG_USB_NET_ZAURUS=m
2653CONFIG_USB_NET_CX82310_ETH=m
2654CONFIG_USB_NET_KALMIA=m
2655CONFIG_USB_NET_QMI_WWAN=m
2656CONFIG_USB_HSO=m
2657CONFIG_USB_NET_INT51X1=m
2658CONFIG_USB_CDC_PHONET=m
2659CONFIG_USB_IPHETH=m
2660CONFIG_USB_SIERRA_NET=m
2661CONFIG_USB_VL600=m
2662CONFIG_USB_NET_CH9200=m
2663CONFIG_WLAN=y
2664CONFIG_PCMCIA_RAYCS=m
2665CONFIG_LIBERTAS_THINFIRM=m
2666# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set
2667CONFIG_LIBERTAS_THINFIRM_USB=m
2668CONFIG_AIRO=m
2669CONFIG_ATMEL=m
2670CONFIG_PCI_ATMEL=m
2671CONFIG_PCMCIA_ATMEL=m
2672CONFIG_AT76C50X_USB=m
2673CONFIG_AIRO_CS=m
2674CONFIG_PCMCIA_WL3501=m
2675# CONFIG_PRISM54 is not set
2676CONFIG_USB_ZD1201=m
2677CONFIG_USB_NET_RNDIS_WLAN=m
2678CONFIG_ADM8211=m
2679CONFIG_RTL8180=m
2680CONFIG_RTL8187=m
2681CONFIG_RTL8187_LEDS=y
2682CONFIG_MAC80211_HWSIM=m
2683CONFIG_MWL8K=m
2684CONFIG_ATH_COMMON=m
2685CONFIG_ATH_CARDS=m
2686# CONFIG_ATH_DEBUG is not set
2687CONFIG_ATH5K=m
2688# CONFIG_ATH5K_DEBUG is not set
2689CONFIG_ATH5K_PCI=y
2690CONFIG_ATH9K_HW=m
2691CONFIG_ATH9K_COMMON=m
2692CONFIG_ATH9K_BTCOEX_SUPPORT=y
2693CONFIG_ATH9K=m
2694CONFIG_ATH9K_PCI=y
2695# CONFIG_ATH9K_AHB is not set
2696# CONFIG_ATH9K_DYNACK is not set
2697# CONFIG_ATH9K_WOW is not set
2698CONFIG_ATH9K_RFKILL=y
2699# CONFIG_ATH9K_CHANNEL_CONTEXT is not set
2700CONFIG_ATH9K_PCOEM=y
2701CONFIG_ATH9K_HTC=m
2702CONFIG_CARL9170=m
2703CONFIG_CARL9170_LEDS=y
2704CONFIG_CARL9170_WPC=y
2705# CONFIG_CARL9170_HWRNG is not set
2706CONFIG_ATH6KL=m
2707CONFIG_ATH6KL_SDIO=m
2708CONFIG_ATH6KL_USB=m
2709# CONFIG_ATH6KL_DEBUG is not set
2710CONFIG_AR5523=m
2711CONFIG_WIL6210=m
2712CONFIG_WIL6210_ISR_COR=y
2713CONFIG_ATH10K=m
2714CONFIG_ATH10K_PCI=m
2715# CONFIG_ATH10K_DEBUG is not set
2716# CONFIG_WCN36XX is not set
2717CONFIG_B43=m
2718CONFIG_B43_BCMA=y
2719CONFIG_B43_SSB=y
2720CONFIG_B43_BUSES_BCMA_AND_SSB=y
2721# CONFIG_B43_BUSES_BCMA is not set
2722# CONFIG_B43_BUSES_SSB is not set
2723CONFIG_B43_PCI_AUTOSELECT=y
2724CONFIG_B43_PCICORE_AUTOSELECT=y
2725CONFIG_B43_SDIO=y
2726CONFIG_B43_BCMA_PIO=y
2727CONFIG_B43_PIO=y
2728CONFIG_B43_PHY_G=y
2729CONFIG_B43_PHY_N=y
2730CONFIG_B43_PHY_LP=y
2731CONFIG_B43_PHY_HT=y
2732CONFIG_B43_LEDS=y
2733CONFIG_B43_HWRNG=y
2734# CONFIG_B43_DEBUG is not set
2735CONFIG_B43LEGACY=m
2736CONFIG_B43LEGACY_PCI_AUTOSELECT=y
2737CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
2738CONFIG_B43LEGACY_LEDS=y
2739CONFIG_B43LEGACY_HWRNG=y
2740CONFIG_B43LEGACY_DEBUG=y
2741CONFIG_B43LEGACY_DMA=y
2742CONFIG_B43LEGACY_PIO=y
2743CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
2744# CONFIG_B43LEGACY_DMA_MODE is not set
2745# CONFIG_B43LEGACY_PIO_MODE is not set
2746CONFIG_BRCMUTIL=m
2747CONFIG_BRCMSMAC=m
2748CONFIG_BRCMFMAC=m
2749CONFIG_BRCMFMAC_PROTO_BCDC=y
2750CONFIG_BRCMFMAC_PROTO_MSGBUF=y
2751CONFIG_BRCMFMAC_SDIO=y
2752CONFIG_BRCMFMAC_USB=y
2753CONFIG_BRCMFMAC_PCIE=y
2754# CONFIG_BRCM_TRACING is not set
2755# CONFIG_BRCMDBG is not set
2756CONFIG_HOSTAP=m
2757CONFIG_HOSTAP_FIRMWARE=y
2758# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
2759CONFIG_HOSTAP_PLX=m
2760CONFIG_HOSTAP_PCI=m
2761CONFIG_HOSTAP_CS=m
2762# CONFIG_IPW2100 is not set
2763CONFIG_IPW2200=m
2764CONFIG_IPW2200_MONITOR=y
2765CONFIG_IPW2200_RADIOTAP=y
2766CONFIG_IPW2200_PROMISCUOUS=y
2767CONFIG_IPW2200_QOS=y
2768# CONFIG_IPW2200_DEBUG is not set
2769CONFIG_LIBIPW=m
2770# CONFIG_LIBIPW_DEBUG is not set
2771CONFIG_IWLWIFI=m
2772CONFIG_IWLWIFI_LEDS=y
2773CONFIG_IWLDVM=m
2774CONFIG_IWLMVM=m
2775CONFIG_IWLWIFI_OPMODE_MODULAR=y
2776# CONFIG_IWLWIFI_BCAST_FILTERING is not set
2777# CONFIG_IWLWIFI_UAPSD is not set
2778
2779#
2780# Debugging Options
2781#
2782# CONFIG_IWLWIFI_DEBUG is not set
2783CONFIG_IWLEGACY=m
2784CONFIG_IWL4965=m
2785CONFIG_IWL3945=m
2786
2787#
2788# iwl3945 / iwl4965 Debugging Options
2789#
2790# CONFIG_IWLEGACY_DEBUG is not set
2791CONFIG_LIBERTAS=m
2792CONFIG_LIBERTAS_USB=m
2793CONFIG_LIBERTAS_CS=m
2794CONFIG_LIBERTAS_SDIO=m
2795# CONFIG_LIBERTAS_SPI is not set
2796# CONFIG_LIBERTAS_DEBUG is not set
2797CONFIG_LIBERTAS_MESH=y
2798CONFIG_HERMES=m
2799# CONFIG_HERMES_PRISM is not set
2800CONFIG_HERMES_CACHE_FW_ON_INIT=y
2801CONFIG_PLX_HERMES=m
2802CONFIG_TMD_HERMES=m
2803CONFIG_NORTEL_HERMES=m
2804CONFIG_PCMCIA_HERMES=m
2805CONFIG_PCMCIA_SPECTRUM=m
2806CONFIG_ORINOCO_USB=m
2807CONFIG_P54_COMMON=m
2808CONFIG_P54_USB=m
2809CONFIG_P54_PCI=m
2810# CONFIG_P54_SPI is not set
2811CONFIG_P54_LEDS=y
2812CONFIG_RT2X00=m
2813CONFIG_RT2400PCI=m
2814CONFIG_RT2500PCI=m
2815CONFIG_RT61PCI=m
2816CONFIG_RT2800PCI=m
2817CONFIG_RT2800PCI_RT33XX=y
2818CONFIG_RT2800PCI_RT35XX=y
2819CONFIG_RT2800PCI_RT53XX=y
2820CONFIG_RT2800PCI_RT3290=y
2821CONFIG_RT2500USB=m
2822CONFIG_RT73USB=m
2823CONFIG_RT2800USB=m
2824CONFIG_RT2800USB_RT33XX=y
2825CONFIG_RT2800USB_RT35XX=y
2826CONFIG_RT2800USB_RT3573=y
2827CONFIG_RT2800USB_RT53XX=y
2828CONFIG_RT2800USB_RT55XX=y
2829# CONFIG_RT2800USB_UNKNOWN is not set
2830CONFIG_RT2800_LIB=m
2831CONFIG_RT2800_LIB_MMIO=m
2832CONFIG_RT2X00_LIB_MMIO=m
2833CONFIG_RT2X00_LIB_PCI=m
2834CONFIG_RT2X00_LIB_USB=m
2835CONFIG_RT2X00_LIB=m
2836CONFIG_RT2X00_LIB_FIRMWARE=y
2837CONFIG_RT2X00_LIB_CRYPTO=y
2838CONFIG_RT2X00_LIB_LEDS=y
2839# CONFIG_RT2X00_DEBUG is not set
2840CONFIG_WL_MEDIATEK=y
2841CONFIG_MT7601U=m
2842CONFIG_RTL_CARDS=m
2843CONFIG_RTL8192CE=m
2844CONFIG_RTL8192SE=m
2845CONFIG_RTL8192DE=m
2846CONFIG_RTL8723AE=m
2847CONFIG_RTL8723BE=m
2848CONFIG_RTL8188EE=m
2849CONFIG_RTL8192EE=m
2850CONFIG_RTL8821AE=m
2851CONFIG_RTL8192CU=m
2852CONFIG_RTLWIFI=m
2853CONFIG_RTLWIFI_PCI=m
2854CONFIG_RTLWIFI_USB=m
2855# CONFIG_RTLWIFI_DEBUG is not set
2856CONFIG_RTL8192C_COMMON=m
2857CONFIG_RTL8723_COMMON=m
2858CONFIG_RTLBTCOEXIST=m
2859# CONFIG_RTL8XXXU is not set
2860# CONFIG_WL_TI is not set
2861CONFIG_ZD1211RW=m
2862# CONFIG_ZD1211RW_DEBUG is not set
2863CONFIG_MWIFIEX=m
2864CONFIG_MWIFIEX_SDIO=m
2865CONFIG_MWIFIEX_PCIE=m
2866CONFIG_MWIFIEX_USB=m
2867# CONFIG_CW1200 is not set
2868CONFIG_RSI_91X=m
2869CONFIG_RSI_DEBUGFS=y
2870# CONFIG_RSI_SDIO is not set
2871CONFIG_RSI_USB=m
2872
2873#
2874# WiMAX Wireless Broadband devices
2875#
2876CONFIG_WIMAX_I2400M=m
2877CONFIG_WIMAX_I2400M_USB=m
2878CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
2879CONFIG_WAN=y
2880CONFIG_LANMEDIA=m
2881CONFIG_HDLC=m
2882CONFIG_HDLC_RAW=m
2883CONFIG_HDLC_RAW_ETH=m
2884CONFIG_HDLC_CISCO=m
2885CONFIG_HDLC_FR=m
2886CONFIG_HDLC_PPP=m
2887# CONFIG_HDLC_X25 is not set
2888CONFIG_PCI200SYN=m
2889CONFIG_WANXL=m
2890# CONFIG_PC300TOO is not set
2891CONFIG_FARSYNC=m
2892CONFIG_DSCC4=m
2893CONFIG_DSCC4_PCISYNC=y
2894CONFIG_DSCC4_PCI_RST=y
2895CONFIG_DLCI=m
2896CONFIG_DLCI_MAX=8
2897# CONFIG_SBNI is not set
2898CONFIG_IEEE802154_DRIVERS=m
2899CONFIG_VMXNET3=m
2900CONFIG_FUJITSU_ES=m
2901CONFIG_HYPERV_NET=m
2902CONFIG_ISDN=y
2903# CONFIG_ISDN_I4L is not set
2904CONFIG_ISDN_CAPI=m
2905CONFIG_CAPI_TRACE=y
2906CONFIG_ISDN_CAPI_CAPI20=m
2907CONFIG_ISDN_CAPI_MIDDLEWARE=y
2908
2909#
2910# CAPI hardware drivers
2911#
2912CONFIG_CAPI_AVM=y
2913CONFIG_ISDN_DRV_AVMB1_B1PCI=m
2914CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
2915CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
2916CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
2917CONFIG_ISDN_DRV_AVMB1_T1PCI=m
2918CONFIG_ISDN_DRV_AVMB1_C4=m
2919CONFIG_CAPI_EICON=y
2920CONFIG_ISDN_DIVAS=m
2921CONFIG_ISDN_DIVAS_BRIPCI=y
2922CONFIG_ISDN_DIVAS_PRIPCI=y
2923CONFIG_ISDN_DIVAS_DIVACAPI=m
2924CONFIG_ISDN_DIVAS_USERIDI=m
2925CONFIG_ISDN_DIVAS_MAINT=m
2926CONFIG_ISDN_DRV_GIGASET=m
2927CONFIG_GIGASET_CAPI=y
2928# CONFIG_GIGASET_DUMMYLL is not set
2929CONFIG_GIGASET_BASE=m
2930CONFIG_GIGASET_M105=m
2931CONFIG_GIGASET_M101=m
2932# CONFIG_GIGASET_DEBUG is not set
2933CONFIG_HYSDN=m
2934CONFIG_HYSDN_CAPI=y
2935CONFIG_MISDN=m
2936CONFIG_MISDN_DSP=m
2937CONFIG_MISDN_L1OIP=m
2938
2939#
2940# mISDN hardware drivers
2941#
2942CONFIG_MISDN_HFCPCI=m
2943CONFIG_MISDN_HFCMULTI=m
2944CONFIG_MISDN_HFCUSB=m
2945CONFIG_MISDN_AVMFRITZ=m
2946CONFIG_MISDN_SPEEDFAX=m
2947CONFIG_MISDN_INFINEON=m
2948CONFIG_MISDN_W6692=m
2949# CONFIG_MISDN_NETJET is not set
2950CONFIG_MISDN_IPAC=m
2951CONFIG_MISDN_ISAR=m
2952# CONFIG_NVM is not set
2953
2954#
2955# Input device support
2956#
2957CONFIG_INPUT=y
2958CONFIG_INPUT_LEDS=y
2959CONFIG_INPUT_FF_MEMLESS=m
2960CONFIG_INPUT_POLLDEV=m
2961CONFIG_INPUT_SPARSEKMAP=m
2962CONFIG_INPUT_MATRIXKMAP=m
2963
2964#
2965# Userland interfaces
2966#
2967CONFIG_INPUT_MOUSEDEV=y
2968CONFIG_INPUT_MOUSEDEV_PSAUX=y
2969CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
2970CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
2971CONFIG_INPUT_JOYDEV=m
2972CONFIG_INPUT_EVDEV=m
2973# CONFIG_INPUT_EVBUG is not set
2974
2975#
2976# Input Device Drivers
2977#
2978CONFIG_INPUT_KEYBOARD=y
2979CONFIG_KEYBOARD_ADP5588=m
2980# CONFIG_KEYBOARD_ADP5589 is not set
2981CONFIG_KEYBOARD_ATKBD=y
2982# CONFIG_KEYBOARD_QT1070 is not set
2983CONFIG_KEYBOARD_QT2160=m
2984CONFIG_KEYBOARD_LKKBD=m
2985CONFIG_KEYBOARD_GPIO=m
2986# CONFIG_KEYBOARD_GPIO_POLLED is not set
2987# CONFIG_KEYBOARD_TCA6416 is not set
2988# CONFIG_KEYBOARD_TCA8418 is not set
2989# CONFIG_KEYBOARD_MATRIX is not set
2990CONFIG_KEYBOARD_LM8323=m
2991# CONFIG_KEYBOARD_LM8333 is not set
2992CONFIG_KEYBOARD_MAX7359=m
2993# CONFIG_KEYBOARD_MCS is not set
2994# CONFIG_KEYBOARD_MPR121 is not set
2995CONFIG_KEYBOARD_NEWTON=m
2996CONFIG_KEYBOARD_OPENCORES=m
2997# CONFIG_KEYBOARD_SAMSUNG is not set
2998CONFIG_KEYBOARD_STOWAWAY=m
2999CONFIG_KEYBOARD_SUNKBD=m
3000CONFIG_KEYBOARD_XTKBD=m
3001CONFIG_INPUT_MOUSE=y
3002CONFIG_MOUSE_PS2=m
3003CONFIG_MOUSE_PS2_ALPS=y
3004CONFIG_MOUSE_PS2_LOGIPS2PP=y
3005CONFIG_MOUSE_PS2_SYNAPTICS=y
3006CONFIG_MOUSE_PS2_CYPRESS=y
3007CONFIG_MOUSE_PS2_LIFEBOOK=y
3008CONFIG_MOUSE_PS2_TRACKPOINT=y
3009CONFIG_MOUSE_PS2_ELANTECH=y
3010CONFIG_MOUSE_PS2_SENTELIC=y
3011# CONFIG_MOUSE_PS2_TOUCHKIT is not set
3012CONFIG_MOUSE_PS2_FOCALTECH=y
3013CONFIG_MOUSE_PS2_VMMOUSE=y
3014CONFIG_MOUSE_SERIAL=m
3015CONFIG_MOUSE_APPLETOUCH=m
3016CONFIG_MOUSE_BCM5974=m
3017CONFIG_MOUSE_CYAPA=m
3018CONFIG_MOUSE_ELAN_I2C=m
3019CONFIG_MOUSE_ELAN_I2C_I2C=y
3020CONFIG_MOUSE_ELAN_I2C_SMBUS=y
3021CONFIG_MOUSE_VSXXXAA=m
3022# CONFIG_MOUSE_GPIO is not set
3023CONFIG_MOUSE_SYNAPTICS_I2C=m
3024CONFIG_MOUSE_SYNAPTICS_USB=m
3025CONFIG_INPUT_JOYSTICK=y
3026CONFIG_JOYSTICK_ANALOG=m
3027CONFIG_JOYSTICK_A3D=m
3028CONFIG_JOYSTICK_ADI=m
3029CONFIG_JOYSTICK_COBRA=m
3030CONFIG_JOYSTICK_GF2K=m
3031CONFIG_JOYSTICK_GRIP=m
3032CONFIG_JOYSTICK_GRIP_MP=m
3033CONFIG_JOYSTICK_GUILLEMOT=m
3034CONFIG_JOYSTICK_INTERACT=m
3035CONFIG_JOYSTICK_SIDEWINDER=m
3036CONFIG_JOYSTICK_TMDC=m
3037CONFIG_JOYSTICK_IFORCE=m
3038CONFIG_JOYSTICK_IFORCE_USB=y
3039CONFIG_JOYSTICK_IFORCE_232=y
3040CONFIG_JOYSTICK_WARRIOR=m
3041CONFIG_JOYSTICK_MAGELLAN=m
3042CONFIG_JOYSTICK_SPACEORB=m
3043CONFIG_JOYSTICK_SPACEBALL=m
3044CONFIG_JOYSTICK_STINGER=m
3045CONFIG_JOYSTICK_TWIDJOY=m
3046CONFIG_JOYSTICK_ZHENHUA=m
3047CONFIG_JOYSTICK_DB9=m
3048CONFIG_JOYSTICK_GAMECON=m
3049CONFIG_JOYSTICK_TURBOGRAFX=m
3050# CONFIG_JOYSTICK_AS5011 is not set
3051CONFIG_JOYSTICK_JOYDUMP=m
3052CONFIG_JOYSTICK_XPAD=m
3053CONFIG_JOYSTICK_XPAD_FF=y
3054CONFIG_JOYSTICK_XPAD_LEDS=y
3055CONFIG_JOYSTICK_WALKERA0701=m
3056CONFIG_INPUT_TABLET=y
3057CONFIG_TABLET_USB_ACECAD=m
3058CONFIG_TABLET_USB_AIPTEK=m
3059CONFIG_TABLET_USB_GTCO=m
3060CONFIG_TABLET_USB_HANWANG=m
3061CONFIG_TABLET_USB_KBTAB=m
3062CONFIG_TABLET_SERIAL_WACOM4=m
3063CONFIG_INPUT_TOUCHSCREEN=y
3064CONFIG_TOUCHSCREEN_PROPERTIES=y
3065CONFIG_TOUCHSCREEN_ADS7846=m
3066CONFIG_TOUCHSCREEN_AD7877=m
3067CONFIG_TOUCHSCREEN_AD7879=m
3068CONFIG_TOUCHSCREEN_AD7879_I2C=m
3069# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
3070CONFIG_TOUCHSCREEN_ATMEL_MXT=m
3071# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
3072# CONFIG_TOUCHSCREEN_BU21013 is not set
3073# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
3074# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set
3075# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set
3076CONFIG_TOUCHSCREEN_DYNAPRO=m
3077CONFIG_TOUCHSCREEN_HAMPSHIRE=m
3078CONFIG_TOUCHSCREEN_EETI=m
3079# CONFIG_TOUCHSCREEN_FT6236 is not set
3080CONFIG_TOUCHSCREEN_FUJITSU=m
3081# CONFIG_TOUCHSCREEN_GOODIX is not set
3082# CONFIG_TOUCHSCREEN_ILI210X is not set
3083CONFIG_TOUCHSCREEN_GUNZE=m
3084# CONFIG_TOUCHSCREEN_ELAN is not set
3085CONFIG_TOUCHSCREEN_ELO=m
3086CONFIG_TOUCHSCREEN_WACOM_W8001=m
3087# CONFIG_TOUCHSCREEN_WACOM_I2C is not set
3088# CONFIG_TOUCHSCREEN_MAX11801 is not set
3089CONFIG_TOUCHSCREEN_MCS5000=m
3090# CONFIG_TOUCHSCREEN_MMS114 is not set
3091CONFIG_TOUCHSCREEN_MTOUCH=m
3092CONFIG_TOUCHSCREEN_INEXIO=m
3093CONFIG_TOUCHSCREEN_MK712=m
3094CONFIG_TOUCHSCREEN_PENMOUNT=m
3095# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set
3096CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
3097CONFIG_TOUCHSCREEN_TOUCHWIN=m
3098# CONFIG_TOUCHSCREEN_PIXCIR is not set
3099# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set
3100CONFIG_TOUCHSCREEN_WM97XX=m
3101CONFIG_TOUCHSCREEN_WM9705=y
3102CONFIG_TOUCHSCREEN_WM9712=y
3103CONFIG_TOUCHSCREEN_WM9713=y
3104CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
3105CONFIG_TOUCHSCREEN_USB_EGALAX=y
3106CONFIG_TOUCHSCREEN_USB_PANJIT=y
3107CONFIG_TOUCHSCREEN_USB_3M=y
3108CONFIG_TOUCHSCREEN_USB_ITM=y
3109CONFIG_TOUCHSCREEN_USB_ETURBO=y
3110CONFIG_TOUCHSCREEN_USB_GUNZE=y
3111CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y
3112CONFIG_TOUCHSCREEN_USB_IRTOUCH=y
3113CONFIG_TOUCHSCREEN_USB_IDEALTEK=y
3114CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y
3115CONFIG_TOUCHSCREEN_USB_GOTOP=y
3116CONFIG_TOUCHSCREEN_USB_JASTEC=y
3117CONFIG_TOUCHSCREEN_USB_ELO=y
3118CONFIG_TOUCHSCREEN_USB_E2I=y
3119CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
3120CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
3121CONFIG_TOUCHSCREEN_USB_NEXIO=y
3122CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y
3123CONFIG_TOUCHSCREEN_TOUCHIT213=m
3124CONFIG_TOUCHSCREEN_TSC_SERIO=m
3125# CONFIG_TOUCHSCREEN_TSC2004 is not set
3126# CONFIG_TOUCHSCREEN_TSC2005 is not set
3127CONFIG_TOUCHSCREEN_TSC2007=m
3128# CONFIG_TOUCHSCREEN_ST1232 is not set
3129CONFIG_TOUCHSCREEN_SUR40=m
3130# CONFIG_TOUCHSCREEN_SX8654 is not set
3131CONFIG_TOUCHSCREEN_TPS6507X=m
3132# CONFIG_TOUCHSCREEN_ZFORCE is not set
3133# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set
3134CONFIG_INPUT_MISC=y
3135# CONFIG_INPUT_AD714X is not set
3136# CONFIG_INPUT_BMA150 is not set
3137# CONFIG_INPUT_E3X0_BUTTON is not set
3138CONFIG_INPUT_PCSPKR=m
3139# CONFIG_INPUT_MMA8450 is not set
3140# CONFIG_INPUT_MPU3050 is not set
3141CONFIG_INPUT_APANEL=m
3142# CONFIG_INPUT_GP2A is not set
3143# CONFIG_INPUT_GPIO_BEEPER is not set
3144# CONFIG_INPUT_GPIO_TILT_POLLED is not set
3145CONFIG_INPUT_ATLAS_BTNS=m
3146CONFIG_INPUT_ATI_REMOTE2=m
3147CONFIG_INPUT_KEYSPAN_REMOTE=m
3148# CONFIG_INPUT_KXTJ9 is not set
3149CONFIG_INPUT_POWERMATE=m
3150CONFIG_INPUT_YEALINK=m
3151CONFIG_INPUT_CM109=m
3152CONFIG_INPUT_UINPUT=m
3153# CONFIG_INPUT_PCF8574 is not set
3154# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
3155# CONFIG_INPUT_ADXL34X is not set
3156# CONFIG_INPUT_IMS_PCU is not set
3157# CONFIG_INPUT_CMA3000 is not set
3158CONFIG_INPUT_IDEAPAD_SLIDEBAR=m
3159CONFIG_INPUT_SOC_BUTTON_ARRAY=m
3160# CONFIG_INPUT_DRV260X_HAPTICS is not set
3161# CONFIG_INPUT_DRV2665_HAPTICS is not set
3162# CONFIG_INPUT_DRV2667_HAPTICS is not set
3163
3164#
3165# Hardware I/O ports
3166#
3167CONFIG_SERIO=y
3168CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
3169CONFIG_SERIO_I8042=y
3170CONFIG_SERIO_SERPORT=m
3171CONFIG_SERIO_CT82C710=m
3172CONFIG_SERIO_PARKBD=m
3173CONFIG_SERIO_PCIPS2=m
3174CONFIG_SERIO_LIBPS2=y
3175CONFIG_SERIO_RAW=m
3176CONFIG_SERIO_ALTERA_PS2=m
3177# CONFIG_SERIO_PS2MULT is not set
3178# CONFIG_SERIO_ARC_PS2 is not set
3179CONFIG_HYPERV_KEYBOARD=m
3180# CONFIG_USERIO is not set
3181CONFIG_GAMEPORT=m
3182CONFIG_GAMEPORT_NS558=m
3183CONFIG_GAMEPORT_L4=m
3184CONFIG_GAMEPORT_EMU10K1=m
3185CONFIG_GAMEPORT_FM801=m
3186
3187#
3188# Character devices
3189#
3190CONFIG_TTY=y
3191CONFIG_VT=y
3192CONFIG_CONSOLE_TRANSLATIONS=y
3193CONFIG_VT_CONSOLE=y
3194CONFIG_VT_CONSOLE_SLEEP=y
3195CONFIG_HW_CONSOLE=y
3196CONFIG_VT_HW_CONSOLE_BINDING=y
3197CONFIG_UNIX98_PTYS=y
3198CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
3199# CONFIG_LEGACY_PTYS is not set
3200CONFIG_SERIAL_NONSTANDARD=y
3201CONFIG_ROCKETPORT=m
3202CONFIG_CYCLADES=m
3203# CONFIG_CYZ_INTR is not set
3204CONFIG_MOXA_INTELLIO=m
3205CONFIG_MOXA_SMARTIO=m
3206CONFIG_SYNCLINK=m
3207CONFIG_SYNCLINKMP=m
3208CONFIG_SYNCLINK_GT=m
3209CONFIG_NOZOMI=m
3210CONFIG_ISI=m
3211CONFIG_N_HDLC=m
3212CONFIG_N_GSM=m
3213# CONFIG_TRACE_SINK is not set
3214CONFIG_DEVMEM=y
3215
3216#
3217# Serial drivers
3218#
3219CONFIG_SERIAL_EARLYCON=y
3220CONFIG_SERIAL_8250=y
3221# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
3222CONFIG_SERIAL_8250_PNP=y
3223CONFIG_SERIAL_8250_CONSOLE=y
3224CONFIG_SERIAL_8250_DMA=y
3225CONFIG_SERIAL_8250_PCI=y
3226CONFIG_SERIAL_8250_CS=m
3227CONFIG_SERIAL_8250_NR_UARTS=32
3228CONFIG_SERIAL_8250_RUNTIME_UARTS=4
3229CONFIG_SERIAL_8250_EXTENDED=y
3230CONFIG_SERIAL_8250_MANY_PORTS=y
3231CONFIG_SERIAL_8250_SHARE_IRQ=y
3232# CONFIG_SERIAL_8250_DETECT_IRQ is not set
3233CONFIG_SERIAL_8250_RSA=y
3234# CONFIG_SERIAL_8250_FSL is not set
3235CONFIG_SERIAL_8250_DW=y
3236# CONFIG_SERIAL_8250_RT288X is not set
3237CONFIG_SERIAL_8250_FINTEK=m
3238# CONFIG_SERIAL_8250_MID is not set
3239
3240#
3241# Non-8250 serial port support
3242#
3243# CONFIG_SERIAL_MAX3100 is not set
3244# CONFIG_SERIAL_MAX310X is not set
3245# CONFIG_SERIAL_UARTLITE is not set
3246CONFIG_SERIAL_CORE=y
3247CONFIG_SERIAL_CORE_CONSOLE=y
3248CONFIG_SERIAL_JSM=m
3249# CONFIG_SERIAL_SCCNXP is not set
3250# CONFIG_SERIAL_SC16IS7XX is not set
3251# CONFIG_SERIAL_ALTERA_JTAGUART is not set
3252# CONFIG_SERIAL_ALTERA_UART is not set
3253# CONFIG_SERIAL_IFX6X60 is not set
3254# CONFIG_SERIAL_ARC is not set
3255CONFIG_SERIAL_RP2=m
3256CONFIG_SERIAL_RP2_NR_UARTS=32
3257# CONFIG_SERIAL_FSL_LPUART is not set
3258CONFIG_TTY_PRINTK=m
3259CONFIG_PRINTER=m
3260# CONFIG_LP_CONSOLE is not set
3261CONFIG_PPDEV=m
3262CONFIG_HVC_DRIVER=y
3263CONFIG_VIRTIO_CONSOLE=m
3264CONFIG_IPMI_HANDLER=m
3265# CONFIG_IPMI_PANIC_EVENT is not set
3266CONFIG_IPMI_DEVICE_INTERFACE=m
3267CONFIG_IPMI_SI=m
3268# CONFIG_IPMI_SI_PROBE_DEFAULTS is not set
3269# CONFIG_IPMI_SSIF is not set
3270CONFIG_IPMI_WATCHDOG=m
3271CONFIG_IPMI_POWEROFF=m
3272CONFIG_HW_RANDOM=m
3273# CONFIG_HW_RANDOM_TIMERIOMEM is not set
3274CONFIG_HW_RANDOM_INTEL=m
3275CONFIG_HW_RANDOM_AMD=m
3276CONFIG_HW_RANDOM_VIA=m
3277CONFIG_HW_RANDOM_VIRTIO=m
3278CONFIG_HW_RANDOM_TPM=m
3279CONFIG_NVRAM=m
3280CONFIG_R3964=m
3281CONFIG_APPLICOM=m
3282
3283#
3284# PCMCIA character devices
3285#
3286CONFIG_SYNCLINK_CS=m
3287CONFIG_CARDMAN_4000=m
3288CONFIG_CARDMAN_4040=m
3289CONFIG_IPWIRELESS=m
3290CONFIG_MWAVE=m
3291CONFIG_RAW_DRIVER=m
3292CONFIG_MAX_RAW_DEVS=256
3293CONFIG_HPET=y
3294CONFIG_HPET_MMAP=y
3295CONFIG_HPET_MMAP_DEFAULT=y
3296CONFIG_HANGCHECK_TIMER=m
3297CONFIG_TCG_TPM=m
3298CONFIG_TCG_TIS=m
3299CONFIG_TCG_TIS_I2C_ATMEL=m
3300CONFIG_TCG_TIS_I2C_INFINEON=m
3301CONFIG_TCG_TIS_I2C_NUVOTON=m
3302CONFIG_TCG_NSC=m
3303CONFIG_TCG_ATMEL=m
3304CONFIG_TCG_INFINEON=m
3305CONFIG_TCG_CRB=m
3306CONFIG_TCG_TIS_ST33ZP24=m
3307CONFIG_TCG_TIS_ST33ZP24_I2C=m
3308# CONFIG_TCG_TIS_ST33ZP24_SPI is not set
3309CONFIG_TELCLOCK=m
3310# CONFIG_XILLYBUS is not set
3311
3312#
3313# I2C support
3314#
3315CONFIG_I2C=y
3316CONFIG_ACPI_I2C_OPREGION=y
3317CONFIG_I2C_BOARDINFO=y
3318CONFIG_I2C_COMPAT=y
3319CONFIG_I2C_CHARDEV=m
3320CONFIG_I2C_MUX=m
3321
3322#
3323# Multiplexer I2C Chip support
3324#
3325# CONFIG_I2C_MUX_GPIO is not set
3326# CONFIG_I2C_MUX_PCA9541 is not set
3327# CONFIG_I2C_MUX_PCA954x is not set
3328# CONFIG_I2C_MUX_PINCTRL is not set
3329# CONFIG_I2C_MUX_REG is not set
3330CONFIG_I2C_HELPER_AUTO=y
3331CONFIG_I2C_SMBUS=m
3332CONFIG_I2C_ALGOBIT=m
3333CONFIG_I2C_ALGOPCA=m
3334
3335#
3336# I2C Hardware Bus support
3337#
3338
3339#
3340# PC SMBus host controller drivers
3341#
3342CONFIG_I2C_ALI1535=m
3343CONFIG_I2C_ALI1563=m
3344CONFIG_I2C_ALI15X3=m
3345CONFIG_I2C_AMD756=m
3346CONFIG_I2C_AMD756_S4882=m
3347CONFIG_I2C_AMD8111=m
3348CONFIG_I2C_I801=m
3349CONFIG_I2C_ISCH=m
3350CONFIG_I2C_ISMT=m
3351CONFIG_I2C_PIIX4=m
3352CONFIG_I2C_NFORCE2=m
3353CONFIG_I2C_NFORCE2_S4985=m
3354CONFIG_I2C_SIS5595=m
3355CONFIG_I2C_SIS630=m
3356CONFIG_I2C_SIS96X=m
3357CONFIG_I2C_VIA=m
3358CONFIG_I2C_VIAPRO=m
3359
3360#
3361# ACPI drivers
3362#
3363CONFIG_I2C_SCMI=m
3364
3365#
3366# I2C system bus drivers (mostly embedded / system-on-chip)
3367#
3368# CONFIG_I2C_CBUS_GPIO is not set
3369CONFIG_I2C_DESIGNWARE_CORE=m
3370CONFIG_I2C_DESIGNWARE_PLATFORM=m
3371CONFIG_I2C_DESIGNWARE_PCI=m
3372# CONFIG_I2C_EMEV2 is not set
3373# CONFIG_I2C_GPIO is not set
3374CONFIG_I2C_KEMPLD=m
3375CONFIG_I2C_OCORES=m
3376CONFIG_I2C_PCA_PLATFORM=m
3377# CONFIG_I2C_PXA_PCI is not set
3378CONFIG_I2C_SIMTEC=m
3379# CONFIG_I2C_XILINX is not set
3380
3381#
3382# External I2C/SMBus adapter drivers
3383#
3384CONFIG_I2C_DIOLAN_U2C=m
3385CONFIG_I2C_PARPORT=m
3386CONFIG_I2C_PARPORT_LIGHT=m
3387CONFIG_I2C_ROBOTFUZZ_OSIF=m
3388CONFIG_I2C_TAOS_EVM=m
3389CONFIG_I2C_TINY_USB=m
3390CONFIG_I2C_VIPERBOARD=m
3391
3392#
3393# Other I2C/SMBus bus drivers
3394#
3395CONFIG_I2C_STUB=m
3396# CONFIG_I2C_SLAVE is not set
3397# CONFIG_I2C_DEBUG_CORE is not set
3398# CONFIG_I2C_DEBUG_ALGO is not set
3399# CONFIG_I2C_DEBUG_BUS is not set
3400CONFIG_SPI=y
3401# CONFIG_SPI_DEBUG is not set
3402CONFIG_SPI_MASTER=y
3403
3404#
3405# SPI Master Controller Drivers
3406#
3407# CONFIG_SPI_ALTERA is not set
3408CONFIG_SPI_BITBANG=m
3409CONFIG_SPI_BUTTERFLY=m
3410# CONFIG_SPI_CADENCE is not set
3411# CONFIG_SPI_GPIO is not set
3412CONFIG_SPI_LM70_LLP=m
3413# CONFIG_SPI_OC_TINY is not set
3414# CONFIG_SPI_PXA2XX is not set
3415# CONFIG_SPI_PXA2XX_PCI is not set
3416# CONFIG_SPI_SC18IS602 is not set
3417# CONFIG_SPI_XCOMM is not set
3418# CONFIG_SPI_XILINX is not set
3419# CONFIG_SPI_ZYNQMP_GQSPI is not set
3420# CONFIG_SPI_DESIGNWARE is not set
3421
3422#
3423# SPI Protocol Masters
3424#
3425# CONFIG_SPI_SPIDEV is not set
3426# CONFIG_SPI_TLE62X0 is not set
3427# CONFIG_SPMI is not set
3428# CONFIG_HSI is not set
3429
3430#
3431# PPS support
3432#
3433CONFIG_PPS=m
3434# CONFIG_PPS_DEBUG is not set
3435# CONFIG_NTP_PPS is not set
3436
3437#
3438# PPS clients support
3439#
3440# CONFIG_PPS_CLIENT_KTIMER is not set
3441CONFIG_PPS_CLIENT_LDISC=m
3442CONFIG_PPS_CLIENT_PARPORT=m
3443# CONFIG_PPS_CLIENT_GPIO is not set
3444
3445#
3446# PPS generators support
3447#
3448
3449#
3450# PTP clock support
3451#
3452CONFIG_PTP_1588_CLOCK=m
3453
3454#
3455# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
3456#
3457CONFIG_PINCTRL=y
3458
3459#
3460# Pin controllers
3461#
3462CONFIG_PINMUX=y
3463CONFIG_PINCONF=y
3464CONFIG_GENERIC_PINCONF=y
3465# CONFIG_DEBUG_PINCTRL is not set
3466# CONFIG_PINCTRL_AMD is not set
3467CONFIG_PINCTRL_BAYTRAIL=y
3468CONFIG_PINCTRL_CHERRYVIEW=y
3469CONFIG_PINCTRL_INTEL=y
3470CONFIG_PINCTRL_BROXTON=y
3471CONFIG_PINCTRL_SUNRISEPOINT=y
3472CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
3473CONFIG_GPIOLIB=y
3474CONFIG_GPIO_DEVRES=y
3475CONFIG_GPIO_ACPI=y
3476CONFIG_GPIOLIB_IRQCHIP=y
3477# CONFIG_DEBUG_GPIO is not set
3478CONFIG_GPIO_SYSFS=y
3479
3480#
3481# Memory mapped GPIO drivers
3482#
3483# CONFIG_GPIO_AMDPT is not set
3484# CONFIG_GPIO_DWAPB is not set
3485# CONFIG_GPIO_GENERIC_PLATFORM is not set
3486# CONFIG_GPIO_ICH is not set
3487# CONFIG_GPIO_LYNXPOINT is not set
3488# CONFIG_GPIO_VX855 is not set
3489# CONFIG_GPIO_ZX is not set
3490
3491#
3492# Port-mapped I/O GPIO drivers
3493#
3494# CONFIG_GPIO_104_IDIO_16 is not set
3495# CONFIG_GPIO_F7188X is not set
3496# CONFIG_GPIO_IT87 is not set
3497# CONFIG_GPIO_SCH is not set
3498# CONFIG_GPIO_SCH311X is not set
3499
3500#
3501# I2C GPIO expanders
3502#
3503# CONFIG_GPIO_ADP5588 is not set
3504# CONFIG_GPIO_MAX7300 is not set
3505# CONFIG_GPIO_MAX732X is not set
3506# CONFIG_GPIO_PCA953X is not set
3507# CONFIG_GPIO_PCF857X is not set
3508# CONFIG_GPIO_SX150X is not set
3509
3510#
3511# MFD GPIO expanders
3512#
3513CONFIG_GPIO_KEMPLD=m
3514
3515#
3516# PCI GPIO expanders
3517#
3518# CONFIG_GPIO_AMD8111 is not set
3519# CONFIG_GPIO_INTEL_MID is not set
3520CONFIG_GPIO_ML_IOH=m
3521# CONFIG_GPIO_RDC321X is not set
3522
3523#
3524# SPI GPIO expanders
3525#
3526# CONFIG_GPIO_MAX7301 is not set
3527# CONFIG_GPIO_MC33880 is not set
3528
3529#
3530# SPI or I2C GPIO expanders
3531#
3532# CONFIG_GPIO_MCP23S08 is not set
3533
3534#
3535# USB GPIO expanders
3536#
3537CONFIG_GPIO_VIPERBOARD=m
3538CONFIG_W1=m
3539CONFIG_W1_CON=y
3540
3541#
3542# 1-wire Bus Masters
3543#
3544CONFIG_W1_MASTER_MATROX=m
3545CONFIG_W1_MASTER_DS2490=m
3546CONFIG_W1_MASTER_DS2482=m
3547# CONFIG_W1_MASTER_DS1WM is not set
3548# CONFIG_W1_MASTER_GPIO is not set
3549
3550#
3551# 1-wire Slaves
3552#
3553CONFIG_W1_SLAVE_THERM=m
3554CONFIG_W1_SLAVE_SMEM=m
3555# CONFIG_W1_SLAVE_DS2408 is not set
3556# CONFIG_W1_SLAVE_DS2413 is not set
3557# CONFIG_W1_SLAVE_DS2406 is not set
3558# CONFIG_W1_SLAVE_DS2423 is not set
3559CONFIG_W1_SLAVE_DS2431=m
3560CONFIG_W1_SLAVE_DS2433=m
3561# CONFIG_W1_SLAVE_DS2433_CRC is not set
3562# CONFIG_W1_SLAVE_DS2760 is not set
3563# CONFIG_W1_SLAVE_DS2780 is not set
3564# CONFIG_W1_SLAVE_DS2781 is not set
3565# CONFIG_W1_SLAVE_DS28E04 is not set
3566CONFIG_W1_SLAVE_BQ27000=m
3567CONFIG_POWER_SUPPLY=y
3568# CONFIG_POWER_SUPPLY_DEBUG is not set
3569# CONFIG_PDA_POWER is not set
3570# CONFIG_GENERIC_ADC_BATTERY is not set
3571# CONFIG_TEST_POWER is not set
3572# CONFIG_BATTERY_DS2780 is not set
3573# CONFIG_BATTERY_DS2781 is not set
3574# CONFIG_BATTERY_DS2782 is not set
3575CONFIG_BATTERY_SBS=m
3576# CONFIG_BATTERY_BQ27XXX is not set
3577# CONFIG_BATTERY_MAX17040 is not set
3578# CONFIG_BATTERY_MAX17042 is not set
3579# CONFIG_CHARGER_MAX8903 is not set
3580# CONFIG_CHARGER_LP8727 is not set
3581# CONFIG_CHARGER_GPIO is not set
3582# CONFIG_CHARGER_BQ2415X is not set
3583# CONFIG_CHARGER_BQ24190 is not set
3584# CONFIG_CHARGER_BQ24257 is not set
3585# CONFIG_CHARGER_BQ24735 is not set
3586# CONFIG_CHARGER_BQ25890 is not set
3587# CONFIG_CHARGER_SMB347 is not set
3588# CONFIG_BATTERY_GAUGE_LTC2941 is not set
3589# CONFIG_CHARGER_RT9455 is not set
3590# CONFIG_POWER_RESET is not set
3591# CONFIG_POWER_AVS is not set
3592CONFIG_HWMON=y
3593CONFIG_HWMON_VID=m
3594# CONFIG_HWMON_DEBUG_CHIP is not set
3595
3596#
3597# Native drivers
3598#
3599CONFIG_SENSORS_ABITUGURU=m
3600CONFIG_SENSORS_ABITUGURU3=m
3601# CONFIG_SENSORS_AD7314 is not set
3602CONFIG_SENSORS_AD7414=m
3603CONFIG_SENSORS_AD7418=m
3604CONFIG_SENSORS_ADM1021=m
3605CONFIG_SENSORS_ADM1025=m
3606CONFIG_SENSORS_ADM1026=m
3607CONFIG_SENSORS_ADM1029=m
3608CONFIG_SENSORS_ADM1031=m
3609CONFIG_SENSORS_ADM9240=m
3610# CONFIG_SENSORS_ADT7310 is not set
3611# CONFIG_SENSORS_ADT7410 is not set
3612CONFIG_SENSORS_ADT7411=m
3613CONFIG_SENSORS_ADT7462=m
3614CONFIG_SENSORS_ADT7470=m
3615CONFIG_SENSORS_ADT7475=m
3616CONFIG_SENSORS_ASC7621=m
3617CONFIG_SENSORS_K8TEMP=m
3618CONFIG_SENSORS_K10TEMP=m
3619CONFIG_SENSORS_FAM15H_POWER=m
3620CONFIG_SENSORS_APPLESMC=m
3621CONFIG_SENSORS_ASB100=m
3622CONFIG_SENSORS_ATXP1=m
3623CONFIG_SENSORS_DS620=m
3624CONFIG_SENSORS_DS1621=m
3625CONFIG_SENSORS_DELL_SMM=m
3626CONFIG_SENSORS_I5K_AMB=m
3627CONFIG_SENSORS_F71805F=m
3628CONFIG_SENSORS_F71882FG=m
3629CONFIG_SENSORS_F75375S=m
3630CONFIG_SENSORS_FSCHMD=m
3631CONFIG_SENSORS_GL518SM=m
3632CONFIG_SENSORS_GL520SM=m
3633CONFIG_SENSORS_G760A=m
3634# CONFIG_SENSORS_G762 is not set
3635# CONFIG_SENSORS_GPIO_FAN is not set
3636# CONFIG_SENSORS_HIH6130 is not set
3637CONFIG_SENSORS_IBMAEM=m
3638CONFIG_SENSORS_IBMPEX=m
3639# CONFIG_SENSORS_IIO_HWMON is not set
3640CONFIG_SENSORS_I5500=m
3641CONFIG_SENSORS_CORETEMP=m
3642CONFIG_SENSORS_IT87=m
3643CONFIG_SENSORS_JC42=m
3644# CONFIG_SENSORS_POWR1220 is not set
3645CONFIG_SENSORS_LINEAGE=m
3646# CONFIG_SENSORS_LTC2945 is not set
3647CONFIG_SENSORS_LTC4151=m
3648CONFIG_SENSORS_LTC4215=m
3649# CONFIG_SENSORS_LTC4222 is not set
3650CONFIG_SENSORS_LTC4245=m
3651# CONFIG_SENSORS_LTC4260 is not set
3652CONFIG_SENSORS_LTC4261=m
3653CONFIG_SENSORS_MAX1111=m
3654CONFIG_SENSORS_MAX16065=m
3655CONFIG_SENSORS_MAX1619=m
3656CONFIG_SENSORS_MAX1668=m
3657# CONFIG_SENSORS_MAX197 is not set
3658CONFIG_SENSORS_MAX6639=m
3659CONFIG_SENSORS_MAX6642=m
3660CONFIG_SENSORS_MAX6650=m
3661# CONFIG_SENSORS_MAX6697 is not set
3662# CONFIG_SENSORS_MAX31790 is not set
3663# CONFIG_SENSORS_HTU21 is not set
3664# CONFIG_SENSORS_MCP3021 is not set
3665CONFIG_SENSORS_MENF21BMC_HWMON=m
3666CONFIG_SENSORS_ADCXX=m
3667CONFIG_SENSORS_LM63=m
3668CONFIG_SENSORS_LM70=m
3669CONFIG_SENSORS_LM73=m
3670CONFIG_SENSORS_LM75=m
3671CONFIG_SENSORS_LM77=m
3672CONFIG_SENSORS_LM78=m
3673CONFIG_SENSORS_LM80=m
3674CONFIG_SENSORS_LM83=m
3675CONFIG_SENSORS_LM85=m
3676CONFIG_SENSORS_LM87=m
3677CONFIG_SENSORS_LM90=m
3678CONFIG_SENSORS_LM92=m
3679CONFIG_SENSORS_LM93=m
3680# CONFIG_SENSORS_LM95234 is not set
3681CONFIG_SENSORS_LM95241=m
3682CONFIG_SENSORS_LM95245=m
3683CONFIG_SENSORS_PC87360=m
3684CONFIG_SENSORS_PC87427=m
3685CONFIG_SENSORS_NTC_THERMISTOR=m
3686CONFIG_SENSORS_NCT6683=m
3687CONFIG_SENSORS_NCT6775=m
3688# CONFIG_SENSORS_NCT7802 is not set
3689# CONFIG_SENSORS_NCT7904 is not set
3690CONFIG_SENSORS_PCF8591=m
3691# CONFIG_PMBUS is not set
3692# CONFIG_SENSORS_SHT15 is not set
3693CONFIG_SENSORS_SHT21=m
3694# CONFIG_SENSORS_SHTC1 is not set
3695CONFIG_SENSORS_SIS5595=m
3696CONFIG_SENSORS_DME1737=m
3697CONFIG_SENSORS_EMC1403=m
3698CONFIG_SENSORS_EMC2103=m
3699CONFIG_SENSORS_EMC6W201=m
3700CONFIG_SENSORS_SMSC47M1=m
3701CONFIG_SENSORS_SMSC47M192=m
3702CONFIG_SENSORS_SMSC47B397=m
3703CONFIG_SENSORS_SCH56XX_COMMON=m
3704CONFIG_SENSORS_SCH5627=m
3705CONFIG_SENSORS_SCH5636=m
3706CONFIG_SENSORS_SMM665=m
3707# CONFIG_SENSORS_ADC128D818 is not set
3708CONFIG_SENSORS_ADS1015=m
3709CONFIG_SENSORS_ADS7828=m
3710CONFIG_SENSORS_ADS7871=m
3711CONFIG_SENSORS_AMC6821=m
3712# CONFIG_SENSORS_INA209 is not set
3713# CONFIG_SENSORS_INA2XX is not set
3714# CONFIG_SENSORS_TC74 is not set
3715CONFIG_SENSORS_THMC50=m
3716CONFIG_SENSORS_TMP102=m
3717# CONFIG_SENSORS_TMP103 is not set
3718CONFIG_SENSORS_TMP401=m
3719CONFIG_SENSORS_TMP421=m
3720CONFIG_SENSORS_VIA_CPUTEMP=m
3721CONFIG_SENSORS_VIA686A=m
3722CONFIG_SENSORS_VT1211=m
3723CONFIG_SENSORS_VT8231=m
3724CONFIG_SENSORS_W83781D=m
3725CONFIG_SENSORS_W83791D=m
3726CONFIG_SENSORS_W83792D=m
3727CONFIG_SENSORS_W83793=m
3728CONFIG_SENSORS_W83795=m
3729# CONFIG_SENSORS_W83795_FANCTRL is not set
3730CONFIG_SENSORS_W83L785TS=m
3731CONFIG_SENSORS_W83L786NG=m
3732CONFIG_SENSORS_W83627HF=m
3733CONFIG_SENSORS_W83627EHF=m
3734
3735#
3736# ACPI drivers
3737#
3738CONFIG_SENSORS_ACPI_POWER=m
3739CONFIG_SENSORS_ATK0110=m
3740CONFIG_THERMAL=y
3741CONFIG_THERMAL_HWMON=y
3742CONFIG_THERMAL_WRITABLE_TRIPS=y
3743CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
3744# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
3745# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
3746# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set
3747CONFIG_THERMAL_GOV_FAIR_SHARE=y
3748CONFIG_THERMAL_GOV_STEP_WISE=y
3749CONFIG_THERMAL_GOV_BANG_BANG=y
3750CONFIG_THERMAL_GOV_USER_SPACE=y
3751# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set
3752# CONFIG_THERMAL_EMULATION is not set
3753CONFIG_INTEL_POWERCLAMP=m
3754CONFIG_X86_PKG_TEMP_THERMAL=m
3755CONFIG_INTEL_SOC_DTS_IOSF_CORE=m
3756CONFIG_INTEL_SOC_DTS_THERMAL=m
3757CONFIG_INT340X_THERMAL=m
3758CONFIG_ACPI_THERMAL_REL=m
3759CONFIG_INTEL_PCH_THERMAL=m
3760CONFIG_WATCHDOG=y
3761CONFIG_WATCHDOG_CORE=y
3762# CONFIG_WATCHDOG_NOWAYOUT is not set
3763
3764#
3765# Watchdog Device Drivers
3766#
3767CONFIG_SOFT_WATCHDOG=m
3768CONFIG_MENF21BMC_WATCHDOG=m
3769# CONFIG_XILINX_WATCHDOG is not set
3770# CONFIG_CADENCE_WATCHDOG is not set
3771# CONFIG_DW_WATCHDOG is not set
3772# CONFIG_MAX63XX_WATCHDOG is not set
3773CONFIG_ACQUIRE_WDT=m
3774CONFIG_ADVANTECH_WDT=m
3775CONFIG_ALIM1535_WDT=m
3776CONFIG_ALIM7101_WDT=m
3777CONFIG_F71808E_WDT=m
3778CONFIG_SP5100_TCO=m
3779CONFIG_SBC_FITPC2_WATCHDOG=m
3780CONFIG_EUROTECH_WDT=m
3781CONFIG_IB700_WDT=m
3782CONFIG_IBMASR=m
3783CONFIG_WAFER_WDT=m
3784CONFIG_I6300ESB_WDT=m
3785CONFIG_IE6XX_WDT=m
3786CONFIG_ITCO_WDT=m
3787CONFIG_ITCO_VENDOR_SUPPORT=y
3788CONFIG_IT8712F_WDT=m
3789CONFIG_IT87_WDT=m
3790CONFIG_HP_WATCHDOG=m
3791CONFIG_KEMPLD_WDT=m
3792CONFIG_HPWDT_NMI_DECODING=y
3793CONFIG_SC1200_WDT=m
3794CONFIG_PC87413_WDT=m
3795CONFIG_NV_TCO=m
3796CONFIG_60XX_WDT=m
3797CONFIG_CPU5_WDT=m
3798CONFIG_SMSC_SCH311X_WDT=m
3799CONFIG_SMSC37B787_WDT=m
3800CONFIG_VIA_WDT=m
3801CONFIG_W83627HF_WDT=m
3802CONFIG_W83877F_WDT=m
3803CONFIG_W83977F_WDT=m
3804CONFIG_MACHZ_WDT=m
3805CONFIG_SBC_EPX_C3_WATCHDOG=m
3806# CONFIG_BCM7038_WDT is not set
3807# CONFIG_MEN_A21_WDT is not set
3808
3809#
3810# PCI-based Watchdog Cards
3811#
3812CONFIG_PCIPCWATCHDOG=m
3813CONFIG_WDTPCI=m
3814
3815#
3816# USB-based Watchdog Cards
3817#
3818CONFIG_USBPCWATCHDOG=m
3819CONFIG_SSB_POSSIBLE=y
3820
3821#
3822# Sonics Silicon Backplane
3823#
3824CONFIG_SSB=m
3825CONFIG_SSB_SPROM=y
3826CONFIG_SSB_BLOCKIO=y
3827CONFIG_SSB_PCIHOST_POSSIBLE=y
3828CONFIG_SSB_PCIHOST=y
3829CONFIG_SSB_B43_PCI_BRIDGE=y
3830CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
3831CONFIG_SSB_PCMCIAHOST=y
3832CONFIG_SSB_SDIOHOST_POSSIBLE=y
3833CONFIG_SSB_SDIOHOST=y
3834# CONFIG_SSB_HOST_SOC is not set
3835# CONFIG_SSB_SILENT is not set
3836# CONFIG_SSB_DEBUG is not set
3837CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
3838CONFIG_SSB_DRIVER_PCICORE=y
3839# CONFIG_SSB_DRIVER_GPIO is not set
3840CONFIG_BCMA_POSSIBLE=y
3841
3842#
3843# Broadcom specific AMBA
3844#
3845CONFIG_BCMA=m
3846CONFIG_BCMA_BLOCKIO=y
3847CONFIG_BCMA_HOST_PCI_POSSIBLE=y
3848CONFIG_BCMA_HOST_PCI=y
3849# CONFIG_BCMA_HOST_SOC is not set
3850CONFIG_BCMA_DRIVER_PCI=y
3851# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
3852# CONFIG_BCMA_DRIVER_GPIO is not set
3853# CONFIG_BCMA_DEBUG is not set
3854
3855#
3856# Multifunction device drivers
3857#
3858CONFIG_MFD_CORE=m
3859# CONFIG_MFD_AS3711 is not set
3860# CONFIG_PMIC_ADP5520 is not set
3861# CONFIG_MFD_AAT2870_CORE is not set
3862# CONFIG_MFD_BCM590XX is not set
3863# CONFIG_MFD_AXP20X is not set
3864# CONFIG_MFD_CROS_EC is not set
3865# CONFIG_PMIC_DA903X is not set
3866# CONFIG_MFD_DA9052_SPI is not set
3867# CONFIG_MFD_DA9052_I2C is not set
3868# CONFIG_MFD_DA9055 is not set
3869# CONFIG_MFD_DA9062 is not set
3870# CONFIG_MFD_DA9063 is not set
3871# CONFIG_MFD_DA9150 is not set
3872# CONFIG_MFD_DLN2 is not set
3873# CONFIG_MFD_MC13XXX_SPI is not set
3874# CONFIG_MFD_MC13XXX_I2C is not set
3875# CONFIG_HTC_PASIC3 is not set
3876# CONFIG_HTC_I2CPLD is not set
3877# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set
3878CONFIG_LPC_ICH=m
3879CONFIG_LPC_SCH=m
3880# CONFIG_INTEL_SOC_PMIC is not set
3881CONFIG_MFD_INTEL_LPSS=m
3882CONFIG_MFD_INTEL_LPSS_ACPI=m
3883CONFIG_MFD_INTEL_LPSS_PCI=m
3884# CONFIG_MFD_JANZ_CMODIO is not set
3885CONFIG_MFD_KEMPLD=m
3886# CONFIG_MFD_88PM800 is not set
3887# CONFIG_MFD_88PM805 is not set
3888# CONFIG_MFD_88PM860X is not set
3889# CONFIG_MFD_MAX14577 is not set
3890# CONFIG_MFD_MAX77693 is not set
3891# CONFIG_MFD_MAX77843 is not set
3892# CONFIG_MFD_MAX8907 is not set
3893# CONFIG_MFD_MAX8925 is not set
3894# CONFIG_MFD_MAX8997 is not set
3895# CONFIG_MFD_MAX8998 is not set
3896# CONFIG_MFD_MT6397 is not set
3897CONFIG_MFD_MENF21BMC=m
3898# CONFIG_EZX_PCAP is not set
3899CONFIG_MFD_VIPERBOARD=m
3900# CONFIG_MFD_RETU is not set
3901# CONFIG_MFD_PCF50633 is not set
3902# CONFIG_UCB1400_CORE is not set
3903# CONFIG_MFD_RDC321X is not set
3904CONFIG_MFD_RTSX_PCI=m
3905# CONFIG_MFD_RT5033 is not set
3906CONFIG_MFD_RTSX_USB=m
3907# CONFIG_MFD_RC5T583 is not set
3908# CONFIG_MFD_RN5T618 is not set
3909# CONFIG_MFD_SEC_CORE is not set
3910# CONFIG_MFD_SI476X_CORE is not set
3911# CONFIG_MFD_SM501 is not set
3912# CONFIG_MFD_SKY81452 is not set
3913# CONFIG_MFD_SMSC is not set
3914# CONFIG_ABX500_CORE is not set
3915# CONFIG_MFD_SYSCON is not set
3916# CONFIG_MFD_TI_AM335X_TSCADC is not set
3917# CONFIG_MFD_LP3943 is not set
3918# CONFIG_MFD_LP8788 is not set
3919# CONFIG_MFD_PALMAS is not set
3920# CONFIG_TPS6105X is not set
3921# CONFIG_TPS65010 is not set
3922# CONFIG_TPS6507X is not set
3923# CONFIG_MFD_TPS65090 is not set
3924# CONFIG_MFD_TPS65217 is not set
3925# CONFIG_MFD_TPS65218 is not set
3926# CONFIG_MFD_TPS6586X is not set
3927# CONFIG_MFD_TPS65910 is not set
3928# CONFIG_MFD_TPS65912 is not set
3929# CONFIG_MFD_TPS65912_I2C is not set
3930# CONFIG_MFD_TPS65912_SPI is not set
3931# CONFIG_MFD_TPS80031 is not set
3932# CONFIG_TWL4030_CORE is not set
3933# CONFIG_TWL6040_CORE is not set
3934# CONFIG_MFD_WL1273_CORE is not set
3935# CONFIG_MFD_LM3533 is not set
3936# CONFIG_MFD_TMIO is not set
3937# CONFIG_MFD_VX855 is not set
3938# CONFIG_MFD_ARIZONA_I2C is not set
3939# CONFIG_MFD_ARIZONA_SPI is not set
3940# CONFIG_MFD_WM8400 is not set
3941# CONFIG_MFD_WM831X_I2C is not set
3942# CONFIG_MFD_WM831X_SPI is not set
3943# CONFIG_MFD_WM8350_I2C is not set
3944# CONFIG_MFD_WM8994 is not set
3945# CONFIG_REGULATOR is not set
3946CONFIG_MEDIA_SUPPORT=m
3947
3948#
3949# Multimedia core support
3950#
3951CONFIG_MEDIA_CAMERA_SUPPORT=y
3952CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
3953CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
3954CONFIG_MEDIA_RADIO_SUPPORT=y
3955CONFIG_MEDIA_SDR_SUPPORT=y
3956CONFIG_MEDIA_RC_SUPPORT=y
3957CONFIG_MEDIA_CONTROLLER=y
3958CONFIG_VIDEO_DEV=m
3959# CONFIG_VIDEO_V4L2_SUBDEV_API is not set
3960CONFIG_VIDEO_V4L2=m
3961# CONFIG_VIDEO_ADV_DEBUG is not set
3962# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
3963CONFIG_VIDEO_TUNER=m
3964CONFIG_VIDEOBUF_GEN=m
3965CONFIG_VIDEOBUF_DMA_SG=m
3966CONFIG_VIDEOBUF_VMALLOC=m
3967CONFIG_VIDEOBUF_DVB=m
3968CONFIG_VIDEOBUF2_CORE=m
3969CONFIG_VIDEOBUF2_MEMOPS=m
3970CONFIG_VIDEOBUF2_DMA_CONTIG=m
3971CONFIG_VIDEOBUF2_VMALLOC=m
3972CONFIG_VIDEOBUF2_DMA_SG=m
3973CONFIG_VIDEOBUF2_DVB=m
3974CONFIG_DVB_CORE=m
3975CONFIG_DVB_NET=y
3976CONFIG_TTPCI_EEPROM=m
3977CONFIG_DVB_MAX_ADAPTERS=8
3978CONFIG_DVB_DYNAMIC_MINORS=y
3979
3980#
3981# Media drivers
3982#
3983CONFIG_RC_CORE=m
3984CONFIG_RC_MAP=m
3985CONFIG_RC_DECODERS=y
3986CONFIG_LIRC=m
3987CONFIG_IR_LIRC_CODEC=m
3988CONFIG_IR_NEC_DECODER=m
3989CONFIG_IR_RC5_DECODER=m
3990CONFIG_IR_RC6_DECODER=m
3991CONFIG_IR_JVC_DECODER=m
3992CONFIG_IR_SONY_DECODER=m
3993CONFIG_IR_SANYO_DECODER=m
3994CONFIG_IR_SHARP_DECODER=m
3995CONFIG_IR_MCE_KBD_DECODER=m
3996CONFIG_IR_XMP_DECODER=m
3997CONFIG_RC_DEVICES=y
3998CONFIG_RC_ATI_REMOTE=m
3999CONFIG_IR_ENE=m
4000# CONFIG_IR_HIX5HD2 is not set
4001CONFIG_IR_IMON=m
4002CONFIG_IR_MCEUSB=m
4003CONFIG_IR_ITE_CIR=m
4004CONFIG_IR_FINTEK=m
4005CONFIG_IR_NUVOTON=m
4006CONFIG_IR_REDRAT3=m
4007CONFIG_IR_STREAMZAP=m
4008CONFIG_IR_WINBOND_CIR=m
4009CONFIG_IR_IGORPLUGUSB=m
4010CONFIG_IR_IGUANA=m
4011CONFIG_IR_TTUSBIR=m
4012CONFIG_RC_LOOPBACK=m
4013# CONFIG_IR_GPIO_CIR is not set
4014CONFIG_MEDIA_USB_SUPPORT=y
4015
4016#
4017# Webcam devices
4018#
4019CONFIG_USB_VIDEO_CLASS=m
4020CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
4021CONFIG_USB_GSPCA=m
4022CONFIG_USB_M5602=m
4023CONFIG_USB_STV06XX=m
4024CONFIG_USB_GL860=m
4025CONFIG_USB_GSPCA_BENQ=m
4026CONFIG_USB_GSPCA_CONEX=m
4027CONFIG_USB_GSPCA_CPIA1=m
4028CONFIG_USB_GSPCA_DTCS033=m
4029CONFIG_USB_GSPCA_ETOMS=m
4030CONFIG_USB_GSPCA_FINEPIX=m
4031CONFIG_USB_GSPCA_JEILINJ=m
4032CONFIG_USB_GSPCA_JL2005BCD=m
4033CONFIG_USB_GSPCA_KINECT=m
4034CONFIG_USB_GSPCA_KONICA=m
4035CONFIG_USB_GSPCA_MARS=m
4036CONFIG_USB_GSPCA_MR97310A=m
4037CONFIG_USB_GSPCA_NW80X=m
4038CONFIG_USB_GSPCA_OV519=m
4039CONFIG_USB_GSPCA_OV534=m
4040CONFIG_USB_GSPCA_OV534_9=m
4041CONFIG_USB_GSPCA_PAC207=m
4042CONFIG_USB_GSPCA_PAC7302=m
4043CONFIG_USB_GSPCA_PAC7311=m
4044CONFIG_USB_GSPCA_SE401=m
4045CONFIG_USB_GSPCA_SN9C2028=m
4046CONFIG_USB_GSPCA_SN9C20X=m
4047CONFIG_USB_GSPCA_SONIXB=m
4048CONFIG_USB_GSPCA_SONIXJ=m
4049CONFIG_USB_GSPCA_SPCA500=m
4050CONFIG_USB_GSPCA_SPCA501=m
4051CONFIG_USB_GSPCA_SPCA505=m
4052CONFIG_USB_GSPCA_SPCA506=m
4053CONFIG_USB_GSPCA_SPCA508=m
4054CONFIG_USB_GSPCA_SPCA561=m
4055CONFIG_USB_GSPCA_SPCA1528=m
4056CONFIG_USB_GSPCA_SQ905=m
4057CONFIG_USB_GSPCA_SQ905C=m
4058CONFIG_USB_GSPCA_SQ930X=m
4059CONFIG_USB_GSPCA_STK014=m
4060CONFIG_USB_GSPCA_STK1135=m
4061CONFIG_USB_GSPCA_STV0680=m
4062CONFIG_USB_GSPCA_SUNPLUS=m
4063CONFIG_USB_GSPCA_T613=m
4064CONFIG_USB_GSPCA_TOPRO=m
4065CONFIG_USB_GSPCA_TOUPTEK=m
4066CONFIG_USB_GSPCA_TV8532=m
4067CONFIG_USB_GSPCA_VC032X=m
4068CONFIG_USB_GSPCA_VICAM=m
4069CONFIG_USB_GSPCA_XIRLINK_CIT=m
4070CONFIG_USB_GSPCA_ZC3XX=m
4071CONFIG_USB_PWC=m
4072# CONFIG_USB_PWC_DEBUG is not set
4073CONFIG_USB_PWC_INPUT_EVDEV=y
4074CONFIG_VIDEO_CPIA2=m
4075CONFIG_USB_ZR364XX=m
4076CONFIG_USB_STKWEBCAM=m
4077CONFIG_USB_S2255=m
4078CONFIG_VIDEO_USBTV=m
4079
4080#
4081# Analog TV USB devices
4082#
4083CONFIG_VIDEO_PVRUSB2=m
4084CONFIG_VIDEO_PVRUSB2_SYSFS=y
4085CONFIG_VIDEO_PVRUSB2_DVB=y
4086# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
4087CONFIG_VIDEO_HDPVR=m
4088CONFIG_VIDEO_USBVISION=m
4089CONFIG_VIDEO_STK1160_COMMON=m
4090CONFIG_VIDEO_STK1160_AC97=y
4091CONFIG_VIDEO_STK1160=m
4092# CONFIG_VIDEO_GO7007 is not set
4093
4094#
4095# Analog/digital TV USB devices
4096#
4097CONFIG_VIDEO_AU0828=m
4098CONFIG_VIDEO_AU0828_V4L2=y
4099CONFIG_VIDEO_AU0828_RC=y
4100CONFIG_VIDEO_CX231XX=m
4101CONFIG_VIDEO_CX231XX_RC=y
4102CONFIG_VIDEO_CX231XX_ALSA=m
4103CONFIG_VIDEO_CX231XX_DVB=m
4104CONFIG_VIDEO_TM6000=m
4105CONFIG_VIDEO_TM6000_ALSA=m
4106CONFIG_VIDEO_TM6000_DVB=m
4107
4108#
4109# Digital TV USB devices
4110#
4111CONFIG_DVB_USB=m
4112# CONFIG_DVB_USB_DEBUG is not set
4113CONFIG_DVB_USB_A800=m
4114CONFIG_DVB_USB_DIBUSB_MB=m
4115CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
4116CONFIG_DVB_USB_DIBUSB_MC=m
4117CONFIG_DVB_USB_DIB0700=m
4118CONFIG_DVB_USB_UMT_010=m
4119CONFIG_DVB_USB_CXUSB=m
4120CONFIG_DVB_USB_M920X=m
4121CONFIG_DVB_USB_DIGITV=m
4122CONFIG_DVB_USB_VP7045=m
4123CONFIG_DVB_USB_VP702X=m
4124CONFIG_DVB_USB_GP8PSK=m
4125CONFIG_DVB_USB_NOVA_T_USB2=m
4126CONFIG_DVB_USB_TTUSB2=m
4127CONFIG_DVB_USB_DTT200U=m
4128CONFIG_DVB_USB_OPERA1=m
4129CONFIG_DVB_USB_AF9005=m
4130CONFIG_DVB_USB_AF9005_REMOTE=m
4131CONFIG_DVB_USB_PCTV452E=m
4132CONFIG_DVB_USB_DW2102=m
4133CONFIG_DVB_USB_CINERGY_T2=m
4134CONFIG_DVB_USB_DTV5100=m
4135CONFIG_DVB_USB_FRIIO=m
4136CONFIG_DVB_USB_AZ6027=m
4137CONFIG_DVB_USB_TECHNISAT_USB2=m
4138CONFIG_DVB_USB_V2=m
4139CONFIG_DVB_USB_AF9015=m
4140CONFIG_DVB_USB_AF9035=m
4141CONFIG_DVB_USB_ANYSEE=m
4142CONFIG_DVB_USB_AU6610=m
4143CONFIG_DVB_USB_AZ6007=m
4144CONFIG_DVB_USB_CE6230=m
4145CONFIG_DVB_USB_EC168=m
4146CONFIG_DVB_USB_GL861=m
4147CONFIG_DVB_USB_LME2510=m
4148CONFIG_DVB_USB_MXL111SF=m
4149CONFIG_DVB_USB_RTL28XXU=m
4150CONFIG_DVB_USB_DVBSKY=m
4151CONFIG_DVB_TTUSB_BUDGET=m
4152CONFIG_DVB_TTUSB_DEC=m
4153CONFIG_SMS_USB_DRV=m
4154CONFIG_DVB_B2C2_FLEXCOP_USB=m
4155# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set
4156CONFIG_DVB_AS102=m
4157
4158#
4159# Webcam, TV (analog/digital) USB devices
4160#
4161CONFIG_VIDEO_EM28XX=m
4162CONFIG_VIDEO_EM28XX_V4L2=m
4163CONFIG_VIDEO_EM28XX_ALSA=m
4164CONFIG_VIDEO_EM28XX_DVB=m
4165CONFIG_VIDEO_EM28XX_RC=m
4166
4167#
4168# Software defined radio USB devices
4169#
4170CONFIG_USB_AIRSPY=m
4171CONFIG_USB_HACKRF=m
4172CONFIG_USB_MSI2500=m
4173CONFIG_MEDIA_PCI_SUPPORT=y
4174
4175#
4176# Media capture support
4177#
4178CONFIG_VIDEO_MEYE=m
4179CONFIG_VIDEO_SOLO6X10=m
4180CONFIG_VIDEO_TW68=m
4181CONFIG_VIDEO_ZORAN=m
4182CONFIG_VIDEO_ZORAN_DC30=m
4183CONFIG_VIDEO_ZORAN_ZR36060=m
4184CONFIG_VIDEO_ZORAN_BUZ=m
4185CONFIG_VIDEO_ZORAN_DC10=m
4186CONFIG_VIDEO_ZORAN_LML33=m
4187CONFIG_VIDEO_ZORAN_LML33R10=m
4188CONFIG_VIDEO_ZORAN_AVS6EYES=m
4189
4190#
4191# Media capture/analog TV support
4192#
4193CONFIG_VIDEO_IVTV=m
4194CONFIG_VIDEO_IVTV_ALSA=m
4195CONFIG_VIDEO_FB_IVTV=m
4196CONFIG_VIDEO_HEXIUM_GEMINI=m
4197CONFIG_VIDEO_HEXIUM_ORION=m
4198CONFIG_VIDEO_MXB=m
4199CONFIG_VIDEO_DT3155=m
4200
4201#
4202# Media capture/analog/hybrid TV support
4203#
4204CONFIG_VIDEO_CX18=m
4205CONFIG_VIDEO_CX18_ALSA=m
4206CONFIG_VIDEO_CX23885=m
4207CONFIG_MEDIA_ALTERA_CI=m
4208# CONFIG_VIDEO_CX25821 is not set
4209CONFIG_VIDEO_CX88=m
4210CONFIG_VIDEO_CX88_ALSA=m
4211CONFIG_VIDEO_CX88_BLACKBIRD=m
4212CONFIG_VIDEO_CX88_DVB=m
4213CONFIG_VIDEO_CX88_ENABLE_VP3054=y
4214CONFIG_VIDEO_CX88_VP3054=m
4215CONFIG_VIDEO_CX88_MPEG=m
4216CONFIG_VIDEO_BT848=m
4217CONFIG_DVB_BT8XX=m
4218CONFIG_VIDEO_SAA7134=m
4219CONFIG_VIDEO_SAA7134_ALSA=m
4220CONFIG_VIDEO_SAA7134_RC=y
4221CONFIG_VIDEO_SAA7134_DVB=m
4222CONFIG_VIDEO_SAA7164=m
4223
4224#
4225# Media digital TV PCI Adapters
4226#
4227CONFIG_DVB_AV7110_IR=y
4228CONFIG_DVB_AV7110=m
4229CONFIG_DVB_AV7110_OSD=y
4230CONFIG_DVB_BUDGET_CORE=m
4231CONFIG_DVB_BUDGET=m
4232CONFIG_DVB_BUDGET_CI=m
4233CONFIG_DVB_BUDGET_AV=m
4234CONFIG_DVB_BUDGET_PATCH=m
4235CONFIG_DVB_B2C2_FLEXCOP_PCI=m
4236# CONFIG_DVB_B2C2_FLEXCOP_PCI_DEBUG is not set
4237CONFIG_DVB_PLUTO2=m
4238CONFIG_DVB_DM1105=m
4239CONFIG_DVB_PT1=m
4240CONFIG_DVB_PT3=m
4241CONFIG_MANTIS_CORE=m
4242CONFIG_DVB_MANTIS=m
4243CONFIG_DVB_HOPPER=m
4244CONFIG_DVB_NGENE=m
4245CONFIG_DVB_DDBRIDGE=m
4246CONFIG_DVB_SMIPCIE=m
4247CONFIG_DVB_NETUP_UNIDVB=m
4248CONFIG_V4L_PLATFORM_DRIVERS=y
4249CONFIG_VIDEO_CAFE_CCIC=m
4250CONFIG_VIDEO_VIA_CAMERA=m
4251# CONFIG_SOC_CAMERA is not set
4252CONFIG_V4L_MEM2MEM_DRIVERS=y
4253# CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
4254# CONFIG_VIDEO_SH_VEU is not set
4255CONFIG_V4L_TEST_DRIVERS=y
4256CONFIG_VIDEO_VIVID=m
4257CONFIG_VIDEO_VIVID_MAX_DEVS=64
4258# CONFIG_VIDEO_VIM2M is not set
4259# CONFIG_DVB_PLATFORM_DRIVERS is not set
4260
4261#
4262# Supported MMC/SDIO adapters
4263#
4264CONFIG_SMS_SDIO_DRV=m
4265CONFIG_RADIO_ADAPTERS=y
4266CONFIG_RADIO_TEA575X=m
4267CONFIG_RADIO_SI470X=y
4268CONFIG_USB_SI470X=m
4269# CONFIG_I2C_SI470X is not set
4270# CONFIG_RADIO_SI4713 is not set
4271CONFIG_USB_MR800=m
4272CONFIG_USB_DSBR=m
4273CONFIG_RADIO_MAXIRADIO=m
4274CONFIG_RADIO_SHARK=m
4275CONFIG_RADIO_SHARK2=m
4276CONFIG_USB_KEENE=m
4277CONFIG_USB_RAREMONO=m
4278CONFIG_USB_MA901=m
4279# CONFIG_RADIO_TEA5764 is not set
4280# CONFIG_RADIO_SAA7706H is not set
4281# CONFIG_RADIO_TEF6862 is not set
4282# CONFIG_RADIO_WL1273 is not set
4283
4284#
4285# Texas Instruments WL128x FM driver (ST based)
4286#
4287
4288#
4289# Supported FireWire (IEEE 1394) Adapters
4290#
4291CONFIG_DVB_FIREDTV=m
4292CONFIG_DVB_FIREDTV_INPUT=y
4293CONFIG_MEDIA_COMMON_OPTIONS=y
4294
4295#
4296# common driver options
4297#
4298CONFIG_VIDEO_CX2341X=m
4299CONFIG_VIDEO_TVEEPROM=m
4300CONFIG_CYPRESS_FIRMWARE=m
4301CONFIG_DVB_B2C2_FLEXCOP=m
4302CONFIG_VIDEO_SAA7146=m
4303CONFIG_VIDEO_SAA7146_VV=m
4304CONFIG_SMS_SIANO_MDTV=m
4305CONFIG_SMS_SIANO_RC=y
4306
4307#
4308# Media ancillary drivers (tuners, sensors, i2c, frontends)
4309#
4310CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
4311CONFIG_MEDIA_ATTACH=y
4312CONFIG_VIDEO_IR_I2C=m
4313
4314#
4315# Audio decoders, processors and mixers
4316#
4317CONFIG_VIDEO_TVAUDIO=m
4318CONFIG_VIDEO_TDA7432=m
4319CONFIG_VIDEO_TDA9840=m
4320CONFIG_VIDEO_TEA6415C=m
4321CONFIG_VIDEO_TEA6420=m
4322CONFIG_VIDEO_MSP3400=m
4323CONFIG_VIDEO_CS5345=m
4324CONFIG_VIDEO_CS53L32A=m
4325CONFIG_VIDEO_WM8775=m
4326CONFIG_VIDEO_WM8739=m
4327CONFIG_VIDEO_VP27SMPX=m
4328
4329#
4330# RDS decoders
4331#
4332CONFIG_VIDEO_SAA6588=m
4333
4334#
4335# Video decoders
4336#
4337CONFIG_VIDEO_BT819=m
4338CONFIG_VIDEO_BT856=m
4339CONFIG_VIDEO_BT866=m
4340CONFIG_VIDEO_KS0127=m
4341CONFIG_VIDEO_SAA7110=m
4342CONFIG_VIDEO_SAA711X=m
4343CONFIG_VIDEO_TVP5150=m
4344CONFIG_VIDEO_VPX3220=m
4345
4346#
4347# Video and audio decoders
4348#
4349CONFIG_VIDEO_SAA717X=m
4350CONFIG_VIDEO_CX25840=m
4351
4352#
4353# Video encoders
4354#
4355CONFIG_VIDEO_SAA7127=m
4356CONFIG_VIDEO_SAA7185=m
4357CONFIG_VIDEO_ADV7170=m
4358CONFIG_VIDEO_ADV7175=m
4359
4360#
4361# Camera sensor devices
4362#
4363CONFIG_VIDEO_OV7670=m
4364CONFIG_VIDEO_MT9V011=m
4365
4366#
4367# Flash devices
4368#
4369
4370#
4371# Video improvement chips
4372#
4373CONFIG_VIDEO_UPD64031A=m
4374CONFIG_VIDEO_UPD64083=m
4375
4376#
4377# Audio/Video compression chips
4378#
4379CONFIG_VIDEO_SAA6752HS=m
4380
4381#
4382# Miscellaneous helper chips
4383#
4384CONFIG_VIDEO_M52790=m
4385
4386#
4387# Sensors used on soc_camera driver
4388#
4389CONFIG_MEDIA_TUNER=m
4390CONFIG_MEDIA_TUNER_SIMPLE=m
4391CONFIG_MEDIA_TUNER_TDA8290=m
4392CONFIG_MEDIA_TUNER_TDA827X=m
4393CONFIG_MEDIA_TUNER_TDA18271=m
4394CONFIG_MEDIA_TUNER_TDA9887=m
4395CONFIG_MEDIA_TUNER_TEA5761=m
4396CONFIG_MEDIA_TUNER_TEA5767=m
4397CONFIG_MEDIA_TUNER_MSI001=m
4398CONFIG_MEDIA_TUNER_MT20XX=m
4399CONFIG_MEDIA_TUNER_MT2060=m
4400CONFIG_MEDIA_TUNER_MT2063=m
4401CONFIG_MEDIA_TUNER_MT2266=m
4402CONFIG_MEDIA_TUNER_MT2131=m
4403CONFIG_MEDIA_TUNER_QT1010=m
4404CONFIG_MEDIA_TUNER_XC2028=m
4405CONFIG_MEDIA_TUNER_XC5000=m
4406CONFIG_MEDIA_TUNER_XC4000=m
4407CONFIG_MEDIA_TUNER_MXL5005S=m
4408CONFIG_MEDIA_TUNER_MXL5007T=m
4409CONFIG_MEDIA_TUNER_MC44S803=m
4410CONFIG_MEDIA_TUNER_MAX2165=m
4411CONFIG_MEDIA_TUNER_TDA18218=m
4412CONFIG_MEDIA_TUNER_FC0011=m
4413CONFIG_MEDIA_TUNER_FC0012=m
4414CONFIG_MEDIA_TUNER_FC0013=m
4415CONFIG_MEDIA_TUNER_TDA18212=m
4416CONFIG_MEDIA_TUNER_E4000=m
4417CONFIG_MEDIA_TUNER_FC2580=m
4418CONFIG_MEDIA_TUNER_M88RS6000T=m
4419CONFIG_MEDIA_TUNER_TUA9001=m
4420CONFIG_MEDIA_TUNER_SI2157=m
4421CONFIG_MEDIA_TUNER_IT913X=m
4422CONFIG_MEDIA_TUNER_R820T=m
4423CONFIG_MEDIA_TUNER_MXL301RF=m
4424CONFIG_MEDIA_TUNER_QM1D1C0042=m
4425
4426#
4427# Multistandard (satellite) frontends
4428#
4429CONFIG_DVB_STB0899=m
4430CONFIG_DVB_STB6100=m
4431CONFIG_DVB_STV090x=m
4432CONFIG_DVB_STV6110x=m
4433CONFIG_DVB_M88DS3103=m
4434
4435#
4436# Multistandard (cable + terrestrial) frontends
4437#
4438CONFIG_DVB_DRXK=m
4439CONFIG_DVB_TDA18271C2DD=m
4440CONFIG_DVB_SI2165=m
4441
4442#
4443# DVB-S (satellite) frontends
4444#
4445CONFIG_DVB_CX24110=m
4446CONFIG_DVB_CX24123=m
4447CONFIG_DVB_MT312=m
4448CONFIG_DVB_ZL10036=m
4449CONFIG_DVB_ZL10039=m
4450CONFIG_DVB_S5H1420=m
4451CONFIG_DVB_STV0288=m
4452CONFIG_DVB_STB6000=m
4453CONFIG_DVB_STV0299=m
4454CONFIG_DVB_STV6110=m
4455CONFIG_DVB_STV0900=m
4456CONFIG_DVB_TDA8083=m
4457CONFIG_DVB_TDA10086=m
4458CONFIG_DVB_TDA8261=m
4459CONFIG_DVB_VES1X93=m
4460CONFIG_DVB_TUNER_ITD1000=m
4461CONFIG_DVB_TUNER_CX24113=m
4462CONFIG_DVB_TDA826X=m
4463CONFIG_DVB_TUA6100=m
4464CONFIG_DVB_CX24116=m
4465CONFIG_DVB_CX24117=m
4466CONFIG_DVB_CX24120=m
4467CONFIG_DVB_SI21XX=m
4468CONFIG_DVB_TS2020=m
4469CONFIG_DVB_DS3000=m
4470CONFIG_DVB_MB86A16=m
4471CONFIG_DVB_TDA10071=m
4472
4473#
4474# DVB-T (terrestrial) frontends
4475#
4476CONFIG_DVB_SP8870=m
4477CONFIG_DVB_SP887X=m
4478CONFIG_DVB_CX22700=m
4479CONFIG_DVB_CX22702=m
4480CONFIG_DVB_DRXD=m
4481CONFIG_DVB_L64781=m
4482CONFIG_DVB_TDA1004X=m
4483CONFIG_DVB_NXT6000=m
4484CONFIG_DVB_MT352=m
4485CONFIG_DVB_ZL10353=m
4486CONFIG_DVB_DIB3000MB=m
4487CONFIG_DVB_DIB3000MC=m
4488CONFIG_DVB_DIB7000M=m
4489CONFIG_DVB_DIB7000P=m
4490CONFIG_DVB_TDA10048=m
4491CONFIG_DVB_AF9013=m
4492CONFIG_DVB_EC100=m
4493CONFIG_DVB_STV0367=m
4494CONFIG_DVB_CXD2820R=m
4495CONFIG_DVB_CXD2841ER=m
4496CONFIG_DVB_RTL2830=m
4497CONFIG_DVB_RTL2832=m
4498CONFIG_DVB_RTL2832_SDR=m
4499CONFIG_DVB_SI2168=m
4500CONFIG_DVB_AS102_FE=m
4501
4502#
4503# DVB-C (cable) frontends
4504#
4505CONFIG_DVB_VES1820=m
4506CONFIG_DVB_TDA10021=m
4507CONFIG_DVB_TDA10023=m
4508CONFIG_DVB_STV0297=m
4509
4510#
4511# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
4512#
4513CONFIG_DVB_NXT200X=m
4514CONFIG_DVB_OR51211=m
4515CONFIG_DVB_OR51132=m
4516CONFIG_DVB_BCM3510=m
4517CONFIG_DVB_LGDT330X=m
4518CONFIG_DVB_LGDT3305=m
4519CONFIG_DVB_LGDT3306A=m
4520CONFIG_DVB_LG2160=m
4521CONFIG_DVB_S5H1409=m
4522CONFIG_DVB_AU8522=m
4523CONFIG_DVB_AU8522_DTV=m
4524CONFIG_DVB_AU8522_V4L=m
4525CONFIG_DVB_S5H1411=m
4526
4527#
4528# ISDB-T (terrestrial) frontends
4529#
4530CONFIG_DVB_S921=m
4531CONFIG_DVB_DIB8000=m
4532CONFIG_DVB_MB86A20S=m
4533
4534#
4535# ISDB-S (satellite) & ISDB-T (terrestrial) frontends
4536#
4537CONFIG_DVB_TC90522=m
4538
4539#
4540# Digital terrestrial only tuners/PLL
4541#
4542CONFIG_DVB_PLL=m
4543CONFIG_DVB_TUNER_DIB0070=m
4544CONFIG_DVB_TUNER_DIB0090=m
4545
4546#
4547# SEC control devices for DVB-S
4548#
4549CONFIG_DVB_DRX39XYJ=m
4550CONFIG_DVB_LNBH25=m
4551CONFIG_DVB_LNBP21=m
4552CONFIG_DVB_LNBP22=m
4553CONFIG_DVB_ISL6405=m
4554CONFIG_DVB_ISL6421=m
4555CONFIG_DVB_ISL6423=m
4556CONFIG_DVB_A8293=m
4557CONFIG_DVB_SP2=m
4558CONFIG_DVB_LGS8GXX=m
4559CONFIG_DVB_ATBM8830=m
4560CONFIG_DVB_TDA665x=m
4561CONFIG_DVB_IX2505V=m
4562CONFIG_DVB_M88RS2000=m
4563CONFIG_DVB_AF9033=m
4564CONFIG_DVB_HORUS3A=m
4565CONFIG_DVB_ASCOT2E=m
4566
4567#
4568# Tools to develop new frontends
4569#
4570# CONFIG_DVB_DUMMY_FE is not set
4571
4572#
4573# Graphics support
4574#
4575CONFIG_AGP=y
4576CONFIG_AGP_AMD64=y
4577CONFIG_AGP_INTEL=y
4578CONFIG_AGP_SIS=y
4579CONFIG_AGP_VIA=y
4580CONFIG_INTEL_GTT=y
4581CONFIG_VGA_ARB=y
4582CONFIG_VGA_ARB_MAX_GPUS=16
4583CONFIG_VGA_SWITCHEROO=y
4584CONFIG_DRM=m
4585CONFIG_DRM_MIPI_DSI=y
4586CONFIG_DRM_KMS_HELPER=m
4587CONFIG_DRM_KMS_FB_HELPER=y
4588CONFIG_DRM_FBDEV_EMULATION=y
4589CONFIG_DRM_LOAD_EDID_FIRMWARE=y
4590CONFIG_DRM_TTM=m
4591
4592#
4593# I2C encoder or helper chips
4594#
4595# CONFIG_DRM_I2C_ADV7511 is not set
4596CONFIG_DRM_I2C_CH7006=m
4597CONFIG_DRM_I2C_SIL164=m
4598# CONFIG_DRM_I2C_NXP_TDA998X is not set
4599CONFIG_DRM_TDFX=m
4600CONFIG_DRM_R128=m
4601CONFIG_DRM_RADEON=m
4602# CONFIG_DRM_RADEON_USERPTR is not set
4603# CONFIG_DRM_RADEON_UMS is not set
4604CONFIG_DRM_AMDGPU=m
4605# CONFIG_DRM_AMDGPU_CIK is not set
4606CONFIG_DRM_AMDGPU_USERPTR=y
4607CONFIG_DRM_NOUVEAU=m
4608CONFIG_NOUVEAU_DEBUG=5
4609CONFIG_NOUVEAU_DEBUG_DEFAULT=3
4610CONFIG_DRM_NOUVEAU_BACKLIGHT=y
4611# CONFIG_DRM_I810 is not set
4612CONFIG_DRM_I915=m
4613# CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set
4614CONFIG_DRM_MGA=m
4615CONFIG_DRM_SIS=m
4616CONFIG_DRM_VIA=m
4617CONFIG_DRM_SAVAGE=m
4618CONFIG_DRM_VGEM=m
4619CONFIG_DRM_VMWGFX=m
4620CONFIG_DRM_VMWGFX_FBCON=y
4621CONFIG_DRM_GMA500=m
4622CONFIG_DRM_GMA600=y
4623CONFIG_DRM_GMA3600=y
4624CONFIG_DRM_UDL=m
4625CONFIG_DRM_AST=m
4626CONFIG_DRM_MGAG200=m
4627CONFIG_DRM_CIRRUS_QEMU=m
4628CONFIG_DRM_QXL=m
4629CONFIG_DRM_BOCHS=m
4630CONFIG_DRM_VIRTIO_GPU=m
4631CONFIG_DRM_PANEL=y
4632
4633#
4634# Display Panels
4635#
4636CONFIG_DRM_BRIDGE=y
4637
4638#
4639# Display Interface Bridges
4640#
4641CONFIG_HSA_AMD=m
4642
4643#
4644# Frame buffer Devices
4645#
4646CONFIG_FB=y
4647CONFIG_FIRMWARE_EDID=y
4648CONFIG_FB_CMDLINE=y
4649CONFIG_FB_DDC=m
4650CONFIG_FB_BOOT_VESA_SUPPORT=y
4651CONFIG_FB_CFB_FILLRECT=y
4652CONFIG_FB_CFB_COPYAREA=y
4653CONFIG_FB_CFB_IMAGEBLIT=y
4654# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
4655CONFIG_FB_SYS_FILLRECT=m
4656CONFIG_FB_SYS_COPYAREA=m
4657CONFIG_FB_SYS_IMAGEBLIT=m
4658# CONFIG_FB_FOREIGN_ENDIAN is not set
4659CONFIG_FB_SYS_FOPS=m
4660CONFIG_FB_DEFERRED_IO=y
4661CONFIG_FB_HECUBA=m
4662CONFIG_FB_SVGALIB=m
4663# CONFIG_FB_MACMODES is not set
4664CONFIG_FB_BACKLIGHT=y
4665CONFIG_FB_MODE_HELPERS=y
4666CONFIG_FB_TILEBLITTING=y
4667
4668#
4669# Frame buffer hardware drivers
4670#
4671CONFIG_FB_CIRRUS=m
4672CONFIG_FB_PM2=m
4673CONFIG_FB_PM2_FIFO_DISCONNECT=y
4674CONFIG_FB_CYBER2000=m
4675CONFIG_FB_CYBER2000_DDC=y
4676CONFIG_FB_ARC=m
4677# CONFIG_FB_ASILIANT is not set
4678# CONFIG_FB_IMSTT is not set
4679CONFIG_FB_VGA16=m
4680CONFIG_FB_UVESA=m
4681CONFIG_FB_VESA=y
4682CONFIG_FB_EFI=y
4683CONFIG_FB_N411=m
4684CONFIG_FB_HGA=m
4685# CONFIG_FB_OPENCORES is not set
4686# CONFIG_FB_S1D13XXX is not set
4687# CONFIG_FB_I740 is not set
4688CONFIG_FB_LE80578=m
4689CONFIG_FB_CARILLO_RANCH=m
4690# CONFIG_FB_INTEL is not set
4691CONFIG_FB_MATROX=m
4692CONFIG_FB_MATROX_MILLENIUM=y
4693CONFIG_FB_MATROX_MYSTIQUE=y
4694CONFIG_FB_MATROX_G=y
4695CONFIG_FB_MATROX_I2C=m
4696CONFIG_FB_MATROX_MAVEN=m
4697CONFIG_FB_RADEON=m
4698CONFIG_FB_RADEON_I2C=y
4699CONFIG_FB_RADEON_BACKLIGHT=y
4700# CONFIG_FB_RADEON_DEBUG is not set
4701CONFIG_FB_ATY128=m
4702CONFIG_FB_ATY128_BACKLIGHT=y
4703CONFIG_FB_ATY=m
4704CONFIG_FB_ATY_CT=y
4705# CONFIG_FB_ATY_GENERIC_LCD is not set
4706CONFIG_FB_ATY_GX=y
4707CONFIG_FB_ATY_BACKLIGHT=y
4708CONFIG_FB_S3=m
4709CONFIG_FB_S3_DDC=y
4710CONFIG_FB_SAVAGE=m
4711# CONFIG_FB_SAVAGE_I2C is not set
4712# CONFIG_FB_SAVAGE_ACCEL is not set
4713CONFIG_FB_SIS=m
4714CONFIG_FB_SIS_300=y
4715CONFIG_FB_SIS_315=y
4716CONFIG_FB_VIA=m
4717# CONFIG_FB_VIA_DIRECT_PROCFS is not set
4718CONFIG_FB_VIA_X_COMPATIBILITY=y
4719CONFIG_FB_NEOMAGIC=m
4720CONFIG_FB_KYRO=m
4721CONFIG_FB_3DFX=m
4722# CONFIG_FB_3DFX_ACCEL is not set
4723CONFIG_FB_3DFX_I2C=y
4724CONFIG_FB_VOODOO1=m
4725CONFIG_FB_VT8623=m
4726CONFIG_FB_TRIDENT=m
4727CONFIG_FB_ARK=m
4728CONFIG_FB_PM3=m
4729# CONFIG_FB_CARMINE is not set
4730CONFIG_FB_SMSCUFX=m
4731CONFIG_FB_UDL=m
4732# CONFIG_FB_IBM_GXT4500 is not set
4733CONFIG_FB_VIRTUAL=m
4734# CONFIG_FB_METRONOME is not set
4735CONFIG_FB_MB862XX=m
4736CONFIG_FB_MB862XX_PCI_GDC=y
4737CONFIG_FB_MB862XX_I2C=y
4738# CONFIG_FB_BROADSHEET is not set
4739# CONFIG_FB_AUO_K190X is not set
4740CONFIG_FB_HYPERV=m
4741CONFIG_FB_SIMPLE=y
4742# CONFIG_FB_SM712 is not set
4743CONFIG_BACKLIGHT_LCD_SUPPORT=y
4744# CONFIG_LCD_CLASS_DEVICE is not set
4745CONFIG_BACKLIGHT_CLASS_DEVICE=y
4746# CONFIG_BACKLIGHT_GENERIC is not set
4747CONFIG_BACKLIGHT_APPLE=m
4748# CONFIG_BACKLIGHT_PM8941_WLED is not set
4749# CONFIG_BACKLIGHT_SAHARA is not set
4750# CONFIG_BACKLIGHT_ADP8860 is not set
4751# CONFIG_BACKLIGHT_ADP8870 is not set
4752# CONFIG_BACKLIGHT_LM3639 is not set
4753# CONFIG_BACKLIGHT_GPIO is not set
4754# CONFIG_BACKLIGHT_LV5207LP is not set
4755# CONFIG_BACKLIGHT_BD6107 is not set
4756CONFIG_VGASTATE=m
4757CONFIG_HDMI=y
4758
4759#
4760# Console display driver support
4761#
4762CONFIG_VGA_CONSOLE=y
4763# CONFIG_VGACON_SOFT_SCROLLBACK is not set
4764CONFIG_DUMMY_CONSOLE=y
4765CONFIG_DUMMY_CONSOLE_COLUMNS=80
4766CONFIG_DUMMY_CONSOLE_ROWS=25
4767CONFIG_FRAMEBUFFER_CONSOLE=y
4768CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
4769CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
4770# CONFIG_LOGO is not set
4771CONFIG_SOUND=m
4772CONFIG_SOUND_OSS_CORE=y
4773# CONFIG_SOUND_OSS_CORE_PRECLAIM is not set
4774CONFIG_SND=m
4775CONFIG_SND_TIMER=m
4776CONFIG_SND_PCM=m
4777CONFIG_SND_HWDEP=m
4778CONFIG_SND_RAWMIDI=m
4779CONFIG_SND_JACK=y
4780CONFIG_SND_SEQUENCER=m
4781CONFIG_SND_SEQ_DUMMY=m
4782CONFIG_SND_OSSEMUL=y
4783CONFIG_SND_MIXER_OSS=m
4784CONFIG_SND_PCM_OSS=m
4785CONFIG_SND_PCM_OSS_PLUGINS=y
4786CONFIG_SND_PCM_TIMER=y
4787# CONFIG_SND_SEQUENCER_OSS is not set
4788CONFIG_SND_HRTIMER=m
4789CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
4790CONFIG_SND_DYNAMIC_MINORS=y
4791CONFIG_SND_MAX_CARDS=32
4792CONFIG_SND_SUPPORT_OLD_API=y
4793CONFIG_SND_PROC_FS=y
4794CONFIG_SND_VERBOSE_PROCFS=y
4795# CONFIG_SND_VERBOSE_PRINTK is not set
4796# CONFIG_SND_DEBUG is not set
4797CONFIG_SND_VMASTER=y
4798CONFIG_SND_DMA_SGBUF=y
4799CONFIG_SND_RAWMIDI_SEQ=m
4800CONFIG_SND_OPL3_LIB_SEQ=m
4801# CONFIG_SND_OPL4_LIB_SEQ is not set
4802# CONFIG_SND_SBAWE_SEQ is not set
4803# CONFIG_SND_EMU10K1_SEQ is not set
4804CONFIG_SND_MPU401_UART=m
4805CONFIG_SND_OPL3_LIB=m
4806CONFIG_SND_VX_LIB=m
4807CONFIG_SND_AC97_CODEC=m
4808CONFIG_SND_DRIVERS=y
4809CONFIG_SND_PCSP=m
4810CONFIG_SND_DUMMY=m
4811CONFIG_SND_ALOOP=m
4812CONFIG_SND_VIRMIDI=m
4813CONFIG_SND_MTPAV=m
4814CONFIG_SND_MTS64=m
4815CONFIG_SND_SERIAL_U16550=m
4816CONFIG_SND_MPU401=m
4817CONFIG_SND_PORTMAN2X4=m
4818CONFIG_SND_AC97_POWER_SAVE=y
4819CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
4820CONFIG_SND_SB_COMMON=m
4821CONFIG_SND_PCI=y
4822CONFIG_SND_AD1889=m
4823CONFIG_SND_ALS4000=m
4824CONFIG_SND_ASIHPI=m
4825CONFIG_SND_ATIIXP=m
4826CONFIG_SND_ATIIXP_MODEM=m
4827CONFIG_SND_AU8810=m
4828CONFIG_SND_AU8820=m
4829CONFIG_SND_AU8830=m
4830# CONFIG_SND_AW2 is not set
4831CONFIG_SND_BT87X=m
4832# CONFIG_SND_BT87X_OVERCLOCK is not set
4833CONFIG_SND_CA0106=m
4834CONFIG_SND_CMIPCI=m
4835CONFIG_SND_OXYGEN_LIB=m
4836CONFIG_SND_OXYGEN=m
4837CONFIG_SND_CS4281=m
4838CONFIG_SND_CS46XX=m
4839CONFIG_SND_CS46XX_NEW_DSP=y
4840CONFIG_SND_CTXFI=m
4841CONFIG_SND_DARLA20=m
4842CONFIG_SND_GINA20=m
4843CONFIG_SND_LAYLA20=m
4844CONFIG_SND_DARLA24=m
4845CONFIG_SND_GINA24=m
4846CONFIG_SND_LAYLA24=m
4847CONFIG_SND_MONA=m
4848CONFIG_SND_MIA=m
4849CONFIG_SND_ECHO3G=m
4850CONFIG_SND_INDIGO=m
4851CONFIG_SND_INDIGOIO=m
4852CONFIG_SND_INDIGODJ=m
4853CONFIG_SND_INDIGOIOX=m
4854CONFIG_SND_INDIGODJX=m
4855CONFIG_SND_ENS1370=m
4856CONFIG_SND_ENS1371=m
4857CONFIG_SND_FM801=m
4858CONFIG_SND_FM801_TEA575X_BOOL=y
4859CONFIG_SND_HDSP=m
4860CONFIG_SND_HDSPM=m
4861CONFIG_SND_ICE1724=m
4862CONFIG_SND_INTEL8X0=m
4863CONFIG_SND_INTEL8X0M=m
4864CONFIG_SND_KORG1212=m
4865CONFIG_SND_LOLA=m
4866CONFIG_SND_LX6464ES=m
4867CONFIG_SND_MIXART=m
4868CONFIG_SND_NM256=m
4869CONFIG_SND_PCXHR=m
4870CONFIG_SND_RIPTIDE=m
4871CONFIG_SND_RME32=m
4872CONFIG_SND_RME96=m
4873CONFIG_SND_RME9652=m
4874CONFIG_SND_VIA82XX=m
4875CONFIG_SND_VIA82XX_MODEM=m
4876CONFIG_SND_VIRTUOSO=m
4877CONFIG_SND_VX222=m
4878CONFIG_SND_YMFPCI=m
4879
4880#
4881# HD-Audio
4882#
4883CONFIG_SND_HDA=m
4884CONFIG_SND_HDA_INTEL=m
4885CONFIG_SND_HDA_HWDEP=y
4886CONFIG_SND_HDA_RECONFIG=y
4887CONFIG_SND_HDA_INPUT_BEEP=y
4888CONFIG_SND_HDA_INPUT_BEEP_MODE=1
4889CONFIG_SND_HDA_PATCH_LOADER=y
4890CONFIG_SND_HDA_CODEC_REALTEK=m
4891CONFIG_SND_HDA_CODEC_ANALOG=m
4892CONFIG_SND_HDA_CODEC_SIGMATEL=m
4893CONFIG_SND_HDA_CODEC_VIA=m
4894CONFIG_SND_HDA_CODEC_HDMI=m
4895CONFIG_SND_HDA_CODEC_CIRRUS=m
4896CONFIG_SND_HDA_CODEC_CONEXANT=m
4897CONFIG_SND_HDA_CODEC_CA0110=m
4898CONFIG_SND_HDA_CODEC_CA0132=m
4899CONFIG_SND_HDA_CODEC_CA0132_DSP=y
4900CONFIG_SND_HDA_CODEC_CMEDIA=m
4901CONFIG_SND_HDA_CODEC_SI3054=m
4902CONFIG_SND_HDA_GENERIC=m
4903CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0
4904CONFIG_SND_HDA_CORE=m
4905CONFIG_SND_HDA_DSP_LOADER=y
4906CONFIG_SND_HDA_I915=y
4907CONFIG_SND_HDA_PREALLOC_SIZE=64
4908CONFIG_SND_SPI=y
4909CONFIG_SND_USB=y
4910CONFIG_SND_USB_AUDIO=m
4911CONFIG_SND_USB_UA101=m
4912CONFIG_SND_USB_USX2Y=m
4913CONFIG_SND_USB_CAIAQ=m
4914CONFIG_SND_USB_CAIAQ_INPUT=y
4915CONFIG_SND_USB_US122L=m
4916CONFIG_SND_USB_6FIRE=m
4917CONFIG_SND_USB_HIFACE=m
4918CONFIG_SND_BCD2000=m
4919CONFIG_SND_USB_LINE6=m
4920CONFIG_SND_USB_POD=m
4921CONFIG_SND_USB_PODHD=m
4922CONFIG_SND_USB_TONEPORT=m
4923CONFIG_SND_USB_VARIAX=m
4924CONFIG_SND_FIREWIRE=y
4925CONFIG_SND_FIREWIRE_LIB=m
4926CONFIG_SND_DICE=m
4927CONFIG_SND_OXFW=m
4928CONFIG_SND_ISIGHT=m
4929CONFIG_SND_SCS1X=m
4930CONFIG_SND_FIREWORKS=m
4931CONFIG_SND_BEBOB=m
4932CONFIG_SND_FIREWIRE_DIGI00X=m
4933CONFIG_SND_FIREWIRE_TASCAM=m
4934CONFIG_SND_PCMCIA=y
4935CONFIG_SND_VXPOCKET=m
4936CONFIG_SND_PDAUDIOCF=m
4937CONFIG_SND_SOC=m
4938# CONFIG_SND_ATMEL_SOC is not set
4939# CONFIG_SND_DESIGNWARE_I2S is not set
4940
4941#
4942# SoC Audio for Freescale CPUs
4943#
4944
4945#
4946# Common SoC Audio options for Freescale CPUs:
4947#
4948# CONFIG_SND_SOC_FSL_ASRC is not set
4949# CONFIG_SND_SOC_FSL_SAI is not set
4950# CONFIG_SND_SOC_FSL_SSI is not set
4951# CONFIG_SND_SOC_FSL_SPDIF is not set
4952# CONFIG_SND_SOC_FSL_ESAI is not set
4953# CONFIG_SND_SOC_IMX_AUDMUX is not set
4954CONFIG_SND_SOC_INTEL_SST=m
4955CONFIG_SND_SOC_INTEL_SST_ACPI=m
4956CONFIG_SND_SOC_INTEL_HASWELL=m
4957CONFIG_SND_SOC_INTEL_BAYTRAIL=m
4958CONFIG_SND_SOC_INTEL_HASWELL_MACH=m
4959CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH=m
4960CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH=m
4961CONFIG_SND_SOC_INTEL_BROADWELL_MACH=m
4962# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set
4963# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set
4964# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set
4965# CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set
4966# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set
4967
4968#
4969# Allwinner SoC Audio support
4970#
4971# CONFIG_SND_SUN4I_CODEC is not set
4972# CONFIG_SND_SOC_XTFPGA_I2S is not set
4973CONFIG_SND_SOC_I2C_AND_SPI=m
4974
4975#
4976# CODEC drivers
4977#
4978# CONFIG_SND_SOC_AC97_CODEC is not set
4979# CONFIG_SND_SOC_ADAU1701 is not set
4980# CONFIG_SND_SOC_AK4104 is not set
4981# CONFIG_SND_SOC_AK4554 is not set
4982# CONFIG_SND_SOC_AK4613 is not set
4983# CONFIG_SND_SOC_AK4642 is not set
4984# CONFIG_SND_SOC_AK5386 is not set
4985# CONFIG_SND_SOC_ALC5623 is not set
4986# CONFIG_SND_SOC_CS35L32 is not set
4987# CONFIG_SND_SOC_CS42L51_I2C is not set
4988# CONFIG_SND_SOC_CS42L52 is not set
4989# CONFIG_SND_SOC_CS42L56 is not set
4990# CONFIG_SND_SOC_CS42L73 is not set
4991# CONFIG_SND_SOC_CS4265 is not set
4992# CONFIG_SND_SOC_CS4270 is not set
4993# CONFIG_SND_SOC_CS4271_I2C is not set
4994# CONFIG_SND_SOC_CS4271_SPI is not set
4995# CONFIG_SND_SOC_CS42XX8_I2C is not set
4996# CONFIG_SND_SOC_CS4349 is not set
4997# CONFIG_SND_SOC_ES8328 is not set
4998# CONFIG_SND_SOC_GTM601 is not set
4999CONFIG_SND_SOC_MAX98090=m
5000# CONFIG_SND_SOC_PCM1681 is not set
5001# CONFIG_SND_SOC_PCM1792A is not set
5002# CONFIG_SND_SOC_PCM512x_I2C is not set
5003# CONFIG_SND_SOC_PCM512x_SPI is not set
5004CONFIG_SND_SOC_RL6231=m
5005CONFIG_SND_SOC_RL6347A=m
5006CONFIG_SND_SOC_RT286=m
5007# CONFIG_SND_SOC_RT5631 is not set
5008CONFIG_SND_SOC_RT5640=m
5009# CONFIG_SND_SOC_RT5677_SPI is not set
5010# CONFIG_SND_SOC_SGTL5000 is not set
5011# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set
5012# CONFIG_SND_SOC_SPDIF is not set
5013# CONFIG_SND_SOC_SSM2602_SPI is not set
5014# CONFIG_SND_SOC_SSM2602_I2C is not set
5015# CONFIG_SND_SOC_SSM4567 is not set
5016# CONFIG_SND_SOC_STA32X is not set
5017# CONFIG_SND_SOC_STA350 is not set
5018# CONFIG_SND_SOC_STI_SAS is not set
5019# CONFIG_SND_SOC_TAS2552 is not set
5020# CONFIG_SND_SOC_TAS5086 is not set
5021# CONFIG_SND_SOC_TAS571X is not set
5022# CONFIG_SND_SOC_TFA9879 is not set
5023# CONFIG_SND_SOC_TLV320AIC23_I2C is not set
5024# CONFIG_SND_SOC_TLV320AIC23_SPI is not set
5025# CONFIG_SND_SOC_TLV320AIC31XX is not set
5026# CONFIG_SND_SOC_TLV320AIC3X is not set
5027# CONFIG_SND_SOC_TS3A227E is not set
5028# CONFIG_SND_SOC_WM8510 is not set
5029# CONFIG_SND_SOC_WM8523 is not set
5030# CONFIG_SND_SOC_WM8580 is not set
5031# CONFIG_SND_SOC_WM8711 is not set
5032# CONFIG_SND_SOC_WM8728 is not set
5033# CONFIG_SND_SOC_WM8731 is not set
5034# CONFIG_SND_SOC_WM8737 is not set
5035# CONFIG_SND_SOC_WM8741 is not set
5036# CONFIG_SND_SOC_WM8750 is not set
5037# CONFIG_SND_SOC_WM8753 is not set
5038# CONFIG_SND_SOC_WM8770 is not set
5039# CONFIG_SND_SOC_WM8776 is not set
5040# CONFIG_SND_SOC_WM8804_I2C is not set
5041# CONFIG_SND_SOC_WM8804_SPI is not set
5042# CONFIG_SND_SOC_WM8903 is not set
5043# CONFIG_SND_SOC_WM8962 is not set
5044# CONFIG_SND_SOC_WM8978 is not set
5045# CONFIG_SND_SOC_TPA6130A2 is not set
5046# CONFIG_SND_SIMPLE_CARD is not set
5047# CONFIG_SOUND_PRIME is not set
5048CONFIG_AC97_BUS=m
5049
5050#
5051# HID support
5052#
5053CONFIG_HID=m
5054CONFIG_HID_BATTERY_STRENGTH=y
5055CONFIG_HIDRAW=y
5056CONFIG_UHID=m
5057CONFIG_HID_GENERIC=m
5058
5059#
5060# Special HID drivers
5061#
5062CONFIG_HID_A4TECH=m
5063CONFIG_HID_ACRUX=m
5064CONFIG_HID_ACRUX_FF=y
5065CONFIG_HID_APPLE=m
5066CONFIG_HID_APPLEIR=m
5067CONFIG_HID_AUREAL=m
5068CONFIG_HID_BELKIN=m
5069CONFIG_HID_BETOP_FF=m
5070CONFIG_HID_CHERRY=m
5071CONFIG_HID_CHICONY=m
5072CONFIG_HID_CORSAIR=m
5073CONFIG_HID_PRODIKEYS=m
5074CONFIG_HID_CP2112=m
5075CONFIG_HID_CYPRESS=m
5076CONFIG_HID_DRAGONRISE=m
5077CONFIG_DRAGONRISE_FF=y
5078CONFIG_HID_EMS_FF=m
5079CONFIG_HID_ELECOM=m
5080CONFIG_HID_ELO=m
5081CONFIG_HID_EZKEY=m
5082CONFIG_HID_GEMBIRD=m
5083# CONFIG_HID_GFRM is not set
5084CONFIG_HID_HOLTEK=m
5085CONFIG_HOLTEK_FF=y
5086# CONFIG_HID_GT683R is not set
5087CONFIG_HID_KEYTOUCH=m
5088CONFIG_HID_KYE=m
5089CONFIG_HID_UCLOGIC=m
5090CONFIG_HID_WALTOP=m
5091CONFIG_HID_GYRATION=m
5092CONFIG_HID_ICADE=m
5093CONFIG_HID_TWINHAN=m
5094CONFIG_HID_KENSINGTON=m
5095CONFIG_HID_LCPOWER=m
5096CONFIG_HID_LENOVO=m
5097CONFIG_HID_LOGITECH=m
5098CONFIG_HID_LOGITECH_DJ=m
5099CONFIG_HID_LOGITECH_HIDPP=m
5100CONFIG_LOGITECH_FF=y
5101CONFIG_LOGIRUMBLEPAD2_FF=y
5102CONFIG_LOGIG940_FF=y
5103CONFIG_LOGIWHEELS_FF=y
5104CONFIG_HID_MAGICMOUSE=m
5105CONFIG_HID_MICROSOFT=m
5106CONFIG_HID_MONTEREY=m
5107CONFIG_HID_MULTITOUCH=m
5108CONFIG_HID_NTRIG=m
5109CONFIG_HID_ORTEK=m
5110CONFIG_HID_PANTHERLORD=m
5111CONFIG_PANTHERLORD_FF=y
5112CONFIG_HID_PENMOUNT=m
5113CONFIG_HID_PETALYNX=m
5114CONFIG_HID_PICOLCD=m
5115CONFIG_HID_PICOLCD_FB=y
5116CONFIG_HID_PICOLCD_BACKLIGHT=y
5117CONFIG_HID_PICOLCD_LEDS=y
5118CONFIG_HID_PICOLCD_CIR=y
5119CONFIG_HID_PLANTRONICS=m
5120CONFIG_HID_PRIMAX=m
5121CONFIG_HID_ROCCAT=m
5122CONFIG_HID_SAITEK=m
5123CONFIG_HID_SAMSUNG=m
5124CONFIG_HID_SONY=m
5125CONFIG_SONY_FF=y
5126CONFIG_HID_SPEEDLINK=m
5127CONFIG_HID_STEELSERIES=m
5128CONFIG_HID_SUNPLUS=m
5129CONFIG_HID_RMI=m
5130CONFIG_HID_GREENASIA=m
5131CONFIG_GREENASIA_FF=y
5132CONFIG_HID_HYPERV_MOUSE=m
5133CONFIG_HID_SMARTJOYPLUS=m
5134CONFIG_SMARTJOYPLUS_FF=y
5135CONFIG_HID_TIVO=m
5136CONFIG_HID_TOPSEED=m
5137CONFIG_HID_THINGM=m
5138CONFIG_HID_THRUSTMASTER=m
5139CONFIG_THRUSTMASTER_FF=y
5140CONFIG_HID_WACOM=m
5141CONFIG_HID_WIIMOTE=m
5142CONFIG_HID_XINMO=m
5143CONFIG_HID_ZEROPLUS=m
5144CONFIG_ZEROPLUS_FF=y
5145CONFIG_HID_ZYDACRON=m
5146CONFIG_HID_SENSOR_HUB=m
5147# CONFIG_HID_SENSOR_CUSTOM_SENSOR is not set
5148
5149#
5150# USB HID support
5151#
5152CONFIG_USB_HID=m
5153CONFIG_HID_PID=y
5154CONFIG_USB_HIDDEV=y
5155
5156#
5157# USB HID Boot Protocol drivers
5158#
5159# CONFIG_USB_KBD is not set
5160# CONFIG_USB_MOUSE is not set
5161
5162#
5163# I2C HID support
5164#
5165CONFIG_I2C_HID=m
5166CONFIG_USB_OHCI_LITTLE_ENDIAN=y
5167CONFIG_USB_SUPPORT=y
5168CONFIG_USB_COMMON=m
5169CONFIG_USB_ARCH_HAS_HCD=y
5170CONFIG_USB=m
5171CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
5172
5173#
5174# Miscellaneous USB options
5175#
5176CONFIG_USB_DEFAULT_PERSIST=y
5177CONFIG_USB_DYNAMIC_MINORS=y
5178# CONFIG_USB_OTG is not set
5179# CONFIG_USB_OTG_WHITELIST is not set
5180# CONFIG_USB_OTG_BLACKLIST_HUB is not set
5181# CONFIG_USB_ULPI_BUS is not set
5182CONFIG_USB_MON=m
5183CONFIG_USB_WUSB=m
5184CONFIG_USB_WUSB_CBAF=m
5185# CONFIG_USB_WUSB_CBAF_DEBUG is not set
5186
5187#
5188# USB Host Controller Drivers
5189#
5190# CONFIG_USB_C67X00_HCD is not set
5191CONFIG_USB_XHCI_HCD=m
5192CONFIG_USB_XHCI_PCI=m
5193# CONFIG_USB_XHCI_PLATFORM is not set
5194CONFIG_USB_EHCI_HCD=m
5195CONFIG_USB_EHCI_ROOT_HUB_TT=y
5196CONFIG_USB_EHCI_TT_NEWSCHED=y
5197CONFIG_USB_EHCI_PCI=m
5198# CONFIG_USB_EHCI_HCD_PLATFORM is not set
5199# CONFIG_USB_OXU210HP_HCD is not set
5200# CONFIG_USB_ISP116X_HCD is not set
5201# CONFIG_USB_ISP1362_HCD is not set
5202# CONFIG_USB_FOTG210_HCD is not set
5203# CONFIG_USB_MAX3421_HCD is not set
5204CONFIG_USB_OHCI_HCD=m
5205CONFIG_USB_OHCI_HCD_PCI=m
5206# CONFIG_USB_OHCI_HCD_SSB is not set
5207# CONFIG_USB_OHCI_HCD_PLATFORM is not set
5208CONFIG_USB_UHCI_HCD=m
5209CONFIG_USB_U132_HCD=m
5210CONFIG_USB_SL811_HCD=m
5211# CONFIG_USB_SL811_HCD_ISO is not set
5212CONFIG_USB_SL811_CS=m
5213# CONFIG_USB_R8A66597_HCD is not set
5214CONFIG_USB_WHCI_HCD=m
5215CONFIG_USB_HWA_HCD=m
5216# CONFIG_USB_HCD_BCMA is not set
5217# CONFIG_USB_HCD_SSB is not set
5218# CONFIG_USB_HCD_TEST_MODE is not set
5219
5220#
5221# USB Device Class drivers
5222#
5223CONFIG_USB_ACM=m
5224CONFIG_USB_PRINTER=m
5225CONFIG_USB_WDM=m
5226CONFIG_USB_TMC=m
5227
5228#
5229# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
5230#
5231
5232#
5233# also be needed; see USB_STORAGE Help for more info
5234#
5235CONFIG_USB_STORAGE=m
5236# CONFIG_USB_STORAGE_DEBUG is not set
5237CONFIG_USB_STORAGE_REALTEK=m
5238CONFIG_REALTEK_AUTOPM=y
5239CONFIG_USB_STORAGE_DATAFAB=m
5240CONFIG_USB_STORAGE_FREECOM=m
5241CONFIG_USB_STORAGE_ISD200=m
5242CONFIG_USB_STORAGE_USBAT=m
5243CONFIG_USB_STORAGE_SDDR09=m
5244CONFIG_USB_STORAGE_SDDR55=m
5245CONFIG_USB_STORAGE_JUMPSHOT=m
5246CONFIG_USB_STORAGE_ALAUDA=m
5247CONFIG_USB_STORAGE_ONETOUCH=m
5248CONFIG_USB_STORAGE_KARMA=m
5249CONFIG_USB_STORAGE_CYPRESS_ATACB=m
5250CONFIG_USB_STORAGE_ENE_UB6250=m
5251CONFIG_USB_UAS=m
5252
5253#
5254# USB Imaging devices
5255#
5256CONFIG_USB_MDC800=m
5257CONFIG_USB_MICROTEK=m
5258CONFIG_USBIP_CORE=m
5259CONFIG_USBIP_VHCI_HCD=m
5260CONFIG_USBIP_HOST=m
5261# CONFIG_USBIP_DEBUG is not set
5262# CONFIG_USB_MUSB_HDRC is not set
5263# CONFIG_USB_DWC3 is not set
5264# CONFIG_USB_DWC2 is not set
5265# CONFIG_USB_CHIPIDEA is not set
5266# CONFIG_USB_ISP1760 is not set
5267
5268#
5269# USB port drivers
5270#
5271CONFIG_USB_USS720=m
5272CONFIG_USB_SERIAL=m
5273CONFIG_USB_SERIAL_GENERIC=y
5274CONFIG_USB_SERIAL_SIMPLE=m
5275CONFIG_USB_SERIAL_AIRCABLE=m
5276CONFIG_USB_SERIAL_ARK3116=m
5277CONFIG_USB_SERIAL_BELKIN=m
5278CONFIG_USB_SERIAL_CH341=m
5279CONFIG_USB_SERIAL_WHITEHEAT=m
5280CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
5281CONFIG_USB_SERIAL_CP210X=m
5282CONFIG_USB_SERIAL_CYPRESS_M8=m
5283CONFIG_USB_SERIAL_EMPEG=m
5284CONFIG_USB_SERIAL_FTDI_SIO=m
5285CONFIG_USB_SERIAL_VISOR=m
5286CONFIG_USB_SERIAL_IPAQ=m
5287CONFIG_USB_SERIAL_IR=m
5288CONFIG_USB_SERIAL_EDGEPORT=m
5289CONFIG_USB_SERIAL_EDGEPORT_TI=m
5290CONFIG_USB_SERIAL_F81232=m
5291CONFIG_USB_SERIAL_GARMIN=m
5292CONFIG_USB_SERIAL_IPW=m
5293CONFIG_USB_SERIAL_IUU=m
5294CONFIG_USB_SERIAL_KEYSPAN_PDA=m
5295CONFIG_USB_SERIAL_KEYSPAN=m
5296CONFIG_USB_SERIAL_KLSI=m
5297CONFIG_USB_SERIAL_KOBIL_SCT=m
5298CONFIG_USB_SERIAL_MCT_U232=m
5299CONFIG_USB_SERIAL_METRO=m
5300CONFIG_USB_SERIAL_MOS7720=m
5301CONFIG_USB_SERIAL_MOS7715_PARPORT=y
5302CONFIG_USB_SERIAL_MOS7840=m
5303CONFIG_USB_SERIAL_MXUPORT=m
5304CONFIG_USB_SERIAL_NAVMAN=m
5305CONFIG_USB_SERIAL_PL2303=m
5306CONFIG_USB_SERIAL_OTI6858=m
5307CONFIG_USB_SERIAL_QCAUX=m
5308CONFIG_USB_SERIAL_QUALCOMM=m
5309CONFIG_USB_SERIAL_SPCP8X5=m
5310CONFIG_USB_SERIAL_SAFE=m
5311# CONFIG_USB_SERIAL_SAFE_PADDED is not set
5312CONFIG_USB_SERIAL_SIERRAWIRELESS=m
5313CONFIG_USB_SERIAL_SYMBOL=m
5314CONFIG_USB_SERIAL_TI=m
5315CONFIG_USB_SERIAL_CYBERJACK=m
5316CONFIG_USB_SERIAL_XIRCOM=m
5317CONFIG_USB_SERIAL_WWAN=m
5318CONFIG_USB_SERIAL_OPTION=m
5319CONFIG_USB_SERIAL_OMNINET=m
5320CONFIG_USB_SERIAL_OPTICON=m
5321CONFIG_USB_SERIAL_XSENS_MT=m
5322CONFIG_USB_SERIAL_WISHBONE=m
5323CONFIG_USB_SERIAL_SSU100=m
5324CONFIG_USB_SERIAL_QT2=m
5325CONFIG_USB_SERIAL_DEBUG=m
5326
5327#
5328# USB Miscellaneous drivers
5329#
5330CONFIG_USB_EMI62=m
5331CONFIG_USB_EMI26=m
5332CONFIG_USB_ADUTUX=m
5333CONFIG_USB_SEVSEG=m
5334CONFIG_USB_RIO500=m
5335CONFIG_USB_LEGOTOWER=m
5336CONFIG_USB_LCD=m
5337CONFIG_USB_LED=m
5338CONFIG_USB_CYPRESS_CY7C63=m
5339CONFIG_USB_CYTHERM=m
5340CONFIG_USB_IDMOUSE=m
5341CONFIG_USB_FTDI_ELAN=m
5342CONFIG_USB_APPLEDISPLAY=m
5343CONFIG_USB_SISUSBVGA=m
5344CONFIG_USB_SISUSBVGA_CON=y
5345CONFIG_USB_LD=m
5346CONFIG_USB_TRANCEVIBRATOR=m
5347CONFIG_USB_IOWARRIOR=m
5348CONFIG_USB_TEST=m
5349CONFIG_USB_EHSET_TEST_FIXTURE=m
5350CONFIG_USB_ISIGHTFW=m
5351CONFIG_USB_YUREX=m
5352CONFIG_USB_EZUSB_FX2=m
5353# CONFIG_USB_HSIC_USB3503 is not set
5354# CONFIG_USB_LINK_LAYER_TEST is not set
5355CONFIG_USB_CHAOSKEY=m
5356CONFIG_USB_ATM=m
5357CONFIG_USB_SPEEDTOUCH=m
5358CONFIG_USB_CXACRU=m
5359CONFIG_USB_UEAGLEATM=m
5360CONFIG_USB_XUSBATM=m
5361
5362#
5363# USB Physical Layer drivers
5364#
5365# CONFIG_USB_PHY is not set
5366# CONFIG_NOP_USB_XCEIV is not set
5367# CONFIG_USB_GPIO_VBUS is not set
5368# CONFIG_USB_ISP1301 is not set
5369CONFIG_USB_GADGET=m
5370# CONFIG_USB_GADGET_DEBUG is not set
5371# CONFIG_USB_GADGET_DEBUG_FILES is not set
5372CONFIG_USB_GADGET_VBUS_DRAW=2
5373CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
5374
5375#
5376# USB Peripheral Controller
5377#
5378# CONFIG_USB_FOTG210_UDC is not set
5379# CONFIG_USB_GR_UDC is not set
5380# CONFIG_USB_R8A66597 is not set
5381# CONFIG_USB_PXA27X is not set
5382# CONFIG_USB_MV_UDC is not set
5383# CONFIG_USB_MV_U3D is not set
5384# CONFIG_USB_M66592 is not set
5385# CONFIG_USB_BDC_UDC is not set
5386# CONFIG_USB_AMD5536UDC is not set
5387# CONFIG_USB_NET2272 is not set
5388CONFIG_USB_NET2280=m
5389# CONFIG_USB_GOKU is not set
5390CONFIG_USB_EG20T=m
5391# CONFIG_USB_DUMMY_HCD is not set
5392# CONFIG_USB_CONFIGFS is not set
5393# CONFIG_USB_ZERO is not set
5394# CONFIG_USB_AUDIO is not set
5395# CONFIG_USB_ETH is not set
5396# CONFIG_USB_G_NCM is not set
5397# CONFIG_USB_GADGETFS is not set
5398# CONFIG_USB_FUNCTIONFS is not set
5399# CONFIG_USB_MASS_STORAGE is not set
5400# CONFIG_USB_GADGET_TARGET is not set
5401# CONFIG_USB_G_SERIAL is not set
5402# CONFIG_USB_MIDI_GADGET is not set
5403# CONFIG_USB_G_PRINTER is not set
5404# CONFIG_USB_CDC_COMPOSITE is not set
5405# CONFIG_USB_G_NOKIA is not set
5406# CONFIG_USB_G_ACM_MS is not set
5407# CONFIG_USB_G_MULTI is not set
5408# CONFIG_USB_G_HID is not set
5409# CONFIG_USB_G_DBGP is not set
5410# CONFIG_USB_G_WEBCAM is not set
5411CONFIG_USB_LED_TRIG=y
5412CONFIG_UWB=m
5413CONFIG_UWB_HWA=m
5414CONFIG_UWB_WHCI=m
5415CONFIG_UWB_I1480U=m
5416CONFIG_MMC=m
5417# CONFIG_MMC_DEBUG is not set
5418
5419#
5420# MMC/SD/SDIO Card Drivers
5421#
5422CONFIG_MMC_BLOCK=m
5423CONFIG_MMC_BLOCK_MINORS=256
5424CONFIG_MMC_BLOCK_BOUNCE=y
5425CONFIG_SDIO_UART=m
5426# CONFIG_MMC_TEST is not set
5427
5428#
5429# MMC/SD/SDIO Host Controller Drivers
5430#
5431CONFIG_MMC_SDHCI=m
5432CONFIG_MMC_SDHCI_PCI=m
5433CONFIG_MMC_RICOH_MMC=y
5434CONFIG_MMC_SDHCI_ACPI=m
5435# CONFIG_MMC_SDHCI_PLTFM is not set
5436CONFIG_MMC_WBSD=m
5437CONFIG_MMC_TIFM_SD=m
5438# CONFIG_MMC_SPI is not set
5439CONFIG_MMC_SDRICOH_CS=m
5440CONFIG_MMC_CB710=m
5441CONFIG_MMC_VIA_SDMMC=m
5442CONFIG_MMC_VUB300=m
5443CONFIG_MMC_USHC=m
5444# CONFIG_MMC_USDHI6ROL0 is not set
5445CONFIG_MMC_REALTEK_PCI=m
5446CONFIG_MMC_REALTEK_USB=m
5447CONFIG_MMC_TOSHIBA_PCI=m
5448# CONFIG_MMC_MTK is not set
5449CONFIG_MEMSTICK=m
5450# CONFIG_MEMSTICK_DEBUG is not set
5451
5452#
5453# MemoryStick drivers
5454#
5455# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
5456CONFIG_MSPRO_BLOCK=m
5457# CONFIG_MS_BLOCK is not set
5458
5459#
5460# MemoryStick Host Controller Drivers
5461#
5462CONFIG_MEMSTICK_TIFM_MS=m
5463CONFIG_MEMSTICK_JMICRON_38X=m
5464CONFIG_MEMSTICK_R592=m
5465CONFIG_MEMSTICK_REALTEK_PCI=m
5466CONFIG_MEMSTICK_REALTEK_USB=m
5467CONFIG_NEW_LEDS=y
5468CONFIG_LEDS_CLASS=y
5469# CONFIG_LEDS_CLASS_FLASH is not set
5470
5471#
5472# LED drivers
5473#
5474# CONFIG_LEDS_LM3530 is not set
5475# CONFIG_LEDS_LM3642 is not set
5476# CONFIG_LEDS_PCA9532 is not set
5477# CONFIG_LEDS_GPIO is not set
5478CONFIG_LEDS_LP3944=m
5479# CONFIG_LEDS_LP5521 is not set
5480# CONFIG_LEDS_LP5523 is not set
5481# CONFIG_LEDS_LP5562 is not set
5482# CONFIG_LEDS_LP8501 is not set
5483# CONFIG_LEDS_LP8860 is not set
5484CONFIG_LEDS_CLEVO_MAIL=m
5485CONFIG_LEDS_PCA955X=m
5486# CONFIG_LEDS_PCA963X is not set
5487CONFIG_LEDS_DAC124S085=m
5488CONFIG_LEDS_BD2802=m
5489CONFIG_LEDS_INTEL_SS4200=m
5490CONFIG_LEDS_LT3593=m
5491CONFIG_LEDS_DELL_NETBOOKS=m
5492# CONFIG_LEDS_TCA6507 is not set
5493# CONFIG_LEDS_TLC591XX is not set
5494# CONFIG_LEDS_LM355x is not set
5495CONFIG_LEDS_MENF21BMC=m
5496
5497#
5498# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
5499#
5500# CONFIG_LEDS_BLINKM is not set
5501
5502#
5503# LED Triggers
5504#
5505CONFIG_LEDS_TRIGGERS=y
5506CONFIG_LEDS_TRIGGER_TIMER=m
5507CONFIG_LEDS_TRIGGER_ONESHOT=m
5508CONFIG_LEDS_TRIGGER_HEARTBEAT=m
5509CONFIG_LEDS_TRIGGER_BACKLIGHT=m
5510CONFIG_LEDS_TRIGGER_CPU=y
5511CONFIG_LEDS_TRIGGER_GPIO=m
5512CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
5513
5514#
5515# iptables trigger is under Netfilter config (LED target)
5516#
5517CONFIG_LEDS_TRIGGER_TRANSIENT=m
5518CONFIG_LEDS_TRIGGER_CAMERA=m
5519CONFIG_ACCESSIBILITY=y
5520CONFIG_A11Y_BRAILLE_CONSOLE=y
5521CONFIG_INFINIBAND=m
5522CONFIG_INFINIBAND_USER_MAD=m
5523CONFIG_INFINIBAND_USER_ACCESS=m
5524CONFIG_INFINIBAND_USER_MEM=y
5525CONFIG_INFINIBAND_ON_DEMAND_PAGING=y
5526CONFIG_INFINIBAND_ADDR_TRANS=y
5527CONFIG_INFINIBAND_MTHCA=m
5528CONFIG_INFINIBAND_MTHCA_DEBUG=y
5529CONFIG_INFINIBAND_QIB=m
5530CONFIG_INFINIBAND_QIB_DCA=y
5531CONFIG_INFINIBAND_CXGB3=m
5532# CONFIG_INFINIBAND_CXGB3_DEBUG is not set
5533CONFIG_INFINIBAND_CXGB4=m
5534CONFIG_MLX4_INFINIBAND=m
5535CONFIG_MLX5_INFINIBAND=m
5536CONFIG_INFINIBAND_NES=m
5537# CONFIG_INFINIBAND_NES_DEBUG is not set
5538CONFIG_INFINIBAND_OCRDMA=m
5539CONFIG_INFINIBAND_USNIC=m
5540CONFIG_INFINIBAND_IPOIB=m
5541CONFIG_INFINIBAND_IPOIB_CM=y
5542CONFIG_INFINIBAND_IPOIB_DEBUG=y
5543# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
5544CONFIG_INFINIBAND_SRP=m
5545CONFIG_INFINIBAND_SRPT=m
5546CONFIG_INFINIBAND_ISER=m
5547CONFIG_INFINIBAND_ISERT=m
5548CONFIG_EDAC_ATOMIC_SCRUB=y
5549CONFIG_EDAC_SUPPORT=y
5550CONFIG_EDAC=y
5551CONFIG_EDAC_LEGACY_SYSFS=y
5552# CONFIG_EDAC_DEBUG is not set
5553CONFIG_EDAC_DECODE_MCE=m
5554CONFIG_EDAC_MM_EDAC=m
5555CONFIG_EDAC_AMD64=m
5556# CONFIG_EDAC_AMD64_ERROR_INJECTION is not set
5557CONFIG_EDAC_E752X=m
5558CONFIG_EDAC_I82975X=m
5559CONFIG_EDAC_I3000=m
5560CONFIG_EDAC_I3200=m
5561CONFIG_EDAC_IE31200=m
5562CONFIG_EDAC_X38=m
5563CONFIG_EDAC_I5400=m
5564CONFIG_EDAC_I7CORE=m
5565CONFIG_EDAC_I5000=m
5566CONFIG_EDAC_I5100=m
5567CONFIG_EDAC_I7300=m
5568CONFIG_EDAC_SBRIDGE=m
5569CONFIG_RTC_LIB=y
5570CONFIG_RTC_CLASS=y
5571CONFIG_RTC_HCTOSYS=y
5572CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
5573CONFIG_RTC_SYSTOHC=y
5574CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
5575# CONFIG_RTC_DEBUG is not set
5576
5577#
5578# RTC interfaces
5579#
5580CONFIG_RTC_INTF_SYSFS=y
5581CONFIG_RTC_INTF_PROC=y
5582CONFIG_RTC_INTF_DEV=y
5583# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
5584# CONFIG_RTC_DRV_TEST is not set
5585
5586#
5587# I2C RTC drivers
5588#
5589# CONFIG_RTC_DRV_ABB5ZES3 is not set
5590# CONFIG_RTC_DRV_ABX80X is not set
5591# CONFIG_RTC_DRV_DS1307 is not set
5592# CONFIG_RTC_DRV_DS1374 is not set
5593# CONFIG_RTC_DRV_DS1672 is not set
5594# CONFIG_RTC_DRV_DS3232 is not set
5595# CONFIG_RTC_DRV_MAX6900 is not set
5596# CONFIG_RTC_DRV_RS5C372 is not set
5597# CONFIG_RTC_DRV_ISL1208 is not set
5598# CONFIG_RTC_DRV_ISL12022 is not set
5599# CONFIG_RTC_DRV_ISL12057 is not set
5600# CONFIG_RTC_DRV_X1205 is not set
5601# CONFIG_RTC_DRV_PCF2127 is not set
5602# CONFIG_RTC_DRV_PCF8523 is not set
5603# CONFIG_RTC_DRV_PCF8563 is not set
5604# CONFIG_RTC_DRV_PCF85063 is not set
5605# CONFIG_RTC_DRV_PCF8583 is not set
5606# CONFIG_RTC_DRV_M41T80 is not set
5607# CONFIG_RTC_DRV_BQ32K is not set
5608# CONFIG_RTC_DRV_S35390A is not set
5609# CONFIG_RTC_DRV_FM3130 is not set
5610# CONFIG_RTC_DRV_RX8581 is not set
5611# CONFIG_RTC_DRV_RX8025 is not set
5612# CONFIG_RTC_DRV_EM3027 is not set
5613# CONFIG_RTC_DRV_RV3029C2 is not set
5614# CONFIG_RTC_DRV_RV8803 is not set
5615
5616#
5617# SPI RTC drivers
5618#
5619# CONFIG_RTC_DRV_M41T93 is not set
5620# CONFIG_RTC_DRV_M41T94 is not set
5621# CONFIG_RTC_DRV_DS1305 is not set
5622# CONFIG_RTC_DRV_DS1343 is not set
5623# CONFIG_RTC_DRV_DS1347 is not set
5624# CONFIG_RTC_DRV_DS1390 is not set
5625# CONFIG_RTC_DRV_MAX6902 is not set
5626# CONFIG_RTC_DRV_R9701 is not set
5627# CONFIG_RTC_DRV_RS5C348 is not set
5628# CONFIG_RTC_DRV_DS3234 is not set
5629# CONFIG_RTC_DRV_PCF2123 is not set
5630# CONFIG_RTC_DRV_RX4581 is not set
5631# CONFIG_RTC_DRV_MCP795 is not set
5632
5633#
5634# Platform RTC drivers
5635#
5636CONFIG_RTC_DRV_CMOS=y
5637# CONFIG_RTC_DRV_DS1286 is not set
5638# CONFIG_RTC_DRV_DS1511 is not set
5639# CONFIG_RTC_DRV_DS1553 is not set
5640# CONFIG_RTC_DRV_DS1685_FAMILY is not set
5641# CONFIG_RTC_DRV_DS1742 is not set
5642# CONFIG_RTC_DRV_DS2404 is not set
5643# CONFIG_RTC_DRV_STK17TA8 is not set
5644# CONFIG_RTC_DRV_M48T86 is not set
5645# CONFIG_RTC_DRV_M48T35 is not set
5646# CONFIG_RTC_DRV_M48T59 is not set
5647# CONFIG_RTC_DRV_MSM6242 is not set
5648# CONFIG_RTC_DRV_BQ4802 is not set
5649# CONFIG_RTC_DRV_RP5C01 is not set
5650# CONFIG_RTC_DRV_V3020 is not set
5651
5652#
5653# on-CPU RTC drivers
5654#
5655
5656#
5657# HID Sensor RTC drivers
5658#
5659# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
5660CONFIG_DMADEVICES=y
5661# CONFIG_DMADEVICES_DEBUG is not set
5662
5663#
5664# DMA Devices
5665#
5666CONFIG_DMA_ENGINE=y
5667CONFIG_DMA_VIRTUAL_CHANNELS=m
5668CONFIG_DMA_ACPI=y
5669CONFIG_INTEL_IDMA64=m
5670CONFIG_INTEL_IOATDMA=m
5671CONFIG_INTEL_MIC_X100_DMA=m
5672CONFIG_DW_DMAC_CORE=m
5673CONFIG_DW_DMAC=m
5674# CONFIG_DW_DMAC_PCI is not set
5675
5676#
5677# DMA Clients
5678#
5679CONFIG_ASYNC_TX_DMA=y
5680# CONFIG_DMATEST is not set
5681CONFIG_DMA_ENGINE_RAID=y
5682CONFIG_DCA=m
5683# CONFIG_AUXDISPLAY is not set
5684CONFIG_UIO=m
5685CONFIG_UIO_CIF=m
5686# CONFIG_UIO_PDRV_GENIRQ is not set
5687# CONFIG_UIO_DMEM_GENIRQ is not set
5688CONFIG_UIO_AEC=m
5689CONFIG_UIO_SERCOS3=m
5690CONFIG_UIO_PCI_GENERIC=m
5691CONFIG_UIO_NETX=m
5692# CONFIG_UIO_PRUSS is not set
5693CONFIG_UIO_MF624=m
5694CONFIG_VFIO_IOMMU_TYPE1=m
5695CONFIG_VFIO_VIRQFD=m
5696CONFIG_VFIO=m
5697CONFIG_VFIO_PCI=m
5698CONFIG_VFIO_PCI_VGA=y
5699CONFIG_VFIO_PCI_MMAP=y
5700CONFIG_VFIO_PCI_INTX=y
5701CONFIG_IRQ_BYPASS_MANAGER=m
5702CONFIG_VIRT_DRIVERS=y
5703CONFIG_VIRTIO=m
5704
5705#
5706# Virtio drivers
5707#
5708CONFIG_VIRTIO_PCI=m
5709CONFIG_VIRTIO_PCI_LEGACY=y
5710CONFIG_VIRTIO_BALLOON=m
5711CONFIG_VIRTIO_INPUT=m
5712# CONFIG_VIRTIO_MMIO is not set
5713
5714#
5715# Microsoft Hyper-V guest support
5716#
5717CONFIG_HYPERV=m
5718CONFIG_HYPERV_UTILS=m
5719CONFIG_HYPERV_BALLOON=m
5720CONFIG_STAGING=y
5721# CONFIG_SLICOSS is not set
5722CONFIG_PRISM2_USB=m
5723CONFIG_COMEDI=m
5724# CONFIG_COMEDI_DEBUG is not set
5725CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB=2048
5726CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB=20480
5727CONFIG_COMEDI_MISC_DRIVERS=y
5728CONFIG_COMEDI_BOND=m
5729CONFIG_COMEDI_TEST=m
5730CONFIG_COMEDI_PARPORT=m
5731CONFIG_COMEDI_SERIAL2002=m
5732# CONFIG_COMEDI_ISA_DRIVERS is not set
5733CONFIG_COMEDI_PCI_DRIVERS=m
5734CONFIG_COMEDI_8255_PCI=m
5735CONFIG_COMEDI_ADDI_WATCHDOG=m
5736CONFIG_COMEDI_ADDI_APCI_1032=m
5737CONFIG_COMEDI_ADDI_APCI_1500=m
5738CONFIG_COMEDI_ADDI_APCI_1516=m
5739CONFIG_COMEDI_ADDI_APCI_1564=m
5740CONFIG_COMEDI_ADDI_APCI_16XX=m
5741CONFIG_COMEDI_ADDI_APCI_2032=m
5742CONFIG_COMEDI_ADDI_APCI_2200=m
5743CONFIG_COMEDI_ADDI_APCI_3120=m
5744CONFIG_COMEDI_ADDI_APCI_3501=m
5745CONFIG_COMEDI_ADDI_APCI_3XXX=m
5746CONFIG_COMEDI_ADL_PCI6208=m
5747CONFIG_COMEDI_ADL_PCI7X3X=m
5748CONFIG_COMEDI_ADL_PCI8164=m
5749CONFIG_COMEDI_ADL_PCI9111=m
5750CONFIG_COMEDI_ADL_PCI9118=m
5751CONFIG_COMEDI_ADV_PCI1710=m
5752CONFIG_COMEDI_ADV_PCI1723=m
5753CONFIG_COMEDI_ADV_PCI1724=m
5754CONFIG_COMEDI_ADV_PCI_DIO=m
5755CONFIG_COMEDI_AMPLC_DIO200_PCI=m
5756CONFIG_COMEDI_AMPLC_PC236_PCI=m
5757CONFIG_COMEDI_AMPLC_PC263_PCI=m
5758CONFIG_COMEDI_AMPLC_PCI224=m
5759CONFIG_COMEDI_AMPLC_PCI230=m
5760CONFIG_COMEDI_CONTEC_PCI_DIO=m
5761CONFIG_COMEDI_DAS08_PCI=m
5762CONFIG_COMEDI_DT3000=m
5763CONFIG_COMEDI_DYNA_PCI10XX=m
5764CONFIG_COMEDI_GSC_HPDI=m
5765CONFIG_COMEDI_MF6X4=m
5766CONFIG_COMEDI_ICP_MULTI=m
5767CONFIG_COMEDI_DAQBOARD2000=m
5768CONFIG_COMEDI_JR3_PCI=m
5769CONFIG_COMEDI_KE_COUNTER=m
5770CONFIG_COMEDI_CB_PCIDAS64=m
5771CONFIG_COMEDI_CB_PCIDAS=m
5772CONFIG_COMEDI_CB_PCIDDA=m
5773CONFIG_COMEDI_CB_PCIMDAS=m
5774CONFIG_COMEDI_CB_PCIMDDA=m
5775CONFIG_COMEDI_ME4000=m
5776CONFIG_COMEDI_ME_DAQ=m
5777CONFIG_COMEDI_NI_6527=m
5778CONFIG_COMEDI_NI_65XX=m
5779CONFIG_COMEDI_NI_660X=m
5780CONFIG_COMEDI_NI_670X=m
5781CONFIG_COMEDI_NI_LABPC_PCI=m
5782CONFIG_COMEDI_NI_PCIDIO=m
5783CONFIG_COMEDI_NI_PCIMIO=m
5784CONFIG_COMEDI_RTD520=m
5785CONFIG_COMEDI_S626=m
5786CONFIG_COMEDI_MITE=m
5787CONFIG_COMEDI_NI_TIOCMD=m
5788CONFIG_COMEDI_PCMCIA_DRIVERS=m
5789CONFIG_COMEDI_CB_DAS16_CS=m
5790CONFIG_COMEDI_DAS08_CS=m
5791CONFIG_COMEDI_NI_DAQ_700_CS=m
5792CONFIG_COMEDI_NI_DAQ_DIO24_CS=m
5793CONFIG_COMEDI_NI_LABPC_CS=m
5794CONFIG_COMEDI_NI_MIO_CS=m
5795CONFIG_COMEDI_QUATECH_DAQP_CS=m
5796CONFIG_COMEDI_USB_DRIVERS=m
5797CONFIG_COMEDI_DT9812=m
5798CONFIG_COMEDI_NI_USB6501=m
5799CONFIG_COMEDI_USBDUX=m
5800CONFIG_COMEDI_USBDUXFAST=m
5801CONFIG_COMEDI_USBDUXSIGMA=m
5802CONFIG_COMEDI_VMK80XX=m
5803CONFIG_COMEDI_8254=m
5804CONFIG_COMEDI_8255=m
5805CONFIG_COMEDI_8255_SA=m
5806CONFIG_COMEDI_KCOMEDILIB=m
5807CONFIG_COMEDI_AMPLC_DIO200=m
5808CONFIG_COMEDI_AMPLC_PC236=m
5809CONFIG_COMEDI_DAS08=m
5810CONFIG_COMEDI_NI_LABPC=m
5811CONFIG_COMEDI_NI_TIO=m
5812# CONFIG_PANEL is not set
5813CONFIG_RTL8192U=m
5814CONFIG_RTLLIB=m
5815CONFIG_RTLLIB_CRYPTO_CCMP=m
5816CONFIG_RTLLIB_CRYPTO_TKIP=m
5817CONFIG_RTLLIB_CRYPTO_WEP=m
5818CONFIG_RTL8192E=m
5819CONFIG_R8712U=m
5820CONFIG_R8188EU=m
5821CONFIG_88EU_AP_MODE=y
5822CONFIG_R8723AU=m
5823CONFIG_8723AU_AP_MODE=y
5824CONFIG_8723AU_BT_COEXIST=y
5825CONFIG_RTS5208=m
5826# CONFIG_VT6655 is not set
5827CONFIG_VT6656=m
5828
5829#
5830# IIO staging drivers
5831#
5832
5833#
5834# Accelerometers
5835#
5836# CONFIG_ADIS16201 is not set
5837# CONFIG_ADIS16203 is not set
5838# CONFIG_ADIS16204 is not set
5839# CONFIG_ADIS16209 is not set
5840# CONFIG_ADIS16220 is not set
5841# CONFIG_ADIS16240 is not set
5842# CONFIG_LIS3L02DQ is not set
5843# CONFIG_SCA3000 is not set
5844
5845#
5846# Analog to digital converters
5847#
5848# CONFIG_AD7606 is not set
5849# CONFIG_AD7780 is not set
5850# CONFIG_AD7816 is not set
5851# CONFIG_AD7192 is not set
5852# CONFIG_AD7280 is not set
5853
5854#
5855# Analog digital bi-direction converters
5856#
5857# CONFIG_ADT7316 is not set
5858
5859#
5860# Capacitance to digital converters
5861#
5862# CONFIG_AD7150 is not set
5863# CONFIG_AD7152 is not set
5864# CONFIG_AD7746 is not set
5865
5866#
5867# Direct Digital Synthesis
5868#
5869# CONFIG_AD9832 is not set
5870# CONFIG_AD9834 is not set
5871
5872#
5873# Digital gyroscope sensors
5874#
5875# CONFIG_ADIS16060 is not set
5876
5877#
5878# Network Analyzer, Impedance Converters
5879#
5880# CONFIG_AD5933 is not set
5881
5882#
5883# Light sensors
5884#
5885CONFIG_SENSORS_ISL29018=m
5886# CONFIG_SENSORS_ISL29028 is not set
5887CONFIG_TSL2583=m
5888# CONFIG_TSL2x7x is not set
5889
5890#
5891# Magnetometer sensors
5892#
5893# CONFIG_SENSORS_HMC5843_I2C is not set
5894# CONFIG_SENSORS_HMC5843_SPI is not set
5895
5896#
5897# Active energy metering IC
5898#
5899# CONFIG_ADE7753 is not set
5900# CONFIG_ADE7754 is not set
5901# CONFIG_ADE7758 is not set
5902# CONFIG_ADE7759 is not set
5903# CONFIG_ADE7854 is not set
5904
5905#
5906# Resolver to digital converters
5907#
5908# CONFIG_AD2S90 is not set
5909# CONFIG_AD2S1200 is not set
5910# CONFIG_AD2S1210 is not set
5911
5912#
5913# Triggers - standalone
5914#
5915# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set
5916# CONFIG_IIO_SIMPLE_DUMMY is not set
5917# CONFIG_FB_SM750 is not set
5918# CONFIG_FB_XGI is not set
5919
5920#
5921# Speakup console speech
5922#
5923CONFIG_SPEAKUP=m
5924CONFIG_SPEAKUP_SYNTH_ACNTSA=m
5925CONFIG_SPEAKUP_SYNTH_APOLLO=m
5926CONFIG_SPEAKUP_SYNTH_AUDPTR=m
5927CONFIG_SPEAKUP_SYNTH_BNS=m
5928CONFIG_SPEAKUP_SYNTH_DECTLK=m
5929CONFIG_SPEAKUP_SYNTH_DECEXT=m
5930CONFIG_SPEAKUP_SYNTH_LTLK=m
5931CONFIG_SPEAKUP_SYNTH_SOFT=m
5932CONFIG_SPEAKUP_SYNTH_SPKOUT=m
5933CONFIG_SPEAKUP_SYNTH_TXPRT=m
5934CONFIG_SPEAKUP_SYNTH_DUMMY=m
5935# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
5936CONFIG_STAGING_MEDIA=y
5937# CONFIG_I2C_BCM2048 is not set
5938# CONFIG_DVB_CXD2099 is not set
5939# CONFIG_DVB_MN88472 is not set
5940# CONFIG_DVB_MN88473 is not set
5941CONFIG_LIRC_STAGING=y
5942CONFIG_LIRC_BT829=m
5943CONFIG_LIRC_IMON=m
5944# CONFIG_LIRC_PARALLEL is not set
5945CONFIG_LIRC_SASEM=m
5946CONFIG_LIRC_SERIAL=m
5947CONFIG_LIRC_SERIAL_TRANSMITTER=y
5948CONFIG_LIRC_SIR=m
5949CONFIG_LIRC_ZILOG=m
5950# CONFIG_STAGING_RDMA is not set
5951
5952#
5953# Android
5954#
5955CONFIG_WIMAX_GDM72XX=m
5956# CONFIG_WIMAX_GDM72XX_QOS is not set
5957# CONFIG_WIMAX_GDM72XX_K_MODE is not set
5958# CONFIG_WIMAX_GDM72XX_WIMAX2 is not set
5959CONFIG_WIMAX_GDM72XX_USB=y
5960# CONFIG_WIMAX_GDM72XX_SDIO is not set
5961CONFIG_WIMAX_GDM72XX_USB_PM=y
5962# CONFIG_LTE_GDM724X is not set
5963# CONFIG_FIREWIRE_SERIAL is not set
5964# CONFIG_MTD_SPINAND_MT29F is not set
5965CONFIG_LUSTRE_FS=m
5966CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER=8192
5967# CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK is not set
5968CONFIG_LUSTRE_LLITE_LLOOP=m
5969CONFIG_LNET=m
5970CONFIG_LNET_MAX_PAYLOAD=1048576
5971# CONFIG_LNET_SELFTEST is not set
5972CONFIG_LNET_XPRT_IB=m
5973# CONFIG_DGNC is not set
5974# CONFIG_DGAP is not set
5975# CONFIG_GS_FPGABOOT is not set
5976# CONFIG_CRYPTO_SKEIN is not set
5977# CONFIG_UNISYSSPAR is not set
5978# CONFIG_FB_TFT is not set
5979# CONFIG_WILC1000_DRIVER is not set
5980# CONFIG_MOST is not set
5981CONFIG_X86_PLATFORM_DEVICES=y
5982CONFIG_ACER_WMI=m
5983CONFIG_ACERHDF=m
5984CONFIG_ALIENWARE_WMI=m
5985CONFIG_ASUS_LAPTOP=m
5986CONFIG_DELL_LAPTOP=m
5987CONFIG_DELL_WMI=m
5988CONFIG_DELL_WMI_AIO=m
5989CONFIG_DELL_SMO8800=m
5990CONFIG_DELL_RBTN=m
5991CONFIG_FUJITSU_LAPTOP=m
5992# CONFIG_FUJITSU_LAPTOP_DEBUG is not set
5993CONFIG_FUJITSU_TABLET=m
5994CONFIG_AMILO_RFKILL=m
5995CONFIG_HP_ACCEL=m
5996CONFIG_HP_WIRELESS=m
5997CONFIG_HP_WMI=m
5998CONFIG_MSI_LAPTOP=m
5999CONFIG_PANASONIC_LAPTOP=m
6000CONFIG_COMPAL_LAPTOP=m
6001CONFIG_SONY_LAPTOP=m
6002CONFIG_SONYPI_COMPAT=y
6003CONFIG_IDEAPAD_LAPTOP=m
6004CONFIG_THINKPAD_ACPI=m
6005CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y
6006# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
6007# CONFIG_THINKPAD_ACPI_DEBUG is not set
6008# CONFIG_THINKPAD_ACPI_UNSAFE_LEDS is not set
6009CONFIG_THINKPAD_ACPI_VIDEO=y
6010CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
6011CONFIG_SENSORS_HDAPS=m
6012# CONFIG_INTEL_MENLOW is not set
6013CONFIG_EEEPC_LAPTOP=m
6014CONFIG_ASUS_WMI=m
6015CONFIG_ASUS_NB_WMI=m
6016CONFIG_EEEPC_WMI=m
6017CONFIG_ACPI_WMI=m
6018CONFIG_MSI_WMI=m
6019CONFIG_TOPSTAR_LAPTOP=m
6020CONFIG_ACPI_TOSHIBA=m
6021CONFIG_TOSHIBA_BT_RFKILL=m
6022CONFIG_TOSHIBA_HAPS=m
6023# CONFIG_TOSHIBA_WMI is not set
6024CONFIG_ACPI_CMPC=m
6025CONFIG_INTEL_IPS=m
6026CONFIG_IBM_RTL=m
6027CONFIG_SAMSUNG_LAPTOP=m
6028CONFIG_MXM_WMI=m
6029CONFIG_INTEL_OAKTRAIL=m
6030CONFIG_SAMSUNG_Q10=m
6031CONFIG_APPLE_GMUX=m
6032CONFIG_INTEL_RST=m
6033CONFIG_INTEL_SMARTCONNECT=m
6034CONFIG_PVPANIC=m
6035CONFIG_INTEL_PMC_IPC=m
6036CONFIG_SURFACE_PRO3_BUTTON=m
6037CONFIG_CHROME_PLATFORMS=y
6038CONFIG_CHROMEOS_LAPTOP=m
6039CONFIG_CHROMEOS_PSTORE=m
6040CONFIG_CLKDEV_LOOKUP=y
6041CONFIG_HAVE_CLK_PREPARE=y
6042CONFIG_COMMON_CLK=y
6043
6044#
6045# Common Clock Framework
6046#
6047# CONFIG_COMMON_CLK_SI5351 is not set
6048# CONFIG_COMMON_CLK_PXA is not set
6049# CONFIG_COMMON_CLK_CDCE706 is not set
6050
6051#
6052# Hardware Spinlock drivers
6053#
6054
6055#
6056# Clock Source drivers
6057#
6058CONFIG_CLKEVT_I8253=y
6059CONFIG_I8253_LOCK=y
6060CONFIG_CLKBLD_I8253=y
6061# CONFIG_ATMEL_PIT is not set
6062# CONFIG_SH_TIMER_CMT is not set
6063# CONFIG_SH_TIMER_MTU2 is not set
6064# CONFIG_SH_TIMER_TMU is not set
6065# CONFIG_EM_TIMER_STI is not set
6066# CONFIG_MAILBOX is not set
6067CONFIG_IOMMU_API=y
6068CONFIG_IOMMU_SUPPORT=y
6069
6070#
6071# Generic IOMMU Pagetable Support
6072#
6073CONFIG_IOMMU_IOVA=y
6074CONFIG_AMD_IOMMU=y
6075CONFIG_AMD_IOMMU_V2=y
6076CONFIG_DMAR_TABLE=y
6077CONFIG_INTEL_IOMMU=y
6078CONFIG_INTEL_IOMMU_SVM=y
6079# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
6080CONFIG_INTEL_IOMMU_FLOPPY_WA=y
6081CONFIG_IRQ_REMAP=y
6082
6083#
6084# Remoteproc drivers
6085#
6086# CONFIG_STE_MODEM_RPROC is not set
6087
6088#
6089# Rpmsg drivers
6090#
6091
6092#
6093# SOC (System On Chip) specific Drivers
6094#
6095# CONFIG_SUNXI_SRAM is not set
6096# CONFIG_SOC_TI is not set
6097CONFIG_PM_DEVFREQ=y
6098
6099#
6100# DEVFREQ Governors
6101#
6102CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=m
6103# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set
6104# CONFIG_DEVFREQ_GOV_POWERSAVE is not set
6105# CONFIG_DEVFREQ_GOV_USERSPACE is not set
6106
6107#
6108# DEVFREQ Drivers
6109#
6110# CONFIG_PM_DEVFREQ_EVENT is not set
6111# CONFIG_EXTCON is not set
6112CONFIG_MEMORY=y
6113CONFIG_IIO=m
6114CONFIG_IIO_BUFFER=y
6115# CONFIG_IIO_BUFFER_CB is not set
6116CONFIG_IIO_KFIFO_BUF=m
6117CONFIG_IIO_TRIGGERED_BUFFER=m
6118CONFIG_IIO_TRIGGER=y
6119CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
6120
6121#
6122# Accelerometers
6123#
6124# CONFIG_BMA180 is not set
6125CONFIG_BMC150_ACCEL=m
6126CONFIG_BMC150_ACCEL_I2C=m
6127CONFIG_BMC150_ACCEL_SPI=m
6128CONFIG_HID_SENSOR_ACCEL_3D=m
6129# CONFIG_IIO_ST_ACCEL_3AXIS is not set
6130# CONFIG_KXSD9 is not set
6131CONFIG_KXCJK1013=m
6132# CONFIG_MMA8452 is not set
6133CONFIG_MMA9551_CORE=m
6134CONFIG_MMA9551=m
6135CONFIG_MMA9553=m
6136# CONFIG_MXC4005 is not set
6137# CONFIG_STK8312 is not set
6138# CONFIG_STK8BA50 is not set
6139
6140#
6141# Analog to digital converters
6142#
6143# CONFIG_AD7266 is not set
6144# CONFIG_AD7291 is not set
6145# CONFIG_AD7298 is not set
6146# CONFIG_AD7476 is not set
6147# CONFIG_AD7791 is not set
6148# CONFIG_AD7793 is not set
6149# CONFIG_AD7887 is not set
6150# CONFIG_AD7923 is not set
6151# CONFIG_AD799X is not set
6152# CONFIG_HI8435 is not set
6153# CONFIG_MAX1027 is not set
6154# CONFIG_MAX1363 is not set
6155# CONFIG_MCP320X is not set
6156# CONFIG_MCP3422 is not set
6157# CONFIG_NAU7802 is not set
6158# CONFIG_TI_ADC081C is not set
6159# CONFIG_TI_ADC128S052 is not set
6160CONFIG_VIPERBOARD_ADC=m
6161
6162#
6163# Amplifiers
6164#
6165# CONFIG_AD8366 is not set
6166
6167#
6168# Chemical Sensors
6169#
6170# CONFIG_VZ89X is not set
6171
6172#
6173# Hid Sensor IIO Common
6174#
6175CONFIG_HID_SENSOR_IIO_COMMON=m
6176CONFIG_HID_SENSOR_IIO_TRIGGER=m
6177
6178#
6179# SSP Sensor Common
6180#
6181# CONFIG_IIO_SSP_SENSORHUB is not set
6182
6183#
6184# Digital to analog converters
6185#
6186# CONFIG_AD5064 is not set
6187# CONFIG_AD5360 is not set
6188# CONFIG_AD5380 is not set
6189# CONFIG_AD5421 is not set
6190# CONFIG_AD5446 is not set
6191# CONFIG_AD5449 is not set
6192# CONFIG_AD5504 is not set
6193# CONFIG_AD5624R_SPI is not set
6194# CONFIG_AD5686 is not set
6195# CONFIG_AD5755 is not set
6196# CONFIG_AD5764 is not set
6197# CONFIG_AD5791 is not set
6198# CONFIG_AD7303 is not set
6199# CONFIG_M62332 is not set
6200# CONFIG_MAX517 is not set
6201# CONFIG_MCP4725 is not set
6202# CONFIG_MCP4922 is not set
6203
6204#
6205# Frequency Synthesizers DDS/PLL
6206#
6207
6208#
6209# Clock Generator/Distribution
6210#
6211# CONFIG_AD9523 is not set
6212
6213#
6214# Phase-Locked Loop (PLL) frequency synthesizers
6215#
6216# CONFIG_ADF4350 is not set
6217
6218#
6219# Digital gyroscope sensors
6220#
6221# CONFIG_ADIS16080 is not set
6222# CONFIG_ADIS16130 is not set
6223# CONFIG_ADIS16136 is not set
6224# CONFIG_ADIS16260 is not set
6225# CONFIG_ADXRS450 is not set
6226CONFIG_BMG160=m
6227CONFIG_BMG160_I2C=m
6228CONFIG_BMG160_SPI=m
6229CONFIG_HID_SENSOR_GYRO_3D=m
6230# CONFIG_IIO_ST_GYRO_3AXIS is not set
6231# CONFIG_ITG3200 is not set
6232
6233#
6234# Humidity sensors
6235#
6236# CONFIG_DHT11 is not set
6237# CONFIG_HDC100X is not set
6238# CONFIG_HTU21 is not set
6239# CONFIG_SI7005 is not set
6240# CONFIG_SI7020 is not set
6241
6242#
6243# Inertial measurement units
6244#
6245# CONFIG_ADIS16400 is not set
6246# CONFIG_ADIS16480 is not set
6247CONFIG_KMX61=m
6248CONFIG_INV_MPU6050_IIO=m
6249
6250#
6251# Light sensors
6252#
6253CONFIG_ACPI_ALS=m
6254# CONFIG_ADJD_S311 is not set
6255# CONFIG_AL3320A is not set
6256# CONFIG_APDS9300 is not set
6257# CONFIG_APDS9960 is not set
6258# CONFIG_BH1750 is not set
6259# CONFIG_CM32181 is not set
6260# CONFIG_CM3232 is not set
6261# CONFIG_CM3323 is not set
6262# CONFIG_CM36651 is not set
6263# CONFIG_GP2AP020A00F is not set
6264# CONFIG_ISL29125 is not set
6265CONFIG_HID_SENSOR_ALS=m
6266CONFIG_HID_SENSOR_PROX=m
6267CONFIG_JSA1212=m
6268# CONFIG_RPR0521 is not set
6269# CONFIG_LTR501 is not set
6270# CONFIG_OPT3001 is not set
6271# CONFIG_PA12203001 is not set
6272# CONFIG_STK3310 is not set
6273# CONFIG_TCS3414 is not set
6274# CONFIG_TCS3472 is not set
6275CONFIG_SENSORS_TSL2563=m
6276# CONFIG_TSL4531 is not set
6277# CONFIG_US5182D is not set
6278# CONFIG_VCNL4000 is not set
6279
6280#
6281# Magnetometer sensors
6282#
6283CONFIG_AK8975=m
6284# CONFIG_AK09911 is not set
6285# CONFIG_BMC150_MAGN is not set
6286# CONFIG_MAG3110 is not set
6287CONFIG_HID_SENSOR_MAGNETOMETER_3D=m
6288# CONFIG_MMC35240 is not set
6289# CONFIG_IIO_ST_MAGN_3AXIS is not set
6290
6291#
6292# Inclinometer sensors
6293#
6294CONFIG_HID_SENSOR_INCLINOMETER_3D=m
6295CONFIG_HID_SENSOR_DEVICE_ROTATION=m
6296
6297#
6298# Triggers - standalone
6299#
6300# CONFIG_IIO_INTERRUPT_TRIGGER is not set
6301# CONFIG_IIO_SYSFS_TRIGGER is not set
6302
6303#
6304# Digital potentiometers
6305#
6306# CONFIG_MCP4531 is not set
6307
6308#
6309# Pressure sensors
6310#
6311CONFIG_BMP280=m
6312CONFIG_HID_SENSOR_PRESS=m
6313# CONFIG_MPL115 is not set
6314# CONFIG_MPL3115 is not set
6315# CONFIG_MS5611 is not set
6316# CONFIG_MS5637 is not set
6317# CONFIG_IIO_ST_PRESS is not set
6318# CONFIG_T5403 is not set
6319
6320#
6321# Lightning sensors
6322#
6323# CONFIG_AS3935 is not set
6324
6325#
6326# Proximity sensors
6327#
6328# CONFIG_LIDAR_LITE_V2 is not set
6329CONFIG_SX9500=m
6330
6331#
6332# Temperature sensors
6333#
6334# CONFIG_MLX90614 is not set
6335# CONFIG_TMP006 is not set
6336# CONFIG_TSYS01 is not set
6337# CONFIG_TSYS02D is not set
6338# CONFIG_NTB is not set
6339# CONFIG_VME_BUS is not set
6340# CONFIG_PWM is not set
6341# CONFIG_IPACK_BUS is not set
6342# CONFIG_RESET_CONTROLLER is not set
6343# CONFIG_FMC is not set
6344
6345#
6346# PHY Subsystem
6347#
6348CONFIG_GENERIC_PHY=y
6349# CONFIG_PHY_PXA_28NM_HSIC is not set
6350# CONFIG_PHY_PXA_28NM_USB2 is not set
6351# CONFIG_BCM_KONA_USB2_PHY is not set
6352CONFIG_POWERCAP=y
6353CONFIG_INTEL_RAPL=m
6354# CONFIG_MCB is not set
6355
6356#
6357# Performance monitor support
6358#
6359CONFIG_RAS=y
6360CONFIG_THUNDERBOLT=m
6361
6362#
6363# Android
6364#
6365# CONFIG_ANDROID is not set
6366CONFIG_LIBNVDIMM=m
6367CONFIG_BLK_DEV_PMEM=m
6368CONFIG_ND_BLK=m
6369CONFIG_ND_CLAIM=y
6370CONFIG_ND_BTT=m
6371CONFIG_BTT=y
6372CONFIG_ND_PFN=m
6373CONFIG_NVDIMM_PFN=y
6374# CONFIG_NVMEM is not set
6375# CONFIG_STM is not set
6376# CONFIG_STM_DUMMY is not set
6377# CONFIG_STM_SOURCE_CONSOLE is not set
6378# CONFIG_INTEL_TH is not set
6379
6380#
6381# FPGA Configuration Support
6382#
6383# CONFIG_FPGA is not set
6384
6385#
6386# Firmware Drivers
6387#
6388CONFIG_EDD=m
6389# CONFIG_EDD_OFF is not set
6390CONFIG_FIRMWARE_MEMMAP=y
6391CONFIG_DELL_RBU=m
6392CONFIG_DCDBAS=m
6393CONFIG_DMIID=y
6394CONFIG_DMI_SYSFS=y
6395CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
6396CONFIG_ISCSI_IBFT_FIND=y
6397CONFIG_ISCSI_IBFT=m
6398# CONFIG_GOOGLE_FIRMWARE is not set
6399
6400#
6401# EFI (Extensible Firmware Interface) Support
6402#
6403CONFIG_EFI_VARS=m
6404CONFIG_EFI_ESRT=y
6405CONFIG_EFI_VARS_PSTORE=m
6406# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set
6407# CONFIG_EFI_FAKE_MEMMAP is not set
6408CONFIG_EFI_RUNTIME_WRAPPERS=y
6409CONFIG_UEFI_CPER=y
6410
6411#
6412# File systems
6413#
6414CONFIG_DCACHE_WORD_ACCESS=y
6415# CONFIG_EXT2_FS is not set
6416# CONFIG_EXT3_FS is not set
6417CONFIG_EXT4_FS=m
6418CONFIG_EXT4_USE_FOR_EXT2=y
6419CONFIG_EXT4_FS_POSIX_ACL=y
6420CONFIG_EXT4_FS_SECURITY=y
6421CONFIG_EXT4_ENCRYPTION=m
6422CONFIG_EXT4_FS_ENCRYPTION=y
6423# CONFIG_EXT4_DEBUG is not set
6424CONFIG_JBD2=m
6425# CONFIG_JBD2_DEBUG is not set
6426CONFIG_FS_MBCACHE=m
6427CONFIG_REISERFS_FS=m
6428# CONFIG_REISERFS_CHECK is not set
6429# CONFIG_REISERFS_PROC_INFO is not set
6430CONFIG_REISERFS_FS_XATTR=y
6431CONFIG_REISERFS_FS_POSIX_ACL=y
6432CONFIG_REISERFS_FS_SECURITY=y
6433CONFIG_JFS_FS=m
6434CONFIG_JFS_POSIX_ACL=y
6435CONFIG_JFS_SECURITY=y
6436# CONFIG_JFS_DEBUG is not set
6437# CONFIG_JFS_STATISTICS is not set
6438CONFIG_XFS_FS=m
6439CONFIG_XFS_QUOTA=y
6440CONFIG_XFS_POSIX_ACL=y
6441CONFIG_XFS_RT=y
6442# CONFIG_XFS_WARN is not set
6443# CONFIG_XFS_DEBUG is not set
6444CONFIG_GFS2_FS=m
6445CONFIG_GFS2_FS_LOCKING_DLM=y
6446CONFIG_OCFS2_FS=m
6447CONFIG_OCFS2_FS_O2CB=m
6448CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
6449CONFIG_OCFS2_DEBUG_MASKLOG=y
6450# CONFIG_OCFS2_DEBUG_FS is not set
6451CONFIG_BTRFS_FS=m
6452CONFIG_BTRFS_FS_POSIX_ACL=y
6453# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
6454# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
6455# CONFIG_BTRFS_DEBUG is not set
6456# CONFIG_BTRFS_ASSERT is not set
6457CONFIG_NILFS2_FS=m
6458CONFIG_F2FS_FS=m
6459CONFIG_F2FS_FS_XATTR=y
6460CONFIG_F2FS_FS_POSIX_ACL=y
6461CONFIG_F2FS_FS_SECURITY=y
6462# CONFIG_F2FS_CHECK_FS is not set
6463CONFIG_F2FS_FS_ENCRYPTION=y
6464CONFIG_FS_DAX=y
6465CONFIG_FS_POSIX_ACL=y
6466CONFIG_EXPORTFS=y
6467CONFIG_FILE_LOCKING=y
6468CONFIG_FSNOTIFY=y
6469CONFIG_DNOTIFY=y
6470CONFIG_INOTIFY_USER=y
6471CONFIG_FANOTIFY=y
6472# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set
6473CONFIG_QUOTA=y
6474CONFIG_QUOTA_NETLINK_INTERFACE=y
6475CONFIG_PRINT_QUOTA_WARNING=y
6476# CONFIG_QUOTA_DEBUG is not set
6477CONFIG_QUOTA_TREE=m
6478CONFIG_QFMT_V1=m
6479CONFIG_QFMT_V2=m
6480CONFIG_QUOTACTL=y
6481CONFIG_QUOTACTL_COMPAT=y
6482CONFIG_AUTOFS4_FS=m
6483CONFIG_FUSE_FS=m
6484CONFIG_CUSE=m
6485CONFIG_OVERLAY_FS=m
6486
6487#
6488# Caches
6489#
6490CONFIG_FSCACHE=m
6491CONFIG_FSCACHE_STATS=y
6492# CONFIG_FSCACHE_HISTOGRAM is not set
6493# CONFIG_FSCACHE_DEBUG is not set
6494# CONFIG_FSCACHE_OBJECT_LIST is not set
6495CONFIG_CACHEFILES=m
6496# CONFIG_CACHEFILES_DEBUG is not set
6497# CONFIG_CACHEFILES_HISTOGRAM is not set
6498
6499#
6500# CD-ROM/DVD Filesystems
6501#
6502CONFIG_ISO9660_FS=m
6503CONFIG_JOLIET=y
6504CONFIG_ZISOFS=y
6505CONFIG_UDF_FS=m
6506CONFIG_UDF_NLS=y
6507
6508#
6509# DOS/FAT/NT Filesystems
6510#
6511CONFIG_FAT_FS=m
6512CONFIG_MSDOS_FS=m
6513CONFIG_VFAT_FS=m
6514CONFIG_FAT_DEFAULT_CODEPAGE=437
6515CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
6516CONFIG_NTFS_FS=m
6517# CONFIG_NTFS_DEBUG is not set
6518CONFIG_NTFS_RW=y
6519
6520#
6521# Pseudo filesystems
6522#
6523CONFIG_PROC_FS=y
6524CONFIG_PROC_SYSCTL=y
6525# CONFIG_PROC_CHILDREN is not set
6526CONFIG_KERNFS=y
6527CONFIG_SYSFS=y
6528CONFIG_TMPFS=y
6529CONFIG_TMPFS_POSIX_ACL=y
6530CONFIG_TMPFS_XATTR=y
6531CONFIG_HUGETLBFS=y
6532CONFIG_HUGETLB_PAGE=y
6533CONFIG_CONFIGFS_FS=m
6534CONFIG_EFIVAR_FS=m
6535CONFIG_MISC_FILESYSTEMS=y
6536CONFIG_ADFS_FS=m
6537# CONFIG_ADFS_FS_RW is not set
6538CONFIG_AFFS_FS=m
6539CONFIG_ECRYPT_FS=m
6540CONFIG_ECRYPT_FS_MESSAGING=y
6541CONFIG_HFS_FS=m
6542CONFIG_HFSPLUS_FS=m
6543# CONFIG_HFSPLUS_FS_POSIX_ACL is not set
6544CONFIG_BEFS_FS=m
6545# CONFIG_BEFS_DEBUG is not set
6546CONFIG_BFS_FS=m
6547CONFIG_EFS_FS=m
6548CONFIG_JFFS2_FS=m
6549CONFIG_JFFS2_FS_DEBUG=0
6550CONFIG_JFFS2_FS_WRITEBUFFER=y
6551# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
6552CONFIG_JFFS2_SUMMARY=y
6553CONFIG_JFFS2_FS_XATTR=y
6554CONFIG_JFFS2_FS_POSIX_ACL=y
6555CONFIG_JFFS2_FS_SECURITY=y
6556CONFIG_JFFS2_COMPRESSION_OPTIONS=y
6557CONFIG_JFFS2_ZLIB=y
6558CONFIG_JFFS2_LZO=y
6559CONFIG_JFFS2_RTIME=y
6560# CONFIG_JFFS2_RUBIN is not set
6561# CONFIG_JFFS2_CMODE_NONE is not set
6562CONFIG_JFFS2_CMODE_PRIORITY=y
6563# CONFIG_JFFS2_CMODE_SIZE is not set
6564# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
6565CONFIG_UBIFS_FS=m
6566CONFIG_UBIFS_FS_ADVANCED_COMPR=y
6567CONFIG_UBIFS_FS_LZO=y
6568CONFIG_UBIFS_FS_ZLIB=y
6569# CONFIG_UBIFS_ATIME_SUPPORT is not set
6570CONFIG_LOGFS=m
6571# CONFIG_CRAMFS is not set
6572CONFIG_SQUASHFS=m
6573CONFIG_SQUASHFS_FILE_CACHE=y
6574# CONFIG_SQUASHFS_FILE_DIRECT is not set
6575CONFIG_SQUASHFS_DECOMP_SINGLE=y
6576# CONFIG_SQUASHFS_DECOMP_MULTI is not set
6577# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set
6578CONFIG_SQUASHFS_XATTR=y
6579CONFIG_SQUASHFS_ZLIB=y
6580# CONFIG_SQUASHFS_LZ4 is not set
6581CONFIG_SQUASHFS_LZO=y
6582CONFIG_SQUASHFS_XZ=y
6583# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
6584# CONFIG_SQUASHFS_EMBEDDED is not set
6585CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
6586CONFIG_VXFS_FS=m
6587CONFIG_MINIX_FS=m
6588CONFIG_OMFS_FS=m
6589# CONFIG_HPFS_FS is not set
6590CONFIG_QNX4FS_FS=m
6591CONFIG_QNX6FS_FS=m
6592# CONFIG_QNX6FS_DEBUG is not set
6593CONFIG_ROMFS_FS=m
6594# CONFIG_ROMFS_BACKED_BY_BLOCK is not set
6595# CONFIG_ROMFS_BACKED_BY_MTD is not set
6596CONFIG_ROMFS_BACKED_BY_BOTH=y
6597CONFIG_ROMFS_ON_BLOCK=y
6598CONFIG_ROMFS_ON_MTD=y
6599CONFIG_PSTORE=y
6600# CONFIG_PSTORE_CONSOLE is not set
6601# CONFIG_PSTORE_PMSG is not set
6602CONFIG_PSTORE_RAM=m
6603CONFIG_SYSV_FS=m
6604CONFIG_UFS_FS=m
6605# CONFIG_UFS_FS_WRITE is not set
6606# CONFIG_UFS_DEBUG is not set
6607CONFIG_EXOFS_FS=m
6608# CONFIG_EXOFS_DEBUG is not set
6609CONFIG_ORE=m
6610CONFIG_NETWORK_FILESYSTEMS=y
6611CONFIG_NFS_FS=m
6612CONFIG_NFS_V2=m
6613CONFIG_NFS_V3=m
6614CONFIG_NFS_V3_ACL=y
6615CONFIG_NFS_V4=m
6616CONFIG_NFS_SWAP=y
6617CONFIG_NFS_V4_1=y
6618CONFIG_NFS_V4_2=y
6619CONFIG_PNFS_FILE_LAYOUT=m
6620CONFIG_PNFS_BLOCK=m
6621CONFIG_PNFS_OBJLAYOUT=m
6622CONFIG_PNFS_FLEXFILE_LAYOUT=m
6623CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
6624# CONFIG_NFS_V4_1_MIGRATION is not set
6625CONFIG_NFS_V4_SECURITY_LABEL=y
6626CONFIG_NFS_FSCACHE=y
6627# CONFIG_NFS_USE_LEGACY_DNS is not set
6628CONFIG_NFS_USE_KERNEL_DNS=y
6629CONFIG_NFSD=m
6630CONFIG_NFSD_V2_ACL=y
6631CONFIG_NFSD_V3=y
6632CONFIG_NFSD_V3_ACL=y
6633CONFIG_NFSD_V4=y
6634CONFIG_NFSD_PNFS=y
6635CONFIG_NFSD_V4_SECURITY_LABEL=y
6636CONFIG_GRACE_PERIOD=m
6637CONFIG_LOCKD=m
6638CONFIG_LOCKD_V4=y
6639CONFIG_NFS_ACL_SUPPORT=m
6640CONFIG_NFS_COMMON=y
6641CONFIG_SUNRPC=m
6642CONFIG_SUNRPC_GSS=m
6643CONFIG_SUNRPC_BACKCHANNEL=y
6644CONFIG_SUNRPC_SWAP=y
6645CONFIG_RPCSEC_GSS_KRB5=m
6646CONFIG_SUNRPC_XPRT_RDMA=m
6647CONFIG_CEPH_FS=m
6648CONFIG_CEPH_FSCACHE=y
6649CONFIG_CEPH_FS_POSIX_ACL=y
6650CONFIG_CIFS=m
6651# CONFIG_CIFS_STATS is not set
6652CONFIG_CIFS_WEAK_PW_HASH=y
6653CONFIG_CIFS_UPCALL=y
6654CONFIG_CIFS_XATTR=y
6655CONFIG_CIFS_POSIX=y
6656CONFIG_CIFS_ACL=y
6657CONFIG_CIFS_DEBUG=y
6658# CONFIG_CIFS_DEBUG2 is not set
6659CONFIG_CIFS_DFS_UPCALL=y
6660CONFIG_CIFS_SMB2=y
6661# CONFIG_CIFS_SMB311 is not set
6662CONFIG_CIFS_FSCACHE=y
6663CONFIG_NCP_FS=m
6664CONFIG_NCPFS_PACKET_SIGNING=y
6665CONFIG_NCPFS_IOCTL_LOCKING=y
6666CONFIG_NCPFS_STRONG=y
6667CONFIG_NCPFS_NFS_NS=y
6668CONFIG_NCPFS_OS2_NS=y
6669# CONFIG_NCPFS_SMALLDOS is not set
6670CONFIG_NCPFS_NLS=y
6671CONFIG_NCPFS_EXTRAS=y
6672CONFIG_CODA_FS=m
6673CONFIG_AFS_FS=m
6674# CONFIG_AFS_DEBUG is not set
6675CONFIG_AFS_FSCACHE=y
6676CONFIG_9P_FS=m
6677CONFIG_9P_FSCACHE=y
6678CONFIG_9P_FS_POSIX_ACL=y
6679CONFIG_9P_FS_SECURITY=y
6680CONFIG_NLS=y
6681CONFIG_NLS_DEFAULT="utf8"
6682CONFIG_NLS_CODEPAGE_437=m
6683CONFIG_NLS_CODEPAGE_737=m
6684CONFIG_NLS_CODEPAGE_775=m
6685CONFIG_NLS_CODEPAGE_850=m
6686CONFIG_NLS_CODEPAGE_852=m
6687CONFIG_NLS_CODEPAGE_855=m
6688CONFIG_NLS_CODEPAGE_857=m
6689CONFIG_NLS_CODEPAGE_860=m
6690CONFIG_NLS_CODEPAGE_861=m
6691CONFIG_NLS_CODEPAGE_862=m
6692CONFIG_NLS_CODEPAGE_863=m
6693CONFIG_NLS_CODEPAGE_864=m
6694CONFIG_NLS_CODEPAGE_865=m
6695CONFIG_NLS_CODEPAGE_866=m
6696CONFIG_NLS_CODEPAGE_869=m
6697CONFIG_NLS_CODEPAGE_936=m
6698CONFIG_NLS_CODEPAGE_950=m
6699CONFIG_NLS_CODEPAGE_932=m
6700CONFIG_NLS_CODEPAGE_949=m
6701CONFIG_NLS_CODEPAGE_874=m
6702CONFIG_NLS_ISO8859_8=m
6703CONFIG_NLS_CODEPAGE_1250=m
6704CONFIG_NLS_CODEPAGE_1251=m
6705CONFIG_NLS_ASCII=m
6706CONFIG_NLS_ISO8859_1=m
6707CONFIG_NLS_ISO8859_2=m
6708CONFIG_NLS_ISO8859_3=m
6709CONFIG_NLS_ISO8859_4=m
6710CONFIG_NLS_ISO8859_5=m
6711CONFIG_NLS_ISO8859_6=m
6712CONFIG_NLS_ISO8859_7=m
6713CONFIG_NLS_ISO8859_9=m
6714CONFIG_NLS_ISO8859_13=m
6715CONFIG_NLS_ISO8859_14=m
6716CONFIG_NLS_ISO8859_15=m
6717CONFIG_NLS_KOI8_R=m
6718CONFIG_NLS_KOI8_U=m
6719CONFIG_NLS_MAC_ROMAN=m
6720CONFIG_NLS_MAC_CELTIC=m
6721CONFIG_NLS_MAC_CENTEURO=m
6722CONFIG_NLS_MAC_CROATIAN=m
6723CONFIG_NLS_MAC_CYRILLIC=m
6724CONFIG_NLS_MAC_GAELIC=m
6725CONFIG_NLS_MAC_GREEK=m
6726CONFIG_NLS_MAC_ICELAND=m
6727CONFIG_NLS_MAC_INUIT=m
6728CONFIG_NLS_MAC_ROMANIAN=m
6729CONFIG_NLS_MAC_TURKISH=m
6730CONFIG_NLS_UTF8=m
6731CONFIG_DLM=m
6732CONFIG_DLM_DEBUG=y
6733
6734#
6735# Kernel hacking
6736#
6737CONFIG_TRACE_IRQFLAGS_SUPPORT=y
6738
6739#
6740# printk and dmesg options
6741#
6742CONFIG_PRINTK_TIME=y
6743CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
6744CONFIG_BOOT_PRINTK_DELAY=y
6745
6746#
6747# Compile-time checks and compiler options
6748#
6749# CONFIG_DEBUG_INFO is not set
6750CONFIG_ENABLE_WARN_DEPRECATED=y
6751CONFIG_ENABLE_MUST_CHECK=y
6752CONFIG_FRAME_WARN=2048
6753CONFIG_STRIP_ASM_SYMS=y
6754# CONFIG_READABLE_ASM is not set
6755CONFIG_UNUSED_SYMBOLS=y
6756# CONFIG_HEADERS_CHECK is not set
6757# CONFIG_DEBUG_SECTION_MISMATCH is not set
6758CONFIG_SECTION_MISMATCH_WARN_ONLY=y
6759CONFIG_ARCH_WANT_FRAME_POINTERS=y
6760# CONFIG_FRAME_POINTER is not set
6761# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
6762CONFIG_MAGIC_SYSRQ=y
6763CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x01b6
6764CONFIG_DEBUG_KERNEL=y
6765
6766#
6767# Memory Debugging
6768#
6769# CONFIG_PAGE_EXTENSION is not set
6770# CONFIG_DEBUG_OBJECTS is not set
6771# CONFIG_DEBUG_SLAB is not set
6772CONFIG_HAVE_DEBUG_KMEMLEAK=y
6773# CONFIG_DEBUG_STACK_USAGE is not set
6774# CONFIG_DEBUG_VM is not set
6775# CONFIG_DEBUG_VIRTUAL is not set
6776CONFIG_DEBUG_MEMORY_INIT=y
6777# CONFIG_DEBUG_PER_CPU_MAPS is not set
6778CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
6779# CONFIG_DEBUG_STACKOVERFLOW is not set
6780CONFIG_HAVE_ARCH_KMEMCHECK=y
6781# CONFIG_KMEMCHECK is not set
6782CONFIG_HAVE_ARCH_KASAN=y
6783# CONFIG_DEBUG_SHIRQ is not set
6784
6785#
6786# Debug Lockups and Hangs
6787#
6788CONFIG_LOCKUP_DETECTOR=y
6789CONFIG_HARDLOCKUP_DETECTOR=y
6790# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
6791CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
6792# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
6793CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
6794CONFIG_DETECT_HUNG_TASK=y
6795CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
6796# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
6797CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
6798# CONFIG_PANIC_ON_OOPS is not set
6799CONFIG_PANIC_ON_OOPS_VALUE=0
6800CONFIG_PANIC_TIMEOUT=0
6801CONFIG_SCHED_DEBUG=y
6802CONFIG_SCHED_INFO=y
6803# CONFIG_SCHEDSTATS is not set
6804CONFIG_SCHED_STACK_END_CHECK=y
6805# CONFIG_DEBUG_TIMEKEEPING is not set
6806CONFIG_TIMER_STATS=y
6807
6808#
6809# Lock Debugging (spinlocks, mutexes, etc...)
6810#
6811# CONFIG_DEBUG_RT_MUTEXES is not set
6812# CONFIG_DEBUG_SPINLOCK is not set
6813# CONFIG_DEBUG_MUTEXES is not set
6814# CONFIG_DEBUG_ATOMIC_SLEEP is not set
6815# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
6816# CONFIG_LOCK_TORTURE_TEST is not set
6817# CONFIG_STACKTRACE is not set
6818# CONFIG_DEBUG_KOBJECT is not set
6819CONFIG_DEBUG_BUGVERBOSE=y
6820CONFIG_DEBUG_LIST=y
6821# CONFIG_DEBUG_PI_LIST is not set
6822# CONFIG_DEBUG_SG is not set
6823# CONFIG_DEBUG_NOTIFIERS is not set
6824# CONFIG_DEBUG_CREDENTIALS is not set
6825
6826#
6827# RCU Debugging
6828#
6829# CONFIG_PROVE_RCU is not set
6830# CONFIG_SPARSE_RCU_POINTER is not set
6831# CONFIG_TORTURE_TEST is not set
6832# CONFIG_RCU_TORTURE_TEST is not set
6833CONFIG_RCU_CPU_STALL_TIMEOUT=21
6834# CONFIG_RCU_TRACE is not set
6835# CONFIG_RCU_EQS_DEBUG is not set
6836# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
6837# CONFIG_FAULT_INJECTION is not set
6838CONFIG_ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS=y
6839CONFIG_USER_STACKTRACE_SUPPORT=y
6840CONFIG_HAVE_FUNCTION_TRACER=y
6841CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
6842CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
6843CONFIG_HAVE_DYNAMIC_FTRACE=y
6844CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
6845CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
6846CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
6847CONFIG_HAVE_FENTRY=y
6848CONFIG_HAVE_C_RECORDMCOUNT=y
6849CONFIG_TRACE_CLOCK=y
6850CONFIG_RING_BUFFER=y
6851CONFIG_RING_BUFFER_ALLOW_SWAP=y
6852
6853#
6854# Runtime Testing
6855#
6856# CONFIG_TEST_LIST_SORT is not set
6857# CONFIG_KPROBES_SANITY_TEST is not set
6858# CONFIG_BACKTRACE_SELF_TEST is not set
6859# CONFIG_RBTREE_TEST is not set
6860# CONFIG_INTERVAL_TREE_TEST is not set
6861# CONFIG_PERCPU_TEST is not set
6862# CONFIG_ATOMIC64_SELFTEST is not set
6863# CONFIG_ASYNC_RAID6_TEST is not set
6864# CONFIG_TEST_HEXDUMP is not set
6865# CONFIG_TEST_STRING_HELPERS is not set
6866# CONFIG_TEST_KSTRTOX is not set
6867# CONFIG_TEST_PRINTF is not set
6868# CONFIG_TEST_RHASHTABLE is not set
6869# CONFIG_DMA_API_DEBUG is not set
6870# CONFIG_TEST_LKM is not set
6871CONFIG_TEST_USER_COPY=m
6872CONFIG_TEST_BPF=m
6873CONFIG_TEST_FIRMWARE=m
6874# CONFIG_TEST_UDELAY is not set
6875CONFIG_MEMTEST=y
6876CONFIG_TEST_STATIC_KEYS=m
6877# CONFIG_SAMPLES is not set
6878CONFIG_HAVE_ARCH_KGDB=y
6879# CONFIG_KGDB is not set
6880CONFIG_STRICT_DEVMEM=y
6881# CONFIG_X86_VERBOSE_BOOTUP is not set
6882CONFIG_EARLY_PRINTK=y
6883# CONFIG_EARLY_PRINTK_DBGP is not set
6884CONFIG_EARLY_PRINTK_EFI=y
6885# CONFIG_X86_PTDUMP_CORE is not set
6886# CONFIG_EFI_PGT_DUMP is not set
6887# CONFIG_DEBUG_NX_TEST is not set
6888CONFIG_DOUBLEFAULT=y
6889# CONFIG_DEBUG_TLBFLUSH is not set
6890# CONFIG_IOMMU_DEBUG is not set
6891# CONFIG_IOMMU_STRESS is not set
6892CONFIG_HAVE_MMIOTRACE_SUPPORT=y
6893# CONFIG_X86_DECODER_SELFTEST is not set
6894CONFIG_IO_DELAY_TYPE_0X80=0
6895CONFIG_IO_DELAY_TYPE_0XED=1
6896CONFIG_IO_DELAY_TYPE_UDELAY=2
6897CONFIG_IO_DELAY_TYPE_NONE=3
6898CONFIG_IO_DELAY_0X80=y
6899# CONFIG_IO_DELAY_0XED is not set
6900# CONFIG_IO_DELAY_UDELAY is not set
6901# CONFIG_IO_DELAY_NONE is not set
6902CONFIG_DEFAULT_IO_DELAY_TYPE=0
6903# CONFIG_CPA_DEBUG is not set
6904CONFIG_OPTIMIZE_INLINING=y
6905# CONFIG_DEBUG_ENTRY is not set
6906# CONFIG_DEBUG_NMI_SELFTEST is not set
6907# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set
6908CONFIG_X86_DEBUG_FPU=y
6909
6910#
6911# Security options
6912#
6913
6914#
6915# Grsecurity
6916#
6917CONFIG_PAX_KERNEXEC_PLUGIN=y
6918CONFIG_PAX_PER_CPU_PGD=y
6919CONFIG_TASK_SIZE_MAX_SHIFT=42
6920CONFIG_PAX_USERCOPY_SLABS=y
6921CONFIG_GRKERNSEC=y
6922# CONFIG_GRKERNSEC_CONFIG_AUTO is not set
6923CONFIG_GRKERNSEC_CONFIG_CUSTOM=y
6924CONFIG_GRKERNSEC_TPE_TRUSTED_GID=64040
6925CONFIG_GRKERNSEC_SYMLINKOWN_GID=33
6926
6927#
6928# Customize Configuration
6929#
6930
6931#
6932# PaX
6933#
6934CONFIG_PAX=y
6935
6936#
6937# PaX Control
6938#
6939CONFIG_PAX_SOFTMODE=y
6940CONFIG_PAX_EI_PAX=y
6941CONFIG_PAX_PT_PAX_FLAGS=y
6942CONFIG_PAX_XATTR_PAX_FLAGS=y
6943# CONFIG_PAX_NO_ACL_FLAGS is not set
6944CONFIG_PAX_HAVE_ACL_FLAGS=y
6945# CONFIG_PAX_HOOK_ACL_FLAGS is not set
6946
6947#
6948# Non-executable pages
6949#
6950CONFIG_PAX_NOEXEC=y
6951CONFIG_PAX_PAGEEXEC=y
6952CONFIG_PAX_EMUTRAMP=y
6953CONFIG_PAX_MPROTECT=y
6954# CONFIG_PAX_MPROTECT_COMPAT is not set
6955# CONFIG_PAX_ELFRELOCS is not set
6956CONFIG_PAX_KERNEXEC=y
6957CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS=y
6958CONFIG_PAX_KERNEXEC_PLUGIN_METHOD="bts"
6959
6960#
6961# Address Space Layout Randomization
6962#
6963CONFIG_PAX_ASLR=y
6964CONFIG_PAX_RANDKSTACK=y
6965CONFIG_PAX_RANDUSTACK=y
6966CONFIG_PAX_RANDMMAP=y
6967
6968#
6969# Miscellaneous hardening features
6970#
6971CONFIG_PAX_MEMORY_SANITIZE=y
6972CONFIG_PAX_MEMORY_STACKLEAK=y
6973CONFIG_PAX_MEMORY_STRUCTLEAK=y
6974CONFIG_PAX_MEMORY_UDEREF=y
6975CONFIG_PAX_REFCOUNT=y
6976CONFIG_PAX_CONSTIFY_PLUGIN=y
6977CONFIG_PAX_USERCOPY=y
6978# CONFIG_PAX_USERCOPY_DEBUG is not set
6979CONFIG_PAX_SIZE_OVERFLOW=y
6980CONFIG_PAX_LATENT_ENTROPY=y
6981
6982#
6983# Memory Protections
6984#
6985CONFIG_GRKERNSEC_KMEM=y
6986CONFIG_GRKERNSEC_IO=y
6987CONFIG_GRKERNSEC_BPF_HARDEN=y
6988CONFIG_GRKERNSEC_PERF_HARDEN=y
6989CONFIG_GRKERNSEC_RAND_THREADSTACK=y
6990CONFIG_GRKERNSEC_PROC_MEMMAP=y
6991CONFIG_GRKERNSEC_KSTACKOVERFLOW=y
6992CONFIG_GRKERNSEC_BRUTE=y
6993CONFIG_GRKERNSEC_MODHARDEN=y
6994CONFIG_GRKERNSEC_HIDESYM=y
6995CONFIG_GRKERNSEC_RANDSTRUCT=y
6996CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
6997CONFIG_GRKERNSEC_KERN_LOCKOUT=y
6998
6999#
7000# Role Based Access Control Options
7001#
7002# CONFIG_GRKERNSEC_NO_RBAC is not set
7003CONFIG_GRKERNSEC_ACL_HIDEKERN=y
7004CONFIG_GRKERNSEC_ACL_MAXTRIES=3
7005CONFIG_GRKERNSEC_ACL_TIMEOUT=30
7006
7007#
7008# Filesystem Protections
7009#
7010CONFIG_GRKERNSEC_PROC=y
7011CONFIG_GRKERNSEC_PROC_USER=y
7012CONFIG_GRKERNSEC_PROC_ADD=y
7013CONFIG_GRKERNSEC_LINK=y
7014CONFIG_GRKERNSEC_SYMLINKOWN=y
7015CONFIG_GRKERNSEC_FIFO=y
7016# CONFIG_GRKERNSEC_SYSFS_RESTRICT is not set
7017CONFIG_GRKERNSEC_ROFS=y
7018CONFIG_GRKERNSEC_DEVICE_SIDECHANNEL=y
7019CONFIG_GRKERNSEC_CHROOT=y
7020CONFIG_GRKERNSEC_CHROOT_MOUNT=y
7021CONFIG_GRKERNSEC_CHROOT_DOUBLE=y
7022CONFIG_GRKERNSEC_CHROOT_PIVOT=y
7023CONFIG_GRKERNSEC_CHROOT_CHDIR=y
7024CONFIG_GRKERNSEC_CHROOT_CHMOD=y
7025CONFIG_GRKERNSEC_CHROOT_FCHDIR=y
7026CONFIG_GRKERNSEC_CHROOT_MKNOD=y
7027CONFIG_GRKERNSEC_CHROOT_SHMAT=y
7028CONFIG_GRKERNSEC_CHROOT_UNIX=y
7029CONFIG_GRKERNSEC_CHROOT_FINDTASK=y
7030CONFIG_GRKERNSEC_CHROOT_NICE=y
7031CONFIG_GRKERNSEC_CHROOT_SYSCTL=y
7032CONFIG_GRKERNSEC_CHROOT_RENAME=y
7033CONFIG_GRKERNSEC_CHROOT_CAPS=y
7034CONFIG_GRKERNSEC_CHROOT_INITRD=y
7035
7036#
7037# Kernel Auditing
7038#
7039CONFIG_GRKERNSEC_AUDIT_GROUP=y
7040CONFIG_GRKERNSEC_AUDIT_GID=64044
7041CONFIG_GRKERNSEC_EXECLOG=y
7042CONFIG_GRKERNSEC_RESLOG=y
7043CONFIG_GRKERNSEC_CHROOT_EXECLOG=y
7044CONFIG_GRKERNSEC_AUDIT_PTRACE=y
7045CONFIG_GRKERNSEC_AUDIT_CHDIR=y
7046CONFIG_GRKERNSEC_AUDIT_MOUNT=y
7047CONFIG_GRKERNSEC_SIGNAL=y
7048CONFIG_GRKERNSEC_FORKFAIL=y
7049CONFIG_GRKERNSEC_TIME=y
7050CONFIG_GRKERNSEC_PROC_IPADDR=y
7051CONFIG_GRKERNSEC_RWXMAP_LOG=y
7052
7053#
7054# Executable Protections
7055#
7056CONFIG_GRKERNSEC_DMESG=y
7057CONFIG_GRKERNSEC_HARDEN_PTRACE=y
7058CONFIG_GRKERNSEC_PTRACE_READEXEC=y
7059CONFIG_GRKERNSEC_SETXID=y
7060CONFIG_GRKERNSEC_HARDEN_IPC=y
7061CONFIG_GRKERNSEC_HARDEN_TTY=y
7062CONFIG_GRKERNSEC_TPE=y
7063CONFIG_GRKERNSEC_TPE_ALL=y
7064CONFIG_GRKERNSEC_TPE_INVERT=y
7065CONFIG_GRKERNSEC_TPE_GID=64040
7066
7067#
7068# Network Protections
7069#
7070CONFIG_GRKERNSEC_BLACKHOLE=y
7071CONFIG_GRKERNSEC_NO_SIMULT_CONNECT=y
7072CONFIG_GRKERNSEC_SOCKET=y
7073CONFIG_GRKERNSEC_SOCKET_ALL=y
7074CONFIG_GRKERNSEC_SOCKET_ALL_GID=64041
7075CONFIG_GRKERNSEC_SOCKET_CLIENT=y
7076CONFIG_GRKERNSEC_SOCKET_CLIENT_GID=64042
7077CONFIG_GRKERNSEC_SOCKET_SERVER=y
7078CONFIG_GRKERNSEC_SOCKET_SERVER_GID=64043
7079
7080#
7081# Physical Protections
7082#
7083CONFIG_GRKERNSEC_DENYUSB=y
7084# CONFIG_GRKERNSEC_DENYUSB_FORCE is not set
7085
7086#
7087# Sysctl Support
7088#
7089CONFIG_GRKERNSEC_SYSCTL=y
7090CONFIG_GRKERNSEC_SYSCTL_DISTRO=y
7091CONFIG_GRKERNSEC_SYSCTL_ON=y
7092
7093#
7094# Logging Options
7095#
7096CONFIG_GRKERNSEC_FLOODTIME=10
7097CONFIG_GRKERNSEC_FLOODBURST=6
7098CONFIG_KEYS=y
7099# CONFIG_PERSISTENT_KEYRINGS is not set
7100# CONFIG_BIG_KEYS is not set
7101# CONFIG_TRUSTED_KEYS is not set
7102CONFIG_ENCRYPTED_KEYS=m
7103CONFIG_SECURITY_DMESG_RESTRICT=y
7104CONFIG_SECURITY=y
7105CONFIG_SECURITYFS=y
7106CONFIG_SECURITY_NETWORK=y
7107CONFIG_SECURITY_NETWORK_XFRM=y
7108CONFIG_SECURITY_PATH=y
7109# CONFIG_INTEL_TXT is not set
7110CONFIG_LSM_MMAP_MIN_ADDR=65536
7111CONFIG_SECURITY_SELINUX=y
7112# CONFIG_SECURITY_SELINUX_BOOTPARAM is not set
7113# CONFIG_SECURITY_SELINUX_DISABLE is not set
7114CONFIG_SECURITY_SELINUX_DEVELOP=y
7115CONFIG_SECURITY_SELINUX_AVC_STATS=y
7116CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
7117# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
7118# CONFIG_SECURITY_SMACK is not set
7119CONFIG_SECURITY_TOMOYO=y
7120CONFIG_SECURITY_TOMOYO_MAX_ACCEPT_ENTRY=2048
7121CONFIG_SECURITY_TOMOYO_MAX_AUDIT_LOG=1024
7122# CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER is not set
7123CONFIG_SECURITY_TOMOYO_POLICY_LOADER="/sbin/tomoyo-init"
7124CONFIG_SECURITY_TOMOYO_ACTIVATION_TRIGGER="/sbin/init"
7125CONFIG_SECURITY_APPARMOR=y
7126CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
7127CONFIG_SECURITY_APPARMOR_HASH=y
7128CONFIG_INTEGRITY=y
7129# CONFIG_INTEGRITY_SIGNATURE is not set
7130CONFIG_INTEGRITY_AUDIT=y
7131# CONFIG_IMA is not set
7132# CONFIG_EVM is not set
7133# CONFIG_DEFAULT_SECURITY_SELINUX is not set
7134# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
7135# CONFIG_DEFAULT_SECURITY_APPARMOR is not set
7136CONFIG_DEFAULT_SECURITY_DAC=y
7137CONFIG_DEFAULT_SECURITY=""
7138CONFIG_XOR_BLOCKS=m
7139CONFIG_ASYNC_CORE=m
7140CONFIG_ASYNC_MEMCPY=m
7141CONFIG_ASYNC_XOR=m
7142CONFIG_ASYNC_PQ=m
7143CONFIG_ASYNC_RAID6_RECOV=m
7144CONFIG_CRYPTO=y
7145
7146#
7147# Crypto core or helper
7148#
7149CONFIG_CRYPTO_ALGAPI=y
7150CONFIG_CRYPTO_ALGAPI2=y
7151CONFIG_CRYPTO_AEAD=m
7152CONFIG_CRYPTO_AEAD2=y
7153CONFIG_CRYPTO_BLKCIPHER=m
7154CONFIG_CRYPTO_BLKCIPHER2=y
7155CONFIG_CRYPTO_HASH=y
7156CONFIG_CRYPTO_HASH2=y
7157CONFIG_CRYPTO_RNG=m
7158CONFIG_CRYPTO_RNG2=y
7159CONFIG_CRYPTO_RNG_DEFAULT=m
7160CONFIG_CRYPTO_PCOMP=m
7161CONFIG_CRYPTO_PCOMP2=y
7162CONFIG_CRYPTO_AKCIPHER2=y
7163CONFIG_CRYPTO_AKCIPHER=m
7164# CONFIG_CRYPTO_RSA is not set
7165CONFIG_CRYPTO_MANAGER=y
7166CONFIG_CRYPTO_MANAGER2=y
7167# CONFIG_CRYPTO_USER is not set
7168# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
7169CONFIG_CRYPTO_GF128MUL=m
7170CONFIG_CRYPTO_NULL=m
7171CONFIG_CRYPTO_NULL2=y
7172CONFIG_CRYPTO_PCRYPT=m
7173CONFIG_CRYPTO_WORKQUEUE=y
7174CONFIG_CRYPTO_CRYPTD=m
7175# CONFIG_CRYPTO_MCRYPTD is not set
7176CONFIG_CRYPTO_AUTHENC=m
7177CONFIG_CRYPTO_TEST=m
7178CONFIG_CRYPTO_ABLK_HELPER=m
7179CONFIG_CRYPTO_GLUE_HELPER_X86=m
7180
7181#
7182# Authenticated Encryption with Associated Data
7183#
7184CONFIG_CRYPTO_CCM=m
7185CONFIG_CRYPTO_GCM=m
7186CONFIG_CRYPTO_CHACHA20POLY1305=m
7187CONFIG_CRYPTO_SEQIV=m
7188CONFIG_CRYPTO_ECHAINIV=m
7189
7190#
7191# Block modes
7192#
7193CONFIG_CRYPTO_CBC=m
7194CONFIG_CRYPTO_CTR=m
7195CONFIG_CRYPTO_CTS=m
7196CONFIG_CRYPTO_ECB=m
7197CONFIG_CRYPTO_LRW=m
7198CONFIG_CRYPTO_PCBC=m
7199CONFIG_CRYPTO_XTS=m
7200# CONFIG_CRYPTO_KEYWRAP is not set
7201
7202#
7203# Hash modes
7204#
7205CONFIG_CRYPTO_CMAC=m
7206CONFIG_CRYPTO_HMAC=m
7207CONFIG_CRYPTO_XCBC=m
7208CONFIG_CRYPTO_VMAC=m
7209
7210#
7211# Digest
7212#
7213CONFIG_CRYPTO_CRC32C=m
7214CONFIG_CRYPTO_CRC32C_INTEL=m
7215CONFIG_CRYPTO_CRC32=m
7216CONFIG_CRYPTO_CRC32_PCLMUL=m
7217CONFIG_CRYPTO_CRCT10DIF=y
7218CONFIG_CRYPTO_CRCT10DIF_PCLMUL=m
7219CONFIG_CRYPTO_GHASH=m
7220CONFIG_CRYPTO_POLY1305=m
7221CONFIG_CRYPTO_POLY1305_X86_64=m
7222CONFIG_CRYPTO_MD4=m
7223CONFIG_CRYPTO_MD5=y
7224CONFIG_CRYPTO_MICHAEL_MIC=m
7225CONFIG_CRYPTO_RMD128=m
7226CONFIG_CRYPTO_RMD160=m
7227CONFIG_CRYPTO_RMD256=m
7228CONFIG_CRYPTO_RMD320=m
7229CONFIG_CRYPTO_SHA1=y
7230CONFIG_CRYPTO_SHA1_SSSE3=m
7231CONFIG_CRYPTO_SHA256_SSSE3=m
7232CONFIG_CRYPTO_SHA512_SSSE3=m
7233# CONFIG_CRYPTO_SHA1_MB is not set
7234CONFIG_CRYPTO_SHA256=y
7235CONFIG_CRYPTO_SHA512=m
7236CONFIG_CRYPTO_TGR192=m
7237CONFIG_CRYPTO_WP512=m
7238CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL=m
7239
7240#
7241# Ciphers
7242#
7243CONFIG_CRYPTO_AES=y
7244CONFIG_CRYPTO_AES_X86_64=m
7245CONFIG_CRYPTO_AES_NI_INTEL=m
7246CONFIG_CRYPTO_ANUBIS=m
7247CONFIG_CRYPTO_ARC4=m
7248CONFIG_CRYPTO_BLOWFISH=m
7249CONFIG_CRYPTO_BLOWFISH_COMMON=m
7250CONFIG_CRYPTO_BLOWFISH_X86_64=m
7251CONFIG_CRYPTO_CAMELLIA=m
7252CONFIG_CRYPTO_CAMELLIA_X86_64=m
7253CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64=m
7254CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64=m
7255CONFIG_CRYPTO_CAST_COMMON=m
7256CONFIG_CRYPTO_CAST5=m
7257CONFIG_CRYPTO_CAST5_AVX_X86_64=m
7258CONFIG_CRYPTO_CAST6=m
7259CONFIG_CRYPTO_CAST6_AVX_X86_64=m
7260CONFIG_CRYPTO_DES=m
7261CONFIG_CRYPTO_DES3_EDE_X86_64=m
7262CONFIG_CRYPTO_FCRYPT=m
7263CONFIG_CRYPTO_KHAZAD=m
7264CONFIG_CRYPTO_SALSA20=m
7265CONFIG_CRYPTO_SALSA20_X86_64=m
7266CONFIG_CRYPTO_CHACHA20=m
7267CONFIG_CRYPTO_CHACHA20_X86_64=m
7268CONFIG_CRYPTO_SEED=m
7269CONFIG_CRYPTO_SERPENT=m
7270CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
7271CONFIG_CRYPTO_SERPENT_AVX_X86_64=m
7272CONFIG_CRYPTO_SERPENT_AVX2_X86_64=m
7273CONFIG_CRYPTO_TEA=m
7274CONFIG_CRYPTO_TWOFISH=m
7275CONFIG_CRYPTO_TWOFISH_COMMON=m
7276CONFIG_CRYPTO_TWOFISH_X86_64=m
7277CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
7278CONFIG_CRYPTO_TWOFISH_AVX_X86_64=m
7279
7280#
7281# Compression
7282#
7283CONFIG_CRYPTO_DEFLATE=m
7284CONFIG_CRYPTO_ZLIB=m
7285CONFIG_CRYPTO_LZO=y
7286# CONFIG_CRYPTO_842 is not set
7287CONFIG_CRYPTO_LZ4=m
7288CONFIG_CRYPTO_LZ4HC=m
7289
7290#
7291# Random Number Generation
7292#
7293CONFIG_CRYPTO_ANSI_CPRNG=m
7294CONFIG_CRYPTO_DRBG_MENU=m
7295CONFIG_CRYPTO_DRBG_HMAC=y
7296# CONFIG_CRYPTO_DRBG_HASH is not set
7297# CONFIG_CRYPTO_DRBG_CTR is not set
7298CONFIG_CRYPTO_DRBG=m
7299CONFIG_CRYPTO_JITTERENTROPY=m
7300CONFIG_CRYPTO_USER_API=m
7301CONFIG_CRYPTO_USER_API_HASH=m
7302CONFIG_CRYPTO_USER_API_SKCIPHER=m
7303# CONFIG_CRYPTO_USER_API_RNG is not set
7304CONFIG_CRYPTO_USER_API_AEAD=m
7305CONFIG_CRYPTO_HW=y
7306CONFIG_CRYPTO_DEV_PADLOCK=m
7307CONFIG_CRYPTO_DEV_PADLOCK_AES=m
7308CONFIG_CRYPTO_DEV_PADLOCK_SHA=m
7309CONFIG_CRYPTO_DEV_CCP=y
7310CONFIG_CRYPTO_DEV_CCP_DD=m
7311CONFIG_CRYPTO_DEV_CCP_CRYPTO=m
7312CONFIG_CRYPTO_DEV_QAT=m
7313CONFIG_CRYPTO_DEV_QAT_DH895xCC=m
7314CONFIG_CRYPTO_DEV_QAT_DH895xCCVF=m
7315# CONFIG_ASYMMETRIC_KEY_TYPE is not set
7316
7317#
7318# Certificates for signature checking
7319#
7320# CONFIG_SYSTEM_TRUSTED_KEYRING is not set
7321CONFIG_HAVE_KVM=y
7322CONFIG_HAVE_KVM_IRQCHIP=y
7323CONFIG_HAVE_KVM_IRQFD=y
7324CONFIG_HAVE_KVM_IRQ_ROUTING=y
7325CONFIG_HAVE_KVM_EVENTFD=y
7326CONFIG_KVM_APIC_ARCHITECTURE=y
7327CONFIG_KVM_MMIO=y
7328CONFIG_KVM_ASYNC_PF=y
7329CONFIG_HAVE_KVM_MSI=y
7330CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
7331CONFIG_KVM_VFIO=y
7332CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
7333CONFIG_KVM_COMPAT=y
7334CONFIG_HAVE_KVM_IRQ_BYPASS=y
7335CONFIG_VIRTUALIZATION=y
7336CONFIG_KVM=m
7337CONFIG_KVM_INTEL=m
7338CONFIG_KVM_AMD=m
7339CONFIG_KVM_DEVICE_ASSIGNMENT=y
7340# CONFIG_BINARY_PRINTF is not set
7341
7342#
7343# Library routines
7344#
7345CONFIG_RAID6_PQ=m
7346CONFIG_BITREVERSE=y
7347# CONFIG_HAVE_ARCH_BITREVERSE is not set
7348CONFIG_RATIONAL=y
7349CONFIG_GENERIC_STRNCPY_FROM_USER=y
7350CONFIG_GENERIC_STRNLEN_USER=y
7351CONFIG_GENERIC_NET_UTILS=y
7352CONFIG_GENERIC_FIND_FIRST_BIT=y
7353CONFIG_GENERIC_PCI_IOMAP=y
7354CONFIG_GENERIC_IOMAP=y
7355CONFIG_GENERIC_IO=y
7356CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
7357CONFIG_ARCH_HAS_FAST_MULTIPLIER=y
7358CONFIG_CRC_CCITT=m
7359CONFIG_CRC16=m
7360CONFIG_CRC_T10DIF=y
7361CONFIG_CRC_ITU_T=m
7362CONFIG_CRC32=y
7363# CONFIG_CRC32_SELFTEST is not set
7364CONFIG_CRC32_SLICEBY8=y
7365# CONFIG_CRC32_SLICEBY4 is not set
7366# CONFIG_CRC32_SARWATE is not set
7367# CONFIG_CRC32_BIT is not set
7368CONFIG_CRC7=m
7369CONFIG_LIBCRC32C=m
7370# CONFIG_CRC8 is not set
7371# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
7372# CONFIG_RANDOM32_SELFTEST is not set
7373CONFIG_ZLIB_INFLATE=y
7374CONFIG_ZLIB_DEFLATE=y
7375CONFIG_LZO_COMPRESS=y
7376CONFIG_LZO_DECOMPRESS=y
7377CONFIG_LZ4_COMPRESS=m
7378CONFIG_LZ4HC_COMPRESS=m
7379CONFIG_LZ4_DECOMPRESS=y
7380CONFIG_XZ_DEC=y
7381CONFIG_XZ_DEC_X86=y
7382# CONFIG_XZ_DEC_POWERPC is not set
7383# CONFIG_XZ_DEC_IA64 is not set
7384# CONFIG_XZ_DEC_ARM is not set
7385# CONFIG_XZ_DEC_ARMTHUMB is not set
7386# CONFIG_XZ_DEC_SPARC is not set
7387CONFIG_XZ_DEC_BCJ=y
7388# CONFIG_XZ_DEC_TEST is not set
7389CONFIG_DECOMPRESS_GZIP=y
7390CONFIG_DECOMPRESS_BZIP2=y
7391CONFIG_DECOMPRESS_LZMA=y
7392CONFIG_DECOMPRESS_XZ=y
7393CONFIG_DECOMPRESS_LZO=y
7394CONFIG_DECOMPRESS_LZ4=y
7395CONFIG_GENERIC_ALLOCATOR=y
7396CONFIG_REED_SOLOMON=m
7397CONFIG_REED_SOLOMON_ENC8=y
7398CONFIG_REED_SOLOMON_DEC8=y
7399CONFIG_REED_SOLOMON_DEC16=y
7400CONFIG_BCH=m
7401CONFIG_TEXTSEARCH=y
7402CONFIG_TEXTSEARCH_KMP=m
7403CONFIG_TEXTSEARCH_BM=m
7404CONFIG_TEXTSEARCH_FSM=m
7405CONFIG_BTREE=y
7406CONFIG_INTERVAL_TREE=y
7407CONFIG_ASSOCIATIVE_ARRAY=y
7408CONFIG_HAS_IOMEM=y
7409CONFIG_HAS_IOPORT_MAP=y
7410CONFIG_HAS_DMA=y
7411CONFIG_CHECK_SIGNATURE=y
7412CONFIG_CPU_RMAP=y
7413CONFIG_DQL=y
7414CONFIG_GLOB=y
7415# CONFIG_GLOB_SELFTEST is not set
7416CONFIG_NLATTR=y
7417CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
7418CONFIG_LRU_CACHE=m
7419CONFIG_CORDIC=m
7420# CONFIG_DDR is not set
7421CONFIG_OID_REGISTRY=m
7422CONFIG_UCS2_STRING=y
7423CONFIG_FONT_SUPPORT=y
7424# CONFIG_FONTS is not set
7425CONFIG_FONT_8x8=y
7426CONFIG_FONT_8x16=y
7427# CONFIG_SG_SPLIT is not set
7428CONFIG_ARCH_HAS_SG_CHAIN=y
7429CONFIG_ARCH_HAS_PMEM_API=y
7430CONFIG_ARCH_HAS_MMIO_FLUSH=y
diff --git a/src/tools/extract_caps.c b/src/tools/extract_caps.c
index 5e9c1764d..8da9c452b 100644
--- a/src/tools/extract_caps.c
+++ b/src/tools/extract_caps.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -17,6 +17,7 @@
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#include <ctype.h>
20#include <stdio.h> 21#include <stdio.h>
21#include <stdlib.h> 22#include <stdlib.h>
22#include <string.h> 23#include <string.h>
diff --git a/src/tools/extract_errnos.sh b/src/tools/extract_errnos.sh
index 43b225828..34c416b04 100644
--- a/src/tools/extract_errnos.sh
+++ b/src/tools/extract_errnos.sh
@@ -1,3 +1,8 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
1echo -e "#include <errno.h>\n#include <attr/xattr.h>" | \ 6echo -e "#include <errno.h>\n#include <attr/xattr.h>" | \
2 cpp -dD | \ 7 cpp -dD | \
3 grep "^#define E" | \ 8 grep "^#define E" | \
diff --git a/src/tools/extract_seccomp.c b/src/tools/extract_seccomp.c
new file mode 100644
index 000000000..b5f92d2df
--- /dev/null
+++ b/src/tools/extract_seccomp.c
@@ -0,0 +1,115 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#define _GNU_SOURCE
22#include <stdio.h>
23#include <stdlib.h>
24#include <unistd.h>
25#include <string.h>
26#include <errno.h>
27#include <sys/stat.h>
28#include <sys/types.h>
29#include <sys/ptrace.h>
30#include <sys/wait.h>
31#include <linux/filter.h>
32
33#define MAXBUF 1024
34#define errExit(msg) { char msgout[256]; \
35 snprintf(msgout, 256, "Error %d: %s", __LINE__, (msg)); \
36 perror(msgout); \
37 exit(1); }
38
39// dump all seccomp filters of a process
40// for further analysis with fsec-print
41// requires kernel 4.4 or higher
42
43void dump_filter(const char *dname, unsigned cnt, const struct sock_filter *f, size_t nmemb) {
44 char fname[MAXBUF];
45 snprintf(fname, MAXBUF, "%s/%u", dname, cnt);
46 printf("Writing file %s\n", fname);
47 FILE *fp = fopen(fname, "w");
48 if (!fp) {
49 printf("Error: Cannot open %s for writing: %s\n", fname, strerror(errno));
50 exit(1);
51 }
52 if (fwrite(f, sizeof(struct sock_filter), nmemb, fp) != nmemb) {
53 printf("Error: Cannot write %s\n", fname);
54 exit(1);
55 }
56 fclose(fp);
57}
58
59int main(int argc, char **argv) {
60 if (argc != 2)
61 goto usage;
62 pid_t pid = (pid_t) strtol(argv[1], NULL, 10);
63 if (pid <= 0)
64 goto usage;
65
66 printf("** Attaching to process with pid %d **\n", pid);
67 long rv = ptrace(PTRACE_ATTACH, pid, 0, 0);
68 if (rv != 0) {
69 printf("Error: Cannot attach: %s\n", strerror(errno));
70 exit(1);
71 }
72 waitpid(pid, NULL, 0);
73 printf("Attached\n");
74
75 char dname[MAXBUF];
76 snprintf(dname, MAXBUF, "/tmp/seccomp-%d", pid);
77 printf("** Creating directory %s **\n", dname);
78 if (mkdir(dname, 0755) < 0) {
79 printf("Error: Cannot create directory: %s\n", strerror(errno));
80 exit(1);
81 }
82 printf("Created\n");
83
84 printf("** Extracting seccomp filters **\n");
85 unsigned cnt = 0;
86 while ((rv = ptrace(PTRACE_SECCOMP_GET_FILTER, pid, cnt, NULL)) > 0) {
87 struct sock_filter *f = malloc(rv * sizeof(struct sock_filter));
88 if (!f)
89 errExit("malloc");
90 if (ptrace(PTRACE_SECCOMP_GET_FILTER, pid, cnt, f) < 0)
91 errExit("ptrace");
92
93 dump_filter(dname, cnt, f, rv);
94 free(f);
95 cnt++;
96 }
97
98 if (cnt)
99 printf("Dumped %u filters\n", cnt);
100 else {
101 printf("No seccomp filter was found\n");
102 printf("** Cleanup **\n");
103 if (remove(dname) == 0)
104 printf("Removed %s\n", dname);
105 else
106 printf("Could not remove %s: %s\n", dname, strerror(errno));
107 }
108
109 printf("Bye ...\n");
110 return 0;
111
112usage:
113 printf("Usage: %s <PID>\n", argv[0]);
114 return 1;
115}
diff --git a/src/tools/extract_syscalls.c b/src/tools/extract_syscalls.c
index 18c1814e6..9159b6576 100644
--- a/src/tools/extract_syscalls.c
+++ b/src/tools/extract_syscalls.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
diff --git a/src/tools/grsec.conf b/src/tools/grsec.conf
deleted file mode 100644
index 177e4d59b..000000000
--- a/src/tools/grsec.conf
+++ /dev/null
@@ -1,98 +0,0 @@
1## Address Space Protection
2# Disable privileged io: iopl(2) and ioperm(2)
3# Warning: Xorg without modesetting needs it to be 0
4kernel.grsecurity.disable_priv_io = 1
5kernel.grsecurity.deter_bruteforce = 1
6
7kernel.grsecurity.deny_new_usb = 0
8kernel.grsecurity.harden_ipc = 1
9
10## Filesystem Protections
11# Prevent symlinks/hardlinks exploits (don't follow symlink on world-writable +t
12# folders)
13kernel.grsecurity.linking_restrictions = 1
14# Prevent writing to fifo not owned in world-writable +t folders
15kernel.grsecurity.fifo_restrictions = 1
16
17# Chroot restrictions
18kernel.grsecurity.chroot_deny_bad_rename = 1
19kernel.grsecurity.chroot_deny_mount = 1
20kernel.grsecurity.chroot_deny_chroot = 1
21kernel.grsecurity.chroot_deny_pivot = 1
22kernel.grsecurity.chroot_enforce_chdir = 1
23kernel.grsecurity.chroot_deny_chmod = 1
24kernel.grsecurity.chroot_deny_fchdir = 1
25kernel.grsecurity.chroot_deny_mknod = 1
26kernel.grsecurity.chroot_deny_shmat = 1
27kernel.grsecurity.chroot_deny_unix = 1
28kernel.grsecurity.chroot_findtask = 1
29kernel.grsecurity.chroot_restrict_nice = 1
30kernel.grsecurity.chroot_deny_sysctl = 1
31kernel.grsecurity.chroot_caps = 1
32
33## Kernel Auditing
34kernel.grsecurity.exec_logging = 1
35kernel.grsecurity.audit_chdir = 1
36# By default exec_logging and audit_chdir only target members of audit_gid, you
37# can change that by setting audit_group to 0
38kernel.grsecurity.audit_group = 1
39# You can also override audit_gid to use another group
40kernel.grsecurity.audit_gid = 0
41kernel.grsecurity.resource_logging = 1
42kernel.grsecurity.chroot_execlog = 1
43kernel.grsecurity.audit_ptrace = 1
44kernel.grsecurity.audit_mount = 1
45kernel.grsecurity.signal_logging = 1
46kernel.grsecurity.forkfail_logging = 1
47kernel.grsecurity.timechange_logging = 1
48kernel.grsecurity.rwxmap_logging = 1
49
50## Executable Protections
51kernel.grsecurity.dmesg = 1
52kernel.grsecurity.consistent_setxid = 1
53# Trusted execution
54# Add users to the 64040 (grsec-tpe) group to enable them to execute binaries
55# from untrusted directories
56kernel.grsecurity.tpe = 1
57kernel.grsecurity.tpe_invert = 1
58kernel.grsecurity.tpe_restrict_all = 1
59kernel.grsecurity.tpe_gid = 64040
60
61## Kernel-enforce SymlinkIfOwnerMatch
62kernel.grsecurity.enforce_symlinksifowner = 1
63kernel.grsecurity.symlinkown_gid = 33
64
65## Network Protections
66kernel.grsecurity.ip_blackhole = 1
67kernel.grsecurity.lastack_retries = 4
68# Socket restrictions
69# If the setting is enabled and an user is added to relevant group, she won't
70# be able to open this kind of socket
71kernel.grsecurity.socket_all = 1
72kernel.grsecurity.socket_all_gid = 64041
73kernel.grsecurity.socket_client = 1
74kernel.grsecurity.socket_client_gid = 64042
75kernel.grsecurity.socket_server = 1
76kernel.grsecurity.socket_server_gid = 64043
77
78# Ptrace
79kernel.grsecurity.harden_ptrace = 1
80kernel.grsecurity.ptrace_readexec = 1
81
82# Protect mounts
83# don't try to set it to 0, it'll fail, just let it commented
84# kernel.grsecurity.romount_protect = 1
85
86# PAX
87kernel.pax.softmode = 0
88
89# Disable module loading
90# This is not a grsecurity anymore, but you might still want to disable module
91# loading so no code is inserted into the kernel
92# kernel.modules_disabled=1
93
94# Once you're satisfied with settings, set grsec_lock to 1 so noone can change
95# grsec sysctl on a running system
96kernel.grsecurity.grsec_lock = 1
97
98# vim: filetype=conf:
diff --git a/src/tools/mkcoverit.sh b/src/tools/mkcoverit.sh
index d4a68e397..86d798a11 100755
--- a/src/tools/mkcoverit.sh
+++ b/src/tools/mkcoverit.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3# unpack firejail archive 6# unpack firejail archive
4ARCFIREJAIL=`ls *.tar.xz| grep firejail` 7ARCFIREJAIL=`ls *.tar.xz| grep firejail`
diff --git a/src/tools/profcleaner.c b/src/tools/profcleaner.c
new file mode 100644
index 000000000..93bb3f73d
--- /dev/null
+++ b/src/tools/profcleaner.c
@@ -0,0 +1,75 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21//*************************************************************
22// Small utility program to convert profiles from blacklist/whitelist to deny/allow
23// Compile:
24// gcc -o profcleaner profcleaner.c
25// Usage:
26// profcleaner *.profile
27//*************************************************************
28
29#include <stdio.h>
30#include <stdlib.h>
31#include <string.h>
32#include <unistd.h>
33#define MAXBUF 4096
34
35int main(int argc, char **argv) {
36 printf("Usage: profcleaner files\n");
37 int i;
38
39 for (i = 1; i < argc; i++) {
40 FILE *fp = fopen(argv[i], "r");
41 if (!fp) {
42 fprintf(stderr, "Error: cannot open %s\n", argv[i]);
43 return 1;
44 }
45
46 FILE *fpout = fopen("profcleaner-tmp", "w");
47 if (!fpout) {
48 fprintf(stderr, "Error: cannot open output file\n");
49 return 1;
50 }
51
52 char buf[MAXBUF];
53 while (fgets(buf, MAXBUF, fp)) {
54 if (strncmp(buf, "blacklist-nolog", 15) == 0)
55 fprintf(fpout, "deny-nolog %s", buf + 15);
56 else if (strncmp(buf, "blacklist", 9) == 0)
57 fprintf(fpout, "deny %s", buf + 9);
58 else if (strncmp(buf, "noblacklist", 11) == 0)
59 fprintf(fpout, "nodeny %s", buf + 11);
60 else if (strncmp(buf, "whitelist", 9) == 0)
61 fprintf(fpout, "allow %s", buf + 9);
62 else if (strncmp(buf, "nowhitelist", 11) == 0)
63 fprintf(fpout, "noallow %s", buf + 11);
64 else
65 fprintf(fpout, "%s", buf);
66 }
67
68 fclose(fp);
69 fclose(fpout);
70 unlink(argv[i]);
71 rename("profcleaner-tmp", argv[i]);
72 }
73
74 return 0;
75} \ No newline at end of file
diff --git a/src/tools/profcleaner.sh b/src/tools/profcleaner.sh
new file mode 100755
index 000000000..96402aed6
--- /dev/null
+++ b/src/tools/profcleaner.sh
@@ -0,0 +1,45 @@
1#!/bin/bash
2
3# Copyright (C) 2021 Firejail Authors
4#
5# This file is part of firejail project
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21if [[ $1 == --help ]]; then
22 cat <<-EOM
23 USAGE:
24 profcleaner.sh --help Show this help message and exit
25 profcleaner.sh --system Clean all profiles in /etc/firejail
26 profcleaner.sh --user Clean all profiles in ~/.config/firejail
27 profcleaner.sh /path/to/profile1 /path/to/profile2 ...
28 EOM
29 exit 0
30fi
31
32if [[ $1 == --system ]]; then
33 profiles=(/etc/firejail/*.{inc,local,profile})
34elif [[ $1 == --user ]]; then
35 profiles=("$HOME"/.config/firejail/*.{inc,local,profile})
36else
37 profiles=("$@")
38fi
39
40sed -i -E \
41 -e "s/^(# |#)?(ignore )?blacklist/\1\2deny/" \
42 -e "s/^(# |#)?(ignore )?noblacklist/\1\2nodeny/" \
43 -e "s/^(# |#)?(ignore )?whitelist/\1\2allow/" \
44 -e "s/^(# |#)?(ignore )?nowhitelist/\1\2noallow/" \
45 "${profiles[@]}"
diff --git a/src/tools/rvtest.c b/src/tools/rvtest.c
deleted file mode 100644
index f2f114ea7..000000000
--- a/src/tools/rvtest.c
+++ /dev/null
@@ -1,144 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21// run it as "rvtest 2>/dev/null | grep TESTING"
22
23#include <stdio.h>
24#include <stdlib.h>
25#include <unistd.h>
26#include <string.h>
27#include <sys/types.h>
28#include <signal.h>
29
30#define MAXBUF 1024 // line buffer
31#define TIMEOUT 30 // timeout time in seconds
32
33static pid_t pid;
34static void catch_alarm(int sig) {
35 kill(pid, SIGTERM);
36 sleep(1);
37 kill(pid, SIGKILL);
38 printf("TESTING ERROR: SIGALARM triggered\n");
39 exit(1);
40}
41
42static void usage(void) {
43 printf("Usage: rvtest testfile\n");
44 printf("\n");
45 printf("Testfile format:\n");
46 printf("\tretval command\n");
47 printf("\n");
48 printf("Testfile example:\n");
49 printf("\n");
50 printf("0 firejail --net=none exit\n");
51 printf("1 firejail --private=/etc sleep 1\n");
52 printf("1 firejail --blablabla\n");
53}
54
55int main(int argc, char **argv) {
56 if (argc != 2) {
57 fprintf(stderr, "Error: test file missing\n");
58 usage();
59 return 1;
60 }
61
62 signal (SIGALRM, catch_alarm);
63
64 // open test file
65 char *fname = argv[1];
66 FILE *fp = fopen(fname, "r");
67
68 // read test file
69 char buf[MAXBUF];
70 int line = 0;
71 while (fgets(buf, MAXBUF, fp)) {
72 line++;
73 // skip blanks
74 char *start = buf;
75 while (*start == ' ' || *start == '\t')
76 start++;
77 // remove '\n'
78 char *ptr = strchr(start, '\n');
79 if (ptr)
80 *ptr ='\0';
81 if (*start == '\0')
82 continue;
83
84 // skip comments
85 if (*start == '#')
86 continue;
87 ptr = strchr(start, '#');
88 if (ptr)
89 *ptr = '\0';
90
91 // extract exit status
92 int status;
93 int rv = sscanf(start, "%d\n", &status);
94 if (rv != 1) {
95 fprintf(stderr, "Error: invalid line %d in %s\n", line, fname);
96 exit(1);
97 }
98
99 // extract command
100 char *cmd = strchr(start, ' ');
101 if (!cmd) {
102 fprintf(stderr, "Error: invalid line %d in %s\n", line, fname);
103 exit(1);
104 }
105
106 // execute command
107 printf("TESTING %s\n", cmd);
108 fflush(0);
109 pid = fork();
110 if (pid == -1) {
111 perror("fork");
112 exit(1);
113 }
114
115 // child
116 if (pid == 0) {
117 char *earg[50];
118 earg[0] = "/bin/bash";
119 earg[1] = "-c";
120 earg[2] = cmd;
121 earg[3] = NULL;
122 execvp(earg[0], earg);
123 }
124 // parent
125 else {
126 int exit_status;
127
128 alarm(TIMEOUT);
129 pid = waitpid(pid, &exit_status, 0);
130 if (pid == -1) {
131 perror("waitpid");
132 exit(1);
133 }
134
135 if (WEXITSTATUS(exit_status) != status)
136 printf("ERROR TESTING: %s\n", cmd);
137 }
138
139 fflush(0);
140 }
141 fclose(fp);
142
143 return 0;
144}
diff --git a/src/faudit/faudit.h b/src/tools/testuid.c
index 16a13d0ff..a18d57d5e 100644
--- a/src/faudit/faudit.h
+++ b/src/tools/testuid.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017 Firejail Authors 2 * Copyright (C) 2014-2021 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
5 * 5 *
@@ -18,51 +18,32 @@
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 20
21#ifndef FAUDIT_H 21// compile: gcc -o testuid testuid.c
22#define FAUDIT_H 22
23#define _GNU_SOURCE
24#include <stdio.h> 23#include <stdio.h>
25#include <stdlib.h> 24#include <stdlib.h>
26#include <stdint.h>
27#include <string.h> 25#include <string.h>
28#include <unistd.h> 26#include <unistd.h>
29#include <sys/types.h> 27#include <sys/types.h>
30#include <sys/stat.h>
31#include <sys/mount.h>
32#include <assert.h>
33
34#define errExit(msg) do { char msgout[500]; sprintf(msgout, "Error %s:%s(%d)", msg, __FUNCTION__, __LINE__); perror(msgout); exit(1);} while (0)
35
36// main.c
37extern char *prog;
38
39// pid.c
40void pid_test(void);
41
42// caps.c
43void caps_test(void);
44
45// seccomp.c
46void seccomp_test(void);
47
48// syscall.c
49void syscall_helper(int argc, char **argv);
50void syscall_run(const char *name);
51
52// files.c
53void files_test(void);
54 28
55// network.c
56void network_test(void);
57 29
58// dbus.c 30static void print_status(void) {
59int check_unix(const char *sockfile); 31 FILE *fp = fopen("/proc/self/status", "r");
60void dbus_test(void); 32 if (!fp) {
33 fprintf(stderr, "Error, cannot open status file\n");
34 exit(1);
35 }
61 36
62// dev.c 37 char buf[4096];
63void dev_test(void); 38 while (fgets(buf, 4096, fp)) {
39 if (strncmp(buf, "Uid", 3) == 0 || strncmp(buf, "Gid", 3) == 0)
40 printf("%s", buf);
41 }
64 42
65// x11.c 43 fclose(fp);
66void x11_test(void); 44}
67 45
68#endif 46int main(void) {
47 print_status();
48 return 0;
49}
diff --git a/src/tools/ttytest.c b/src/tools/ttytest.c
index a449bf9ba..0f72753bc 100644
--- a/src/tools/ttytest.c
+++ b/src/tools/ttytest.c
@@ -1,3 +1,23 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
1#define _XOPEN_SOURCE 600 21#define _XOPEN_SOURCE 600
2#include <stdlib.h> 22#include <stdlib.h>
3#include <stdio.h> 23#include <stdio.h>
diff --git a/src/tools/unixsocket.c b/src/tools/unixsocket.c
index c4302eed3..c4ecabca7 100644
--- a/src/tools/unixsocket.c
+++ b/src/tools/unixsocket.c
@@ -1,3 +1,23 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
1#include <stdio.h> 21#include <stdio.h>
2#include <sys/types.h> 22#include <sys/types.h>
3#include <sys/socket.h> 23#include <sys/socket.h>
diff --git a/src/zsh_completion/Makefile.in b/src/zsh_completion/Makefile.in
new file mode 100644
index 000000000..a83cccf6c
--- /dev/null
+++ b/src/zsh_completion/Makefile.in
@@ -0,0 +1,17 @@
1.PHONY: all
2all: _firejail
3
4include ../common.mk
5
6_firejail: _firejail.in
7 gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp
8 sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@
9 rm $@.tmp
10
11.PHONY: clean
12clean:
13 rm -fr _firejail
14
15.PHONY: distclean
16distclean: clean
17 rm -fr Makefile
diff --git a/src/zsh_completion/_firejail.in b/src/zsh_completion/_firejail.in
new file mode 100644
index 000000000..c7f6ee3f1
--- /dev/null
+++ b/src/zsh_completion/_firejail.in
@@ -0,0 +1,286 @@
1#compdef firejail
2
3# Documentation: man 1 zshcompsys
4# HowTo: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
5
6_all_firejails() {
7 local -a _all_firejails_list
8 for jail in ${(f)"$(_call_program modules_tag "firejail --list 2> /dev/null | cut -d: -f1")"}; do
9 _all_firejails_list+=${jail%% *}
10 done
11 _describe 'firejails list' _all_firejails_list
12}
13
14_all_cpus() {
15 _cpu_count=$(getconf _NPROCESSORS_ONLN)
16 for i in {0..$((_cpu_count-1))} ; do
17 print $i
18 done
19}
20
21_profiles() {
22 print $1/*.profile | sed -E "s;$1/;;g;s;\.profile;;g;"
23}
24_profiles_with_ext() {
25 print $1/*.profile
26}
27
28_all_profiles() {
29 _values 'profiles' $(_profiles _SYSCONFDIR_/firejail) $(_profiles $HOME/.config/firejail) $(_profiles_with_ext .)
30}
31
32_session_bus_names() {
33 _values names $(busctl --user list --no-legend --activatable | cut -d" " -f1)
34 # Alternatives to hack on for non-systemd systems:
35 # dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply=literal /org/freedesktop/DBus org.freedesktop.DBus.ListNames
36 # ls /usr/share/dbus-1/services | xargs -I FILENAME basename FILENAME .service
37}
38
39_system_bus_names() {
40 _values names $(busctl --system list --no-legend --activatable | cut -d" " -f1)
41}
42
43_caps() {
44 _values -s "," caps $(firejail --debug-caps | awk '/[0-9]+\s*- /{print $3}')
45}
46
47_firejail_args=(
48 '*::arguments:_normal'
49
50 '--appimage[sandbox an AppImage application]'
51 '--build[build a profile for the application and print it on stdout]'
52 '--build=-[build a profile for the application and save it]: :_files'
53 # Ignore that you can do -? too as it's the only short option
54 '--help[this help screen]'
55 '--join=-[join the sandbox name|pid]: :_all_firejails'
56 '--join-filesystem=-[join the mount namespace name|pid]: :_all_firejails'
57 '--list[list all sandboxes]'
58 '(--profile)--noprofile[do not use a security profile]'
59 '(--noprofile)--profile=-[use a custom profile]: :_all_profiles'
60 '--shutdown=-[shutdown the sandbox identified by name|pid]: :_all_firejails'
61 '--top[monitor the most CPU-intensive sandboxes]'
62 '--tree[print a tree of all sandboxed processes]'
63 '--version[print program version and exit]'
64
65 '--ids-check[verify file system]'
66 '--ids-init[initialize IDS database]'
67
68 '--debug[print sandbox debug messages]'
69 '--debug-allow[debug file system access]'
70 '--debug-caps[print all recognized capabilities]'
71 '--debug-deny[debug file system access]'
72 '--debug-errnos[print all recognized error numbers]'
73 '--debug-private-lib[debug for --private-lib option]'
74 '--debug-protocols[print all recognized protocols]'
75 '--debug-syscalls[print all recognized system calls]'
76 '--debug-syscalls32[print all recognized 32 bit system calls]'
77
78 '--caps.print=-[print the caps filter name|pid]:firejail:_all_firejails'
79 '--cpu.print=-[print the cpus in use name|pid]: :_all_firejails'
80 '--fs.print=-[print the filesystem log name|pid]: :_all_firejails'
81 '--profile.print=-[print the name of profile file name|pid]: :_all_firejails'
82 '--protocol.print=-[print the protocol filter name|pid]: :_all_firejails'
83 '--seccomp.print=-[print the seccomp filter for the sandbox identified by name|pid]: :_all_firejails'
84
85 '--allow-debuggers[allow tools such as strace and gdb inside the sandbox]'
86 '--allusers[all user home directories are visible inside the sandbox]'
87 # Should be _files, a comma and files or files -/
88 '*--bind=-[mount-bind dirname1/filename1 on top of dirname2/filename2]: :(file1,file2 dir1,dir2)'
89 '--caps[enable default Linux capabilities filter]'
90 '--caps.drop=all[drop all capabilities]'
91 '*--caps.drop=-[drop capabilities: all|cap1,cap2,...]: :_caps'
92 '*--caps.keep=-[keep capabilities: cap1,cap2,...]: :_caps'
93 '--cgroup=-[place the sandbox in the specified control group]: :'
94 '--cpu=-[set cpu affinity]: :->cpus'
95 '*--deny=-[deny access to directory or file]: :_files'
96 "--deterministic-exit-code[always exit with first child's status code]"
97 '*--dns=-[set DNS server]: :'
98 '*--env=-[set environment variable]: :'
99 '--hostname=-[set sandbox hostname]: :'
100 '--hosts-file=-[use file as /etc/hosts]: :_files'
101 '*--ignore=-[ignore command in profile files]: :'
102 '--ipc-namespace[enable a new IPC namespace]'
103 '--join-or-start=-[join the sandbox or start a new one name|pid]: :_all_firejails'
104 '--keep-config-pulse[disable automatic ~/.config/pulse init]'
105 '--keep-dev-shm[/dev/shm directory is untouched (even with --private-dev)]'
106 '--keep-var-tmp[/var/tmp directory is untouched]'
107 '--machine-id[preserve /etc/machine-id]'
108 '--memory-deny-write-execute[seccomp filter to block attempts to create memory mappings that are both writable and executable]'
109 '*--mkdir=-[create a directory]:'
110 '*--mkfile=-[create a file]:'
111 '--name=-[set sandbox name]: :'
112 '--net=none[enable a new, unconnected network namespace]'
113 # Sample values as I don't think
114 # many would enjoy getting a list from -20..20
115 '--nice=-[set nice value]: :(1 10 15 20)'
116 '--no3d[disable 3D hardware acceleration]'
117 '--noautopulse[disable automatic ~/.config/pulse init]'
118 '--nodeny=-[disable deny command for file or directory]: :_files'
119 '--nodbus[disable D-Bus access]'
120 '--nodvd[disable DVD and audio CD devices]'
121 '*--noexec=-[remount the file or directory noexec nosuid and nodev]: :_files'
122 '--nogroups[disable supplementary groups]'
123 '--noinput[disable input devices]'
124 '--nonewprivs[sets the NO_NEW_PRIVS prctl]'
125 '--nosound[disable sound system]'
126 '--nou2f[disable U2F devices]'
127 '--novideo[disable video devices]'
128 '--private[temporary home directory]'
129 '--private=-[use directory as user home]: :_files -/'
130 '--private-bin=-[build a new /bin in a temporary filesystem, and copy the programs in the list]: :_files -W /usr/bin'
131 '--private-cwd[do not inherit working directory inside jail]'
132 '--private-cwd=-[set working directory inside jail]: :_files -/'
133 '--private-dev[create a new /dev directory with a small number of common device files]'
134 '(--writable-etc)--private-etc=-[build a new /etc in a temporary filesystem, and copy the files and directories in the list]: :_files -W /etc'
135 '--private-opt=-[build a new /opt in a temporary filesystem]: :_files -W /opt'
136 '--private-srv=-[build a new /srv in a temporary filesystem]: :_files -W /srv'
137 '--private-tmp[mount a tmpfs on top of /tmp directory]'
138 '*--protocol=-[enable protocol filter]: :_values -s , protocols unix inet inet6 netlink packet bluetooth'
139 "--quiet[turn off Firejail's output.]"
140 '*--read-only=-[set directory or file read-only]: :_files'
141 '*--read-write=-[set directory or file read-write]: :_files'
142 "--rlimit-as=-[set the maximum size of the process's virtual memory (address space) in bytes]: :"
143 '--rlimit-cpu=-[set the maximum CPU time in seconds]: :'
144 '--rlimit-fsize=-[set the maximum file size that can be created by a process]: :'
145 '--rlimit-nofile=-[set the maximum number of files that can be opened by a process]: :'
146 '--rlimit-nproc=-[set the maximum number of processes that can be created for the real user ID of the calling process]: :'
147 '--rlimit-sigpending=-[set the maximum number of pending signals for a process]: :'
148 '*--rmenv=-[remove environment variable in the new sandbox]: :_values environment-variables $(env | cut -d= -f1)'
149 '--seccomp[enable seccomp filter and drop the default syscalls]: :'
150 '--seccomp=-[enable seccomp filter, drop the default syscall list and the syscalls specified by the command]: :->seccomp'
151 '--seccomp.block-secondary[build only the native architecture filters]'
152 '*--seccomp.drop=-[enable seccomp filter, and drop the syscalls specified by the command]: :->seccomp'
153 '*--seccomp.keep=-[enable seccomp filter, and allow the syscalls specified by the command]: :->seccomp'
154 '*--seccomp.32.drop=-[enable seccomp filter, and drop the 32 bit syscalls specified by the command]: :'
155 '*--seccomp.32.keep=-[enable seccomp filter, and drop the 32 bit syscalls specified by the command]: :'
156 # FIXME: Add errnos
157 '--seccomp-error-action=-[change error code, kill process or log the attempt]: :(kill log)'
158 '--shell=none[run the program directly without a user shell]'
159 '--shell=-[set default user shell]: :_values $(cat /etc/shells)'
160 '--timeout=-[kill the sandbox automatically after the time has elapsed]: :'
161 #'(--tracelog)--trace[trace open, access and connect system calls]'
162 '(--tracelog)--trace=-[trace open, access and connect system calls]: :_files'
163 '(--trace)--tracelog[add a syslog message for every access to files or directories dropped by the security profile]'
164 '(--private-etc)--writable-etc[/etc directory is mounted read-write]'
165 '--writable-run-user[allow access to /run/user/$UID/systemd and /run/user/$UID/gnupg]'
166 '--writable-var[/var directory is mounted read-write]'
167 '--writable-var-log[use the real /var/log directory, not a clone]'
168
169#ifdef HAVE_APPARMOR
170 '--apparmor[enable AppArmor confinement]'
171 '--apparmor.print=-[print apparmor status name|pid]:firejail:_all_firejails'
172#endif
173
174#ifdef HAVE_CHROOT
175 '(--noroot --overlay --overlay-named --overlay-tmpfs)--chroot=-[chroot into directory]: :_files -/'
176#endif
177
178#ifdef HAVE_DBUSPROXY
179 # FIXME: _xx_bus_names is actually wrong for --dbus-*.{broadcast,call}.
180 # We can steal some function from https://github.com/systemd/systemd/blob/main/shell-completion/zsh/_busctl
181 '--dbus-log=-[set DBus log file location]: :_files'
182 '--dbus-system=-[set system DBus access policy]: :(filter none)'
183 '--dbus-system.broadcast=-[allow signals on the system DBus according to rule]: :_system_bus_names'
184 '--dbus-system.call=-[allow calls on the system DBus according to rule]: :_system_bus_names'
185 '--dbus-system.own=-[allow ownership of name on the system DBus]: :_system_bus_names'
186 '--dbus-system.see=-[allow seeing name on the system DBus]: :_system_bus_names'
187 '--dbus-system.talk=-[allow talking to name on the system DBus]: :_system_bus_names'
188 '--dbus-user=-[set session DBus access policy or none]: :(filter none)'
189 '--dbus-user.broadcast=-[allow signals on the session DBus according to rule]: :_session_bus_names'
190 '--dbus-user.call=-[allow calls on the session DBus according to rule]: :_session_bus_names'
191 '--dbus-user.own=-[allow ownership of name on the session DBus]: :_session_bus_names'
192 '--dbus-user.see=-[allow seeing name on the session DBus]: :_session_bus_names'
193 '--dbus-user.talk=-[allow talking to name on the session DBus]: :_session_bus_names'
194#endif
195
196#ifdef HAVE_FILE_TRANSFER
197 '--cat=-[print content of file from sandbox container name|pid]: :_all_firejails'
198 '--get=-[get a file from sandbox container name|pid]: :_all_firejails'
199 # --put=name|pid src-filename dest-filename - put a file in sandbox container.
200 '--put=-[put a file in sandbox container]: :'
201 '--ls=-[list files in sandbox container name|pid]: :_all_firejails'
202#endif
203
204#ifdef HAVE_FIRETUNNEL
205 '--tunnel=-[connect the sandbox to a tunnel created by firetunnel utility]: :'
206#endif
207
208#ifdef HAVE_NETWORK
209 '--bandwidth=-[set bandwidth limits name|pid]: :_all_firejails'
210 '--defaultgw=[configure default gateway]: :'
211 '--dns.print=-[print DNS configuration name|pid]: :_all_firejails'
212 '--join-network=-[join the network namespace name|pid]: :_all_firejails'
213 '--mac=-[set interface MAC address]: :(xx\:xx\:xx\:xx\:xx\:xx)'
214 '--mtu=-[set interface MTU]: :'
215 '--net=-[enable network namespaces and connect to this bridge or Ethernet interface (or none to disable)]: :->net_or_none'
216 '--net.print=-[print network interface configuration name|pid]: :_all_firejails'
217 '--netfilter=-[enable firewall]: :'
218 '--netfilter.print=-[print the firewall name|pid]: :_all_firejails'
219 '--netfilter6=-[enable IPv6 firewall]: :'
220 '--netfilter6.print=-[print the IPv6 firewall name|pid]: :_all_firejails'
221 '--netmask=-[define a network mask when dealing with unconfigured parent interfaces]: :'
222 '--netns=-[Run the program in a named, persistent network namespace]: :'
223 '--netstats[monitor network statistics]'
224 '--interface=-[move interface in sandbox]: :'
225 '--ip=-[set interface IP address none|dhcp|ADDRESS]: :(none dhcp)'
226 '--ip6=-[set interface IPv6 address or use dhcp via dhclient]: :(dhcp)'
227 '--iprange=-[configure an IP address in this range]: :'
228 '--scan[ARP-scan all the networks from inside a network namespace]'
229 '--veth-name=-[use this name for the interface connected to the bridge]: :'
230#endif
231
232#ifdef HAVE_OUTPUT
233 '--output=-[stdout logging and log rotation]: :_files'
234 '--output-stderr=-[stdout and stderr logging and log rotation]: :_files'
235#endif
236
237#ifdef HAVE_OVERLAYFS
238 '(--chroot --noroot)--overlay[mount a filesystem overlay on top of the current filesystem]'
239 '--overlay-clean[clean all overlays stored in $HOME/.firejail directory]'
240 '(--chroot --noroot)--overlay-named=-[mount a filesystem overlay on top of the current filesystem, and store it in name directory]: :_files -/'
241 '(--chroot --noroot)--overlay-tmpfs[mount a temporary filesystem overlay on top of the current filesystem]'
242#endif
243
244#ifdef HAVE_PRIVATE_HOME
245 '--private-home=-[build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home]: :_files'
246#endif
247
248#ifdef HAVE_USERNS
249 '(--chroot --overlay --overlay-named --overlay-tmpfs)--noroot[install a user namespace with only the current user]'
250#endif
251
252#ifdef HAVE_USERTMPFS
253 '--private-cache[temporary ~/.cache directory]'
254 '*--tmpfs=-[mount a tmpfs filesystem on directory dirname]: :_files -/'
255#endif
256
257 '*--noallow=-[disable allow command for file or directory]: :_files'
258 '*--allow=-[allow file system access]: :_files'
259
260#ifdef HAVE_X11
261 '--x11[enable X11 sandboxing. The software checks first if Xpra is installed, then it checks if Xephyr is installed. If all fails, it will attempt to use X11 security extension]'
262 '--x11=-[disable or enable specific X11 server]: :(none xephyr xorg xpra xvfb)'
263 '--xephyr-screen=-[set screen size for --x11=xephyr]: :(WIDTHxHEIGHT)'
264#endif
265)
266
267
268_firejail() {
269 _arguments -S $_firejail_args
270 case "$state" in
271 cpus)
272 _values -s "," 'cpus' $(_all_cpus)
273 ;;
274 net_or_none)
275 local netdevs=($(ip link | awk '{print $2}' | grep '^.*:$' | tr -d ':'))
276 local net_and_none=(none $netdevs)
277 _values 'net' $net_and_none
278 ;;
279 seccomp)
280 # TODO: syscall groups
281 _values -s "," 'syscalls' $(firejail --debug-syscalls | cut -d" " -f2)
282 ;;
283 esac
284}
285
286# vim: ft=zsh sw=4 ts=4 et sts=4 ai
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 000000000..264314a3b
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,14 @@
1TESTS=$(patsubst %/,%,$(wildcard */))
2
3.PHONY: $(TESTS)
4$(TESTS):
5 cd $@ && ./$@.sh 2>&1 | tee $@.log
6 cd $@ && grep -a TESTING $@.log && grep -a -L "TESTING ERROR" $@.log
7
8.PHONY: clean
9clean:
10 for test in $(TESTS); do rm -f "$$test/$$test.log"; done
11
12.PHONY: distclean
13distclean: clean
14 rm -f Makefile
diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp
index a2cc9285e..eecb9bf82 100755
--- a/test/appimage/appimage-args.exp
+++ b/test/appimage/appimage-args.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -56,7 +56,7 @@ expect {
56sleep 2 56sleep 2
57 57
58spawn $env(SHELL) 58spawn $env(SHELL)
59send -- "firemon --seccomp\r" 59send -- "firemon --seccomp --wrap\r"
60expect { 60expect {
61 timeout {puts "TESTING ERROR 8\n";exit} 61 timeout {puts "TESTING ERROR 8\n";exit}
62 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 62 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -71,7 +71,7 @@ expect {
71 "name=blablabla" 71 "name=blablabla"
72} 72}
73after 100 73after 100
74send -- "firemon --caps\r" 74send -- "firemon --caps --wrap\r"
75expect { 75expect {
76 timeout {puts "TESTING ERROR 11\n";exit} 76 timeout {puts "TESTING ERROR 11\n";exit}
77 "appimage Leafpad" 77 "appimage Leafpad"
@@ -95,8 +95,8 @@ send -- "firejail --shutdown=appimage-test\r"
95 95
96set spawn_id $appimage_id 96set spawn_id $appimage_id
97expect { 97expect {
98 timeout {puts "TESTING ERROR 15\n";exit} 98 timeout {puts "shutdown\n";exit}
99 "AppImage unmounted" 99 "AppImage detached"
100} 100}
101 101
102after 100 102after 100
diff --git a/test/tty.exp b/test/appimage/appimage-trace.exp
index 0d66f5ce7..2f67eb531 100755
--- a/test/tty.exp
+++ b/test/appimage/appimage-trace.exp
@@ -1,96 +1,68 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
5match_max 100000 8match_max 100000
9set appimage_id $spawn_id
6 10
7send -- "firejail\r" 11send -- "firejail --trace --timeout=00:00:05 --appimage Leafpad-0.8.17-x86_64.AppImage\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 2
13send -- "xterm &\r"
14sleep 2
15send -- "urxvt &\r"
16sleep 2
17send -- "rxvt &\r"
18sleep 2
19
20send -- "ps aux\r"
21expect { 12expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
23 "USER" 14 "Child process initialized"
24} 15}
25expect { 16expect {
26 timeout {puts "TESTING ERROR 2\n";exit} 17 timeout {puts "TESTING ERROR 2\n";exit}
27 "xterm" 18 "leafpad:socket"
28} 19}
29expect { 20expect {
30 timeout {puts "TESTING ERROR 3\n";exit} 21 timeout {puts "TESTING ERROR 3\n";exit}
31 "urxvt" 22 "leafpad:connect"
32} 23}
33expect { 24expect {
34 timeout {puts "TESTING ERROR 4\n";exit} 25 timeout {puts "TESTING ERROR 4\n";exit}
35 "rxvt" 26 "X11-unix/X0"
36} 27}
37expect { 28expect {
38 timeout {puts "TESTING ERROR 5\n";exit} 29 timeout {puts "TESTING ERROR 5\n";exit}
39 "ps aux" 30 "Parent is shutting down, bye"
40} 31}
41
42send -- "pkill xterm\r"
43sleep 1
44send -- "pkill urxvt\r"
45sleep 1
46send -- "pkill rxvt\r"
47sleep 1
48send -- "exit\r"
49sleep 2
50
51
52send -- "firejail --private-dev\r"
53expect { 32expect {
54 timeout {puts "TESTING ERROR 10\n";exit} 33 timeout {puts "shutdown\n"}
55 "Child process initialized" 34 "AppImage detached"
56} 35}
57sleep 2 36sleep 1
58send -- "xterm &\r"
59sleep 2
60send -- "urxvt &\r"
61sleep 2
62send -- "rxvt &\r"
63sleep 2
64 37
65send -- "ps aux\r" 38send -- "firejail --trace --timeout=00:00:05 --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r"
66expect { 39expect {
67 timeout {puts "TESTING ERROR 11\n";exit} 40 timeout {puts "TESTING ERROR 11\n";exit}
68 "USER" 41 "Child process initialized"
69} 42}
70expect { 43expect {
71 timeout {puts "TESTING ERROR 12\n";exit} 44 timeout {puts "TESTING ERROR 12\n";exit}
72 "xterm" 45 "leafpad:socket"
73} 46}
74expect { 47expect {
75 timeout {puts "TESTING ERROR 13\n";exit} 48 timeout {puts "TESTING ERROR 13\n";exit}
76 "urxvt" 49 "leafpad:connect"
77} 50}
78expect { 51expect {
79 timeout {puts "TESTING ERROR 14\n";exit} 52 timeout {puts "TESTING ERROR 14\n";exit}
80 "rxvt" 53 "X11-unix/X0"
81} 54}
82expect { 55expect {
83 timeout {puts "TESTING ERROR 15\n";exit} 56 timeout {puts "TESTING ERROR 15\n";exit}
84 "ps aux" 57 "Parent is shutting down, bye"
58}
59expect {
60 timeout {puts "shutdown\n"}
61 "AppImage detached"
85} 62}
86
87send -- "pkill xterm\r"
88sleep 1
89send -- "pkill urxvt\r"
90sleep 1
91send -- "pkill rxvt\r"
92sleep 1 63sleep 1
93send -- "exit\r"
94sleep 2
95 64
96puts "\n" 65
66after 100
67
68puts "\nall done\n"
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp
index 86a968125..b8b6e0c96 100755
--- a/test/appimage/appimage-v1.exp
+++ b/test/appimage/appimage-v1.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -44,7 +44,7 @@ expect {
44sleep 2 44sleep 2
45 45
46spawn $env(SHELL) 46spawn $env(SHELL)
47send -- "firemon --seccomp\r" 47send -- "firemon --seccomp --wrap\r"
48expect { 48expect {
49 timeout {puts "TESTING ERROR 5\n";exit} 49 timeout {puts "TESTING ERROR 5\n";exit}
50 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 50 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -59,7 +59,7 @@ expect {
59 "name=blablabla" 59 "name=blablabla"
60} 60}
61after 100 61after 100
62send -- "firemon --caps\r" 62send -- "firemon --caps --wrap\r"
63expect { 63expect {
64 timeout {puts "TESTING ERROR 6\n";exit} 64 timeout {puts "TESTING ERROR 6\n";exit}
65 "appimage Leafpad" 65 "appimage Leafpad"
@@ -83,8 +83,8 @@ send -- "firejail --shutdown=appimage-test\r"
83 83
84set spawn_id $appimage_id 84set spawn_id $appimage_id
85expect { 85expect {
86 timeout {puts "TESTING ERROR 7\n";exit} 86 timeout {puts "shutdown\n"}
87 "AppImage unmounted" 87 "AppImage detached"
88} 88}
89 89
90after 100 90after 100
diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp
index f89ac008c..243824f75 100755
--- a/test/appimage/appimage-v2.exp
+++ b/test/appimage/appimage-v2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -82,8 +82,8 @@ spawn $env(SHELL)
82send -- "firejail --shutdown=appimage-test\r" 82send -- "firejail --shutdown=appimage-test\r"
83set spawn_id $appimage_id 83set spawn_id $appimage_id
84expect { 84expect {
85 timeout {puts "TESTING ERROR 7\n";exit} 85 timeout {puts "shutdown\n"}
86 "AppImage unmounted" 86 "AppImage detached"
87} 87}
88 88
89after 100 89after 100
diff --git a/test/appimage/appimage.sh b/test/appimage/appimage.sh
index 4221944e2..e766b1acd 100755
--- a/test/appimage/appimage.sh
+++ b/test/appimage/appimage.sh
@@ -1,10 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9echo "TESTING: AppImage v1 (test/appimage/appimage-v1.exp)" 10echo "TESTING: AppImage v1 (test/appimage/appimage-v1.exp)"
10./appimage-v1.exp 11./appimage-v1.exp
@@ -17,3 +18,6 @@ echo "TESTING: AppImage file name (test/appimage/filename.exp)";
17 18
18echo "TESTING: AppImage argsv1 (test/appimage/appimage-args.exp)" 19echo "TESTING: AppImage argsv1 (test/appimage/appimage-args.exp)"
19./appimage-args.exp 20./appimage-args.exp
21
22echo "TESTING: AppImage trace (test/appimage/appimage-trace.exp)"
23./appimage-trace.exp
diff --git a/test/appimage/filename.exp b/test/appimage/filename.exp
index ebf2125f0..54d8d722d 100755
--- a/test/appimage/filename.exp
+++ b/test/appimage/filename.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -17,7 +17,7 @@ after 100
17send -- "firejail --appimage /etc/shadow\r" 17send -- "firejail --appimage /etc/shadow\r"
18expect { 18expect {
19 timeout {puts "TESTING ERROR 2\n";exit} 19 timeout {puts "TESTING ERROR 2\n";exit}
20 "cannot access" 20 "cannot read"
21} 21}
22after 100 22after 100
23 23
diff --git a/test/apps-x11-xorg/apps-x11-xorg.sh b/test/apps-x11-xorg/apps-x11-xorg.sh
index 6f051b28d..7f37914aa 100755
--- a/test/apps-x11-xorg/apps-x11-xorg.sh
+++ b/test/apps-x11-xorg/apps-x11-xorg.sh
@@ -1,12 +1,13 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9which firefox 10which firefox 2>/dev/null
10if [ "$?" -eq 0 ]; 11if [ "$?" -eq 0 ];
11then 12then
12 echo "TESTING: firefox x11 xorg" 13 echo "TESTING: firefox x11 xorg"
@@ -15,7 +16,7 @@ else
15 echo "TESTING SKIP: firefox not found" 16 echo "TESTING SKIP: firefox not found"
16fi 17fi
17 18
18which transmission-gtk 19which transmission-gtk 2>/dev/null
19if [ "$?" -eq 0 ]; 20if [ "$?" -eq 0 ];
20then 21then
21 echo "TESTING: transmission-gtk x11 xorg" 22 echo "TESTING: transmission-gtk x11 xorg"
@@ -24,7 +25,16 @@ else
24 echo "TESTING SKIP: transmission-gtk not found" 25 echo "TESTING SKIP: transmission-gtk not found"
25fi 26fi
26 27
27which thunderbird 28which transmission-qt 2>/dev/null
29if [ "$?" -eq 0 ];
30then
31 echo "TESTING: transmission-qt x11 xorg"
32 ./transmission-qt.exp
33else
34 echo "TESTING SKIP: transmission-qt not found"
35fi
36
37which thunderbird 2>/dev/null
28if [ "$?" -eq 0 ]; 38if [ "$?" -eq 0 ];
29then 39then
30 echo "TESTING: thunderbird x11 xorg" 40 echo "TESTING: thunderbird x11 xorg"
diff --git a/test/apps-x11-xorg/firefox.exp b/test/apps-x11-xorg/firefox.exp
index a0e8284d3..12fcc13ce 100755
--- a/test/apps-x11-xorg/firefox.exp
+++ b/test/apps-x11-xorg/firefox.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -41,7 +41,7 @@ expect {
41sleep 2 41sleep 2
42 42
43spawn $env(SHELL) 43spawn $env(SHELL)
44send -- "firemon --seccomp --nowrap\r" 44send -- "firemon --seccomp --wrap\r"
45expect { 45expect {
46 timeout {puts "TESTING ERROR 5\n";exit} 46 timeout {puts "TESTING ERROR 5\n";exit}
47 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 47 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -61,7 +61,7 @@ expect {
61 "name=blablabla" 61 "name=blablabla"
62} 62}
63sleep 1 63sleep 1
64send -- "firemon --caps --nowrap\r" 64send -- "firemon --caps --wrap\r"
65expect { 65expect {
66 timeout {puts "TESTING ERROR 6\n";exit} 66 timeout {puts "TESTING ERROR 6\n";exit}
67 " firefox" {puts "firefox detected\n";} 67 " firefox" {puts "firefox detected\n";}
diff --git a/test/apps-x11-xorg/thunderbird.exp b/test/apps-x11-xorg/thunderbird.exp
index 42220b52e..5c810c517 100755
--- a/test/apps-x11-xorg/thunderbird.exp
+++ b/test/apps-x11-xorg/thunderbird.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -38,7 +38,7 @@ expect {
38sleep 2 38sleep 2
39 39
40spawn $env(SHELL) 40spawn $env(SHELL)
41send -- "firemon --seccomp --nowrap\r" 41send -- "firemon --seccomp --wrap\r"
42expect { 42expect {
43 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
44 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 44 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -57,7 +57,7 @@ expect {
57 "name=blablabla" 57 "name=blablabla"
58} 58}
59sleep 2 59sleep 2
60send -- "firemon --caps --nowrap\r" 60send -- "firemon --caps --wrap\r"
61expect { 61expect {
62 timeout {puts "TESTING ERROR 6\n";exit} 62 timeout {puts "TESTING ERROR 6\n";exit}
63 ":firejail" 63 ":firejail"
diff --git a/test/apps-x11-xorg/transmission-gtk.exp b/test/apps-x11-xorg/transmission-gtk.exp
index aec4c46ad..e0f519c00 100755
--- a/test/apps-x11-xorg/transmission-gtk.exp
+++ b/test/apps-x11-xorg/transmission-gtk.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -38,7 +38,7 @@ expect {
38sleep 2 38sleep 2
39 39
40spawn $env(SHELL) 40spawn $env(SHELL)
41send -- "firemon --seccomp --nowrap\r" 41send -- "firemon --seccomp --wrap\r"
42expect { 42expect {
43 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
44 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 44 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
@@ -57,7 +57,7 @@ expect {
57 "name=blablabla" 57 "name=blablabla"
58} 58}
59sleep 1 59sleep 1
60send -- "firemon --caps --nowrap\r" 60send -- "firemon --caps --wrap\r"
61expect { 61expect {
62 timeout {puts "TESTING ERROR 6\n";exit} 62 timeout {puts "TESTING ERROR 6\n";exit}
63 ":firejail" 63 ":firejail"
diff --git a/test/apps-x11-xorg/transmission-qt.exp b/test/apps-x11-xorg/transmission-qt.exp
new file mode 100755
index 000000000..02a015968
--- /dev/null
+++ b/test/apps-x11-xorg/transmission-qt.exp
@@ -0,0 +1,85 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test --x11=xorg --ignore=net --ignore=netfilter --ignore=iprange transmission-qt\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "transmission-qt"
22}
23sleep 1
24
25# grsecurity exit
26send -- "file /proc/sys/kernel/grsecurity\r"
27expect {
28 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
29 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
30 "cannot open" {puts "grsecurity not present\n"}
31}
32
33send -- "firejail --name=blablabla\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "Child process initialized"
37}
38sleep 2
39
40spawn $env(SHELL)
41send -- "firemon --seccomp --wrap\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
45 ":firejail"
46}
47expect {
48 timeout {puts "TESTING ERROR 5.0\n";exit}
49 "transmission-qt"
50}
51expect {
52 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
53 "Seccomp: 2"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1\n";exit}
57 "name=blablabla"
58}
59sleep 1
60send -- "firemon --caps --wrap\r"
61expect {
62 timeout {puts "TESTING ERROR 6\n";exit}
63 ":firejail"
64}
65expect {
66 timeout {puts "TESTING ERROR 6.0\n";exit}
67 "transmission-qt"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81sleep 1
82send -- "firejail --shutdown=test\r"
83sleep 3
84
85puts "\nall done\n"
diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh
index 1e98b74fd..9954cb736 100755
--- a/test/apps-x11/apps-x11.sh
+++ b/test/apps-x11/apps-x11.sh
@@ -1,29 +1,30 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9echo "TESTING: no x11 (test/apps-x11/x11-none.exp)" 10echo "TESTING: no x11 (test/apps-x11/x11-none.exp)"
10./x11-none.exp 11./x11-none.exp
11 12
12 13
13which xterm 14which xterm 2>/dev/null
14if [ "$?" -eq 0 ]; 15if [ "$?" -eq 0 ];
15then 16then
16 echo "TESTING: xterm x11 xorg" 17 echo "TESTING: xterm x11 xorg"
17 ./xterm-xorg.exp 18 ./xterm-xorg.exp
18 19
19 which xpra 20 which xpra 2>/dev/null
20 if [ "$?" -eq 0 ]; 21 if [ "$?" -eq 0 ];
21 then 22 then
22 echo "TESTING: xterm x11 xpra" 23 echo "TESTING: xterm x11 xpra"
23 ./xterm-xpra.exp 24 ./xterm-xpra.exp
24 fi 25 fi
25 26
26 which Xephyr 27 which Xephyr 2>/dev/null
27 if [ "$?" -eq 0 ]; 28 if [ "$?" -eq 0 ];
28 then 29 then
29 echo "TESTING: xterm x11 xephyr" 30 echo "TESTING: xterm x11 xephyr"
@@ -34,13 +35,13 @@ else
34fi 35fi
35 36
36# check xpra/xephyr 37# check xpra/xephyr
37which xpra 38which xpra 2>/dev/null
38if [ "$?" -eq 0 ]; 39if [ "$?" -eq 0 ];
39then 40then
40 echo "xpra found" 41 echo "xpra found"
41else 42else
42 echo "xpra not found" 43 echo "xpra not found"
43 which Xephyr 44 which Xephyr 2>/dev/null
44 if [ "$?" -eq 0 ]; 45 if [ "$?" -eq 0 ];
45 then 46 then
46 echo "Xephyr found" 47 echo "Xephyr found"
@@ -50,7 +51,7 @@ else
50 fi 51 fi
51fi 52fi
52 53
53which firefox 54which firefox 2>/dev/null
54if [ "$?" -eq 0 ]; 55if [ "$?" -eq 0 ];
55then 56then
56 echo "TESTING: firefox x11" 57 echo "TESTING: firefox x11"
@@ -59,7 +60,7 @@ else
59 echo "TESTING SKIP: firefox not found" 60 echo "TESTING SKIP: firefox not found"
60fi 61fi
61 62
62which chromium 63which chromium 2>/dev/null
63if [ "$?" -eq 0 ]; 64if [ "$?" -eq 0 ];
64then 65then
65 echo "TESTING: chromium x11" 66 echo "TESTING: chromium x11"
@@ -68,7 +69,7 @@ else
68 echo "TESTING SKIP: chromium not found" 69 echo "TESTING SKIP: chromium not found"
69fi 70fi
70 71
71which transmission-gtk 72which transmission-gtk 2>/dev/null
72if [ "$?" -eq 0 ]; 73if [ "$?" -eq 0 ];
73then 74then
74 echo "TESTING: transmission-gtk x11" 75 echo "TESTING: transmission-gtk x11"
@@ -77,7 +78,7 @@ else
77 echo "TESTING SKIP: transmission-gtk not found" 78 echo "TESTING SKIP: transmission-gtk not found"
78fi 79fi
79 80
80which thunderbird 81which thunderbird 2>/dev/null
81if [ "$?" -eq 0 ]; 82if [ "$?" -eq 0 ];
82then 83then
83 echo "TESTING: thunderbird x11" 84 echo "TESTING: thunderbird x11"
diff --git a/test/apps-x11/chromium.exp b/test/apps-x11/chromium.exp
index a7eace125..92739048c 100755
--- a/test/apps-x11/chromium.exp
+++ b/test/apps-x11/chromium.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/firefox.exp b/test/apps-x11/firefox.exp
index c77d120a8..69efc79d9 100755
--- a/test/apps-x11/firefox.exp
+++ b/test/apps-x11/firefox.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/thunderbird.exp b/test/apps-x11/thunderbird.exp
index 604a6a0d3..7cfc957b7 100755
--- a/test/apps-x11/thunderbird.exp
+++ b/test/apps-x11/thunderbird.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/transmission-gtk.exp b/test/apps-x11/transmission-gtk.exp
index 8403b7a9f..53e396a9e 100755
--- a/test/apps-x11/transmission-gtk.exp
+++ b/test/apps-x11/transmission-gtk.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/x11-none.exp b/test/apps-x11/x11-none.exp
index e811533f9..b45751aa7 100755
--- a/test/apps-x11/x11-none.exp
+++ b/test/apps-x11/x11-none.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/x11-xephyr.exp b/test/apps-x11/x11-xephyr.exp
index 3f032ae4a..3da0e1a46 100755
--- a/test/apps-x11/x11-xephyr.exp
+++ b/test/apps-x11/x11-xephyr.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/xterm-xephyr.exp b/test/apps-x11/xterm-xephyr.exp
index b1ee9e5b4..5edbadad9 100755
--- a/test/apps-x11/xterm-xephyr.exp
+++ b/test/apps-x11/xterm-xephyr.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/xterm-xorg.exp b/test/apps-x11/xterm-xorg.exp
index 76c6891ea..a2a027729 100755
--- a/test/apps-x11/xterm-xorg.exp
+++ b/test/apps-x11/xterm-xorg.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps-x11/xterm-xpra.exp b/test/apps-x11/xterm-xpra.exp
index 6425412c9..0f1458d15 100755
--- a/test/apps-x11/xterm-xpra.exp
+++ b/test/apps-x11/xterm-xpra.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/apps.sh b/test/apps/apps.sh
index 86b7f636e..c332fe416 100755
--- a/test/apps/apps.sh
+++ b/test/apps/apps.sh
@@ -1,179 +1,22 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8export LC_ALL=C
9which firefox 9
10if [ "$?" -eq 0 ]; 10LIST="firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird "
11then 11LIST+="vlc fbreader deluge gnome-mplayer xchat wine kcalc ktorrent hexchat"
12 echo "TESTING: firefox" 12
13 ./firefox.exp 13for app in $LIST; do
14else 14 which $app 2>/dev/null
15 echo "TESTING SKIP: firefox not found" 15 if [ "$?" -eq 0 ];
16fi 16 then
17 17 echo "TESTING: $app"
18which midori 18 ./$app.exp
19if [ "$?" -eq 0 ]; 19 else
20then 20 echo "TESTING SKIP: $app not found"
21 echo "TESTING: midori" 21 fi
22 ./midori.exp 22done
23else
24 echo "TESTING SKIP: midori not found"
25fi
26
27which chromium
28if [ "$?" -eq 0 ];
29then
30 echo "TESTING: chromium"
31 ./chromium.exp
32else
33 echo "TESTING SKIP: chromium not found"
34fi
35
36which opera
37if [ "$?" -eq 0 ];
38then
39 echo "TESTING: opera"
40 ./opera.exp
41else
42 echo "TESTING SKIP: opera not found"
43fi
44
45which transmission-gtk
46if [ "$?" -eq 0 ];
47then
48 echo "TESTING: transmission-gtk"
49 ./transmission-gtk.exp
50else
51 echo "TESTING SKIP: transmission-gtk not found"
52fi
53
54which transmission-qt
55if [ "$?" -eq 0 ];
56then
57 echo "TESTING: transmission-qt"
58 ./transmission-qt.exp
59else
60 echo "TESTING SKIP: transmission-qt not found"
61fi
62
63which qbittorrent
64if [ "$?" -eq 0 ];
65then
66 echo "TESTING: qbittorrent"
67 ./qbittorrent.exp
68else
69 echo "TESTING SKIP: qbittorrent not found"
70fi
71
72which uget-gtk
73if [ "$?" -eq 0 ];
74then
75 echo "TESTING: uget"
76 ./uget-gtk.exp
77else
78 echo "TESTING SKIP: uget-gtk not found"
79fi
80
81which filezilla
82if [ "$?" -eq 0 ];
83then
84 echo "TESTING: filezilla"
85 ./filezilla.exp
86else
87 echo "TESTING SKIP: filezilla not found"
88fi
89
90which evince
91if [ "$?" -eq 0 ];
92then
93 echo "TESTING: evince"
94 ./evince.exp
95else
96 echo "TESTING SKIP: evince not found"
97fi
98
99
100which gthumb
101if [ "$?" -eq 0 ];
102then
103 echo "TESTING: gthumb"
104 ./gthumb.exp
105else
106 echo "TESTING SKIP: gthumb not found"
107fi
108
109which thunderbird
110if [ "$?" -eq 0 ];
111then
112 echo "TESTING: thunderbird"
113 ./thunderbird.exp
114else
115 echo "TESTING SKIP: thunderbird not found"
116fi
117
118which vlc
119if [ "$?" -eq 0 ];
120then
121 echo "TESTING: vlc"
122 ./vlc.exp
123else
124 echo "TESTING SKIP: vlc not found"
125fi
126
127which fbreader
128if [ "$?" -eq 0 ];
129then
130 echo "TESTING: fbreader"
131 ./fbreader.exp
132else
133 echo "TESTING SKIP: fbreader not found"
134fi
135
136which deluge
137if [ "$?" -eq 0 ];
138then
139 echo "TESTING: deluge"
140 ./deluge.exp
141else
142 echo "TESTING SKIP: deluge not found"
143fi
144
145which gnome-mplayer
146if [ "$?" -eq 0 ];
147then
148 echo "TESTING: gnome-mplayer"
149 ./gnome-mplayer.exp
150else
151 echo "TESTING SKIP: gnome-mplayer not found"
152fi
153
154which xchat
155if [ "$?" -eq 0 ];
156then
157 echo "TESTING: xchat"
158 ./xchat.exp
159else
160 echo "TESTING SKIP: xchat not found"
161fi
162
163which hexchat
164if [ "$?" -eq 0 ];
165then
166 echo "TESTING: hexchat"
167 ./hexchat.exp
168else
169 echo "TESTING SKIP: hexchat not found"
170fi
171
172which wine
173if [ "$?" -eq 0 ];
174then
175 echo "TESTING: wine"
176 ./wine.exp
177else
178 echo "TESTING SKIP: wine not found"
179fi
diff --git a/test/apps/chromium.exp b/test/apps/chromium.exp
index 6b784e395..d65bc93a9 100755
--- a/test/apps/chromium.exp
+++ b/test/apps/chromium.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/deluge.exp b/test/apps/deluge.exp
index 004b8d144..25c98623c 100755
--- a/test/apps/deluge.exp
+++ b/test/apps/deluge.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/fbreader.exp b/test/apps/fbreader.exp
index d0ad8be0a..67301c1d2 100755
--- a/test/apps/fbreader.exp
+++ b/test/apps/fbreader.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/filezilla.exp b/test/apps/filezilla.exp
index da8c23773..da37f1eff 100755
--- a/test/apps/filezilla.exp
+++ b/test/apps/filezilla.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/firefox.exp b/test/apps/firefox.exp
index 84504ccbf..2a6f18276 100755
--- a/test/apps/firefox.exp
+++ b/test/apps/firefox.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/gnome-mplayer.exp b/test/apps/gnome-mplayer.exp
index d0c370df0..564220d95 100755
--- a/test/apps/gnome-mplayer.exp
+++ b/test/apps/gnome-mplayer.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/gthumb.exp b/test/apps/gthumb.exp
index 9edcd68fe..569adcd34 100755
--- a/test/apps/gthumb.exp
+++ b/test/apps/gthumb.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/hexchat.exp b/test/apps/hexchat.exp
index 9d78a9676..adea02216 100755
--- a/test/apps/hexchat.exp
+++ b/test/apps/hexchat.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -50,7 +50,7 @@ send -- "firemon --seccomp\r"
50expect { 50expect {
51 timeout {puts "TESTING ERROR 5\n";exit} 51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 "hexchat" 53 ":firejail hexchat"
54} 54}
55expect { 55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} 56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
@@ -64,7 +64,7 @@ after 100
64send -- "firemon --caps\r" 64send -- "firemon --caps\r"
65expect { 65expect {
66 timeout {puts "TESTING ERROR 6\n";exit} 66 timeout {puts "TESTING ERROR 6\n";exit}
67 "hexchat" 67 ":firejail hexchat"
68} 68}
69expect { 69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit} 70 timeout {puts "TESTING ERROR 6.1\n";exit}
@@ -80,4 +80,4 @@ expect {
80} 80}
81after 100 81after 100
82 82
83puts "\n" 83puts "\nall done\n"
diff --git a/test/apps/kcalc.exp b/test/apps/kcalc.exp
new file mode 100755
index 000000000..aaeb5221d
--- /dev/null
+++ b/test/apps/kcalc.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail kcalc\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/kcalc.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "kcalc"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail kcalc"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail kcalc"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/apps/ktorrent.exp b/test/apps/ktorrent.exp
new file mode 100755
index 000000000..8693f5f1d
--- /dev/null
+++ b/test/apps/ktorrent.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail ktorrent\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/ktorrent.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "ktorrent"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail ktorrent"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail ktorrent"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/apps/midori.exp b/test/apps/midori.exp
index be6df1cbd..fae41e6da 100755
--- a/test/apps/midori.exp
+++ b/test/apps/midori.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/opera.exp b/test/apps/opera.exp
index eb6aef719..990476ed5 100755
--- a/test/apps/opera.exp
+++ b/test/apps/opera.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/qbittorrent.exp b/test/apps/qbittorrent.exp
index 742d9baf1..bc0386335 100755
--- a/test/apps/qbittorrent.exp
+++ b/test/apps/qbittorrent.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/thunderbird.exp b/test/apps/thunderbird.exp
index f1aad2871..10d0bb2f6 100755
--- a/test/apps/thunderbird.exp
+++ b/test/apps/thunderbird.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/transmission-qt.exp b/test/apps/transmission-qt.exp
index 63f135b1d..fec18a8bf 100755
--- a/test/apps/transmission-qt.exp
+++ b/test/apps/transmission-qt.exp
@@ -1,13 +1,13 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail transmission-qt\r" 10send -- "firejail --ignore=quiet transmission-qt\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/transmission-qt.profile" 13 "Reading profile /etc/firejail/transmission-qt.profile"
@@ -50,7 +50,7 @@ send -- "firemon --seccomp\r"
50expect { 50expect {
51 timeout {puts "TESTING ERROR 5\n";exit} 51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail transmission-qt" 53 ":firejail --ignore=quiet transmission-qt"
54} 54}
55expect { 55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} 56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
@@ -64,7 +64,7 @@ after 100
64send -- "firemon --caps\r" 64send -- "firemon --caps\r"
65expect { 65expect {
66 timeout {puts "TESTING ERROR 6\n";exit} 66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail transmission-qt" 67 ":firejail --ignore=quiet transmission-qt"
68} 68}
69expect { 69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit} 70 timeout {puts "TESTING ERROR 6.1\n";exit}
diff --git a/test/apps/uget-gtk.exp b/test/apps/uget-gtk.exp
index 05dd9edc6..caa4063b9 100755
--- a/test/apps/uget-gtk.exp
+++ b/test/apps/uget-gtk.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/vlc.exp b/test/apps/vlc.exp
index 9d75c40d6..ce3df1ba6 100755
--- a/test/apps/vlc.exp
+++ b/test/apps/vlc.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/wine.exp b/test/apps/wine.exp
index 75f044ca6..982a0c6d9 100755
--- a/test/apps/wine.exp
+++ b/test/apps/wine.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/apps/xchat.exp b/test/apps/xchat.exp
index 427e09159..9ed75d821 100755
--- a/test/apps/xchat.exp
+++ b/test/apps/xchat.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/arguments/arguments.sh b/test/arguments/arguments.sh
deleted file mode 100755
index 049236900..000000000
--- a/test/arguments/arguments.sh
+++ /dev/null
@@ -1,27 +0,0 @@
1#!/bin/bash
2
3if [ -f /etc/debian_version ]; then
4 libdir=$(dirname "$(dpkg -L firejail | grep faudit)")
5 export PATH="$PATH:$libdir"
6else
7 export PATH="$PATH:/usr/lib/firejail"
8fi
9export PATH="$PATH:/usr/lib/firejail"
10
11echo "TESTING: 1. regular bash session"
12./bashrun.exp
13sleep 1
14
15echo "TESTING: 2. symbolic link to firejail"
16./symrun.exp
17rm -fr symtest
18sleep 1
19
20echo "TESTING: 3. --join option"
21./joinrun.exp
22sleep 1
23
24echo "TESTING: 4. --output option"
25./outrun.exp
26rm out
27rm out.*
diff --git a/test/arguments/bashrun.exp b/test/arguments/bashrun.exp
deleted file mode 100755
index a3c9e382d..000000000
--- a/test/arguments/bashrun.exp
+++ /dev/null
@@ -1,86 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "./bashrun.sh\r"
8expect {
9 timeout {puts "TESTING ERROR 1.1.1\n";exit}
10 "Arguments:"
11}
12expect {
13 timeout {puts "TESTING ERROR 1.1.2\n";exit}
14 "#arg1#"
15}
16expect {
17 timeout {puts "TESTING ERROR 1.1.3\n";exit}
18 "#arg2#"
19}
20
21expect {
22 timeout {puts "TESTING ERROR 1.2.1\n";exit}
23 "Arguments:"
24}
25expect {
26 timeout {puts "TESTING ERROR 1.2.2\n";exit}
27 "#arg1 tail#"
28}
29expect {
30 timeout {puts "TESTING ERROR 1.2.3\n";exit}
31 "#arg2 tail#"
32}
33
34expect {
35 timeout {puts "TESTING ERROR 1.3.1\n";exit}
36 "Arguments:"
37}
38expect {
39 timeout {puts "TESTING ERROR 1.3.2\n";exit}
40 "#arg1 tail#"
41}
42expect {
43 timeout {puts "TESTING ERROR 1.3.3\n";exit}
44 "#arg2 tail#"
45}
46
47expect {
48 timeout {puts "TESTING ERROR 1.4.1\n";exit}
49 "Arguments:"
50}
51expect {
52 timeout {puts "TESTING ERROR 1.4.2\n";exit}
53 "#arg1 tail#"
54}
55expect {
56 timeout {puts "TESTING ERROR 1.4.3\n";exit}
57 "#arg2 tail#"
58}
59
60expect {
61 timeout {puts "TESTING ERROR 1.5.1\n";exit}
62 "Arguments:"
63}
64expect {
65 timeout {puts "TESTING ERROR 1.5.2\n";exit}
66 "#arg1&tail#"
67}
68expect {
69 timeout {puts "TESTING ERROR 1.5.3\n";exit}
70 "#arg2&tail#"
71}
72
73expect {
74 timeout {puts "TESTING ERROR 1.6.1\n";exit}
75 "Arguments:"
76}
77expect {
78 timeout {puts "TESTING ERROR 1.6.2\n";exit}
79 "#arg1&tail#"
80}
81expect {
82 timeout {puts "TESTING ERROR 1.6.3\n";exit}
83 "#arg2&tail#"
84}
85
86puts "\nall done\n"
diff --git a/test/arguments/bashrun.sh b/test/arguments/bashrun.sh
deleted file mode 100755
index a4773fd6c..000000000
--- a/test/arguments/bashrun.sh
+++ /dev/null
@@ -1,22 +0,0 @@
1#!/bin/bash
2
3echo "TESTING: 1.1 - simple args"
4firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit arg1 arg2
5
6# simple quotes, testing spaces in file names
7echo "TESTING: 1.2 - args with space and \""
8firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit "arg1 tail" "arg2 tail"
9
10echo "TESTING: 1.3 - args with space and '"
11firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit 'arg1 tail' 'arg2 tail'
12
13# escaped space in file names
14echo "TESTING: 1.4 - args with space and \\"
15firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit arg1\ tail arg2\ tail
16
17# & char appears in URLs - URLs should be quoted
18echo "TESTING: 1.5 - args with & and \""
19firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit "arg1&tail" "arg2&tail"
20
21echo "TESTING: 1.6 - args with & and '"
22firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit 'arg1&tail' 'arg2&tail'
diff --git a/test/arguments/joinrun.exp b/test/arguments/joinrun.exp
deleted file mode 100755
index 97972e5e8..000000000
--- a/test/arguments/joinrun.exp
+++ /dev/null
@@ -1,89 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7
8send -- "firejail --name=joinrun\r"
9sleep 2
10
11spawn $env(SHELL)
12send -- "./joinrun.sh\r"
13expect {
14 timeout {puts "TESTING ERROR 3.1.1\n";exit}
15 "Arguments:"
16}
17expect {
18 timeout {puts "TESTING ERROR 3.1.2\n";exit}
19 "#arg1#"
20}
21expect {
22 timeout {puts "TESTING ERROR 3.1.3\n";exit}
23 "#arg2#"
24}
25
26expect {
27 timeout {puts "TESTING ERROR 3.2.1\n";exit}
28 "Arguments:"
29}
30expect {
31 timeout {puts "TESTING ERROR 3.2.2\n";exit}
32 "#arg1 tail#"
33}
34expect {
35 timeout {puts "TESTING ERROR 3.2.3\n";exit}
36 "#arg2 tail#"
37}
38expect {
39 timeout {puts "TESTING ERROR 3.3.1\n";exit}
40 "Arguments:"
41}
42expect {
43 timeout {puts "TESTING ERROR 3.3.2\n";exit}
44 "#arg1 tail#"
45}
46expect {
47 timeout {puts "TESTING ERROR 3.3.3\n";exit}
48 "#arg2 tail#"
49}
50expect {
51 timeout {puts "TESTING ERROR 3.4.1\n";exit}
52 "Arguments:"
53}
54expect {
55 timeout {puts "TESTING ERROR 3.4.2\n";exit}
56 "#arg1 tail#"
57}
58expect {
59 timeout {puts "TESTING ERROR 3.4.3\n";exit}
60 "#arg2 tail#"
61}
62
63expect {
64 timeout {puts "TESTING ERROR 3.5.1\n";exit}
65 "Arguments:"
66}
67expect {
68 timeout {puts "TESTING ERROR 3.5.2\n";exit}
69 "#arg1&tail#"
70}
71expect {
72 timeout {puts "TESTING ERROR 3.5.3\n";exit}
73 "#arg2&tail#"
74}
75
76expect {
77 timeout {puts "TESTING ERROR 3.6.1\n";exit}
78 "Arguments:"
79}
80expect {
81 timeout {puts "TESTING ERROR 3.6.2\n";exit}
82 "#arg1&tail#"
83}
84expect {
85 timeout {puts "TESTING ERROR 3.6.3\n";exit}
86 "#arg2&tail#"
87}
88
89puts "\nall done\n"
diff --git a/test/arguments/joinrun.sh b/test/arguments/joinrun.sh
deleted file mode 100755
index b00ea0e80..000000000
--- a/test/arguments/joinrun.sh
+++ /dev/null
@@ -1,22 +0,0 @@
1#!/bin/bash
2
3echo "TESTING: 3.1 - simple args"
4firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit arg1 arg2
5
6# simple quotes, testing spaces in file names
7echo "TESTING: 3.2 - args with space and \""
8firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit "arg1 tail" "arg2 tail"
9
10echo "TESTING: 3.3 - args with space and '"
11firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit 'arg1 tail' 'arg2 tail'
12
13# escaped space in file names
14echo "TESTING: 3.4 - args with space and \\"
15firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit arg1\ tail arg2\ tail
16
17# & char appears in URLs - URLs should be quoted
18echo "TESTING: 3.5 - args with & and \""
19firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit "arg1&tail" "arg2&tail"
20
21echo "TESTING: 3.6 - args with & and '"
22firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit 'arg1&tail' 'arg2&tail'
diff --git a/test/arguments/outrun.exp b/test/arguments/outrun.exp
deleted file mode 100755
index d28e75661..000000000
--- a/test/arguments/outrun.exp
+++ /dev/null
@@ -1,90 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "./outrun.sh\r"
8expect {
9 timeout {puts "TESTING ERROR 4.1.1\n";exit}
10 "Arguments:"
11}
12expect {
13 timeout {puts "TESTING ERROR 4.1.2\n";exit}
14 "#arg1#"
15}
16expect {
17 timeout {puts "TESTING ERROR 4.1.3\n";exit}
18 "#arg2#"
19}
20
21exit
22#***************************************************
23# breaking down from here on - bug to fix
24#***************************************************
25expect {
26 timeout {puts "TESTING ERROR 4.2.1\n";exit}
27 "Arguments:"
28}
29expect {
30 timeout {puts "TESTING ERROR 4.2.2\n";exit}
31 "#arg1 tail#"
32}
33expect {
34 timeout {puts "TESTING ERROR 4.2.3\n";exit}
35 "#arg2 tail#"
36}
37
38expect {
39 timeout {puts "TESTING ERROR 4.3.1\n";exit}
40 "Arguments:"
41}
42expect {
43 timeout {puts "TESTING ERROR 4.3.2\n";exit}
44 "#arg1 tail#"
45}
46expect {
47 timeout {puts "TESTING ERROR 4.3.3\n";exit}
48 "#arg2 tail#"
49}
50
51expect {
52 timeout {puts "TESTING ERROR 4.4.1\n";exit}
53 "Arguments:"
54}
55expect {
56 timeout {puts "TESTING ERROR 4.4.2\n";exit}
57 "#arg1 tail#"
58}
59expect {
60 timeout {puts "TESTING ERROR 4.4.3\n";exit}
61 "#arg2 tail#"
62}
63
64expect {
65 timeout {puts "TESTING ERROR 4.5.1\n";exit}
66 "Arguments:"
67}
68expect {
69 timeout {puts "TESTING ERROR 4.5.2\n";exit}
70 "#arg1&tail#"
71}
72expect {
73 timeout {puts "TESTING ERROR 4.5.3\n";exit}
74 "#arg2&tail#"
75}
76
77expect {
78 timeout {puts "TESTING ERROR 4.6.1\n";exit}
79 "Arguments:"
80}
81expect {
82 timeout {puts "TESTING ERROR 4.6.2\n";exit}
83 "#arg1&tail#"
84}
85expect {
86 timeout {puts "TESTING ERROR 4.6.3\n";exit}
87 "#arg2&tail#"
88}
89
90puts "\nall done\n"
diff --git a/test/arguments/outrun.sh b/test/arguments/outrun.sh
deleted file mode 100755
index 5bc3b1e37..000000000
--- a/test/arguments/outrun.sh
+++ /dev/null
@@ -1,22 +0,0 @@
1#!/bin/bash
2
3echo "TESTING: 4.1 - simple args"
4firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit arg1 arg2
5
6# simple quotes, testing spaces in file names
7echo "TESTING: 4.2 - args with space and \""
8firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit "arg1 tail" "arg2 tail"
9
10echo "TESTING: 4.3 - args with space and '"
11firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit 'arg1 tail' 'arg2 tail'
12
13# escaped space in file names
14echo "TESTING: 4.4 - args with space and \\"
15firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit arg1\ tail arg2\ tail
16
17# & char appears in URLs - URLs should be quoted
18echo "TESTING: 4.5 - args with & and \""
19firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit "arg1&tail" "arg2&tail"
20
21echo "TESTING: 4.6 - args with & and '"
22firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit 'arg1&tail' 'arg2&tail'
diff --git a/test/arguments/symrun.exp b/test/arguments/symrun.exp
deleted file mode 100755
index 10e7ac6c8..000000000
--- a/test/arguments/symrun.exp
+++ /dev/null
@@ -1,71 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "./symrun.sh\r"
8expect {
9 timeout {puts "TESTING ERROR 2.1.1\n";exit}
10 "Arguments:"
11}
12expect {
13 timeout {puts "TESTING ERROR 2.1.2\n";exit}
14 "#arg1#"
15}
16expect {
17 timeout {puts "TESTING ERROR 2.1.3\n";exit}
18 "#arg2#"
19}
20
21expect {
22 timeout {puts "TESTING ERROR 2.3.1\n";exit}
23 "Arguments:"
24}
25expect {
26 timeout {puts "TESTING ERROR 2.3.2\n";exit}
27 "#arg1 tail#"
28}
29expect {
30 timeout {puts "TESTING ERROR 2.3.3\n";exit}
31 "#arg2 tail#"
32}
33
34expect {
35 timeout {puts "TESTING ERROR 2.4.1\n";exit}
36 "Arguments:"
37}
38expect {
39 timeout {puts "TESTING ERROR 2.4.2\n";exit}
40 "#arg1 tail#"
41}
42expect {
43 timeout {puts "TESTING ERROR 2.4.3\n";exit}
44 "#arg2 tail#"
45}
46
47expect {
48 timeout {puts "TESTING ERROR 2.5.1\n";exit}
49 "Arguments:"
50}
51expect {
52 timeout {puts "TESTING ERROR 2.5.2\n";exit}
53 "#arg1&tail#"
54}
55expect {
56 timeout {puts "TESTING ERROR 2.5.3\n";exit}
57 "#arg2&tail#"
58}
59
60expect {
61 timeout {puts "TESTING ERROR 2.6.1\n";exit}
62 "Arguments:"
63}
64expect {
65 timeout {puts "TESTING ERROR 2.6.2\n";exit}
66 "#arg1&tail#"
67}
68expect {
69 timeout {puts "TESTING ERROR 2.6.3\n";exit}
70 "#arg2&tail#"
71}
diff --git a/test/arguments/symrun.sh b/test/arguments/symrun.sh
deleted file mode 100755
index db5f06835..000000000
--- a/test/arguments/symrun.sh
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/bin/bash
2
3mkdir symtest
4ln -s /usr/bin/firejail symtest/faudit
5
6# search for faudit in current directory
7export PATH=$PATH:.
8export FIREJAIL_TEST_ARGUMENTS=yes
9
10echo "TESTING: 2.1 - simple args"
11symtest/faudit arg1 arg2
12
13# simple quotes, testing spaces in file names
14echo "TESTING: 2.2 - args with space and \""
15symtest/faudit "arg1 tail" "arg2 tail"
16
17echo "TESTING: 2.3 - args with space and '"
18symtest/faudit 'arg1 tail' 'arg2 tail'
19
20# escaped space in file names
21echo "TESTING: 2.4 - args with space and \\"
22symtest/faudit arg1\ tail arg2\ tail
23
24# & char appears in URLs - URLs should be quoted
25echo "TESTING: 2.5 - args with & and \""
26symtest/faudit "arg1&tail" "arg2&tail"
27
28echo "TESTING: 2.6 - args with & and '"
29symtest/faudit 'arg1&tail' 'arg2&tail'
30
31rm -fr symtest
diff --git a/test/blacklist-link.exp b/test/blacklist-link.exp
deleted file mode 100755
index 4252f875a..000000000
--- a/test/blacklist-link.exp
+++ /dev/null
@@ -1,82 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# blacklist a directory symlink
8send -- "firejail --blacklist=auto2\r"
9expect {
10 timeout {puts "TESTING ERROR 1\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls auto2\r"
16expect {
17 timeout {puts "TESTING ERROR 2\n";exit}
18 "cannot open directory"
19}
20send -- "exit\r"
21sleep 1
22
23# blacklist a directory symlink from a profile file
24send -- "firejail --profile=blacklist3.profile\r"
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 "Child process initialized"
28}
29sleep 1
30
31send -- "ls auto2\r"
32expect {
33 timeout {puts "TESTING ERROR 4\n";exit}
34 "cannot open directory"
35}
36send -- "exit\r"
37sleep 1
38
39# do not blacklist /bin
40send -- "firejail --blacklist=auto3\r"
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 "auto3 directory link was not blacklisted"
44}
45expect {
46 timeout {puts "TESTING ERROR 5.1\n";exit}
47 "Child process initialized"
48}
49sleep 1
50
51send -- "ls auto3; pwd\r"
52expect {
53 timeout {puts "TESTING ERROR 6\n";exit}
54 "cannot open directory" {puts "TESTING ERROR 6.1\n";exit}
55 "home"
56}
57send -- "exit\r"
58sleep 1
59
60# do not blacklist /usr/bin
61send -- "firejail --blacklist=auto3\r"
62expect {
63 timeout {puts "TESTING ERROR 7\n";exit}
64 "auto3 directory link was not blacklisted"
65}
66expect {
67 timeout {puts "TESTING ERROR 7.1\n";exit}
68 "Child process initialized"
69}
70sleep 1
71
72send -- "ls auto3; pwd\r"
73expect {
74 timeout {puts "TESTING ERROR 8\n";exit}
75 "cannot open directory" {puts "TESTING ERROR 9.1\n";exit}
76 "home"
77}
78send -- "exit\r"
79sleep 1
80
81
82puts "all done\n"
diff --git a/test/blacklist.exp b/test/blacklist.exp
deleted file mode 100755
index 9c3dddf1f..000000000
--- a/test/blacklist.exp
+++ /dev/null
@@ -1,75 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# directory with ~
8send -- "firejail --blacklist=~/.config\r"
9expect {
10 timeout {puts "TESTING ERROR 1\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls -al ~/.config\r"
16expect {
17 timeout {puts "TESTING ERROR 2\n";exit}
18 "cannot open directory"
19}
20
21send -- "exit\r"
22sleep 1
23
24# directory with ~ in profile file
25send -- "firejail --profile=blacklist1.profile\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "Child process initialized"
29}
30sleep 1
31
32send -- "ls -al ~/.config\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "cannot open directory"
36}
37
38send -- "exit\r"
39sleep 1
40
41
42# directory with space
43send -- "firejail \"--blacklist=dir with space\"\r"
44expect {
45 timeout {puts "TESTING ERROR 5\n";exit}
46 "Child process initialized"
47}
48sleep 1
49
50send -- "ls -al \"dir with space\"\r"
51expect {
52 timeout {puts "TESTING ERROR 6\n";exit}
53 "cannot open directory"
54}
55
56send -- "exit\r"
57sleep 1
58
59# directory with space in profile
60send -- "firejail --profile=blacklist2.profile\r"
61expect {
62 timeout {puts "TESTING ERROR 7\n";exit}
63 "Child process initialized"
64}
65sleep 1
66
67send -- "ls -al \"dir with space\"\r"
68expect {
69 timeout {puts "TESTING ERROR 8\n";exit}
70 "cannot open directory"
71}
72
73
74
75puts "\n"
diff --git a/test/blacklist1.profile b/test/blacklist1.profile
deleted file mode 100644
index f12facd05..000000000
--- a/test/blacklist1.profile
+++ /dev/null
@@ -1 +0,0 @@
1blacklist ~/.config
diff --git a/test/blacklist2.profile b/test/blacklist2.profile
deleted file mode 100644
index 4bb603db2..000000000
--- a/test/blacklist2.profile
+++ /dev/null
@@ -1 +0,0 @@
1blacklist dir with space
diff --git a/test/blacklist3.profile b/test/blacklist3.profile
deleted file mode 100644
index 08f754f3f..000000000
--- a/test/blacklist3.profile
+++ /dev/null
@@ -1 +0,0 @@
1blacklist auto2
diff --git a/test/chk_config.exp b/test/chk_config.exp
deleted file mode 100755
index f47fd0eee..000000000
--- a/test/chk_config.exp
+++ /dev/null
@@ -1,85 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# check br0
8send -- "/sbin/ifconfig;pwd\r"
9expect {
10 timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
11 "br0"
12}
13expect {
14 timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
15 "10.10.20.1"
16}
17expect {
18 timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
19 "home"
20}
21
22# check br1
23send -- "/sbin/ifconfig;pwd\r"
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "br1"
27}
28expect {
29 timeout {puts "TESTING ERROR 1\n";exit}
30 "10.10.30.1"
31}
32expect {
33 timeout {puts "TESTING ERROR 1\n";exit}
34 "home"
35}
36
37# check br2
38send -- "/sbin/ifconfig;pwd\r"
39expect {
40 timeout {puts "TESTING ERROR 2\n";exit}
41 "br2"
42}
43expect {
44 timeout {puts "TESTING ERROR 2\n";exit}
45 "10.10.40.1"
46}
47expect {
48 timeout {puts "TESTING ERROR 2\n";exit}
49 "home"
50}
51
52# check br3
53send -- "/sbin/ifconfig;pwd\r"
54expect {
55 timeout {puts "TESTING ERROR 3\n";exit}
56 "br3"
57}
58expect {
59 timeout {puts "TESTING ERROR 3\n";exit}
60 "10.10.50.1"
61}
62expect {
63 timeout {puts "TESTING ERROR 3\n";exit}
64 "home"
65}
66
67# start a sandbox and check MALLOC_PERTURB
68send -- "firejail\r"
69expect {
70 timeout {puts "TESTING ERROR 4\n";exit}
71 "Child process initialized"
72}
73sleep 1
74
75set timeout 2
76send -- "env | grep MALLOC;pwd\r"
77expect {
78 timeout {puts "\nTESTING: MALLOC_PERTURB_ disabled\n"}
79 "MALLOC_PERTURB_" {puts "\nTESTING: MALLOC_PERTURB_ enabled\n"}
80}
81expect {
82 timeout {puts "TESTING ERROR 5\n";exit}
83 "home" {puts "regular user\n"}
84 "root" {puts "root user\n"}
85}
diff --git a/test/chroot/chroot.sh b/test/chroot/chroot.sh
index e7911caa0..1ac5cf47e 100755
--- a/test/chroot/chroot.sh
+++ b/test/chroot/chroot.sh
@@ -1,10 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9rm -f unchroot 10rm -f unchroot
10gcc -o unchroot unchroot.c 11gcc -o unchroot unchroot.c
diff --git a/test/chroot/configure b/test/chroot/configure
index 26a516931..747dc4383 100755
--- a/test/chroot/configure
+++ b/test/chroot/configure
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3# build a very small chroot 6# build a very small chroot
4ROOTDIR="/tmp/chroot" # default chroot directory 7ROOTDIR="/tmp/chroot" # default chroot directory
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp
index a071027e5..650425829 100755
--- a/test/chroot/fs_chroot.exp
+++ b/test/chroot/fs_chroot.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/chroot/unchroot-as-root.exp b/test/chroot/unchroot-as-root.exp
index e4bedd539..b88367054 100755
--- a/test/chroot/unchroot-as-root.exp
+++ b/test/chroot/unchroot-as-root.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/chroot/unchroot.c b/test/chroot/unchroot.c
index 4919637d6..643983ce4 100644
--- a/test/chroot/unchroot.c
+++ b/test/chroot/unchroot.c
@@ -1,3 +1,7 @@
1// This file is part of Firejail project
2// Copyright (C) 2014-2021 Firejail Authors
3// License GPL v2
4
1// simple unchroot example from http://linux-vserver.org/Secure_chroot_Barrier 5// simple unchroot example from http://linux-vserver.org/Secure_chroot_Barrier
2#include <unistd.h> 6#include <unistd.h>
3#include <stdlib.h> 7#include <stdlib.h>
diff --git a/test/compile/compile.sh b/test/compile/compile.sh
index 9b7d19057..101998187 100755
--- a/test/compile/compile.sh
+++ b/test/compile/compile.sh
@@ -1,26 +1,44 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6# not currently covered
7# --disable-suid install as a non-SUID executable
8# --enable-fatal-warnings -W -Wall -Werror
9# --enable-gcov Gcov instrumentation
10# --enable-contrib-install
11# install contrib scripts
12# --enable-analyzer enable GCC 10 static analyzer
13
14
2 15
3arr[1]="TEST 1: standard compilation" 16arr[1]="TEST 1: standard compilation"
4arr[2]="TEST 2: compile seccomp disabled" 17arr[2]="TEST 2: compile dbus proxy disabled"
5arr[3]="TEST 3: compile chroot disabled" 18arr[3]="TEST 3: compile chroot disabled"
6arr[4]="TEST 4: compile bind disabled" 19arr[4]="TEST 4: compile firetunnel disabled"
7arr[5]="TEST 5: compile user namespace disabled" 20arr[5]="TEST 5: compile user namespace disabled"
8arr[6]="TEST 6: compile network disabled" 21arr[6]="TEST 6: compile network disabled"
9arr[7]="TEST 7: compile X11 disabled" 22arr[7]="TEST 7: compile X11 disabled"
10arr[8]="TEST 8: compile network restricted" 23arr[8]="TEST 8: compile selinux"
11arr[9]="TEST 9: compile file transfer disabled" 24arr[9]="TEST 9: compile file transfer disabled"
12arr[10]="TEST 10: compile disable whitelist" 25arr[10]="TEST 10: compile disable whitelist"
13arr[11]="TEST 11: compile disable global config" 26arr[11]="TEST 11: compile disable global config"
14arr[12]="TEST 12: compile apparmor" 27arr[12]="TEST 12: compile apparmor"
15arr[13]="TEST 13: compile busybox" 28arr[13]="TEST 13: compile busybox"
16arr[14]="TEST 14: compile overlayfs disabled" 29arr[14]="TEST 14: compile overlayfs disabled"
17arr[15]="TEST 15: compile apparmor enabled" 30arr[15]="TEST 15: compile private-home disabled"
31arr[16]="TEST 16: compile disable manpages"
32arr[17]="TEST 17: disable tmpfs as regular user"
33arr[18]="TEST 18: disable private home"
18 34
19# remove previous reports and output file 35# remove previous reports and output file
20cleanup() { 36cleanup() {
21 rm -f report* 37 rm -f report*
22 rm -fr firejail 38 rm -fr firejail
23 rm -f oc* om* 39 rm -f oc* om*
40 rm -f output-configure
41 rm -f output-make
24} 42}
25 43
26print_title() { 44print_title() {
@@ -74,13 +92,12 @@ rm output-configure output-make
74#***************************************************************** 92#*****************************************************************
75# TEST 2 93# TEST 2
76#***************************************************************** 94#*****************************************************************
77# - disable seccomp configuration 95# - disable dbus proxy configuration
78#***************************************************************** 96#*****************************************************************
79print_title "${arr[2]}" 97print_title "${arr[2]}"
80# seccomp
81cd firejail 98cd firejail
82make distclean 99make distclean
83./configure --prefix=/usr --disable-seccomp --enable-fatal-warnings 2>&1 | tee ../output-configure 100./configure --prefix=/usr --disable-dbusproxy --enable-fatal-warnings 2>&1 | tee ../output-configure
84make -j4 2>&1 | tee ../output-make 101make -j4 2>&1 | tee ../output-make
85cd .. 102cd ..
86grep Warning output-configure output-make > ./report-test2 103grep Warning output-configure output-make > ./report-test2
@@ -95,7 +112,6 @@ rm output-configure output-make
95# - disable chroot configuration 112# - disable chroot configuration
96#***************************************************************** 113#*****************************************************************
97print_title "${arr[3]}" 114print_title "${arr[3]}"
98# seccomp
99cd firejail 115cd firejail
100make distclean 116make distclean
101./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure 117./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -110,13 +126,12 @@ rm output-configure output-make
110#***************************************************************** 126#*****************************************************************
111# TEST 4 127# TEST 4
112#***************************************************************** 128#*****************************************************************
113# - disable bind configuration 129# - disable firetunnel configuration
114#***************************************************************** 130#*****************************************************************
115print_title "${arr[4]}" 131print_title "${arr[4]}"
116# seccomp
117cd firejail 132cd firejail
118make distclean 133make distclean
119./configure --prefix=/usr --disable-bind --enable-fatal-warnings 2>&1 | tee ../output-configure 134./configure --prefix=/usr --disable-firetunnel --enable-fatal-warnings 2>&1 | tee ../output-configure
120make -j4 2>&1 | tee ../output-make 135make -j4 2>&1 | tee ../output-make
121cd .. 136cd ..
122grep Warning output-configure output-make > ./report-test4 137grep Warning output-configure output-make > ./report-test4
@@ -131,7 +146,6 @@ rm output-configure output-make
131# - disable user namespace configuration 146# - disable user namespace configuration
132#***************************************************************** 147#*****************************************************************
133print_title "${arr[5]}" 148print_title "${arr[5]}"
134# seccomp
135cd firejail 149cd firejail
136make distclean 150make distclean
137./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure 151./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -150,7 +164,6 @@ rm output-configure output-make
150# - check compilation 164# - check compilation
151#***************************************************************** 165#*****************************************************************
152print_title "${arr[6]}" 166print_title "${arr[6]}"
153# seccomp
154cd firejail 167cd firejail
155make distclean 168make distclean
156./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure 169./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -168,7 +181,6 @@ rm output-configure output-make
168# - disable X11 support 181# - disable X11 support
169#***************************************************************** 182#*****************************************************************
170print_title "${arr[7]}" 183print_title "${arr[7]}"
171# seccomp
172cd firejail 184cd firejail
173make distclean 185make distclean
174./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure 186./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -180,17 +192,15 @@ cp output-configure oc7
180cp output-make om7 192cp output-make om7
181rm output-configure output-make 193rm output-configure output-make
182 194
183
184#***************************************************************** 195#*****************************************************************
185# TEST 8 196# TEST 8
186#***************************************************************** 197#*****************************************************************
187# - enable network restricted 198# - enable selinux
188#***************************************************************** 199#*****************************************************************
189print_title "${arr[8]}" 200print_title "${arr[8]}"
190# seccomp
191cd firejail 201cd firejail
192make distclean 202make distclean
193./configure --prefix=/usr --enable-network=restricted --enable-fatal-warnings 2>&1 | tee ../output-configure 203./configure --prefix=/usr --enable-selinux --enable-fatal-warnings 2>&1 | tee ../output-configure
194make -j4 2>&1 | tee ../output-make 204make -j4 2>&1 | tee ../output-make
195cd .. 205cd ..
196grep Warning output-configure output-make > ./report-test8 206grep Warning output-configure output-make > ./report-test8
@@ -199,14 +209,12 @@ cp output-configure oc8
199cp output-make om8 209cp output-make om8
200rm output-configure output-make 210rm output-configure output-make
201 211
202
203#***************************************************************** 212#*****************************************************************
204# TEST 9 213# TEST 9
205#***************************************************************** 214#*****************************************************************
206# - disable file transfer 215# - disable file transfer
207#***************************************************************** 216#*****************************************************************
208print_title "${arr[9]}" 217print_title "${arr[9]}"
209# seccomp
210cd firejail 218cd firejail
211make distclean 219make distclean
212./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure 220./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -224,7 +232,6 @@ rm output-configure output-make
224# - disable whitelist 232# - disable whitelist
225#***************************************************************** 233#*****************************************************************
226print_title "${arr[10]}" 234print_title "${arr[10]}"
227# seccomp
228cd firejail 235cd firejail
229make distclean 236make distclean
230./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure 237./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -242,7 +249,6 @@ rm output-configure output-make
242# - disable global config 249# - disable global config
243#***************************************************************** 250#*****************************************************************
244print_title "${arr[11]}" 251print_title "${arr[11]}"
245# seccomp
246cd firejail 252cd firejail
247make distclean 253make distclean
248./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure 254./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -260,7 +266,6 @@ rm output-configure output-make
260# - enable apparmor 266# - enable apparmor
261#***************************************************************** 267#*****************************************************************
262print_title "${arr[12]}" 268print_title "${arr[12]}"
263# seccomp
264cd firejail 269cd firejail
265make distclean 270make distclean
266./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure 271./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -278,7 +283,6 @@ rm output-configure output-make
278# - enable busybox workaround 283# - enable busybox workaround
279#***************************************************************** 284#*****************************************************************
280print_title "${arr[13]}" 285print_title "${arr[13]}"
281# seccomp
282cd firejail 286cd firejail
283make distclean 287make distclean
284./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure 288./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -296,7 +300,6 @@ rm output-configure output-make
296# - disable overlayfs 300# - disable overlayfs
297#***************************************************************** 301#*****************************************************************
298print_title "${arr[14]}" 302print_title "${arr[14]}"
299# seccomp
300cd firejail 303cd firejail
301make distclean 304make distclean
302./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure 305./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure
@@ -311,13 +314,12 @@ rm output-configure output-make
311#***************************************************************** 314#*****************************************************************
312# TEST 15 315# TEST 15
313#***************************************************************** 316#*****************************************************************
314# - enable apparmor 317# - disable private home
315#***************************************************************** 318#*****************************************************************
316print_title "${arr[15]}" 319print_title "${arr[15]}"
317# seccomp
318cd firejail 320cd firejail
319make distclean 321make distclean
320./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure 322./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure
321make -j4 2>&1 | tee ../output-make 323make -j4 2>&1 | tee ../output-make
322cd .. 324cd ..
323grep Warning output-configure output-make > ./report-test15 325grep Warning output-configure output-make > ./report-test15
@@ -326,6 +328,56 @@ cp output-configure oc15
326cp output-make om15 328cp output-make om15
327rm output-configure output-make 329rm output-configure output-make
328 330
331#*****************************************************************
332# TEST 16
333#*****************************************************************
334# - disable manpages
335#*****************************************************************
336print_title "${arr[16]}"
337cd firejail
338make distclean
339./configure --prefix=/usr --disable-man --enable-fatal-warnings 2>&1 | tee ../output-configure
340make -j4 2>&1 | tee ../output-make
341cd ..
342grep Warning output-configure output-make > ./report-test16
343grep Error output-configure output-make >> ./report-test16
344cp output-configure oc16
345cp output-make om16
346rm output-configure output-make
347
348#*****************************************************************
349# TEST 17
350#*****************************************************************
351# - disable tmpfs as regular user"
352#*****************************************************************
353print_title "${arr[17]}"
354cd firejail
355make distclean
356./configure --prefix=/usr --disable-usertmpfs --enable-fatal-warnings 2>&1 | tee ../output-configure
357make -j4 2>&1 | tee ../output-make
358cd ..
359grep Warning output-configure output-make > ./report-test17
360grep Error output-configure output-make >> ./report-test17
361cp output-configure oc17
362cp output-make om17
363rm output-configure output-make
364
365#*****************************************************************
366# TEST 18
367#*****************************************************************
368# - disable private home feature
369#*****************************************************************
370print_title "${arr[18]}"
371cd firejail
372make distclean
373./configure --prefix=/usr --disable-private-home --enable-fatal-warnings 2>&1 | tee ../output-configure
374make -j4 2>&1 | tee ../output-make
375cd ..
376grep Warning output-configure output-make > ./report-test18
377grep Error output-configure output-make >> ./report-test18
378cp output-configure oc18
379cp output-make om18
380rm output-configure output-make
329 381
330#***************************************************************** 382#*****************************************************************
331# PRINT REPORTS 383# PRINT REPORTS
@@ -356,3 +408,6 @@ echo ${arr[12]}
356echo ${arr[13]} 408echo ${arr[13]}
357echo ${arr[14]} 409echo ${arr[14]}
358echo ${arr[15]} 410echo ${arr[15]}
411echo ${arr[16]}
412echo ${arr[17]}
413echo ${arr[18]}
diff --git a/test/configure b/test/configure
deleted file mode 100755
index bb955670b..000000000
--- a/test/configure
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/bin/bash
2
3brctl addbr br0
4ifconfig br0 10.10.20.1/29 up
5# NAT masquerade
6iptables -t nat -A POSTROUTING -o eth0 -s 10.10.20.0/29 -j MASQUERADE
7# port forwarding
8# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.10.20.2:80
9
10brctl addbr br1
11ifconfig br1 10.10.30.1/24 up
12brctl addbr br2
13ifconfig br2 10.10.40.1/24 up
14brctl addbr br3
15ifconfig br3 10.10.50.1/24 up
16brctl addbr br4
17ifconfig br4 10.10.60.1/24 up
18ip link add link eth0 name eth0.5 type vlan id 5
19/sbin/ifconfig eth0.5 10.10.205.10/24 up
20ip link add link eth0 name eth0.6 type vlan id 6
21/sbin/ifconfig eth0.6 10.10.206.10/24 up
22ip link add link eth0 name eth0.7 type vlan id 7
23/sbin/ifconfig eth0.7 10.10.207.10/24 up
24
25
26# build a very small chroot
27ROOTDIR="/tmp/chroot" # default chroot directory
28DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files
29DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group "
30DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc
31DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/netstat /bin/ping /sbin/ifconfig /usr/bin/touch /bin/ip /bin/hostname /bin/grep /usr/bin/dig /usr/bin/openssl /usr/bin/id /usr/bin/getent /usr/bin/whoami /usr/bin/wc /usr/bin/wget /bin/umount"
32
33rm -fr $ROOTDIR
34mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc}
35chmod 777 $ROOTDIR/tmp
36mkdir -p $ROOTDIR/etc/firejail
37mkdir -p $ROOTDIR/home/netblue/.config/firejail
38chown netblue:netblue $ROOTDIR/home/netblue
39chown netblue:netblue $ROOTDIR/home/netblue/.config
40cp /home/netblue/.Xauthority $ROOTDIR/home/netblue/.
41cp -a /etc/skel $ROOTDIR/etc/.
42mkdir $ROOTDIR/home/someotheruser
43mkdir $ROOTDIR/boot
44mkdir $ROOTDIR/selinux
45cp /etc/passwd $ROOTDIR/etc/.
46cp /etc/group $ROOTDIR/etc/.
47cp /etc/hosts $ROOTDIR/etc/.
48cp /etc/hostname $ROOTDIR/etc/.
49mkdir -p $ROOTDIR/usr/lib/x86_64-linux-gnu
50cp -a /usr/lib/x86_64-linux-gnu/openssl-1.0.0 $ROOTDIR/usr/lib/x86_64-linux-gnu/.
51cp -a /usr/lib/ssl $ROOTDIR/usr/lib/.
52touch $ROOTDIR/var/log/syslog
53touch $ROOTDIR/var/tmp/somefile
54SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u`
55for FILE in $SORTED
56do
57 cp --parents $FILE $ROOTDIR
58done
59cp --parents /lib64/ld-linux-x86-64.so.2 $ROOTDIR
60cp --parents /lib/ld-linux.so.2 $ROOTDIR
61cp ../src/tools/unchroot $ROOTDIR/.
62touch $ROOTDIR/this-is-my-chroot
63
64cd $ROOTDIR; find .
65mkdir -p usr/lib/firejail/
66cp /usr/lib/firejail/libtrace.so usr/lib/firejail/.
67
68
69echo "To enter the chroot directory run: firejail --chroot=$ROOTDIR"
diff --git a/test/environment/allow-debuggers.exp b/test/environment/allow-debuggers.exp
index 359f94db1..f660c123a 100755
--- a/test/environment/allow-debuggers.exp
+++ b/test/environment/allow-debuggers.exp
@@ -1,40 +1,34 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4cd /home 7cd /home
5spawn $env(SHELL) 8spawn $env(SHELL)
6match_max 100000 9match_max 100000
7 10
8send -- "firejail --profile=/etc/firejail/firefox.profile --allow-debuggers strace ls\r" 11send -- "firejail --allow-debuggers\r"
9expect { 12expect {
10 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized" { puts "\n"} 14 "Child process initialized" { puts "\n"}
12 "is disabled on Linux kernels prior to 4.8" { puts "TESTING SKIP: kernel too old\n"; exit } 15 "is disabled on Linux kernels prior to 4.8" { puts "TESTING SKIP: kernel too old\n"; exit }
13} 16}
14expect {
15 timeout {puts "TESTING ERROR 1\n";exit}
16 "ioctl"
17}
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "exit_group"
21}
22after 100 17after 100
23 18
24send -- "firejail --allow-debuggers --profile=/etc/firejail/firefox.profile strace ls\r" 19send -- "strace ls\r"
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 "Child process initialized"
28}
29expect { 20expect {
30 timeout {puts "TESTING ERROR 4\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
31 "ioctl" 22 "open"
32} 23}
33expect { 24expect {
34 timeout {puts "TESTING ERROR 5\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
35 "exit_group" 26 "exit_group"
36} 27}
37after 100 28after 100
29send -- "exit\r"
30sleep 1
31
38 32
39 33
40puts "\nall done\n" 34puts "\nall done\n"
diff --git a/test/environment/csh.exp b/test/environment/csh.exp
index 633934791..f8ced07b5 100755
--- a/test/environment/csh.exp
+++ b/test/environment/csh.exp
@@ -1,35 +1,34 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7cd /home
7spawn $env(SHELL) 8spawn $env(SHELL)
8match_max 100000 9match_max 100000
9 10
10send -- "firejail --private --tracelog --csh\r" 11send -- "firejail --private --shell=/bin/csh\r"
11expect { 12expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 14 "Child process initialized"
14} 15}
15sleep 1 16sleep 1
16 17
17send -- "find ~\r" 18send -- "env | grep SHELL;pwd\r"
18expect { 19expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
20 ".cshrc" 21 "SHELL"
21} 22}
22
23send -- "env | grep SHELL\r"
24expect { 23expect {
25 timeout {puts "TESTING ERROR 2\n";exit} 24 timeout {puts "TESTING ERROR 2\n";exit}
26 "SHELL" 25 "/bin/csh"
27} 26}
28expect { 27expect {
29 timeout {puts "TESTING ERROR 2.1\n";exit} 28 timeout {puts "TESTING ERROR 3\n";exit}
30 "/bin/csh" 29 "home"
31} 30}
32send -- "exit\r" 31send -- "exit\r"
33after 100 32after 100
34 33
35puts "\n" 34puts "\nall done\n"
diff --git a/test/environment/dash.exp b/test/environment/dash.exp
index cad4422a0..983a527cf 100755
--- a/test/environment/dash.exp
+++ b/test/environment/dash.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4cd /home 7cd /home
diff --git a/test/environment/deterministic-exit-code.exp b/test/environment/deterministic-exit-code.exp
new file mode 100755
index 000000000..1a1e53605
--- /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-2021 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/dns.exp b/test/environment/dns.exp
index 0d12a82f2..5b06b51c0 100755
--- a/test/environment/dns.exp
+++ b/test/environment/dns.exp
@@ -1,29 +1,82 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 30 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
5match_max 100000 8match_max 100000
6 9
7send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1\r" 10send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2 --dns=1.2.3.4 sleep 1\r"
8expect { 11expect {
9 timeout {puts "TESTING ERROR 2.1\n";exit} 12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Warning: up to 4 DNS servers can be specified, 1.2.3.4 ignored"
14}
15expect {
16 timeout {puts "TESTING ERROR 1.1\n";exit}
17 "DNS server 8.8.4.4"
18}
19expect {
20 timeout {puts "TESTING ERROR 1.2\n";exit}
21 "DNS server 8.8.8.8"
22}
23expect {
24 timeout {puts "TESTING ERROR 1.3\n";exit}
25 "DNS server 4.2.2.1"
26}
27expect {
28 timeout {puts "TESTING ERROR 1.4\n";exit}
29 "DNS server ::2"
30}
31expect {
32 timeout {puts "TESTING ERROR 1.5\n";exit}
33 "Child process initialized"
34}
35expect {
36 timeout {puts "TESTING ERROR 1.6\n";exit}
37 "Parent is shutting down, bye..."
38}
39after 100
40
41
42send -- "firejail --quiet --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2 --dns=1.2.3.4 cat /etc/passwd\r"
43expect {
44 timeout {puts "TESTING ERROR 2\n";exit}
45 "Warning: up to 4 DNS servers can be specified, 1.2.3.4 ignored" {puts "TESTING ERROR 2.1\n";exit}
46 "DNS server 8.8.4.4" {puts "TESTING ERROR 2.2\n";exit}
47 "DNS server 8.8.8.8" {puts "TESTING ERROR 2.3\n";exit}
48 "DNS server 4.2.2.1" {puts "TESTING ERROR 2.4\n";exit}
49 "DNS server ::2" {puts "TESTING ERROR 2.5\n";exit}
50 "Child process initialized" {puts "TESTING ERROR 2.6\n";exit}
51 "Parent is shutting down, bye..." {puts "TESTING ERROR 2.7\n";exit}
52 "root"
53}
54after 100
55
56send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2\r"
57expect {
58 timeout {puts "TESTING ERROR 3\n";exit}
10 "Child process initialized" 59 "Child process initialized"
11} 60}
12sleep 1 61sleep 1
13 62
14send -- "cat /etc/resolv.conf\r" 63send -- "cat /etc/resolv.conf\r"
15expect { 64expect {
16 timeout {puts "TESTING ERROR 2.2\n";exit} 65 timeout {puts "TESTING ERROR 4.1\n";exit}
17 "nameserver 8.8.4.4" 66 "nameserver 8.8.4.4"
18} 67}
19expect { 68expect {
20 timeout {puts "TESTING ERROR 2.3\n";exit} 69 timeout {puts "TESTING ERROR 4.2\n";exit}
21 "nameserver 8.8.8.8" 70 "nameserver 8.8.8.8"
22} 71}
23expect { 72expect {
24 timeout {puts "TESTING ERROR 2.4\n";exit} 73 timeout {puts "TESTING ERROR 4.3\n";exit}
25 "nameserver 4.2.2.1" 74 "nameserver 4.2.2.1"
26} 75}
76expect {
77 timeout {puts "TESTING ERROR 4.4\n";exit}
78 "nameserver ::2"
79}
27after 100 80after 100
28send -- "exit\r" 81send -- "exit\r"
29sleep 1 82sleep 1
@@ -31,39 +84,43 @@ sleep 1
31 84
32send -- "firejail --profile=dns.profile\r" 85send -- "firejail --profile=dns.profile\r"
33expect { 86expect {
34 timeout {puts "TESTING ERROR 12.1\n";exit} 87 timeout {puts "TESTING ERROR 5.1\n";exit}
35 "Child process initialized" 88 "Child process initialized"
36} 89}
37sleep 1 90sleep 1
38 91
39send -- "cat /etc/resolv.conf\r" 92send -- "cat /etc/resolv.conf\r"
40expect { 93expect {
41 timeout {puts "TESTING ERROR 12.2\n";exit} 94 timeout {puts "TESTING ERROR 5.2\n";exit}
42 "nameserver 8.8.4.4" 95 "nameserver 8.8.4.4"
43} 96}
44expect { 97expect {
45 timeout {puts "TESTING ERROR 12.3\n";exit} 98 timeout {puts "TESTING ERROR 5.3\n";exit}
46 "nameserver 8.8.8.8" 99 "nameserver 8.8.8.8"
47} 100}
48expect { 101expect {
49 timeout {puts "TESTING ERROR 12.4\n";exit} 102 timeout {puts "TESTING ERROR 5.4\n";exit}
50 "nameserver 4.2.2.1" 103 "nameserver 4.2.2.1"
51} 104}
52after 100 105after 100
106expect {
107 timeout {puts "TESTING ERROR 5.5\n";exit}
108 "nameserver ::2"
109}
53send -- "exit\r" 110send -- "exit\r"
54sleep 1 111sleep 1
55 112
56send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r" 113send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r"
57expect { 114expect {
58 timeout {puts "TESTING ERROR 1.2\n";exit} 115 timeout {puts "TESTING ERROR 6.1\n";exit}
59 "connect" 116 "connect"
60} 117}
61expect { 118expect {
62 timeout {puts "TESTING ERROR 1.2\n";exit} 119 timeout {puts "TESTING ERROR 6.2\n";exit}
63 "208.67.222.222" 120 "208.67.222.222"
64} 121}
65expect { 122expect {
66 timeout {puts "TESTING ERROR 1.2\n";exit} 123 timeout {puts "TESTING ERROR 6.3\n";exit}
67 "53" 124 "53"
68} 125}
69after 100 126after 100
diff --git a/test/environment/dns.profile b/test/environment/dns.profile
index d1b842c86..ade2f2650 100644
--- a/test/environment/dns.profile
+++ b/test/environment/dns.profile
@@ -1,3 +1,4 @@
1dns 8.8.4.4 1dns 8.8.4.4
2dns 8.8.8.8 2dns 8.8.8.8
3dns 4.2.2.1 3dns 4.2.2.1
4dns ::2
diff --git a/test/environment/doubledash.exp b/test/environment/doubledash.exp
index ed0419f2d..275755337 100755
--- a/test/environment/doubledash.exp
+++ b/test/environment/doubledash.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/environment/env.exp b/test/environment/env.exp
index 9e2ba1e1c..4f6f8a1b7 100755
--- a/test/environment/env.exp
+++ b/test/environment/env.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/environment/environment.sh b/test/environment/environment.sh
index 308d99871..1e1dd549b 100755
--- a/test/environment/environment.sh
+++ b/test/environment/environment.sh
@@ -1,12 +1,16 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9 10
11echo "TESTING: timeout (test/environment/timeout.exp)"
12./timeout.exp
13
10echo "TESTING: DNS (test/environment/dns.exp)" 14echo "TESTING: DNS (test/environment/dns.exp)"
11./dns.exp 15./dns.exp
12 16
@@ -35,7 +39,7 @@ echo "TESTING: environment variables (test/environment/env.exp)"
35echo "TESTING: shell none(test/environment/shell-none.exp)" 39echo "TESTING: shell none(test/environment/shell-none.exp)"
36./shell-none.exp 40./shell-none.exp
37 41
38which dash 42which dash 2>/dev/null
39if [ "$?" -eq 0 ]; 43if [ "$?" -eq 0 ];
40then 44then
41 echo "TESTING: dash (test/environment/dash.exp)" 45 echo "TESTING: dash (test/environment/dash.exp)"
@@ -44,7 +48,7 @@ else
44 echo "TESTING SKIP: dash not found" 48 echo "TESTING SKIP: dash not found"
45fi 49fi
46 50
47which csh 51which csh 2>/dev/null
48if [ "$?" -eq 0 ]; 52if [ "$?" -eq 0 ];
49then 53then
50 echo "TESTING: csh (test/environment/csh.exp)" 54 echo "TESTING: csh (test/environment/csh.exp)"
@@ -53,7 +57,7 @@ else
53 echo "TESTING SKIP: csh not found" 57 echo "TESTING SKIP: csh not found"
54fi 58fi
55 59
56which zsh 60which zsh 2>/dev/null
57if [ "$?" -eq 0 ]; 61if [ "$?" -eq 0 ];
58then 62then
59 echo "TESTING: zsh (test/environment/zsh.exp)" 63 echo "TESTING: zsh (test/environment/zsh.exp)"
@@ -65,16 +69,13 @@ fi
65echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail-in-firejail.exp)" 69echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail-in-firejail.exp)"
66./firejail-in-firejail.exp 70./firejail-in-firejail.exp
67 71
68echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" 72which aplay 2>/dev/null
69./firejail-in-firejail2.exp 73if [ "$?" -eq 0 ] && [ "$(aplay -l | grep -c "List of PLAYBACK")" -gt 0 ];
70
71which aplay
72if [ "$?" -eq 0 ];
73then 74then
74 echo "TESTING: sound (test/environment/sound.exp)" 75 echo "TESTING: sound (test/environment/sound.exp)"
75 ./sound.exp 76 ./sound.exp
76else 77else
77 echo "TESTING SKIP: aplay not found" 78 echo "TESTING SKIP: no aplay or sound card found"
78fi 79fi
79 80
80echo "TESTING: nice (test/environment/nice.exp)" 81echo "TESTING: nice (test/environment/nice.exp)"
@@ -83,7 +84,7 @@ echo "TESTING: nice (test/environment/nice.exp)"
83echo "TESTING: quiet (test/environment/quiet.exp)" 84echo "TESTING: quiet (test/environment/quiet.exp)"
84./quiet.exp 85./quiet.exp
85 86
86which strace 87which strace 2>/dev/null
87if [ "$?" -eq 0 ]; 88if [ "$?" -eq 0 ];
88then 89then
89 echo "TESTING: --allow-debuggers (test/environment/allow-debuggers.exp)" 90 echo "TESTING: --allow-debuggers (test/environment/allow-debuggers.exp)"
@@ -111,8 +112,17 @@ echo "TESTING: rlimit (test/environment/rlimit.exp)"
111echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)" 112echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)"
112./rlimit-profile.exp 113./rlimit-profile.exp
113 114
115echo "TESTING: rlimit join (test/environment/rlimit-join.exp)"
116./rlimit-join.exp
117
114echo "TESTING: rlimit errors (test/environment/rlimit-bad.exp)" 118echo "TESTING: rlimit errors (test/environment/rlimit-bad.exp)"
115./rlimit-bad.exp 119./rlimit-bad.exp
116 120
117echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)" 121echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)"
118./rlimit-bad-profile.exp 122./rlimit-bad-profile.exp
123
124echo "TESTING: deterministic exit code (test/environment/deterministic-exit-code.exp)"
125./deterministic-exit-code.exp
126
127echo "TESTING: retain umask (test/environment/umask.exp)"
128(umask 123 && ./umask.exp)
diff --git a/test/environment/extract_command.exp b/test/environment/extract_command.exp
index 72d7501aa..f91a10fa6 100755
--- a/test/environment/extract_command.exp
+++ b/test/environment/extract_command.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/environment/firejail-in-firejail.exp b/test/environment/firejail-in-firejail.exp
index c2e2be596..459056260 100755
--- a/test/environment/firejail-in-firejail.exp
+++ b/test/environment/firejail-in-firejail.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -24,26 +24,6 @@ after 100
24send -- "exit\r" 24send -- "exit\r"
25after 100 25after 100
26 26
27send -- "firejail --force\r"
28expect {
29 timeout {puts "TESTING ERROR 3\n";exit}
30 "cannot rise privileges"
31}
32after 100
33
34send -- "firejail --version\r"
35expect {
36 timeout {puts "TESTING ERROR 4\n";exit}
37 "firejail version"
38}
39after 100
40
41send -- "firejail --version --force\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 "firejail version"
45}
46after 100
47 27
48 28
49puts "\nall done\n" 29puts "\nall done\n"
diff --git a/test/environment/hostfile.exp b/test/environment/hostfile.exp
index c42864432..6b98863e5 100755
--- a/test/environment/hostfile.exp
+++ b/test/environment/hostfile.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6 6
diff --git a/test/environment/ibus.exp b/test/environment/ibus.exp
index 75c7f5450..089736f33 100755
--- a/test/environment/ibus.exp
+++ b/test/environment/ibus.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4cd /home 7cd /home
diff --git a/test/environment/machineid.exp b/test/environment/machineid.exp
index 02eb6b232..f0b3d2942 100755
--- a/test/environment/machineid.exp
+++ b/test/environment/machineid.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6 6
diff --git a/test/environment/nice.exp b/test/environment/nice.exp
index f0ca93a5e..80591978d 100755
--- a/test/environment/nice.exp
+++ b/test/environment/nice.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -14,11 +14,7 @@ expect {
14} 14}
15sleep 1 15sleep 1
16 16
17send -- "top -b -n 1\r" 17send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 $env(USER)
21}
22expect { 18expect {
23 timeout {puts "TESTING ERROR 2\n";exit} 19 timeout {puts "TESTING ERROR 2\n";exit}
24 "15" 20 "15"
@@ -28,10 +24,6 @@ expect {
28 "bash" 24 "bash"
29} 25}
30expect { 26expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 $env(USER)
33}
34expect {
35 timeout {puts "TESTING ERROR 5\n";exit} 27 timeout {puts "TESTING ERROR 5\n";exit}
36 "15" 28 "15"
37} 29}
@@ -51,11 +43,7 @@ expect {
51} 43}
52sleep 1 44sleep 1
53 45
54send -- "top -b -n 1\r" 46send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r"
55expect {
56 timeout {puts "TESTING ERROR 11\n";exit}
57 $env(USER)
58}
59expect { 47expect {
60 timeout {puts "TESTING ERROR 12\n";exit} 48 timeout {puts "TESTING ERROR 12\n";exit}
61 "15" 49 "15"
@@ -65,10 +53,6 @@ expect {
65 "bash" 53 "bash"
66} 54}
67expect { 55expect {
68 timeout {puts "TESTING ERROR 14\n";exit}
69 $env(USER)
70}
71expect {
72 timeout {puts "TESTING ERROR 15\n";exit} 56 timeout {puts "TESTING ERROR 15\n";exit}
73 "15" 57 "15"
74} 58}
@@ -90,11 +74,7 @@ expect {
90} 74}
91sleep 1 75sleep 1
92 76
93send -- "top -b -n 1\r" 77send -- "top -b -n 1 | awk '{ print \$4, \$12 }'\r"
94expect {
95 timeout {puts "TESTING ERROR 18\n";exit}
96 $env(USER)
97}
98expect { 78expect {
99 timeout {puts "TESTING ERROR 19\n";exit} 79 timeout {puts "TESTING ERROR 19\n";exit}
100 "0" 80 "0"
@@ -104,10 +84,6 @@ expect {
104 "bash" 84 "bash"
105} 85}
106expect { 86expect {
107 timeout {puts "TESTING ERROR 21\n";exit}
108 $env(USER)
109}
110expect {
111 timeout {puts "TESTING ERROR 22\n";exit} 87 timeout {puts "TESTING ERROR 22\n";exit}
112 "0" 88 "0"
113} 89}
diff --git a/test/environment/output.exp b/test/environment/output.exp
index d175ddae2..dd03001d7 100755
--- a/test/environment/output.exp
+++ b/test/environment/output.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/environment/output.sh b/test/environment/output.sh
index 2be188e3a..edf7dc4cb 100755
--- a/test/environment/output.sh
+++ b/test/environment/output.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3i="0" 6i="0"
4 7
diff --git a/test/environment/quiet.exp b/test/environment/quiet.exp
index 3ab6d7f53..510491738 100755
--- a/test/environment/quiet.exp
+++ b/test/environment/quiet.exp
@@ -1,13 +1,14 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 4 6set timeout 4
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10# check ip address 10send -- "stty -echo\r"
11after 100
11send -- "firejail --quiet echo done\r" 12send -- "firejail --quiet echo done\r"
12expect { 13expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 14 timeout {puts "TESTING ERROR 1\n";exit}
diff --git a/test/environment/rlimit-bad-profile.exp b/test/environment/rlimit-bad-profile.exp
index cd77402fd..b1572afb6 100755
--- a/test/environment/rlimit-bad-profile.exp
+++ b/test/environment/rlimit-bad-profile.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -8,7 +11,7 @@ match_max 100000
8send -- "firejail --profile=rlimit-bad1.profile\r" 11send -- "firejail --profile=rlimit-bad1.profile\r"
9expect { 12expect {
10 timeout {puts "TESTING ERROR 4\n";exit} 13 timeout {puts "TESTING ERROR 4\n";exit}
11 "invalid rlimit" 14 "invalid rlimit-fsize in profile file. Only use positive numbers and k, m or g suffix."
12} 15}
13after 100 16after 100
14 17
diff --git a/test/environment/rlimit-bad.exp b/test/environment/rlimit-bad.exp
index 0a2fe9c98..c05e14b97 100755
--- a/test/environment/rlimit-bad.exp
+++ b/test/environment/rlimit-bad.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -7,7 +10,7 @@ match_max 100000
7send -- "firejail --rlimit-fsize=-1024\r" 10send -- "firejail --rlimit-fsize=-1024\r"
8expect { 11expect {
9 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
10 "invalid rlimit" 13 "invalid rlimit-fsize. Only use positive numbers and k, m or g suffix."
11} 14}
12after 100 15after 100
13 16
diff --git a/test/environment/rlimit-join.exp b/test/environment/rlimit-join.exp
new file mode 100755
index 000000000..aa8a203c0
--- /dev/null
+++ b/test/environment/rlimit-join.exp
@@ -0,0 +1,36 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11send -- "firejail --noprofile --name=\"rlimit testing\"\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 1
17
18spawn $env(SHELL)
19send -- "firejail --rlimit-nofile=1234 --join=\"rlimit testing\"\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "Switching to pid"
23}
24sleep 1
25
26send -- "cat /proc/self/limits\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "Max open files 1234 1234"
30}
31after 100
32
33send -- "exit\r"
34after 100
35
36puts "\nall done\n"
diff --git a/test/environment/rlimit-profile.exp b/test/environment/rlimit-profile.exp
index a9e54a405..4071675ee 100755
--- a/test/environment/rlimit-profile.exp
+++ b/test/environment/rlimit-profile.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4#cd /home 7#cd /home
@@ -27,6 +30,10 @@ expect {
27} 30}
28expect { 31expect {
29 timeout {puts "TESTING ERROR 1.4\n";exit} 32 timeout {puts "TESTING ERROR 1.4\n";exit}
33 "Max address space 1234567890 1234567890"
34}
35expect {
36 timeout {puts "TESTING ERROR 1.5\n";exit}
30 "Max pending signals 200 200" 37 "Max pending signals 200 200"
31} 38}
32after 100 39after 100
diff --git a/test/environment/rlimit.exp b/test/environment/rlimit.exp
index ecbe2a3b7..6fcb554a7 100755
--- a/test/environment/rlimit.exp
+++ b/test/environment/rlimit.exp
@@ -1,11 +1,14 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4cd /home 7cd /home
5spawn $env(SHELL) 8spawn $env(SHELL)
6match_max 100000 9match_max 100000
7 10
8send -- "firejail --rlimit-fsize=1024 --rlimit-nproc=1000 --rlimit-nofile=500 --rlimit-sigpending=200\r" 11send -- "firejail --rlimit-fsize=1024 --rlimit-nproc=1000 --rlimit-nofile=500 --rlimit-sigpending=200 --rlimit-as=1234567890\r"
9expect { 12expect {
10 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized" 14 "Child process initialized"
@@ -27,10 +30,14 @@ expect {
27} 30}
28expect { 31expect {
29 timeout {puts "TESTING ERROR 1.4\n";exit} 32 timeout {puts "TESTING ERROR 1.4\n";exit}
30 "Max pending signals 200 200" 33 "Max address space 1234567890 1234567890"
31} 34}
32expect { 35expect {
33 timeout {puts "TESTING ERROR 1.5\n";exit} 36 timeout {puts "TESTING ERROR 1.5\n";exit}
37 "Max pending signals 200 200"
38}
39expect {
40 timeout {puts "TESTING ERROR 1.6\n";exit}
34 "home" 41 "home"
35} 42}
36after 100 43after 100
diff --git a/test/environment/rlimit.profile b/test/environment/rlimit.profile
index 88fc9ff31..2f1134e6c 100644
--- a/test/environment/rlimit.profile
+++ b/test/environment/rlimit.profile
@@ -1,4 +1,5 @@
1 rlimit-fsize 1024 1rlimit-fsize 1024
2rlimit-nproc 1000 2rlimit-nproc 1000
3 rlimit-nofile 500 3rlimit-nofile 500
4rlimit-sigpending 200 4rlimit-sigpending 200
5rlimit-as 1234567890
diff --git a/test/environment/shell-none.exp b/test/environment/shell-none.exp
index 6514e6840..507225326 100755
--- a/test/environment/shell-none.exp
+++ b/test/environment/shell-none.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/environment/sound.exp b/test/environment/sound.exp
index 18691b1f9..e5fa27e77 100755
--- a/test/environment/sound.exp
+++ b/test/environment/sound.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6 6
diff --git a/test/environment/timeout.exp b/test/environment/timeout.exp
new file mode 100755
index 000000000..ea0dd67b7
--- /dev/null
+++ b/test/environment/timeout.exp
@@ -0,0 +1,31 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "time firejail --timeout=00:00:05\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17sleep 3
18send -- "env\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "container=firejail"
22}
23
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "m5." {puts "5 seconds"}
27 "m6." {puts "6 seconds"}
28 "m7." {puts "7 seconds"}
29}
30
31puts "\nall done\n"
diff --git a/test/fs_home_sanitize.exp b/test/environment/umask.exp
index d661f9c7b..e1f520fcd 100755
--- a/test/fs_home_sanitize.exp
+++ b/test/environment/umask.exp
@@ -1,32 +1,44 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
5match_max 100000 8match_max 100000
6 9
7send -- "firejail\r" 10send -- "firejail --noprofile\r"
8expect { 11expect {
9 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized" 13 "Child process initialized"
11} 14}
12sleep 1 15sleep 1
13 16
14send -- "ls /home;pwd\r" 17send -- "umask\r"
15expect { 18expect {
16 timeout {puts "TESTING ERROR 1\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
17 "bingo" 20 "0123"
18} 21}
22after 100
23
24send -- "firejail\r"
19expect { 25expect {
20 timeout {puts "TESTING ERROR 2\n";exit} 26 timeout {puts "TESTING ERROR 2\n";exit}
21 "home" 27 "Warning: an existing sandbox was detected"
22} 28}
23sleep 1 29after 100
24 30
25send -- "ls /home/bingo;pwd\r" 31send -- "umask\r"
26expect { 32expect {
27 timeout {puts "TESTING ERROR 3\n";exit} 33 timeout {puts "TESTING ERROR 3\n";exit}
28 "cannot open directory" 34 "0123"
29} 35}
36after 100
37
38send -- "exit\r"
39after 100
40
41send -- "exit\r"
30sleep 1 42sleep 1
31 43
32puts "\n" 44puts "\nall done\n"
diff --git a/test/environment/zsh.exp b/test/environment/zsh.exp
index 711905f2c..a750ac55c 100755
--- a/test/environment/zsh.exp
+++ b/test/environment/zsh.exp
@@ -1,33 +1,32 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7cd /home
7spawn $env(SHELL) 8spawn $env(SHELL)
8match_max 100000 9match_max 100000
9 10
10send -- "firejail --private --tracelog --zsh\r" 11send -- "firejail --private --shell=/bin/zsh\r"
11expect { 12expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 14 "Child process initialized"
14} 15}
15sleep 1 16sleep 1
16 17
17send -- "find ~\r" 18send -- "env | grep SHELL;pwd\r"
18expect { 19expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
20 ".zshrc" 21 "SHELL"
21} 22}
22
23send -- "env | grep SHELL;pwd\r"
24expect { 23expect {
25 timeout {puts "TESTING ERROR 2\n";exit} 24 timeout {puts "TESTING ERROR 2\n";exit}
26 "SHELL" 25 "/bin/zsh"
27} 26}
28expect { 27expect {
29 timeout {puts "TESTING ERROR 2.1\n";exit} 28 timeout {puts "TESTING ERROR 3\n";exit}
30 "/bin/zsh" 29 "home"
31} 30}
32send -- "exit\r" 31send -- "exit\r"
33after 100 32after 100
diff --git a/test/fcopy/cmdline.exp b/test/fcopy/cmdline.exp
index 798c9e718..00e44e489 100755
--- a/test/fcopy/cmdline.exp
+++ b/test/fcopy/cmdline.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fcopy/dircopy.exp b/test/fcopy/dircopy.exp
index e8462ae82..633d12d08 100755
--- a/test/fcopy/dircopy.exp
+++ b/test/fcopy/dircopy.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6# 6#
@@ -118,6 +118,8 @@ expect {
118} 118}
119after 100 119after 100
120 120
121send -- "stty -echo\r"
122after 100
121send -- "diff -q src/a/b/file4 dest/a/b/file4; echo done\r" 123send -- "diff -q src/a/b/file4 dest/a/b/file4; echo done\r"
122expect { 124expect {
123 timeout {puts "TESTING ERROR 16\n";exit} 125 timeout {puts "TESTING ERROR 16\n";exit}
diff --git a/test/fcopy/fcopy.sh b/test/fcopy/fcopy.sh
index 19401cf98..822f6a9cd 100755
--- a/test/fcopy/fcopy.sh
+++ b/test/fcopy/fcopy.sh
@@ -1,17 +1,18 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9if [ -f /etc/debian_version ]; then 10if [ -f /etc/debian_version ]; then
10 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)") 11 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)")
11 export PATH="$PATH:$libdir" 12 export PATH="$PATH:$libdir"
12fi 13fi
13 14
14export PATH="$PATH:/usr/lib/firejail" 15export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
15 16
16mkdir dest 17mkdir dest
17 18
@@ -27,7 +28,4 @@ echo "TESTING: fcopy file (test/fcopy/filecopy.exp)"
27echo "TESTING: fcopy link (test/fcopy/linkcopy.exp)" 28echo "TESTING: fcopy link (test/fcopy/linkcopy.exp)"
28./linkcopy.exp 29./linkcopy.exp
29 30
30echo "TESTING: fcopy trailing char (test/copy/trailing.exp)"
31./trailing.exp
32
33rm -fr dest/* 31rm -fr dest/*
diff --git a/test/fcopy/filecopy.exp b/test/fcopy/filecopy.exp
index 824a22bba..fb911e222 100755
--- a/test/fcopy/filecopy.exp
+++ b/test/fcopy/filecopy.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6# 6#
@@ -35,6 +35,8 @@ expect {
35 "rwxrwxr-x" { puts "umask 0002\n" } 35 "rwxrwxr-x" { puts "umask 0002\n" }
36} 36}
37after 100 37after 100
38send -- "stty -echo\r"
39after 100
38 40
39send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r" 41send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r"
40expect { 42expect {
diff --git a/test/fcopy/linkcopy.exp b/test/fcopy/linkcopy.exp
index 46ee327cb..dbc33c6a7 100755
--- a/test/fcopy/linkcopy.exp
+++ b/test/fcopy/linkcopy.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6# 6#
@@ -34,6 +34,8 @@ expect {
34 "lrwxrwxrwx" 34 "lrwxrwxrwx"
35} 35}
36after 100 36after 100
37send -- "stty -echo\r"
38after 100
37 39
38send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r" 40send -- "diff -q dircopy.exp dest/dircopy.exp; echo done\r"
39expect { 41expect {
diff --git a/test/fcopy/trailing.exp b/test/fcopy/trailing.exp
deleted file mode 100755
index 1bff4e6c8..000000000
--- a/test/fcopy/trailing.exp
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6#
7# copy directory src to dest
8#
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12
13send -- "firejail --private-etc=group,passwd,firejail/ ls /etc/firejail\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18expect {
19 timeout {puts "TESTING ERROR 0\n";exit}
20 "0ad.profile"
21}
22after 100
23
24
25puts "\nall done\n"
diff --git a/test/features/1.1.exp b/test/features/1.1.exp
index 2273a3b98..fe1e0f132 100755
--- a/test/features/1.1.exp
+++ b/test/features/1.1.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# disable /boot 6# disable /boot
4# 7#
diff --git a/test/features/1.10.exp b/test/features/1.10.exp
index b668f5cd1..5dd03ecef 100755
--- a/test/features/1.10.exp
+++ b/test/features/1.10.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# disable /selinux 6# disable /selinux
4# 7#
diff --git a/test/features/1.2.exp b/test/features/1.2.exp
index 81f9531cb..f7a55b445 100755
--- a/test/features/1.2.exp
+++ b/test/features/1.2.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# new /proc 6# new /proc
4# 7#
diff --git a/test/features/1.4.exp b/test/features/1.4.exp
index de05536f0..66a8c1175 100755
--- a/test/features/1.4.exp
+++ b/test/features/1.4.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# mask other users 6# mask other users
4# 7#
diff --git a/test/features/1.5.exp b/test/features/1.5.exp
index 194c7859e..ba0aea220 100755
--- a/test/features/1.5.exp
+++ b/test/features/1.5.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# PID namespace 6# PID namespace
4# 7#
diff --git a/test/features/1.6.exp b/test/features/1.6.exp
index 111aca3c8..89fa29de0 100755
--- a/test/features/1.6.exp
+++ b/test/features/1.6.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# new /var/log 6# new /var/log
4# 7#
diff --git a/test/features/1.7.exp b/test/features/1.7.exp
index dc73ae529..3e9c0908f 100755
--- a/test/features/1.7.exp
+++ b/test/features/1.7.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# new /var/tmp 6# new /var/tmp
4# 7#
diff --git a/test/features/1.8.exp b/test/features/1.8.exp
index 3bb43718e..15936c2fb 100755
--- a/test/features/1.8.exp
+++ b/test/features/1.8.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# disable /etc/firejail and ~/.config/firejail 6# disable /etc/firejail and ~/.config/firejail
4# 7#
diff --git a/test/features/2.1.exp b/test/features/2.1.exp
index d560d1a36..6e741a1c2 100755
--- a/test/features/2.1.exp
+++ b/test/features/2.1.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# hostname 6# hostname
4# 7#
diff --git a/test/features/2.2.exp b/test/features/2.2.exp
index 00ed20e1f..3f30d0bad 100755
--- a/test/features/2.2.exp
+++ b/test/features/2.2.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# DNS 6# DNS
4# 7#
diff --git a/test/features/2.3.exp b/test/features/2.3.exp
index 9d3320d78..6c520fdba 100755
--- a/test/features/2.3.exp
+++ b/test/features/2.3.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# mac-vlan 6# mac-vlan
4# 7#
diff --git a/test/features/2.4.exp b/test/features/2.4.exp
index 6784e1add..74b7881f0 100755
--- a/test/features/2.4.exp
+++ b/test/features/2.4.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# bridge 6# bridge
4# - todo: ping test or equivalent on chroot 7# - todo: ping test or equivalent on chroot
diff --git a/test/features/2.5.exp b/test/features/2.5.exp
index 2d4c7a9bc..bc3e44e8f 100755
--- a/test/features/2.5.exp
+++ b/test/features/2.5.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# interface 6# interface
4# 7#
diff --git a/test/features/2.6.exp b/test/features/2.6.exp
index 63a9b3b90..7c763e6f1 100755
--- a/test/features/2.6.exp
+++ b/test/features/2.6.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# default gateway 6# default gateway
4# 7#
diff --git a/test/features/3.1.exp b/test/features/3.1.exp
index 3178cda42..6ba56517a 100755
--- a/test/features/3.1.exp
+++ b/test/features/3.1.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# private 6# private
4# 7#
diff --git a/test/features/3.10.exp b/test/features/3.10.exp
index d6d858322..4797c765b 100755
--- a/test/features/3.10.exp
+++ b/test/features/3.10.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# whitelist tmp 6# whitelist tmp
4# 7#
diff --git a/test/features/3.11.exp b/test/features/3.11.exp
index 4e89aa372..b26d7b888 100755
--- a/test/features/3.11.exp
+++ b/test/features/3.11.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# mkdir 6# mkdir
4# 7#
diff --git a/test/features/3.2.exp b/test/features/3.2.exp
index 271bbdda1..df73b9786 100755
--- a/test/features/3.2.exp
+++ b/test/features/3.2.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# read-only 6# read-only
4# 7#
diff --git a/test/features/3.3.exp b/test/features/3.3.exp
index c662410dc..499718dbd 100755
--- a/test/features/3.3.exp
+++ b/test/features/3.3.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# blacklist 6# blacklist
4# 7#
diff --git a/test/features/3.4.exp b/test/features/3.4.exp
index 2e0f7cae7..e59ff8a38 100755
--- a/test/features/3.4.exp
+++ b/test/features/3.4.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# whitelist home 6# whitelist home
4# 7#
diff --git a/test/features/3.5.exp b/test/features/3.5.exp
index abaf42a0e..8c37aebb3 100755
--- a/test/features/3.5.exp
+++ b/test/features/3.5.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# private-dev 6# private-dev
4# 7#
diff --git a/test/features/3.6.exp b/test/features/3.6.exp
index 043a24121..0149a04cd 100755
--- a/test/features/3.6.exp
+++ b/test/features/3.6.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# private-etc 6# private-etc
4# 7#
diff --git a/test/features/3.7.exp b/test/features/3.7.exp
index bcd50c389..9d3e7265c 100755
--- a/test/features/3.7.exp
+++ b/test/features/3.7.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# private-tmp 6# private-tmp
4# 7#
diff --git a/test/features/3.8.exp b/test/features/3.8.exp
index 4497b9f19..5546ef15b 100755
--- a/test/features/3.8.exp
+++ b/test/features/3.8.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# private-bin 6# private-bin
4# 7#
diff --git a/test/features/3.9.exp b/test/features/3.9.exp
index e6cefa0f6..6029160a6 100755
--- a/test/features/3.9.exp
+++ b/test/features/3.9.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# whitelist dev 6# whitelist dev
4# 7#
diff --git a/test/features/test.sh b/test/features/test.sh
index cf62d0a3d..392e6c159 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -1,4 +1,9 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6export LC_ALL=C
2OVERLAY="overlay" 7OVERLAY="overlay"
3CHROOT="chroot" 8CHROOT="chroot"
4NETWORK="network" 9NETWORK="network"
diff --git a/test/filters/apparmor.exp b/test/filters/apparmor.exp
new file mode 100755
index 000000000..f20326fe0
--- /dev/null
+++ b/test/filters/apparmor.exp
@@ -0,0 +1,59 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test1 --apparmor\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17spawn $env(SHELL)
18send -- "firejail --name=test2 --apparmor\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "Child process initialized"
22}
23sleep 1
24
25spawn $env(SHELL)
26send -- "firemon --apparmor\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "test1:firejail --name=test1 --apparmor"
30}
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "AppArmor: firejail-default enforce"
34}
35expect {
36 timeout {puts "TESTING ERROR 4\n";exit}
37 "test2:firejail --name=test2 --apparmor"
38}
39expect {
40 timeout {puts "TESTING ERROR 5\n";exit}
41 "AppArmor: firejail-default enforce"
42}
43after 100
44
45send -- "firejail --apparmor.print=test1\r"
46expect {
47 timeout {puts "TESTING ERROR 6\n";exit}
48 "AppArmor: firejail-default enforce"
49}
50after 100
51
52send -- "firejail --apparmor.print=test2\r"
53expect {
54 timeout {puts "TESTING ERROR 7\n";exit}
55 "AppArmor: firejail-default enforce"
56}
57after 100
58
59puts "\nall done\n"
diff --git a/test/filters/caps-join.exp b/test/filters/caps-join.exp
new file mode 100755
index 000000000..4f3a2832d
--- /dev/null
+++ b/test/filters/caps-join.exp
@@ -0,0 +1,96 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7match_max 100000
8spawn $env(SHELL)
9set id1 $spawn_id
10spawn $env(SHELL)
11set id2 $spawn_id
12
13send -- "stty -echo\r"
14after 100
15
16#
17# regular run
18#
19set spawn_id $id1
20send -- "firejail --name=jointesting\r"
21expect {
22 timeout {puts "TESTING ERROR 0\n";exit}
23 "Child process initialized"
24}
25sleep 1
26
27set spawn_id $id2
28
29send -- "firejail --join=jointesting cat /proc/self/status\r"
30expect {
31 timeout {puts "TESTING ERROR 1\n";exit}
32 "CapBnd: 0000000000000000"
33}
34sleep 1
35
36set spawn_id $id1
37send -- "exit\r"
38after 100
39
40#
41# no caps
42#
43set spawn_id $id1
44send -- "firejail --name=jointesting --noprofile\r"
45expect {
46 timeout {puts "TESTING ERROR 10\n";exit}
47 "Child process initialized"
48}
49sleep 1
50
51set spawn_id $id2
52
53send -- "firejail --join=jointesting cat /proc/self/status\r"
54expect {
55 timeout {puts "TESTING ERROR 11\n";exit}
56 "CapBnd:"
57}
58expect {
59 timeout {puts "TESTING ERROR 12\n";exit}
60 "fffffffff"
61}
62expect {
63 timeout {puts "TESTING ERROR 13\n";exit}
64 "CapAmb:"
65}
66sleep 1
67
68set spawn_id $id1
69send -- "exit\r"
70after 100
71
72#
73# no caps
74#
75set spawn_id $id1
76send -- "firejail --name=jointesting --noprofile --caps.keep=chown,fowner\r"
77expect {
78 timeout {puts "TESTING ERROR20\n";exit}
79 "Child process initialized"
80}
81sleep 1
82
83set spawn_id $id2
84
85send -- "firejail --join=jointesting cat /proc/self/status\r"
86expect {
87 timeout {puts "TESTING ERROR 21\n";exit}
88 "CapBnd: 0000000000000009"
89}
90sleep 1
91
92set spawn_id $id1
93send -- "exit\r"
94after 100
95
96puts "all done\n"
diff --git a/test/filters/caps-print.exp b/test/filters/caps-print.exp
index 605041e22..e8465aee1 100755
--- a/test/filters/caps-print.exp
+++ b/test/filters/caps-print.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/caps.exp b/test/filters/caps.exp
index aff5f03c2..8776e83d4 100755
--- a/test/filters/caps.exp
+++ b/test/filters/caps.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/debug.exp b/test/filters/debug.exp
index d37353378..b2ca95191 100755
--- a/test/filters/debug.exp
+++ b/test/filters/debug.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index d59d9109b..a9f06b60a 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -1,19 +1,24 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9if [ -f /etc/debian_version ]; then 10if [ -f /etc/debian_version ]; then
10 libdir=$(dirname "$(dpkg -L firejail | grep fseccomp)") 11 libdir=$(dirname "$(dpkg -L firejail | grep fseccomp)")
11 export PATH="$PATH:$libdir" 12 export PATH="$PATH:$libdir"
12else
13 export PATH="$PATH:/usr/lib/firejail"
14fi 13fi
14export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
15 15
16export PATH="$PATH:/usr/lib/firejail" 16if [ -f /sys/kernel/security/apparmor/profiles ]; then
17 echo "TESTING: apparmor (test/filters/apparmor.exp)"
18 ./apparmor.exp
19else
20 echo "TESTING SKIP: no apparmor support in Linux kernel (test/filters/apparmor.exp)"
21fi
17 22
18if [ "$(uname -m)" = "x86_64" ]; then 23if [ "$(uname -m)" = "x86_64" ]; then
19 echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)" 24 echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)"
@@ -28,15 +33,29 @@ fi
28echo "TESTING: debug options (test/filters/debug.exp)" 33echo "TESTING: debug options (test/filters/debug.exp)"
29./debug.exp 34./debug.exp
30 35
36echo "TESTING: seccomp run files (test/filters/seccomp-run-files.exp)"
37./seccomp-run-files.exp
38
39echo "TESTING: seccomp postexec (test/filters/seccomp-postexec.exp)"
40./seccomp-postexec.exp
41
31echo "TESTING: noroot (test/filters/noroot.exp)" 42echo "TESTING: noroot (test/filters/noroot.exp)"
32./noroot.exp 43./noroot.exp
33 44
34echo "TESTING: capabilities (test/filters/caps.exp)" 45
35./caps.exp 46if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then
47 echo "TESTING: capabilities (test/filters/caps.exp)"
48 ./caps.exp
49else
50 echo "TESTING SKIP: other capabilities than expected (test/filters/caps.exp)"
51fi
36 52
37echo "TESTING: capabilities print (test/filters/caps-print.exp)" 53echo "TESTING: capabilities print (test/filters/caps-print.exp)"
38./caps-print.exp 54./caps-print.exp
39 55
56echo "TESTING: capabilities join (test/filters/caps-join.exp)"
57./caps-join.exp
58
40rm -f seccomp-test-file 59rm -f seccomp-test-file
41if [ "$(uname -m)" = "x86_64" ]; then 60if [ "$(uname -m)" = "x86_64" ]; then
42 echo "TESTING: fseccomp (test/filters/fseccomp.exp)" 61 echo "TESTING: fseccomp (test/filters/fseccomp.exp)"
@@ -73,7 +92,7 @@ echo "TESTING: seccomp errno (test/filters/seccomp-errno.exp)"
73echo "TESTING: seccomp su (test/filters/seccomp-su.exp)" 92echo "TESTING: seccomp su (test/filters/seccomp-su.exp)"
74./seccomp-su.exp 93./seccomp-su.exp
75 94
76which strace 95which strace 2>/dev/null
77if [ $? -eq 0 ]; then 96if [ $? -eq 0 ]; then
78 echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)" 97 echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)"
79 ./seccomp-ptrace.exp 98 ./seccomp-ptrace.exp
@@ -92,9 +111,19 @@ echo "TESTING: seccomp chmod profile - seccomp lists (test/filters/seccomp-chmod
92echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)" 111echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)"
93./seccomp-empty.exp 112./seccomp-empty.exp
94 113
114echo "TESTING: seccomp numeric (test/filters/seccomp-numeric.exp)"
115./seccomp-numeric.exp
116
95if [ "$(uname -m)" = "x86_64" ]; then 117if [ "$(uname -m)" = "x86_64" ]; then
96 echo "TESTING: seccomp dual filter (test/filters/seccomp-dualfilter.exp)" 118 echo "TESTING: seccomp dual filter (test/filters/seccomp-dualfilter.exp)"
97 ./seccomp-dualfilter.exp 119 ./seccomp-dualfilter.exp
98else 120else
99 echo "TESTING SKIP: seccomp dual, not running on x86_64" 121 echo "TESTING SKIP: seccomp dual, not running on x86_64"
100fi 122fi
123
124if [ "$(uname -m)" = "x86_64" ]; then
125 echo "TESTING: seccomp join (test/filters/seccomp-join.exp)"
126 ./seccomp-join.exp
127else
128 echo "TESTING SKIP: seccomp join test implemented only for x86_64"
129fi
diff --git a/test/filters/fseccomp.exp b/test/filters/fseccomp.exp
index a71c35302..59f812d6d 100755
--- a/test/filters/fseccomp.exp
+++ b/test/filters/fseccomp.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -31,104 +31,87 @@ expect {
31after 100 31after 100
32send -- "fseccomp protocol build unix,inet seccomp-test-file\r" 32send -- "fseccomp protocol build unix,inet seccomp-test-file\r"
33after 100 33after 100
34send -- "fseccomp print seccomp-test-file\r" 34send -- "fsec-print seccomp-test-file\r"
35expect { 35expect {
36 timeout {puts "TESTING ERROR 4.1\n";exit} 36 timeout {puts "TESTING ERROR 4.1\n";exit}
37 "WHITELIST 41 socket" 37 "jeq socket"
38}
39
40after 100
41send -- "fseccomp secondary 64 seccomp-test-file\r"
42after 100
43send -- "fseccomp print seccomp-test-file\r"
44expect {
45 timeout {puts "TESTING ERROR 5.1\n";exit}
46 "BLACKLIST 165 mount"
47}
48expect {
49 timeout {puts "TESTING ERROR 5.2\n";exit}
50 "BLACKLIST 166 umount2"
51}
52expect {
53 timeout {puts "TESTING ERROR 5.3\n";exit}
54 "RETURN_ALLOW"
55} 38}
56 39
57after 100 40after 100
58send -- "fseccomp default seccomp-test-file\r" 41send -- "fseccomp default seccomp-test-file\r"
59after 100 42after 100
60send -- "fseccomp print seccomp-test-file\r" 43send -- "fsec-print seccomp-test-file\r"
61expect { 44expect {
62 timeout {puts "TESTING ERROR 6.1\n";exit} 45 timeout {puts "TESTING ERROR 6.1\n";exit}
63 "BLACKLIST 165 mount" 46 "jeq mount"
64} 47}
65expect { 48expect {
66 timeout {puts "TESTING ERROR 6.2\n";exit} 49 timeout {puts "TESTING ERROR 6.2\n";exit}
67 "BLACKLIST 166 umount2" 50 "jeq umount2"
68} 51}
69expect { 52expect {
70 timeout {puts "TESTING ERROR 6.3\n";exit} 53 timeout {puts "TESTING ERROR 6.3\n";exit}
71 "RETURN_ALLOW" 54 "ret ALLOW"
72} 55}
73 56
74after 100 57after 100
75send -- "fseccomp drop seccomp-test-file tmpfile chmod,chown\r" 58send -- "fseccomp drop seccomp-test-file tmpfile chmod,chown\r"
76after 100 59after 100
77send -- "fseccomp print seccomp-test-file\r" 60send -- "fsec-print seccomp-test-file\r"
78expect { 61expect {
79 timeout {puts "TESTING ERROR 7.1\n";exit} 62 timeout {puts "TESTING ERROR 7.1\n";exit}
80 "BLACKLIST 165 mount" {puts "TESTING ERROR 7.2\n";exit} 63 "jeq mount" {puts "TESTING ERROR 7.2\n";exit}
81 "BLACKLIST 166 umount2" {puts "TESTING ERROR 7.3\n";exit} 64 "jeq umount2" {puts "TESTING ERROR 7.3\n";exit}
82 "BLACKLIST 90 chmod" 65 "jeq chmod"
83} 66}
84expect { 67expect {
85 timeout {puts "TESTING ERROR 7.4\n";exit} 68 timeout {puts "TESTING ERROR 7.4\n";exit}
86 "BLACKLIST 92 chown" 69 "jeq chown"
87} 70}
88expect { 71expect {
89 timeout {puts "TESTING ERROR 7.5\n";exit} 72 timeout {puts "TESTING ERROR 7.5\n";exit}
90 "RETURN_ALLOW" 73 "ret ALLOW"
91} 74}
92 75
93after 100 76after 100
94send -- "fseccomp default drop seccomp-test-file tmpfile chmod,chown\r" 77send -- "fseccomp default drop seccomp-test-file tmpfile chmod,chown\r"
95after 100 78after 100
96send -- "fseccomp print seccomp-test-file\r" 79send -- "fsec-print seccomp-test-file\r"
97expect { 80expect {
98 timeout {puts "TESTING ERROR 8.1\n";exit} 81 timeout {puts "TESTING ERROR 8.1\n";exit}
99 "BLACKLIST 165 mount" 82 "jeq mount"
100} 83}
101expect { 84expect {
102 timeout {puts "TESTING ERROR 8.2\n";exit} 85 timeout {puts "TESTING ERROR 8.2\n";exit}
103 "BLACKLIST 166 umount2" 86 "jeq umount2"
104} 87}
105expect { 88expect {
106 timeout {puts "TESTING ERROR 8.3\n";exit} 89 timeout {puts "TESTING ERROR 8.3\n";exit}
107 "BLACKLIST 90 chmod" 90 "jeq chmod"
108} 91}
109expect { 92expect {
110 timeout {puts "TESTING ERROR 8.4\n";exit} 93 timeout {puts "TESTING ERROR 8.4\n";exit}
111 "BLACKLIST 92 chown" 94 "jeq chown"
112} 95}
113expect { 96expect {
114 timeout {puts "TESTING ERROR 8.5\n";exit} 97 timeout {puts "TESTING ERROR 8.5\n";exit}
115 "RETURN_ALLOW" 98 "ret ALLOW"
116} 99}
117after 100 100after 100
118send -- "fseccomp keep seccomp-test-file tmpfile chmod,chown\r" 101send -- "fseccomp keep seccomp-test-file tmpfile chmod,chown\r"
119after 100 102after 100
120send -- "fseccomp print seccomp-test-file\r" 103send -- "fsec-print seccomp-test-file\r"
121expect { 104expect {
122 timeout {puts "TESTING ERROR 9.1\n";exit} 105 timeout {puts "TESTING ERROR 9.1\n";exit}
123 "WHITELIST 90 chmod" 106 "jeq chmod"
124} 107}
125expect { 108expect {
126 timeout {puts "TESTING ERROR 9.2\n";exit} 109 timeout {puts "TESTING ERROR 9.2\n";exit}
127 "WHITELIST 92 chown" 110 "jeq chown"
128} 111}
129expect { 112expect {
130 timeout {puts "TESTING ERROR 9.3\n";exit} 113 timeout {puts "TESTING ERROR 9.3\n";exit}
131 "KILL_PROCESS" 114 "ret KILL"
132} 115}
133 116
134 117
diff --git a/test/filters/memwrexe b/test/filters/memwrexe
index 3a079672c..669f0d320 100755
--- a/test/filters/memwrexe
+++ b/test/filters/memwrexe
Binary files differ
diff --git a/test/filters/memwrexe-32.exp b/test/filters/memwrexe-32.exp
index af2159973..1aeaacc82 100755
--- a/test/filters/memwrexe-32.exp
+++ b/test/filters/memwrexe-32.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -29,6 +29,18 @@ expect {
29 "mprotect successful" {puts "TESTING ERROR 12\n";exit} 29 "mprotect successful" {puts "TESTING ERROR 12\n";exit}
30 "Parent is shutting down" 30 "Parent is shutting down"
31} 31}
32after 100
33
34send -- "firejail --memory-deny-write-execute ./memwrexe-32 memfd_create\r"
35expect {
36 timeout {puts "TESTING ERROR 20\n";exit}
37 "Child process initialized"
38}
39expect {
40 timeout {puts "TESTING ERROR 21\n";exit}
41 "memfd_create successful" {puts "TESTING ERROR 22\n";exit}
42 "Parent is shutting down"
43}
32 44
33after 100 45after 100
34puts "\nall done\n" 46puts "\nall done\n"
diff --git a/test/filters/memwrexe.c b/test/filters/memwrexe.c
index 7e14aa23d..4fbf05f78 100644
--- a/test/filters/memwrexe.c
+++ b/test/filters/memwrexe.c
@@ -1,3 +1,7 @@
1// This file is part of Firejail project
2// Copyright (C) 2014-2021 Firejail Authors
3// License GPL v2
4
1#include <stdio.h> 5#include <stdio.h>
2#include <stdlib.h> 6#include <stdlib.h>
3#include <string.h> 7#include <string.h>
@@ -6,12 +10,14 @@
6#include <sys/stat.h> 10#include <sys/stat.h>
7#include <fcntl.h> 11#include <fcntl.h>
8#include <sys/mman.h> 12#include <sys/mman.h>
13#include <sys/syscall.h>
9 14
10static void usage(void) { 15static void usage(void) {
11 printf("memwrexe options\n"); 16 printf("memwrexe options\n");
12 printf("where options is:\n"); 17 printf("where options is:\n");
13 printf("\tmmap - mmap test\n"); 18 printf("\tmmap - mmap test\n");
14 printf("\tmprotect - mprotect test\n"); 19 printf("\tmprotect - mprotect test\n");
20 printf("\tmemfd_create - memfd_create test\n");
15} 21}
16 22
17int main(int argc, char **argv) { 23int main(int argc, char **argv) {
@@ -20,7 +26,7 @@ int main(int argc, char **argv) {
20 usage(); 26 usage();
21 return 1; 27 return 1;
22 } 28 }
23 29
24 if (strcmp(argv[1], "mmap") == 0) { 30 if (strcmp(argv[1], "mmap") == 0) {
25 // open some file 31 // open some file
26 int fd = open("memwrexe.c", O_RDONLY); 32 int fd = open("memwrexe.c", O_RDONLY);
@@ -28,13 +34,13 @@ int main(int argc, char **argv) {
28 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 34 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
29 return 1; 35 return 1;
30 } 36 }
31 37
32 int size = lseek(fd, 0, SEEK_END); 38 int size = lseek(fd, 0, SEEK_END);
33 if (size == -1) { 39 if (size == -1) {
34 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 40 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
35 return 1; 41 return 1;
36 } 42 }
37 43
38 void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0); 44 void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
39 printf("mmap successful\n"); 45 printf("mmap successful\n");
40 46
@@ -51,19 +57,19 @@ int main(int argc, char **argv) {
51 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 57 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
52 return 1; 58 return 1;
53 } 59 }
54 60
55 int size = lseek(fd, 0, SEEK_END); 61 int size = lseek(fd, 0, SEEK_END);
56 if (size == -1) { 62 if (size == -1) {
57 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n"); 63 fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
58 return 1; 64 return 1;
59 } 65 }
60 66
61 void *p = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0); 67 void *p = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0);
62 if (!p) { 68 if (p == MAP_FAILED) {
63 fprintf(stderr, "TESTING ERROR: cannot map file for mprotect test\n"); 69 fprintf(stderr, "TESTING ERROR: cannot map file for mprotect test\n");
64 return 1; 70 return 1;
65 } 71 }
66 72
67 mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC); 73 mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC);
68 printf("mprotect successful\n"); 74 printf("mprotect successful\n");
69 75
@@ -72,5 +78,18 @@ int main(int argc, char **argv) {
72 78
73 return 0; 79 return 0;
74 } 80 }
81
82 else if (strcmp(argv[1], "memfd_create") == 0) {
83 int fd = syscall(SYS_memfd_create, "memfd_create", 0);
84 if (fd == -1) {
85 fprintf(stderr, "TESTING ERROR: cannot run memfd_create test\n");
86 return 1;
87 }
88 printf("memfd_create successful\n");
89
90 // wait for expect to timeout
91 sleep(100);
92
93 return 0;
94 }
75} 95}
76 \ No newline at end of file
diff --git a/test/filters/memwrexe.exp b/test/filters/memwrexe.exp
index 6a57b8a07..2b170803c 100755
--- a/test/filters/memwrexe.exp
+++ b/test/filters/memwrexe.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -29,6 +29,18 @@ expect {
29 "mprotect successful" {puts "TESTING ERROR 12\n";exit} 29 "mprotect successful" {puts "TESTING ERROR 12\n";exit}
30 "Parent is shutting down" 30 "Parent is shutting down"
31} 31}
32after 100
33
34send -- "firejail --memory-deny-write-execute ./memwrexe memfd_create\r"
35expect {
36 timeout {puts "TESTING ERROR 20\n";exit}
37 "Child process initialized"
38}
39expect {
40 timeout {puts "TESTING ERROR 21\n";exit}
41 "memfd_create successful" {puts "TESTING ERROR 22\n";exit}
42 "Parent is shutting down"
43}
32 44
33after 100 45after 100
34puts "\nall done\n" 46puts "\nall done\n"
diff --git a/test/filters/noroot.exp b/test/filters/noroot.exp
index 2c7218c87..64f72f610 100755
--- a/test/filters/noroot.exp
+++ b/test/filters/noroot.exp
@@ -1,160 +1,136 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --noprofile --noroot --caps.drop=all --seccomp\r" 10send -- "firejail --name=test --noroot --noprofile\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 12 timeout {puts "TESTING ERROR 1\n";exit}
13 "cannot create a new user namespace" {puts "TESTING SKIP: user namespace not available\n"; exit}
14 "Child process initialized" 13 "Child process initialized"
15} 14}
16sleep 1 15sleep 1
17 16
17# check seccomp disabled and all caps enabled
18send -- "cat /proc/self/status\r" 18send -- "cat /proc/self/status\r"
19expect { 19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "CapBnd: 0000000000000000"
22}
23expect {
24 timeout {puts "TESTING ERROR 2\n";exit} 20 timeout {puts "TESTING ERROR 2\n";exit}
25 "Seccomp:" 21 "CapBnd:"
26} 22}
27expect { 23expect {
28 timeout {puts "TESTING ERROR 3\n";exit} 24 timeout {puts "TESTING ERROR 3\n";exit}
29 "2" 25 "ffffffff"
30} 26}
31expect { 27expect {
32 timeout {puts "TESTING ERROR 4\n";exit} 28 timeout {puts "TESTING ERROR 4\n";exit}
33 "Cpus_allowed:" 29 "Seccomp:"
34} 30}
35puts "\n"
36
37send -- "ping 0\r"
38expect { 31expect {
39 timeout {puts "TESTING ERROR 5\n";exit} 32 timeout {puts "TESTING ERROR 5\n";exit}
40 "Operation not permitted" 33 "0"
41} 34}
42send -- "whoami\r"
43expect { 35expect {
44 timeout {puts "TESTING ERROR 6\n";exit} 36 timeout {puts "TESTING ERROR 6\n";exit}
45 $env(USER) 37 "Cpus_allowed:"
46} 38}
47send -- "sudo -s\r" 39puts "\n"
40
41send -- "whoami\r"
48expect { 42expect {
49 timeout {puts "TESTING ERROR 7\n";exit} 43 timeout {puts "TESTING ERROR 7\n";exit}
50 "effective uid is not 0, is sudo installed setuid root?" { puts "OK\n";} 44 $env(USER)
51 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";}
52 "Bad system call" { puts "OK\n";}
53} 45}
54send -- "cat /proc/self/uid_map | wc -l\r" 46send -- "sudo -s\r"
55expect { 47expect {
56 timeout {puts "TESTING ERROR 8\n";exit} 48 timeout {puts "TESTING ERROR 8\n";exit}
57 "1" 49 "effective uid is not 0, is sudo installed setuid root?" { puts "OK\n";}
50 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";}
58} 51}
59send -- "cat /proc/self/gid_map | wc -l\r" 52
53send -- "sudo su -\r"
60expect { 54expect {
61 timeout {puts "TESTING ERROR 9\n";exit} 55 timeout {puts "TESTING ERROR 9\n";exit}
62 "5" 56 "effective uid is not 0" {puts "OK\n"}
57 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";}
63} 58}
64 59
65puts "\n" 60send -- "sudo ls\r"
66send -- "exit\r"
67sleep 2
68
69
70
71send -- "firejail --name=test --noroot --noprofile\r"
72expect { 61expect {
73 timeout {puts "TESTING ERROR 10\n";exit} 62 timeout {puts "TESTING ERROR 10\n";exit}
74 "Child process initialized" 63 "effective uid is not 0" {puts "OK\n"}
64 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";}
75} 65}
76sleep 1
77 66
78send -- "cat /proc/self/status\r" 67send -- "cat /proc/self/uid_map | wc -l\r"
79expect { 68expect {
80 timeout {puts "TESTING ERROR 11\n";exit} 69 timeout {puts "TESTING ERROR 11\n";exit}
81 "CapBnd:" 70 "1"
82} 71}
72send -- "cat /proc/self/gid_map | wc -l\r"
83expect { 73expect {
84 timeout {puts "TESTING ERROR 12\n";exit} 74 timeout {puts "TESTING ERROR 12\n";exit}
85 "ffffffff" 75 "5"
86} 76}
77
78
79
80spawn $env(SHELL)
81send -- "firejail --debug --join=test\r"
87expect { 82expect {
88 timeout {puts "TESTING ERROR 13\n";exit} 83 timeout {puts "TESTING ERROR 13\n";exit}
89 "Seccomp:" 84 "User namespace detected"
90} 85}
91expect { 86expect {
92 timeout {puts "TESTING ERROR 14\n";exit} 87 timeout {puts "TESTING ERROR 14\n";exit}
93 "0" 88 "Joining user namespace"
94}
95expect {
96 timeout {puts "TESTING ERROR 15\n";exit}
97 "Cpus_allowed:"
98} 89}
99puts "\n" 90sleep 1
100 91
101send -- "whoami\r"
102expect {
103 timeout {puts "TESTING ERROR 16\n";exit}
104 $env(USER)
105}
106send -- "sudo -s\r" 92send -- "sudo -s\r"
107expect { 93expect {
108 timeout {puts "TESTING ERROR 17\n";exit} 94 timeout {puts "TESTING ERROR 15\n";exit}
109 "effective uid is not 0, is sudo installed setuid root?" { puts "OK\n";} 95 "effective uid is not 0, is sudo installed setuid root?" { puts "OK\n";}
110 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";} 96 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";}
111} 97 "Permission denied" { puts "OK\n";}
112send -- "ping 0\r"
113expect {
114 timeout {puts "TESTING ERROR 18\n";exit}
115 "Operation not permitted"
116} 98}
117send -- "cat /proc/self/uid_map | wc -l\r" 99send -- "cat /proc/self/uid_map | wc -l\r"
118expect { 100expect {
119 timeout {puts "TESTING ERROR 19\n";exit} 101 timeout {puts "TESTING ERROR 16\n";exit}
120 "1" 102 "1"
121} 103}
122send -- "cat /proc/self/gid_map | wc -l\r" 104send -- "cat /proc/self/gid_map | wc -l\r"
123expect { 105expect {
124 timeout {puts "TESTING ERROR 20\n";exit} 106 timeout {puts "TESTING ERROR 17\n";exit}
125 "5" 107 "5"
126} 108}
127 109
128 110# check seccomp disabled and all caps enabled
129 111send -- "cat /proc/self/status\r"
130spawn $env(SHELL)
131send -- "firejail --debug --join=test\r"
132expect { 112expect {
133 timeout {puts "TESTING ERROR 21\n";exit} 113 timeout {puts "TESTING ERROR 18\n";exit}
134 "User namespace detected" 114 "CapBnd:"
135} 115}
136expect { 116expect {
137 timeout {puts "TESTING ERROR 22\n";exit} 117 timeout {puts "TESTING ERROR 19\n";exit}
138 "Joining user namespace" 118 "ffffffff"
139} 119}
140sleep 1
141
142send -- "sudo -s\r"
143expect { 120expect {
144 timeout {puts "TESTING ERROR 23\n";exit} 121 timeout {puts "TESTING ERROR 20\n";exit}
145 "effective uid is not 0, is sudo installed setuid root?" { puts "OK\n";} 122 "Seccomp:"
146 "sudo must be owned by uid 0 and have the setuid bit set" { puts "OK\n";}
147 "Permission denied" { puts "OK\n";}
148} 123}
149send -- "cat /proc/self/uid_map | wc -l\r"
150expect { 124expect {
151 timeout {puts "TESTING ERROR 24\n";exit} 125 timeout {puts "TESTING ERROR 21\n";exit}
152 "1" 126 "0"
153} 127}
154send -- "cat /proc/self/gid_map | wc -l\r"
155expect { 128expect {
156 timeout {puts "TESTING ERROR 25\n";exit} 129 timeout {puts "TESTING ERROR 22\n";exit}
157 "5" 130 "Cpus_allowed:"
158} 131}
132puts "\n"
133
134
159after 100 135after 100
160puts "\nall done\n" 136puts "\nall done\n"
diff --git a/test/filters/protocol.exp b/test/filters/protocol.exp
index 71f54b08a..071460e4c 100755
--- a/test/filters/protocol.exp
+++ b/test/filters/protocol.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/seccomp-bad-empty.exp b/test/filters/seccomp-bad-empty.exp
index 19e64ee84..5e7c8e1b5 100755
--- a/test/filters/seccomp-bad-empty.exp
+++ b/test/filters/seccomp-bad-empty.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/seccomp-chmod-profile.exp b/test/filters/seccomp-chmod-profile.exp
index 22615420d..5587e056c 100755
--- a/test/filters/seccomp-chmod-profile.exp
+++ b/test/filters/seccomp-chmod-profile.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -12,8 +12,10 @@ expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 13 "Child process initialized"
14} 14}
15sleep 2 15sleep 1
16 16
17send -- "stty -echo\r"
18after 100
17send -- "cd ~; echo done\r" 19send -- "cd ~; echo done\r"
18expect { 20expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
@@ -39,7 +41,7 @@ expect {
39send -- "chmod +x testfile; echo done\r" 41send -- "chmod +x testfile; echo done\r"
40expect { 42expect {
41 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
42 "Bad system call" 44 "Operation not permitted"
43} 45}
44expect { 46expect {
45 timeout {puts "TESTING ERROR 6\n";exit} 47 timeout {puts "TESTING ERROR 6\n";exit}
diff --git a/test/filters/seccomp-chmod.exp b/test/filters/seccomp-chmod.exp
index 35c6f69c2..0d01d4ff2 100755
--- a/test/filters/seccomp-chmod.exp
+++ b/test/filters/seccomp-chmod.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -12,8 +12,10 @@ expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 13 "Child process initialized"
14} 14}
15sleep 2 15sleep 1
16 16
17send -- "stty -echo\r"
18after 100
17send -- "cd ~; echo done\r" 19send -- "cd ~; echo done\r"
18expect { 20expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
@@ -39,7 +41,7 @@ expect {
39send -- "chmod +x testfile; echo done\r" 41send -- "chmod +x testfile; echo done\r"
40expect { 42expect {
41 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
42 "Bad system call" 44 "Operation not permitted"
43} 45}
44expect { 46expect {
45 timeout {puts "TESTING ERROR 6\n";exit} 47 timeout {puts "TESTING ERROR 6\n";exit}
diff --git a/test/filters/seccomp-chown.exp b/test/filters/seccomp-chown.exp
index 7d9da5e5a..0a19229b4 100755
--- a/test/filters/seccomp-chown.exp
+++ b/test/filters/seccomp-chown.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/seccomp-debug-32.exp b/test/filters/seccomp-debug-32.exp
index 098b309f5..677ca4e30 100755
--- a/test/filters/seccomp-debug-32.exp
+++ b/test/filters/seccomp-debug-32.exp
@@ -1,12 +1,15 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "stty -echo\r"
11after 100
12
10send -- "firejail --debug sleep 1; echo done\r" 13send -- "firejail --debug sleep 1; echo done\r"
11expect { 14expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
diff --git a/test/filters/seccomp-debug.exp b/test/filters/seccomp-debug.exp
index 4986a6bf6..852abf822 100755
--- a/test/filters/seccomp-debug.exp
+++ b/test/filters/seccomp-debug.exp
@@ -1,24 +1,23 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "stty -echo\r"
11after 100
12
10send -- "firejail --debug sleep 1; echo done\r" 13send -- "firejail --debug sleep 1; echo done\r"
11expect { 14expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
13 "SECCOMP Filter" 16 "seccomp entries in /run/firejail/mnt/seccomp/seccomp"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "BLACKLIST"
18} 17}
19expect { 18expect {
20 timeout {puts "TESTING ERROR 2\n";exit} 19 timeout {puts "TESTING ERROR 2\n";exit}
21 "open_by_handle_at" 20 "jeq open_by_handle_at"
22} 21}
23expect { 22expect {
24 timeout {puts "TESTING ERROR 3\n";exit} 23 timeout {puts "TESTING ERROR 3\n";exit}
@@ -39,15 +38,15 @@ expect {
39} 38}
40expect { 39expect {
41 timeout {puts "TESTING ERROR 6\n";exit} 40 timeout {puts "TESTING ERROR 6\n";exit}
42 "Installing /run/firejail/mnt/seccomp seccomp filter" 41 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
43} 42}
44expect { 43expect {
45 timeout {puts "TESTING ERROR 7\n";exit} 44 timeout {puts "TESTING ERROR 7\n";exit}
46 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" 45 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
47} 46}
48expect { 47expect {
49 timeout {puts "TESTING ERROR 8\n";exit} 48 timeout {puts "TESTING ERROR 8\n";exit}
50 "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" 49 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
51} 50}
52expect { 51expect {
53 timeout {puts "TESTING ERROR 9\n";exit} 52 timeout {puts "TESTING ERROR 9\n";exit}
@@ -59,15 +58,15 @@ after 100
59send -- "firejail --debug --ignore=seccomp sleep 1; echo done\r" 58send -- "firejail --debug --ignore=seccomp sleep 1; echo done\r"
60expect { 59expect {
61 timeout {puts "TESTING ERROR 10\n";exit} 60 timeout {puts "TESTING ERROR 10\n";exit}
62 "Installing /run/firejail/mnt/seccomp seccomp filter" {puts "TESTING ERROR 11\n";exit} 61 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter" {puts "TESTING ERROR 11\n";exit}
63 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 12\n";exit} 62 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 12\n";exit}
64 "Child process initialized" 63 "Child process initialized"
65} 64}
66expect { 65expect {
67 timeout {puts "TESTING ERROR 13\n";exit} 66 timeout {puts "TESTING ERROR 13\n";exit}
68 "Installing /run/firejail/mnt/seccomp seccomp filter" {puts "TESTING ERROR 14\n";exit} 67 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter" {puts "TESTING ERROR 14\n";exit}
69 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 15\n";exit} 68 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 15\n";exit}
70 "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" 69 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
71} 70}
72expect { 71expect {
73 timeout {puts "TESTING ERROR 16\n";exit} 72 timeout {puts "TESTING ERROR 16\n";exit}
@@ -79,18 +78,18 @@ after 100
79send -- "firejail --debug --ignore=protocol sleep 1; echo done\r" 78send -- "firejail --debug --ignore=protocol sleep 1; echo done\r"
80expect { 79expect {
81 timeout {puts "TESTING ERROR 17\n";exit} 80 timeout {puts "TESTING ERROR 17\n";exit}
82 "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" {puts "TESTING ERROR 18\n";exit} 81 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter" {puts "TESTING ERROR 18\n";exit}
83 "Child process initialized" 82 "Child process initialized"
84} 83}
85expect { 84expect {
86 timeout {puts "TESTING ERROR 19\n";exit} 85 timeout {puts "TESTING ERROR 19\n";exit}
87 "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" {puts "TESTING ERROR 20\n";exit} 86 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter" {puts "TESTING ERROR 20\n";exit}
88 "Installing /run/firejail/mnt/seccomp seccomp filter" 87 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
89} 88}
90expect { 89expect {
91 timeout {puts "TESTING ERROR 21\n";exit} 90 timeout {puts "TESTING ERROR 21\n";exit}
92 "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" {puts "TESTING ERROR 22\n";exit} 91 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter" {puts "TESTING ERROR 22\n";exit}
93 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" 92 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
94} 93}
95expect { 94expect {
96 timeout {puts "TESTING ERROR 23\n";exit} 95 timeout {puts "TESTING ERROR 23\n";exit}
@@ -106,7 +105,7 @@ expect {
106} 105}
107expect { 106expect {
108 timeout {puts "TESTING ERROR 25\n";exit} 107 timeout {puts "TESTING ERROR 25\n";exit}
109 "Installing /run/firejail/mnt/seccomp.mdwx seccomp filter" 108 "Installing /run/firejail/mnt/seccomp/seccomp.mdwx seccomp filter"
110} 109}
111expect { 110expect {
112 timeout {puts "TESTING ERROR 26\n";exit} 111 timeout {puts "TESTING ERROR 26\n";exit}
@@ -118,18 +117,18 @@ expect {
118send -- "firejail --debug --seccomp.block-secondary sleep 1; echo done\r" 117send -- "firejail --debug --seccomp.block-secondary sleep 1; echo done\r"
119expect { 118expect {
120 timeout {puts "TESTING ERROR 27\n";exit} 119 timeout {puts "TESTING ERROR 27\n";exit}
121 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 28\n";exit} 120 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 28\n";exit}
122 "Child process initialized" 121 "Child process initialized"
123} 122}
124expect { 123expect {
125 timeout {puts "TESTING ERROR 29\n";exit} 124 timeout {puts "TESTING ERROR 29\n";exit}
126 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 30\n";exit} 125 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 30\n";exit}
127 "Installing /run/firejail/mnt/seccomp seccomp filter" 126 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
128} 127}
129expect { 128expect {
130 timeout {puts "TESTING ERROR 31\n";exit} 129 timeout {puts "TESTING ERROR 31\n";exit}
131 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 32\n";exit} 130 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 32\n";exit}
132 "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" 131 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
133} 132}
134expect { 133expect {
135 timeout {puts "TESTING ERROR 33\n";exit} 134 timeout {puts "TESTING ERROR 33\n";exit}
@@ -141,13 +140,13 @@ after 100
141send -- "firejail --debug --profile=block-secondary.profile sleep 1; echo done\r" 140send -- "firejail --debug --profile=block-secondary.profile sleep 1; echo done\r"
142expect { 141expect {
143 timeout {puts "TESTING ERROR 33\n";exit} 142 timeout {puts "TESTING ERROR 33\n";exit}
144 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 34\n";exit} 143 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 34\n";exit}
145 "Child process initialized" 144 "Child process initialized"
146} 145}
147expect { 146expect {
148 timeout {puts "TESTING ERROR 35\n";exit} 147 timeout {puts "TESTING ERROR 35\n";exit}
149 "Installing /run/firejail/mnt/seccomp.32 seccomp filter" {puts "TESTING ERROR 35\n";exit} 148 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 35\n";exit}
150 "Installing /run/firejail/mnt/seccomp seccomp filter" 149 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
151} 150}
152expect { 151expect {
153 timeout {puts "TESTING ERROR 37\n";exit} 152 timeout {puts "TESTING ERROR 37\n";exit}
diff --git a/test/filters/seccomp-dualfilter.exp b/test/filters/seccomp-dualfilter.exp
index abf093201..e655be848 100755
--- a/test/filters/seccomp-dualfilter.exp
+++ b/test/filters/seccomp-dualfilter.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 1 6set timeout 1
diff --git a/test/filters/seccomp-empty.exp b/test/filters/seccomp-empty.exp
index 03e081b34..3baa7f0c6 100755
--- a/test/filters/seccomp-empty.exp
+++ b/test/filters/seccomp-empty.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -10,7 +10,11 @@ match_max 100000
10send -- "firejail --debug --seccomp=chmod,fchmod,fchmodat --private\r" 10send -- "firejail --debug --seccomp=chmod,fchmod,fchmodat --private\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "VALIDATE_ARCHITECTURE" 13 "seccomp entries in /run/firejail/mnt/seccomp"
14}
15expect {
16 timeout {puts "TESTING ERROR 0.0\n";exit}
17 "ld data.architecture"
14} 18}
15expect { 19expect {
16 timeout {puts "TESTING ERROR 0.1\n";exit} 20 timeout {puts "TESTING ERROR 0.1\n";exit}
@@ -34,7 +38,7 @@ expect {
34} 38}
35expect { 39expect {
36 timeout {puts "TESTING ERROR 0.6\n";exit} 40 timeout {puts "TESTING ERROR 0.6\n";exit}
37 "RETURN_ALLOW" 41 "ret ALLOW"
38} 42}
39expect { 43expect {
40 timeout {puts "TESTING ERROR 0.7\n";exit} 44 timeout {puts "TESTING ERROR 0.7\n";exit}
@@ -48,7 +52,11 @@ puts "\n"
48send -- "firejail --debug --seccomp.drop=chmod,fchmod,fchmodat --private\r" 52send -- "firejail --debug --seccomp.drop=chmod,fchmod,fchmodat --private\r"
49expect { 53expect {
50 timeout {puts "TESTING ERROR 1\n";exit} 54 timeout {puts "TESTING ERROR 1\n";exit}
51 "VALIDATE_ARCHITECTURE" 55 "seccomp entries in /run/firejail/mnt/seccomp"
56}
57expect {
58 timeout {puts "TESTING ERROR 1.0\n";exit}
59 "ld data.architecture"
52} 60}
53expect { 61expect {
54 timeout {puts "TESTING ERROR 1.1\n";exit} 62 timeout {puts "TESTING ERROR 1.1\n";exit}
@@ -66,7 +74,7 @@ expect {
66} 74}
67expect { 75expect {
68 timeout {puts "TESTING ERROR 1.6\n";exit} 76 timeout {puts "TESTING ERROR 1.6\n";exit}
69 "RETURN_ALLOW" 77 "ret ALLOW"
70} 78}
71expect { 79expect {
72 timeout {puts "TESTING ERROR 1.7\n";exit} 80 timeout {puts "TESTING ERROR 1.7\n";exit}
@@ -80,7 +88,11 @@ sleep 2
80send -- "firejail --debug --profile=seccomp.profile --private\r" 88send -- "firejail --debug --profile=seccomp.profile --private\r"
81expect { 89expect {
82 timeout {puts "TESTING ERROR 2\n";exit} 90 timeout {puts "TESTING ERROR 2\n";exit}
83 "VALIDATE_ARCHITECTURE" 91 "seccomp entries in /run/firejail/mnt/seccomp"
92}
93expect {
94 timeout {puts "TESTING ERROR 2.0\n";exit}
95 "ld data.architecture"
84} 96}
85expect { 97expect {
86 timeout {puts "TESTING ERROR 2.1\n";exit} 98 timeout {puts "TESTING ERROR 2.1\n";exit}
@@ -104,7 +116,7 @@ expect {
104} 116}
105expect { 117expect {
106 timeout {puts "TESTING ERROR 2.6\n";exit} 118 timeout {puts "TESTING ERROR 2.6\n";exit}
107 "RETURN_ALLOW" 119 "ret ALLOW"
108} 120}
109expect { 121expect {
110 timeout {puts "TESTING ERROR 2.7\n";exit} 122 timeout {puts "TESTING ERROR 2.7\n";exit}
@@ -118,7 +130,11 @@ puts "\n"
118send -- "firejail --debug --profile=seccomp-empty.profile --private\r" 130send -- "firejail --debug --profile=seccomp-empty.profile --private\r"
119expect { 131expect {
120 timeout {puts "TESTING ERROR 3\n";exit} 132 timeout {puts "TESTING ERROR 3\n";exit}
121 "VALIDATE_ARCHITECTURE" 133 "seccomp entries in /run/firejail/mnt/seccomp"
134}
135expect {
136 timeout {puts "TESTING ERROR 3.0\n";exit}
137 "ld data.architecture"
122} 138}
123expect { 139expect {
124 timeout {puts "TESTING ERROR 3.1\n";exit} 140 timeout {puts "TESTING ERROR 3.1\n";exit}
@@ -136,7 +152,7 @@ expect {
136} 152}
137expect { 153expect {
138 timeout {puts "TESTING ERROR 3.6\n";exit} 154 timeout {puts "TESTING ERROR 3.6\n";exit}
139 "RETURN_ALLOW" 155 "ret ALLOW"
140} 156}
141expect { 157expect {
142 timeout {puts "TESTING ERROR 3.7\n";exit} 158 timeout {puts "TESTING ERROR 3.7\n";exit}
@@ -145,4 +161,4 @@ expect {
145sleep 2 161sleep 2
146send -- "exit\r" 162send -- "exit\r"
147after 100 163after 100
148puts "\n" 164puts "all done\n"
diff --git a/test/filters/seccomp-errno.exp b/test/filters/seccomp-errno.exp
index eeb0824f2..6c7c63e88 100755
--- a/test/filters/seccomp-errno.exp
+++ b/test/filters/seccomp-errno.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -20,19 +20,23 @@ sleep 1
20send -- "firejail --seccomp=unlinkat:ENOENT --debug rm seccomp-test-file\r" 20send -- "firejail --seccomp=unlinkat:ENOENT --debug rm seccomp-test-file\r"
21expect { 21expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 22 timeout {puts "TESTING ERROR 1\n";exit}
23 "unlinkat 2 ENOENT" 23 "seccomp entries in /run/firejail/mnt/seccomp"
24}
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "ret ERRNO(2)"
24} 28}
25sleep 1 29sleep 1
26 30
27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT\r" 31send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT\r"
28expect { 32expect {
29 timeout {puts "TESTING ERROR 2\n";exit} 33 timeout {puts "TESTING ERROR 3\n";exit}
30 "Child process initialized" 34 "Child process initialized"
31} 35}
32sleep 1 36sleep 1
33send -- "rm seccomp-test-file\r" 37send -- "rm seccomp-test-file\r"
34expect { 38expect {
35 timeout {puts "TESTING ERROR 3\n";exit} 39 timeout {puts "TESTING ERROR 4\n";exit}
36 "No such file or directory" 40 "No such file or directory"
37} 41}
38after 100 42after 100
@@ -40,7 +44,7 @@ puts "\n"
40 44
41send -- "mkdir seccomp-test-dir\r" 45send -- "mkdir seccomp-test-dir\r"
42expect { 46expect {
43 timeout {puts "TESTING ERROR 4\n";exit} 47 timeout {puts "TESTING ERROR 5\n";exit}
44 "No such file or directory" 48 "No such file or directory"
45} 49}
46after 100 50after 100
diff --git a/test/filters/seccomp-join.exp b/test/filters/seccomp-join.exp
new file mode 100755
index 000000000..9a8767ed7
--- /dev/null
+++ b/test/filters/seccomp-join.exp
@@ -0,0 +1,159 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7match_max 100000
8spawn $env(SHELL)
9set id1 $spawn_id
10spawn $env(SHELL)
11set id2 $spawn_id
12
13send -- "stty -echo\r"
14after 100
15
16#
17# regular run
18#
19set spawn_id $id1
20send -- "firejail --name=jointesting --debug\r"
21expect {
22 timeout {puts "TESTING ERROR 0\n";exit}
23 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
24}
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
28}
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
32}
33sleep 1
34
35set spawn_id $id2
36
37send -- "firejail --debug --join=jointesting\r"
38expect {
39 timeout {puts "TESTING ERROR 3\n";exit}
40 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
41}
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
45}
46expect {
47 timeout {puts "TESTING ERROR 5\n";exit}
48 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
49}
50sleep 1
51
52send -- "exit\r"
53after 100
54set spawn_id $id1
55send -- "exit\r"
56after 100
57
58
59
60#
61# block secondary
62#
63set spawn_id $id1
64send -- "firejail --name=jointesting --seccomp.block-secondary --debug\r"
65expect {
66 timeout {puts "TESTING ERROR 10\n";exit}
67 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
68}
69expect {
70 timeout {puts "TESTING ERROR 11\n";exit}
71 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 12\n";exit}
72 "Installing /run/firejail/mnt/seccomp/seccomp.block_secondary seccomp filter"
73}
74expect {
75 timeout {puts "TESTING ERROR 13\n";exit}
76 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
77}
78sleep 1
79
80set spawn_id $id2
81send -- "firejail --debug --join=jointesting\r"
82expect {
83 timeout {puts "TESTING ERROR 14\n";exit}
84 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter"
85}
86expect {
87 timeout {puts "TESTING ERROR 15\n";exit}
88 "Installing /run/firejail/mnt/seccomp/seccomp.block_secondary seccomp filter"
89}
90expect {
91 timeout {puts "TESTING ERROR 16\n";exit}
92 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
93}
94sleep 1
95
96send -- "exit\r"
97after 100
98set spawn_id $id1
99send -- "exit\r"
100after 100
101
102#
103# protocol
104#
105set spawn_id $id1
106send -- "firejail --name=jointesting --noprofile --protocol=inet --debug\r"
107expect {
108 timeout {puts "TESTING ERROR 22\n";exit}
109 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
110}
111sleep 1
112
113set spawn_id $id2
114
115send -- "firejail --debug --join=jointesting\r"
116expect {
117 timeout {puts "TESTING ERROR 23\n";exit}
118 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter" {puts "TESTING ERROR 24\n";exit}
119 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 25\n";exit}
120 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
121}
122sleep 1
123
124send -- "exit\r"
125after 100
126set spawn_id $id1
127send -- "exit\r"
128after 100
129
130#
131# memory deny write execute
132#
133set spawn_id $id1
134send -- "firejail --name=jointesting --noprofile --memory-deny-write-execute --debug\r"
135expect {
136 timeout {puts "TESTING ERROR 32\n";exit}
137 "Installing /run/firejail/mnt/seccomp/seccomp.mdwx seccomp filter"
138}
139sleep 1
140
141set spawn_id $id2
142
143send -- "firejail --debug --join=jointesting\r"
144expect {
145 timeout {puts "TESTING ERROR 33\n";exit}
146 "Installing /run/firejail/mnt/seccomp/seccomp seccomp filter" {puts "TESTING ERROR 34\n";exit}
147 "Installing /run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 35\n";exit}
148 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter" {puts "TESTING ERROR 36\n";exit}
149 "Installing /run/firejail/mnt/seccomp/seccomp.mdwx seccomp filter"
150}
151sleep 1
152
153send -- "exit\r"
154after 100
155set spawn_id $id1
156send -- "exit\r"
157after 100
158
159puts "all done\n"
diff --git a/test/filters/seccomp-numeric.exp b/test/filters/seccomp-numeric.exp
new file mode 100755
index 000000000..59fc26884
--- /dev/null
+++ b/test/filters/seccomp-numeric.exp
@@ -0,0 +1,44 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch seccomp-test-file\r"
11after 100
12
13send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "No such file or directory"
17}
18after 100
19
20send -- "firejail --seccomp=\\\$263:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "No such file or directory"
24}
25after 100
26
27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT mkdir seccomp-test-dir\r"
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "No such file or directory"
31}
32after 100
33
34send -- "firejail --seccomp=unlinkat:ENOENT,\\\$83:ENOENT mkdir seccomp-test-dir\r"
35expect {
36 timeout {puts "TESTING ERROR 3\n";exit}
37 "No such file or directory"
38}
39after 100
40
41send -- "rm seccomp-test-file\r"
42#send -- "rm -fr seccomp-test-dir\r"
43after 100
44puts "all done\n"
diff --git a/test/filters/seccomp-postexec.exp b/test/filters/seccomp-postexec.exp
new file mode 100755
index 000000000..18263520a
--- /dev/null
+++ b/test/filters/seccomp-postexec.exp
@@ -0,0 +1,33 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug --seccomp=execve\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "configuring postexec seccomp filter in"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "data.architecture"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "monitoring pid"
22}
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "Sandbox monitor: waitpid"
26}
27expect {
28 timeout {puts "TESTING ERROR 4\n";exit}
29 "Parent is shutting down"
30}
31sleep 1
32
33puts "all done\n"
diff --git a/test/filters/seccomp-ptrace.exp b/test/filters/seccomp-ptrace.exp
index 2c6d9d25e..ec8ab615c 100755
--- a/test/filters/seccomp-ptrace.exp
+++ b/test/filters/seccomp-ptrace.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/filters/seccomp-run-files.exp b/test/filters/seccomp-run-files.exp
new file mode 100755
index 000000000..1e3827f0f
--- /dev/null
+++ b/test/filters/seccomp-run-files.exp
@@ -0,0 +1,98 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "/run/firejail/mnt/seccomp/seccomp seccomp filter"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "/run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "/run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
22}
23after 100
24send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r"
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 "6"
28}
29send -- "exit\r"
30sleep 1
31
32send -- "firejail --ignore=seccomp --debug\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "/run/firejail/mnt/seccomp/seccomp seccomp filter" {puts "TESTING ERROR 5\n";exit}
36 "/run/firejail/mnt/seccomp/seccomp.32 seccomp filter" {puts "TESTING ERROR 6\n";exit}
37 "/run/firejail/mnt/seccomp/seccomp.64 seccomp filter" {puts "TESTING ERROR 7\n";exit}
38 "Installing /run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
39}
40after 100
41send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r"
42expect {
43 timeout {puts "TESTING ERROR 8\n";exit}
44 "3"
45}
46send -- "exit\r"
47sleep 1
48
49send -- "firejail --ignore=protocol --debug\r"
50expect {
51 timeout {puts "TESTING ERROR 9\n";exit}
52 "/run/firejail/mnt/seccomp/seccomp seccomp filter"
53}
54expect {
55 timeout {puts "TESTING ERROR 10\n";exit}
56 "/run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
57}
58expect {
59 timeout {puts "TESTING ERROR 11\n";exit}
60 "/run/firejail/mnt/seccomp/seccomp.protocol seccomp filter" {puts "TESTING ERROR 12\n";exit}
61 "monitoring"
62}
63after 100
64send -- "ls -l /run/firejail/mnt | grep -c seccomp\r"
65expect {
66 timeout {puts "TESTING ERROR 13\n";exit}
67 "4"
68}
69send -- "exit\r"
70sleep 1
71
72send -- "firejail --memory-deny-write-execute --debug\r"
73expect {
74 timeout {puts "TESTING ERROR 14\n";exit}
75 "/run/firejail/mnt/seccomp/seccomp.mdwx seccomp filter"
76}
77expect {
78 timeout {puts "TESTING ERROR 15\n";exit}
79 "/run/firejail/mnt/seccomp/seccomp seccomp filter"
80}
81expect {
82 timeout {puts "TESTING ERROR 16\n";exit}
83 "/run/firejail/mnt/seccomp/seccomp.32 seccomp filter"
84}
85expect {
86 timeout {puts "TESTING ERROR 17\n";exit}
87 "/run/firejail/mnt/seccomp/seccomp.protocol seccomp filter"
88}
89after 100
90send -- "ls -l /run/firejail/mnt/seccomp | grep -c seccomp\r"
91expect {
92 timeout {puts "TESTING ERROR 18\n";exit}
93 "8"
94}
95send -- "exit\r"
96sleep 1
97
98puts "all done\n"
diff --git a/test/filters/seccomp-su.exp b/test/filters/seccomp-su.exp
index 62135abb8..4bd8b5e93 100755
--- a/test/filters/seccomp-su.exp
+++ b/test/filters/seccomp-su.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -28,13 +28,6 @@ expect {
28 "Bad system call" {puts "OK\n"} 28 "Bad system call" {puts "OK\n"}
29} 29}
30 30
31send -- "ping google.com\r"
32expect {
33 timeout {puts "TESTING ERROR 3\n";exit}
34 "Operation not permitted" {puts "OK\n"}
35 "unknown host" {puts "OK\n"}
36}
37
38send -- "exit\r" 31send -- "exit\r"
39after 100 32after 100
40puts "all done\n" 33puts "all done\n"
diff --git a/test/filters/syscall_test.c b/test/filters/syscall_test.c
index 641eb0c00..55ee31afb 100644
--- a/test/filters/syscall_test.c
+++ b/test/filters/syscall_test.c
@@ -1,5 +1,5 @@
1// This file is part of Firejail project 1// This file is part of Firejail project
2// Copyright (C) 2014-2017 Firejail Authors 2// Copyright (C) 2014-2021 Firejail Authors
3// License GPL v2 3// License GPL v2
4 4
5#include <stdlib.h> 5#include <stdlib.h>
@@ -69,7 +69,7 @@ int main(int argc, char **argv) {
69 } 69 }
70 else if (strcmp(argv[1], "mount") == 0) { 70 else if (strcmp(argv[1], "mount") == 0) {
71 printf("before mount\n"); 71 printf("before mount\n");
72 if (mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME | MS_REC, "mode=755,gid=0") < 0) { 72 if (mount("tmpfs", "/tmp", "tmpfs", MS_NOSUID | MS_STRICTATIME, "mode=755,gid=0") < 0) {
73 perror("mount"); 73 perror("mount");
74 } 74 }
75 printf("after mount\n"); 75 printf("after mount\n");
diff --git a/test/firemon-cgroup.exp b/test/firemon-cgroup.exp
deleted file mode 100755
index 482905bb3..000000000
--- a/test/firemon-cgroup.exp
+++ /dev/null
@@ -1,39 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=bingo1 --cgroup=/sys/fs/cgroup/g1/tasks\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14spawn $env(SHELL)
15send -- "firejail --name=bingo2\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22
23spawn $env(SHELL)
24send -- "firemon --cgroup\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "bingo1"
28}
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 ":/g1"
32}
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "bingo2"
36}
37sleep 1
38
39puts "\n"
diff --git a/test/fnetfilter/cmdline.exp b/test/fnetfilter/cmdline.exp
new file mode 100755
index 000000000..16e8ccb81
--- /dev/null
+++ b/test/fnetfilter/cmdline.exp
@@ -0,0 +1,37 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "fnetfilter\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Usage:"
14}
15after 100
16
17send -- "fnetfilter -h\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "Usage:"
21}
22after 100
23
24send -- "fnetfilter -h a b c d\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "Usage:"
28}
29after 100
30
31send -- "fnetfilter a b c d\r"
32expect {
33 timeout {puts "TESTING ERROR 2\n";exit}
34 "Usage:"
35}
36after 100
37puts "\nall done\n"
diff --git a/test/environment/firejail-in-firejail2.exp b/test/fnetfilter/copy.exp
index db64d59ed..6c672141f 100755
--- a/test/environment/firejail-in-firejail2.exp
+++ b/test/fnetfilter/copy.exp
@@ -1,51 +1,52 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --noprofile\r" 10send -- "rm outfile\r"
11after 100
12
13send -- "fnetfilter test1.net outfile\r"
14after 100
15
16send -- "cat outfile\r"
11expect { 17expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 18 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized" 19 "*filter"
14} 20}
15sleep 1
16
17send -- "firejail\r"
18expect { 21expect {
19 timeout {puts "TESTING ERROR 2\n";exit} 22 timeout {puts "TESTING ERROR 2\n";exit}
20 "Warning: an existing sandbox was detected" 23 "test1"
21} 24}
22after 100
23
24send -- "exit\r"
25after 100
26
27send -- "firejail --force\r"
28expect { 25expect {
29 timeout {puts "TESTING ERROR 3\n";exit} 26 timeout {puts "TESTING ERROR 3\n";exit}
30 "Child process initialized" 27 "INPUT -m state --state RELATED,ESTABLISHED"
31} 28}
32after 100
33
34send -- "exit\r"
35after 100
36
37send -- "firejail --version\r"
38expect { 29expect {
39 timeout {puts "TESTING ERROR 4\n";exit} 30 timeout {puts "TESTING ERROR 4\n";exit}
40 "firejail version" 31 "disable STUN"
41} 32}
42after 100 33after 100
43 34
44send -- "firejail --version --force\r" 35send -- "fnetfilter foo outfile\r"
45expect { 36expect {
46 timeout {puts "TESTING ERROR 5\n";exit} 37 timeout {puts "TESTING ERROR 5\n";exit}
47 "firejail version" 38 "cannot open foo"
48} 39}
49after 100 40after 100
50 41
42send -- "fnetfilter test1.net outlocked\r"
43expect {
44 timeout {puts "TESTING ERROR 6\n";exit}
45 "cannot open outlocked"
46}
47after 100
48
49send -- "rm outfile\r"
50after 100
51
51puts "\nall done\n" 52puts "\nall done\n"
diff --git a/test/fnetfilter/default.exp b/test/fnetfilter/default.exp
new file mode 100755
index 000000000..fee9fb5f3
--- /dev/null
+++ b/test/fnetfilter/default.exp
@@ -0,0 +1,40 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "rm outfile\r"
11after 100
12
13send -- "fnetfilter outfile\r"
14after 100
15
16send -- "cat outfile\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "*filter"
20}
21expect {
22 timeout {puts "TESTING ERROR 2\n";exit}
23 "INPUT -m state --state RELATED,ESTABLISHED"
24}
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 "disable STUN"
28}
29after 100
30
31send -- "fnetfilter test1.net,33\r"
32expect {
33 timeout {puts "TESTING ERROR 4\n";exit}
34 "cannot open test1.net,33"
35}
36after 100
37send -- "rm outfile\r"
38after 100
39
40puts "\nall done\n"
diff --git a/test/fnetfilter/fnetfilter.sh b/test/fnetfilter/fnetfilter.sh
new file mode 100755
index 000000000..9fac92d39
--- /dev/null
+++ b/test/fnetfilter/fnetfilter.sh
@@ -0,0 +1,31 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10if [ -f /etc/debian_version ]; then
11 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)")
12 export PATH="$PATH:$libdir"
13fi
14
15export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
16
17chmod 400 outlocked
18
19echo "TESTING: fnetfilter cmdline (test/fnetfilter/cmdline.exp)"
20./cmdline.exp
21
22echo "TESTING: fnetfilter default (test/fnetfilter/default.exp)"
23./default.exp
24
25echo "TESTING: fnetfilter copy (test/fnetfilter/copy.exp)"
26./copy.exp
27
28echo "TESTING: fnetfilter template (test/fnetfilter/template.exp)"
29./template.exp
30
31rm -f outfile
diff --git a/test/fs/testdir1/.directory/file b/test/fnetfilter/outlocked
index e69de29bb..e69de29bb 100644
--- a/test/fs/testdir1/.directory/file
+++ b/test/fnetfilter/outlocked
diff --git a/test/fnetfilter/template.exp b/test/fnetfilter/template.exp
new file mode 100755
index 000000000..0ff09a024
--- /dev/null
+++ b/test/fnetfilter/template.exp
@@ -0,0 +1,82 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "rm outfile\r"
11after 100
12
13send -- "fnetfilter test2.net,icmp-type,destination-unreachable,time-exceeded,echo-request,3478,3479 outfile\r"
14after 100
15
16send -- "cat outfile\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "*filter"
20}
21expect {
22 timeout {puts "TESTING ERROR 2\n";exit}
23 "INPUT -m state --state RELATED,ESTABLISHED"
24}
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 "icmp-type echo-reply"
28}
29expect {
30 timeout {puts "TESTING ERROR 4\n";exit}
31 "icmp-type destination-unreachable"
32}
33expect {
34 timeout {puts "TESTING ERROR 5\n";exit}
35 "icmp-type time-exceeded"
36}
37expect {
38 timeout {puts "TESTING ERROR 6\n";exit}
39 "icmp-type echo-request"
40}
41expect {
42 timeout {puts "TESTING ERROR 7\n";exit}
43 "dport 3478"
44}
45expect {
46 timeout {puts "TESTING ERROR 8\n";exit}
47 "dport 3479"
48}
49expect {
50 timeout {puts "TESTING ERROR 8\n";exit}
51 "dport 3478"
52}
53expect {
54 timeout {puts "TESTING ERROR 10\n";exit}
55 "dport 3479"
56}
57after 100
58
59send -- "fnetfilter test2.net,icmp-type,destination-unreachable,time-exceeded,echo-request outfile\r"
60expect {
61 timeout {puts "TESTING ERROR 11\n";exit}
62 "ARG5 on line 14 was not defined"
63}
64after 100
65
66send -- "fnetfilter test2.net,icmp-type,destination-unreachable,time-exceeded,echo-request\r"
67expect {
68 timeout {puts "TESTING ERROR 12\n";exit}
69 "cannot open test2.net,"
70}
71after 100
72
73send -- "fnetfilter test3.net,44 outfile\r"
74expect {
75 timeout {puts "TESTING ERROR 13\n";exit}
76 "invalid template argument on line 1"
77}
78after 100
79send -- "rm outfile\r"
80after 100
81
82puts "\nall done\n"
diff --git a/test/fnetfilter/test1.net b/test/fnetfilter/test1.net
new file mode 100644
index 000000000..ce21f20c2
--- /dev/null
+++ b/test/fnetfilter/test1.net
@@ -0,0 +1,18 @@
1*filter
2# test1
3:INPUT DROP [0:0]
4:FORWARD DROP [0:0]
5:OUTPUT ACCEPT [0:0]
6-A INPUT -i lo -j ACCEPT
7-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
8# echo replay is handled by -m state RELATED/ESTABLISHED above
9#-A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
10-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
11-A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
12-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
13# disable STUN
14-A OUTPUT -p udp --dport 3478 -j DROP
15-A OUTPUT -p udp --dport 3479 -j DROP
16-A OUTPUT -p tcp --dport 3478 -j DROP
17-A OUTPUT -p tcp --dport 3479 -j DROP
18COMMIT
diff --git a/test/fnetfilter/test2.net b/test/fnetfilter/test2.net
new file mode 100644
index 000000000..f389cd16d
--- /dev/null
+++ b/test/fnetfilter/test2.net
@@ -0,0 +1,18 @@
1*filter
2# test2
3:INPUT DROP [0:0]
4:FORWARD DROP [0:0]
5:OUTPUT ACCEPT [0:0]
6-A INPUT -i lo -j ACCEPT
7-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
8# echo replay is handled by -m state RELATED/ESTABLISHED above
9#-A INPUT -p icmp --$ARG1 echo-reply -j ACCEPT
10-A INPUT -p icmp --$ARG1 $ARG2 -j ACCEPT
11-A INPUT -p icmp --$ARG1 $ARG3 -j ACCEPT
12-A INPUT -p icmp --$ARG1 $ARG4 -j ACCEPT
13# disable STUN
14-A OUTPUT -p udp --dport $ARG5 -j DROP
15-A OUTPUT -p udp --dport $ARG6 -j DROP
16-A OUTPUT -p tcp --dport $ARG5 -j DROP
17-A OUTPUT -p tcp --dport $ARG6 -j DROP
18COMMIT
diff --git a/test/fnetfilter/test3.net b/test/fnetfilter/test3.net
new file mode 100644
index 000000000..702cb06b3
--- /dev/null
+++ b/test/fnetfilter/test3.net
@@ -0,0 +1 @@
asdfasdf $ARG asdfasdfdasf
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index e67ccc476..9c3310b31 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -1,53 +1,84 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10# These directories are required by some tests:
11mkdir -p ~/Desktop ~/Documents ~/Downloads ~/Music ~/Pictures ~/Videos
8 12
9rm -fr ~/_firejail_test_* 13rm -fr ~/_firejail_test_*
10echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)" 14echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)"
11./mkdir_mkfile.exp 15./mkdir_mkfile.exp
12rm -fr ~/_firejail_test_* 16rm -fr ~/_firejail_test_*
13 17
14mkdir ~/_firejail_test_dir 18echo "TESTING: recursive mkdir (test/fs/mkdir.exp)"
15touch ~/_firejail_test_dir/a 19./mkdir.exp
16mkdir ~/_firejail_test_dir/test1 20rm -fr ~/_firejail_test_*
17touch ~/_firejail_test_dir/test1/b 21rm -fr /tmp/_firejail_test_*
22
18echo "TESTING: read/write (test/fs/read-write.exp)" 23echo "TESTING: read/write (test/fs/read-write.exp)"
19./read-write.exp 24./read-write.exp
20rm -fr ~/_firejail_test_* 25rm -fr ~/_firejail_test_dir
26
27echo "TESTING: whitelist readonly (test/fs/whitelist-readonly.exp)"
28./whitelist-readonly.exp
29rm -f ~/_firejail_test_dir
21 30
22echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" 31echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)"
23./sys_fs.exp 32./sys_fs.exp
24 33
25echo "TESTING: kmsg access (test/fs/kmsg.exp)" 34if [ -c /dev/kmsg ]; then
26./kmsg.exp 35 echo "TESTING: kmsg access (test/fs/kmsg.exp)"
36 ./kmsg.exp
37else
38 echo "TESTING SKIP: /dev/kmsg not available"
39fi
27 40
28echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" 41echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)"
29./fs_var_tmp.exp 42./fs_var_tmp.exp
43rm -f /var/tmp/_firejail_test_file
30 44
31echo "TESTING: private-lib (test/fs/private-lib.exp)" 45echo "TESTING: private-lib (test/fs/private-lib.exp)"
32./private-lib.exp 46./private-lib.exp
33 47
34echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" 48echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)"
35./fs_var_lock.exp 49./fs_var_lock.exp
50rm -f /var/lock/_firejail_test_file
36 51
37echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)" 52if [ -w /dev/shm ]; then
38./fs_dev_shm.exp 53 echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)"
54 ./fs_dev_shm.exp
55 rm -f /dev/shm/_firejail_test_file
56else
57 echo "TESTING SKIP: /dev/shm not writable"
58fi
39 59
40echo "TESTING: private (test/fs/private.exp)" 60echo "TESTING: private (test/fs/private.exp)"
41./private.exp 61./private.exp
42 62
43echo "TESTING: private home (test/fs/private-home.exp)" 63echo "TESTING: private home (test/fs/private-home.exp)"
44./private-home.exp 64./private-home.exp
65rm -f ~/_firejail_test_file1
66rm -f ~/_firejail_test_file2
67rm -fr ~/_firejail_test_dir1
68rm -f ~/_firejail_test_link1
69rm -f ~/_firejail_test_link2
45 70
46echo "TESTING: private home dir (test/fs/private-home-dir.exp)" 71echo "TESTING: private home dir (test/fs/private-home-dir.exp)"
47./private-home-dir.exp 72./private-home-dir.exp
73rm -fr ~/_firejail_test_dir1
48 74
49echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)" 75echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)"
50./private-homedir.exp 76./private-homedir.exp
77rm -f ~/_firejail_test_file1
78rm -f ~/_firejail_test_file2
79rm -fr ~/_firejail_test_dir1
80rm -f ~/_firejail_test_link1
81rm -f ~/_firejail_test_link2
51 82
52echo "TESTING: private-etc (test/fs/private-etc.exp)" 83echo "TESTING: private-etc (test/fs/private-etc.exp)"
53./private-etc.exp 84./private-etc.exp
@@ -58,15 +89,28 @@ echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)"
58echo "TESTING: private-bin (test/fs/private-bin.exp)" 89echo "TESTING: private-bin (test/fs/private-bin.exp)"
59./private-bin.exp 90./private-bin.exp
60 91
92echo "TESTING: private-cache (test/fs/private-cache.exp)"
93./private-cache.exp
94rm -f ~/.cache/abcdefg
95
96echo "TESTING: private-cwd (test/fs/private-cwd.exp)"
97./private-cwd.exp
98
99echo "TESTING: macros (test/fs/macro.exp)"
100./macro.exp
101
61echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" 102echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)"
62./whitelist-empty.exp 103./whitelist-empty.exp
104rm -f ~/Videos/_firejail_test_fil
105rm -f ~/Pictures/_firejail_test_file
106rm -f ~/Music/_firejail_test_file
107rm -f ~/Downloads/_firejail_test_file
108rm -f ~/Documents/_firejail_test_file
109rm -f ~/Desktop/_firejail_test_file
63 110
64echo "TESTING: private whitelist (test/fs/private-whitelist.exp)" 111echo "TESTING: private whitelist (test/fs/private-whitelist.exp)"
65./private-whitelist.exp 112./private-whitelist.exp
66 113
67echo "TESTING: whitelist ~/Downloads (test/fs/whitelist-downloads.exp)"
68./whitelist-downloads.exp
69
70echo "TESTING: invalid filename (test/fs/invalid_filename.exp)" 114echo "TESTING: invalid filename (test/fs/invalid_filename.exp)"
71./invalid_filename.exp 115./invalid_filename.exp
72 116
@@ -75,30 +119,45 @@ echo "TESTING: blacklist directory (test/fs/option_blacklist.exp)"
75 119
76echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)" 120echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)"
77./option_blacklist_file.exp 121./option_blacklist_file.exp
122rm -fr ~/_firejail_test_dir
78 123
79echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)" 124echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)"
80./option_blacklist_glob.exp 125./option_blacklist_glob.exp
126rm -fr ~/_firejail_test_dir
127
128echo "TESTING: noblacklist blacklist noexec (test/fs/noblacklist-blacklist-noexec.exp)"
129./noblacklist-blacklist-noexec.exp
130
131echo "TESTING: noblacklist blacklist readonly (test/fs/noblacklist-blacklist-readonly.exp)"
132./noblacklist-blacklist-readonly.exp
81 133
82echo "TESTING: bind as user (test/fs/option_bind_user.exp)" 134echo "TESTING: bind as user (test/fs/option_bind_user.exp)"
83./option_bind_user.exp 135./option_bind_user.exp
84 136
85echo "TESTING: recursive mkdir (test/fs/mkdir.exp)"
86./mkdir.exp
87
88echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" 137echo "TESTING: double whitelist (test/fs/whitelist-double.exp)"
89./whitelist-double.exp 138./whitelist-double.exp
139rm -f /tmp/_firejail_test_file
90 140
91echo "TESTING: whitelist (test/fs/whitelist.exp)" 141echo "TESTING: whitelist (test/fs/whitelist.exp)"
92./whitelist.exp 142./whitelist.exp
143rm -fr ~/_firejail_test_*
93 144
94echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)" 145echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)"
95./whitelist-dev.exp 146./whitelist-dev.exp
96 147
148echo "TESTING: whitelist noexec (test/fs/whitelist-noexec.exp)"
149./whitelist-noexec.exp
150
151echo "TESTING: whitelist with whitespaces (test/fs/whitelist-whitespace.exp)"
152./whitelist-whitespace.exp
153
97echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)" 154echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)"
98./fscheck-bindnoroot.exp 155./fscheck-bindnoroot.exp
99 156
100echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)" 157echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)"
101./fscheck-tmpfs.exp 158./fscheck-tmpfs.exp
159rm -fr ~/_firejail_test_dir
160rm -fr /tmp/_firejail_test_dir
102 161
103echo "TESTING: fscheck --private= (test/fs/fscheck-private.exp)" 162echo "TESTING: fscheck --private= (test/fs/fscheck-private.exp)"
104./fscheck-private.exp 163./fscheck-private.exp
@@ -107,10 +166,4 @@ echo "TESTING: fscheck --read-only= (test/fs/fscheck-readonly.exp)"
107./fscheck-readonly.exp 166./fscheck-readonly.exp
108 167
109#cleanup 168#cleanup
110rm -fr ~/fjtest-dir 169rm -fr ~/_firejail_test*
111rm -fr ~/fjtest-dir-lnk
112rm -f ~/fjtest-file
113rm -f ~/fjtest-file-lnk
114rm -f /tmp/fjtest-file
115rm -fr /tmp/fjtest-dir
116rm -fr ~/_firejail_test_*
diff --git a/test/fs/fs_dev_shm.exp b/test/fs/fs_dev_shm.exp
index 1d810084c..5f0503494 100755
--- a/test/fs/fs_dev_shm.exp
+++ b/test/fs/fs_dev_shm.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -13,15 +13,16 @@ expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized" 14 "Child process initialized"
15} 15}
16sleep 1 16after 100
17send -- "stty -echo\r"
17 18
18send -- "echo mytest > /dev/shm/ttt;echo done\r" 19send -- "echo mytest > /dev/shm/_firejail_test_file;echo done\r"
19expect { 20expect {
20 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
21 "done" 22 "done"
22} 23}
23 24
24send -- "cat /dev/shm/ttt;echo done\r" 25send -- "cat /dev/shm/_firejail_test_file;echo done\r"
25expect { 26expect {
26 timeout {puts "TESTING ERROR 2\n";exit} 27 timeout {puts "TESTING ERROR 2\n";exit}
27 "mytest" 28 "mytest"
@@ -31,20 +32,19 @@ expect {
31 "done" 32 "done"
32} 33}
33 34
34send -- "rm /dev/shm/ttt;echo done\r" 35send -- "rm /dev/shm/_firejail_test_file;echo done\r"
35expect { 36expect {
36 timeout {puts "TESTING ERROR 4\n";exit} 37 timeout {puts "TESTING ERROR 4\n";exit}
37 "done" 38 "done"
38} 39}
39 40
40send -- "cat /dev/shm/ttt;echo done\r" 41send -- "cat /dev/shm/_firejail_test_file;echo done\r"
41expect { 42expect {
42 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
43 "mytest" {puts "TESTING ERROR 6\n";exit} 44 "mytest" {puts "TESTING ERROR 6\n";exit}
44 "done" 45 "done"
45} 46}
46 47after 100
47sleep 1
48send -- "exit\r" 48send -- "exit\r"
49sleep 1 49sleep 1
50 50
@@ -54,15 +54,16 @@ expect {
54 timeout {puts "TESTING ERROR 7\n";exit} 54 timeout {puts "TESTING ERROR 7\n";exit}
55 "Child process initialized" 55 "Child process initialized"
56} 56}
57sleep 1 57after 100
58send -- "stty -echo\r"
58 59
59send -- "echo mytest > /dev/shm/ttt;echo done\r" 60send -- "echo mytest > /dev/shm/_firejail_test_file;echo done\r"
60expect { 61expect {
61 timeout {puts "TESTING ERROR 8\n";exit} 62 timeout {puts "TESTING ERROR 8\n";exit}
62 "done" 63 "done"
63} 64}
64 65
65send -- "cat /dev/shm/ttt;echo done\r" 66send -- "cat /dev/shm/_firejail_test_file;echo done\r"
66expect { 67expect {
67 timeout {puts "TESTING ERROR 9\n";exit} 68 timeout {puts "TESTING ERROR 9\n";exit}
68 "mytest" 69 "mytest"
@@ -72,13 +73,13 @@ expect {
72 "done" 73 "done"
73} 74}
74 75
75send -- "rm /dev/shm/ttt;echo done\r" 76send -- "rm /dev/shm/_firejail_test_file;echo done\r"
76expect { 77expect {
77 timeout {puts "TESTING ERROR 11\n";exit} 78 timeout {puts "TESTING ERROR 11\n";exit}
78 "done" 79 "done"
79} 80}
80 81
81send -- "cat /dev/shm/ttt;echo done\r" 82send -- "cat /dev/shm/_firejail_test_file;echo done\r"
82expect { 83expect {
83 timeout {puts "TESTING ERROR 12\n";exit} 84 timeout {puts "TESTING ERROR 12\n";exit}
84 "mytest" {puts "TESTING ERROR 13\n";exit} 85 "mytest" {puts "TESTING ERROR 13\n";exit}
diff --git a/test/fs/fs_var_lock.exp b/test/fs/fs_var_lock.exp
index 919b75f34..3ea98c3e3 100755
--- a/test/fs/fs_var_lock.exp
+++ b/test/fs/fs_var_lock.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -13,7 +13,8 @@ expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized" 14 "Child process initialized"
15} 15}
16sleep 1 16after 100
17send -- "stty -echo\r"
17 18
18send -- "echo mytest > /var/lock/ttt;echo done\r" 19send -- "echo mytest > /var/lock/ttt;echo done\r"
19expect { 20expect {
@@ -44,7 +45,7 @@ expect {
44 "done" 45 "done"
45} 46}
46 47
47sleep 1 48after 100
48send -- "exit\r" 49send -- "exit\r"
49sleep 1 50sleep 1
50 51
@@ -54,7 +55,8 @@ expect {
54 timeout {puts "TESTING ERROR 7\n";exit} 55 timeout {puts "TESTING ERROR 7\n";exit}
55 "Child process initialized" 56 "Child process initialized"
56} 57}
57sleep 1 58after 100
59send -- "stty -echo\r"
58 60
59send -- "echo mytest > /var/lock/ttt;echo done\r" 61send -- "echo mytest > /var/lock/ttt;echo done\r"
60expect { 62expect {
diff --git a/test/fs/fs_var_tmp.exp b/test/fs/fs_var_tmp.exp
index 50679db6d..c7d4b0c20 100755
--- a/test/fs/fs_var_tmp.exp
+++ b/test/fs/fs_var_tmp.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -13,15 +13,16 @@ expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized" 14 "Child process initialized"
15} 15}
16sleep 1 16after 100
17send -- "stty -echo\r"
17 18
18send -- "echo mytest > /var/tmp/ttt;echo done\r" 19send -- "echo mytest > /var/tmp/_firejail_test_file;echo done\r"
19expect { 20expect {
20 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
21 "done" 22 "done"
22} 23}
23 24
24send -- "cat /var/tmp/ttt;echo done\r" 25send -- "cat /var/tmp/_firejail_test_file;echo done\r"
25expect { 26expect {
26 timeout {puts "TESTING ERROR 2\n";exit} 27 timeout {puts "TESTING ERROR 2\n";exit}
27 "mytest" 28 "mytest"
@@ -31,20 +32,20 @@ expect {
31 "done" 32 "done"
32} 33}
33 34
34send -- "rm /var/tmp/ttt;echo done\r" 35send -- "rm /var/tmp/_firejail_test_file;echo done\r"
35expect { 36expect {
36 timeout {puts "TESTING ERROR 4\n";exit} 37 timeout {puts "TESTING ERROR 4\n";exit}
37 "done" 38 "done"
38} 39}
39 40
40send -- "cat /var/tmp/ttt;echo done\r" 41send -- "cat /var/tmp/_firejail_test_file;echo done\r"
41expect { 42expect {
42 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
43 "mytest" {puts "TESTING ERROR 6\n";exit} 44 "mytest" {puts "TESTING ERROR 6\n";exit}
44 "done" 45 "done"
45} 46}
46 47
47sleep 1 48after 100
48send -- "exit\r" 49send -- "exit\r"
49sleep 1 50sleep 1
50 51
@@ -54,15 +55,16 @@ expect {
54 timeout {puts "TESTING ERROR 7\n";exit} 55 timeout {puts "TESTING ERROR 7\n";exit}
55 "Child process initialized" 56 "Child process initialized"
56} 57}
57sleep 1 58after 100
59send -- "stty -echo\r"
58 60
59send -- "echo mytest > /var/tmp/ttt;echo done\r" 61send -- "echo mytest > /var/tmp/_firejail_test_file;echo done\r"
60expect { 62expect {
61 timeout {puts "TESTING ERROR 8\n";exit} 63 timeout {puts "TESTING ERROR 8\n";exit}
62 "done" 64 "done"
63} 65}
64 66
65send -- "cat /var/tmp/ttt;echo done\r" 67send -- "cat /var/tmp/_firejail_test_file;echo done\r"
66expect { 68expect {
67 timeout {puts "TESTING ERROR 9\n";exit} 69 timeout {puts "TESTING ERROR 9\n";exit}
68 "mytest" 70 "mytest"
@@ -72,13 +74,13 @@ expect {
72 "done" 74 "done"
73} 75}
74 76
75send -- "rm /var/tmp/ttt;echo done\r" 77send -- "rm /var/tmp/_firejail_test_file;echo done\r"
76expect { 78expect {
77 timeout {puts "TESTING ERROR 11\n";exit} 79 timeout {puts "TESTING ERROR 11\n";exit}
78 "done" 80 "done"
79} 81}
80 82
81send -- "cat /var/tmp/ttt;echo done\r" 83send -- "cat /var/tmp/_firejail_test_file;echo done\r"
82expect { 84expect {
83 timeout {puts "TESTING ERROR 12\n";exit} 85 timeout {puts "TESTING ERROR 12\n";exit}
84 "mytest" {puts "TESTING ERROR 13\n";exit} 86 "mytest" {puts "TESTING ERROR 13\n";exit}
diff --git a/test/fs/fscheck-bindnoroot.exp b/test/fs/fscheck-bindnoroot.exp
index 431092f05..53a3922ee 100755
--- a/test/fs/fscheck-bindnoroot.exp
+++ b/test/fs/fscheck-bindnoroot.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/fs/fscheck-private.exp b/test/fs/fscheck-private.exp
index 1972a683b..ab39b43e1 100755
--- a/test/fs/fscheck-private.exp
+++ b/test/fs/fscheck-private.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/fs/fscheck-readonly.exp b/test/fs/fscheck-readonly.exp
index 4d7528e50..5d4821dea 100755
--- a/test/fs/fscheck-readonly.exp
+++ b/test/fs/fscheck-readonly.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/fs/fscheck-tmpfs.exp b/test/fs/fscheck-tmpfs.exp
index f8901e336..78b6efb76 100755
--- a/test/fs/fscheck-tmpfs.exp
+++ b/test/fs/fscheck-tmpfs.exp
@@ -1,13 +1,55 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
5match_max 100000 8match_max 100000
6 9
7# .. 10send -- "mkdir -p ~/fjtest-dir/fjtest-dir\r"
8send -- "firejail --tmpfs=fscheck-dir\r" 11after 100
12send -- "mkdir /tmp/fjtest-dir\r"
13after 100
14
15if { ! [file exists ~/fjtest-dir/fjtest-dir] } {
16 puts "TESTING ERROR 1\n"
17 exit
18}
19if { ! [file exists /tmp/fjtest-dir] } {
20 puts "TESTING ERROR 2\n"
21 exit
22}
23
24send -- "firejail --noprofile --tmpfs=~/fjtest-dir\r"
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 "Child process initialized"
28}
29after 500
30
31send -- "ls ~/fjtest-dir/fjtest-dir\r"
9expect { 32expect {
10 timeout {puts "TESTING ERROR 0.1\n";exit} 33 timeout {puts "TESTING ERROR 4\n";exit}
11 "Error" 34 "No such file or directory"
12} 35}
36after 500
37
38send -- "exit\r"
39after 500
40
41send -- "firejail --noprofile --tmpfs=/tmp/fjtest-dir\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 "Warning: you are not allowed to mount a tmpfs"
45}
46after 500
47
48# cleanup
49send -- "rm -fr ~/fjtest-dir\r"
50after 100
51send -- "rm -fr /tmp/fjtest-dir\r"
13after 100 52after 100
53
54
55puts "\nall done\n"
diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp
index 3d734e852..7c4797976 100755
--- a/test/fs/invalid_filename.exp
+++ b/test/fs/invalid_filename.exp
@@ -1,17 +1,13 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --debug-check-filename --noprofile --blacklist=\"bla&&bla\"\r" 10send -- "firejail --noprofile --blacklist=\"bla&&bla\"\r"
11expect {
12 timeout {puts "TESTING ERROR 1.1\n";exit}
13 "Checking filename bla&&bla"
14}
15expect { 11expect {
16 timeout {puts "TESTING ERROR 1.2\n";exit} 12 timeout {puts "TESTING ERROR 1.2\n";exit}
17 "Error:" 13 "Error:"
@@ -22,11 +18,7 @@ expect {
22} 18}
23after 100 19after 100
24 20
25send -- "firejail --debug-check-filename --noprofile --cgroup=\"bla&&bla\"\r" 21send -- "firejail --noprofile --cgroup=\"bla&&bla\"\r"
26expect {
27 timeout {puts "TESTING ERROR 2.1\n";exit}
28 "Checking filename bla&&bla"
29}
30expect { 22expect {
31 timeout {puts "TESTING ERROR 2.2\n";exit} 23 timeout {puts "TESTING ERROR 2.2\n";exit}
32 "Error:" 24 "Error:"
@@ -37,12 +29,7 @@ expect {
37} 29}
38after 100 30after 100
39 31
40send -- "firejail --debug-check-filename --noprofile --chroot=\"bla&&bla\"\r" 32send -- "firejail --noprofile --chroot=\"bla&&bla\"\r"
41expect {
42 timeout {puts "TESTING ERROR 3.1\n";exit}
43 "Checking filename bla&&bla" {puts "normal system\n"}
44 "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit}
45}
46expect { 33expect {
47 timeout {puts "TESTING ERROR 3.2\n";exit} 34 timeout {puts "TESTING ERROR 3.2\n";exit}
48 "Error:" 35 "Error:"
@@ -53,11 +40,7 @@ expect {
53} 40}
54after 100 41after 100
55 42
56send -- "firejail --debug-check-filename --noprofile --netfilter=\"bla&&bla\"\r" 43send -- "firejail --noprofile --netfilter=\"bla&&bla\"\r"
57expect {
58 timeout {puts "TESTING ERROR 4.1\n";exit}
59 "Checking filename bla&&bla"
60}
61expect { 44expect {
62 timeout {puts "TESTING ERROR 4.2\n";exit} 45 timeout {puts "TESTING ERROR 4.2\n";exit}
63 "Error:" 46 "Error:"
@@ -68,22 +51,14 @@ expect {
68} 51}
69after 100 52after 100
70 53
71send -- "firejail --debug-check-filename --noprofile --output=\"bla&&bla\"\r" 54send -- "firejail --noprofile --output=\"bla&&bla\"\r"
72expect {
73 timeout {puts "TESTING ERROR 5.2\n";exit}
74 "Error:"
75}
76expect { 55expect {
77 timeout {puts "TESTING ERROR 5.3\n";exit} 56 timeout {puts "TESTING ERROR 5.3\n";exit}
78 "is an invalid filename" 57 "is an invalid filename"
79} 58}
80after 100 59after 100
81 60
82send -- "firejail --debug-check-filename --noprofile --private=\"bla&&bla\"\r" 61send -- "firejail --noprofile --private=\"bla&&bla\"\r"
83expect {
84 timeout {puts "TESTING ERROR 6.1\n";exit}
85 "Checking filename bla&&bla"
86}
87expect { 62expect {
88 timeout {puts "TESTING ERROR 6.2\n";exit} 63 timeout {puts "TESTING ERROR 6.2\n";exit}
89 "Error:" 64 "Error:"
@@ -94,11 +69,7 @@ expect {
94} 69}
95after 100 70after 100
96 71
97send -- "firejail --debug-check-filename --noprofile --private-bin=\"bla&&bla\"\r" 72send -- "firejail --noprofile --private-bin=\"bla&&bla\"\r"
98expect {
99 timeout {puts "TESTING ERROR 7.1\n";exit}
100 "Checking filename bla&&bla"
101}
102expect { 73expect {
103 timeout {puts "TESTING ERROR 7.2\n";exit} 74 timeout {puts "TESTING ERROR 7.2\n";exit}
104 "Error:" 75 "Error:"
@@ -109,11 +80,7 @@ expect {
109} 80}
110after 100 81after 100
111 82
112send -- "firejail --debug-check-filename --noprofile --private-home=\"bla&&bla\"\r" 83send -- "firejail --noprofile --private-home=\"bla&&bla\"\r"
113expect {
114 timeout {puts "TESTING ERROR 8.1\n";exit}
115 "Checking filename bla&&bla"
116}
117expect { 84expect {
118 timeout {puts "TESTING ERROR 8.2\n";exit} 85 timeout {puts "TESTING ERROR 8.2\n";exit}
119 "Error:" 86 "Error:"
@@ -124,11 +91,7 @@ expect {
124} 91}
125after 100 92after 100
126 93
127send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" 94send -- "firejail --noprofile --private-etc=\"bla&&bla\"\r"
128expect {
129 timeout {puts "TESTING ERROR 9.1\n";exit}
130 "Checking filename bla&&bla"
131}
132expect { 95expect {
133 timeout {puts "TESTING ERROR 9.2\n";exit} 96 timeout {puts "TESTING ERROR 9.2\n";exit}
134 "Error:" 97 "Error:"
@@ -139,11 +102,7 @@ expect {
139} 102}
140after 100 103after 100
141 104
142send -- "firejail --debug-check-filename --profile=\"bla&&bla\"\r" 105send -- "firejail --profile=\"bla&&bla\"\r"
143expect {
144 timeout {puts "TESTING ERROR 10.1\n";exit}
145 "Checking filename bla&&bla"
146}
147expect { 106expect {
148 timeout {puts "TESTING ERROR 10.2\n";exit} 107 timeout {puts "TESTING ERROR 10.2\n";exit}
149 "Error:" 108 "Error:"
@@ -154,11 +113,7 @@ expect {
154} 113}
155after 100 114after 100
156 115
157send -- "firejail --debug-check-filename --read-only=\"bla&&bla\"\r" 116send -- "firejail --read-only=\"bla&&bla\"\r"
158expect {
159 timeout {puts "TESTING ERROR 11.1\n";exit}
160 "Checking filename bla&&bla"
161}
162expect { 117expect {
163 timeout {puts "TESTING ERROR 11.2\n";exit} 118 timeout {puts "TESTING ERROR 11.2\n";exit}
164 "Error:" 119 "Error:"
@@ -169,11 +124,7 @@ expect {
169} 124}
170after 100 125after 100
171 126
172send -- "firejail --debug-check-filename --shell=\"bla&&bla\"\r" 127send -- "firejail --shell=\"bla&&bla\"\r"
173expect {
174 timeout {puts "TESTING ERROR 12.1\n";exit}
175 "Checking filename bla&&bla"
176}
177expect { 128expect {
178 timeout {puts "TESTING ERROR 12.2\n";exit} 129 timeout {puts "TESTING ERROR 12.2\n";exit}
179 "Error:" 130 "Error:"
@@ -185,11 +136,7 @@ expect {
185after 100 136after 100
186 137
187 138
188send -- "firejail --debug-check-filename --whitelist=\"bla&&bla\"\r" 139send -- "firejail --whitelist=\"bla&&bla\"\r"
189expect {
190 timeout {puts "TESTING ERROR 14.1\n";exit}
191 "Checking filename bla&&bla"
192}
193expect { 140expect {
194 timeout {puts "TESTING ERROR 14.2\n";exit} 141 timeout {puts "TESTING ERROR 14.2\n";exit}
195 "Error:" 142 "Error:"
diff --git a/test/fs/kmsg.exp b/test/fs/kmsg.exp
index 8dd13b129..209cb8d3b 100755
--- a/test/fs/kmsg.exp
+++ b/test/fs/kmsg.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fs/macro-blacklist.profile b/test/fs/macro-blacklist.profile
new file mode 100644
index 000000000..2421d1b7c
--- /dev/null
+++ b/test/fs/macro-blacklist.profile
@@ -0,0 +1,6 @@
1blacklist ${VIDEOS}
2blacklist ${DOCUMENTS}
3blacklist ${MUSIC}
4blacklist ${DOWNLOADS}
5blacklist ${PICTURES}
6blacklist ${DESKTOP}
diff --git a/test/fs/macro-readonly.profile b/test/fs/macro-readonly.profile
new file mode 100644
index 000000000..2f3d5bd78
--- /dev/null
+++ b/test/fs/macro-readonly.profile
@@ -0,0 +1,6 @@
1read-only ${VIDEOS}
2read-only ${DOCUMENTS}
3read-only ${MUSIC}
4read-only ${DOWNLOADS}
5read-only ${PICTURES}
6read-only ${DESKTOP}
diff --git a/test/fs/macro-whitelist.profile b/test/fs/macro-whitelist.profile
new file mode 100644
index 000000000..fed7f76fc
--- /dev/null
+++ b/test/fs/macro-whitelist.profile
@@ -0,0 +1,6 @@
1whitelist ${VIDEOS}
2whitelist ${DOCUMENTS}
3whitelist ${MUSIC}
4whitelist ${DOWNLOADS}
5whitelist ${PICTURES}
6whitelist ${DESKTOP}
diff --git a/test/fs/macro.exp b/test/fs/macro.exp
new file mode 100755
index 000000000..45e892088
--- /dev/null
+++ b/test/fs/macro.exp
@@ -0,0 +1,174 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --profile=macro-whitelist.profile ls ~\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16expect {
17 timeout {puts "TESTING ERROR 1\n";exit}
18 "Desktop"
19}
20expect {
21 timeout {puts "TESTING ERROR 2\n";exit}
22 "Documents"
23}
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "Downloads"
27}
28expect {
29 timeout {puts "TESTING ERROR 4\n";exit}
30 "Music"
31}
32expect {
33 timeout {puts "TESTING ERROR 5\n";exit}
34 "Pictures"
35}
36expect {
37 timeout {puts "TESTING ERROR 6\n";exit}
38 "Videos"
39}
40sleep 1
41
42send -- "firejail --profile=macro-blacklist.profile ls ~/Desktop\r"
43expect {
44 timeout {puts "TESTING ERROR 7\n";exit}
45 "Child process initialized"
46}
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "Permission denied"
50}
51sleep 1
52
53send -- "firejail --profile=macro-blacklist.profile ls ~/Documents\r"
54expect {
55 timeout {puts "TESTING ERROR 9n";exit}
56 "Child process initialized"
57}
58expect {
59 timeout {puts "TESTING ERROR 10\n";exit}
60 "Permission denied"
61}
62sleep 1
63
64send -- "firejail --profile=macro-blacklist.profile ls ~/Downloads\r"
65expect {
66 timeout {puts "TESTING ERROR 11n";exit}
67 "Child process initialized"
68}
69expect {
70 timeout {puts "TESTING ERROR 12n";exit}
71 "Permission denied"
72}
73sleep 1
74
75send -- "firejail --profile=macro-blacklist.profile ls ~/Music\r"
76expect {
77 timeout {puts "TESTING ERROR 13\n";exit}
78 "Child process initialized"
79}
80expect {
81 timeout {puts "TESTING ERROR 14\n";exit}
82 "Permission denied"
83}
84sleep 1
85
86send -- "firejail --profile=macro-blacklist.profile ls ~/Pictures\r"
87expect {
88 timeout {puts "TESTING ERROR 15\n";exit}
89 "Child process initialized"
90}
91expect {
92 timeout {puts "TESTING ERROR 16\n";exit}
93 "Permission denied"
94}
95sleep 1
96
97send -- "firejail --profile=macro-blacklist.profile ls ~/Videos\r"
98expect {
99 timeout {puts "TESTING ERROR 17\n";exit}
100 "Child process initialized"
101}
102expect {
103 timeout {puts "TESTING ERROR 18\n";exit}
104 "Permission denied"
105}
106sleep 1
107
108send -- "firejail --profile=macro-readonly.profile touch ~/Desktop/blablabla\r"
109expect {
110 timeout {puts "TESTING ERROR 19\n";exit}
111 "Child process initialized"
112}
113expect {
114 timeout {puts "TESTING ERROR 20\n";exit}
115 "Read-only file system"
116}
117sleep 1
118
119send -- "firejail --profile=macro-readonly.profile touch ~/Documents/blablabla\r"
120expect {
121 timeout {puts "TESTING ERROR 21\n";exit}
122 "Child process initialized"
123}
124expect {
125 timeout {puts "TESTING ERROR 22\n";exit}
126 "Read-only file system"
127}
128sleep 1
129
130send -- "firejail --profile=macro-readonly.profile touch ~/Downloads/blablabla\r"
131expect {
132 timeout {puts "TESTING ERROR 23\n";exit}
133 "Child process initialized"
134}
135expect {
136 timeout {puts "TESTING ERROR 24\n";exit}
137 "Read-only file system"
138}
139sleep 1
140
141send -- "firejail --profile=macro-readonly.profile touch ~/Music/blablabla\r"
142expect {
143 timeout {puts "TESTING ERROR 25\n";exit}
144 "Child process initialized"
145}
146expect {
147 timeout {puts "TESTING ERROR 26\n";exit}
148 "Read-only file system"
149}
150sleep 1
151
152send -- "firejail --profile=macro-readonly.profile touch ~/Pictures/blablabla\r"
153expect {
154 timeout {puts "TESTING ERROR 27\n";exit}
155 "Child process initialized"
156}
157expect {
158 timeout {puts "TESTING ERROR 28\n";exit}
159 "Read-only file system"
160}
161sleep 1
162
163send -- "firejail --profile=macro-readonly.profile touch ~/Videos/blablabla\r"
164expect {
165 timeout {puts "TESTING ERROR 29\n";exit}
166 "Child process initialized"
167}
168expect {
169 timeout {puts "TESTING ERROR 30\n";exit}
170 "Read-only file system"
171}
172sleep 1
173
174puts "\nall done\n"
diff --git a/test/fs/mkdir.exp b/test/fs/mkdir.exp
index 81df7cd86..da04a431c 100755
--- a/test/fs/mkdir.exp
+++ b/test/fs/mkdir.exp
@@ -1,27 +1,49 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2016 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 3 6set timeout 3
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --profile=mkdir.profile find ~/.firejail_test\r" 10send -- "rm -fr ~/_firejail_test_dir\r"
11after 100
12
13send -- "firejail --profile=mkdir.profile find ~/_firejail_test_dir\r"
11expect { 14expect {
12 timeout {puts "TESTING ERROR 1.1\n";exit} 15 timeout {puts "TESTING ERROR 1.1\n";exit}
13 "Warning: cannot create" { puts "TESTING ERROR 1.2\n";exit} 16 "_firejail_test_dir/_firejail_test_file"
14 "No such file or directory" { puts "TESTING ERROR 1.3\n";exit}
15 ".firejail_test/a/b/c/d.txt"
16} 17}
17send -- "rm -rf ~/.firejail_test\r" 18send -- "rm -rf ~/_firejail_test_dir\r"
18after 100 19after 100
19 20
20send -- "firejail --profile=mkdir2.profile\r" 21send -- "firejail --profile=mkdir.profile find /tmp/_firejail_test_dir\r"
21expect { 22expect {
22 timeout {puts "TESTING ERROR 2\n";exit} 23 timeout {puts "TESTING ERROR 2.1\n";exit}
23 "only directories in user home or /tmp" 24 "_firejail_test_dir/_firejail_test_file"
24} 25}
26send -- "rm -rf /tmp/_firejail_test_dir\r"
25after 100 27after 100
26 28
29set UID [exec id -u]
30set fexist [file exist /run/user/$UID]
31if { $fexist } {
32 send -- "firejail --profile=mkdir.profile find /run/user/$UID/_firejail_test_dir\r"
33 expect {
34 timeout {puts "TESTING ERROR 3.1\n";exit}
35 "_firejail_test_dir/_firejail_test_file"
36 }
37 send -- "rm -rf /run/user/$UID/_firejail_test_dir\r"
38 after 100
39
40
41 send -- "firejail --profile=mkdir2.profile\r"
42 expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "only files or directories in user home, /tmp, or /run/user/<UID>"
45 }
46 after 100
47}
48
27puts "\nall done\n" 49puts "\nall done\n"
diff --git a/test/fs/mkdir.profile b/test/fs/mkdir.profile
index 61b44c9ac..fba93f466 100644
--- a/test/fs/mkdir.profile
+++ b/test/fs/mkdir.profile
@@ -1,2 +1,6 @@
1mkdir ~/.firejail_test/a/b/c 1mkdir ~/_firejail_test_dir
2mkfile ~/.firejail_test/a/b/c/d.txt 2mkfile ~/_firejail_test_dir/_firejail_test_file
3mkdir /tmp/_firejail_test_dir
4mkfile /tmp/_firejail_test_dir/_firejail_test_file
5mkdir ${RUNUSER}/_firejail_test_dir
6mkfile ${RUNUSER}/_firejail_test_dir/_firejail_test_file
diff --git a/test/fs/mkdir_mkfile.exp b/test/fs/mkdir_mkfile.exp
index 1faa913e0..eddc6ebfb 100755
--- a/test/fs/mkdir_mkfile.exp
+++ b/test/fs/mkdir_mkfile.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -22,23 +22,23 @@ expect {
22 "_firejail_test_dir" 22 "_firejail_test_dir"
23} 23}
24expect { 24expect {
25 timeout {puts "TESTING ERROR 1\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
26 "_firejail_test_dir/dir1" 26 "_firejail_test_dir/dir1"
27} 27}
28expect { 28expect {
29 timeout {puts "TESTING ERROR 1\n";exit} 29 timeout {puts "TESTING ERROR 3\n";exit}
30 "_firejail_test_dir/dir1/dir2" 30 "_firejail_test_dir/dir1/dir2"
31} 31}
32expect { 32expect {
33 timeout {puts "TESTING ERROR 1\n";exit} 33 timeout {puts "TESTING ERROR 4\n";exit}
34 "_firejail_test_dir/dir1/dir2/dir3" 34 "_firejail_test_dir/dir1/dir2/dir3"
35} 35}
36expect { 36expect {
37 timeout {puts "TESTING ERROR 1\n";exit} 37 timeout {puts "TESTING ERROR 5\n";exit}
38 "_firejail_test_dir/dir1/dir2/dir3/file1" 38 "_firejail_test_dir/dir1/dir2/dir3/file1"
39} 39}
40expect { 40expect {
41 timeout {puts "TESTING ERROR 1\n";exit} 41 timeout {puts "TESTING ERROR 6\n";exit}
42 "_firejail_test_file" 42 "_firejail_test_file"
43} 43}
44after 100 44after 100
@@ -47,8 +47,8 @@ after 100
47 47
48send -- "firejail --profile=mkfile.profile\r" 48send -- "firejail --profile=mkfile.profile\r"
49expect { 49expect {
50 timeout {puts "TESTING ERROR 1\n";exit} 50 timeout {puts "TESTING ERROR 7\n";exit}
51 "only files in user home or /tmp" 51 "only files or directories in user home, /tmp"
52} 52}
53after 100 53after 100
54 54
diff --git a/test/fs/noblacklist-blacklist-noexec.exp b/test/fs/noblacklist-blacklist-noexec.exp
new file mode 100755
index 000000000..9f5794a7d
--- /dev/null
+++ b/test/fs/noblacklist-blacklist-noexec.exp
@@ -0,0 +1,36 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set PWD $env(PWD)
10
11
12send -- "firejail --noprofile --noblacklist=$PWD --blacklist=$PWD --noexec=$PWD\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "Child process initialized"
16}
17sleep 1
18
19send -- "ls $PWD\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "noblacklist-blacklist-noexec.exp"
23}
24after 100
25
26send -- "$PWD/noblacklist-blacklist-noexec.exp\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "Permission denied"
30}
31after 100
32
33send -- "exit\r"
34sleep 1
35
36puts "\nall done\n"
diff --git a/test/option_readonly.exp b/test/fs/noblacklist-blacklist-readonly.exp
index d776ed823..558d3ac9c 100755
--- a/test/option_readonly.exp
+++ b/test/fs/noblacklist-blacklist-readonly.exp
@@ -1,25 +1,35 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
5match_max 100000 8match_max 100000
6 9
7send -- "firejail --read-only=tmpreadonly\r" 10
11send -- "firejail --noprofile --noblacklist=~ --blacklist=~ --read-only=~\r"
8expect { 12expect {
9 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized" 14 "Child process initialized"
11} 15}
12sleep 1 16sleep 1
13 17
14send -- "touch tmpreadonly;pwd\r" 18send -- "ls ~\r"
15expect { 19expect {
16 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
17 "Read-only file system" 21 "Downloads"
18} 22}
23after 100
24
25send -- "echo World > ~/Hello\r"
19expect { 26expect {
20 timeout {puts "TESTING ERROR 2\n";exit} 27 timeout {puts "TESTING ERROR 2\n";exit}
21 "home" 28 "Read-only file system"
22} 29}
30after 100
31
32send -- "exit\r"
23sleep 1 33sleep 1
24 34
25puts "\n" 35puts "\nall done\n"
diff --git a/test/fs/option_bind_user.exp b/test/fs/option_bind_user.exp
index 7ec55d82f..08b892121 100755
--- a/test/fs/option_bind_user.exp
+++ b/test/fs/option_bind_user.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/fs/option_blacklist.exp b/test/fs/option_blacklist.exp
index bf2a57999..48dfcc069 100755
--- a/test/fs/option_blacklist.exp
+++ b/test/fs/option_blacklist.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -12,7 +12,8 @@ expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 13 "Child process initialized"
14} 14}
15sleep 1 15after 100
16send -- "stty -echo\r"
16 17
17send -- "ls -l /var;echo done\r" 18send -- "ls -l /var;echo done\r"
18expect { 19expect {
@@ -34,4 +35,4 @@ expect {
34} 35}
35after 100 36after 100
36 37
37puts "\n" 38puts "\nall done\n"
diff --git a/test/fs/option_blacklist_file.exp b/test/fs/option_blacklist_file.exp
index 6f789a792..247e69121 100755
--- a/test/fs/option_blacklist_file.exp
+++ b/test/fs/option_blacklist_file.exp
@@ -1,10 +1,18 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
5match_max 100000 8match_max 100000
6 9
7send -- "firejail --blacklist=/etc/passwd\r" 10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14
15send -- "firejail --blacklist=/etc/passwd --blacklist=~/_firejail_test_dir\r"
8expect { 16expect {
9 timeout {puts "TESTING ERROR 0\n";exit} 17 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized" 18 "Child process initialized"
@@ -14,6 +22,16 @@ sleep 1
14send -- "cat /etc/passwd;echo done\r" 22send -- "cat /etc/passwd;echo done\r"
15expect { 23expect {
16 timeout {puts "TESTING ERROR 1\n";exit} 24 timeout {puts "TESTING ERROR 1\n";exit}
25 "No such file or directory"
26}
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "done"
30}
31after 100
32send -- "cat ~/_firejail_test_dir/a;echo done\r"
33expect {
34 timeout {puts "TESTING ERROR 1\n";exit}
17 "Permission denied" 35 "Permission denied"
18} 36}
19expect { 37expect {
@@ -22,4 +40,10 @@ expect {
22} 40}
23after 100 41after 100
24 42
25puts "\n" 43send -- "exit\r"
44sleep 1
45
46send -- "rm -fr ~/_firejail_test_dir\r"
47after 100
48
49puts "\nall done\n"
diff --git a/test/fs/option_blacklist_glob.exp b/test/fs/option_blacklist_glob.exp
index 3de1f736d..a4be4a97d 100755
--- a/test/fs/option_blacklist_glob.exp
+++ b/test/fs/option_blacklist_glob.exp
@@ -1,32 +1,47 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --blacklist=testdir1/*\r" 10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14send -- "mkdir ~/_firejail_test_dir/test1\r"
15after 100
16send -- "touch ~/_firejail_test_dir/test1/b\r"
17after 100
18
19send -- "firejail --blacklist=~/_firejail_test_dir/*\r"
11expect { 20expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 21 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 22 "Child process initialized"
14} 23}
15sleep 1 24sleep 1
16send -- "cd testdir1\r" 25send -- "cd ~/_firejail_test_dir\r"
17sleep 1 26sleep 1
18 27
19send -- "cat .file\r" 28send -- "cat a\r"
20expect { 29expect {
21 timeout {puts "TESTING ERROR 1\n";exit} 30 timeout {puts "TESTING ERROR 1\n";exit}
22 "Permission denied" 31 "Permission denied"
23} 32}
24 33
25send -- "ls .directory\r" 34send -- "ls test1\r"
26expect { 35expect {
27 timeout {puts "TESTING ERROR 2\n";exit} 36 timeout {puts "TESTING ERROR 2\n";exit}
28 "Permission denied" 37 "Permission denied"
29} 38}
30after 100 39after 100
31 40
32puts "\n" 41send -- "exit\r"
42sleep 1
43
44send -- "rm -fr ~/_firejail_test_dir\r"
45after 100
46
47puts "\nall done\n"
diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp
index 8403b8442..b5d205780 100755
--- a/test/fs/private-bin.exp
+++ b/test/fs/private-bin.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -68,19 +68,19 @@ send -- "exit\r"
68after 100 68after 100
69 69
70 70
71send -- "firejail --debug --private-bin=/etc/shadow \r" 71send -- "firejail --private-bin=/etc/shadow\r"
72expect { 72expect {
73 timeout {puts "TESTING ERROR 13\n";exit} 73 timeout {puts "TESTING ERROR 13\n";exit}
74 "Warning: file /etc/shadow not found" 74 "Warning: invalid private-bin path /etc/shadow"
75} 75}
76after 100 76after 300
77 77
78send -- "firejail --private-bin=\"bla;bla\"\r" 78send -- "firejail --private-bin=\"bla;bla\"\r"
79expect { 79expect {
80 timeout {puts "TESTING ERROR 14\n";exit} 80 timeout {puts "TESTING ERROR 14\n";exit}
81 "is an invalid filename" 81 "is an invalid filename"
82} 82}
83after 100 83after 300
84 84
85send -- "firejail --private-etc=../bin/ls\r" 85send -- "firejail --private-etc=../bin/ls\r"
86expect { 86expect {
@@ -88,5 +88,5 @@ expect {
88 "is an invalid filename" 88 "is an invalid filename"
89} 89}
90 90
91after 100 91after 300
92puts "\nall done\n" 92puts "\nall done\n"
diff --git a/test/fs/private-cache.exp b/test/fs/private-cache.exp
new file mode 100755
index 000000000..3244c21c1
--- /dev/null
+++ b/test/fs/private-cache.exp
@@ -0,0 +1,42 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "mkdir --mode=700 ~/.cache\r"
11after 100
12
13send -- "touch ~/.cache/abcdefg\r"
14after 100
15
16if { ! [file exists ~/.cache/abcdefg] } {
17 puts "TESTING ERROR 0\n"
18 exit
19}
20
21send -- "firejail --noprofile --private-cache\r"
22expect {
23 timeout {puts "TESTING ERROR 1\n";exit}
24 "Child process initialized"
25}
26sleep 1
27
28send -- "ls -l ~/.cache\r"
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 "total 0"
32}
33after 100
34
35send -- "exit\r"
36sleep 1
37
38# cleanup
39send -- "rm ~/.cache/abcdefg\r"
40after 100
41
42puts "\nall done\n"
diff --git a/test/fs/private-cwd.exp b/test/fs/private-cwd.exp
new file mode 100755
index 000000000..54804a6a6
--- /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-2021 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/fs/private-etc-empty.exp b/test/fs/private-etc-empty.exp
index b91da07f3..9be18f9bd 100755
--- a/test/fs/private-etc-empty.exp
+++ b/test/fs/private-etc-empty.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fs/private-etc.exp b/test/fs/private-etc.exp
index a2223b593..7d0e9f619 100755
--- a/test/fs/private-etc.exp
+++ b/test/fs/private-etc.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -64,9 +64,6 @@ expect {
64} 64}
65after 100 65after 100
66 66
67 67send -- "exit\r"
68
69
70
71after 100 68after 100
72puts "\nall done\n" 69puts "\nall done\n"
diff --git a/test/fs/private-home-dir.exp b/test/fs/private-home-dir.exp
index 9c97ff4ea..bd8cab16f 100755
--- a/test/fs/private-home-dir.exp
+++ b/test/fs/private-home-dir.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -21,13 +21,13 @@ if {[file exists ~/.Xauthority]} {
21 send -- "touch ~/.Xauthority\r" 21 send -- "touch ~/.Xauthority\r"
22} 22}
23after 100 23after 100
24send -- "rm -fr ~/_firejail_test_dir_\r" 24send -- "rm -fr ~/_firejail_test_dir1_\r"
25after 100 25after 100
26send -- "mkdir ~/_firejail_test_dir_\r" 26send -- "mkdir ~/_firejail_test_dir1_\r"
27sleep 1 27sleep 1
28 28
29# testing profile and private 29# testing profile and private
30send -- "firejail --private=~/_firejail_test_dir_\r" 30send -- "firejail --private=~/_firejail_test_dir1_\r"
31expect { 31expect {
32 timeout {puts "TESTING ERROR 0\n";exit} 32 timeout {puts "TESTING ERROR 0\n";exit}
33 "Child process initialized" 33 "Child process initialized"
@@ -64,41 +64,15 @@ sleep 1
64send -- "firejail --private=/etc\r" 64send -- "firejail --private=/etc\r"
65expect { 65expect {
66 timeout {puts "TESTING ERROR 5\n";exit} 66 timeout {puts "TESTING ERROR 5\n";exit}
67 "private directory should be owned by the current user" 67 "private directory is not owned by the current user"
68} 68}
69sleep 1 69sleep 1
70send -- "mkdir ~/_firejail_test_dir_/test_dir_2\r" 70send -- "mkdir ~/_firejail_test_dir1_/test_dir_2\r"
71after 100 71after 100
72send -- "touch ~/_firejail_test_dir_/test_dir_2/testfile\r" 72send -- "touch ~/_firejail_test_dir1_/test_dir_2/testfile\r"
73sleep 1 73sleep 1
74 74
75send -- "firejail --debug --noprofile --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r" 75send -- "firejail --debug --noprofile --blacklist=~/test_dir_2 --private=~/_firejail_test_dir1_\r"
76expect {
77 timeout {puts "TESTING ERROR 6\n";exit}
78 "Not blacklist"
79}
80expect {
81 timeout {puts "TESTING ERROR 7\n";exit}
82 "test_dir_2"
83}
84expect {
85 timeout {puts "TESTING ERROR 8\n";exit}
86 "Child process initialized"
87}
88
89sleep 1
90
91send -- "find ~\r"
92expect {
93 timeout {puts "TESTING ERROR 9\n";exit}
94 "testfile"
95}
96after 100
97
98send -- "exit\r"
99sleep 1
100
101send -- "firejail --debug --noprofile --allow-private-blacklist --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r"
102expect { 76expect {
103 timeout {puts "TESTING ERROR 10\n";exit} 77 timeout {puts "TESTING ERROR 10\n";exit}
104 "Disable" 78 "Disable"
@@ -124,7 +98,8 @@ after 100
124send "exit\r" 98send "exit\r"
125sleep 1 99sleep 1
126 100
127send -- "rm -fr ~/_firejail_test_dir_\r" 101send -- "rm -fr ~/_firejail_test_dir1\r"
128after 100 102after 100
129 103
104
130puts "\nall done\n" 105puts "\nall done\n"
diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp
index 11fd52563..6fbe8b0f6 100755
--- a/test/fs/private-home.exp
+++ b/test/fs/private-home.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -95,8 +95,19 @@ expect {
95 "broken symbolic link" 95 "broken symbolic link"
96} 96}
97send -- "exit\r" 97send -- "exit\r"
98sleep 1
98 99
99send -- "rm -f ~/_firejail_test*\r" 100send -- "echo cleanup\r"
101after 100
102send -- "rm -f ~/_firejail_test_file1\r"
103after 100
104send -- "rm -f ~/_firejail_test_file2\r"
105after 100
106send -- "rm -fr ~/_firejail_test_dir1\r"
107after 100
108send -- "rm -f ~/_firejail_test_link1\r"
109after 100
110send -- "rm -f ~/_firejail_test_link2\r"
100after 100 111after 100
101 112
102puts "\nall done\n" 113puts "\nall done\n"
diff --git a/test/fs/private-homedir.exp b/test/fs/private-homedir.exp
index 78dfdc1c4..78fb705ec 100755
--- a/test/fs/private-homedir.exp
+++ b/test/fs/private-homedir.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fs/private-lib.exp b/test/fs/private-lib.exp
index dd418da0f..f32affabb 100755
--- a/test/fs/private-lib.exp
+++ b/test/fs/private-lib.exp
@@ -1,38 +1,42 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6
6set timeout 10 7set timeout 10
7spawn $env(SHELL) 8spawn $env(SHELL)
8match_max 100000 9match_max 100000
9 10
10send -- "firejail --private-lib --private-bin=sh,bash,dash,ps,grep,ls,find,echo \r" 11send -- "firejail --private-lib --private-bin=sh,bash,dash,ps,grep,ls,find,echo,stty \r"
11expect { 12expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized" 14 "Child process initialized"
14} 15}
15after 100 16after 100
17send -- "stty -echo\r"
18after 100
16 19
17send -- "find /bin; echo done\r" 20send -- "cd /bin; find .\; echo done\r"
18expect { 21expect {
19 timeout {puts "TESTING ERROR 2\n";exit} 22 timeout {puts "TESTING ERROR 2\n";exit}
23# "grep" {puts "TESTING ERROR 3\n";exit}
20 "rm" {puts "TESTING ERROR 3\n";exit} 24 "rm" {puts "TESTING ERROR 3\n";exit}
21 "cp" {puts "TESTING ERROR 4\n";exit} 25 "cp" {puts "TESTING ERROR 4\n";exit}
22 "done" 26 "done"
23} 27}
24after 100 28after 100
25 29
26send -- "find /lib; echo done\r" 30send -- "cd /lib; find .\r"
27expect { 31expect {
28 timeout {puts "TESTING ERROR 5\n";exit} 32 timeout {puts "TESTING ERROR 5\n";exit}
29 "modules" {puts "TESTING ERROR 6\n";exit} 33 "./modules" {puts "TESTING ERROR 6\n";exit}
30 "firmware" {puts "TESTING ERROR 7\n";exit} 34 "./firmware" {puts "TESTING ERROR 7\n";exit}
31 "libc.so" 35 "libc.so"
32} 36}
33after 100 37after 100
34 38
35send -- "find /usr/lib; echo done\r" 39send -- "cd /usr/lib; find .\r"
36expect { 40expect {
37 timeout {puts "TESTING ERROR 8\n";exit} 41 timeout {puts "TESTING ERROR 8\n";exit}
38 "grub" {puts "TESTING ERROR 9\n";exit} 42 "grub" {puts "TESTING ERROR 9\n";exit}
diff --git a/test/fs/private-whitelist.exp b/test/fs/private-whitelist.exp
index bbb1a757c..1879a3d54 100755
--- a/test/fs/private-whitelist.exp
+++ b/test/fs/private-whitelist.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fs/private.exp b/test/fs/private.exp
index e522ca5a1..d4f7fc893 100755
--- a/test/fs/private.exp
+++ b/test/fs/private.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fs/read-write.exp b/test/fs/read-write.exp
index c648f83dd..6c0f755da 100755
--- a/test/fs/read-write.exp
+++ b/test/fs/read-write.exp
@@ -1,12 +1,20 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14send -- "mkdir ~/_firejail_test_dir/test1\r"
15after 100
16send -- "touch ~/_firejail_test_dir/test1/b\r"
17after 100
10 18
11send -- "firejail --read-only=~/_firejail_test_dir --read-write=~/_firejail_test_dir/test1\r" 19send -- "firejail --read-only=~/_firejail_test_dir --read-write=~/_firejail_test_dir/test1\r"
12expect { 20expect {
@@ -32,4 +40,9 @@ expect {
32} 40}
33 41
34after 100 42after 100
43send -- "exit\r"
44sleep 1
45
46send -- "rm -fr ~/_firejail_test_dir\r"
47after 100
35puts "\nall done\n" 48puts "\nall done\n"
diff --git a/test/fs/sys_fs.exp b/test/fs/sys_fs.exp
index 23ae410be..de7fadf6c 100755
--- a/test/fs/sys_fs.exp
+++ b/test/fs/sys_fs.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/fs/testdir1/.file b/test/fs/testdir1/.file
deleted file mode 100644
index e69de29bb..000000000
--- a/test/fs/testdir1/.file
+++ /dev/null
diff --git a/test/fs/testfile1 b/test/fs/testfile1
deleted file mode 100644
index e69de29bb..000000000
--- a/test/fs/testfile1
+++ /dev/null
diff --git a/test/fs/user-dirs.dirs b/test/fs/user-dirs.dirs
deleted file mode 100644
index ea3a3a4c2..000000000
--- a/test/fs/user-dirs.dirs
+++ /dev/null
@@ -1,15 +0,0 @@
1# This file is written by xdg-user-dirs-update
2# If you want to change or add directories, just edit the line you're
3# interested in. All local changes will be retained on the next run
4# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
5# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
6# absolute path. No other format is supported.
7#
8XDG_DESKTOP_DIR="$HOME/Desktop"
9XDG_DOWNLOAD_DIR="$HOME/Downloads"
10XDG_TEMPLATES_DIR="$HOME/Templates"
11XDG_PUBLICSHARE_DIR="$HOME/Public"
12XDG_DOCUMENTS_DIR="$HOME/Documents"
13XDG_MUSIC_DIR="$HOME/Music"
14XDG_PICTURES_DIR="$HOME/Pictures"
15XDG_VIDEOS_DIR="$HOME/Videos"
diff --git a/test/fs/whitelist-dev.exp b/test/fs/whitelist-dev.exp
index b6ae6319f..d0466bbeb 100755
--- a/test/fs/whitelist-dev.exp
+++ b/test/fs/whitelist-dev.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -14,26 +14,26 @@ expect {
14} 14}
15sleep 1 15sleep 1
16 16
17send -- "find /dev | wc -l\r" 17send -- "ls /dev | wc -l\r"
18expect { 18expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
20 "2" 20 "1"
21} 21}
22after 100 22after 100
23send -- "exit\r" 23send -- "exit\r"
24sleep 1 24sleep 1
25 25
26send -- "firejail --whitelist=/dev/null --whitelist=/dev/shm --whitelist=/dev/random\r" 26send -- "firejail --whitelist=/dev/null --whitelist=/dev/random\r"
27expect { 27expect {
28 timeout {puts "TESTING ERROR 2\n";exit} 28 timeout {puts "TESTING ERROR 2\n";exit}
29 "Child process initialized" 29 "Child process initialized"
30} 30}
31sleep 1 31sleep 1
32 32
33send -- "find /dev | wc -l\r" 33send -- "ls /dev | wc -l\r"
34expect { 34expect {
35 timeout {puts "TESTING ERROR 3\n";exit} 35 timeout {puts "TESTING ERROR 3\n";exit}
36 "4" 36 "2"
37} 37}
38after 100 38after 100
39send -- "exit\r" 39send -- "exit\r"
@@ -46,9 +46,11 @@ expect {
46} 46}
47sleep 1 47sleep 1
48 48
49send -- "ls -l /dev | wc -l\r" 49send -- "ls /dev | wc -l\r"
50expect { 50expect {
51 timeout {puts "TESTING ERROR 5\n";exit} 51 timeout {puts "TESTING ERROR 5\n";exit}
52 "10" {puts "OK\n"}
53 "11" {puts "OK\n"}
52 "12" {puts "OK\n"} 54 "12" {puts "OK\n"}
53 "13" {puts "OK\n"} 55 "13" {puts "OK\n"}
54 "14" {puts "OK\n"} 56 "14" {puts "OK\n"}
@@ -56,6 +58,12 @@ expect {
56 "16" {puts "OK\n"} 58 "16" {puts "OK\n"}
57 "17" {puts "OK\n"} 59 "17" {puts "OK\n"}
58 "18" {puts "OK\n"} 60 "18" {puts "OK\n"}
61 "19" {puts "OK\n"}
62 "20" {puts "OK\n"}
63 "21" {puts "OK\n"}
64 "22" {puts "OK\n"}
65 "23" {puts "OK\n"}
66 "24" {puts "OK\n"}
59} 67}
60after 100 68after 100
61 69
diff --git a/test/fs/whitelist-double.exp b/test/fs/whitelist-double.exp
index ac6adc165..e653517a6 100755
--- a/test/fs/whitelist-double.exp
+++ b/test/fs/whitelist-double.exp
@@ -1,23 +1,23 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "echo 123 > /tmp/firejal-deleteme\r" 10send -- "echo 123 > /tmp/_firejail_test_file\r"
11sleep 1 11sleep 1
12 12
13send -- "firejail --whitelist=/tmp/firejal-deleteme --whitelist=/tmp/firejal-deleteme\r" 13send -- "firejail --whitelist=/tmp/_firejail_test_file --whitelist=/tmp/_firejail_test_file\r"
14expect { 14expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized" 16 "Child process initialized"
17} 17}
18sleep 1 18sleep 1
19 19
20send -- "cat /tmp/firejal-deleteme\r" 20send -- "cat /tmp/_firejail_test_file\r"
21expect { 21expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 22 timeout {puts "TESTING ERROR 1\n";exit}
23 "123" 23 "123"
@@ -26,13 +26,13 @@ expect {
26send -- "exit\r" 26send -- "exit\r"
27sleep 1 27sleep 1
28 28
29send -- "cat /tmp/firejal-deleteme\r" 29send -- "cat /tmp/_firejail_test_file\r"
30expect { 30expect {
31 timeout {puts "TESTING ERROR 2\n";exit} 31 timeout {puts "TESTING ERROR 2\n";exit}
32 "123" 32 "123"
33} 33}
34 34
35send -- "rm -v /tmp/firejal-deleteme\r" 35send -- "rm -v /tmp/_firejail_test_file\r"
36expect { 36expect {
37 timeout {puts "TESTING ERROR 3\n";exit} 37 timeout {puts "TESTING ERROR 3\n";exit}
38 "removed" 38 "removed"
diff --git a/test/fs/whitelist-downloads.exp b/test/fs/whitelist-downloads.exp
deleted file mode 100755
index ab411ca08..000000000
--- a/test/fs/whitelist-downloads.exp
+++ /dev/null
@@ -1,48 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "cp user-dirs.dirs /tmp/.\r"
11after 100
12
13send -- "firejail --private --noprofile\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18after 100
19
20send -- "firejail --force --ignore=shell --profile=/etc/firejail/firefox.profile\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "cannot whitelist Downloads directory"
24}
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "Child process initialized"
28}
29after 100
30
31send -- "exit\r"
32after 100
33
34send -- "cp /tmp/user-dirs.dirs ~/.config/.\r"
35after 100
36
37send -- "firejail --force --ignore=shell --profile=/etc/firejail/firefox.profile\r"
38expect {
39 timeout {puts "TESTING ERROR 3\n";exit}
40 "cannot whitelist Downloads directory"
41}
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46after 100
47
48puts "\nall done\n"
diff --git a/test/fs/whitelist-empty.exp b/test/fs/whitelist-empty.exp
index 9e4406263..dbc04cf30 100755
--- a/test/fs/whitelist-empty.exp
+++ b/test/fs/whitelist-empty.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 30 6set timeout 30
diff --git a/test/fs/whitelist-noexec.exp b/test/fs/whitelist-noexec.exp
new file mode 100755
index 000000000..e1c39b66f
--- /dev/null
+++ b/test/fs/whitelist-noexec.exp
@@ -0,0 +1,36 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set PWD $env(PWD)
10
11
12send -- "firejail --noprofile --whitelist=$PWD --noexec=$PWD\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "Child process initialized"
16}
17sleep 1
18
19send -- "ls $PWD\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "whitelist-noexec.exp"
23}
24after 100
25
26send -- "$PWD/whitelist-noexec.exp\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "Permission denied"
30}
31after 100
32
33send -- "exit\r"
34sleep 1
35
36puts "\nall done\n"
diff --git a/test/fs/whitelist-readonly.exp b/test/fs/whitelist-readonly.exp
new file mode 100755
index 000000000..f9d78b7c0
--- /dev/null
+++ b/test/fs/whitelist-readonly.exp
@@ -0,0 +1,38 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14send -- "mkdir ~/_firejail_test_dir/test1\r"
15after 100
16send -- "touch ~/_firejail_test_dir/test1/b\r"
17after 100
18
19send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "Child process initialized"
23}
24sleep 1
25
26send -- "echo mytest > ~/_firejail_test_dir/a\r"
27expect {
28 timeout {puts "TESTING ERROR 1\n";exit}
29 "Read-only file system"
30}
31after 100
32
33send -- "exit\r"
34sleep 1
35
36send -- "rm -fr ~/_firejail_test_dir\r"
37after 100
38puts "\nall done\n"
diff --git a/test/fs/whitelist-whitespace.exp b/test/fs/whitelist-whitespace.exp
new file mode 100755
index 000000000..1b1c4c1cb
--- /dev/null
+++ b/test/fs/whitelist-whitespace.exp
@@ -0,0 +1,37 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch ~/filewith\\\ \\\ many\\\ whitespaces\\\ \r"
11after 100
12
13send -- "firejail --noprofile --whitelist=~/filewith\\\ \\\ many\\\ whitespaces\\\ \r"
14expect {
15 timeout {puts "TESTING ERROR 1\n";exit}
16 "Child process initialized"
17}
18sleep 1
19
20send -- "ls ~\r"
21expect {
22 timeout {puts "TESTING ERROR 3\n";exit}
23 "filewith many whitespaces "
24}
25after 100
26
27send -- "exit\r"
28sleep 1
29
30send -- "rm -v ~/filewith\\\ \\\ many\\\ whitespaces\\\ \r"
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "removed"
34}
35after 100
36
37puts "\nall done\n"
diff --git a/test/fs/whitelist.exp b/test/fs/whitelist.exp
index 2988209d3..dcc2276b8 100755
--- a/test/fs/whitelist.exp
+++ b/test/fs/whitelist.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -16,10 +16,7 @@ send -- "rm ~/fjtest-file\r"
16after 200 16after 200
17send -- "rm ~/fjtest-file-lnk\r" 17send -- "rm ~/fjtest-file-lnk\r"
18after 200 18after 200
19send -- "rm /tmp/fjtest-file\r" 19
20after 200
21send -- "rm -fr /tmp/fjtest-dir\r"
22after 200
23 20
24 21
25# simple files and directories 22# simple files and directories
@@ -149,63 +146,7 @@ expect {
149send -- "exit\r" 146send -- "exit\r"
150sleep 1 147sleep 1
151 148
152# symlinks outside home to a file we don't own
153send -- "rm ~/fjtest-file-lnk\r"
154after 200
155send -- "ln -s /etc/passwd ~/fjtest-file-lnk\r"
156after 200
157send -- "firejail --whitelist=~/fjtest-file-lnk --whitelist=~/fjtest-dir-lnk\r"
158expect {
159 timeout {puts "TESTING ERROR 30\n";exit}
160 "invalid whitelist path"
161}
162expect {
163 timeout {puts "TESTING ERROR 31\n";exit}
164 "cannot sync with peer"
165}
166sleep 1
167
168# symlinks outside home to a file we own
169send -- "rm -fr ~/fjtest-dir-lnk\r"
170after 200
171send -- "rm ~/fjtest-file-lnk\r"
172after 200
173send -- "echo 123 > /tmp/fjtest-file\r"
174after 200
175send -- "mkdir /tmp/fjtest-dir\r"
176after 200
177send -- "echo 123 > /tmp/fjtest-dir/fjtest-file\r"
178after 200
179send -- "ln -s /tmp/fjtest-file ~/fjtest-file-lnk\r"
180after 200
181send -- "ln -s /tmp/fjtest-dir ~/fjtest-dir-lnk\r"
182after 200
183send -- "firejail --whitelist=~/fjtest-file-lnk --whitelist=~/fjtest-dir-lnk\r"
184expect {
185 timeout {puts "TESTING ERROR 40\n";exit}
186 "Child process initialized"
187}
188sleep 1
189
190send -- "ls -l ~/ | grep -v total | wc -l\r"
191expect {
192 timeout {puts "TESTING ERROR 41\n";exit}
193 "2"
194}
195 149
196send -- "cat ~/fjtest-file-lnk\r"
197expect {
198 timeout {puts "TESTING ERROR 42\n";exit}
199 "123"
200}
201
202send -- "cat ~/fjtest-dir-lnk/fjtest-file\r"
203expect {
204 timeout {puts "TESTING ERROR 43\n";exit}
205 "123"
206}
207send -- "exit\r"
208sleep 1
209 150
210# cleanup 151# cleanup
211send -- "rm -fr ~/fjtest-dir\r" 152send -- "rm -fr ~/fjtest-dir\r"
@@ -216,10 +157,5 @@ send -- "rm ~/fjtest-file\r"
216after 200 157after 200
217send -- "rm ~/fjtest-file-lnk\r" 158send -- "rm ~/fjtest-file-lnk\r"
218after 200 159after 200
219send -- "rm /tmp/fjtest-file\r"
220after 200
221send -- "rm -fr /tmp/fjtest-dir\r"
222after 200
223
224 160
225puts "\nall done\n" 161puts "\nall done\n"
diff --git a/test/fs_chroot_asroot.exp b/test/fs_chroot_asroot.exp
deleted file mode 100755
index 000ce96f7..000000000
--- a/test/fs_chroot_asroot.exp
+++ /dev/null
@@ -1,90 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --chroot=/tmp/chroot\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "cd /home;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 0.1\n";exit}
17 "home"
18}
19sleep 1
20send -- "bash\r"
21sleep 1
22send -- "ls /; pwd\r"
23expect {
24 timeout {puts "TESTING ERROR 0.2\n";exit}
25 "this-is-my-chroot"
26}
27expect {
28 timeout {puts "TESTING ERROR 0.3\n";exit}
29 "home"
30}
31
32send -- "umount /boot; pwd\r"
33expect {
34 timeout {puts "TESTING ERROR 0.4\n";exit}
35 "Bad system call"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.5\n";exit}
39 "home"
40}
41
42send -- "/unchroot; pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 0.6\n";exit}
45 "Bad system call"
46}
47expect {
48 timeout {puts "TESTING ERROR 0.7\n";exit}
49 "home"
50}
51
52
53
54
55
56send -- "ps aux; pwd\r"
57expect {
58 timeout {puts "TESTING ERROR 1\n";exit}
59 "/bin/bash"
60}
61expect {
62 timeout {puts "TESTING ERROR 2\n";exit}
63 "bash"
64}
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "ps aux"
68}
69expect {
70 timeout {puts "TESTING ERROR 4\n";exit}
71 "home"
72}
73sleep 1
74
75
76send -- "ps aux |wc -l; pwd\r"
77expect {
78 timeout {puts "TESTING ERROR 5\n";exit}
79 "6"
80}
81expect {
82 timeout {puts "TESTING ERROR 6\n";exit}
83 "home"
84}
85sleep 1
86
87
88
89
90puts "all done\n"
diff --git a/test/fs_sys.exp b/test/fs_sys.exp
deleted file mode 100755
index 05023994c..000000000
--- a/test/fs_sys.exp
+++ /dev/null
@@ -1,33 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --net=br0\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "find /sys | grep --color=never eth0;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 2\n";exit}
17 "/sys/class/net/eth0"
18}
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "home"
22}
23sleep 1
24
25send -- "find /sys | grep --color=never br0;pwd\r"
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "/sys/class/net/br0" {puts "TESTING ERROR 5\n";exit}
29 "home"
30}
31sleep 1
32
33puts "\n"
diff --git a/test/fscheck-blacklist.exp b/test/fscheck-blacklist.exp
deleted file mode 100755
index c71d1fdfd..000000000
--- a/test/fscheck-blacklist.exp
+++ /dev/null
@@ -1,13 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --blacklist=../test/fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
diff --git a/test/fscheck-chroot.exp b/test/fscheck-chroot.exp
deleted file mode 100755
index 00013e462..000000000
--- a/test/fscheck-chroot.exp
+++ /dev/null
@@ -1,77 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8#send -- "firejail --net=br0 --chroot=fscheck-dir\r"
9#expect {
10# timeout {puts "TESTING ERROR 0\n";exit}
11# "Error"
12#}
13#after 100
14
15# ..
16send -- "firejail --net=br0 --chroot=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --chroot=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --chroot=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --chroot=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# file
48send -- "firejail --net=br0 --chroot=fscheck-file\r"
49expect {
50 timeout {puts "TESTING ERROR 2.1\n";exit}
51 "Error"
52}
53after 100
54
55# ..
56send -- "firejail --net=br0 --chroot=../test/fscheck-file\r"
57expect {
58 timeout {puts "TESTING ERROR 2.2\n";exit}
59 "Error"
60}
61after 100
62
63# no file
64send -- "firejail --net=br0 --chroot=../test/nodir\r"
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "Error"
68}
69after 100
70
71# same owner
72#send -- "firejail --net=br0 --chroot=/etc\r"
73#expect {
74# timeout {puts "TESTING ERROR 4\n";exit}
75# "Error"
76#}
77#after 100
diff --git a/test/fscheck-netfilter.exp b/test/fscheck-netfilter.exp
deleted file mode 100755
index d2339c8b9..000000000
--- a/test/fscheck-netfilter.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --netfilter=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --netfilter=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --netfilter=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --netfilter=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --netfilter=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# ..
48send -- "firejail --net=br0 --netfilter=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 2\n";exit}
51 "Error"
52}
53after 100
54
55# no file
56send -- "firejail --net=br0 --netfilter=../test/nofile\r"
57expect {
58 timeout {puts "TESTING ERROR 3\n";exit}
59 "Error"
60}
61after 100
62
63# real GID/UID
64send -- "firejail --net=br0 --netfilter=/etc/shadow\r"
65expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 "Error"
68}
69after 100
diff --git a/test/fscheck-output.exp b/test/fscheck-output.exp
deleted file mode 100755
index 0b444d6ba..000000000
--- a/test/fscheck-output.exp
+++ /dev/null
@@ -1,104 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --output=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --output=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --output=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --output=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --output=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# ..
48send -- "firejail --net=br0 --output=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 2.1\n";exit}
51 "Error"
52}
53after 100
54
55# hard link1
56send -- "firejail --net=br0 --output=fscheck-file-hard1\r"
57expect {
58 timeout {puts "TESTING ERROR 2.2\n";exit}
59 "Error"
60}
61after 100
62
63# hard link2
64send -- "firejail --net=br0 --output=fscheck-file-hard2\r"
65expect {
66 timeout {puts "TESTING ERROR 2.3\n";exit}
67 "Error"
68}
69after 100
70
71# ..
72send -- "firejail --net=br0 --output=../test/fscheck-file-hard1\r"
73expect {
74 timeout {puts "TESTING ERROR 2.4\n";exit}
75 "Error"
76}
77after 100
78
79# ..
80send -- "firejail --net=br0 --output=../test/fscheck-file-hard2\r"
81expect {
82 timeout {puts "TESTING ERROR 2.5\n";exit}
83 "Error"
84}
85after 100
86
87
88
89
90# no file
91send -- "firejail --net=br0 --output=../test/nofile\r"
92expect {
93 timeout {puts "TESTING ERROR 3\n";exit}
94 "Error"
95}
96after 100
97
98# real GID/UID
99send -- "firejail --net=br0 --output=/etc/shadow\r"
100expect {
101 timeout {puts "TESTING ERROR 4\n";exit}
102 "Error"
103}
104after 100
diff --git a/test/fscheck-privatekeep.exp b/test/fscheck-privatekeep.exp
deleted file mode 100755
index 6cbf98d96..000000000
--- a/test/fscheck-privatekeep.exp
+++ /dev/null
@@ -1,93 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8#send -- "firejail --net=br0 --private-home=fscheck-dir\r"
9#expect {
10# timeout {puts "TESTING ERROR 0\n";exit}
11# "Error"
12#}
13#after 100
14
15# ..
16send -- "firejail --net=br0 --private-home=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --private-home=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --private-home=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --private-home=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# file
48#send -- "firejail --net=br0 --private-home=fscheck-file\r"
49#expect {
50# timeout {puts "TESTING ERROR 2.1\n";exit}
51# "Error"
52#}
53#after 100
54
55# ..
56send -- "firejail --net=br0 --private-home=../test/fscheck-file\r"
57expect {
58 timeout {puts "TESTING ERROR 2.2\n";exit}
59 "Error"
60}
61after 100
62
63# no dir
64send -- "firejail --net=br0 --private-home=../test/nodir\r"
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "Error"
68}
69after 100
70
71# no file
72send -- "firejail --net=br0 --private-home=../test/nofile\r"
73expect {
74 timeout {puts "TESTING ERROR 3.1\n";exit}
75 "Error"
76}
77after 100
78
79# same owner
80send -- "firejail --net=br0 --private=/etc\r"
81expect {
82 timeout {puts "TESTING ERROR 4\n";exit}
83 "Error"
84}
85after 100
86
87# same owner
88send -- "firejail --net=br0 --private=/etc/shadow\r"
89expect {
90 timeout {puts "TESTING ERROR 4\n";exit}
91 "Error"
92}
93after 100
diff --git a/test/fscheck-profile.exp b/test/fscheck-profile.exp
deleted file mode 100755
index d7d7c7cd1..000000000
--- a/test/fscheck-profile.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --profile=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --profile=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --profile=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --profile=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --profile=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# ..
48send -- "firejail --net=br0 --profile=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 2\n";exit}
51 "Error"
52}
53after 100
54
55# no file
56send -- "firejail --net=br0 --profile=../test/nofile\r"
57expect {
58 timeout {puts "TESTING ERROR 3\n";exit}
59 "Error"
60}
61after 100
62
63# real GID/UID
64send -- "firejail --net=br0 --profile=/etc/shadow\r"
65expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 "Error"
68}
69after 100
diff --git a/test/fscheck-shell.exp b/test/fscheck-shell.exp
deleted file mode 100755
index 6a3b5829c..000000000
--- a/test/fscheck-shell.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --shell=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --shell=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --shell=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --shell=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40#send -- "firejail --net=br0 --shell=fscheck-file-link\r"
41#expect {
42# timeout {puts "TESTING ERROR 4\n";exit}
43# "Error"
44#}
45#after 100
46
47# ..
48send -- "firejail --net=br0 --shell=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 5\n";exit}
51 "Error"
52}
53after 100
54
55# no file
56send -- "firejail --net=br0 --shell=../test/nofile\r"
57expect {
58 timeout {puts "TESTING ERROR 6\n";exit}
59 "Error"
60}
61after 100
62
63# real GID/UID
64send -- "firejail --net=br0 --shell=/etc/shadow\r"
65expect {
66 timeout {puts "TESTING ERROR 7\n";exit}
67 "Error"
68}
69after 100
diff --git a/test/fscheck.sh b/test/fscheck.sh
deleted file mode 100755
index 009f33043..000000000
--- a/test/fscheck.sh
+++ /dev/null
@@ -1,39 +0,0 @@
1#!/bin/bash
2
3mkdir fscheck-dir
4ln -s fscheck-dir fscheck-dir-link
5touch fscheck-file
6ln -s fscheck-file fscheck-file-link
7touch fscheck-file-hard1
8ln fscheck-file-hard1 fscheck-file-hard2
9
10echo "TESTING: fscheck netfilter"
11./fscheck-netfilter.exp
12echo "TESTING: fscheck shell"
13./fscheck-shell.exp
14echo "TESTING: fscheck private"
15./fscheck-private.exp
16echo "TESTING: fscheck private keep"
17./fscheck-privatekeep.exp
18echo "TESTING: fscheck profile"
19./fscheck-profile.exp
20echo "TESTING: fscheck chroot"
21./fscheck-chroot.exp
22echo "TESTING: fscheck output"
23./fscheck-output.exp
24echo "TESTING: fscheck bind nonroot"
25./fscheck-bindnoroot.exp
26echo "TESTING: fscheck tmpfs"
27./fscheck-tmpfs.exp
28echo "TESTING: fscheck readonly"
29./fscheck-readonly.exp
30echo "TESTING: fscheck blacklist"
31./fscheck-blacklist.exp
32
33
34rm -fr fscheck-dir
35rm -fr fscheck-dir-link
36rm -fr fscheck-file-link
37rm -fr fscheck-file
38rm -fr fscheck-file-hard1
39rm -fr fscheck-file-hard2
diff --git a/test/hidepid-howto b/test/hidepid-howto
new file mode 100644
index 000000000..0fa1e5d86
--- /dev/null
+++ b/test/hidepid-howto
@@ -0,0 +1,25 @@
11. Find an unused user group for hidepid exception:
2
3$ id
4uid=1000(netblue) gid=100(users) groups=100(users),10(wheel),90(network),
592(audio),93(optical),95(storage),98(power)
6
7From /etc/group I pick up a group I am not part of:
8
9$ cat /etc/group
10[...]
11xmms2:x:618:
12rtkit:x:133:
13vboxsf:x:109:
14git:x:617:
15[...]
16
17I'll use group 618 (xmms2)
18
192. Set hidepid and allow xmms2 users to bypass hidepid
20
21$ sudo mount -o remount,rw,hidepid=2,gid=618 /proc
22$ cat /proc/mounts | grep proc
23proc /proc proc rw,nosuid,nodev,noexec,relatime,gid=618,hidepid=2 0 0
24
253. Test "firejail --list", "firejail --top", "firejail --tree", "firejail --netstats"
diff --git a/test/login_ssh.exp b/test/login_ssh.exp
deleted file mode 100755
index db0721d25..000000000
--- a/test/login_ssh.exp
+++ /dev/null
@@ -1,59 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "ssh bingo@0\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "password:" {
11 puts "\nTESTING: please enter SSH password"
12 set oldmode [stty -echo -raw]
13 expect_user -re "(.*)\n"
14 send_user "\n"
15 eval stty $oldmode
16# stty echo
17 set pass $expect_out(1,string)
18 send -- "$pass\r"
19 puts "TESTING: password sent to the server"
20 }
21 "Child process initialized"
22}
23sleep 1
24
25# test default gw
26send -- "bash\r"
27sleep 1
28send -- "ps aux; pwd\r"
29expect {
30 timeout {puts "TESTING ERROR 1\n";exit}
31 "/bin/bash"
32}
33expect {
34 timeout {puts "TESTING ERROR 2\n";exit}
35 "bash"
36}
37expect {
38 timeout {puts "TESTING ERROR 3\n";exit}
39 "ps aux"
40}
41expect {
42 timeout {puts "TESTING ERROR 4\n";exit}
43 "home"
44}
45sleep 1
46
47
48send -- "ps aux |wc -l; pwd\r"
49expect {
50 timeout {puts "TESTING ERROR 5\n";exit}
51 "6"
52}
53expect {
54 timeout {puts "TESTING ERROR 6\n";exit}
55 "home"
56}
57sleep 1
58
59puts "\nall done\n"
diff --git a/test/network/4bridges_arp.exp b/test/network/4bridges_arp.exp
index 88b06ee3d..d608128f8 100755
--- a/test/network/4bridges_arp.exp
+++ b/test/network/4bridges_arp.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/4bridges_ip.exp b/test/network/4bridges_ip.exp
index e7308c106..586dfcba9 100755
--- a/test/network/4bridges_ip.exp
+++ b/test/network/4bridges_ip.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/README b/test/network/README
index 4404c53b0..1e215b41e 100644
--- a/test/network/README
+++ b/test/network/README
@@ -1,7 +1,7 @@
1Warning: this test requires root access to configure a number of bridge, mac 1Warning: this test requires root access to configure a number of bridge, mac
2and vlan devices. Please take a look at configure file. By the time you are 2and vlan devices. Please take a look at configure file. By the time you are
3finished testing, you'll probably have to reboot the computer to get your 3finished testing, you'll probably have to reboot the computer to get your
4networking subsytem back to normal. 4networking subsystem back to normal.
5 5
6Limitations - to be investigated and fixed: 6Limitations - to be investigated and fixed:
7 - the test is assuming an eth0 wired interface to be present 7 - the test is assuming an eth0 wired interface to be present
diff --git a/test/network/bandwidth.exp b/test/network/bandwidth.exp
index 25845c728..d73669ebe 100755
--- a/test/network/bandwidth.exp
+++ b/test/network/bandwidth.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -50,10 +50,13 @@ sleep 1
50send -- "firejail --bandwidth=test clear br0\r" 50send -- "firejail --bandwidth=test clear br0\r"
51expect { 51expect {
52 timeout {puts "TESTING ERROR 7\n";exit} 52 timeout {puts "TESTING ERROR 7\n";exit}
53 "Removing bandwith limits" 53 "Removing bandwidth limits"
54} 54}
55sleep 1 55sleep 1
56 56
57send -- "stty -echo\r"
58after 100
59
57send -- "firejail --bandwidth=test status; echo done\r" 60send -- "firejail --bandwidth=test status; echo done\r"
58expect { 61expect {
59 timeout {puts "TESTING ERROR 8\n";exit} 62 timeout {puts "TESTING ERROR 8\n";exit}
diff --git a/test/network/configure b/test/network/configure
index 9d47fe69e..f75e9b23f 100755
--- a/test/network/configure
+++ b/test/network/configure
@@ -1,6 +1,6 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6brctl addbr br0 6brctl addbr br0
@@ -10,6 +10,8 @@ iptables -t nat -A POSTROUTING -o eth0 -s 10.10.20.0/29 -j MASQUERADE
10# port forwarding 10# port forwarding
11# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.10.20.2:80 11# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.10.20.2:80
12 12
13brctl addbr br-unconfigured
14ifconfig br-unconfigured up
13brctl addbr br1 15brctl addbr br1
14ifconfig br1 10.10.30.1/24 up 16ifconfig br1 10.10.30.1/24 up
15brctl addbr br2 17brctl addbr br2
diff --git a/test/network/dns-print.exp b/test/network/dns-print.exp
index 9cdc14a6d..5ee4c0d19 100755
--- a/test/network/dns-print.exp
+++ b/test/network/dns-print.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/network/firemon-arp.exp b/test/network/firemon-arp.exp
index 71fa1660f..8e0a0b1b0 100755
--- a/test/network/firemon-arp.exp
+++ b/test/network/firemon-arp.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/network/firemon-interfaces.exp b/test/network/firemon-interfaces.exp
index f70d64dce..494496a26 100755
--- a/test/network/firemon-interfaces.exp
+++ b/test/network/firemon-interfaces.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/firemon-route.exp b/test/network/firemon-route.exp
index 19a705778..a1ded08c1 100755
--- a/test/network/firemon-route.exp
+++ b/test/network/firemon-route.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/network/hostname.exp b/test/network/hostname.exp
index 0acb6a5ac..825f1f6cf 100755
--- a/test/network/hostname.exp
+++ b/test/network/hostname.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -13,6 +13,8 @@ expect {
13 "Child process initialized" 13 "Child process initialized"
14} 14}
15sleep 1 15sleep 1
16send -- "stty -echo\r"
17after 100
16 18
17send -- "ping -c 3 bingo; echo done\r" 19send -- "ping -c 3 bingo; echo done\r"
18expect { 20expect {
diff --git a/test/network/interface.exp b/test/network/interface.exp
index f631b805b..78178e233 100755
--- a/test/network/interface.exp
+++ b/test/network/interface.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2# 5#
3# interface 6# interface
4# 7#
diff --git a/test/network/ip6.exp b/test/network/ip6.exp
index 26780e167..ed29964c6 100755
--- a/test/network/ip6.exp
+++ b/test/network/ip6.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -10,7 +10,7 @@ match_max 100000
10send -- "firejail --debug --noprofile --net=br0 --ip6=2001:0db8:0:f101::1/64 --netfilter6=ipv6.net\r" 10send -- "firejail --debug --noprofile --net=br0 --ip6=2001:0db8:0:f101::1/64 --netfilter6=ipv6.net\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Installing network filter" 13 "Installing IPv6 firewall"
14} 14}
15expect { 15expect {
16 timeout {puts "TESTING ERROR 1\n";exit} 16 timeout {puts "TESTING ERROR 1\n";exit}
@@ -46,10 +46,12 @@ send -- "exit\r"
46sleep 2 46sleep 2
47 47
48 48
49
50
49send -- "firejail --debug --profile=ip6.profile\r" 51send -- "firejail --debug --profile=ip6.profile\r"
50expect { 52expect {
51 timeout {puts "TESTING ERROR 10\n";exit} 53 timeout {puts "TESTING ERROR 10\n";exit}
52 "Installing network filter" 54 "Installing IPv6 firewall"
53} 55}
54expect { 56expect {
55 timeout {puts "TESTING ERROR 11\n";exit} 57 timeout {puts "TESTING ERROR 11\n";exit}
@@ -82,7 +84,17 @@ expect {
82} 84}
83 85
84send -- "exit\r" 86send -- "exit\r"
87sleep 2
85 88
89send -- "firejail --debug --netfilter6=ipv6.net\r"
90expect {
91 timeout {puts "TESTING ERROR 11\n";exit}
92 "Installing IPv6 firewall" {puts "TESTING ERROR 12\n";exit}
93 "Child process initialized"
94}
86after 100 95after 100
96send -- "exit\r"
87 97
98
99after 100
88puts "\nall done\n" 100puts "\nall done\n"
diff --git a/test/network/iprange.exp b/test/network/iprange.exp
index c8a96b560..2690a128a 100755
--- a/test/network/iprange.exp
+++ b/test/network/iprange.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -29,9 +29,9 @@ expect {
29 timeout {puts "TESTING ERROR 3\n";exit} 29 timeout {puts "TESTING ERROR 3\n";exit}
30 "Child process initialized" 30 "Child process initialized"
31} 31}
32sleep 1 32after 100
33send -- "exit\r" 33send -- "exit\r"
34sleep 2 34sleep 1
35 35
36send -- "firejail --profile=iprange.profile\r" 36send -- "firejail --profile=iprange.profile\r"
37expect { 37expect {
@@ -55,9 +55,9 @@ expect {
55 timeout {puts "TESTING ERROR 8\n";exit} 55 timeout {puts "TESTING ERROR 8\n";exit}
56 "Child process initialized" 56 "Child process initialized"
57} 57}
58sleep 1 58after 100
59send -- "exit\r" 59send -- "exit\r"
60sleep 2 60sleep 1
61 61
62 62
63 63
diff --git a/test/network/net_arp.exp b/test/network/net_arp.exp
index 98ed8d9f1..84912cddd 100755
--- a/test/network/net_arp.exp
+++ b/test/network/net_arp.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_badip.exp b/test/network/net_badip.exp
index 54f1858ca..b09f4d192 100755
--- a/test/network/net_badip.exp
+++ b/test/network/net_badip.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_defaultgw.exp b/test/network/net_defaultgw.exp
index 1eee2c252..19dd94dbd 100755
--- a/test/network/net_defaultgw.exp
+++ b/test/network/net_defaultgw.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_defaultgw2.exp b/test/network/net_defaultgw2.exp
index 58f8f9edd..4f5864822 100755
--- a/test/network/net_defaultgw2.exp
+++ b/test/network/net_defaultgw2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_defaultgw3.exp b/test/network/net_defaultgw3.exp
index 7762e98d6..dc3589c3c 100755
--- a/test/network/net_defaultgw3.exp
+++ b/test/network/net_defaultgw3.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_ip.exp b/test/network/net_ip.exp
index a8cf08a86..098eed758 100755
--- a/test/network/net_ip.exp
+++ b/test/network/net_ip.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_local.exp b/test/network/net_local.exp
index b724ce5d4..d5d4170e8 100755
--- a/test/network/net_local.exp
+++ b/test/network/net_local.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_mac.exp b/test/network/net_mac.exp
index d2aa19503..e067f604f 100755
--- a/test/network/net_mac.exp
+++ b/test/network/net_mac.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_macvlan2.exp b/test/network/net_macvlan2.exp
index 334eb448e..1f67f059e 100755
--- a/test/network/net_macvlan2.exp
+++ b/test/network/net_macvlan2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_mtu.exp b/test/network/net_mtu.exp
index 9436f5cc5..439e05334 100755
--- a/test/network/net_mtu.exp
+++ b/test/network/net_mtu.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_netfilter.exp b/test/network/net_netfilter.exp
index 52fd3bf11..8a949c22b 100755
--- a/test/network/net_netfilter.exp
+++ b/test/network/net_netfilter.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -11,7 +11,7 @@ match_max 100000
11send -- "firejail --debug --noprofile --net=br0 --ip=10.10.20.5 --netfilter\r" 11send -- "firejail --debug --noprofile --net=br0 --ip=10.10.20.5 --netfilter\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Installing network filter" 14 "Installing firewall"
15} 15}
16expect { 16expect {
17 timeout {puts "TESTING ERROR 1\n";exit} 17 timeout {puts "TESTING ERROR 1\n";exit}
@@ -51,7 +51,7 @@ sleep 1
51send -- "firejail --debug --noprofile --net=br0 --ip=10.10.20.5 --netfilter=netfilter.filter\r" 51send -- "firejail --debug --noprofile --net=br0 --ip=10.10.20.5 --netfilter=netfilter.filter\r"
52expect { 52expect {
53 timeout {puts "TESTING ERROR 6\n";exit} 53 timeout {puts "TESTING ERROR 6\n";exit}
54 "Installing network filter" 54 "Installing firewall"
55} 55}
56expect { 56expect {
57 timeout {puts "TESTING ERROR 6.1\n";exit} 57 timeout {puts "TESTING ERROR 6.1\n";exit}
@@ -71,7 +71,7 @@ sleep 1
71send -- "firejail --debug --net=br0 --ip=10.10.20.5 --profile=netfilter.profile\r" 71send -- "firejail --debug --net=br0 --ip=10.10.20.5 --profile=netfilter.profile\r"
72expect { 72expect {
73 timeout {puts "TESTING ERROR 7\n";exit} 73 timeout {puts "TESTING ERROR 7\n";exit}
74 "Installing network filter" 74 "Installing firewall"
75} 75}
76expect { 76expect {
77 timeout {puts "TESTING ERROR 7.1\n";exit} 77 timeout {puts "TESTING ERROR 7.1\n";exit}
diff --git a/test/network/net_noip.exp b/test/network/net_noip.exp
index 9a73f618a..53b719f6c 100755
--- a/test/network/net_noip.exp
+++ b/test/network/net_noip.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -18,6 +18,9 @@ sleep 1
18send -- "bash\r" 18send -- "bash\r"
19sleep 1 19sleep 1
20 20
21send -- "stty -echo\r"
22after 100
23
21# no default gateway configured 24# no default gateway configured
22send -- "netstat -rn;echo done\r" 25send -- "netstat -rn;echo done\r"
23expect { 26expect {
@@ -36,6 +39,7 @@ expect {
36} 39}
37expect { 40expect {
38 timeout {puts "TESTING ERROR 6\n";exit} 41 timeout {puts "TESTING ERROR 6\n";exit}
42 "10.10.20" {puts "TESTING ERROR 7\n";exit}
39 "done" 43 "done"
40} 44}
41send -- "exit\r" 45send -- "exit\r"
diff --git a/test/network/net_noip2.exp b/test/network/net_noip2.exp
index c01f2e4f4..aa74d6ba8 100755
--- a/test/network/net_noip2.exp
+++ b/test/network/net_noip2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -17,6 +17,8 @@ expect {
17sleep 1 17sleep 1
18send -- "bash\r" 18send -- "bash\r"
19sleep 1 19sleep 1
20send -- "stty -echo\r"
21after 100
20 22
21# no default gateway configured 23# no default gateway configured
22send -- "netstat -rn;echo done\r" 24send -- "netstat -rn;echo done\r"
@@ -36,6 +38,7 @@ expect {
36} 38}
37expect { 39expect {
38 timeout {puts "TESTING ERROR 6\n";exit} 40 timeout {puts "TESTING ERROR 6\n";exit}
41 "10.10.30" {puts "TESTING ERROR 7\n";exit}
39 "done" 42 "done"
40} 43}
41send -- "exit\r" 44send -- "exit\r"
diff --git a/test/network/net_none.exp b/test/network/net_none.exp
index 0d3701f22..c8787c342 100755
--- a/test/network/net_none.exp
+++ b/test/network/net_none.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -19,6 +19,9 @@ sleep 1
19# test default gw 19# test default gw
20send -- "bash\r" 20send -- "bash\r"
21sleep 1 21sleep 1
22send -- "stty -echo\r"
23after 100
24
22send -- "netstat -rn; echo done\r" 25send -- "netstat -rn; echo done\r"
23expect { 26expect {
24 timeout {puts "TESTING ERROR 1\n";exit} 27 timeout {puts "TESTING ERROR 1\n";exit}
diff --git a/test/network/net_profile.exp b/test/network/net_profile.exp
index 801fc4dfa..e7c6530df 100755
--- a/test/network/net_profile.exp
+++ b/test/network/net_profile.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_scan.exp b/test/network/net_scan.exp
index 84893cf9c..b9260925a 100755
--- a/test/network/net_scan.exp
+++ b/test/network/net_scan.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/net_unconfigured.exp b/test/network/net_unconfigured.exp
new file mode 100755
index 000000000..d2b60d73c
--- /dev/null
+++ b/test/network/net_unconfigured.exp
@@ -0,0 +1,244 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# check ip address
11send -- "firejail --noprofile --net=br-unconfigured --ip=none\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "eth0" {puts "TESTING ERROR 1\n";exit}
15 "Child process initialized"
16}
17sleep 1
18send -- "bash\r"
19sleep 1
20
21send -- "stty -echo\r"
22after 100
23
24# no default gateway configured
25send -- "netstat -rn;echo done\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "0.0.0.0" {puts "TESTING ERROR 3\n";exit}
29 "eth0" {puts "TESTING ERROR 4\n";exit}
30 "done"
31}
32sleep 1
33
34# eth0 configured
35send -- "/sbin/ifconfig;echo done\r"
36expect {
37 timeout {puts "TESTING ERROR 5\n";exit}
38 "eth0"
39}
40expect {
41 timeout {puts "TESTING ERROR 6\n";exit}
42 "done"
43}
44send -- "exit\r"
45after 100
46send -- "exit\r"
47after 100
48
49
50
51# check ip address
52send -- "firejail --noprofile --net=br-unconfigured\r"
53expect {
54 timeout {puts "TESTING ERROR 7\n";exit}
55 "eth0" {puts "TESTING ERROR 8\n";exit}
56 "Child process initialized"
57}
58sleep 1
59send -- "bash\r"
60sleep 1
61
62send -- "stty -echo\r"
63after 100
64
65# no default gateway configured
66send -- "netstat -rn;echo done\r"
67expect {
68 timeout {puts "TESTING ERROR 9\n";exit}
69 "0.0.0.0" {puts "TESTING ERROR 10\n";exit}
70 "eth0" {puts "TESTING ERROR 11\n";exit}
71 "done"
72}
73sleep 1
74
75# eth0 configured
76send -- "/sbin/ifconfig;echo done\r"
77expect {
78 timeout {puts "TESTING ERROR 12\n";exit}
79 "eth0"
80}
81expect {
82 timeout {puts "TESTING ERROR 13\n";exit}
83 "done"
84}
85send -- "exit\r"
86after 100
87send -- "exit\r"
88after 100
89
90
91# check ip address
92send -- "firejail --noprofile --net=br-unconfigured --defaultgw=10.10.80.1\r"
93expect {
94 timeout {puts "TESTING ERROR 14\n";exit}
95 "eth0" {puts "TESTING ERROR 15\n";exit}
96 "Child process initialized"
97}
98sleep 1
99send -- "bash\r"
100sleep 1
101
102send -- "stty -echo\r"
103after 100
104
105# no default gateway configured
106send -- "netstat -rn;echo done\r"
107expect {
108 timeout {puts "TESTING ERROR 16\n";exit}
109 "0.0.0.0" {puts "TESTING ERROR 17\n";exit}
110 "eth0" {puts "TESTING ERROR 18\n";exit}
111 "done"
112}
113sleep 1
114
115# eth0 configured
116send -- "/sbin/ifconfig;echo done\r"
117expect {
118 timeout {puts "TESTING ERROR 19\n";exit}
119 "eth0"
120}
121expect {
122 timeout {puts "TESTING ERROR 20\n";exit}
123 "done"
124}
125send -- "exit\r"
126after 100
127send -- "exit\r"
128after 100
129
130
131# check ip address
132send -- "firejail --noprofile --net=br-unconfigured --ip=10.10.80.1 --defaultgw=10.10.80.1\r"
133expect {
134 timeout {puts "TESTING ERROR 21\n";exit}
135 "eth0" {puts "TESTING ERROR 22\n";exit}
136 "Child process initialized"
137}
138sleep 1
139send -- "bash\r"
140sleep 1
141
142send -- "stty -echo\r"
143after 100
144
145# no default gateway configured
146send -- "netstat -rn;echo done\r"
147expect {
148 timeout {puts "TESTING ERROR 23\n";exit}
149 "0.0.0.0" {puts "TESTING ERROR 24\n";exit}
150 "eth0" {puts "TESTING ERROR 25\n";exit}
151 "done"
152}
153sleep 1
154
155# eth0 configured
156send -- "/sbin/ifconfig;echo done\r"
157expect {
158 timeout {puts "TESTING ERROR 26\n";exit}
159 "eth0"
160}
161expect {
162 timeout {puts "TESTING ERROR 27\n";exit}
163 "done"
164}
165send -- "exit\r"
166after 100
167send -- "exit\r"
168after 100
169
170
171# check ip address
172send -- "firejail --noprofile --net=br-unconfigured --ip=10.10.80.1 --netmask=255.255.255.0 --defaultgw=10.10.80.1\r"
173expect {
174 timeout {puts "TESTING ERROR 28\n";exit}
175 "eth0"
176}
177expect {
178 timeout {puts "TESTING ERROR 29\n";exit}
179 "10.10.80.1"
180}
181expect {
182 timeout {puts "TESTING ERROR 30\n";exit}
183 "Child process initialized"
184}
185sleep 1
186send -- "bash\r"
187sleep 1
188
189send -- "stty -echo\r"
190after 100
191
192# no default gateway configured
193send -- "netstat -rn;echo done\r"
194expect {
195 timeout {puts "TESTING ERROR 31\n";exit}
196 "0.0.0.0"
197}
198expect {
199 timeout {puts "TESTING ERROR 32\n";exit}
200 "10.10.80.1"
201}
202expect {
203 timeout {puts "TESTING ERROR 33\n";exit}
204 "eth0"
205}
206expect {
207 timeout {puts "TESTING ERROR 34\n";exit}
208 "10.10.80.0"
209}
210expect {
211 timeout {puts "TESTING ERROR 35\n";exit}
212 "0.0.0.0"
213}
214expect {
215 timeout {puts "TESTING ERROR 36\n";exit}
216 "eth0"
217}
218expect {
219 timeout {puts "TESTING ERROR 37\n";exit}
220 "done"
221}
222sleep 1
223
224# eth0 configured
225send -- "/sbin/ifconfig;echo done\r"
226expect {
227 timeout {puts "TESTING ERROR 38\n";exit}
228 "eth0"
229}
230expect {
231 timeout {puts "TESTING ERROR 39\n";exit}
232 "10.10.80.1"
233}
234expect {
235 timeout {puts "TESTING ERROR 40\n";exit}
236 "done"
237}
238send -- "exit\r"
239after 100
240send -- "exit\r"
241after 100
242
243
244puts "all done\n"
diff --git a/test/network/net_veth.exp b/test/network/net_veth.exp
index 62e41fcfc..cd4e64e24 100755
--- a/test/network/net_veth.exp
+++ b/test/network/net_veth.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/netfilter-template.exp b/test/network/netfilter-template.exp
new file mode 100755
index 000000000..dadea1430
--- /dev/null
+++ b/test/network/netfilter-template.exp
@@ -0,0 +1,67 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --net=br1 --ip=10.10.30.10 --name=test1 --netfilter=/etc/firejail/blablabla\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "invalid network filter file"
15}
16sleep 1
17
18send -- "firejail --net=br1 --ip=10.10.30.10 --name=test1 --netfilter=/etc/firejail/tcpserver.net,5555 ./tcpserver 5555\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "Child process initialized"
22}
23sleep 1
24
25spawn $env(SHELL)
26send -- "firejail --netfilter.print=test1\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "Chain INPUT"
30}
31expect {
32 timeout {puts "TESTING ERROR 1.2\n";exit}
33 "Chain FORWARD"
34}
35expect {
36 timeout {puts "TESTING ERROR 1.3\n";exit}
37 "Chain OUTPUT"
38}
39sleep 1
40
41send -- "telnet 10.10.30.10 5555\r"
42expect {
43 timeout {puts "TESTING ERROR 2\n";exit}
44 "Connected to 10.10.30.10"
45}
46sleep 1
47
48send "sdfklsjadfl;ksadjfl;sdkfj\r"
49expect {
50 timeout {puts "TESTING ERROR 3\n";exit}
51 "response"
52}
53expect {
54 timeout {puts "TESTING ERROR 4\n";exit}
55 "Connection closed"
56}
57sleep 1
58
59send -- "telnet 10.10.30.10 5556\r"
60expect {
61 timeout {puts "OK\n"}
62 "Connected to 10.10.30.10" {puts "TESTING ERROR 6\n";exit}
63 "dikasdfjasdjf"
64}
65
66after 100
67puts "all done\n"
diff --git a/test/network/netns.exp b/test/network/netns.exp
index 9475cf958..9ef4ed554 100755
--- a/test/network/netns.exp
+++ b/test/network/netns.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/netstats.exp b/test/network/netstats.exp
index e9ca4e027..e15e2f42d 100755
--- a/test/network/netstats.exp
+++ b/test/network/netstats.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/network/network.sh b/test/network/network.sh
index 739644c8e..9f2b9e1cd 100755
--- a/test/network/network.sh
+++ b/test/network/network.sh
@@ -1,13 +1,23 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9sudo ./configure 10sudo ./configure
10 11
12echo "TESTING: unconfigured network (net_unconfigured.exp)"
13./net_unconfigured.exp
14
15echo "TESTING: netfilter template (netfilter-template.exp)"
16rm -f ./tcpserver
17gcc -o tcpserver tcpserver.c
18./netfilter-template.exp
19rm ./tcpserver
20
11echo "TESTING: firemon interface (firemon-interfaces.exp)" 21echo "TESTING: firemon interface (firemon-interfaces.exp)"
12sudo ./firemon-interfaces.exp 22sudo ./firemon-interfaces.exp
13 23
diff --git a/test/network/tcpserver.c b/test/network/tcpserver.c
new file mode 100644
index 000000000..72730b674
--- /dev/null
+++ b/test/network/tcpserver.c
@@ -0,0 +1,108 @@
1/*
2 * Copyright (C) 2014-2021 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#include <stdio.h>
21#include <stdlib.h>
22#include <unistd.h>
23#include <netdb.h>
24#include <netinet/in.h>
25#include <string.h>
26
27
28int main(int argc, char **argv) {
29 int fd, newfd, client_len;
30 struct sockaddr_in serv_addr, client_addr;
31 int n, pid;
32
33 if (argc < 2) {
34 printf("Usage: ./server port-number\n");
35 return 1;
36 }
37 int portno = atoi(argv[1]);
38
39 // init socket
40 fd = socket(AF_INET, SOCK_STREAM, 0);
41 if (fd < 0) {
42 perror("ERROR opening socket");
43 return 1;
44 }
45
46 // Initialize socket structure
47 memset(&serv_addr, 0, sizeof(serv_addr));
48
49 serv_addr.sin_family = AF_INET;
50 serv_addr.sin_addr.s_addr = INADDR_ANY;
51 serv_addr.sin_port = htons(portno);
52
53 // bind
54 if (bind(fd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
55 perror("bind");
56 return 1;
57 }
58
59 // listen - 5 pending conncections
60 if (listen(fd, 5) < 0) {
61 perror("listen");
62 return 1;
63 }
64 client_len = sizeof(client_addr);
65
66 while (1) {
67 newfd = accept(fd, (struct sockaddr *) &client_addr, &client_len);
68
69 if (newfd < 0) {
70 perror("accept");
71 return 1;
72 }
73
74 /* Create child process */
75 pid = fork();
76
77 if (pid < 0) {
78 perror("fork");
79 return 1;
80 }
81
82 if (pid == 0) {
83 // child
84 close(fd);
85#define MAXBUF 4096
86 char buf[MAXBUF];
87 memset(buf, 0, MAXBUF);
88
89 int rcv = read(newfd, buf, MAXBUF - 1);
90 if (rcv < 0) {
91 perror("read");
92 exit(1);
93 }
94
95 int sent = write(newfd, "response\n", 9);
96 if (sent < 9) {
97 perror("write");
98 return 1;
99 }
100
101 exit(0);
102 }
103 else
104 close(newfd);
105 }
106
107 return 0;
108}
diff --git a/test/network/veth-name.exp b/test/network/veth-name.exp
index a9aeac9ae..1790381e3 100755
--- a/test/network/veth-name.exp
+++ b/test/network/veth-name.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/option_chroot_overlay.exp b/test/option_chroot_overlay.exp
deleted file mode 100755
index 08ffb1b43..000000000
--- a/test/option_chroot_overlay.exp
+++ /dev/null
@@ -1,22 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --chroot=/tmp/chroot --overlay\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "mutually exclusive" {puts "normal system\n"}
11 "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit}
12}
13sleep 1
14
15send -- "firejail --overlay --chroot=/tmp/chroot\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "mutually exclusive"
19}
20sleep 1
21
22puts "\n"
diff --git a/test/overlay/firefox-x11-xorg.exp b/test/overlay/firefox-x11-xorg.exp
index efbe0e4d7..ecb9288b0 100755
--- a/test/overlay/firefox-x11-xorg.exp
+++ b/test/overlay/firefox-x11-xorg.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/overlay/firefox-x11.exp b/test/overlay/firefox-x11.exp
index f8b0740af..5b7b1bec3 100755
--- a/test/overlay/firefox-x11.exp
+++ b/test/overlay/firefox-x11.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/overlay/firefox.exp b/test/overlay/firefox.exp
index 1e719f86d..25c6e5e07 100755
--- a/test/overlay/firefox.exp
+++ b/test/overlay/firefox.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/overlay/fs-named.exp b/test/overlay/fs-named.exp
index 2519a8ede..df1dfc244 100755
--- a/test/overlay/fs-named.exp
+++ b/test/overlay/fs-named.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -12,6 +15,8 @@ expect {
12 "Child process initialized" {puts "found\n"} 15 "Child process initialized" {puts "found\n"}
13} 16}
14sleep 1 17sleep 1
18send -- "stty -echo\r"
19after 100
15 20
16send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" 21send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
17expect { 22expect {
@@ -51,6 +56,8 @@ expect {
51} 56}
52sleep 1 57sleep 1
53 58
59send -- "stty -echo\r"
60after 100
54send -- "cat ~/_firejail_test_file; echo done\r" 61send -- "cat ~/_firejail_test_file; echo done\r"
55expect { 62expect {
56 timeout {puts "TESTING ERROR 4\n";exit} 63 timeout {puts "TESTING ERROR 4\n";exit}
diff --git a/test/overlay/fs-tmpfs.exp b/test/overlay/fs-tmpfs.exp
index 7c1b5d1df..5bd2b25fc 100755
--- a/test/overlay/fs-tmpfs.exp
+++ b/test/overlay/fs-tmpfs.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -21,6 +24,8 @@ expect {
21 "Child process initialized" {puts "found\n"} 24 "Child process initialized" {puts "found\n"}
22} 25}
23sleep 1 26sleep 1
27send -- "stty -echo\r"
28after 100
24 29
25send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" 30send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
26expect { 31expect {
@@ -29,6 +34,8 @@ expect {
29} 34}
30after 100 35after 100
31 36
37send -- "stty -echo\r"
38after 100
32send -- "cat ~/_firejail_test_file; echo done\r" 39send -- "cat ~/_firejail_test_file; echo done\r"
33expect { 40expect {
34 timeout {puts "TESTING ERROR 3\n";exit} 41 timeout {puts "TESTING ERROR 3\n";exit}
@@ -43,6 +50,8 @@ after 100
43send -- "exit\r" 50send -- "exit\r"
44sleep 1 51sleep 1
45 52
53send -- "stty -echo\r"
54after 100
46send -- "cat ~/_firejail_test_file; echo done\r" 55send -- "cat ~/_firejail_test_file; echo done\r"
47expect { 56expect {
48 timeout {puts "TESTING ERROR 5\n";exit} 57 timeout {puts "TESTING ERROR 5\n";exit}
diff --git a/test/overlay/fs.exp b/test/overlay/fs.exp
index f8478e78b..3314e849d 100755
--- a/test/overlay/fs.exp
+++ b/test/overlay/fs.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -13,6 +16,8 @@ expect {
13} 16}
14sleep 1 17sleep 1
15 18
19send -- "stty -echo\r"
20after 100
16send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" 21send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
17expect { 22expect {
18 timeout {puts "TESTING ERROR 3\n";exit} 23 timeout {puts "TESTING ERROR 3\n";exit}
@@ -20,6 +25,8 @@ expect {
20} 25}
21after 100 26after 100
22 27
28send -- "stty -echo\r"
29after 100
23send -- "cat ~/_firejail_test_file; echo done\r" 30send -- "cat ~/_firejail_test_file; echo done\r"
24expect { 31expect {
25 timeout {puts "TESTING ERROR 4\n";exit} 32 timeout {puts "TESTING ERROR 4\n";exit}
@@ -34,6 +41,8 @@ after 100
34send -- "exit\r" 41send -- "exit\r"
35sleep 2 42sleep 2
36 43
44send -- "stty -echo\r"
45after 100
37send -- "cat ~/_firejail_test_file; echo done\r" 46send -- "cat ~/_firejail_test_file; echo done\r"
38expect { 47expect {
39 timeout {puts "TESTING ERROR 5\n";exit} 48 timeout {puts "TESTING ERROR 5\n";exit}
diff --git a/test/overlay/overlay.sh b/test/overlay/overlay.sh
index 94ad6a3cd..f1daba935 100755
--- a/test/overlay/overlay.sh
+++ b/test/overlay/overlay.sh
@@ -1,10 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9echo "TESTING: overlay fs (test/overlay/fs.exp)" 10echo "TESTING: overlay fs (test/overlay/fs.exp)"
10rm -fr ~/_firejail_test_* 11rm -fr ~/_firejail_test_*
@@ -21,7 +22,7 @@ rm -fr ~/_firejail_test_*
21./fs-tmpfs.exp 22./fs-tmpfs.exp
22rm -fr ~/_firejail_test_* 23rm -fr ~/_firejail_test_*
23 24
24which firefox 25which firefox 2>/dev/null
25if [ "$?" -eq 0 ]; 26if [ "$?" -eq 0 ];
26then 27then
27 echo "TESTING: overlay firefox" 28 echo "TESTING: overlay firefox"
@@ -30,7 +31,7 @@ else
30 echo "TESTING SKIP: firefox not found" 31 echo "TESTING SKIP: firefox not found"
31fi 32fi
32 33
33which firefox 34which firefox 2>/dev/null
34if [ "$?" -eq 0 ]; 35if [ "$?" -eq 0 ];
35then 36then
36 echo "TESTING: overlay firefox x11 xorg" 37 echo "TESTING: overlay firefox x11 xorg"
@@ -41,13 +42,13 @@ fi
41 42
42 43
43# check xpra/xephyr 44# check xpra/xephyr
44which xpra 45which xpra 2>/dev/null
45if [ "$?" -eq 0 ]; 46if [ "$?" -eq 0 ];
46then 47then
47 echo "xpra found" 48 echo "xpra found"
48else 49else
49 echo "xpra not found" 50 echo "xpra not found"
50 which Xephyr 51 which Xephyr 2>/dev/null
51 if [ "$?" -eq 0 ]; 52 if [ "$?" -eq 0 ];
52 then 53 then
53 echo "Xephyr found" 54 echo "Xephyr found"
@@ -57,7 +58,7 @@ else
57 fi 58 fi
58fi 59fi
59 60
60which firefox 61which firefox 2>/dev/null
61if [ "$?" -eq 0 ]; 62if [ "$?" -eq 0 ];
62then 63then
63 echo "TESTING: overlay firefox x11" 64 echo "TESTING: overlay firefox x11"
diff --git a/test/private-keep.profile b/test/private-keep.profile
deleted file mode 100644
index a968c4ce2..000000000
--- a/test/private-keep.profile
+++ /dev/null
@@ -1 +0,0 @@
1private-home .mozilla,.config/firejail
diff --git a/test/private-lib/atril.exp b/test/private-lib/atril.exp
new file mode 100755
index 000000000..679799f02
--- /dev/null
+++ b/test/private-lib/atril.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail atril\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/atril.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "atril"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail atril"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail atril"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/dig.exp b/test/private-lib/dig.exp
new file mode 100755
index 000000000..39f3f6d49
--- /dev/null
+++ b/test/private-lib/dig.exp
@@ -0,0 +1,17 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail dig 1.1.1.1\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Query time"
14}
15
16after 100
17puts "\nall done\n"
diff --git a/test/private-lib/eog.exp b/test/private-lib/eog.exp
new file mode 100755
index 000000000..ac6ecfff7
--- /dev/null
+++ b/test/private-lib/eog.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail eog\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/eog.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "eog"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail eog"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail eog"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/eom.exp b/test/private-lib/eom.exp
new file mode 100755
index 000000000..47e749712
--- /dev/null
+++ b/test/private-lib/eom.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail eom\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/eom.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "eom"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail eom"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail eom"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/apps/evince.exp b/test/private-lib/evince.exp
index 5eada5fdf..1e270a2ef 100755
--- a/test/apps/evince.exp
+++ b/test/private-lib/evince.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/private-lib/galculator.exp b/test/private-lib/galculator.exp
new file mode 100755
index 000000000..68ff9f834
--- /dev/null
+++ b/test/private-lib/galculator.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail galculator\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/galculator.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "galculator"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail galculator"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail galculator"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/gedit.exp b/test/private-lib/gedit.exp
new file mode 100755
index 000000000..67be5c215
--- /dev/null
+++ b/test/private-lib/gedit.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail /usr/bin/gedit\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/gedit.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "gedit"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail /usr/bin/gedit"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail /usr/bin/gedit"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/gnome-calculator.exp b/test/private-lib/gnome-calculator.exp
new file mode 100755
index 000000000..67712bd67
--- /dev/null
+++ b/test/private-lib/gnome-calculator.exp
@@ -0,0 +1,85 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# gnome-calculator uses quiet at the top of the profile
11# we need to use --ignore
12send -- "firejail --ignore=quiet gnome-calculator\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "Reading profile /etc/firejail/gnome-calculator.profile"
16}
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "Child process initialized"
20}
21sleep 3
22
23spawn $env(SHELL)
24send -- "firejail --list\r"
25expect {
26 timeout {puts "TESTING ERROR 3\n";exit}
27 ":firejail"
28}
29expect {
30 timeout {puts "TESTING ERROR 3.1\n";exit}
31 "gnome-calculator"
32}
33after 100
34
35# grsecurity exit
36send -- "file /proc/sys/kernel/grsecurity\r"
37expect {
38 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
39 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
40 "cannot open" {puts "grsecurity not present\n"}
41}
42
43send -- "firejail --name=blablabla\r"
44expect {
45 timeout {puts "TESTING ERROR 4\n";exit}
46 "Child process initialized"
47}
48sleep 2
49
50spawn $env(SHELL)
51send -- "firemon --seccomp\r"
52expect {
53 timeout {puts "TESTING ERROR 5\n";exit}
54 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
55 ":firejail --ignore=quiet gnome-calculator"
56}
57expect {
58 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
59 "Seccomp: 2"
60}
61expect {
62 timeout {puts "TESTING ERROR 5.1\n";exit}
63 "name=blablabla"
64}
65after 100
66send -- "firemon --caps\r"
67expect {
68 timeout {puts "TESTING ERROR 6\n";exit}
69 ":firejail --ignore=quiet gnome-calculator"
70}
71expect {
72 timeout {puts "TESTING ERROR 6.1\n";exit}
73 "CapBnd:"
74}
75expect {
76 timeout {puts "TESTING ERROR 6.2\n";exit}
77 "0000000000000000"
78}
79expect {
80 timeout {puts "TESTING ERROR 6.3\n";exit}
81 "name=blablabla"
82}
83after 100
84
85puts "\nall done\n"
diff --git a/test/private-lib/gnome-logs.exp b/test/private-lib/gnome-logs.exp
new file mode 100755
index 000000000..f671effe4
--- /dev/null
+++ b/test/private-lib/gnome-logs.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail gnome-logs\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/gnome-logs.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "gnome-logs"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail gnome-logs"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail gnome-logs"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/gnome-nettool.exp b/test/private-lib/gnome-nettool.exp
new file mode 100755
index 000000000..a68084776
--- /dev/null
+++ b/test/private-lib/gnome-nettool.exp
@@ -0,0 +1,84 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail gnome-nettool\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/gnome-nettool.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "gnome-nettool"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49#seccomp is not configured
50#send -- "firemon --seccomp\r"
51#expect {
52# timeout {puts "TESTING ERROR 5\n";exit}
53# "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
54# ":firejail gnome-nettool"
55#}
56#expect {
57# timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
58# "Seccomp: 2"
59#}
60#expect {
61# timeout {puts "TESTING ERROR 5.1\n";exit}
62# "name=blablabla"
63#}
64#after 100
65send -- "firemon --caps\r"
66expect {
67 timeout {puts "TESTING ERROR 6\n";exit}
68 ":firejail gnome-nettool"
69}
70expect {
71 timeout {puts "TESTING ERROR 6.1\n";exit}
72 "CapBnd:"
73}
74expect {
75 timeout {puts "TESTING ERROR 6.2\n";exit}
76 "0000000000002000"
77}
78expect {
79 timeout {puts "TESTING ERROR 6.3\n";exit}
80 "name=blablabla"
81}
82after 100
83
84puts "\nall done\n"
diff --git a/test/private-lib/gnome-system-log.exp b/test/private-lib/gnome-system-log.exp
new file mode 100755
index 000000000..c3b1f2377
--- /dev/null
+++ b/test/private-lib/gnome-system-log.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail gnome-system-log\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/gnome-system-log.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "gnome-system-log"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail gnome-system-log"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail gnome-system-log"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/gpicview.exp b/test/private-lib/gpicview.exp
new file mode 100755
index 000000000..b438c6de3
--- /dev/null
+++ b/test/private-lib/gpicview.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail gpicview\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/gpicview.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "gpicview"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail gpicview"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail gpicview"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/leafpad.exp b/test/private-lib/leafpad.exp
new file mode 100755
index 000000000..fbe8e284c
--- /dev/null
+++ b/test/private-lib/leafpad.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail leafpad\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/leafpad.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "leafpad"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail leafpad"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail leafpad"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/mousepad.exp b/test/private-lib/mousepad.exp
new file mode 100755
index 000000000..f47dfe464
--- /dev/null
+++ b/test/private-lib/mousepad.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail mousepad\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/mousepad.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "mousepad"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail mousepad"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail mousepad"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/pavucontrol.exp b/test/private-lib/pavucontrol.exp
new file mode 100755
index 000000000..7b8883ade
--- /dev/null
+++ b/test/private-lib/pavucontrol.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail pavucontrol\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/pavucontrol.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "pavucontrol"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail pavucontrol"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail pavucontrol"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/pluma.exp b/test/private-lib/pluma.exp
new file mode 100755
index 000000000..99d4299fb
--- /dev/null
+++ b/test/private-lib/pluma.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail pluma\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/pluma.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "pluma"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail pluma"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail pluma"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private-lib/private-lib.sh b/test/private-lib/private-lib.sh
new file mode 100755
index 000000000..a70c3fad6
--- /dev/null
+++ b/test/private-lib/private-lib.sh
@@ -0,0 +1,22 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3g
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10LIST="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"
11
12
13for app in $LIST; do
14 which $app 2>/dev/null
15 if [ "$?" -eq 0 ];
16 then
17 echo "TESTING: private-lib $app"
18 ./$app.exp
19 else
20 echo "TESTING SKIP: $app not found"
21 fi
22done
diff --git a/test/apps/transmission-gtk.exp b/test/private-lib/transmission-gtk.exp
index 4df1f7892..3c5402c81 100755
--- a/test/apps/transmission-gtk.exp
+++ b/test/private-lib/transmission-gtk.exp
@@ -1,18 +1,22 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail transmission-gtk\r" 10send -- "firejail --ignore=quiet transmission-gtk\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/transmission-gtk.profile"
14}
11expect { 15expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 16 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized" 17 "Child process initialized"
14} 18}
15sleep 5 19sleep 3
16 20
17spawn $env(SHELL) 21spawn $env(SHELL)
18send -- "firejail --list\r" 22send -- "firejail --list\r"
@@ -33,6 +37,7 @@ expect {
33 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} 37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
34 "cannot open" {puts "grsecurity not present\n"} 38 "cannot open" {puts "grsecurity not present\n"}
35} 39}
40
36send -- "firejail --name=blablabla\r" 41send -- "firejail --name=blablabla\r"
37expect { 42expect {
38 timeout {puts "TESTING ERROR 4\n";exit} 43 timeout {puts "TESTING ERROR 4\n";exit}
@@ -45,7 +50,7 @@ send -- "firemon --seccomp\r"
45expect { 50expect {
46 timeout {puts "TESTING ERROR 5\n";exit} 51 timeout {puts "TESTING ERROR 5\n";exit}
47 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
48 ":firejail transmission-gtk" 53 ":firejail --ignore=quiet transmission-gtk"
49} 54}
50expect { 55expect {
51 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} 56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
@@ -59,11 +64,11 @@ after 100
59send -- "firemon --caps\r" 64send -- "firemon --caps\r"
60expect { 65expect {
61 timeout {puts "TESTING ERROR 6\n";exit} 66 timeout {puts "TESTING ERROR 6\n";exit}
62 ":firejail transmission-gtk" 67 ":firejail --ignore=quiet transmission-gtk"
63} 68}
64expect { 69expect {
65 timeout {puts "TESTING ERROR 6.1\n";exit} 70 timeout {puts "TESTING ERROR 6.1\n";exit}
66 "CapBnd" 71 "CapBnd:"
67} 72}
68expect { 73expect {
69 timeout {puts "TESTING ERROR 6.2\n";exit} 74 timeout {puts "TESTING ERROR 6.2\n";exit}
diff --git a/test/private-lib/whois.exp b/test/private-lib/whois.exp
new file mode 100755
index 000000000..83dc54c76
--- /dev/null
+++ b/test/private-lib/whois.exp
@@ -0,0 +1,17 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail whois debian.org\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Domain Name"
14}
15
16after 100
17puts "\nall done\n"
diff --git a/test/private-lib/xcalc.exp b/test/private-lib/xcalc.exp
new file mode 100755
index 000000000..7cd74d3bd
--- /dev/null
+++ b/test/private-lib/xcalc.exp
@@ -0,0 +1,83 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail xcalc\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/xcalc.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19sleep 3
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "xcalc"
30}
31after 100
32
33# grsecurity exit
34send -- "file /proc/sys/kernel/grsecurity\r"
35expect {
36 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
37 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
38 "cannot open" {puts "grsecurity not present\n"}
39}
40
41send -- "firejail --name=blablabla\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "Child process initialized"
45}
46sleep 2
47
48spawn $env(SHELL)
49send -- "firemon --seccomp\r"
50expect {
51 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail xcalc"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
57 "Seccomp: 2"
58}
59expect {
60 timeout {puts "TESTING ERROR 5.1\n";exit}
61 "name=blablabla"
62}
63after 100
64send -- "firemon --caps\r"
65expect {
66 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail xcalc"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit}
71 "CapBnd:"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.2\n";exit}
75 "0000000000000000"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.3\n";exit}
79 "name=blablabla"
80}
81after 100
82
83puts "\nall done\n"
diff --git a/test/private.profile b/test/private.profile
deleted file mode 100644
index 1b947b6f7..000000000
--- a/test/private.profile
+++ /dev/null
@@ -1 +0,0 @@
1private ./dirprivate
diff --git a/test/private_dir.exp b/test/private_dir.exp
deleted file mode 100755
index a4beeba27..000000000
--- a/test/private_dir.exp
+++ /dev/null
@@ -1,53 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# testing private
8send -- "firejail --private=./dirprivate\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls -al;pwd\r"
16expect {
17 timeout {puts "TESTING ERROR 0.1\n";exit}
18 "bashrc"
19}
20expect {
21 timeout {puts "TESTING ERROR 0.2\n";exit}
22 "home"
23}
24send -- "ls -al;pwd\r"
25expect {
26 timeout {
27 # OpenSUSE doesn't use .Xauthority from user home directory
28 send -- "env | grep XAUTHORITY\r"
29
30 expect {
31 timeout {puts "TESTING ERROR 0.3\n";exit}
32 "/run/lightdm/netblue/xauthority"
33 }
34 }
35 ".Xauthority"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.4\n";exit}
39 [lindex $argv 0]
40}
41
42send -- "ls -al | wc -l;pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 1\n";exit}
45 "6" {puts "normal system\n";}
46 "5" {puts "OpenSUSE\n";}
47}
48expect {
49 timeout {puts "TESTING ERROR 2\n";exit}
50 "home"
51}
52
53puts "\n"
diff --git a/test/private_dir_profile.exp b/test/private_dir_profile.exp
deleted file mode 100755
index 7ba18aa69..000000000
--- a/test/private_dir_profile.exp
+++ /dev/null
@@ -1,53 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# testing private
8send -- "firejail --profile=private.profile\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls -al;pwd\r"
16expect {
17 timeout {puts "TESTING ERROR 0.1\n";exit}
18 "bashrc"
19}
20expect {
21 timeout {puts "TESTING ERROR 0.2\n";exit}
22 "home"
23}
24send -- "ls -al;pwd\r"
25expect {
26 timeout {
27 # OpenSUSE doesn't use .Xauthority from user home directory
28 send -- "env | grep XAUTHORITY\r"
29
30 expect {
31 timeout {puts "TESTING ERROR 0.3\n";exit}
32 "/run/lightdm/netblue/xauthority"
33 }
34 }
35 ".Xauthority"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.4\n";exit}
39 [lindex $argv 0]
40}
41
42send -- "ls -al | wc -l;pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 1\n";exit}
45 "6" {puts "normal system\n";}
46 "5" {puts "OpenSUSE\n";}
47}
48expect {
49 timeout {puts "TESTING ERROR 2\n";exit}
50 "home"
51}
52
53puts "\nall done\n"
diff --git a/test/profiles/comment.profile b/test/profiles/comment.profile
new file mode 100644
index 000000000..4a907a408
--- /dev/null
+++ b/test/profiles/comment.profile
@@ -0,0 +1,3 @@
1# this is a comment
2net none # this is another comment
3private # some other comment
diff --git a/test/profiles/cond1.profile b/test/profiles/cond1.profile
new file mode 100644
index 000000000..207914d66
--- /dev/null
+++ b/test/profiles/cond1.profile
@@ -0,0 +1 @@
?HAS_NODBUS: private
diff --git a/test/profiles/cond2.profile b/test/profiles/cond2.profile
new file mode 100644
index 000000000..078efe161
--- /dev/null
+++ b/test/profiles/cond2.profile
@@ -0,0 +1 @@
?HAS_NODBUSprivate
diff --git a/test/profiles/cond3.profile b/test/profiles/cond3.profile
new file mode 100644
index 000000000..7cc9ac1e0
--- /dev/null
+++ b/test/profiles/cond3.profile
@@ -0,0 +1 @@
?HAS_NODBUS
diff --git a/test/profiles/conditional.exp b/test/profiles/conditional.exp
new file mode 100755
index 000000000..b06b983c1
--- /dev/null
+++ b/test/profiles/conditional.exp
@@ -0,0 +1,47 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug --nodbus --profile=cond1.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "conditional HAS_NODBUS, private"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "firejail --debug --profile=cond1.profile\r"
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "conditional HAS_NODBUS, private" {puts "TESTING ERROR 3\n";exit}
27 "Child process initialized"
28}
29after 100
30send -- "exit\r"
31sleep 1
32
33send -- "firejail --profile=cond2.profile\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "invalid conditional syntax"
37}
38after 100
39
40send -- "firejail --profile=cond3.profile\r"
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 "invalid conditional syntax"
44}
45after 100
46
47puts "\nall done\n"
diff --git a/test/profiles/ignore.exp b/test/profiles/ignore.exp
index cdb38e97b..e7f210a46 100755
--- a/test/profiles/ignore.exp
+++ b/test/profiles/ignore.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -19,7 +19,7 @@ expect {
19 BLACKLIST {puts "TESTING ERROR 2\n";exit} 19 BLACKLIST {puts "TESTING ERROR 2\n";exit}
20 "Child process initialized" 20 "Child process initialized"
21} 21}
22sleep 1 22after 100
23send -- "exit\r" 23send -- "exit\r"
24sleep 1 24sleep 1
25 25
@@ -28,23 +28,58 @@ expect {
28 timeout {puts "TESTING ERROR 3\n";exit} 28 timeout {puts "TESTING ERROR 3\n";exit}
29 "Child process initialized" 29 "Child process initialized"
30} 30}
31sleep 1 31after 100
32 32
33send -- "ps aux | wc -l\r" 33send -- "ps aux | wc -l\r"
34expect { 34expect {
35 timeout {puts "TESTING ERROR 4\n";exit} 35 timeout {puts "TESTING ERROR 4\n";exit}
36 "5" 36 "5"
37} 37}
38after 100
39send -- "exit\r"
38sleep 1 40sleep 1
41
42send -- "firejail --ignore=private --ignore=shell --profile=ignore.profile \r"
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 "Child process initialized"
46}
47after 100
48
49send -- "ps aux | wc -l\r"
50expect {
51 timeout {puts "TESTING ERROR 6\n";exit}
52 "5"
53}
54after 100
39send -- "exit\r" 55send -- "exit\r"
40sleep 1 56sleep 1
41 57
42send -- "firejail --debug --profile=ignore2.profile\r" 58send -- "firejail --debug --profile=ignore2.profile\r"
43expect { 59expect {
44 timeout {puts "TESTING ERROR 5\n";exit} 60 timeout {puts "TESTING ERROR 7\n";exit}
45 BLACKLIST {puts "TESTING ERROR 6\n";exit} 61 BLACKLIST {puts "TESTING ERROR 8\n";exit}
46 "Child process initialized" 62 "Child process initialized"
47} 63}
48 64
49after 100 65after 100
66send -- "exit\r"
67sleep 1
68
69send -- "firejail --ignore=quiet --ignore=shell --profile=ignore.profile \r"
70expect {
71 timeout {puts "TESTING ERROR 9\n";exit}
72 "Child process initialized"
73}
74after 100
75
76send -- "ps aux | wc -l\r"
77expect {
78 timeout {puts "TESTING ERROR 10\n";exit}
79 "5"
80}
81after 100
82send -- "exit\r"
83after 100
84
50puts "\nall done\n" 85puts "\nall done\n"
diff --git a/test/profiles/ignore2.profile b/test/profiles/ignore2.profile
index 49fcd8324..c85cd9544 100644
--- a/test/profiles/ignore2.profile
+++ b/test/profiles/ignore2.profile
@@ -1,3 +1,5 @@
1ignore seccomp 1ignore seccomp
2ignore shell
2private 3private
3seccomp 4seccomp
5shell none
diff --git a/test/profiles/ignore3.profile b/test/profiles/ignore3.profile
new file mode 100644
index 000000000..f0c9699e1
--- /dev/null
+++ b/test/profiles/ignore3.profile
@@ -0,0 +1,4 @@
1quiet
2private
3seccomp
4shell none
diff --git a/test/profiles/profile_appname.exp b/test/profiles/profile_appname.exp
new file mode 100755
index 000000000..240a44697
--- /dev/null
+++ b/test/profiles/profile_appname.exp
@@ -0,0 +1,25 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --profile=firefox\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/firefox.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Reading profile /etc/firejail/firefox-common.profile"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "shell=none configured, but no program specified"
22}
23
24after 100
25puts "\nall done\n"
diff --git a/test/profiles/profile_comment.exp b/test/profiles/profile_comment.exp
new file mode 100755
index 000000000..a2be510c1
--- /dev/null
+++ b/test/profiles/profile_comment.exp
@@ -0,0 +1,52 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "rm -fr /tmp/firejailtest*\r"
11send -- "rm -fr /tmp/firejail-strace*\r"
12send -- "rm -fr /tmp/firejail-trace*\r"
13sleep 1
14
15send -- "firejail --profile=comment.profile /usr/bin/true\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "Parent is shutting down"
23}
24sleep 2
25
26send -- "firejail --build=/tmp/firejailtest.profile /usr/bin/true\r"
27sleep 1
28
29send -- "cat /tmp/firejailtest.profile\r"
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "seccomp"
33}
34after 100
35
36send -- "firejail --profile=/tmp/firejailtest.profile /usr/bin/true\r"
37expect {
38 timeout {puts "TESTING ERROR 3\n";exit}
39 "Child process initialized"
40}
41expect {
42 timeout {puts "TESTING ERROR 4\n";exit}
43 "Parent is shutting down"
44}
45after 100
46
47send -- "rm -fr /tmp/firejailtest*\r"
48send -- "rm -fr /tmp/firejail-strace*\r"
49send -- "rm -fr /tmp/firejail-trace*\r"
50after 100
51
52puts "\nall done\n"
diff --git a/test/profiles/profile_followlnk.exp b/test/profiles/profile_followlnk.exp
index eb3d04852..0500eac35 100755
--- a/test/profiles/profile_followlnk.exp
+++ b/test/profiles/profile_followlnk.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/profiles/profile_noperm.exp b/test/profiles/profile_noperm.exp
index b3b031cb2..609364389 100755
--- a/test/profiles/profile_noperm.exp
+++ b/test/profiles/profile_noperm.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -7,7 +10,7 @@ match_max 100000
7send -- "firejail --profile=/etc/shadow\r" 10send -- "firejail --profile=/etc/shadow\r"
8expect { 11expect {
9 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
10 "cannot access profile" 13 "inaccessible profile file"
11} 14}
12after 100 15after 100
13puts "\nall done\n" 16puts "\nall done\n"
diff --git a/test/profiles/profile_readonly.exp b/test/profiles/profile_readonly.exp
index c1c9544a6..2046cc297 100755
--- a/test/profiles/profile_readonly.exp
+++ b/test/profiles/profile_readonly.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/profiles/profile_recursivity.exp b/test/profiles/profile_recursivity.exp
new file mode 100755
index 000000000..c761a1039
--- /dev/null
+++ b/test/profiles/profile_recursivity.exp
@@ -0,0 +1,25 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --profile=test3.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile test3.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Reading profile test3.profile"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "maximum profile include level was reached"
22}
23
24after 100
25puts "\nall done\n"
diff --git a/test/profiles/profile_syntax.exp b/test/profiles/profile_syntax.exp
index 74b0d5a53..a2cccb0d4 100755
--- a/test/profiles/profile_syntax.exp
+++ b/test/profiles/profile_syntax.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -22,7 +22,7 @@ expect {
22} 22}
23 23
24sleep 1 24sleep 1
25send -- "ls -l /etc/shadow\r" 25send -- "ls -l /dev/console\r"
26expect { 26expect {
27 timeout {puts "TESTING ERROR 3\n";exit} 27 timeout {puts "TESTING ERROR 3\n";exit}
28 "root root" 28 "root root"
diff --git a/test/profiles/profile_syntax2.exp b/test/profiles/profile_syntax2.exp
index 5726c0408..e2ec20ca5 100755
--- a/test/profiles/profile_syntax2.exp
+++ b/test/profiles/profile_syntax2.exp
@@ -1,13 +1,13 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --debug --profile=test2.profile\r" 10send -- "firejail --profile=test2.profile\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile test2.profile" 13 "Reading profile test2.profile"
@@ -18,33 +18,8 @@ expect {
18} 18}
19expect { 19expect {
20 timeout {puts "TESTING ERROR 2\n";exit} 20 timeout {puts "TESTING ERROR 2\n";exit}
21 "Mounting a new /home directory" 21 "cannot access profile file"
22} 22}
23expect { 23
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "Disable /bin/rmdir" {puts "Most Linux platforms\n"}
26 "Disable /usr/bin/rmdir" { puts "OpenSUSE platform\n"}
27}
28expect {
29 timeout {puts "TESTING ERROR 4\n";exit}
30 "Drop CAP_SYS_MODULE"
31}
32expect {
33 timeout {puts "TESTING ERROR 5\n";exit}
34 "SECCOMP Filter"
35}
36expect {
37 timeout {puts "TESTING ERROR 6\n";exit}
38 "BLACKLIST"
39}
40expect {
41 timeout {puts "TESTING ERROR 7\n";exit}
42 "mount"
43}
44expect {
45 timeout {puts "TESTING ERROR 8\n";exit}
46 "Child process initialized"
47}
48send -- "exit\r"
49after 100 24after 100
50puts "\nall done\n" 25puts "\nall done\n"
diff --git a/test/profiles/profiles.sh b/test/profiles/profiles.sh
index 3be10bedd..cbc6fa4d9 100755
--- a/test/profiles/profiles.sh
+++ b/test/profiles/profiles.sh
@@ -1,18 +1,23 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9echo "TESTING: default profiles installed in /etc" 10echo "TESTING: profile comments (test/profiles/profilecomment.exp)"
10PROFILES=`ls /etc/firejail/*.profile` 11./profile_comment.exp
11for PROFILE in $PROFILES 12
12do 13echo "TESTING: profile conditional (test/profiles/conditional.exp)"
13 echo "TESTING: $PROFILE" 14./conditional.exp
14 ./test-profile.exp $PROFILE 15
15done 16echo "TESTING: profile recursivity (test/profiles/profile_recursivity.exp)"
17./profile_recursivity.exp
18
19echo "TESTING: profile application name (test/profiles/profile_appname.exp)"
20./profile_appname.exp
16 21
17echo "TESTING: profile syntax (test/profiles/profile_syntax.exp)" 22echo "TESTING: profile syntax (test/profiles/profile_syntax.exp)"
18./profile_syntax.exp 23./profile_syntax.exp
@@ -32,3 +37,18 @@ echo "TESTING: profile read-only links (test/profiles/profile_readonly.exp)"
32echo "TESTING: profile no permissions (test/profiles/profile_noperm.exp)" 37echo "TESTING: profile no permissions (test/profiles/profile_noperm.exp)"
33./profile_noperm.exp 38./profile_noperm.exp
34 39
40# GitHub CI doesn't have a /run/user/$UID directory. Using it to test a small number of profiles.
41UID=`id -u`
42if [ -d "/run/user/$UID" ]; then
43 PROFILES=`ls /etc/firejail/*.profile`
44 echo "TESTING: default profiles installed in /etc"
45else
46 PROFILES=`ls /etc/firejail/transmission*.profile /etc/firejail/fi*.profile /etc/firejail/fl*.profile /etc/firejail/free*.profile`
47 echo "TESTING: small number of default profiles installed in /etc"
48fi
49
50for PROFILE in $PROFILES
51do
52 echo "TESTING: $PROFILE"
53 ./test-profile.exp $PROFILE
54done
diff --git a/test/profiles/test-profile.exp b/test/profiles/test-profile.exp
index 63fb3a150..625cb6511 100755
--- a/test/profiles/test-profile.exp
+++ b/test/profiles/test-profile.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -13,10 +13,13 @@ if { $argc != 1 } {
13 exit 13 exit
14} 14}
15 15
16send -- "stty -echo\r"
17after 100
16send -- "firejail --profile=$argv echo done\r" 18send -- "firejail --profile=$argv echo done\r"
17expect { 19expect {
18 timeout {puts "TESTING ERROR 0\n";exit} 20 timeout {puts "TESTING ERROR 0\n";exit}
19 "done" 21 "done" {puts "all fine"}
22 "no suitable echo executable found" {puts "echo not found"}
20} 23}
21after 100 24#after 100
22puts "\n" 25puts "\n"
diff --git a/test/profiles/test.profile b/test/profiles/test.profile
index 1d69cc960..27cb99606 100644
--- a/test/profiles/test.profile
+++ b/test/profiles/test.profile
@@ -1,5 +1,5 @@
1 blacklist /sbin/iptables 1blacklist /sbin/iptables
2blacklist /etc/shadow 2blacklist /dev/console
3 blacklist /bin/rmdir 3blacklist /bin/rmdir
4blacklist ${PATH}/umount 4blacklist ${PATH}/umount
5blacklist ${PATH}/mount 5blacklist ${PATH}/mount
diff --git a/test/profiles/test2.profile b/test/profiles/test2.profile
index e219d800d..9fbd5219a 100644
--- a/test/profiles/test2.profile
+++ b/test/profiles/test2.profile
@@ -1,4 +1,6 @@
1caps 1caps
2seccomp 2seccomp
3 private 3 private
4 include test.profile 4 include test.profile
5 include test.local
6 include test25.profile
diff --git a/test/profiles/test3.profile b/test/profiles/test3.profile
new file mode 100644
index 000000000..5a70bd829
--- /dev/null
+++ b/test/profiles/test3.profile
@@ -0,0 +1 @@
include test3.profile
diff --git a/test/root/apache2.exp b/test/root/apache2.exp
index 0b102bad5..0b4b65dc7 100755
--- a/test/root/apache2.exp
+++ b/test/root/apache2.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 5 6set timeout 5
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -16,18 +19,18 @@ spawn $env(SHELL)
16send -- "firejail --tree\r" 19send -- "firejail --tree\r"
17expect { 20expect {
18 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
19 "root:/usr/sbin/apache2" 22 "root:apache:firejail --name=apache /etc/init.d/apache2"
20} 23}
21expect { 24expect {
22 timeout {puts "TESTING ERROR 2\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
23 "www-data:/usr/sbin/apache2" 26 "www-data::/usr/sbin/apache2"
24} 27}
25sleep 2 28sleep 2
26 29
27 30
28send -- "rm index.html\r" 31send -- "rm index.html\r"
29sleep 1 32sleep 1
30send -- "wget 0\r" 33send -- "wget 127.0.0.1\r"
31expect { 34expect {
32 timeout {puts "TESTING ERROR 3\n";exit} 35 timeout {puts "TESTING ERROR 3\n";exit}
33 "saved" 36 "saved"
diff --git a/test/root/cgroup.exp b/test/root/cgroup.exp
index 4b07183a1..d24a39d07 100755
--- a/test/root/cgroup.exp
+++ b/test/root/cgroup.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
index e17e9cda2..9a4c666e1 100755
--- a/test/root/checkcfg.exp
+++ b/test/root/checkcfg.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -107,6 +107,8 @@ send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r"
107after 100 107after 100
108send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r" 108send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r"
109sleep 1 109sleep 1
110send -- "stty -echo\r"
111after 100
110send -- "firejail --noprofile echo done\r" 112send -- "firejail --noprofile echo done\r"
111expect { 113expect {
112 timeout {puts "TESTING ERROR 11\n";exit} 114 timeout {puts "TESTING ERROR 11\n";exit}
diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp
index 8210496bb..65ecefe5d 100755
--- a/test/root/firecfg.exp
+++ b/test/root/firecfg.exp
@@ -1,22 +1,24 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firecfg\r" 10send -- "firecfg --debug\r"
11sleep 1 11sleep 1
12 12
13send -- "firecfg --clean\r" 13send -- "firecfg --debug --clean\r"
14expect { 14expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
16 "/usr/local/bin/firefox removed" 16 "less removed"
17} 17}
18sleep 1 18sleep 1
19 19
20send -- "stty -echo\r"
21after 100
20send -- "file /usr/local/bin/firefox; echo done\r" 22send -- "file /usr/local/bin/firefox; echo done\r"
21expect { 23expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 24 timeout {puts "TESTING ERROR 1\n";exit}
@@ -25,14 +27,14 @@ expect {
25} 27}
26sleep 1 28sleep 1
27 29
28send -- "firecfg\r" 30send -- "firecfg --debug\r"
29expect { 31expect {
30 timeout {puts "TESTING ERROR 3\n";exit} 32 timeout {puts "TESTING ERROR 3\n";exit}
31 "firefox created" 33 "less created"
32} 34}
33sleep 1 35sleep 1
34 36
35send -- "file /usr/local/bin/firefox\r" 37send -- "file /usr/local/bin/less\r"
36expect { 38expect {
37 timeout {puts "TESTING ERROR 4\n";exit} 39 timeout {puts "TESTING ERROR 4\n";exit}
38 "symbolic link to /usr/bin/firejail" 40 "symbolic link to /usr/bin/firejail"
@@ -42,7 +44,7 @@ sleep 1
42send -- "firecfg --list\r" 44send -- "firecfg --list\r"
43expect { 45expect {
44 timeout {puts "TESTING ERROR 5\n";exit} 46 timeout {puts "TESTING ERROR 5\n";exit}
45 "/usr/local/bin/firefox" 47 "/usr/local/bin/less"
46} 48}
47sleep 1 49sleep 1
48 50
diff --git a/test/root/firemon-events.exp b/test/root/firemon-events.exp
index 8f6dd583b..7bf51e2c8 100755
--- a/test/root/firemon-events.exp
+++ b/test/root/firemon-events.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/git.exp b/test/root/git.exp
deleted file mode 100755
index c5ddeee89..000000000
--- a/test/root/git.exp
+++ /dev/null
@@ -1,51 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7
8
9send -- "firejail --version\r"
10expect {
11 timeout {puts "TESTING ERROR 1\n";exit}
12 "git install support is disabled" { puts "TESTING: git support not available in current build\n"; exit}
13 "git install support is enabled" { puts "git support available\n"}
14}
15
16set timeout 120
17send -- "firejail --git-install\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "Cloning into"
21}
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "Configuration options"
25}
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "src/fseccomp/fseccomp default seccomp"
29}
30expect {
31 timeout {puts "TESTING ERROR 5\n";exit}
32 "Mainline git Firejail version was installed in"
33}
34after 100
35
36send -- "firejail --git-uninstall\r"
37expect {
38 timeout {puts "TESTING ERROR 6\n";exit}
39 "Cloning into"
40}
41expect {
42 timeout {puts "TESTING ERROR 7\n";exit}
43 "Configuration options"
44}
45expect {
46 timeout {puts "TESTING ERROR 8\n";exit}
47 "Firejail mainline git version uninstalled from"
48}
49after 100
50
51puts "\nall done\n"
diff --git a/test/root/isc-dhcp.exp b/test/root/isc-dhcp.exp
index 24243d6bb..4c468c3e8 100755
--- a/test/root/isc-dhcp.exp
+++ b/test/root/isc-dhcp.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 5 6set timeout 5
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/join.exp b/test/root/join.exp
index c70fff93d..d995d8aa5 100755
--- a/test/root/join.exp
+++ b/test/root/join.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/root/login_nobody.exp b/test/root/login_nobody.exp
new file mode 100755
index 000000000..42d8fe013
--- /dev/null
+++ b/test/root/login_nobody.exp
@@ -0,0 +1,35 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11send -- "su - nobody -s /usr/bin/firejail\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16after 100
17
18send -- "cat /proc/self/status | grep Seccomp\r"
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "2"
22}
23after 100
24
25send -- "cat /proc/self/status | grep CapBnd\r"
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "0000000000000000"
29}
30after 100
31
32send -- "exit\r"
33sleep 1
34
35puts "\nall done\n"
diff --git a/test/root/nginx.exp b/test/root/nginx.exp
index 82ebe0ee7..924ee8afd 100755
--- a/test/root/nginx.exp
+++ b/test/root/nginx.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 5 6set timeout 5
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -16,18 +19,18 @@ spawn $env(SHELL)
16send -- "firejail --tree\r" 19send -- "firejail --tree\r"
17expect { 20expect {
18 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
19 "root:nginx" 22 "root::nginx: master process /usr/sbin/nginx"
20} 23}
21expect { 24expect {
22 timeout {puts "TESTING ERROR 2\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
23 "www-data:nginx" 26 "www-data::nginx: worker process"
24} 27}
25sleep 2 28sleep 2
26 29
27 30
28send -- "rm index.html\r" 31send -- "rm index.html\r"
29sleep 1 32sleep 1
30send -- "wget 0\r" 33send -- "wget 127.0.0.1\r"
31expect { 34expect {
32 timeout {puts "TESTING ERROR 3\n";exit} 35 timeout {puts "TESTING ERROR 3\n";exit}
33 "saved" 36 "saved"
diff --git a/test/root/option_bind_directory.exp b/test/root/option_bind_directory.exp
index 2156c7dfa..ac6421593 100755
--- a/test/root/option_bind_directory.exp
+++ b/test/root/option_bind_directory.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/option_bind_file.exp b/test/root/option_bind_file.exp
index 107d8bccb..6ead284a8 100755
--- a/test/root/option_bind_file.exp
+++ b/test/root/option_bind_file.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/option_tmpfs.exp b/test/root/option_tmpfs.exp
index 3d492dfdb..67a678c68 100755
--- a/test/root/option_tmpfs.exp
+++ b/test/root/option_tmpfs.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
@@ -37,4 +40,3 @@ after 100
37 40
38 41
39puts "\nall done\n" 42puts "\nall done\n"
40
diff --git a/test/root/private.exp b/test/root/private.exp
index 479d7afb1..373bd6cef 100755
--- a/test/root/private.exp
+++ b/test/root/private.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -54,6 +54,21 @@ expect {
54after 100 54after 100
55send -- "exit\r" 55send -- "exit\r"
56sleep 1 56sleep 1
57send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r"
58expect {
59 timeout {puts "TESTING ERROR 3.1\n";exit}
60 "Child process initialized"
61}
62sleep 1
63
64send -- "find /opt | wc -l\r"
65expect {
66 timeout {puts "TESTING ERROR 4.1\n";exit}
67 "4"
68}
69after 100
70send -- "exit\r"
71sleep 1
57 72
58 73
59send -- "touch /srv/firejail-test-file\r" 74send -- "touch /srv/firejail-test-file\r"
@@ -77,14 +92,20 @@ expect {
77after 100 92after 100
78send -- "exit\r" 93send -- "exit\r"
79sleep 1 94sleep 1
95send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r"
96expect {
97 timeout {puts "TESTING ERROR 5.1\n";exit}
98 "Child process initialized"
99}
100sleep 1
80 101
81 102send -- "find /srv | wc -l\r"
82 103expect {
83 104 timeout {puts "TESTING ERROR 6.1\n";exit}
84 105 "4"
85 106}
86 107after 100
87 108send -- "exit\r"
88 109sleep 1
89 110
90puts "\nall done\n" 111puts "\nall done\n"
diff --git a/test/root/profile_tmpfs.exp b/test/root/profile_tmpfs.exp
index bcb632c20..8a46d666e 100755
--- a/test/root/profile_tmpfs.exp
+++ b/test/root/profile_tmpfs.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/root.sh b/test/root/root.sh
index 912ae23f0..d6b60cb23 100755
--- a/test/root/root.sh
+++ b/test/root/root.sh
@@ -1,8 +1,27 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3# set a new firejail config file 6# set a new firejail config file
4#cp firejail.config /etc/firejail/firejail.config 7#cp firejail.config /etc/firejail/firejail.config
5 8
9export LC_ALL=C
10
11#********************************
12# firecfg
13#********************************
14which less 2>/dev/null
15if [ "$?" -eq 0 ];
16then
17 echo "TESTING: firecfg (test/root/firecfg.exp)"
18 mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store
19 ./firecfg.exp
20 mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications
21else
22 echo "TESTING SKIP: firecfg, less not found"
23fi
24
6#******************************** 25#********************************
7# servers 26# servers
8#******************************** 27#********************************
@@ -62,8 +81,8 @@ echo "TESTING: fs whitelist mnt, opt, media (test/root/whitelist-mnt.exp)"
62echo "TESTING: join (test/root/join.exp)" 81echo "TESTING: join (test/root/join.exp)"
63./join.exp 82./join.exp
64 83
65echo "TESTING: git-install (test/root/git.exp)" 84echo "TESTING: login-nobody (test/root/login_nobody.exp)"
66./git.exp 85./login_nobody.exp
67 86
68#******************************** 87#********************************
69# seccomp 88# seccomp
@@ -107,17 +126,6 @@ rm -f tmpfile
107echo "TESTING: firemon events (test/root/firemon-events.exp)" 126echo "TESTING: firemon events (test/root/firemon-events.exp)"
108./firemon-events.exp 127./firemon-events.exp
109 128
110#********************************
111# firecfg
112#********************************
113which firefox
114if [ "$?" -eq 0 ];
115then
116 echo "TESTING: firecfg (test/root/firecfg.exp)"
117 ./firecfg.exp
118else
119 echo "TESTING SKIP: firecfg, firefox not found"
120fi
121 129
122# restore the default config file 130# restore the default config file
123#cp ../../etc/firejail.config /etc/firejail/firejail.config 131#cp ../../etc/firejail.config /etc/firejail/firejail.config
diff --git a/test/root/seccomp-chmod.exp b/test/root/seccomp-chmod.exp
index 35c6f69c2..d6f8b8bcc 100755
--- a/test/root/seccomp-chmod.exp
+++ b/test/root/seccomp-chmod.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -14,6 +14,8 @@ expect {
14} 14}
15sleep 2 15sleep 2
16 16
17send -- "stty -echo\r"
18after 100
17send -- "cd ~; echo done\r" 19send -- "cd ~; echo done\r"
18expect { 20expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
diff --git a/test/root/seccomp-chown.exp b/test/root/seccomp-chown.exp
index 174a35ffe..daf3a5d06 100755
--- a/test/root/seccomp-chown.exp
+++ b/test/root/seccomp-chown.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -14,6 +14,8 @@ expect {
14} 14}
15sleep 2 15sleep 2
16 16
17send -- "stty -echo\r"
18after 100
17send -- "touch testfile; echo done\r" 19send -- "touch testfile; echo done\r"
18expect { 20expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
diff --git a/test/root/seccomp-umount.exp b/test/root/seccomp-umount.exp
index 90e240e74..0a7310fdd 100755
--- a/test/root/seccomp-umount.exp
+++ b/test/root/seccomp-umount.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/root/snmpd.exp b/test/root/snmpd.exp
index 610fdb13a..d1fc49967 100755
--- a/test/root/snmpd.exp
+++ b/test/root/snmpd.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 5 6set timeout 5
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/unbound.exp b/test/root/unbound.exp
index 9c496306a..710a95bf4 100755
--- a/test/root/unbound.exp
+++ b/test/root/unbound.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 5 6set timeout 5
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/root/whitelist.exp b/test/root/whitelist.exp
index 1ba711c63..429a4153e 100755
--- a/test/root/whitelist.exp
+++ b/test/root/whitelist.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/ssh/login.exp b/test/ssh/login.exp
new file mode 100755
index 000000000..6a5086a77
--- /dev/null
+++ b/test/ssh/login.exp
@@ -0,0 +1,52 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "ps aux | wc -l\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "5"
22}
23after 100
24
25send -- "ls -l /home | grep drw | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "1"
29}
30after 100
31
32send -- "cat /proc/self/status | grep Seccomp\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "2"
36}
37after 100
38
39send -- "cat /proc/self/status | grep CapBnd\r"
40expect {
41 timeout {puts "TESTING ERROR 4\n";exit}
42 "0000000000000000"
43}
44after 100
45
46# preparing scp/sftp tests
47send -- "rm testfile\r"
48
49send -- "exit\r"
50sleep 1
51
52puts "\nall done\n"
diff --git a/test/ssh/scp.exp b/test/ssh/scp.exp
new file mode 100755
index 000000000..bca6a124f
--- /dev/null
+++ b/test/ssh/scp.exp
@@ -0,0 +1,66 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "rm -f testfile\r"
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "echo 12345 > testfile\r"
24after 100
25send -- "scp testfile firejail-test@0:~/testfile\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "100%"
29}
30sleep 1
31
32
33send -- "ssh firejail-test@0\r"
34expect {
35 timeout {puts "TESTING ERROR 2\n";exit}
36 "Child process initialized" {puts "OK\n"}
37 "an existing sandbox was detected" {puts "OK\n"}
38}
39sleep 1
40send -- "cat testfile\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "12345"
44}
45after 100
46send -- "exit\r"
47sleep 1
48
49send -- "rm testfile\r"
50after 100
51send -- "scp firejail-test@0:~/testfile testfile\r"
52expect {
53 timeout {puts "TESTING ERROR 4\n";exit}
54 "100%"
55}
56sleep 1
57send -- "cat testfile\r"
58expect {
59 timeout {puts "TESTING ERROR 5\n";exit}
60 "12345"
61}
62after 100
63send -- "rm testfile\r"
64sleep 1
65
66puts "\nall done\n"
diff --git a/test/ssh/sftp.exp b/test/ssh/sftp.exp
new file mode 100755
index 000000000..09d3c119e
--- /dev/null
+++ b/test/ssh/sftp.exp
@@ -0,0 +1,90 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "rm -f testfile\r"
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "echo 12345 > testfile\r"
24after 100
25send -- "sftp firejail-test@0\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "Connected to 0"
29}
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "sftp>"
33}
34after 100
35send -- "put testfile\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "100%"
39}
40after 100
41send -- "exit\r"
42sleep 1
43
44
45send -- "ssh firejail-test@0\r"
46expect {
47 timeout {puts "TESTING ERROR 4\n";exit}
48 "Child process initialized" {puts "OK\n"}
49 "an existing sandbox was detected" {puts "OK\n"}
50}
51sleep 1
52send -- "cat testfile\r"
53expect {
54 timeout {puts "TESTING ERROR 5\n";exit}
55 "12345"
56}
57after 100
58send -- "exit\r"
59sleep 1
60
61send -- "rm testfile\r"
62after 100
63send -- "sftp firejail-test@0\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 "Connected to 0"
67}
68expect {
69 timeout {puts "TESTING ERROR 7\n";exit}
70 "sftp>"
71}
72after 100
73send -- "get testfile\r"
74expect {
75 timeout {puts "TESTING ERROR 8\n";exit}
76 "100%"
77}
78after 100
79send -- "exit\r"
80sleep 1
81send -- "cat testfile\r"
82expect {
83 timeout {puts "TESTING ERROR 9\n";exit}
84 "12345"
85}
86after 100
87send -- "rm testfile\r"
88sleep 1
89
90puts "\nall done\n"
diff --git a/test/ssh/ssh.sh b/test/ssh/ssh.sh
new file mode 100755
index 000000000..bdad8cf87
--- /dev/null
+++ b/test/ssh/ssh.sh
@@ -0,0 +1,17 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10echo "TESTING: ssh login (test/ssh/login.exp)"
11./login.exp
12
13echo "TESTING: sftp (test/ssh/sftp.exp)"
14./sftp.exp
15
16echo "TESTING: scp (test/ssh/scp.exp)"
17./scp.exp
diff --git a/test/stress/blacklist.exp b/test/stress/blacklist.exp
index abf6c985f..fae874b25 100755
--- a/test/stress/blacklist.exp
+++ b/test/stress/blacklist.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/stress/env.exp b/test/stress/env.exp
index b327ba498..d69558114 100755
--- a/test/stress/env.exp
+++ b/test/stress/env.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/stress/net_macvlan.exp b/test/stress/net_macvlan.exp
index 33a95b885..a535afa2a 100755
--- a/test/stress/net_macvlan.exp
+++ b/test/stress/net_macvlan.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/stress/stress.sh b/test/stress/stress.sh
index 57a8cae56..d32ffe907 100755
--- a/test/stress/stress.sh
+++ b/test/stress/stress.sh
@@ -1,10 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9 10
10# blacklist testing 11# blacklist testing
diff --git a/test/sysutils/cpio.exp b/test/sysutils/cpio.exp
index e7e69df45..4230ba375 100755
--- a/test/sysutils/cpio.exp
+++ b/test/sysutils/cpio.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/sysutils/file.exp b/test/sysutils/file.exp
index c220ab82e..b97c0c283 100755
--- a/test/sysutils/file.exp
+++ b/test/sysutils/file.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/sysutils/gzip.exp b/test/sysutils/gzip.exp
index b56c27ceb..be2222f06 100755
--- a/test/sysutils/gzip.exp
+++ b/test/sysutils/gzip.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/sysutils/less.exp b/test/sysutils/less.exp
index 29781c21a..265b0e474 100755
--- a/test/sysutils/less.exp
+++ b/test/sysutils/less.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -10,6 +10,7 @@ match_max 100000
10send -- "firejail less sysutils.sh\r" 10send -- "firejail less sysutils.sh\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 12 timeout {puts "TESTING ERROR 1\n";exit}
13 "(press RETURN)" {puts "TESTING SKIP 1.1\n";exit}
13 "MALLOC_CHECK" 14 "MALLOC_CHECK"
14} 15}
15expect { 16expect {
diff --git a/test/sysutils/ping.exp b/test/sysutils/ping.exp
new file mode 100755
index 000000000..fac4b2ac3
--- /dev/null
+++ b/test/sysutils/ping.exp
@@ -0,0 +1,23 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "ping -c 3 yahoo.com\r"
11expect {
12 timeout {puts "TESTING SKIP: no internet connection\n";exit}
13 "3 packets transmitted, 3 received"
14}
15after 100
16
17send -- "firejail ping -c 3 yahoo.com\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "3 packets transmitted, 3 received"
21}
22after 100
23puts "\nall done\n"
diff --git a/test/sysutils/strings.exp b/test/sysutils/strings.exp
index 0d18b8079..7c91fb78a 100755
--- a/test/sysutils/strings.exp
+++ b/test/sysutils/strings.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh
index 859d782c6..96962d324 100755
--- a/test/sysutils/sysutils.sh
+++ b/test/sysutils/sysutils.sh
@@ -1,12 +1,13 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9which cpio 10which cpio 2>/dev/null
10if [ "$?" -eq 0 ]; 11if [ "$?" -eq 0 ];
11then 12then
12 echo "TESTING: cpio" 13 echo "TESTING: cpio"
@@ -24,7 +25,7 @@ fi
24# echo "TESTING SKIP: strings not found" 25# echo "TESTING SKIP: strings not found"
25#fi 26#fi
26 27
27which gzip 28which gzip 2>/dev/null
28if [ "$?" -eq 0 ]; 29if [ "$?" -eq 0 ];
29then 30then
30 echo "TESTING: gzip" 31 echo "TESTING: gzip"
@@ -33,7 +34,7 @@ else
33 echo "TESTING SKIP: gzip not found" 34 echo "TESTING SKIP: gzip not found"
34fi 35fi
35 36
36which xzdec 37which xzdec 2>/dev/null
37if [ "$?" -eq 0 ]; 38if [ "$?" -eq 0 ];
38then 39then
39 echo "TESTING: xzdec" 40 echo "TESTING: xzdec"
@@ -42,7 +43,7 @@ else
42 echo "TESTING SKIP: xzdec not found" 43 echo "TESTING SKIP: xzdec not found"
43fi 44fi
44 45
45which xz 46which xz 2>/dev/null
46if [ "$?" -eq 0 ]; 47if [ "$?" -eq 0 ];
47then 48then
48 echo "TESTING: xz" 49 echo "TESTING: xz"
@@ -51,7 +52,7 @@ else
51 echo "TESTING SKIP: xz not found" 52 echo "TESTING SKIP: xz not found"
52fi 53fi
53 54
54which less 55which less 2>/dev/null
55if [ "$?" -eq 0 ]; 56if [ "$?" -eq 0 ];
56then 57then
57 echo "TESTING: less" 58 echo "TESTING: less"
@@ -60,7 +61,7 @@ else
60 echo "TESTING SKIP: less not found" 61 echo "TESTING SKIP: less not found"
61fi 62fi
62 63
63which file 64which file 2>/dev/null
64if [ "$?" -eq 0 ]; 65if [ "$?" -eq 0 ];
65then 66then
66 echo "TESTING: file" 67 echo "TESTING: file"
@@ -69,7 +70,7 @@ else
69 echo "TESTING SKIP: file not found" 70 echo "TESTING SKIP: file not found"
70fi 71fi
71 72
72which tar 73which tar 2>/dev/null
73if [ "$?" -eq 0 ]; 74if [ "$?" -eq 0 ];
74then 75then
75 echo "TESTING: tar" 76 echo "TESTING: tar"
@@ -77,3 +78,12 @@ then
77else 78else
78 echo "TESTING SKIP: tar not found" 79 echo "TESTING SKIP: tar not found"
79fi 80fi
81
82which ping 2>/dev/null
83if [ "$?" -eq 0 ];
84then
85 echo "TESTING: ping"
86 ./ping.exp
87else
88 echo "TESTING SKIP: ping not found"
89fi
diff --git a/test/sysutils/tar.exp b/test/sysutils/tar.exp
index 989f9ada2..60e05f847 100755
--- a/test/sysutils/tar.exp
+++ b/test/sysutils/tar.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/sysutils/xz.exp b/test/sysutils/xz.exp
index 13ae6007b..4c6fcea9d 100755
--- a/test/sysutils/xz.exp
+++ b/test/sysutils/xz.exp
@@ -1,9 +1,9 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 60
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
@@ -13,6 +13,9 @@ sleep 1
13send -- "firejail /usr/bin/xz -c /usr/bin/firejail > firejail_t2\r" 13send -- "firejail /usr/bin/xz -c /usr/bin/firejail > firejail_t2\r"
14sleep 1 14sleep 1
15 15
16send -- "md5sum firejail_t1 firejail_t2; ls -l firejail_t1 firejail_t2\r"
17sleep 1
18
16send -- "diff -s firejail_t1 firejail_t2\r" 19send -- "diff -s firejail_t1 firejail_t2\r"
17expect { 20expect {
18 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
diff --git a/test/sysutils/xzdec.exp b/test/sysutils/xzdec.exp
index 0f3b3ba08..737517d54 100755
--- a/test/sysutils/xzdec.exp
+++ b/test/sysutils/xzdec.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/test.rv b/test/test.rv
deleted file mode 100644
index 98a04fba2..000000000
--- a/test/test.rv
+++ /dev/null
@@ -1,49 +0,0 @@
1# run it as:
2# ../src/tools/rvtest test.rv 2>/dev/null | grep TESTING
3#
4
5
6# invalid options
71 firejail -blablabla
81 firejail --blablabla
91 firejail --debug --blablabla
10
11# misc options
120 firejail --help
130 firejail --list
14
15# network testing
160 firejail --net=none exit
171 firejail --ip=none --net=none exit # noip requires at least one network
180 firejail --net=br0 exit
191 firejail --net=none --net=br0 exit # --net and --net=none are mutually exclusive
201 firejail --ip=none exit # noip requires at least one network
211 firejail --defaultgw=10.10.20.1 # no bridge configured
220 firejail --net=br0 --ip=10.10.20.6 exit
231 firejail --net=br0 --ip=192.168.5.6 exit # interface range
241 firejail --net=br0 --ip=10.10 # bad ip
251 firejail --net=br0 --ip=asdf #bad ip
261 firejail --ip=asdf # no bridge configured
270 firejail --net=br0 --defaultgw=10.10.20.1 exit
281 firejail --net=br0 --defaultgw=10.10.20 exit # invalid ip address
291 firejail --net=br0 --defaultgw=asdf exit # invalid ip address
300 firejail --net=br0 --ip=10.10.20.2 --defaultgw=10.10.20.1 exit
310 firejail --net=br0 --net=br1 --net=br2 --net=br3 exit
321 firejail --net
331 firejail --net=
341 firejail --net=bingo
351 firejail --net=loopback
361 firejail --net=lo #invalid network device
371 firejail --net=/br0 exit
381 firejail --net=br0 --net=br1 --net=br2 --net=br3 --net=br4 exit # only 4 networks allowed
390 firejail --net=eth0 exit
401 firejail --net=/dev/eth0 exit
411 firejail --net=br0 --net=br1 --net=/dev/eth0 exit
420 firejail --net=br0 --net=br0 exit # same device twice
430 firejail --net=eth0 --net=br2 --net=br3 --net=eth0 exit # same device twice
440 firejail --net=eth0 --net=br0 exit
45
46# private mode
470 firejail --private exit
481 firejail --private=/etc sleep 1
491 firejail --private=bingo sleep 1
diff --git a/test/test.sh b/test/test.sh
deleted file mode 100755
index 2693cb702..000000000
--- a/test/test.sh
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6./chk_config.exp
7
8./fscheck.sh
9
10echo "TESTING: tty (tty.exp)"
11./tty.exp
12
13sleep 1
14rm -fr dir\ with\ space
15mkdir dir\ with\ space
16echo "TESTING: blacklist (blacklist.exp)"
17./blacklist.exp
18sleep 1
19rm -fr dir\ with\ space
20
21ln -s auto auto2
22ln -s /bin auto3
23ln -s /usr/bin auto4
24echo "TESTING: blacklist directory link (blacklist-link.exp)"
25./blacklist-link.exp
26rm -fr auto2
27rm -fr auto3
28rm -fr auto4
29
30echo "TESTING: chroot overlay (option_chroot_overlay.exp)"
31./option_chroot_overlay.exp
32
33echo "TESTING: chroot as user (fs_chroot.exp)"
34./fs_chroot.exp
35
36echo "TESTING: /sys (fs_sys.exp)"
37./fs_sys.exp
38
39echo "TESTING: readonly (option_readonly.exp)"
40ls -al > tmpreadonly
41./option_readonly.exp
42sleep 5
43rm -f tmpreadonly
44
45
46
47echo "TESTING: private directory (private_dir.exp)"
48rm -fr dirprivate
49mkdir dirprivate
50./private_dir.exp
51rm -fr dirprivate
52
53echo "TESTING: private directory profile (private_dir_profile.exp)"
54rm -fr dirprivate
55mkdir dirprivate
56./private_dir_profile.exp
57rm -fr dirprivate
58
59echo "TESTING: overlayfs (fs_overlay.exp)"
60./fs_overlay.exp
61
62echo "TESTING: login SSH (login_ssh.exp)"
63./login_ssh.exp
64
65echo "TESTING: firemon --arp (firemon-arp.exp)"
66./firemon-arp.exp
67
68echo "TESTING: firemon --route (firemon-route.exp)"
69./firemon-route.exp
diff --git a/test/utils/audit.exp b/test/utils/audit.exp
deleted file mode 100755
index f0c1906a0..000000000
--- a/test/utils/audit.exp
+++ /dev/null
@@ -1,79 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --audit\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Firejail Audit"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "is running in a PID namespace"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "container/sandbox firejail"
22}
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "seccomp BPF enabled"
26}
27expect {
28 timeout {puts "TESTING ERROR 4\n";exit}
29 "all capabilities are disabled"
30}
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 "dev directory seems to be fully populated"
34}
35after 100
36
37
38send -- "firejail --audit\r"
39expect {
40 timeout {puts "TESTING ERROR 6\n";exit}
41 "Firejail Audit"
42}
43expect {
44 timeout {puts "TESTING ERROR 7\n";exit}
45 "is running in a PID namespace"
46}
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "container/sandbox firejail"
50}
51expect {
52 timeout {puts "TESTING ERROR 9\n";exit}
53 "seccomp BPF enabled"
54}
55expect {
56 timeout {puts "TESTING ERROR 10\n";exit}
57 "all capabilities are disabled"
58}
59expect {
60 timeout {puts "TESTING ERROR 11\n";exit}
61 "dev directory seems to be fully populated"
62}
63after 100
64
65send -- "firejail --audit=blablabla\r"
66expect {
67 timeout {puts "TESTING ERROR 12\n";exit}
68 "cannot find the audit program"
69}
70after 100
71
72send -- "firejail --audit=\r"
73expect {
74 timeout {puts "TESTING ERROR 12\n";exit}
75 "invalid audit program"
76}
77after 100
78
79puts "\nall done\n"
diff --git a/test/utils/build.exp b/test/utils/build.exp
new file mode 100755
index 000000000..104ac037c
--- /dev/null
+++ b/test/utils/build.exp
@@ -0,0 +1,112 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "echo testing > ~/_firejail-test-file\r"
11after 100
12
13send -- "firejail --build cat ~/_firejail-test-file\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "allow $\{HOME\}/_firejail-test-file"
17}
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "include whitelist-common.inc"
21}
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 "include whitelist-usr-share-common.inc"
25}
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "include whitelist-var-common.inc"
29}
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "caps.drop all"
33}
34expect {
35 timeout {puts "TESTING ERROR 5\n";exit}
36 "ipc-namespace"
37}
38expect {
39 timeout {puts "TESTING ERROR 6\n";exit}
40 "netfilter"
41}
42expect {
43 timeout {puts "TESTING ERROR 7\n";exit}
44 "nonewprivs"
45}
46expect {
47 timeout {puts "TESTING ERROR 8\n";exit}
48 "noroot"
49}
50expect {
51 timeout {puts "TESTING ERROR 9\n";exit}
52 "net none"
53}
54expect {
55 timeout {puts "TESTING ERROR 10\n";exit}
56 "seccomp"
57}
58expect {
59 timeout {puts "TESTING ERROR 11\n";exit}
60 "shell none"
61}
62expect {
63 timeout {puts "TESTING ERROR 11\n";exit}
64 "private-bin cat,"
65}
66expect {
67 timeout {puts "TESTING ERROR 12\n";exit}
68 "private-dev"
69}
70expect {
71 timeout {puts "TESTING ERROR 13\n";exit}
72 "private-etc none"
73}
74expect {
75 timeout {puts "TESTING ERROR 14\n";exit}
76 "private-tmp"
77}
78after 100
79
80send -- "rm -f ~/_firejail-test-file\r"
81after 100
82
83send -- "firejail --build cat /etc/passwd\r"
84expect {
85 timeout {puts "TESTING ERROR 10\n";exit}
86 "private-etc passwd,"
87}
88after 100
89
90send -- "rm firejail-test-file-4388\r"
91after 100
92send -- "firejail --build=firejail-test-file-4388 cat /etc/passwd\r"
93after 100
94send -- "cat firejail-test-file-4388\r"
95expect {
96 timeout {puts "TESTING ERROR 10.1\n";exit}
97 "private-etc passwd,"
98}
99after 100
100
101send -- "firejail --build wget --output-document=~ debian.org\r"
102expect {
103 timeout {puts "TESTING ERROR 13\n";exit}
104 "protocol"
105}
106expect {
107 timeout {puts "TESTING ERROR 13.1\n";exit}
108 "inet"
109}
110after 100
111
112puts "all done\n"
diff --git a/test/utils/caps-print.exp b/test/utils/caps-print.exp
index d9d48bd50..6b6090476 100755
--- a/test/utils/caps-print.exp
+++ b/test/utils/caps-print.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/caps2.profile b/test/utils/caps2.profile
index cb2258c52..e760d4cb5 100644
--- a/test/utils/caps2.profile
+++ b/test/utils/caps2.profile
@@ -1 +1 @@
caps.keep chown,kill \ No newline at end of file caps.keep chown,kill
diff --git a/test/utils/catchsignal-master.sh b/test/utils/catchsignal-master.sh
index 62a1801cc..28e646ddb 100755
--- a/test/utils/catchsignal-master.sh
+++ b/test/utils/catchsignal-master.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3./catchsignal.sh & 6./catchsignal.sh &
4./catchsignal.sh & 7./catchsignal.sh &
diff --git a/test/utils/catchsignal.sh b/test/utils/catchsignal.sh
index 87a1d0adf..f7a501011 100755
--- a/test/utils/catchsignal.sh
+++ b/test/utils/catchsignal.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3_term() { 6_term() {
4 echo "Caught Signal" 7 echo "Caught Signal"
diff --git a/test/utils/catchsignal2.sh b/test/utils/catchsignal2.sh
index 424350397..9ba939ef4 100755
--- a/test/utils/catchsignal2.sh
+++ b/test/utils/catchsignal2.sh
@@ -1,4 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3_term() { 6_term() {
4 echo "Caught Signal" 7 echo "Caught Signal"
diff --git a/test/utils/command.exp b/test/utils/command.exp
new file mode 100755
index 000000000..6cb52a7fa
--- /dev/null
+++ b/test/utils/command.exp
@@ -0,0 +1,23 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --quiet --private-etc=passwd,group -c ls -al /etc\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "cron" {puts "TESTING ERROR 2\n";exit}
14 "group"
15}
16expect {
17 timeout {puts "TESTING ERROR 3\n";exit}
18 "passwd"
19}
20
21
22after 100
23puts "\nall done\n"
diff --git a/test/utils/cpu-print.exp b/test/utils/cpu-print.exp
index f639f7c9f..e7d709cee 100755
--- a/test/utils/cpu-print.exp
+++ b/test/utils/cpu-print.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -16,7 +16,11 @@ sleep 1
16send -- "cat /proc/self/status | grep Cpus\r" 16send -- "cat /proc/self/status | grep Cpus\r"
17expect { 17expect {
18 timeout {puts "TESTING ERROR 1\n";exit} 18 timeout {puts "TESTING ERROR 1\n";exit}
19 "Cpus_allowed_list: 0" 19 "Cpus"
20}
21expect {
22 timeout {puts "TESTING ERROR 2\n";exit}
23 "_allowed_list: 0"
20} 24}
21after 100 25after 100
22send -- "exit\r" 26send -- "exit\r"
@@ -25,7 +29,7 @@ sleep 1
25 29
26send -- "firejail --name=test --cpu=1\r" 30send -- "firejail --name=test --cpu=1\r"
27expect { 31expect {
28 timeout {puts "TESTING ERROR 1\n";exit} 32 timeout {puts "TESTING ERROR 3\n";exit}
29 "Child process initialized" 33 "Child process initialized"
30} 34}
31sleep 1 35sleep 1
@@ -33,8 +37,12 @@ sleep 1
33spawn $env(SHELL) 37spawn $env(SHELL)
34send -- "firejail --cpu.print=test\r" 38send -- "firejail --cpu.print=test\r"
35expect { 39expect {
36 timeout {puts "TESTING ERROR 2\n";exit} 40 timeout {puts "TESTING ERROR 4\n";exit}
37 "Cpus_allowed_list: 1" 41 "Cpus"
42}
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 "_allowed_list: 1"
38} 46}
39after 100 47after 100
40puts "\nall done\n" 48puts "\nall done\n"
diff --git a/test/utils/dns-print.exp b/test/utils/dns-print.exp
index 461231735..b3b732bee 100755
--- a/test/utils/dns-print.exp
+++ b/test/utils/dns-print.exp
@@ -1,13 +1,13 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --name=test --dns=1.2.3.4\r" 10send -- "firejail --name=test --dns=1.2.3.4 --dns=::2\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 13 "Child process initialized"
@@ -20,5 +20,9 @@ expect {
20 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
21 "nameserver 1.2.3.4" 21 "nameserver 1.2.3.4"
22} 22}
23expect {
24 timeout {puts "TESTING ERROR 2\n";exit}
25 "nameserver ::2"
26}
23after 100 27after 100
24puts "\nall done\n" 28puts "\nall done\n"
diff --git a/test/utils/firemon-caps.exp b/test/utils/firemon-caps.exp
index 67bf853fe..837d08271 100755
--- a/test/utils/firemon-caps.exp
+++ b/test/utils/firemon-caps.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/firemon-cgroup.exp b/test/utils/firemon-cgroup.exp
index 43dfc4107..3976b0c50 100755
--- a/test/utils/firemon-cgroup.exp
+++ b/test/utils/firemon-cgroup.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/firemon-cpu.exp b/test/utils/firemon-cpu.exp
index adc6b3d45..b410c764e 100755
--- a/test/utils/firemon-cpu.exp
+++ b/test/utils/firemon-cpu.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/firemon-interface.exp b/test/utils/firemon-interface.exp
index 4c976b42f..0c358d129 100755
--- a/test/utils/firemon-interface.exp
+++ b/test/utils/firemon-interface.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/firemon-name.exp b/test/utils/firemon-name.exp
index 37bfdd3b0..57729d662 100755
--- a/test/utils/firemon-name.exp
+++ b/test/utils/firemon-name.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/firemon-seccomp.exp b/test/utils/firemon-seccomp.exp
index 56727a0be..d35027827 100755
--- a/test/utils/firemon-seccomp.exp
+++ b/test/utils/firemon-seccomp.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/firemon-version.exp b/test/utils/firemon-version.exp
index 94f72e454..8e4e33ec0 100755
--- a/test/utils/firemon-version.exp
+++ b/test/utils/firemon-version.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/fs-print.exp b/test/utils/fs-print.exp
index 11b4c9b7e..4b6eac391 100755
--- a/test/utils/fs-print.exp
+++ b/test/utils/fs-print.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -22,11 +22,12 @@ expect {
22} 22}
23expect { 23expect {
24 timeout {puts "TESTING ERROR 2\n";exit} 24 timeout {puts "TESTING ERROR 2\n";exit}
25 "blacklist /dev/kmsg" 25 "blacklist /proc/kmsg"
26} 26}
27expect { 27expect {
28 timeout {puts "TESTING ERROR 3\n";exit} 28 timeout {puts "TESTING ERROR 3\n";exit}
29 "blacklist /proc/kmsg" 29 "blacklist /usr/bin/su" {puts "Arch Linux";}
30 "blacklist /bin/su" {puts "Debian"}
30} 31}
31after 100 32after 100
32puts "\nall done\n" 33puts "\nall done\n"
diff --git a/test/utils/help.exp b/test/utils/help.exp
index 435f8e061..71bb5788c 100755
--- a/test/utils/help.exp
+++ b/test/utils/help.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/join-profile.exp b/test/utils/join-profile.exp
index 716bd2947..d6fcc50d7 100755
--- a/test/utils/join-profile.exp
+++ b/test/utils/join-profile.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/utils/join.exp b/test/utils/join.exp
index d5c421676..25dd31922 100755
--- a/test/utils/join.exp
+++ b/test/utils/join.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/join2.exp b/test/utils/join2.exp
index 0c1fa6684..dada97158 100755
--- a/test/utils/join2.exp
+++ b/test/utils/join2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/join3.exp b/test/utils/join3.exp
index 968aa3008..305000e92 100755
--- a/test/utils/join3.exp
+++ b/test/utils/join3.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/join4.exp b/test/utils/join4.exp
index 27f52fd56..8c5e91d68 100755
--- a/test/utils/join4.exp
+++ b/test/utils/join4.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/join5.exp b/test/utils/join5.exp
new file mode 100755
index 000000000..3d365944d
--- /dev/null
+++ b/test/utils/join5.exp
@@ -0,0 +1,46 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test123 --profile=join5.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 5\n";exit}
13 "Child process initialized"
14}
15sleep 1
16spawn $env(SHELL)
17send -- "firejail --join=test123\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "Switching to pid"
21}
22sleep 1
23send -- "ps aux\r"
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "/bin/bash"
27}
28expect {
29 timeout {puts "TESTING ERROR 3\n";exit}
30 "/bin/bash"
31}
32
33send -- "exit\r"
34after 100
35
36send -- "firejail --protocol.print=test123\r"
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 "Switching to pid"
40}
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 "unix"
44}
45
46puts "\nall done\n"
diff --git a/test/utils/join5.profile b/test/utils/join5.profile
new file mode 100644
index 000000000..e9eb37a4f
--- /dev/null
+++ b/test/utils/join5.profile
@@ -0,0 +1,4 @@
1dbus-user filter
2dbus-system none
3seccomp
4protocol unix
diff --git a/test/utils/list.exp b/test/utils/list.exp
index 5b34b4866..d7d39357d 100755
--- a/test/utils/list.exp
+++ b/test/utils/list.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/ls.exp b/test/utils/ls.exp
index ff6867c51..080bfdad2 100755
--- a/test/utils/ls.exp
+++ b/test/utils/ls.exp
@@ -1,4 +1,7 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
2 5
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $env(SHELL)
diff --git a/test/utils/man.exp b/test/utils/man.exp
index 71dc703aa..41f5a2ff8 100755
--- a/test/utils/man.exp
+++ b/test/utils/man.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -10,6 +10,7 @@ match_max 100000
10send -- "man firejail\r" 10send -- "man firejail\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "(press RETURN)" {puts "TESTING SKIP 1.1\n";exit}
13 "Linux namespaces sandbox program" 14 "Linux namespaces sandbox program"
14} 15}
15after 100 16after 100
diff --git a/test/utils/name.exp b/test/utils/name.exp
new file mode 100755
index 000000000..9e5367ba7
--- /dev/null
+++ b/test/utils/name.exp
@@ -0,0 +1,157 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --name=ftest\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16after 100
17
18spawn $env(SHELL)
19send -- "firejail --name=ftest\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "Child process initialized"
23}
24after 100
25
26spawn $env(SHELL)
27send -- "firejail --name=ftest\r"
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "Child process initialized"
31}
32after 100
33
34spawn $env(SHELL)
35send -- "firejail --name=ftest\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "Child process initialized"
39}
40after 100
41
42spawn $env(SHELL)
43send -- "firejail --name=ftest\r"
44expect {
45 timeout {puts "TESTING ERROR 4\n";exit}
46 "Child process initialized"
47}
48after 100
49
50spawn $env(SHELL)
51send -- "firejail --name=ftest\r"
52expect {
53 timeout {puts "TESTING ERROR 5\n";exit}
54 "Child process initialized"
55}
56after 100
57
58spawn $env(SHELL)
59send -- "firejail --name=ftest\r"
60expect {
61 timeout {puts "TESTING ERROR 6\n";exit}
62 "Child process initialized"
63}
64after 100
65
66spawn $env(SHELL)
67send -- "firejail --name=ftest\r"
68expect {
69 timeout {puts "TESTING ERROR 7\n";exit}
70 "Child process initialized"
71}
72after 100
73
74spawn $env(SHELL)
75send -- "firejail --name=ftest\r"
76expect {
77 timeout {puts "TESTING ERROR 8\n";exit}
78 "Child process initialized"
79}
80after 100
81
82spawn $env(SHELL)
83send -- "firejail --name=ftest\r"
84expect {
85 timeout {puts "TESTING ERROR 9\n";exit}
86 "Child process initialized"
87}
88after 100
89
90spawn $env(SHELL)
91send -- "firejail --name=ftest\r"
92expect {
93 timeout {puts "TESTING ERROR 10\n";exit}
94 "Child process initialized"
95}
96after 100
97
98spawn $env(SHELL)
99send -- "firejail --name=ftest\r"
100expect {
101 timeout {puts "TESTING ERROR 11\n";exit}
102 "Child process initialized"
103}
104after 100
105
106spawn $env(SHELL)
107send -- "firejail --list\r"
108expect {
109 timeout {puts "TESTING ERROR 12\n";exit}
110 ":ftest:"
111}
112expect {
113 timeout {puts "TESTING ERROR 13\n";exit}
114 ":ftest-"
115}
116expect {
117 timeout {puts "TESTING ERROR 14\n";exit}
118 ":ftest-"
119}
120expect {
121 timeout {puts "TESTING ERROR 15\n";exit}
122 ":ftest-"
123}
124expect {
125 timeout {puts "TESTING ERROR 16\n";exit}
126 ":ftest-"
127}
128expect {
129 timeout {puts "TESTING ERROR 17\n";exit}
130 ":ftest-"
131}
132expect {
133 timeout {puts "TESTING ERROR 18\n";exit}
134 ":ftest-"
135}
136expect {
137 timeout {puts "TESTING ERROR 19\n";exit}
138 ":ftest-"
139}
140expect {
141 timeout {puts "TESTING ERROR 20\n";exit}
142 ":ftest-"
143}
144expect {
145 timeout {puts "TESTING ERROR 21\n";exit}
146 ":ftest-"
147}
148expect {
149 timeout {puts "TESTING ERROR 22\n";exit}
150 ":ftest-"
151}
152expect {
153 timeout {puts "TESTING ERROR 23\n";exit}
154 ":ftest-"
155}
156sleep 1
157puts "all done\n"
diff --git a/test/utils/profile_print.exp b/test/utils/profile_print.exp
new file mode 100755
index 000000000..f8f6708bb
--- /dev/null
+++ b/test/utils/profile_print.exp
@@ -0,0 +1,27 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --name=ftest\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16after 100
17
18spawn $env(SHELL)
19send -- "firejail --profile.print=ftest\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "/etc/firejail/default.profile"
23}
24
25
26after 100
27puts "all done\n"
diff --git a/test/utils/protocol-print.exp b/test/utils/protocol-print.exp
index 12ad98a41..1ed92ddd6 100755
--- a/test/utils/protocol-print.exp
+++ b/test/utils/protocol-print.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/seccomp-print.exp b/test/utils/seccomp-print.exp
index b3ab5e13c..86f1e9845 100755
--- a/test/utils/seccomp-print.exp
+++ b/test/utils/seccomp-print.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
@@ -18,19 +18,19 @@ spawn $env(SHELL)
18send -- "firejail --seccomp.print=test\r" 18send -- "firejail --seccomp.print=test\r"
19expect { 19expect {
20 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
21 "EXAMINE_SYSCAL" 21 "ld data.syscall-number"
22} 22}
23expect { 23expect {
24 timeout {puts "TESTING ERROR 2\n";exit} 24 timeout {puts "TESTING ERROR 2\n";exit}
25 "delete_module" 25 "jeq delete_module"
26} 26}
27expect { 27expect {
28 timeout {puts "TESTING ERROR 3\n";exit} 28 timeout {puts "TESTING ERROR 3\n";exit}
29 "init_module" 29 "jeq init_module"
30} 30}
31expect { 31expect {
32 timeout {puts "TESTING ERROR 4\n";exit} 32 timeout {puts "TESTING ERROR 4\n";exit}
33 "RETURN_ALLOW" 33 "ret ALLOW"
34} 34}
35after 100 35after 100
36puts "\nall done\n" 36puts "\nall done\n"
diff --git a/test/utils/shutdown.exp b/test/utils/shutdown.exp
index eb87c5d4f..35d2750db 100755
--- a/test/utils/shutdown.exp
+++ b/test/utils/shutdown.exp
@@ -1,9 +1,9 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 15
7cd /home 7cd /home
8spawn $env(SHELL) 8spawn $env(SHELL)
9match_max 100000 9match_max 100000
@@ -16,9 +16,11 @@ expect {
16sleep 2 16sleep 2
17 17
18spawn $env(SHELL) 18spawn $env(SHELL)
19send -- "stty -echo\r"
20after 100
19send -- "firejail --shutdown=shutdowntesting; echo done\r" 21send -- "firejail --shutdown=shutdowntesting; echo done\r"
20expect { 22expect {
21 timeout {puts "TESTING ERROR 4\n";exit} 23 timeout {puts "TESTING ERROR 1\n";exit}
22 "done" 24 "done"
23} 25}
24sleep 5 26sleep 5
@@ -26,20 +28,20 @@ sleep 5
26spawn $env(SHELL) 28spawn $env(SHELL)
27send -- "firejail --list;echo done\r" 29send -- "firejail --list;echo done\r"
28expect { 30expect {
29 timeout {puts "TESTING ERROR 5\n";exit} 31 timeout {puts "TESTING ERROR 2\n";exit}
30 "shutdowntesting" {puts "TESTING ERROR 6\n";exit} 32 "shutdowntesting" {puts "TESTING ERROR 3\n";exit}
31 "done" 33 "done"
32} 34}
33sleep 1 35sleep 1
34 36
35send -- "firejail --shutdown=sutdowntesting\r" 37send -- "firejail --shutdown=sutdowntesting\r"
36expect { 38expect {
37 timeout {puts "TESTING ERROR 5\n";exit} 39 timeout {puts "TESTING ERROR 4\n";exit}
38 "cannot find sandbox sutdowntesting" 40 "cannot find sandbox sutdowntesting"
39} 41}
40after 100 42after 100
41 43
42send -- "firejail --shutdown=10\r" 44send -- "firejail --shutdown=1\r"
43expect { 45expect {
44 timeout {puts "TESTING ERROR 5\n";exit} 46 timeout {puts "TESTING ERROR 5\n";exit}
45 "this is not a firejail sandbox" 47 "this is not a firejail sandbox"
diff --git a/test/utils/shutdown2.exp b/test/utils/shutdown2.exp
index f92c8b2b1..7eb3d516b 100755
--- a/test/utils/shutdown2.exp
+++ b/test/utils/shutdown2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/shutdown3.exp b/test/utils/shutdown3.exp
index 4c2c616b2..a543bb9e5 100755
--- a/test/utils/shutdown3.exp
+++ b/test/utils/shutdown3.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/shutdown4.exp b/test/utils/shutdown4.exp
index 7d3c27164..a9a3978ea 100755
--- a/test/utils/shutdown4.exp
+++ b/test/utils/shutdown4.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/top.exp b/test/utils/top.exp
index 73903d11f..150011bba 100755
--- a/test/utils/top.exp
+++ b/test/utils/top.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/trace.exp b/test/utils/trace.exp
index 614580016..3ed09565b 100755
--- a/test/utils/trace.exp
+++ b/test/utils/trace.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 30 6set timeout 30
diff --git a/test/utils/tree.exp b/test/utils/tree.exp
index a64c98bca..ff834bec6 100755
--- a/test/utils/tree.exp
+++ b/test/utils/tree.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index a59a9544f..e3e24bd9a 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -1,13 +1,31 @@
1#!/bin/bash 1#!/bin/bash
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
8 9
9echo "TESTING: audit (test/utils/audit.exp)" 10if [ -f /etc/debian_version ]; then
10./audit.exp 11 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)")
12 export PATH="$PATH:$libdir"
13fi
14export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
15
16echo "TESTING: build (test/utils/build.exp)"
17./build.exp
18rm -f ~/_firejail-test-file
19rm -f _firejail-test-file
20
21echo "TESTING: name (test/utils/name.exp)"
22./name.exp
23
24echo "TESTING: command (test/utils/command.exp)"
25./command.exp
26
27echo "TESTING: profile.print (test/utils/profile_print.exp)"
28./profile_print.exp
11 29
12echo "TESTING: version (test/utils/version.exp)" 30echo "TESTING: version (test/utils/version.exp)"
13./version.exp 31./version.exp
@@ -15,7 +33,7 @@ echo "TESTING: version (test/utils/version.exp)"
15echo "TESTING: help (test/utils/help.exp)" 33echo "TESTING: help (test/utils/help.exp)"
16./help.exp 34./help.exp
17 35
18which man 36which man 2>/dev/null
19if [ "$?" -eq 0 ]; 37if [ "$?" -eq 0 ];
20then 38then
21 echo "TESTING: man (test/utils/man.exp)" 39 echo "TESTING: man (test/utils/man.exp)"
@@ -74,9 +92,12 @@ echo "TESTING: join2 (test/utils/join2.exp)"
74echo "TESTING: join3 (test/utils/join3.exp)" 92echo "TESTING: join3 (test/utils/join3.exp)"
75./join3.exp 93./join3.exp
76 94
77echo "TESTING: join3 (test/utils/join4.exp)" 95echo "TESTING: join4 (test/utils/join4.exp)"
78./join4.exp 96./join4.exp
79 97
98echo "TESTING: join5 (test/utils/join5.exp)"
99./join5.exp
100
80echo "TESTING: join profile (test/utils/join-profile.exp)" 101echo "TESTING: join profile (test/utils/join-profile.exp)"
81./join-profile.exp 102./join-profile.exp
82 103
@@ -91,11 +112,19 @@ echo "TESTING: top (test/utils/top.exp)"
91echo "TESTING: file transfer (test/utils/ls.exp)" 112echo "TESTING: file transfer (test/utils/ls.exp)"
92./ls.exp 113./ls.exp
93 114
94echo "TESTING: firemon seccomp (test/utils/firemon-seccomp.exp)" 115if grep -q "^Seccomp.*0" /proc/self/status; then
95./firemon-seccomp.exp 116 echo "TESTING: firemon seccomp (test/utils/firemon-seccomp.exp)"
117 ./firemon-seccomp.exp
118else
119 echo "TESTING SKIP: seccomp already active (test/utils/firemon-seccomp.exp)"
120fi
96 121
97echo "TESTING: firemon caps (test/utils/firemon-caps.exp)" 122if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then
98./firemon-caps.exp 123 echo "TESTING: firemon caps (test/utils/firemon-caps.exp)"
124 ./firemon-caps.exp
125else
126 echo "TESTING SKIP: other capabilities than expected (test/utils/firemon-caps.exp)"
127fi
99 128
100echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" 129echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)"
101./firemon-cpu.exp 130./firemon-cpu.exp
diff --git a/test/utils/version.exp b/test/utils/version.exp
index 35dfc1c86..be0d152b8 100755
--- a/test/utils/version.exp
+++ b/test/utils/version.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# This file is part of Firejail project 2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors 3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2 4# License GPL v2
5 5
6set timeout 10 6set timeout 10
diff --git a/video.png b/video.png
deleted file mode 100644
index f9642f466..000000000
--- a/video.png
+++ /dev/null
Binary files differ