]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
basic_sspi_auth: MinGW build fixes (#1399)
authorAmos Jeffries <yadij@users.noreply.github.com>
Thu, 29 Jun 2023 18:20:28 +0000 (18:20 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 29 Jun 2023 18:20:36 +0000 (18:20 +0000)
Also, remove #error check preventing cross-compile

src/auth/basic/SSPI/basic_sspi_auth.cc
src/auth/basic/SSPI/valid.cc

index 317fc9aa3cdd291cd187baad99c59f7ad015a01c..3da82077a5d0508dca79268549011fad12267d4e 100644 (file)
 #include <getopt.h>
 #endif
 
-/* Check if we try to compile on a Windows Platform */
-#if !_SQUID_WINDOWS_
-/* NON Windows Platform !!! */
-#error NON WINDOWS PLATFORM
-#endif
-
 static char NTGroup[256];
 char * NTAllowedGroup;
 char * NTDisAllowedGroup;
@@ -73,7 +67,7 @@ usage(const char *name)
             name);
 }
 
-void
+static void
 process_options(int argc, char *argv[])
 {
     int opt;
index 5191033aece6a8d0109bc09ed5e8ad1194fc2c9a..0fba1fc7bcb7b062197bff47be4ca762243005b7 100644 (file)
 */
 
 #include "squid.h"
+#include "auth/basic/SSPI/valid.h"
 #include "util.h"
 
-/* Check if we try to compile on a Windows Platform */
-#if !_SQUID_WINDOWS_
-/* NON Windows Platform !!! */
-#error NON WINDOWS PLATFORM
-#endif
-
-#if _SQUID_CYGWIN_
 #include <cwchar>
-#endif
-#include "auth/basic/SSPI/valid.h"
 
 char Default_NTDomain[DNLEN+1] = NTV_DEFAULT_DOMAIN;
 const char * errormsg;
@@ -57,7 +49,7 @@ const char NTV_LOGON_ERROR_MSG[] = "No such user or wrong password";
 const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/";
 
 /* returns 1 on success, 0 on failure */
-int
+static int
 Valid_Group(char *UserName, char *Group)
 {
     int result = FALSE;
@@ -125,7 +117,7 @@ Valid_Group(char *UserName, char *Group)
 }
 
 int
-Valid_User(char *UserName, char *Password, char *Group)
+Valid_User(char *UserName, char *Password, char *)
 {
     int result = NTV_SERVER_ERROR;
     size_t i;
@@ -135,7 +127,7 @@ Valid_User(char *UserName, char *Password, char *Group)
     char User[256];
 
     errormsg = NTV_SERVER_ERROR_MSG;
-    strncpy(NTDomain, UserName, sizeof(NTDomain));
+    xstrncpy(NTDomain, UserName, sizeof(NTDomain));
 
     for (i=0; i < strlen(NTV_VALID_DOMAIN_SEPARATOR); ++i) {
         if ((domain_qualify = strchr(NTDomain, NTV_VALID_DOMAIN_SEPARATOR[i])) != NULL)