diff options
Diffstat (limited to 'crypto/heimdal/lib/krb5/changepw.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/changepw.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/crypto/heimdal/lib/krb5/changepw.c b/crypto/heimdal/lib/krb5/changepw.c index fd94440..56c89a0 100644 --- a/crypto/heimdal/lib/krb5/changepw.c +++ b/crypto/heimdal/lib/krb5/changepw.c @@ -33,21 +33,17 @@ #include <krb5_locl.h> -RCSID("$Id: changepw.c,v 1.19 1999/12/11 23:14:51 assar Exp $"); +RCSID("$Id: changepw.c,v 1.20 2000/02/07 13:40:18 joda Exp $"); static krb5_error_code get_kdc_address (krb5_context context, krb5_realm realm, struct addrinfo **ai) { - struct addrinfo hints; krb5_error_code ret; char **hostlist; int port = 0; - char portstr[NI_MAXSERV]; int error; - char *host; - char *dot; ret = krb5_get_krb_changepw_hst (context, &realm, @@ -55,24 +51,9 @@ get_kdc_address (krb5_context context, if (ret) return ret; - host = *hostlist; + port = ntohs(krb5_getportbyname (context, "kpasswd", "udp", KPASSWD_PORT)); + error = roken_getaddrinfo_hostspec(*hostlist, port, ai); - dot = strchr (host, ':'); - if (dot != NULL) { - char *end; - - *dot++ = '\0'; - port = strtol (dot, &end, 0); - } - if (port == 0) - port = krb5_getportbyname (context, "kpasswd", "udp", KPASSWD_PORT); - snprintf (portstr, sizeof(portstr), "%u", ntohs(port)); - - memset (&hints, 0, sizeof(hints)); - hints.ai_socktype = SOCK_DGRAM; - hints.ai_protocol = IPPROTO_UDP; - - error = getaddrinfo (host, portstr, &hints, ai); krb5_free_krbhst (context, hostlist); return error; } |