]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ntlm_fake_auth: helper protocol fix on Windows
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 22 Aug 2011 11:47:16 +0000 (23:47 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 22 Aug 2011 11:47:16 +0000 (23:47 +1200)
strncasecmp is not available on MinGW. Use strncmp instead
and rely on squid to send properly-capitalized commands.

helpers/ntlm_auth/fake/ntlm_fake_auth.cc

index 38a86f6dd2ca2ca374a8b9512a3ec544417f3b2e..388319c83d20d6b8cc9e6aa9503ca130468003f5 100644 (file)
 #include "ntlmauth/support_bits.cci"
 //#include "util.h"
 
-#if HAVE_CTYPE_H
-#include <ctype.h>
-#endif
 #if HAVE_STRING_H
 #include <string.h>
 #endif
+#if HAVE_CTYPE_H
+#include <ctype.h>
+#endif
 #if HAVE_CRYPT_H
 #include <crypt.h>
 #endif
 #if HAVE_GETOPT_H
 #include <getopt.h>
 #endif
+#if HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
 
 /* A couple of harmless helper macros */
 #define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
@@ -190,7 +199,7 @@ main(int argc, char *argv[])
         } else
             debug("Got '%s' from Squid\n", buf);
 
-        if (strncasecmp(buf, "YR", 2) == 0) {
+        if (strncmp(buf, "YR", 2) == 0) {
             char nonce[NTLM_NONCE_LEN];
             ntlm_challenge chal;
             ntlm_make_nonce(nonce);
@@ -211,7 +220,7 @@ main(int argc, char *argv[])
                 hex_dump((unsigned char *)&chal, len);
             } else
                 SEND2("TT %s", data);
-        } else if (strncasecmp(buf, "KK ", 3) == 0) {
+        } else if (strncmp(buf, "KK ", 3) == 0) {
             if (!packet) {
                 SEND("BH received KK with no data! user=");
             } else if (ntlm_validate_packet(packet, NTLM_AUTHENTICATE) == NTLM_ERR_NONE) {