--------------------- PatchSet 539 Date: 2000/08/18 14:59:23 Author: kinkie Branch: ntlm Tag: (none) Log: Removed a bit of cruft Added function to disconnect from the DC. Removed some now useless debugging output Members: ntlm_auth_modules/NTLMSSP/libntlmssp.c:1.1.2.9->1.1.2.10 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.9 retrieving revision 1.1.2.10 diff -u -r1.1.2.9 -r1.1.2.10 --- squid/ntlm_auth_modules/NTLMSSP/libntlmssp.c 17 Aug 2000 15:17:21 -0000 1.1.2.9 +++ squid/ntlm_auth_modules/NTLMSSP/libntlmssp.c 18 Aug 2000 14:59:23 -0000 1.1.2.10 @@ -116,25 +116,19 @@ static char challenge[8]; SMB_Handle_Type handle=NULL; +/* Disconnects from the DC. A reconnection will be done upon the next request + */ +void dc_disconnect() { + if (handle != NULL) + SMB_Discon(handle,0); + handle=NULL; +} + /* returns 0 on success, > 0 on failure */ static int init_challenge() { - char *SMB_Prots[] = { - "PC NETWORK PROGRAM 1.0", - "MICROSOFT NETWORKS 1.03", - "MICROSOFT NETWORKS 3.0", - "LANMAN1.0", - "LM1.2X002", - "Samba", - "NT LM 0.12", - "NT LANMAN 1.0", - NULL}; if (handle != NULL) { -#ifdef REUSE_SAME_CHALLENGE return 0; -#else /* one challenge - one connection */ - SMB_Discon(handle,0); -#endif /* REUSE_SAME_CHALLENGE */ } debug("Connecting to server\n"); @@ -148,6 +142,7 @@ if (SMB_Negotiate(handle, SMB_Prots) < 0) { /* An error */ debug("Error negotiating protocol with SMB Server\n"); SMB_Discon(handle,0); + handle=NULL; return 2; } @@ -224,7 +219,7 @@ memcpy(pass,tmp.str,tmp.l); pass[25]='\0'; - debug("fetching domain\n"); +/* debug("fetching domain\n"); */ tmp=fetch_string((char *)auth,auth_length,&auth->domain); if (tmp.str==NULL) { debug("No domain supplied. Returning no-auth\n"); @@ -234,7 +229,7 @@ user=domain+tmp.l; *user++='\0'; - debug("fetching user name\n"); +/* debug("fetching user name\n"); */ tmp=fetch_string((char *)auth,auth_length,&auth->user); if (tmp.str==NULL) { debug("No username supplied. Returning no-auth\n"); @@ -247,11 +242,6 @@ rv=SMB_Logon_Server(handle,user,pass,domain,1); -#ifndef REUSE_SAME_CHALLENGE - SMB_Discon(handle,0); - handle=NULL; -#endif /* REUSE_SAME_CHALLENGE */ - debug("\tresult is %d\n",rv); if (rv!=NTV_NO_ERROR) /* failed */