nixos/pam: replace deprecated lastlog with lastlog2#282337
nixos/pam: replace deprecated lastlog with lastlog2#282337amaxine wants to merge 2 commits intoNixOS:masterfrom amaxine:pam_lastlog2
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.
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 <[email protected]>
Description of changes
As of pam 1.5.3, lastlog is considered deprecated (see also #267447 and #281182). This PR attempts to introduce
pam_lastlog2and switch the configuration over. Tested full functionality.cc @trofi
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-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.