netblue30 / firejail

Linux namespaces and seccomp-bpf sandbox
https://firejail.wordpress.com
GNU General Public License v2.0
5.8k stars 567 forks source link

firecfg: Remove DBusActivatable from .desktop files #1574

Closed SkewedZeppelin closed 7 years ago

SkewedZeppelin commented 7 years ago

Currently certain programs when launched do not spawn under Firejail and are unsandboxed. This can be simply fixed by removing DBusActivatable=true from their corresponding desktop file. firecfg already rewrites hardcoded paths in .desktop files so this should take too much to do.

This would allow the following applications to always launch sandboxed

and these programs if they ever got profiles

and probably many more.

In the mean time, users can run the following command as a workaround

sudo sed -i "s|DBusActivatable=true|DBusActivatable=false|" /usr/share/applications/*.desktop
netblue30 commented 7 years ago

We have a fix in. Before you try it, remove all the files from ~/.local/share/applications directory.

SkewedZeppelin commented 7 years ago

Thanks! It seems a bit broken however...

netblue30 commented 7 years ago

Print the exec and dbus lines creating problems here. I tried pithos on debian stable, it doesn't have the dbus line. What distro are you using?

SkewedZeppelin commented 7 years ago

Here are all the .desktops that are having issues https://gist.github.com/SpotComms/e94c7c9275f7c30921c55f8cde9e9365

And Pithos only got DBusActivatable recently, https://github.com/pithos/pithos/commit/abdadf9fae8afe40f4594154943596dc4017d1af

netblue30 commented 7 years ago

I think I got all of them, thanks for the files. Try again and we'll do another round of fixes if necessary.

SkewedZeppelin commented 7 years ago

It works!

reagentoo commented 2 months ago
$ grep -ri DBusActivatable /usr/share/applications/
/usr/share/applications/org.gnome.Terminal.Preferences.desktop:DBusActivatable=false
/usr/share/applications/org.gnome.Calendar.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Boxes.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Characters.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.DiskUtility.desktop:DBusActivatable=true
/usr/share/applications/ca.desrt.dconf-editor.desktop:DBusActivatable=true
/usr/share/applications/io.bassi.Amberol.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.TextEditor.desktop:DBusActivatable=false
/usr/share/applications/org.gnome.font-viewer.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Screenshot.desktop:DBusActivatable=true
/usr/share/applications/de.haeckerfelix.Fragments.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Ptyxis.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Extensions.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Maps.desktop:DBusActivatable=true
/usr/share/applications/io.github.celluloid_player.Celluloid.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Shell.PortalHelper.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Builder.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Weather.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.clocks.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Software.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Nautilus.desktop:DBusActivatable=true
/usr/share/applications/org.gnome.Console.desktop:DBusActivatable=true

Any new workarounds in 2k24?

rusty-snake commented 2 months ago

Any new workarounds in 2k24?

sed "s/DBusActivatable=true/DBusActivatable=false/g"