From commits-return-9782-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Mon Jun 16 21:35:11 2008 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 5398 invoked from network); 16 Jun 2008 21:35:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jun 2008 21:35:11 -0000 Received: (qmail 77046 invoked by uid 500); 16 Jun 2008 21:35:13 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 76999 invoked by uid 500); 16 Jun 2008 21:35:13 -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 76990 invoked by uid 99); 16 Jun 2008 21:35:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 14:35:13 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2008 21:34:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9EEAD23889F3; Mon, 16 Jun 2008 14:34:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r668323 - in /apr/apr-util/branches/1.3.x: build/apu-conf.m4 ldap/apr_ldap_rebind.c Date: Mon, 16 Jun 2008 21:34:50 -0000 To: commits@apr.apache.org From: bojan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080616213450.9EEAD23889F3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bojan Date: Mon Jun 16 14:34:50 2008 New Revision: 668323 URL: http://svn.apache.org/viewvc?rev=668323&view=rev Log: Backport r668322 from the trunk. Older OpenLDAP implementations may have ldap_set_rebind_proc() with two args. Patch by rpluem. Modified: apr/apr-util/branches/1.3.x/build/apu-conf.m4 apr/apr-util/branches/1.3.x/ldap/apr_ldap_rebind.c Modified: apr/apr-util/branches/1.3.x/build/apu-conf.m4 URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/build/apu-conf.m4?rev=668323&r1=668322&r2=668323&view=diff ============================================================================== --- apr/apr-util/branches/1.3.x/build/apu-conf.m4 (original) +++ apr/apr-util/branches/1.3.x/build/apu-conf.m4 Mon Jun 16 14:34:50 2008 @@ -356,6 +356,26 @@ LIBS=$save_libs ]) +if test "$apu_has_ldap_openldap" = "1"; then + AC_CACHE_CHECK([style of ldap_set_rebind_proc routine], ac_cv_ldap_set_rebind_proc_style, + APR_TRY_COMPILE_NO_WARNING([ + #ifdef HAVE_LBER_H + #include + #endif + #ifdef HAVE_LDAP_H + #include + #endif + ], [ + int tmp = ldap_set_rebind_proc((LDAP *)0, (LDAP_REBIND_PROC *)0, (void *)0); + /* use tmp to suppress the warning */ + tmp=0; + ], ac_cv_ldap_set_rebind_proc_style=three, ac_cv_ldap_set_rebind_proc_style=two)) + + if test "$ac_cv_ldap_set_rebind_proc_style" = "three"; then + AC_DEFINE(LDAP_SET_REBIND_PROC_THREE, 1, [Define if ldap_set_rebind_proc takes three arguments]) + fi +fi + AC_SUBST(ldap_h) AC_SUBST(lber_h) AC_SUBST(ldap_ssl_h) Modified: apr/apr-util/branches/1.3.x/ldap/apr_ldap_rebind.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.3.x/ldap/apr_ldap_rebind.c?rev=668323&r1=668322&r2=668323&view=diff ============================================================================== --- apr/apr-util/branches/1.3.x/ldap/apr_ldap_rebind.c (original) +++ apr/apr-util/branches/1.3.x/ldap/apr_ldap_rebind.c Mon Jun 16 14:34:50 2008 @@ -267,8 +267,21 @@ * request Unused in this routine * msgid Unused in this routine * params Unused in this routine + * + * or + * + * ld Pointer to an LDAP control structure. (input only) + * url Unused in this routine + * request Unused in this routine + * msgid Unused in this routine */ -static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, ber_tag_t request, ber_int_t msgid, void *params) +#if defined(LDAP_SET_REBIND_PROC_THREE) +static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, ber_tag_t request, + ber_int_t msgid, void *params) +#else +static int LDAP_rebindproc(LDAP *ld, LDAP_CONST char *url, int request, + ber_int_t msgid) +#endif { apr_ldap_rebind_entry_t *my_conn; const char *bindDN = NULL; @@ -286,7 +299,11 @@ static int apr_ldap_rebind_set_callback(LDAP *ld) { +#if defined(LDAP_SET_REBIND_PROC_THREE) ldap_set_rebind_proc(ld, LDAP_rebindproc, NULL); +#else + ldap_set_rebind_proc(ld, LDAP_rebindproc); +#endif return APR_SUCCESS; }