diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 5edfda9e855c6c0fa19ecd32cb9fd90d408e9522..513452fd2f1a4b93375ed94e6476ab8cea029ce6 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -1552,7 +1552,12 @@ parse_page_control( fprintf( stderr, "%s (%d)\n", ldap_err2string(err), err ); } - if( ctrl ) { + if ( ctrl ) { + /* There might be others, e.g. ppolicy... */ + ctrlp = ldap_find_control( LDAP_CONTROL_PAGEDRESULTS, ctrl ); + } + + if ( ctrlp ) { /* Parse the control value * searchResult ::= SEQUENCE { * size INTEGER (0..maxInt),