[CIFS] Code cleanup in old sessionsetup code
Remove some long lines Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
Version 1.54
|
||||||
|
------------
|
||||||
|
Fix premature write failure on congested networks (we would give up
|
||||||
|
on EAGAIN from the socket too quickly on large writes).
|
||||||
|
Cifs_mkdir and cifs_create now respect the setgid bit on parent dir.
|
||||||
|
Fix endian problems in acl (mode from/to cifs acl) on bigendian
|
||||||
|
architectures.
|
||||||
|
|
||||||
Version 1.53
|
Version 1.53
|
||||||
------------
|
------------
|
||||||
DFS support added (Microsoft Distributed File System client support needed
|
DFS support added (Microsoft Distributed File System client support needed
|
||||||
|
@@ -3620,32 +3620,30 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
|
|||||||
}
|
}
|
||||||
first_time = 1;
|
first_time = 1;
|
||||||
}
|
}
|
||||||
if (!rc) {
|
|
||||||
|
if (rc)
|
||||||
|
goto ss_err_exit;
|
||||||
|
|
||||||
pSesInfo->flags = 0;
|
pSesInfo->flags = 0;
|
||||||
pSesInfo->capabilities = pSesInfo->server->capabilities;
|
pSesInfo->capabilities = pSesInfo->server->capabilities;
|
||||||
if (linuxExtEnabled == 0)
|
if (linuxExtEnabled == 0)
|
||||||
pSesInfo->capabilities &= (~CAP_UNIX);
|
pSesInfo->capabilities &= (~CAP_UNIX);
|
||||||
/* pSesInfo->sequence_number = 0;*/
|
/* pSesInfo->sequence_number = 0;*/
|
||||||
cFYI(1,
|
cFYI(1, ("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
|
||||||
("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
|
|
||||||
pSesInfo->server->secMode,
|
pSesInfo->server->secMode,
|
||||||
pSesInfo->server->capabilities,
|
pSesInfo->server->capabilities,
|
||||||
pSesInfo->server->timeAdj));
|
pSesInfo->server->timeAdj));
|
||||||
if (experimEnabled < 2)
|
if (experimEnabled < 2)
|
||||||
rc = CIFS_SessSetup(xid, pSesInfo,
|
rc = CIFS_SessSetup(xid, pSesInfo, first_time, nls_info);
|
||||||
first_time, nls_info);
|
|
||||||
else if (extended_security
|
else if (extended_security
|
||||||
&& (pSesInfo->capabilities
|
&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
|
||||||
& CAP_EXTENDED_SECURITY)
|
|
||||||
&& (pSesInfo->server->secType == NTLMSSP)) {
|
&& (pSesInfo->server->secType == NTLMSSP)) {
|
||||||
rc = -EOPNOTSUPP;
|
rc = -EOPNOTSUPP;
|
||||||
} else if (extended_security
|
} else if (extended_security
|
||||||
&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
|
&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
|
||||||
&& (pSesInfo->server->secType == RawNTLMSSP)) {
|
&& (pSesInfo->server->secType == RawNTLMSSP)) {
|
||||||
cFYI(1, ("NTLMSSP sesssetup"));
|
cFYI(1, ("NTLMSSP sesssetup"));
|
||||||
rc = CIFSNTLMSSPNegotiateSessSetup(xid,
|
rc = CIFSNTLMSSPNegotiateSessSetup(xid, pSesInfo, &ntlmv2_flag,
|
||||||
pSesInfo,
|
|
||||||
&ntlmv2_flag,
|
|
||||||
nls_info);
|
nls_info);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
if (ntlmv2_flag) {
|
if (ntlmv2_flag) {
|
||||||
@@ -3656,14 +3654,13 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
|
|||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto ss_err_exit;
|
goto ss_err_exit;
|
||||||
} else
|
} else
|
||||||
v2_response = kmalloc(16 + 64 /* blob */, GFP_KERNEL);
|
v2_response = kmalloc(16 + 64 /* blob*/,
|
||||||
|
GFP_KERNEL);
|
||||||
if (v2_response) {
|
if (v2_response) {
|
||||||
CalcNTLMv2_response(pSesInfo,
|
CalcNTLMv2_response(pSesInfo,
|
||||||
v2_response);
|
v2_response);
|
||||||
/* if (first_time)
|
/* if (first_time)
|
||||||
cifs_calculate_ntlmv2_mac_key(
|
cifs_calculate_ntlmv2_mac_key */
|
||||||
pSesInfo->server->mac_signing_key,
|
|
||||||
response, ntlm_session_key,*/
|
|
||||||
kfree(v2_response);
|
kfree(v2_response);
|
||||||
/* BB Put dummy sig in SessSetup PDU? */
|
/* BB Put dummy sig in SessSetup PDU? */
|
||||||
} else {
|
} else {
|
||||||
@@ -3685,15 +3682,13 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
|
|||||||
/* for better security the weaker lanman hash not sent
|
/* for better security the weaker lanman hash not sent
|
||||||
in AuthSessSetup so we no longer calculate it */
|
in AuthSessSetup so we no longer calculate it */
|
||||||
|
|
||||||
rc = CIFSNTLMSSPAuthSessSetup(xid,
|
rc = CIFSNTLMSSPAuthSessSetup(xid, pSesInfo,
|
||||||
pSesInfo,
|
|
||||||
ntlm_session_key,
|
ntlm_session_key,
|
||||||
ntlmv2_flag,
|
ntlmv2_flag,
|
||||||
nls_info);
|
nls_info);
|
||||||
}
|
}
|
||||||
} else { /* old style NTLM 0.12 session setup */
|
} else { /* old style NTLM 0.12 session setup */
|
||||||
SMBNTencrypt(pSesInfo->password,
|
SMBNTencrypt(pSesInfo->password, pSesInfo->server->cryptKey,
|
||||||
pSesInfo->server->cryptKey,
|
|
||||||
ntlm_session_key);
|
ntlm_session_key);
|
||||||
|
|
||||||
if (first_time)
|
if (first_time)
|
||||||
@@ -3701,8 +3696,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
|
|||||||
&pSesInfo->server->mac_signing_key,
|
&pSesInfo->server->mac_signing_key,
|
||||||
ntlm_session_key, pSesInfo->password);
|
ntlm_session_key, pSesInfo->password);
|
||||||
|
|
||||||
rc = CIFSSessSetup(xid, pSesInfo,
|
rc = CIFSSessSetup(xid, pSesInfo, ntlm_session_key, nls_info);
|
||||||
ntlm_session_key, nls_info);
|
|
||||||
}
|
}
|
||||||
if (rc) {
|
if (rc) {
|
||||||
cERROR(1, ("Send error in SessSetup = %d", rc));
|
cERROR(1, ("Send error in SessSetup = %d", rc));
|
||||||
@@ -3710,7 +3704,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
|
|||||||
cFYI(1, ("CIFS Session Established successfully"));
|
cFYI(1, ("CIFS Session Established successfully"));
|
||||||
pSesInfo->status = CifsGood;
|
pSesInfo->status = CifsGood;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
ss_err_exit:
|
ss_err_exit:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user