mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 08:39:37 -05:00
Set outbound connection to use the same protocol version as the inbound.
This commit is contained in:
parent
fcd432ffbd
commit
e2ff92c6fc
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue