]> git.sur5r.net Git - openldap/commitdiff
paged results may not be the only control response
authorPierangelo Masarati <ando@openldap.org>
Sat, 7 Jan 2006 16:52:33 +0000 (16:52 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 7 Jan 2006 16:52:33 +0000 (16:52 +0000)
clients/tools/ldapsearch.c

index c75b22dfcd21808b9afa1e38cfd4d76e49824628..b959d316686a661892244708990ee407fb553b8b 100644 (file)
@@ -1568,7 +1568,7 @@ parse_page_control(
        rc = ldap_parse_result( ld, result,
                &err, NULL, NULL, NULL, &ctrl, 0 );
 
-       if( rc != LDAP_SUCCESS ) {
+       if ( rc != LDAP_SUCCESS ) {
                tool_perror( "ldap_parse_result", rc, NULL, NULL, NULL, NULL );
                exit( EXIT_FAILURE );
        }
@@ -1577,7 +1577,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),