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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user