pSesInfo->sequence_number = 0; 
/*	pSesInfo->sequence_number = 0;*/ 
int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,					   struct nls_table * nls_info){	int rc = 0;	char ntlm_session_key[CIFS_SESSION_KEY_SIZE];	int ntlmv2_flag = FALSE;	/* what if server changes its buffer size after dropping the session? */	if(pSesInfo->server->maxBuf == 0) /* no need to send on reconnect */ {		rc = CIFSSMBNegotiate(xid, pSesInfo);		if(rc == -EAGAIN) /* retry only once on 1st time connection */ {			rc = CIFSSMBNegotiate(xid, pSesInfo);			if(rc == -EAGAIN) 				rc = -EHOSTDOWN;		}		if(rc == 0) {			spin_lock(&GlobalMid_Lock);			if(pSesInfo->server->tcpStatus != CifsExiting)				pSesInfo->server->tcpStatus = CifsGood;			else				rc = -EHOSTDOWN;			spin_unlock(&GlobalMid_Lock);		}	}	if (!rc) {		pSesInfo->capabilities = pSesInfo->server->capabilities;		if(linuxExtEnabled == 0)			pSesInfo->capabilities &= (~CAP_UNIX);		pSesInfo->sequence_number = 0;		cFYI(1,("Security Mode: 0x%x Capabilities: 0x%x Time Zone: %d",			pSesInfo->server->secMode,			pSesInfo->server->capabilities,			pSesInfo->server->timeZone));		if (extended_security				&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)				&& (pSesInfo->server->secType == NTLMSSP)) {			cFYI(1, ("New style sesssetup "));			rc = CIFSSpnegoSessSetup(xid, pSesInfo,				NULL /* security blob */, 				0 /* blob length */,				nls_info);		} else if (extended_security			   && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)			   && (pSesInfo->server->secType == RawNTLMSSP)) {			cFYI(1, ("NTLMSSP sesssetup "));			rc = CIFSNTLMSSPNegotiateSessSetup(xid,						pSesInfo,						&ntlmv2_flag,						nls_info);			if (!rc) {				if(ntlmv2_flag) {					char * v2_response;					cFYI(1,("Can use more secure NTLM version 2 password hash"));					if(CalcNTLMv2_partial_mac_key(pSesInfo, 						nls_info)) {						rc = -ENOMEM;						goto ss_err_exit;					} else						v2_response = kmalloc(16 + 64 /* blob */, GFP_KERNEL);					if(v2_response) {						CalcNTLMv2_response(pSesInfo,v2_response);/*						cifs_calculate_ntlmv2_mac_key(pSesInfo->mac_signing_key, response, ntlm_session_key, */						kfree(v2_response);					/* BB Put dummy sig in SessSetup PDU? */					} else {						rc = -ENOMEM;						goto ss_err_exit;					}				} else {					SMBNTencrypt(pSesInfo->password,						pSesInfo->server->cryptKey,						ntlm_session_key);					cifs_calculate_mac_key(pSesInfo->mac_signing_key,						ntlm_session_key,						pSesInfo->password);				}			/* for better security the weaker lanman hash not sent			   in AuthSessSetup so we no longer calculate it */				rc = CIFSNTLMSSPAuthSessSetup(xid,					pSesInfo,					ntlm_session_key,					ntlmv2_flag,					nls_info);			}		} else { /* old style NTLM 0.12 session setup */			SMBNTencrypt(pSesInfo->password,				pSesInfo->server->cryptKey,				ntlm_session_key);			cifs_calculate_mac_key(pSesInfo->mac_signing_key, 				ntlm_session_key, pSesInfo->password);			rc = CIFSSessSetup(xid, pSesInfo,				ntlm_session_key, nls_info);		}		if (rc) {			cERROR(1,("Send error in SessSetup = %d",rc));		} else {			cFYI(1,("CIFS Session Established successfully"));			pSesInfo->status = CifsGood;		}	}ss_err_exit:	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ad009ac96509e005d9978d0ae9e9ec4d63ad2990/connect.c/clean/fs/cifs/connect.c