From b1ea74af4cd619bae3c73ff6ea14a9204ab6fee1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 6 May 2015 00:38:55 +0200 Subject: [PATCH] s3:smb2_create: treat the SVHDX_OPEN_DEVICE_CONTEXT in smb2_create (not supported) Pair-Programmed-With: Stefan Metzmacher Signed-off-by: Michael Adam Signed-off-by: Stefan Metzmacher --- source3/smbd/smb2_create.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index c9cc9bd0d7d..880ceee26a5 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -675,6 +675,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, struct smb2_lease lease; struct smb2_lease *lease_ptr = NULL; ssize_t lease_len = -1; + struct smb2_create_blob *svhdx = NULL; exta = smb2_create_blob_find(&in_context_blobs, SMB2_CREATE_TAG_EXTA); @@ -688,6 +689,13 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, SMB2_CREATE_TAG_TWRP); qfid = smb2_create_blob_find(&in_context_blobs, SMB2_CREATE_TAG_QFID); + if (smb2req->xconn->protocol >= PROTOCOL_SMB3_02) { + /* + * This was introduced with SMB3_02 + */ + svhdx = smb2_create_blob_find(&in_context_blobs, + SVHDX_OPEN_DEVICE_CONTEXT); + } fname = talloc_strdup(state, in_name); if (tevent_req_nomem(fname, req)) { @@ -902,6 +910,13 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, } } + if (svhdx != NULL) { + /* SharedVHD is not yet supported */ + tevent_req_nterror( + req, NT_STATUS_INVALID_DEVICE_REQUEST); + return tevent_req_post(req, ev); + } + /* these are ignored for SMB2 */ in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */ in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */ -- 2.11.4.GIT