nixos/update-users-groups: /etc/shadow owned by root:shadow

This commit is contained in:
Cole Helbling
2020-09-25 09:38:35 -07:00
parent d6d1c121e1
commit 937359fcf1
3 changed files with 9 additions and 0 deletions
@@ -281,6 +281,12 @@ foreach my $u (values %usersOut) {
}
updateFile("/etc/shadow", \@shadowNew, 0600);
{
my $uid = getpwnam "root";
my $gid = getgrnam "shadow";
my $path = "/etc/shadow";
chown($uid, $gid, $path) || die "Failed to change ownership of $path: $!";
}
# Rewrite /etc/subuid & /etc/subgid to include default container mappings