--------------------- PatchSet 1217 Date: 2001/01/09 13:30:09 Author: kinkie Branch: auth_rewrite Tag: (none) Log: Fixed to print usage instructions in case of some kinds of helper deaths. At least the helpers won't die uselessly now. Members: src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c:1.1.2.2->1.1.2.3 Index: squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/helpers/NTLMSSP/Attic/ntlm_auth.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c 8 Jan 2001 00:14:57 -0000 1.1.2.2 +++ squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c 9 Jan 2001 13:30:09 -0000 1.1.2.3 @@ -106,6 +106,24 @@ * -f fail-over to another DC if DC connection fails. * domain\controller ... */ +char *my_program_name=NULL; + +void +usage() +{ + fprintf(stderr, + "%s usage:\n" + "%s [-b] [-f] domain\\controller [domain\\controller ...]\n" + "-b, if specified, enables load-balancing among controllers\n" + "-f, if specified, enables failover among controllers\n\n" + "You MUST specify at least one Domain Controller.\n" + "You can use either \\ or / as separator between the domain name \n" + "\tand the controller name\n" + ,my_program_name + ,my_program_name); +} + + void process_options(int argc, char *argv[]) { @@ -121,6 +139,7 @@ break; default: fprintf(stderr, "unknown option: -%c. Exiting\n", opt); + usage(); had_error = 1; } } @@ -158,6 +177,7 @@ } if (numcontrollers == 0) { fprintf(stderr, "You must specify at least one domain-controller!\n"); + usage(); exit(1); } last_dc->next = controllers; /* close the queue, now it's circular */ @@ -188,6 +208,7 @@ return NULL; } + void manage_request() { @@ -308,6 +329,7 @@ debug("starting up...\n"); + my_program_name=argv[0]; process_options(argc, argv); debug("options processed OK\n");