From: Quanah Gibson-Mount Date: Thu, 24 Mar 2011 02:14:29 +0000 (+0000) Subject: ITS#6755 X-Git-Tag: OPENLDAP_REL_ENG_2_4_25~12 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1d310fd6df817bdbf88a42292791c5535f9086c8;p=openldap ITS#6755 --- diff --git a/CHANGES b/CHANGES index 22c7e46f22..75a33a2175 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ OpenLDAP 2.4 Change Log OpenLDAP 2.4.25 Engineering + Fixed ldapsearch pagedresults loop (ITS#6755) Fixed tools for incompatible args (ITS#6849) Fixed slapd add objectclasses in order (ITS#6837) Added slapd ordering for uidNumber and gidNumber (ITS#6852) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 4e4f893b8f..1689f61c15 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -908,6 +908,15 @@ main( int argc, char **argv ) tool_bind( ld ); getNextPage: + /* fp may have been closed, need to reopen if code jumps + * back here to getNextPage. + */ + if ( !fp && infile ) { + if (( fp = fopen( infile, "r" )) == NULL ) { + perror( infile ); + return EXIT_FAILURE; + } + } save_nctrls = nctrls; i = nctrls; if ( nctrls > 0 @@ -1249,6 +1258,7 @@ getNextPage: } if ( fp != stdin ) { fclose( fp ); + fp = NULL; } }