From e33ba3808c5a6d763d7e359e2d9a6c4d641db268 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 28 Aug 2004 15:35:42 +0000 Subject: [PATCH] + Fixed ldapsearch paged results size 0 bug + Fixed libldap SASL host connected to bug + Fixed libldap SASL proper sockbuf bug + Fixed libldap getaddrinfo hints portability bug --- CHANGES | 9 +++++++++ clients/tools/ldapsearch.c | 28 +++++++++++++++------------- libraries/libldap/cyrus.c | 8 ++++---- libraries/libldap/os-ip.c | 7 ++++--- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/CHANGES b/CHANGES index 0e92ce7f5c..d9f4f7cf9d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,14 @@ OpenLDAP 2.2 Change Log +OpenLDAP 2.2.16 Engineering + Fixed ldapsearch paged results size 0 bug + Fixed libldap SASL host connected to bug + Fixed libldap SASL proper sockbuf bug + Fixed libldap getaddrinfo hints portability bug + Updated LDAP C++ library + Documentation + Updated provided RFCs and I-Ds + OpenLDAP 2.2.15 Release Fixed back-bdb DB_DEADLOCK memory leak bug (ITS#3213) Fixed back-bdb dbcache locking bug (ITS#3201) diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 5adbde0416..95bc339916 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -659,7 +659,7 @@ getNextPage: || domainScope #endif #ifdef LDAP_CONTROL_PAGEDRESULTS - || pageSize + || pagedResults #endif || ldapsync || subentries || valuesReturnFilter ) @@ -834,7 +834,7 @@ getNextPage: valuesReturnFilter > 1 ? _("critical ") : "", vrFilter ); } #ifdef LDAP_CONTROL_PAGEDRESULTS - if ( pageSize ) { + if ( pagedResults ) { printf(_("\n# with pagedResults %scontrol: size=%d"), (pagedResults > 1) ? _("critical ") : "", pageSize ); @@ -902,7 +902,7 @@ getNextPage: } } - goto getNextPage; + goto getNextPage; } #endif @@ -1040,6 +1040,8 @@ static int dosearch( } else { morePagedResults = 0; } + } else { + morePagedResults = 0; } #endif @@ -1093,18 +1095,18 @@ static int dosearch( done: ldap_msgfree( res ); #ifdef LDAP_CONTROL_PAGEDRESULTS - if ( pageSize != 0 ) { - npagedresponses = npagedresponses + nresponses; - npagedentries = npagedentries + nentries; - npagedreferences = npagedreferences + nreferences; - npagedextended = npagedextended + nextended; - npagedpartial = npagedpartial + npartial; + if ( pagedResults ) { + npagedresponses += nresponses; + npagedentries += nentries; + npagedextended += nextended; + npagedpartial += npartial; + npagedreferences += nreferences; if ( ( morePagedResults == 0 ) && ( ldif < 2 ) ) { printf( _("\n# numResponses: %d\n"), npagedresponses ); - if( nentries ) printf( _("# numEntries: %d\n"), npagedentries ); - if( nextended ) printf( _("# numExtended: %d\n"), npagedextended ); - if( npartial ) printf( _("# numPartial: %d\n"), npagedpartial ); - if( nreferences ) printf( _("# numReferences: %d\n"), npagedreferences ); + if( npagedentries ) printf( _("# numEntries: %d\n"), npagedentries ); + if( npagedextended ) printf( _("# numExtended: %d\n"), npagedextended ); + if( npagedpartial ) printf( _("# numPartial: %d\n"), npagedpartial ); + if( npagedreferences ) printf( _("# numReferences: %d\n"), npagedreferences ); } } else #endif diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 3eb8480845..e1610f6bd0 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -603,7 +603,7 @@ ldap_int_sasl_bind( rc = ldap_open_defconn( ld ); if( rc < 0 ) return ld->ld_errno; - ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_GET_FD, &sd ); + ber_sockbuf_ctrl( ld->ld_defconn->lconn_sb, LBER_SB_OPT_GET_FD, &sd ); if( sd == AC_SOCKET_INVALID ) { ld->ld_errno = LDAP_LOCAL_ERROR; @@ -621,7 +621,7 @@ ldap_int_sasl_bind( ld->ld_defconn->lconn_sasl_authctx = NULL; } - { char *saslhost = ldap_host_connected_to( ld->ld_sb, "localhost" ); + { char *saslhost = ldap_host_connected_to( ld->ld_defconn->lconn_sb, "localhost" ); rc = ldap_int_sasl_open( ld, ld->ld_defconn, saslhost ); LDAP_FREE( saslhost ); } @@ -631,7 +631,7 @@ ldap_int_sasl_bind( ctx = ld->ld_defconn->lconn_sasl_authctx; /* Check for TLS */ - ssl = ldap_pvt_tls_sb_ctx( ld->ld_sb ); + ssl = ldap_pvt_tls_sb_ctx( ld->ld_defconn->lconn_sb ); if ( ssl ) { struct berval authid = BER_BVNULL; ber_len_t fac; @@ -831,7 +831,7 @@ ldap_int_sasl_bind( if ( ld->ld_defconn->lconn_sasl_sockctx ) { oldctx = ld->ld_defconn->lconn_sasl_sockctx; sasl_dispose( &oldctx ); - ldap_pvt_sasl_remove( ld->ld_sb ); + ldap_pvt_sasl_remove( ld->ld_defconn->lconn_sb ); } ldap_pvt_sasl_install( ld->ld_conns->lconn_sb, ctx ); ld->ld_defconn->lconn_sasl_sockctx = ctx; diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 1b3b515810..48d05422e0 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -368,9 +368,10 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, #if defined( HAVE_GETADDRINFO ) && defined( HAVE_INET_NTOP ) memset( &hints, '\0', sizeof(hints) ); -#ifdef AI_ADDRCONFIG - hints.ai_flags = AI_ADDRCONFIG; -#endif +#ifdef USE_AI_ATTRCONFIG /* FIXME: configure test needed */ + /* Use AI_ATTRCONFIG only on systems where its known to be needed. */ + hints.ai_flags = AI_ATTRCONFIG; +#endif hints.ai_family = ldap_int_inet4or6; hints.ai_socktype = socktype; snprintf(serv, sizeof serv, "%d", port ); -- 2.39.5