mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
Ensure that the home directory exists even if the user already exists
(cherry picked from commit 16cf3ee9da
)
This commit is contained in:
parent
ef0b35e28d
commit
77d78cf029
@ -174,12 +174,12 @@ foreach my $u (@{$spec->{users}}) {
|
||||
} elsif (defined $u->{initialHashedPassword}) {
|
||||
$u->{hashedPassword} = $u->{initialHashedPassword};
|
||||
}
|
||||
}
|
||||
|
||||
# Create a home directory.
|
||||
if ($u->{createHome}) {
|
||||
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
|
||||
chown $u->{uid}, $u->{gid}, $u->{home};
|
||||
}
|
||||
# Create a home directory.
|
||||
if ($u->{createHome} && ! -e $u->{home}) {
|
||||
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
|
||||
chown $u->{uid}, $u->{gid}, $u->{home};
|
||||
}
|
||||
|
||||
if (defined $u->{passwordFile}) {
|
||||
|
Loading…
Reference in New Issue
Block a user