diff options
author | r-vdp <ramses@well-founded.dev> | 2023-08-02 13:51:41 +0200 |
---|---|---|
committer | r-vdp <ramses@well-founded.dev> | 2023-08-02 13:51:41 +0200 |
commit | 44a7059bf287366e96f8188cf834a0a63932e220 (patch) | |
tree | 15930a91bd0b33aa57a3c4d800f4fae4ebb3f015 /nixos/modules/config | |
parent | 127e2ed645137ccbcbedb3ba316e1c8bf3ab9ae1 (diff) | |
download | nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.tar nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.tar.gz nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.tar.bz2 nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.tar.lz nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.tar.xz nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.tar.zst nixpkgs-44a7059bf287366e96f8188cf834a0a63932e220.zip |
nixos/update-users-groups: set expiry correctly for new users
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/update-users-groups.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl index 7ec4235db51..fea31ab280f 100644 --- a/nixos/modules/config/update-users-groups.pl +++ b/nixos/modules/config/update-users-groups.pl @@ -316,8 +316,10 @@ foreach my $u (values %usersOut) { next if defined $shadowSeen{$u->{name}}; my $hashedPassword = "!"; $hashedPassword = $u->{hashedPassword} if defined $u->{hashedPassword}; + my $expires = ""; + $expires = dateToDays($u->{expires}) if defined $u->{expires}; # FIXME: set correct value for sp_lstchg. - push @shadowNew, join(":", $u->{name}, $hashedPassword, "1::::::") . "\n"; + push @shadowNew, join(":", $u->{name}, $hashedPassword, "1::::", $expires, "") . "\n"; } updateFile("/etc/shadow", \@shadowNew, 0640); |