Ensure that the home directory exists even if the user already exists
This commit is contained in:
parent
31e4ce5e03
commit
16cf3ee9da
@ -174,12 +174,12 @@ foreach my $u (@{$spec->{users}}) {
|
|||||||
} elsif (defined $u->{initialHashedPassword}) {
|
} elsif (defined $u->{initialHashedPassword}) {
|
||||||
$u->{hashedPassword} = $u->{initialHashedPassword};
|
$u->{hashedPassword} = $u->{initialHashedPassword};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Create a home directory.
|
# Create a home directory.
|
||||||
if ($u->{createHome}) {
|
if ($u->{createHome} && ! -e $u->{home}) {
|
||||||
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
|
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home};
|
||||||
chown $u->{uid}, $u->{gid}, $u->{home};
|
chown $u->{uid}, $u->{gid}, $u->{home};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $u->{passwordFile}) {
|
if (defined $u->{passwordFile}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user