Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Exclude certain programs with firecfg? #3016

Closed
rieje opened this issue Oct 29, 2019 · 6 comments
Closed

[feature request] Exclude certain programs with firecfg? #3016

rieje opened this issue Oct 29, 2019 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@rieje
Copy link

rieje commented Oct 29, 2019

Currently, I have firecfg called as a pacman hook when updating my system--useful for automatically using firejail with new programs. However, I'm currently debugging LibreOffice (finding it very difficult to have a decent experience with Firefox and the clipboard) and would like to exclude that from firecfg.

What's a good workaround? chattr +i doesn't work on symlinks.

@glitsj16
Copy link
Collaborator

Until a native feature is integrated to do what you want, I'd place a small wrapper script in /usr/local/bin/firecfg and disable/enable any applications before running the real deal firecfg. Call it with 'skip' to keep state. Point your pacman hook to this script and debug LibreOffice until you're done. Something like the below should work [untested]:

#!/bin/sh
#
# disable/enable applications from firecfg

### vars
_bin="/usr/bin/firecfg"
_conf="/usr/lib/firejail/firecfg.config"

### logic
# triage
case "$1" in
    disable)
	for _app in libreoffice lobase localc lodraw loffice lofromtemplate \
	    loimpress lomath loweb lowriter soffice; do
		sed -i -e "s/${_app}/#${_app}/" "$_conf"
	done
	;;
    enable)
	for _app in libreoffice lobase localc lodraw loffice lofromtemplate \
	    loimpress lomath loweb lowriter soffice; do
		sed -i -e "s/#${_app}/${_app}/" "$_conf"
	done
	;;
    skip)
	true
	;;
esac

# ensure firecfg gets the options it understands
shift

# run the real deal
${_bin} "$@"

@rusty-snake
Copy link
Collaborator

what about

firecfg
cd /usr/local/bin
rm libreoffice localc ...

@rusty-snake
Copy link
Collaborator

Duplicate of #2097

@rusty-snake rusty-snake marked this as a duplicate of #2097 Oct 29, 2019
@rusty-snake rusty-snake added the duplicate This issue or pull request already exists label Oct 29, 2019
@rusty-snake
Copy link
Collaborator

and #2829. Looks like a realy wanted feature.

@rusty-snake
Copy link
Collaborator

The long time goal here would be file based (see discussions in #2829 and #2097), but a fast fix can be something like --ignore=PROGRAM.

@pizzadude
Copy link
Contributor

I have a script in /usr/local/bin/ called "unlinkfirejailapps" which does "unlink appname" in /usr/local/bin/ for the programs I don't want to use firejail with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants