--------------------- PatchSet 2893 Date: 2001/08/29 09:24:52 Author: kinkie Branch: ntlm Tag: (none) Log: Closed potential race window with timeouts. Members: src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c:1.1.4.21->1.1.4.22 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.4.21 retrieving revision 1.1.4.22 diff -u -r1.1.4.21 -r1.1.4.22 --- squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c 21 Aug 2001 14:30:56 -0000 1.1.4.21 +++ squid/src/auth/ntlm/helpers/NTLMSSP/ntlm_auth.c 29 Aug 2001 09:24:52 -0000 1.1.4.22 @@ -68,10 +68,9 @@ /* signal handler to be invoked when the authentication operation times out */ +static char got_timeout=0; static void timeout_during_auth(int signum) { - fprintf(stderr,"ntlm-auth[%d]: Timeout during authentication.\n", getpid()); - SEND("BH Timeout during authentication"); dc_disconnect(); } @@ -315,6 +314,12 @@ cred = ntlm_check_auth ((ntlm_authenticate *) decoded, plen); alarm(0); signal(SIGALRM,SIG_DFL); + if (got_timeout != 0) { + fprintf(stderr,"ntlm-auth[%d]: Timeout during authentication.\n", getpid()); + SEND("BH Timeout during authentication"); + got_timeout=0; + return; + } if (cred == NULL) { int smblib_err, smb_errorclass, smb_errorcode, nb_error; /* there was an error. We have two errno's to look at.