--------------------- PatchSet 627 Date: 2000/10/10 16:49:46 Author: kinkie Branch: ntlm Tag: (none) Log: Added is_dc_ok, meant to check whether a domain controller is alive. Members: ntlm_auth_modules/NTLMSSP/libntlmssp.c:1.1.2.11->1.1.2.12 Index: squid/ntlm_auth_modules/NTLMSSP/libntlmssp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/ntlm_auth_modules/NTLMSSP/Attic/libntlmssp.c,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -u -r1.1.2.11 -r1.1.2.12 --- squid/ntlm_auth_modules/NTLMSSP/libntlmssp.c 10 Oct 2000 10:08:18 -0000 1.1.2.11 +++ squid/ntlm_auth_modules/NTLMSSP/libntlmssp.c 10 Oct 2000 16:49:46 -0000 1.1.2.12 @@ -128,6 +128,18 @@ return (handle!=NULL); } + +/* Tries to connect to a DC. Returns 0 on failure, 1 on OK */ +int is_dc_ok (char *domain, + char *domain_controller) { + SMB_Handle_Type h=SMB_Connect_Server(NULL,domain_controller,domain); + if (h==NULL) + return 0; + SMB_Discon(h,0); + return 1; +} + + /* returns 0 on success, > 0 on failure */ static int init_challenge(char* domain, char* domain_controller) {