Patch: Fixed patch for moving RSVD/SHVXD to vfs_default

Michael Adam obnox at samba.org
Tue Aug 4 18:25:31 UTC 2015


Wait a minute ... the vfs should not be fiddling
with smb2 create contexts! IMHO, this belongs into
smb2_create.c and nowhere else.

If the smb(2) creat code has to tell the vfs layer something
it should do so, by dedicated interfaces. If the current API
does not provide such an interface, we should extend the API.

So I'd rather not have this patch pushed but rethink the
layering.

Cheers - Michael


On 2015-08-01 at 08:35 -0700, Richard Sharpe wrote:
> Hi folks,
> 
> Attached is the modified patch
> 
> -- 
> Regards,
> Richard Sharpe
> (何以解憂?唯有杜康。--曹操)

> From 7aa03af3e8679bf42f5ec7f1f0274a18d524d8e2 Mon Sep 17 00:00:00 2001
> From: Richard Sharpe <rsharpe at samba.org>
> Date: Tue, 28 Jul 2015 19:08:02 -0700
> Subject: [PATCH] Move the error handling for svhdx to vfswrap_create to give
>  VFS module writers a chance to handle RSVD opens if they want to.
> 
> Signed-off-by: Richard Sharpe <rsharpe at samba.org>
> ---
>  source3/modules/vfs_default.c | 11 +++++++++++
>  source3/smbd/smb2_create.c    |  7 -------
>  2 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
> index 10d0f3b..05c52ff 100644
> --- a/source3/modules/vfs_default.c
> +++ b/source3/modules/vfs_default.c
> @@ -562,6 +562,17 @@ 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;
> +
> +	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,
> diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
> index 880ceee..9f14544 100644
> --- a/source3/smbd/smb2_create.c
> +++ b/source3/smbd/smb2_create.c
> @@ -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 */
> -- 
> 2.4.2
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150804/388c09ea/attachment.sig>


More information about the samba-technical mailing list