Skip to content

Commit b9043cc

Browse files
aaptelsmfrench
authored andcommitted
CIFS: set signing flag in SMB2+ TreeConnect if needed
cifs_enable_signing() already sets server->sign according to what the server requires/offers and what mount options allows/forbids, so use that. this is required for IPC tcon that connects to signing-required servers. Signed-off-by: Aurelien Aptel <aaptel@suse.com> Acked-by: Pavel Shilovsky <pshilov@microsoft.com> Signed-off-by: Steve French <smfrench@gmail.com>
1 parent 7f9f6d2 commit b9043cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/cifs/smb2pdu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,8 +1168,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
11681168

11691169
/* since no tcon, smb2_init can not do this, so do here */
11701170
req->hdr.sync_hdr.SessionId = ses->Suid;
1171-
/* if (ses->server->sec_mode & SECMODE_SIGN_REQUIRED)
1172-
req->hdr.Flags |= SMB2_FLAGS_SIGNED; */
1171+
if (ses->server->sign)
1172+
req->hdr.sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
11731173
} else if (encryption_required(tcon))
11741174
flags |= CIFS_TRANSFORM_REQ;
11751175

0 commit comments

Comments
 (0)