svn commit: samba r6748 - in branches/SAMBA_3_0/source/passdb: .

vlendec at samba.org vlendec at samba.org
Thu May 12 08:33:27 GMT 2005


Author: vlendec
Date: 2005-05-12 08:33:27 +0000 (Thu, 12 May 2005)
New Revision: 6748

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

Log:
With reconnects, state->connection->ldap_struct can change in smbldap_search
and friends. This should be a fix for bug 2701. Thanks to jht for giving me
access to his box!

Volker


Modified:
   branches/SAMBA_3_0/source/passdb/pdb_ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_ldap.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_ldap.c	2005-05-12 08:28:07 UTC (rev 6747)
+++ branches/SAMBA_3_0/source/passdb/pdb_ldap.c	2005-05-12 08:33:27 UTC (rev 6748)
@@ -3390,7 +3390,7 @@
 static BOOL ldapsam_search_firstpage(struct pdb_search *search)
 {
 	struct ldap_search_state *state = search->private;
-	LDAP *ld = state->connection->ldap_struct;
+	LDAP *ld;
 	int rc = LDAP_OPERATIONS_ERROR;
 
 	state->entries = NULL;
@@ -3423,8 +3423,13 @@
 		state->connection->paged_results = False;
 	}
 
-	if ( ld )
-		state->current_entry = ldap_first_entry(ld, state->entries);
+        ld = state->connection->ldap_struct;
+        if ( ld == NULL) {
+                DEBUG(5, ("Don't have an LDAP connection right after a "
+			  "search\n"));
+                return False;
+        }
+        state->current_entry = ldap_first_entry(ld, state->entries);
 
 	if (state->current_entry == NULL) {
 		ldap_msgfree(state->entries);



More information about the samba-cvs mailing list