60 fprintf(stderr,
"Usage:\n%s [-A|D UserGroup][-O DefaultDomain][-d]\n"
61 "-A can specify a Windows Local Group name allowed to authenticate\n"
62 "-D can specify a Windows Local Group name not allowed to authenticate\n"
63 "-O can specify the default Domain against to authenticate\n"
64 "-d enable debugging.\n"
65 "-h this message\n\n",
73 while (-1 != (opt =
getopt(argc, argv,
"dhA:D:O:"))) {
98 fprintf(stderr,
"FATAL: Unknown option: -%c\n", opt);
120 fprintf(stderr,
"FATAL: can't initialize SSPI, exiting.\n");
123 debug(
"SSPI initialized OK\n");
128 setbuf(stdout,
nullptr);
129 setbuf(stderr,
nullptr);
133 if (
NULL == strchr(wstr,
'\n')) {
144 if ((p = strchr(wstr,
'\n')) !=
NULL)
146 if ((p = strchr(wstr,
'\r')) !=
NULL)
151 sscanf(wstr,
"%s %s", username, password);
153 debug(
"Got %s from Squid\n", wstr);
156 if ((username[0] ==
'\0') || (password[0] ==
'\0')) {
164 debug(
"Trying to validate; %s %s\n", username, password);
#define HELPER_INPUT_BUFFER
static void process_options(int argc, char *argv[])
void debug(const char *format,...)
int getopt(int nargc, char *const *nargv, const char *ostr)
void rfc1738_unescape(char *url)
void UnloadSecurityDll(void)
HMODULE LoadSecurityDll(int mode, const char *SSP_Package)
#define NTLM_PACKAGE_NAME
int Valid_User(char *UserName, char *Password, char *)
char Default_NTDomain[DNLEN+1]