[GH-ISSUE #3016] [feature request] Exclude certain programs with firecfg? #1890

Closed
opened 2026-05-05 08:33:24 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @rieje on GitHub (Oct 29, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3016

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.

Originally created by @rieje on GitHub (Oct 29, 2019). Original GitHub issue: https://github.com/netblue30/firejail/issues/3016 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.
gitea-mirror 2026-05-05 08:33:24 -06:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@ghost commented on GitHub (Oct 29, 2019):

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} "$@"
<!-- gh-comment-id:547252596 --> @ghost commented on GitHub (Oct 29, 2019): 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} "$@" ```
Author
Owner

@rusty-snake commented on GitHub (Oct 29, 2019):

what about

firecfg
cd /usr/local/bin
rm libreoffice localc ...
<!-- gh-comment-id:547336028 --> @rusty-snake commented on GitHub (Oct 29, 2019): what about ```bash firecfg cd /usr/local/bin rm libreoffice localc ... ```
Author
Owner

@rusty-snake commented on GitHub (Oct 29, 2019):

Duplicate of #2097

<!-- gh-comment-id:547336720 --> @rusty-snake commented on GitHub (Oct 29, 2019): Duplicate of #2097
Author
Owner

@rusty-snake commented on GitHub (Oct 29, 2019):

and #2829. Looks like a realy wanted feature.

<!-- gh-comment-id:547337934 --> @rusty-snake commented on GitHub (Oct 29, 2019): and #2829. Looks like a realy wanted feature.
Author
Owner

@rusty-snake commented on GitHub (Oct 29, 2019):

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.

<!-- gh-comment-id:547342541 --> @rusty-snake commented on GitHub (Oct 29, 2019): 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`.
Author
Owner

@pizzadude commented on GitHub (Nov 2, 2019):

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.

<!-- gh-comment-id:549007446 --> @pizzadude commented on GitHub (Nov 2, 2019): 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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#1890
No description provided.