Skip to content

nix: add assertions to make sure dbus can provide pidfd#8

Merged
LordGrimmauld merged 1 commit intoLordGrimmauld:mainfrom
xinyangli:main
Jan 31, 2026
Merged

nix: add assertions to make sure dbus can provide pidfd#8
LordGrimmauld merged 1 commit intoLordGrimmauld:mainfrom
xinyangli:main

Conversation

@xinyangli
Copy link
Copy Markdown
Contributor

@xinyangli xinyangli commented Jan 10, 2026

This PR adds a safety check for the security.polkit.persistentAuthentication option to ensure it actually functions as intended. Currently, this feature can silently fail if the underlying D-Bus implementation is too old to provide the necessary process metadata.

Systemd uses the system-bus-name subject type when communicating with Polkit (systemd/systemd). To verify this subject, Polkit retrieve information about the process via D-Bus (polkit-org/polkit). If the D-Bus implementation is too old to provide pidfd in this process, Polkit will explicitly disables authentication persistence to mitigate PID reuse attacks (polkit-org/polkit).

This matters because dbus-daemon is still the default implementation in NixOS and it has been stuck on 1.14.10 for a long time (NixOS/nixpkgs#386170).

Copy link
Copy Markdown
Owner

@LordGrimmauld LordGrimmauld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no issue with the warnings, and this is a good change. Noisy assertions are better than silent fails. But i don't think we should set broker dbus here.

Tested by @zimward just now, broker vs classic does indeed make all the difference here. Good find!

Sorry for taking a while to get around to this properly, and thank you for the PR.

@LordGrimmauld LordGrimmauld merged commit 8b2946a into LordGrimmauld:main Jan 31, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants