Skip to content
Snippets Groups Projects
Commit 090b7ccc authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Backout previous entry... causes runaway ldapsearch.

parent a4822cf3
No related branches found
No related tags found
No related merge requests found
...@@ -25,30 +25,18 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of ...@@ -25,30 +25,18 @@ static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of
LDAPMessage * LDAPMessage *
ldap_first_entry( LDAP *ld, LDAPMessage *chain ) ldap_first_entry( LDAP *ld, LDAPMessage *chain )
{ {
if( ld == NULL || chain == NULLMSG ) { return( chain == NULLMSG || chain->lm_msgtype == LDAP_RES_SEARCH_RESULT
return NULLMSG; ? NULLMSG : chain );
}
return chain->lm_msgtype == LDAP_RES_SEARCH_ENTRY
? chain
: ldap_next_entry( ld, chain );
} }
/* ARGSUSED */ /* ARGSUSED */
LDAPMessage * LDAPMessage *ldap_next_entry( LDAP *ld, LDAPMessage *entry )
ldap_next_entry( LDAP *ld, LDAPMessage *entry )
{ {
if ( ld == NULL || entry == NULLMSG ) { if ( entry == NULLMSG || entry->lm_chain == NULLMSG
return NULLMSG; || entry->lm_chain->lm_msgtype == LDAP_RES_SEARCH_RESULT )
} return( NULLMSG );
for ( ; entry != NULLMSG; entry = entry->lm_chain ) { return( entry->lm_chain );
if( entry->lm_msgtype == LDAP_RES_SEARCH_ENTRY ) {
return( entry );
}
}
return( NULLMSG );
} }
/* ARGSUSED */ /* ARGSUSED */
...@@ -57,15 +45,9 @@ ldap_count_entries( LDAP *ld, LDAPMessage *chain ) ...@@ -57,15 +45,9 @@ ldap_count_entries( LDAP *ld, LDAPMessage *chain )
{ {
int i; int i;
if ( ld == NULL ) { for ( i = 0; chain != NULL && chain->lm_msgtype
return -1; != LDAP_RES_SEARCH_RESULT; chain = chain->lm_chain )
} i++;
for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
if( chain->lm_msgtype == LDAP_RES_SEARCH_ENTRY ) {
i++;
}
}
return( i ); return( i );
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment