From: Kurt Zeilenga Date: Thu, 4 Jan 2001 00:19:16 +0000 (+0000) Subject: Fix ldap versioning X-Git-Tag: OPENLDAP_REL_ENG_2_0_8~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6130a7d49facc725ac11a533a78a4e8bb5ebf406;p=thirdparty%2Fopenldap.git Fix ldap versioning --- diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 921bbe0cdc..bd1af5af8b 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -74,6 +74,7 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) /* Looks like we didn't get a bind. Open a new session... */ if (!lc) { + int vers = conn->c_protocol; int err = ldap_initialize(&ld, li->url); if (err != LDAP_SUCCESS) { err = ldap_back_map_result(err); @@ -81,6 +82,11 @@ ldap_back_getconn(struct ldapinfo *li, Connection *conn, Operation *op) NULL, "ldap_init failed", NULL, NULL ); return( NULL ); } + /* Set LDAP version. This will always succeed: If the client + * bound with a particular version, then so can we. + */ + ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &vers); + lc = (struct ldapconn *)ch_malloc(sizeof(struct ldapconn)); lc->conn = conn; lc->ld = ld;