s3:smb2_create: treat the SVHDX_OPEN_DEVICE_CONTEXT in smb2_create (not supported)
authorMichael Adam <obnox@samba.org>
Tue, 5 May 2015 22:38:55 +0000 (00:38 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 8 May 2015 11:00:28 +0000 (13:00 +0200)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_create.c

index c9cc9bd0d7daf16ce8f758c4e30c64aa25b60870..880ceee26a52d5e7de41e02f9332705b45c9e7e0 100644 (file)
@@ -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 */