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

wip/yesman
Cole Helbling 4 years ago
parent d6d1c121e1
commit 937359fcf1
No known key found for this signature in database
GPG Key ID: B37E0F2371016A4C
  1. 6
      nixos/modules/config/update-users-groups.pl
  2. 1
      nixos/modules/config/users-groups.nix
  3. 2
      nixos/modules/misc/ids.nix

@ -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

@ -537,6 +537,7 @@ in {
input.gid = ids.gids.input;
kvm.gid = ids.gids.kvm;
render.gid = ids.gids.render;
shadow.gid = ids.gids.shadow;
};
system.activationScripts.users = stringAfter [ "stdio" ]

@ -346,6 +346,7 @@ in
paperless = 315;
#mailman = 316; # removed 2019-08-30
zigbee2mqtt = 317;
# shadow = 318; # unused
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -647,6 +648,7 @@ in
paperless = 315;
#mailman = 316; # removed 2019-08-30
zigbee2mqtt = 317;
shadow = 318;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal

Loading…
Cancel
Save