activation: Pass '-d HOME' to 'usermod'.
authorLudovic Courtès <ludo@gnu.org>
Tue, 27 Mar 2018 09:48:01 +0000 (11:48 +0200)
committerLudovic Courtès <ludo@gnu.org>
Tue, 27 Mar 2018 12:51:44 +0000 (14:51 +0200)
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'.

gnu/build/activation.scm

index 6c0d603..68ecd6b 100644 (file)
@@ -1,5 +1,5 @@
 ;;; 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>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -179,7 +179,8 @@ properties.  Return #t on success."
                       `("-G" ,(string-join supplementary-groups ","))
                       '())
                 ,@(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) '())
                 ,name)))
     (zero? (apply system* "usermod" args))))