]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
CIFS: set signing flag in SMB2+ TreeConnect if needed
authorAurelien Aptel <aaptel@suse.com>
Mon, 13 Feb 2017 15:19:04 +0000 (16:19 +0100)
committerSteve French <smfrench@gmail.com>
Thu, 2 Mar 2017 04:26:11 +0000 (22:26 -0600)
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>
fs/cifs/smb2pdu.c

index 8c4532dc749f728a2c9c552a899cde87be54afab..2fd93eeed15a78db3a84d118c748e5c07a2e0314 100644 (file)
@@ -1168,8 +1168,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
 
                /* since no tcon, smb2_init can not do this, so do here */
                req->hdr.sync_hdr.SessionId = ses->Suid;
-               /* if (ses->server->sec_mode & SECMODE_SIGN_REQUIRED)
-                       req->hdr.Flags |= SMB2_FLAGS_SIGNED; */
+               if (ses->server->sign)
+                       req->hdr.sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
        } else if (encryption_required(tcon))
                flags |= CIFS_TRANSFORM_REQ;