From 5dc2526ceae69a5ca21b4640462d6fe6d21d29b3 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Mon, 22 Aug 2011 23:47:16 +1200 Subject: [PATCH] ntlm_fake_auth: helper protocol fix on Windows 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 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/helpers/ntlm_auth/fake/ntlm_fake_auth.cc b/helpers/ntlm_auth/fake/ntlm_fake_auth.cc index 38a86f6dd2..388319c83d 100644 --- a/helpers/ntlm_auth/fake/ntlm_fake_auth.cc +++ b/helpers/ntlm_auth/fake/ntlm_fake_auth.cc @@ -60,12 +60,12 @@ #include "ntlmauth/support_bits.cci" //#include "util.h" -#if HAVE_CTYPE_H -#include -#endif #if HAVE_STRING_H #include #endif +#if HAVE_CTYPE_H +#include +#endif #if HAVE_CRYPT_H #include #endif @@ -75,6 +75,15 @@ #if HAVE_GETOPT_H #include #endif +#if HAVE_STDIO_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +#if HAVE_INTTYPES_H +#include +#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) { -- 2.47.3