From b2410f180e04fcf1ef744db6c56dafd00986391f Mon Sep 17 00:00:00 2001 From: behrica Date: Tue, 30 Sep 2014 15:24:24 +0200 Subject: [PATCH 1/2] fixed #1719 - uses read-line for reading password, if no console is available --- src/leiningen/deploy.clj | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/leiningen/deploy.clj b/src/leiningen/deploy.clj index 55c6db2d4..e6a45fe26 100644 --- a/src/leiningen/deploy.clj +++ b/src/leiningen/deploy.clj @@ -48,8 +48,13 @@ "to avoid prompts.") (print "Username: ") (flush) (let [username (read-line) - password (.readPassword (System/console) "%s" - (into-array ["Password: "]))] + console (System/console) + password (if console + (.readPassword console "%s" (into-array ["Password: "])) + (do + (print "Password(visible): ") + (flush) + (read-line)))] [id (assoc settings :username username :password password)])))) ;; repo names must not contain path delimiters because they're used by From 893876c9121fa9ce711d440f5bee45120097fb91 Mon Sep 17 00:00:00 2001 From: Jean Niklas L'orange Date: Tue, 30 Dec 2014 21:33:47 +0100 Subject: [PATCH 2/2] Emphasise on password visibility in console. --- src/leiningen/deploy.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/leiningen/deploy.clj b/src/leiningen/deploy.clj index e6a45fe26..56c7894c9 100644 --- a/src/leiningen/deploy.clj +++ b/src/leiningen/deploy.clj @@ -52,7 +52,9 @@ password (if console (.readPassword console "%s" (into-array ["Password: "])) (do - (print "Password(visible): ") + (println "LEIN IS UNABLE TO TURN OFF ECHOING, SO" + "THE PASSWORD IS PRINTED TO THE CONSOLE") + (print "Password: ") (flush) (read-line)))] [id (assoc settings :username username :password password)]))))