From 52a812f6610a96ccd4086cb36b867e48b50ee9d1 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 7 Jan 2006 19:59:16 +0000 Subject: [PATCH] Don't assume response control is a paged results response. (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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 5edfda9e85..513452fd2f 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), -- 2.39.5