--------------------- PatchSet 7033 Date: 2005/09/14 12:12:21 Author: serassio Branch: nt-2_5 Tag: (none) Log: More code cleanup Members: helpers/basic_auth/win32_locallogon/NT_auth.c:1.1.4.6->1.1.4.7 helpers/basic_auth/win32_locallogon/valid.c:1.1.4.6->1.1.4.7 helpers/basic_auth/win32_locallogon/valid.h:1.1.4.5->1.1.4.6 Index: squid/helpers/basic_auth/win32_locallogon/NT_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/basic_auth/win32_locallogon/Attic/NT_auth.c,v retrieving revision 1.1.4.6 retrieving revision 1.1.4.7 diff -u -r1.1.4.6 -r1.1.4.7 --- squid/helpers/basic_auth/win32_locallogon/NT_auth.c 13 Sep 2005 15:44:27 -0000 1.1.4.6 +++ squid/helpers/basic_auth/win32_locallogon/NT_auth.c 14 Sep 2005 12:12:21 -0000 1.1.4.7 @@ -24,7 +24,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#include "squid.h" +#include "config.h" +#include +#include +#include "util.h" /* Check if we try to compile on a Windows Platform */ #if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) @@ -40,9 +43,9 @@ /* * options: - * -a can specify a Windows Local Group name allowed to authenticate. - * -d can specify a Windows Local Group name not allowed to authenticate. - * -D can specify the default Domain against to authenticate. + * -A can specify a Windows Local Group name allowed to authenticate. + * -D can specify a Windows Local Group name not allowed to authenticate. + * -O can specify the default Domain against to authenticate. */ char *my_program_name = NULL; @@ -154,7 +157,7 @@ sscanf(wstr, "%s %s", username, password); /* Extract parameters */ debug("Got %s from Squid\n", wstr); - + /* Check for invalid or blank entries */ if ((username[0] == '\0') || (password[0] == '\0')) { fprintf(stderr, "Invalid Request\n"); @@ -173,7 +176,6 @@ printf("ERR %s\n", errormsg); error: err = 0; - fflush(stdout); } return 0; Index: squid/helpers/basic_auth/win32_locallogon/valid.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/basic_auth/win32_locallogon/Attic/valid.c,v retrieving revision 1.1.4.6 retrieving revision 1.1.4.7 diff -u -r1.1.4.6 -r1.1.4.7 --- squid/helpers/basic_auth/win32_locallogon/valid.c 13 Sep 2005 15:44:27 -0000 1.1.4.6 +++ squid/helpers/basic_auth/win32_locallogon/valid.c 14 Sep 2005 12:12:21 -0000 1.1.4.7 @@ -26,7 +26,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#include "squid.h" +#include "util.h" /* Check if we try to compile on a Windows Platform */ #if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) @@ -34,8 +34,6 @@ #if defined(_SQUID_CYGWIN_) #include #endif -#include -#include #include "valid.h" char Default_NTDomain[DNLEN+1] = NTV_DEFAULT_DOMAIN; @@ -117,7 +115,7 @@ /* Valid_User return codes - 0 - User authenticated successfully. 1 - Server error. - 2 - Protocol error. + 2 - Group membership error. 3 - Logon error; Incorrect password or username given. */ Index: squid/helpers/basic_auth/win32_locallogon/valid.h =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/basic_auth/win32_locallogon/Attic/valid.h,v retrieving revision 1.1.4.5 retrieving revision 1.1.4.6 diff -u -r1.1.4.5 -r1.1.4.6 --- squid/helpers/basic_auth/win32_locallogon/valid.h 13 Sep 2005 15:44:27 -0000 1.1.4.5 +++ squid/helpers/basic_auth/win32_locallogon/valid.h 14 Sep 2005 12:12:21 -0000 1.1.4.6 @@ -2,7 +2,6 @@ NT_auth - Version 2.0 Modified to act as a Squid authenticator module. - Removed all Pike stuff. Returns OK for a successful authentication, or ERR upon error. Guido Serassio, Torino - Italy @@ -44,6 +43,8 @@ #define DEBUG #endif +#define safe_free(x) if (x) { free(x); x = NULL; } + /* SMB User verification function */ #define NTV_NO_ERROR 0 @@ -101,9 +102,6 @@ } #endif /* __GNUC__ */ - - - int Valid_User(char *,char *, char *); #endif