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
This commit is contained in:
Jacques A. Vidrine
2002-08-16 18:48:19 +00:00
parent 238ddbcc07
commit 4f91789b25

View File

@@ -514,6 +514,8 @@ kpasswd_get_next(krb5_context context,
struct krb5_krbhst_data *kd, struct krb5_krbhst_data *kd,
krb5_krbhst_info **host) krb5_krbhst_info **host)
{ {
krb5_error_code ret;
if((kd->flags & KD_CONFIG) == 0) { if((kd->flags & KD_CONFIG) == 0) {
config_get_hosts(context, kd, "kpasswd_server"); config_get_hosts(context, kd, "kpasswd_server");
if(get_next(kd, host)) if(get_next(kd, host))
@@ -538,7 +540,10 @@ kpasswd_get_next(krb5_context context,
kd->flags = 0; kd->flags = 0;
kd->port = kd->def_port; kd->port = kd->def_port;
kd->get_next = admin_get_next; 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 */ return KRB5_KDC_UNREACH; /* XXX */