Skip to content

Commit

Permalink
Move the error handling for svhdx to vfswrap_create to give VFS modul…
Browse files Browse the repository at this point in the history
…e writers a chance to handle RSVD opens if they want to.

Also handle a review comment by Metze.

Signed-off-by: Richard Sharpe <[email protected]>
Reviewed-by: Ira Cooper <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>

Autobuild-User(master): Jeremy Allison <[email protected]>
Autobuild-Date(master): Fri Aug 28 03:19:36 CEST 2015 on sn-devel-104
  • Loading branch information
RichardSharpe authored and jrasamba committed Aug 28, 2015
1 parent d9166eb commit e6c234d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
16 changes: 16 additions & 0 deletions source3/modules/vfs_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions source3/smbd/smb2_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit e6c234d

Please sign in to comment.