1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-30 22:35:57 +02:00

accounts: Delete duplicate entries.

When adding multiple instances of a service requiring some user
account/group, we could end up with multiple entries for that account or
group in /etc/passwd or /etc/group.

* gnu/build/accounts.scm (database-writer)[write-entries]: Add call to
'delete-duplicates'.
* tests/accounts.scm ("write-passwd with duplicate entry"): New test.
This commit is contained in:
Ludovic Courtès
2019-08-27 22:38:04 +02:00
parent 114f02bac4
commit dd4e46edda
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ to it atomically and set the appropriate permissions."
(for-each (lambda (entry)
(display (entry->string entry) port)
(newline port))
entries))
(delete-duplicates entries)))
(if (port? file-or-port)
(write-entries file-or-port)