1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

r6748: 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
(This used to be commit 85320c12578f183d4ed0450949e0aee8d020e036)
This commit is contained in:
Volker Lendecke 2005-05-12 08:33:27 +00:00 committed by Gerald (Jerry) Carter
parent 121c115ece
commit 848cec55a0

View File

@ -3390,7 +3390,7 @@ struct ldap_search_state {
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 @@ static BOOL ldapsam_search_firstpage(struct pdb_search *search)
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);