Merge pull request #196337 from SuperSandro2000/update-users-groups
nixos/update-users-groups.pl: sort json file for better reproducibility
This commit is contained in:
commit
24167c94f0
1 changed files with 2 additions and 2 deletions
|
@ -186,7 +186,7 @@ foreach my $name (keys %groupsCur) {
|
|||
# Rewrite /etc/group. FIXME: acquire lock.
|
||||
my @lines = map { join(":", $_->{name}, $_->{password}, $_->{gid}, $_->{members}) . "\n" }
|
||||
(sort { $a->{gid} <=> $b->{gid} } values(%groupsOut));
|
||||
updateFile($gidMapFile, to_json($gidMap));
|
||||
updateFile($gidMapFile, to_json($gidMap, {canonical => 1}));
|
||||
updateFile("/etc/group", \@lines);
|
||||
nscdInvalidate("group");
|
||||
|
||||
|
@ -272,7 +272,7 @@ foreach my $name (keys %usersCur) {
|
|||
# Rewrite /etc/passwd. FIXME: acquire lock.
|
||||
@lines = map { join(":", $_->{name}, $_->{fakePassword}, $_->{uid}, $_->{gid}, $_->{description}, $_->{home}, $_->{shell}) . "\n" }
|
||||
(sort { $a->{uid} <=> $b->{uid} } (values %usersOut));
|
||||
updateFile($uidMapFile, to_json($uidMap));
|
||||
updateFile($uidMapFile, to_json($uidMap, {canonical => 1}));
|
||||
updateFile("/etc/passwd", \@lines);
|
||||
nscdInvalidate("passwd");
|
||||
|
||||
|
|
Loading…
Reference in a new issue