Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26b994fa authored by Steve French's avatar Steve French
Browse files

[CIFS] Code cleanup in old sessionsetup code



Remove some long lines

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 95089910
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
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
------------
DFS support added (Microsoft Distributed File System client support needed
+72 −78
Original line number Diff line number Diff line
@@ -3620,32 +3620,30 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
		}
		first_time = 1;
	}
	if (!rc) {

	if (rc)
		goto ss_err_exit;

	pSesInfo->flags = 0;
	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 TimeAdjust: %d",
	cFYI(1, ("Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
		 pSesInfo->server->secMode,
		 pSesInfo->server->capabilities,
		 pSesInfo->server->timeAdj));
	if (experimEnabled < 2)
			rc = CIFS_SessSetup(xid, pSesInfo,
					    first_time, nls_info);
		rc = CIFS_SessSetup(xid, pSesInfo, first_time, nls_info);
	else if (extended_security
				&& (pSesInfo->capabilities
					& CAP_EXTENDED_SECURITY)
			&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
			&& (pSesInfo->server->secType == NTLMSSP)) {
		rc = -EOPNOTSUPP;
	} else if (extended_security
			&& (pSesInfo->capabilities & CAP_EXTENDED_SECURITY)
			&& (pSesInfo->server->secType == RawNTLMSSP)) {
		cFYI(1, ("NTLMSSP sesssetup"));
			rc = CIFSNTLMSSPNegotiateSessSetup(xid,
						pSesInfo,
						&ntlmv2_flag,
		rc = CIFSNTLMSSPNegotiateSessSetup(xid, pSesInfo, &ntlmv2_flag,
						   nls_info);
		if (!rc) {
			if (ntlmv2_flag) {
@@ -3656,14 +3654,13 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
					rc = -ENOMEM;
					goto ss_err_exit;
				} else
						v2_response = kmalloc(16 + 64 /* blob */, GFP_KERNEL);
					v2_response = kmalloc(16 + 64 /* blob*/,
								GFP_KERNEL);
				if (v2_response) {
					CalcNTLMv2_response(pSesInfo,
								v2_response);
				/*	if (first_time)
						  cifs_calculate_ntlmv2_mac_key(
						   pSesInfo->server->mac_signing_key,
						   response, ntlm_session_key,*/
						cifs_calculate_ntlmv2_mac_key */
					kfree(v2_response);
					/* BB Put dummy sig in SessSetup PDU? */
				} else {
@@ -3685,15 +3682,13 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
			/* for better security the weaker lanman hash not sent
			   in AuthSessSetup so we no longer calculate it */

				rc = CIFSNTLMSSPAuthSessSetup(xid,
					pSesInfo,
			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,
		SMBNTencrypt(pSesInfo->password, pSesInfo->server->cryptKey,
			     ntlm_session_key);

		if (first_time)
@@ -3701,8 +3696,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
					&pSesInfo->server->mac_signing_key,
					ntlm_session_key, pSesInfo->password);

			rc = CIFSSessSetup(xid, pSesInfo,
				ntlm_session_key, nls_info);
		rc = CIFSSessSetup(xid, pSesInfo, ntlm_session_key, nls_info);
	}
	if (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"));
			pSesInfo->status = CifsGood;
	}
	}

ss_err_exit:
	return rc;
}