activation: Pass '-d HOME' to 'usermod'.

Fixes a bug whereby changes to user home directories in the OS config
would never be effective.

Reported by Pierre Neidhardt <ambrevar@gmail.com>.

* gnu/build/activation.scm (modify-user): Pass '-d HOME'.
This commit is contained in:
Ludovic Courtès 2018-03-27 11:48:01 +02:00
parent 7ddd418a1d
commit 82b71ac366
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -179,7 +179,8 @@ (define* (modify-user name group
`("-G" ,(string-join supplementary-groups ",")) `("-G" ,(string-join supplementary-groups ","))
'()) '())
,@(if comment `("-c" ,comment) '()) ,@(if comment `("-c" ,comment) '())
;; Don't use '--move-home', so ignore HOME. ;; Don't use '--move-home'.
,@(if home `("-d" ,home) '())
,@(if shell `("-s" ,shell) '()) ,@(if shell `("-s" ,shell) '())
,name))) ,name)))
(zero? (apply system* "usermod" args)))) (zero? (apply system* "usermod" args))))