#include "squid.h"
#include "helpers/defines.h"
+#include "rfc1738.h"
#include "util.h"
+#include "valid.h"
#if HAVE_STDIO_H
#include <stdio.h>
#error NON WINDOWS PLATFORM
#endif
-#include "valid.h"
-
static char NTGroup[256];
char * NTAllowedGroup;
char * NTDisAllowedGroup;
* -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;
-
-void
-usage()
+static void
+usage(const char *name)
{
fprintf(stderr, "Usage:\n%s [-A|D UserGroup][-O DefaultDomain][-d]\n"
"-A can specify a Windows Local Group name allowed to authenticate\n"
"-O can specify the default Domain against to authenticate\n"
"-d enable debugging.\n"
"-h this message\n\n",
- my_program_name);
+ name);
}
void
/* fall thru to default */
default:
fprintf(stderr, "FATAL: Unknown option: -%c\n", opt);
- usage();
+ usage(argv[0]);
exit(1);
}
}
char *p;
int err = 0;
- my_program_name = argv[0];
process_options(argc, argv);
if (LoadSecurityDll(SSP_BASIC, NTLM_PACKAGE_NAME) == NULL) {
#ifndef _VALID_H_
#define _VALID_H_
-#if _SQUID_CYGWIN_
+#include "sspwin32.h"
+
+#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#include <lm.h>
-#include "sspwin32.h"
+#include <sys/types.h>
#undef debug
/************* CONFIGURATION ***************/
-/*
- * define this if you want debugging
- */
-#ifndef DEBUG
-#define DEBUG
-#endif
-
-#define safe_free(x) if (x) { free(x); x = NULL; }
-
/* SMB User verification function */
#define NTV_NO_ERROR 0
extern char Default_NTDomain[DNLEN+1];
extern const char * errormsg;
-#include <sys/types.h>
-
/* Debugging stuff */
-
-#ifdef __GNUC__ /* this is really a gcc-ism */
-#ifdef DEBUG
+#if defined(__GNUC__) /* this is really a gcc-ism */
#include <stdio.h>
#include <unistd.h>
static char *__foo;
((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
__LINE__);\
fprintf(stderr,X); }
-#else /* DEBUG */
-#define debug(X...) /* */
-#endif /* DEBUG */
#else /* __GNUC__ */
static void
debug(char *format,...)
{
-#ifdef DEBUG
-#if _SQUID_WINDOWS_
if (debug_enabled) {
va_list args;
vfprintf(stderr, format, args);
va_end(args);
}
-#endif /* _SQUID_WINDOWS_ */
-#endif /* DEBUG */
}
#endif /* __GNUC__ */