aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2007-09-15 20:03:03 +0000
committerGunter Knauf <gk@gknw.de>2007-09-15 20:03:03 +0000
commitb41e65a8e3ed8fdafb535328997bedc925f21e37 (patch)
treea6c1f43b85e0e627f420fe0b655e9a2ad43faedd
parentbe8c219ec2897bea8bd293cbf4b4b53964af6d89 (diff)
fixed ldap support for winldap.
-rw-r--r--lib/ldap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ldap.c b/lib/ldap.c
index abbd52f29..2eb71cc73 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -120,7 +120,7 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
LDAPMessage *entryIterator;
int num = 0;
struct SessionHandle *data=conn->data;
- int ldap_proto;
+ int ldap_proto = LDAP_VERSION3;
int ldap_ssl = 0;
char *val_b64;
size_t val_b64_sz;
@@ -153,7 +153,6 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
#ifdef LDAP_OPT_NETWORK_TIMEOUT
ldap_set_option(NULL, LDAP_OPT_NETWORK_TIMEOUT, &ldap_timeout);
#endif
- ldap_proto = LDAP_VERSION3;
ldap_set_option(NULL, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto);
if (ldap_ssl) {
@@ -289,6 +288,9 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
goto quit;
}
}
+#ifdef CURL_LDAP_WIN
+ ldap_set_option(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto);
+#endif
rc = ldap_simple_bind_s(server,
conn->bits.user_passwd ? conn->user : NULL,