nixos/shadow: use su from sudo-rs when enabled#4
Conversation
When security.sudo-rs.enable is true, use the memory-safe su implementation from sudo-rs instead of the one from shadow.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When
security.sudo-rs.enableistrue, thesusetuid wrapper now uses the memory-safesuimplementation fromsudo-rsinstead of the one from theshadowpackage.Users who opt into
sudo-rslikely want the full benefit of its memory-safe tooling, includingsu.Changes
nixos/modules/programs/shadow.nix: Conditionally set thesuwrapper source tosudo-rs'ssubinary whensecurity.sudo-rs.enableistrue.Testing
Verified with
nix-instantiate --eval:sudo-rs.enable = true→susource resolves to.../sudo-rs-0.2.12/bin/susudo-rs.enable = false→susource resolves to.../shadow-4.19.3-su/bin/suThings done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Summary by CodeRabbit
sucommand to use the correct binary when sudo-rs is enabled in system configuration.