summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-09-26 02:55:19 -0700
committerKarolin Seeger <kseeger@samba.org>2013-11-28 10:13:41 +0100
commit2f9c9b7bb5a1b7c25d1c588fcc0e25ec2b0d9906 (patch)
treea65d0c6e41307416aed9942417867a50a30d9adb
parentf9dd9ce298e2bbddfebee62a884f6d63fc2c4ab1 (diff)
downloadsamba-2f9c9b7bb5a1b7c25d1c588fcc0e25ec2b0d9906.tar.gz
s3: smb2 server - fix bug 10167 smb2 breaks "smb encryption = mandatory
Refuse an SMB2 tcon on a share wher eencryption is required. SMB2 doesn't support this. Signed-off-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e00a2c90847b3c85f089b4f3c96ec6c66b949576)
-rw-r--r--source3/smbd/smb2_tcon.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 5f0e3a937a3..8b955ff9604 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -207,6 +207,15 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
return NT_STATUS_BAD_NETWORK_NAME;
}
+ /* Don't allow connection if encryption is required. */
+ if (lp_smb_encrypt(snum) == Required) {
+ DEBUG(0,("Connection refused on share %s as encryption is"
+ " required on this share and SMB2 does not support"
+ " this.\n",
+ lp_servicename(snum)));
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
/* create a new tcon as child of the session */
tcon = talloc_zero(req->session, struct smbd_smb2_tcon);
if (tcon == NULL) {