Move the error handling for svhdx to vfswrap_create to give VFS module writers a...
authorRichard Sharpe <rsharpe@samba.org>
Wed, 29 Jul 2015 02:08:02 +0000 (19:08 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 28 Aug 2015 01:19:35 +0000 (03:19 +0200)
Also handle a review comment by Metze.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 03:19:36 CEST 2015 on sn-devel-104

source3/modules/vfs_default.c
source3/smbd/smb2_create.c

index 460837cc999bd6cf87ff559ea97c4d3c06f1f3f1..9ea630a25ae08883fc7d923272334422ae758295 100644 (file)
@@ -563,6 +563,22 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
                                    const struct smb2_create_blobs *in_context_blobs,
                                    struct smb2_create_blobs *out_context_blobs)
 {
+       struct smb2_create_blob *svhdx = NULL;
+
+       /*
+        * It might be empty ... and smb2_create_blob_find does not handle that
+        */
+       if (in_context_blobs) {
+               svhdx = smb2_create_blob_find(in_context_blobs,
+                                             SVHDX_OPEN_DEVICE_CONTEXT);
+       }
+
+       if (svhdx != NULL) {
+               /* SharedVHD is not yet supported */
+               DEBUG(10, ("Shared VHD not yet supported, INVALID_DEVICE_REQUEST\n"));
+               return NT_STATUS_INVALID_DEVICE_REQUEST;
+       }
+
        return create_file_default(handle->conn, req, root_dir_fid, smb_fname,
                                   access_mask, share_access,
                                   create_disposition, create_options,
index 880ceee26a52d5e7de41e02f9332705b45c9e7e0..9f14544c62d7d7df2261d3f910c62a3aa838da01 100644 (file)
@@ -910,13 +910,6 @@ 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 */