mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #5062] firefox: theme changes are not picked up automatically #2868
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#2868
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 @WhyNotHugo on GitHub (Mar 21, 2022).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5062
Firefox does not pick up gtk theme changes automatically when running under firejail, but it does when running without firejail.
Changing the gtk theme on-the-fly only works when configuring it via dconf, so in order to reproduce this, make sure that the
GTK_THEMEenvironment variable is not set and that$HOME/.config/gtk-3.0/settings.inidoes not define any theme either.To change a theme, use something like:
Make sure you're specifying themes that are installed locally.
@rusty-snake commented on GitHub (Mar 21, 2022):
Does
dbus-user.talk org.freedesktop.portal.*fix it?@WhyNotHugo commented on GitHub (Mar 22, 2022):
It does not (this was already in my
firefox.local).Which portal do you think plays a part here? Keep in mind that the settings portal is likely inaccessible: https://github.com/flatpak/xdg-desktop-portal/issues/737
@rusty-snake commented on GitHub (Mar 22, 2022):
Then try with
ignore norootand the above.@rusty-snake commented on GitHub (Mar 22, 2022):
Firefox has code using it
https://searchfox.org/mozilla-central/rev/840881e1232f664a58b39caaae6284c7bcf121df/widget/gtk/nsLookAndFeel.cpp#1304
@WhyNotHugo commented on GitHub (Mar 22, 2022):
Yup, that's the portal affected by https://github.com/flatpak/xdg-desktop-portal/issues/737. I'm working on a fix for that.
@polyzen commented on GitHub (Oct 4, 2023):
Got theme changes via darkman working with:
@WhyNotHugo commented on GitHub (Oct 4, 2023):
I think it's safe to close this; there seems to be a workaround.
@WhyNotHugo commented on GitHub (Oct 4, 2023):
I still don't quite fully understand what
ignore norootdoes. The double negation does mess me up a bit.The docs indicate that
--norootdoesn't create arootuser inside the namespace (but it's still a root-owned namespace, not a user-namesapce, right?).So does
ignore noroot... actually create a root user inside the namespace? Why does that make things work?@ghost commented on GitHub (Oct 4, 2023):
@WhyNotHugo
There's plenty of confusion on the need for
ignore norootin this context. According to what I'm seeing it's enough to allow Firefox to talk to dconf viadbus-user.talk ca.desrt.dconf. On X11 that is. The need forignore norootonly comes into play when usingdbus-user.talk org.freedesktop.portal.Desktop, due tonorootbreaking GTK_USE_PORTAL=1 apparently (as mentioned here and inside /etc/firejail/firefox.profile). That's for a Wayland use case AFAICT. I never really dug any deeper to find out exactly why noroot and portals don't mix...@polyzen commented on GitHub (Oct 4, 2023):
I'm not using Wayland yet, still on X11. Not using
GTK_USE_PORTAL=1either, not quite familiar with that.@ghost commented on GitHub (Oct 4, 2023):
@polyzen In that case, under the conditions OP stated (no GTK_THEME env var and no defined theme in $HOME/.config/gtk-3.0/settings.ini) a firejailed Firefox follows GTK theme changes, regardless of how it is changed (gsettings, GNOME tweaks, that darkman, etcetera) without ignore noroot
@polyzen commented on GitHub (Oct 4, 2023):
I have darkman changing my theme via xdg-desktop-portal (sorry, I should have been more detailed):
https://darkman.whynothugo.nl/#PORTAL
I don't think I've ever had
gsettings set org.gnome.desktop.interface gtk-theme Adwaita-darkwork, with or without firejail.gsettings set org.gnome.desktop.interface color-scheme prefer-darkworked, but Firefox would only pick that up on startup. Can't recall if I've tried this one in combination with firejail.@rusty-snake commented on GitHub (Oct 7, 2023):
Pineapples and bananas.
It does not create a new user-namespace hence no additional ptrace access mode restrictions.
@kmk3 commented on GitHub (Oct 10, 2023):
@WhyNotHugo on Oct 4:
From my understanding of this code:
It creates a new empty user namespace (with no users or groups mapped) and only
maps the current user ID and group ID inside of it.
It then also conditionally maps certain supplementary groups.
That is, other users and groups do not exist in the new user namespace.
For example, given the following "foo" directory:
If the current user ("user5") is part of "group1", then the "foo" directory
should be accessible outside of firejail. If "group1" does not exist in the
user namespace, then the user is not allowed to access the directory, due to
the 750 permissions.
See also
uid_mapandgid_mapinuser_namespaces(7).That just makes firejail ignore subsequent
norootcommands.@WhyNotHugo commented on GitHub (Oct 10, 2023):
This is a very clear explanation, thanks.
The user inside the sandbox ends up being the same one as on the host (e.g.: same UID), which explains why the xdg-desktop-portal's checks works -- because the current user owns the root of the sandbox's file-system and therefore the portal can read its contents.
This is one of those items where I think that Firejail's interface can improve dramatically: because every time I try to reason about this, I no longer understand what's going on until I go back and read your previous explanation again.
It's just a bit of a puzzle to reason about:
norootto negate this default behaviour into using a namespace with external users inside of it. This makes UIDs mismatch between the host and he sandbox.ignore norootto negate the above negation.So
ignore norootcould be though of as!!root, whererootis the command that creates the root user (and others) inside the namespace (e.g.: the current default).Doesn't it make more sense to remove
norootfrom the profiles entirely unless strictly necessary?@rusty-snake commented on GitHub (Oct 10, 2023):
No. The default does not change users.
No. There is no concept of external users and users are identity mapped.
The cause remains to be the ptrace access mode.
Does it make sense to remove [under security option here] from most profiles?
@kmk3 commented on GitHub (Oct 10, 2023):
(
norootdiscussion continued at #6048)