[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11/12: installer: Fix handling of user password mismatches.
From: |
guix-commits |
Subject: |
11/12: installer: Fix handling of user password mismatches. |
Date: |
Sun, 28 Apr 2019 16:57:18 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit ada4aeb0681445b89459a202b5fa1a46f0a7950e
Author: Ludovic Courtès <address@hidden>
Date: Sun Apr 28 22:42:21 2019 +0200
installer: Fix handling of user password mismatches.
Previously, if we had a password mismatch, the 'password' field would
end up containing a <user> record instead of the actual password.
* gnu/installer/newt/user.scm (confirm-password): Make TRY-AGAIN
optional and adjust docstring.
(run-user-add-page): Move 'confirm-password' call one level higher.
---
gnu/installer/newt/user.scm | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/gnu/installer/newt/user.scm b/gnu/installer/newt/user.scm
index 7c646c1..deab056 100644
--- a/gnu/installer/newt/user.scm
+++ b/gnu/installer/newt/user.scm
@@ -115,25 +115,23 @@ REAL-NAME, and HOME-DIRECTORY as the initial values in
the form."
(begin
(error-page)
(run-user-add-page))
- (user
- (name name)
- (real-name real-name)
- (home-directory home-directory)
- (password
- (confirm-password password
- (lambda ()
- (run-user-add-page
- #:name name
- #:real-name real-name
- #:home-directory
- home-directory)))))))))))
+ (let ((password (confirm-password password)))
+ (if password
+ (user
+ (name name)
+ (real-name real-name)
+ (home-directory home-directory)
+ (password password))
+ (run-user-add-page #:name name
+ #:real-name real-name
+ #:home-directory
+ home-directory)))))))))
(lambda ()
(destroy-form-and-pop form)))))))
-(define (confirm-password password try-again)
+(define* (confirm-password password #:optional (try-again (const #f)))
"Ask the user to confirm PASSWORD, a possibly empty string. Call TRY-AGAIN,
-a thunk, if the confirmation doesn't match PASSWORD. Return the confirmed
-password."
+a thunk, if the confirmation doesn't match PASSWORD, and return its result."
(define confirmation
(run-input-page (G_ "Please confirm the password.")
(G_ "Password confirmation required")
- branch master updated (e0f3a4f -> d779de1), guix-commits, 2019/04/28
- 12/12: installer: Tell the user where the config file is., guix-commits, 2019/04/28
- 10/12: installer: User accounts can now have a "real name.", guix-commits, 2019/04/28
- 11/12: installer: Fix handling of user password mismatches.,
guix-commits <=
- 09/12: installer: User can have a "real name"., guix-commits, 2019/04/28
- 07/12: installer: Add 'nss-certs' to the networking services., guix-commits, 2019/04/28
- 08/12: installer: Improve layout of the partitioning page., guix-commits, 2019/04/28
- 06/12: installer: Recommended services are pre-selected., guix-commits, 2019/04/28
- 03/12: Update NEWS., guix-commits, 2019/04/28
- 05/12: installer: Add #:selection parameter to 'run-checkbox-tree-page'., guix-commits, 2019/04/28
- 04/12: doc: Duplicate recommendation about 'guix-install.sh'., guix-commits, 2019/04/28
- 01/12: describe: Provide a hint when origin detection fails., guix-commits, 2019/04/28
- 02/12: vm-image: Add 'nss-certs' to the global package set., guix-commits, 2019/04/28