Repository navigation
Open
Labels
0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Description
Nixpkgs version
- Unstable (25.05)
Describe the bug
If one of the program wrapping fails, the entire suid-sgid-wrappers.service may fail.
Depending on where it fails, this can cause unix_chkpwd to be missing, and in turn, for any login to fail.
Because of this, this issue was very hard to debug. Especially since using nixos-rebuild switch does not break the system immediately, but only after a reboot.
| ${lib.concatStringsSep "\n" mkWrappedPrograms} |
Steps to reproduce
- Add an incorrect security wrapper, like:
security.wrappers.fails = { source = "${pkgs.hello}/bin/hello"; owner = "root"; group = "root"; capabilties = "cap_sys_nice+ep,cap_sys_nice+pie"; };
nixos-rebuild bootreboot- Enjoy your broken system
Expected behaviour
Only the broken wrapper remains broken
Screenshots
No response
Relevant log output
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: fatal error: Invalid argument
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: usage: setcap [--license] [-f] [-h] [-n <rootid>] [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: Note <filename> must be a regular (non-symlink) file.
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: -r remove capability from file
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: - read capability text from stdin
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: <capsN> cap_from_text(3) formatted file capability
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: [ Note: capsh --suggest="something..." might help you pick. ]
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: --license display the license info
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: -f force setting even when the capability is invalid
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: -h this message and exit status 0
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: -n <rootid> write a user namespace (!= 0) limited capability
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: -q quietly
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: -v validate supplied capability matches file
avril 15 18:12:05 luke-skywalker-nixos suid-sgid-wrappers-start[2789]: argument: cap_setpcap,cap_sys_nice+ep,cap_sys_nice+pie
avril 15 18:12:05 luke-skywalker-nixos systemd[1]: suid-sgid-wrappers.service: Failed with result 'exit-code'.
avril 15 18:12:05 luke-skywalker-nixos systemd[1]: Failed to start Create SUID/SGID WrappersAdditional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.14.2-cachyos, NixOS, 25.05 (Warbler), 25.05pre-git - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.28.1 - nixpkgs:
/nix/store/wq80rglj41byc1bbzj3lfj7pgc3k738m-source
Notify maintainers
@infinisil (There aren't any specific OWNER on this module)
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Reacted by Andrew Marshall
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Activity
aviallon commentedon Apr 15, 2025
Note: this specific bug happened because of
gamemoded's wrapper.As it happen, I had made a wrapper for
gamemodedlong ago, which addedcap_sys_nice+pie.Later, I activated
enabledRenice, which enabled another wrapper. The problem is the following: capabilities were merged, causing this duplicate entry.This should not happen, or duplicates should at least be eliminated.
aviallon commentedon Apr 28, 2025
I may handle this bug myself if I find enough time to do so.
nixos/wrappers: Verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
amarshall commentedon Mar 22, 2026
Just ran into this and was very confused why login was totally broken. Opened PR to add build-time verification #502310
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid
nixos/wrappers: verify that capabilities strings are valid