diff options
Diffstat (limited to 'libs/libcurl/src/ldap.c')
-rw-r--r-- | libs/libcurl/src/ldap.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/libs/libcurl/src/ldap.c b/libs/libcurl/src/ldap.c index af01902594..073f003fd4 100644 --- a/libs/libcurl/src/ldap.c +++ b/libs/libcurl/src/ldap.c @@ -252,16 +252,17 @@ static int ldap_win_bind_auth(LDAP *server, const char *user, }
if(method && user && passwd) {
- rc = Curl_create_sspi_identity(user, passwd, &cred);
+ CURLcode res = Curl_create_sspi_identity(user, passwd, &cred);
+ rc = (int)res;
if(!rc) {
- rc = ldap_bind_s(server, NULL, (TCHAR *)&cred, method);
+ rc = (int)ldap_bind_s(server, NULL, (TCHAR *)&cred, method);
Curl_sspi_free_identity(&cred);
}
}
else {
/* proceed with current user credentials */
method = LDAP_AUTH_NEGOTIATE;
- rc = ldap_bind_s(server, NULL, NULL, method);
+ rc = (int)ldap_bind_s(server, NULL, NULL, method);
}
return rc;
}
@@ -279,14 +280,14 @@ static int ldap_win_bind(struct Curl_easy *data, LDAP *server, inuser = curlx_convert_UTF8_to_tchar((char *) user);
inpass = curlx_convert_UTF8_to_tchar((char *) passwd);
- rc = ldap_simple_bind_s(server, inuser, inpass);
+ rc = (int)ldap_simple_bind_s(server, inuser, inpass);
curlx_unicodefree(inuser);
curlx_unicodefree(inpass);
}
#if defined(USE_WINDOWS_SSPI)
else {
- rc = ldap_win_bind_auth(server, user, passwd, data->set.httpauth);
+ rc = (int)ldap_win_bind_auth(server, user, passwd, data->set.httpauth);
}
#endif
@@ -296,8 +297,10 @@ static int ldap_win_bind(struct Curl_easy *data, LDAP *server, #if defined(USE_WIN32_LDAP)
#define FREE_ON_WINLDAP(x) curlx_unicodefree(x)
+#define curl_ldap_num_t ULONG
#else
#define FREE_ON_WINLDAP(x)
+#define curl_ldap_num_t int
#endif
@@ -337,7 +340,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) rc = _ldap_url_parse(data, conn, &ludp);
#endif
if(rc) {
- failf(data, "Bad LDAP URL: %s", ldap_err2string(rc));
+ failf(data, "Bad LDAP URL: %s", ldap_err2string((curl_ldap_num_t)rc));
result = CURLE_URL_MALFORMAT;
goto quit;
}
@@ -372,8 +375,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) if(ldap_ssl) {
#ifdef HAVE_LDAP_SSL
#ifdef USE_WIN32_LDAP
- /* Win32 LDAP SDK doesn't support insecure mode without CA! */
- server = ldap_sslinit(host, conn->primary.remote_port, 1);
+ /* Win32 LDAP SDK does not support insecure mode without CA! */
+ server = ldap_sslinit(host, (curl_ldap_num_t)conn->primary.remote_port, 1);
ldap_set_option(server, LDAP_OPT_SSL, LDAP_OPT_ON);
#else
int ldap_option;
@@ -503,7 +506,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) goto quit;
}
else {
- server = ldap_init(host, conn->primary.remote_port);
+ server = ldap_init(host, (curl_ldap_num_t)conn->primary.remote_port);
if(!server) {
failf(data, "LDAP local: Cannot connect to %s:%u",
conn->host.dispname, conn->primary.remote_port);
@@ -529,7 +532,7 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) if(rc) {
#ifdef USE_WIN32_LDAP
failf(data, "LDAP local: bind via ldap_win_bind %s",
- ldap_err2string(rc));
+ ldap_err2string((ULONG)rc));
#else
failf(data, "LDAP local: bind via ldap_simple_bind_s %s",
ldap_err2string(rc));
@@ -539,11 +542,12 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) }
Curl_pgrsSetDownloadCounter(data, 0);
- rc = ldap_search_s(server, ludp->lud_dn, ludp->lud_scope,
- ludp->lud_filter, ludp->lud_attrs, 0, &ldapmsg);
+ rc = (int)ldap_search_s(server, ludp->lud_dn,
+ (curl_ldap_num_t)ludp->lud_scope,
+ ludp->lud_filter, ludp->lud_attrs, 0, &ldapmsg);
if(rc && rc != LDAP_SIZELIMIT_EXCEEDED) {
- failf(data, "LDAP remote: %s", ldap_err2string(rc));
+ failf(data, "LDAP remote: %s", ldap_err2string((curl_ldap_num_t)rc));
result = CURLE_LDAP_SEARCH_FAILED;
goto quit;
}
@@ -754,7 +758,7 @@ quit: FREE_ON_WINLDAP(host);
/* no data to transfer */
- Curl_xfer_setup(data, -1, -1, FALSE, -1);
+ Curl_xfer_setup_nop(data);
connclose(conn, "LDAP connection always disable reuse");
return result;
|