nixos/users-group: make homeMode respect is_dry and create home directly with right permissions
This commit is contained in:
@@ -223,8 +223,8 @@ foreach my $u (@{$spec->{users}}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Ensure home directory incl. ownership and permissions.
|
# Ensure home directory incl. ownership and permissions.
|
||||||
if ($u->{createHome}) {
|
if ($u->{createHome} and !$is_dry) {
|
||||||
make_path($u->{home}, { mode => 0700 }) if ! -e $u->{home} and ! $is_dry;
|
make_path($u->{home}, { mode => oct($u->{homeMode}) }) if ! -e $u->{home};
|
||||||
chown $u->{uid}, $u->{gid}, $u->{home};
|
chown $u->{uid}, $u->{gid}, $u->{home};
|
||||||
chmod oct($u->{homeMode}), $u->{home};
|
chmod oct($u->{homeMode}), $u->{home};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user