-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
nixos/pam: replace deprecated lastlog with lastlog2 #282337
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
systemd.packages = optionals config.security.pam.services.login.updateWtmp [ pkgs.pam_lastlog2 ]; | ||
systemd.services.lastlog2-import.enable = config.security.pam.services.login.updateWtmp; | ||
systemd.tmpfiles.packages = optionals config.security.pam.services.login.updateWtmp [ pkgs.pam_lastlog2 ]; |
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.
While this "works" since this is the only in nix use of updateWtmp
(which should probably be updated to be updateLastlog
, but I didn't go searching for historical reasons), I feel like it should be relying on globbing config.security.pam.services.*.updateWtmp
- but I'm not sure how to make this happen.
I think to fully maintain behaviour we probably also want to introduce pam_wtmpdb and enable both. |
Updated PR name to more accurately reflect the purpose of these changes. It looks like lastlog2 will be merged into I have pam_wtmpd in a branch, untested: https://github.com/amaxine/nixpkgs/tree/pam_wtmpdb - this would fully replace lastlog functionality, though I'm not sure if that's necessary. I'm not super familiar with pam, or with everything that interacts with lastlog and wtmp. |
Looks like lastlog2 will make it into 2.40 of util-linux, I'm gonna leave this PR until that makes its way into nix. |
Closing this. Should be revisited when 2.40 is out (rc1 is out), but I'm not promising I'll do it myself. |
Adaptation of NixOS#282337 to use `util-linux` as `lastlog2` provider Co-Authored-By: Maxine Aubrey <35892750+amaxine@users.noreply.github.com>
Adaptation of NixOS#282337 to use `util-linux` as `lastlog2` provider Co-Authored-By: Maxine Aubrey <35892750+amaxine@users.noreply.github.com>
Description of changes
As of pam 1.5.3, lastlog is considered deprecated (see also #267447 and #281182). This PR attempts to introduce
pam_lastlog2
and switch the configuration over. Tested full functionality.cc @trofi
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.