From aebebed645e7523cf730def319dad96571118ce5 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sun, 20 Jul 1997 05:35:02 +0000 Subject: [PATCH] Ask for password before call to get_in_tkt. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2489 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kpasswd/kpasswd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kpasswd/kpasswd.c b/kpasswd/kpasswd.c index 1e0dabcbc..98f6a8819 100644 --- a/kpasswd/kpasswd.c +++ b/kpasswd/kpasswd.c @@ -305,12 +305,21 @@ change_password (krb5_context context, krb5_copy_principal (context, server, &cred.server); cred.times.endtime = time(NULL) + 300; + { + char *tmp; + krb5_unparse_name(context, principal, &p); + asprintf(&tmp, "%s's password: ", p); + free (p); + des_read_pw_string(passwd, sizeof(passwd), tmp, 0); + free(tmp); + } + ret = krb5_get_in_tkt_with_password (context, 0, NULL, NULL, pre_auth_types, - NULL, + passwd, ccache, &cred, NULL); @@ -318,10 +327,6 @@ change_password (krb5_context context, errx (1, "krb5_get_in_tkt_with_password: %s", krb5_get_err_text(context, ret)); - krb5_unparse_name(context, principal, &p); - fprintf (stderr, "%s's old ", p); - free (p); - des_read_pw_string (passwd, sizeof(passwd), "New password: ", 1); sock = socket (AF_INET, SOCK_DGRAM, 0);