From commits-return-6968-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Thu Sep 01 17:01:56 2005 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 77742 invoked from network); 1 Sep 2005 17:01:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2005 17:01:56 -0000 Received: (qmail 6756 invoked by uid 500); 1 Sep 2005 17:01:55 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 6654 invoked by uid 500); 1 Sep 2005 17:01:55 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 6641 invoked by uid 99); 1 Sep 2005 17:01:54 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 01 Sep 2005 10:01:54 -0700 Received: (qmail 77706 invoked by uid 65534); 1 Sep 2005 17:01:54 -0000 Message-ID: <20050901170154.77705.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r265755 - in /apr/apr-util/trunk/ldap: apr_ldap_init.c apr_ldap_option.c Date: Thu, 01 Sep 2005 17:01:53 -0000 To: commits@apr.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: wrowe Date: Thu Sep 1 10:01:49 2005 New Revision: 265755 URL: http://svn.apache.org/viewcvs?rev=265755&view=rev Log: Correct the use-case checking to determine our ldap[ssl]_[ssl]init() choice. This isn't platform specific, it must be based on our apu_ldap.h configuration choices, APR_HAS_LDAP_SSLINIT and APR_HAS_LDAPSSL_INIT are already flagged correctly on Netware, Win32. And follow the APR_HAS_LDAP_START_TLS_S election on Win32, because the platform SDK exports a binding to ordinals 330/331 for start/stop TLS, but these entry points are missing on Windows 2000 Pro SP4, and likely many other flavors of WLDAP32.DLL. Note that the WLDAP32.DLL is bound by ordinals, not by fn names, so VC98 for example provides an invalid wldap32.lib with the wrong ordinal numbers. Only use the platform SDK, and use depends.exe to ensure that the elected functions are correct. One good thing; the VC98 flavor is an LDAPv2 toolkit, while the PSDK is an LDAPv3 which passes the #ifndef/#error backstop. So it's unlikely a user will bind to the wrong wldap32.lib if the LIB and INCLUDES paths on their configuration keeps the VC and PSDK paths in the same order relative to the other envvar. Modified: apr/apr-util/trunk/ldap/apr_ldap_init.c apr/apr-util/trunk/ldap/apr_ldap_option.c Modified: apr/apr-util/trunk/ldap/apr_ldap_init.c URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/ldap/apr_ldap_init.c?rev=265755&r1=265754&r2=265755&view=diff ============================================================================== --- apr/apr-util/trunk/ldap/apr_ldap_init.c (original) +++ apr/apr-util/trunk/ldap/apr_ldap_init.c Thu Sep 1 10:01:49 2005 @@ -145,8 +145,10 @@ apr_ldap_err_t *result = (apr_ldap_err_t *)apr_pcalloc(pool, sizeof(apr_ldap_err_t)); *result_err = result; -#if APR_HAS_NOVELL_LDAPSDK +#if APR_HAS_LDAPSSL_INIT *ldap = ldapssl_init(hostname, portno, 0); +#elif APR_HAS_LDAP_SSLINIT + *ldap = ldap_sslinit((char *)hostname, portno, 0); #else *ldap = ldap_init((char *)hostname, portno); #endif Modified: apr/apr-util/trunk/ldap/apr_ldap_option.c URL: http://svn.apache.org/viewcvs/apr/apr-util/trunk/ldap/apr_ldap_option.c?rev=265755&r1=265754&r2=265755&view=diff ============================================================================== --- apr/apr-util/trunk/ldap/apr_ldap_option.c (original) +++ apr/apr-util/trunk/ldap/apr_ldap_option.c Thu Sep 1 10:01:49 2005 @@ -304,6 +304,7 @@ result->msg = ldap_err2string(result->rc); } } +#if APR_HAS_LDAP_START_TLS_S else if (tls == APR_LDAP_STARTTLS) { result->rc = ldap_start_tls_s(ldap, NULL, NULL, NULL, NULL); if (result->rc != LDAP_SUCCESS) { @@ -318,6 +319,7 @@ result->msg = ldap_err2string(result->rc); } } +#endif #endif #if APR_HAS_OTHER_LDAPSDK