svn commit: samba r2058 - in branches/SAMBA_4_0/source: libads libcli/auth

gd at samba.org gd at samba.org
Wed Aug 25 08:31:48 GMT 2004


Author: gd
Date: 2004-08-25 08:31:48 +0000 (Wed, 25 Aug 2004)
New Revision: 2058

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2058&nolog=1

Log:
Merge heimdal krb5_locate_kdc-fix over from trunk/3_0 although
krb5_locate_kdc is (yet) an unused function in Samba4.

Guenther

Modified:
   branches/SAMBA_4_0/source/libads/config.m4
   branches/SAMBA_4_0/source/libcli/auth/clikrb5.c


Changeset:
Modified: branches/SAMBA_4_0/source/libads/config.m4
===================================================================
--- branches/SAMBA_4_0/source/libads/config.m4	2004-08-25 07:52:23 UTC (rev 2057)
+++ branches/SAMBA_4_0/source/libads/config.m4	2004-08-25 08:31:48 UTC (rev 2058)
@@ -289,6 +289,7 @@
   AC_CHECK_FUNC_EXT(krb5_verify_checksum, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_c_verify_checksum, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_ticket_get_authorization_data_type, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_krbhst_get_addrinfo, $KRB5_LIBS)
 
   LIBS="$LIBS $KRB5_LIBS"
   

Modified: branches/SAMBA_4_0/source/libcli/auth/clikrb5.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/clikrb5.c	2004-08-25 07:52:23 UTC (rev 2057)
+++ branches/SAMBA_4_0/source/libcli/auth/clikrb5.c	2004-08-25 08:31:48 UTC (rev 2058)
@@ -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));
 	}
 



More information about the samba-cvs mailing list