From dd4e46edda6c255ca170a6650c6f92b16ff50a3f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 27 Aug 2019 22:38:04 +0200 Subject: 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. --- gnu/build/accounts.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/build') diff --git a/gnu/build/accounts.scm b/gnu/build/accounts.scm index 5094456ab1..f60d68d9b3 100644 --- a/gnu/build/accounts.scm +++ b/gnu/build/accounts.scm @@ -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) -- cgit 1.4.1