diff options
author | Günther Deschner <gd@samba.org> | 2004-08-25 08:31:48 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:22 -0500 |
commit | e5c4c4b108370277458992a8f6d156317163fbb9 (patch) | |
tree | 95b655314eb790e06e1caf1b47e8cb6a007eac78 /source4/libcli/auth | |
parent | 235a71fa3e9cc1223a6000beb8c775a0cfd14b5e (diff) | |
download | samba-e5c4c4b108370277458992a8f6d156317163fbb9.tar.gz samba-e5c4c4b108370277458992a8f6d156317163fbb9.tar.bz2 samba-e5c4c4b108370277458992a8f6d156317163fbb9.zip |
r2058: Merge heimdal krb5_locate_kdc-fix over from trunk/3_0 although
krb5_locate_kdc is (yet) an unused function in Samba4.
Guenther
(This used to be commit fe93f58dfe208ec814f1e75efde4ececa2b2cb5f)
Diffstat (limited to 'source4/libcli/auth')
-rw-r--r-- | source4/libcli/auth/clikrb5.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/libcli/auth/clikrb5.c b/source4/libcli/auth/clikrb5.c index 0e4ec1f438..f6f8520b3c 100644 --- a/source4/libcli/auth/clikrb5.c +++ b/source4/libcli/auth/clikrb5.c @@ -181,6 +181,7 @@ krb5_error_code rc; int num_kdcs, i; struct sockaddr *sa; + struct addrinfo **ai; *addr_pp = NULL; *naddrs = 0; @@ -210,10 +211,19 @@ return -1; } + *addr_pp = malloc(sizeof(struct sockaddr) * num_kdcs); memset(*addr_pp, '\0', sizeof(struct sockaddr) * num_kdcs ); for (i = 0; i < num_kdcs && (rc = krb5_krbhst_next(ctx, hnd, &hinfo) == 0); i++) { - if (hinfo->ai->ai_family == AF_INET) + +#if defined(HAVE_KRB5_KRBHST_GET_ADDRINFO) + rc = krb5_krbhst_get_addrinfo(ctx, hinfo, ai); + if (rc) { + DEBUG(0,("krb5_krbhst_get_addrinfo failed: %s\n", error_message(rc))); + return rc; + } +#endif + if (hinfo->ai && hinfo->ai->ai_family == AF_INET) memcpy(&sa[i], hinfo->ai->ai_addr, sizeof(struct sockaddr)); } |