From 4f91789b25a4b9db6052d786256e64d9ba60704b Mon Sep 17 00:00:00 2001 From: "Jacques A. Vidrine" Date: Fri, 16 Aug 2002 18:48:19 +0000 Subject: [PATCH] If krbhst fails to find an entry for `kpasswd_server', it will fallback to `admin_server'. This will wind up returning address info with SOCK_STREAM type, which will cause the password change to mysteriously fail (since kpasswd is UDP only). Hack around the problem by explicitly requesting UDP when we fallback to `admin_server'. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11105 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/krbhst.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/krb5/krbhst.c b/lib/krb5/krbhst.c index caff463d1..8cbb4c002 100644 --- a/lib/krb5/krbhst.c +++ b/lib/krb5/krbhst.c @@ -514,6 +514,8 @@ kpasswd_get_next(krb5_context context, struct krb5_krbhst_data *kd, krb5_krbhst_info **host) { + krb5_error_code ret; + if((kd->flags & KD_CONFIG) == 0) { config_get_hosts(context, kd, "kpasswd_server"); if(get_next(kd, host)) @@ -538,7 +540,10 @@ kpasswd_get_next(krb5_context context, kd->flags = 0; kd->port = kd->def_port; kd->get_next = admin_get_next; - return (*kd->get_next)(context, kd, host); + ret = (*kd->get_next)(context, kd, host); + if (ret == 0) + (*host)->proto = KRB5_KRBHST_UDP; + return ret; } return KRB5_KDC_UNREACH; /* XXX */