]> granicus.if.org Git - curl/commitdiff
ldap: show precise LDAP call in error message on Windows
authorViktor Szakats <commit@vszakats.net>
Tue, 9 Oct 2018 15:05:35 +0000 (15:05 +0000)
committerViktor Szakats <commit@vszakats.net>
Tue, 9 Oct 2018 15:05:35 +0000 (15:05 +0000)
Also add a unique but common text ('bind via') to make it
easy to grep this specific failure regardless of platform.

Ref: https://github.com/curl/curl/pull/878/files#diff-7a636f08047c4edb53a240f540b4ecf6R468
Closes https://github.com/curl/curl/pull/3118
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
lib/ldap.c

index e42d1fbbceb041a1f25f1b14895ce41d64f5d925..ceaa71d0892c4f162d11c87b1271ae0492db6008 100644 (file)
@@ -474,7 +474,13 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
 #endif
   }
   if(rc != 0) {
-    failf(data, "LDAP local: ldap_simple_bind_s %s", ldap_err2string(rc));
+#ifdef USE_WIN32_LDAP
+    failf(data, "LDAP local: bind via ldap_win_bind %s",
+          ldap_err2string(rc));
+#else
+    failf(data, "LDAP local: bind via ldap_simple_bind_s %s",
+          ldap_err2string(rc));
+#endif
     result = CURLE_LDAP_CANNOT_BIND;
     goto quit;
   }