svn commit: samba r16861 - branches/SAMBA_3_0/source/libads trunk/source/libads

gd at samba.org gd at samba.org
Fri Jul 7 11:43:48 GMT 2006


Author: gd
Date: 2006-07-07 11:43:47 +0000 (Fri, 07 Jul 2006)
New Revision: 16861

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16861

Log:
Fixing crash bug when passing no domain/realm name to the CLDAP request.

Guenther

Modified:
   branches/SAMBA_3_0/source/libads/cldap.c
   branches/SAMBA_3_0/source/libads/ldap.c
   trunk/source/libads/cldap.c
   trunk/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/cldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/cldap.c	2006-07-07 07:38:36 UTC (rev 16860)
+++ branches/SAMBA_3_0/source/libads/cldap.c	2006-07-07 11:43:47 UTC (rev 16861)
@@ -115,10 +115,12 @@
 	asn1_write_BOOLEAN2(&data, False);
 	asn1_push_tag(&data, ASN1_CONTEXT(0));
 
-	asn1_push_tag(&data, ASN1_CONTEXT(3));
-	asn1_write_OctetString(&data, "DnsDomain", 9);
-	asn1_write_OctetString(&data, domain, strlen(domain));
-	asn1_pop_tag(&data);
+	if (domain) {
+		asn1_push_tag(&data, ASN1_CONTEXT(3));
+		asn1_write_OctetString(&data, "DnsDomain", 9);
+		asn1_write_OctetString(&data, domain, strlen(domain));
+		asn1_pop_tag(&data);
+	}
 
 	asn1_push_tag(&data, ASN1_CONTEXT(3));
 	asn1_write_OctetString(&data, "Host", 4);

Modified: branches/SAMBA_3_0/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap.c	2006-07-07 07:38:36 UTC (rev 16860)
+++ branches/SAMBA_3_0/source/libads/ldap.c	2006-07-07 11:43:47 UTC (rev 16861)
@@ -122,15 +122,16 @@
 		return False;
 	}
 	
-	DEBUG(5,("ads_try_connect: sending CLDAP request to %s\n", server));
+	DEBUG(5,("ads_try_connect: sending CLDAP request to %s (realm: %s)\n", 
+		server, ads->config.realm));
 
 	/* this copes with inet_ntoa brokenness */
 	
 	srv = SMB_STRDUP(server);
 
 	ZERO_STRUCT( cldap_reply );
-	
-	if ( !ads_cldap_netlogon( srv, ads->server.realm, &cldap_reply ) ) {
+
+	if ( !ads_cldap_netlogon( srv, ads->config.realm, &cldap_reply ) ) {
 		DEBUG(3,("ads_try_connect: CLDAP request %s failed.\n", srv));
 		return False;
 	}

Modified: trunk/source/libads/cldap.c
===================================================================
--- trunk/source/libads/cldap.c	2006-07-07 07:38:36 UTC (rev 16860)
+++ trunk/source/libads/cldap.c	2006-07-07 11:43:47 UTC (rev 16861)
@@ -115,10 +115,12 @@
 	asn1_write_BOOLEAN2(&data, False);
 	asn1_push_tag(&data, ASN1_CONTEXT(0));
 
-	asn1_push_tag(&data, ASN1_CONTEXT(3));
-	asn1_write_OctetString(&data, "DnsDomain", 9);
-	asn1_write_OctetString(&data, domain, strlen(domain));
-	asn1_pop_tag(&data);
+	if (domain) {
+		asn1_push_tag(&data, ASN1_CONTEXT(3));
+		asn1_write_OctetString(&data, "DnsDomain", 9);
+		asn1_write_OctetString(&data, domain, strlen(domain));
+		asn1_pop_tag(&data);
+	}
 
 	asn1_push_tag(&data, ASN1_CONTEXT(3));
 	asn1_write_OctetString(&data, "Host", 4);

Modified: trunk/source/libads/ldap.c
===================================================================
--- trunk/source/libads/ldap.c	2006-07-07 07:38:36 UTC (rev 16860)
+++ trunk/source/libads/ldap.c	2006-07-07 11:43:47 UTC (rev 16861)
@@ -122,15 +122,16 @@
 		return False;
 	}
 	
-	DEBUG(5,("ads_try_connect: sending CLDAP request to %s\n", server));
+	DEBUG(5,("ads_try_connect: sending CLDAP request to %s (realm: %s)\n", 
+		server, ads->config.realm));
 
 	/* this copes with inet_ntoa brokenness */
 	
 	srv = SMB_STRDUP(server);
 
 	ZERO_STRUCT( cldap_reply );
-	
-	if ( !ads_cldap_netlogon( srv, ads->server.realm, &cldap_reply ) ) {
+
+	if ( !ads_cldap_netlogon( srv, ads->config.realm, &cldap_reply ) ) {
 		DEBUG(3,("ads_try_connect: CLDAP request %s failed.\n", srv));
 		return False;
 	}



More information about the samba-cvs mailing list