]> git.sur5r.net Git - openldap/commitdiff
Don't assume response control is a paged results response.
authorKurt Zeilenga <kurt@openldap.org>
Sat, 7 Jan 2006 19:59:16 +0000 (19:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 7 Jan 2006 19:59:16 +0000 (19:59 +0000)
(Should loop through response controls and do something, anything
(e.g., include message in output) for each.  ldap_find_control(3)
should be avoided.)

clients/tools/ldapsearch.c

index 5edfda9e855c6c0fa19ecd32cb9fd90d408e9522..513452fd2f1a4b93375ed94e6476ab8cea029ce6 100644 (file)
@@ -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),