-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
gnome3.gnome-settings-daemon: bypass polkit by using an suid wrapper #54584
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
Conversation
🤔 Is pruning the polkit service away needed so it's not in the environment? |
What do you mean? |
Is removing |
I do not think removing it is necessary – single unused field in some hashmap will not cause any problem. |
This is intended to fix NixOS#14168 untli we have a better solution from upstream GNOME. The issue in brief is caused by the fact that gnome-settings-daemon is non-restartable and if the policy definitions change in any way it won't propagate to the running system because of that. Also take note that we're abusing a debugging envar `GSD_BACKLIGHT_HELPER` as it was never intended for use outside testing.
f1a6abd
to
a9776a1
Compare
Did the thing, also built and ran a vm. This probably needs to be tested on a running machine though. |
Looks like a sensible pair of commits to me! I have not tested it yet though and I could well have missed important details. I have this vague feeling that the entire preFixup hook should only happen when the NixOS module is what's using the gsd package, since otherwise there's no /run/wrappers copy of the helper. I'm not sure if Hydra would build and cache the wrapped version then though? Either way, I wouldn't block merging this PR over that question. |
We could create the wrapper in a separate derivation like we do with plug-in wrappers (e.g. gimp/wrapper.nix). But that would not really help, as the module is not what is running it, gnome-session is. |
I'll try to test this later today. I've abused debugging features like this in the past and it generally goes well. |
@GrahamcOfBorg test gnome3 |
|
||
security.wrappers.gsd-backlight-helper.source = "${pkgs.gnome3.gnome-settings-daemon}/libexec/gsd-backlight-helper"; | ||
|
||
nixpkgs.overlays = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably don't want to be setting overlays in NixOS modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking the same thing, but @jtojnar thought it would be an improvement.
Not sure if hydra will cache it and I don't have any details to support against it.
@GrahamcOfBorg build nixosTests.gnome3 |
So I just realized that the code that allows us to do this in is 3.31. |
Is part of #57027 |
Motivation for this change
This is intended to fix #14168 untli we have a better solution from
upstream GNOME.
cc @jameysharp @hedning @jtojnar
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)