From b15b04eaddc88c891e796b1796743fe9af758208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 12 Dec 2005 12:48:57 +0000 Subject: [PATCH] If there is a target principal, use the realm of the realm to change the password with, git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16384 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/changepw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/krb5/changepw.c b/lib/krb5/changepw.c index 71efebc21..f7cda0c83 100644 --- a/lib/krb5/changepw.c +++ b/lib/krb5/changepw.c @@ -522,7 +522,12 @@ change_password_loop (krb5_context context, int sock; int i; int done = 0; - krb5_realm realm = creds->client->realm; + krb5_realm realm; + + if (targprinc) + realm = targprinc->realm; + else + realm = creds->client->realm; ret = krb5_auth_con_init (context, &auth_context); if (ret) @@ -712,7 +717,7 @@ krb5_set_password(krb5_context context, for (i = 0; procs[i].name != NULL; i++) { *result_code = 0; - ret = change_password_loop(context, creds, targprinc, newpw, + ret = change_password_loop(context, creds, principal, newpw, result_code, result_code_string, result_string, &procs[i]);