nixos/users-group: make homeMode respect is_dry and create home directly with right permissions
This commit is contained in:
parent
311aa6d05d
commit
572ff94f55
1 changed files with 2 additions and 2 deletions
|
@ -223,8 +223,8 @@ foreach my $u (@{$spec->{users}}) {
|
|||
}
|
||||
|
||||
# Ensure home directory incl. ownership and permissions.
|
||||
if ($u->{createHome}) {
|
||||
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home} and ! $is_dry;
|
||||
if ($u->{createHome} and !$is_dry) {
|
||||
make_path($u->{home}, { mode => oct($u->{homeMode}) }) if ! -e $u->{home};
|
||||
chown $u->{uid}, $u->{gid}, $u->{home};
|
||||
chmod oct($u->{homeMode}), $u->{home};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue