From 6dc5db3850a2ef5d01e871ec36f1d31457fc64da Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 Aug 2014 16:32:00 +0200 Subject: [PATCH] Fix setting an empty password --- nixos/modules/config/update-users-groups.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/config/update-users-groups.pl b/nixos/modules/config/update-users-groups.pl index 2b9bfb764a8b..197b65e27c4b 100644 --- a/nixos/modules/config/update-users-groups.pl +++ b/nixos/modules/config/update-users-groups.pl @@ -211,7 +211,7 @@ foreach my $line (-f "/etc/shadow" ? read_file("/etc/shadow") : ()) { my ($name, $password, @rest) = split(':', $line, -9); my $u = $usersOut{$name};; next if !defined $u; - $password = $u->{hashedPassword} if $u->{hashedPassword} && !$spec->{mutableUsers}; # FIXME + $password = $u->{hashedPassword} if defined $u->{hashedPassword} && !$spec->{mutableUsers}; # FIXME push @shadowNew, join(":", $name, $password, @rest) . "\n"; $shadowSeen{$name} = 1; } @@ -219,7 +219,7 @@ foreach my $line (-f "/etc/shadow" ? read_file("/etc/shadow") : ()) { foreach my $u (values %usersOut) { next if defined $shadowSeen{$u->{name}}; my $password = "!"; - $password = $u->{hashedPassword} if $u->{hashedPassword}; + $password = $u->{hashedPassword} if defined $u->{hashedPassword}; # FIXME: set correct value for sp_lstchg. push @shadowNew, join(":", $u->{name}, $password, "1::::::") . "\n"; }