@@ -132,9 +132,9 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
dp = description + strlen(description);
/* for now, only sec=krb5 and sec=mskrb5 are valid */
- if (server->secType == Kerberos)
+ if (sesInfo->secType == Kerberos)
sprintf(dp, ";sec=krb5");
- else if (server->secType == MSKerberos)
+ else if (sesInfo->secType == MSKerberos)
sprintf(dp, ";sec=mskrb5");
else
goto out;
@@ -160,7 +160,6 @@ struct TCP_Server_Info {
struct task_struct *tsk;
char server_GUID[16];
char secMode;
- enum securityEnum secType;
unsigned int maxReq; /* Clients should submit no more */
/* than maxReq distinct unanswered SMBs to the server when using */
/* multiplexed reads or writes */
@@ -212,6 +211,7 @@ struct cifsSesInfo {
struct TCP_Server_Info *server; /* pointer to server info */
int ses_count; /* reference counter */
enum statusEnum status;
+ enum securityEnum secType;
unsigned overrideSecFlg; /* if non-zero override global sec flags */
__u16 ipc_tid; /* special tid for connection to IPC share */
__u16 flags;
@@ -425,7 +425,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
if ((secFlags & CIFSSEC_MAY_LANMAN) ||
(secFlags & CIFSSEC_MAY_PLNTXT))
- server->secType = LANMAN;
+ ses->secType = LANMAN;
else {
cERROR(1, ("mount failed weak security disabled"
" in /proc/fs/cifs/SecurityFlags"));
@@ -521,20 +521,20 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
" but client support disabled"));
if ((secFlags & CIFSSEC_MUST_NTLMV2) == CIFSSEC_MUST_NTLMV2)
- server->secType = NTLMv2;
+ ses->secType = NTLMv2;
else if (secFlags & CIFSSEC_MAY_NTLM)
- server->secType = NTLM;
+ ses->secType = NTLM;
else if (secFlags & CIFSSEC_MAY_NTLMV2)
- server->secType = NTLMv2;
+ ses->secType = NTLMv2;
else if (secFlags & CIFSSEC_MAY_KRB5)
- server->secType = Kerberos;
+ ses->secType = Kerberos;
else if (secFlags & CIFSSEC_MAY_NTLMSSP)
- server->secType = RawNTLMSSP;
+ ses->secType = RawNTLMSSP;
else if (secFlags & CIFSSEC_MAY_LANMAN)
- server->secType = LANMAN;
+ ses->secType = LANMAN;
/* #ifdef CONFIG_CIFS_EXPERIMENTAL
else if (secFlags & CIFSSEC_MAY_PLNTXT)
- server->secType = ??
+ ses->secType = ??
#endif */
else {
rc = -EOPNOTSUPP;
@@ -593,12 +593,12 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
}
if (count == 16) {
- server->secType = RawNTLMSSP;
+ ses->secType = RawNTLMSSP;
} else {
rc = decode_negTokenInit(pSMBr->u.extended_response.
SecurityBlob,
count - 16,
- &server->secType);
+ &ses->secType);
if (rc == 1)
rc = 0;
else
@@ -2752,7 +2752,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
NTLMv2 password here) */
#ifdef CONFIG_CIFS_WEAK_PW_HASH
if ((extended_security & CIFSSEC_MAY_LANMAN) &&
- (ses->server->secType == LANMAN))
+ (ses->secType == LANMAN))
calc_lanman_hash(tcon->password, ses->server->cryptKey,
ses->server->secMode &
SECMODE_PW_ENCRYPT ? true : false,
@@ -580,7 +580,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
if (ses == NULL)
return -EINVAL;
- type = ses->server->secType;
+ type = ses->secType;
cFYI(1, ("sess setup type %d", type));
ssetup_ntlmssp_authenticate: