Blob Blame History Raw
# HG changeset patch
# User Daiki Ueno <dueno@redhat.com>
# Date 1510244757 -3600
#      Thu Nov 09 17:25:57 2017 +0100
# Node ID 523734e69b5cdd7c2c9047e705e858da352a3b24
# Parent  54be8a4501d454b2b7454e4a44ea013738e0b693
Bug 1415847, modutil: Suppress unnecessary password prompt, r=kaie

diff --git a/cmd/modutil/pk11.c b/cmd/modutil/pk11.c
--- a/cmd/modutil/pk11.c
+++ b/cmd/modutil/pk11.c
@@ -728,7 +728,7 @@ ChangePW(char *tokenName, char *pwFile, 
                 ret = BAD_PW_ERR;
                 goto loser;
             }
-        } else {
+        } else if (PK11_NeedLogin(slot)) {
             for (matching = PR_FALSE; !matching;) {
                 oldpw = SECU_GetPasswordString(NULL, "Enter old password: ");
                 if (PK11_CheckUserPassword(slot, oldpw) == SECSuccess) {