Skip to content

Commit

Permalink
update-users-groups.pl: correctly guard duplicate uids for declarativ…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
domenkozar committed Aug 30, 2016
1 parent 95021f0 commit e561edc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/config/update-users-groups.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ sub allocUid {
$gidsUsed{$g->{gid}} = 1 if defined $g->{gid};
}

foreach my $u (@{$spec->{groups}}) {
$uidsUsed{$u->{u}} = 1 if defined $u->{uid};
foreach my $u (@{$spec->{users}}) {
$uidsUsed{$u->{uid}} = 1 if defined $u->{uid};
}

# Read the current /etc/group.
Expand Down

0 comments on commit e561edc

Please sign in to comment.