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.
This commit is contained in:
parent
0e8e963d73
commit
ada4aeb068
|
@ -115,25 +115,23 @@ REAL-NAME, and HOME-DIRECTORY as the initial values in the form."
|
||||||
(begin
|
(begin
|
||||||
(error-page)
|
(error-page)
|
||||||
(run-user-add-page))
|
(run-user-add-page))
|
||||||
|
(let ((password (confirm-password password)))
|
||||||
|
(if password
|
||||||
(user
|
(user
|
||||||
(name name)
|
(name name)
|
||||||
(real-name real-name)
|
(real-name real-name)
|
||||||
(home-directory home-directory)
|
(home-directory home-directory)
|
||||||
(password
|
(password password))
|
||||||
(confirm-password password
|
(run-user-add-page #:name name
|
||||||
(lambda ()
|
|
||||||
(run-user-add-page
|
|
||||||
#:name name
|
|
||||||
#:real-name real-name
|
#:real-name real-name
|
||||||
#:home-directory
|
#:home-directory
|
||||||
home-directory)))))))))))
|
home-directory)))))))))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(destroy-form-and-pop form)))))))
|
(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,
|
"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
|
a thunk, if the confirmation doesn't match PASSWORD, and return its result."
|
||||||
password."
|
|
||||||
(define confirmation
|
(define confirmation
|
||||||
(run-input-page (G_ "Please confirm the password.")
|
(run-input-page (G_ "Please confirm the password.")
|
||||||
(G_ "Password confirmation required")
|
(G_ "Password confirmation required")
|
||||||
|
|
Loading…
Reference in New Issue