mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
ldapsearch doesn't handle correctly setting paged results size to 0 to abort
This commit is contained in:
parent
842fe3091a
commit
284ca3ecf0
@ -660,7 +660,7 @@ getNextPage:
|
||||
|| domainScope
|
||||
#endif
|
||||
#ifdef LDAP_CONTROL_PAGEDRESULTS
|
||||
|| pageSize
|
||||
|| pagedResults
|
||||
#endif
|
||||
|| ldapsync
|
||||
|| subentries || valuesReturnFilter )
|
||||
@ -844,7 +844,7 @@ getNextPage:
|
||||
valuesReturnFilter > 1 ? _("critical ") : "", vrFilter );
|
||||
}
|
||||
#ifdef LDAP_CONTROL_PAGEDRESULTS
|
||||
if ( pageSize ) {
|
||||
if ( pagedResults ) {
|
||||
printf(_("\n# with pagedResults %scontrol: size=%d"),
|
||||
(pagedResults > 1) ? _("critical ") : "",
|
||||
pageSize );
|
||||
@ -912,7 +912,7 @@ getNextPage:
|
||||
}
|
||||
}
|
||||
|
||||
goto getNextPage;
|
||||
goto getNextPage;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1050,6 +1050,8 @@ static int dosearch(
|
||||
} else {
|
||||
morePagedResults = 0;
|
||||
}
|
||||
} else {
|
||||
morePagedResults = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1103,18 +1105,18 @@ static int dosearch(
|
||||
done:
|
||||
ldap_msgfree( res );
|
||||
#ifdef LDAP_CONTROL_PAGEDRESULTS
|
||||
if ( pageSize != 0 ) {
|
||||
npagedresponses = npagedresponses + nresponses;
|
||||
npagedentries = npagedentries + nentries;
|
||||
npagedreferences = npagedreferences + nreferences;
|
||||
npagedextended = npagedextended + nextended;
|
||||
npagedpartial = npagedpartial + npartial;
|
||||
if ( pagedResults ) {
|
||||
npagedresponses += nresponses;
|
||||
npagedentries += nentries;
|
||||
npagedextended += nextended;
|
||||
npagedpartial += npartial;
|
||||
npagedreferences += nreferences;
|
||||
if ( ( morePagedResults == 0 ) && ( ldif < 2 ) ) {
|
||||
printf( _("\n# numResponses: %d\n"), npagedresponses );
|
||||
if( nentries ) printf( _("# numEntries: %d\n"), npagedentries );
|
||||
if( nextended ) printf( _("# numExtended: %d\n"), npagedextended );
|
||||
if( npartial ) printf( _("# numPartial: %d\n"), npagedpartial );
|
||||
if( nreferences ) printf( _("# numReferences: %d\n"), npagedreferences );
|
||||
if( npagedentries ) printf( _("# numEntries: %d\n"), npagedentries );
|
||||
if( npagedextended ) printf( _("# numExtended: %d\n"), npagedextended );
|
||||
if( npagedpartial ) printf( _("# numPartial: %d\n"), npagedpartial );
|
||||
if( npagedreferences ) printf( _("# numReferences: %d\n"), npagedreferences );
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user