61 fprintf(stderr,
"Usage:\n%s [-A|D UserGroup][-O DefaultDomain][-d]\n"
62 "-A can specify a Windows Local Group name allowed to authenticate\n"
63 "-D can specify a Windows Local Group name not allowed to authenticate\n"
64 "-O can specify the default Domain against to authenticate\n"
65 "-d enable debugging.\n"
66 "-h this message\n\n",
74 while (-1 != (opt =
getopt(argc, argv,
"dhA:D:O:"))) {
99 fprintf(stderr,
"FATAL: Unknown option: -%c\n", opt);
121 fprintf(stderr,
"FATAL: can't initialize SSPI, exiting.\n");
124 debug(
"SSPI initialized OK\n");
129 setbuf(stdout,
nullptr);
130 setbuf(stderr,
nullptr);
134 if (
NULL == strchr(wstr,
'\n')) {
145 if ((p = strchr(wstr,
'\n')) !=
NULL)
147 if ((p = strchr(wstr,
'\r')) !=
NULL)
152 sscanf(wstr,
"%s %s", username, password);
154 debug(
"Got %s from Squid\n", wstr);
157 if ((username[0] ==
'\0') || (password[0] ==
'\0')) {
165 debug(
"Trying to validate; %s %s\n", username, password);
int Valid_User(char *USERNAME, char *PASSWORD, const char *SERVER, char *, const char *DOMAIN)
char Default_NTDomain[DNLEN+1]
#define HELPER_INPUT_BUFFER
int main(int argc, char **argv)
static void process_options(int argc, char *argv[])
static void usage(const char *name)
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