diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-08-27 22:38:04 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-08-28 00:27:14 +0200 |
commit | dd4e46edda6c255ca170a6650c6f92b16ff50a3f (patch) | |
tree | 545a8eaf37525b31fbdba3765a5f71c32334f0f9 /gnu/build | |
parent | 114f02bac47d86c04bf211e33864beffcde74aab (diff) | |
download | gnu-guix-dd4e46edda6c255ca170a6650c6f92b16ff50a3f.tar gnu-guix-dd4e46edda6c255ca170a6650c6f92b16ff50a3f.tar.gz |
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.
Diffstat (limited to 'gnu/build')
-rw-r--r-- | gnu/build/accounts.scm | 2 |
1 files changed, 1 insertions, 1 deletions
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) |