[Pkg-citadel-devel] Bug#627338: flawed patch
Clint Adams
clint at debian.org
Thu May 19 18:01:39 UTC 2011
Something like this (though this still doesn't work for me), I think:
--- citadel-7.86.orig/configure.ac
+++ citadel-7.86/configure.ac
@@ -694,7 +694,7 @@
dnl Checks for the OpenLDAP client library.
if test "x$with_ldap" != xno ; then
AC_CHECK_HEADERS(ldap.h,
- [AC_CHECK_LIB(ldap, ldap_init,
+ [AC_CHECK_LIB(ldap, ldap_initialize,
[ok_ldap=yes],,
)])
fi
--- citadel-7.86.orig/ldap.c
+++ citadel-7.86/ldap.c
@@ -72,7 +72,6 @@
#include "user_ops.h"
#ifdef HAVE_LDAP
-#define LDAP_DEPRECATED 1 /* Suppress libldap's warning that we are using deprecated API calls */
#include <ldap.h>
int CtdlTryUserLDAP(char *username,
@@ -91,8 +90,7 @@
if (fullname) safestrncpy(fullname, username, fullname_size);
- ldserver = ldap_init(config.c_ldap_host, config.c_ldap_port);
- if (ldserver == NULL) {
+ if (ldap_initialize(&ldserver, "ldaps://hardcoded.example.org/") != LDAP_SUCCESS) {
CtdlLogPrintf(CTDL_ALERT, "LDAP: Could not connect to %s:%d : %s\n",
config.c_ldap_host, config.c_ldap_port,
strerror(errno)
@@ -234,8 +232,7 @@
}
CtdlLogPrintf(CTDL_DEBUG, "LDAP: trying to bind as %s\n", user_dn);
- ldserver = ldap_init(config.c_ldap_host, config.c_ldap_port);
- if (ldserver) {
+ if (ldap_initialize(&ldserver, "ldaps://hardcoded.example.org/") == LDAP_SUCCESS) {
ldap_set_option(ldserver, LDAP_OPT_PROTOCOL_VERSION, &ctdl_require_ldap_version);
i = ldap_simple_bind_s(ldserver, user_dn, password);
if (i == LDAP_SUCCESS) {
More information about the Pkg-citadel-devel
mailing list