On Mon, 2008-06-16 at 10:07 +1000, Bojan Smojver wrote:
> Nah, forget it - wrong and incomplete. Let me do a better one...
OK, for real this time :-)
PS. I don't have RHEL3 platform handy, so please compile and let me
know.
--
Bojan
Index: ldap/apr_ldap_rebind.c
===================================================================
--- ldap/apr_ldap_rebind.c (revision 667454)
+++ ldap/apr_ldap_rebind.c (working copy)
@@ -267,8 +267,21 @@
* request Unused in this routine
* msgid Unused in this routine
* params Unused in this routine
+ *
+ * or
+ *
+ * whop Unused in this routine
+ * credp Unused in this routine
+ * methodp Unused in this routine
+ * freeit 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, char **whop, char **credp, int *methodp,
+ int freeit)
+#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;
}
Index: build/apu-conf.m4
===================================================================
--- build/apu-conf.m4 (revision 667454)
+++ build/apu-conf.m4 (working copy)
@@ -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 <lber.h>
+ #endif
+ #ifdef HAVE_LDAP_H
+ #include <ldap.h>
+ #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)