]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: ensure global "smb encrypt = off" is effective for share with "smb encrypt...
authorRalph Boehme <slow@samba.org>
Mon, 16 Jan 2017 11:56:10 +0000 (12:56 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 1 Feb 2017 11:53:21 +0000 (12:53 +0100)
If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of specifying

[Global]
  smb encrypt = off

[share]
  smb encrypt = desired

must be an unecrypted tree connect to the share "share".

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12520

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b0b418c22558fa1df547df9bdac2642343ac39e1)

source3/smbd/smb2_tcon.c

index 61e2a3636d3a4535418bb14d2dc96e8c372746da..5330fc39c36dfc8c674ebdd12bdcdc6599610ab7 100644 (file)
@@ -268,7 +268,8 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
        }
 
        if ((lp_smb_encrypt(snum) >= SMB_SIGNING_DESIRED) &&
-           (conn->smb2.client.capabilities & SMB2_CAP_ENCRYPTION)) {
+           (conn->smb2.server.cipher != 0))
+       {
                encryption_desired = true;
        }