summaryrefslogtreecommitdiff
path: root/fs/smb/client/connect.c
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2024-11-14 15:46:54 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2024-11-14 15:54:45 -0300
commit7761b7e5370826850a1421d7ffc17b85f6c59a99 (patch)
treed692c8a93c10dd1e5ebe4fa738e69ca07bdf0949 /fs/smb/client/connect.c
parent60eed99db98cb0138209a943d5b8c79af7f7481f (diff)
downloadlinux-hw24.tar.gz
linux-hw24.tar.bz2
linux-hw24.zip
smb: client: leave only string and id in smb_version_valueshw24
Remove all other values as they're the same for SMB 3.0+. For SMB 2.1 handle the only 2 different values (.req_capabilities and .create_lease_size) in-place. Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Diffstat (limited to 'fs/smb/client/connect.c')
-rw-r--r--fs/smb/client/connect.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 065dde89febf..4c269eaf6013 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -909,10 +909,13 @@ handle_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server,
int
cifs_enable_signing(struct TCP_Server_Info *server, bool mnt_sign_required)
{
- bool srv_sign_required = server->sec_mode & server->vals->signing_required;
- bool srv_sign_enabled = server->sec_mode & server->vals->signing_enabled;
+ bool srv_sign_required;
+ bool srv_sign_enabled;
bool mnt_sign_enabled;
+ srv_sign_required = (server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED);
+ srv_sign_enabled = srv_sign_required || (server->sec_mode & SMB2_NEGOTIATE_SIGNING_ENABLED);
+
/*
* Is signing required by mnt options? If not then check
* global_secflags to see if it is there.
@@ -1053,8 +1056,7 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid)
unsigned int pdu_length = server->pdu_size;
/* make sure this will fit in a large buffer */
- if (pdu_length > CIFSMaxBufSize + MAX_HEADER_SIZE(server) -
- HEADER_PREAMBLE_SIZE(server)) {
+ if (pdu_length > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE) {
cifs_server_dbg(VFS, "SMB response too long (%u bytes)\n", pdu_length);
cifs_reconnect(server, true);
return -ECONNABORTED;
@@ -1215,9 +1217,7 @@ next_pdu:
}
/* read down to the MID */
- length = cifs_read_from_socket(server,
- buf + HEADER_PREAMBLE_SIZE(server),
- MID_HEADER_SIZE(server));
+ length = cifs_read_from_socket(server, buf, MID_HEADER_SIZE(server));
if (length < 0)
continue;
server->total_read += length;
@@ -3662,7 +3662,8 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
if (!is_binding) {
ses->capabilities = server->capabilities;
if (!linuxExtEnabled)
- ses->capabilities &= (~server->vals->cap_unix);
+ /* XXX: remove this? (was ~cap_unix) */
+ ses->capabilities &= (~0);
if (ses->auth_key.response) {
cifs_dbg(FYI, "Free previous auth_key.response = %p\n",