accounts: Always honor the configured user account shell.
authorLudovic Courtès <ludo@gnu.org>
Fri, 26 Apr 2019 08:19:56 +0000 (10:19 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 26 Apr 2019 12:19:36 +0000 (14:19 +0200)
Starting from commit 0ae735bcc8ff7fdc89d67b492bdee9091ee19e86, Guix
System would preserve the user shell across reconfigure and reboot.
This was done so as to allow for the use of 'chsh'.

This proved to be a misguided decision.  This commit goes back to
considering user shells as config and not "state."

* gnu/build/accounts.scm (allocate-passwd): Do not use shell from
PREVIOUS.

gnu/build/accounts.scm

index 6b44ab6..c43ce85 100644 (file)
@@ -483,9 +483,12 @@ new UIDs."
                                (real-name (if previous
                                               (password-entry-real-name previous)
                                               real-name))
-                               (shell (if previous
-                                          (password-entry-shell previous)
-                                          shell)))
+
+                               ;; Do not reuse the shell of PREVIOUS since (1)
+                               ;; that could lead to confusion, and (2) the
+                               ;; shell might have been GC'd.  See
+                               ;; <https://lists.gnu.org/archive/html/guix-devel/2019-04/msg00478.html>.
+                               (shell shell))
                               result)
                         allocation))))
           '()