mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2388] Retain firejail-local AppArmor customizations #1593
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1593
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Feb 4, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2388
When installing Firejail a fresh copy of firejail-local gets installed (usually into /etc/apparmor.d/local) by default. While this is fine when users don't add any site-specific additions or overrides to Firejail's default AppArmor profile, this is problematic when they do so. Currently these always seem to get overwritten on each upgrade, causing unnecessary confusion.
This issue usually doesn't show on
Arch Linux, as the official repo package isn't enabling apparmor. Unsure about what happens on RPM-based distros, I have zero-experience with those. But onDebian/Ubuntuand friends this should be reproducible.I only started to use apparmor recently and don't have a lot of experience with it. But it seems to work just fine when enabled on Arch Linux. Am I missing something obvious or is this something we should adress?
@ghost commented on GitHub (Feb 4, 2019):
Follow-up: I think this happens due to the following code-block in Makefile.in:
With a
conditional testto only install firejail-local if it doesn't already exist, this issue/bug could be easily fixed. If only my makefile skills wouldn't be so non-existing I would offer a PR...But perhaps this can be fixed without needing to touch Makefile.in at all. On Arch Linux one can easily add a file like firejail-local to the backup array in a PKGBUILD. This results in avoiding overwriting files which already exists and were previously modified by the user, which is exactly what seems to be needed/wanted here. Yet I am not aware such a mechanism exists on other distros. Maybe something to ask @reinerh?
@reinerh commented on GitHub (Feb 4, 2019):
Good catch! The Debian package indeed also has this problem.
The /etc/apparmor.d/local/ files are not supposed to be installed by the package itself.
A helper script (generated by dh_apparmor) will create them automatically during installation.
I will fix it in the packaging.
But I think firejail's Makefile should also be changed to not install those files.
@reinerh commented on GitHub (Feb 4, 2019):
Just noticed that it's actually not a big issue on Debian, as the file is marked as a "conffile".
When the user has modified such a file and a package update tries to overwrite it, the user is asked what to do (keep/overwrite/review diff).
But the cleaner way is still to not include it in the package and use dh_apparmor instead.
@ghost commented on GitHub (Feb 5, 2019):
@reinerh Thanks for looking into this and for pointing to dh_apparmor. I added a preliminary fix in https://github.com/netblue30/firejail/pull/2390. Tested on Ubuntu 16.04 LTS, but that's with a custom script using checkinstall. Let's hold until someone with actual Makefile skills/experience approves the PR.