update-users-groups.pl: correctly guard duplicate uids for declarative users
Verified that following nixos configuration: users.users.foo = { uid = 1000; name = "foo"; }; users.users.bar = { name = "bar"; }; Before this commit both users will get uid of 1000, after it's applied bar will correctly get 1001.
This commit is contained in:
parent
95021f061a
commit
e561edc322
@ -52,8 +52,8 @@ foreach my $g (@{$spec->{groups}}) {
|
|||||||
$gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
|
$gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $u (@{$spec->{groups}}) {
|
foreach my $u (@{$spec->{users}}) {
|
||||||
$uidsUsed{$u->{u}} = 1 if defined $u->{uid};
|
$uidsUsed{$u->{uid}} = 1 if defined $u->{uid};
|
||||||
}
|
}
|
||||||
|
|
||||||
# Read the current /etc/group.
|
# Read the current /etc/group.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user