[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Heimdal PATCH] LDAP backend support for OpenLDAP 2.1.x




You need to the SASL EXTERNAL bind patch to use with 2.1.x, and a 
recent version of 2.1.x that supports EXTERNAL for ldapi://.

Here's an (untested) patch:

Index: hdb-ldap.c
===================================================================
RCS file: /home/project/cvs/heimdal/lib/hdb/hdb-ldap.c,v
retrieving revision 1.1.1.2
retrieving revision 1.5
diff -u -r1.1.1.2 -r1.5
--- hdb-ldap.c  2002/09/11 03:30:03     1.1.1.2
+++ hdb-ldap.c  2003/05/26 00:27:52     1.5
@@ -32,7 +32,7 @@
 
 #include "hdb_locl.h"
 
-RCSID("$Id: hdb-ldap.c,v 1.1.1.2 2002/09/11 03:30:03 lukeh Exp $");
+RCSID("$Id: hdb-ldap.c,v 1.5 2003/05/26 00:27:52 lukeh Exp $");
 
 #ifdef OPENLDAP
 
@@ -953,6 +953,7 @@
 static krb5_error_code LDAP__connect(krb5_context context, HDB * db)
 {
     int rc, version = LDAP_VERSION3;
+    struct berval authzid = { 0, NULL };
 
     if (db->db != NULL) {
        /* connection has been opened. ping server. */
@@ -986,6 +987,12 @@
        return HDB_ERR_BADVERSION;
     }
 
+    rc = ldap_sasl_bind_s((LDAP *) db->db, NULL, "EXTERNAL", &authzid, NULL, NULL, NULL);
+    if (rc != LDAP_SUCCESS) {
+       krb5_set_error_string(context, "ldap_sasl_bind_s: %s", ldap_err2string(rc));
+       return HDB_ERR_NOENTRY;
+    }
+

-- Luke
--
Luke Howard | PADL Software Pty Ltd | www.padl.com