From 284ca3ecf08fc8dd2a7b83b7c285c2e51127d053 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 24 Aug 2004 09:17:10 +0000 Subject: [PATCH] ldapsearch doesn't handle correctly setting paged results size to 0 to abort --- clients/tools/ldapsearch.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index f8b21b34d6..44284cbd3d 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -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 -- 2.39.5