Patch: Move the handling of svhdx to vfs_default.c

Jeremy Allison jra at samba.org
Fri Oct 2 02:02:52 UTC 2015


On Thu, Oct 01, 2015 at 08:06:44PM -0500, Steve French wrote:
> Why do we return an error when we don't recognize a create context
> (rather than just ignore it as Microsoft servers do)?
> 
> MS-SMB2 says the following (and obviously Windows ignores AAPL rather
> than returning an error, so unknown contexts can or should be ignored)
> 
> "<247> Section 3.3.5.9: Windows Vista SP1, Windows Server 2008,
> Windows 7, Windows Server 2008 R2, Windows 8, and Windows Server 2012
> ignore create contexts having a NameLength greater than 4 and ignore
> create contexts with a length of 4 that are not specified "
> 
> HyperV in creating a VM (at least from Windows 10 MMC) fails on the
> open/create of the image over SMB3 due to us returning
> INVALID_DEVICE_REQUEST due to the unrecognized create context (for
> SVHDXOpenDeviceContext).  This is not actually running the VM, just
> creating an image file on a share.
> 
> Setting max protocols to 3.0 does avoid this problem (although it
> breaks due to a more serious Samba bug in parsing negprot - so you
> can't negotiate protocol with recent Windows to Samba when max
> protocols is set.  Samba needs the patch below
> 
> diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
> index 2ea997e..1a97b2e 100644
> --- a/source3/smbd/smb2_server.c
> +++ b/source3/smbd/smb2_server.c
> @@ -2096,9 +2096,7 @@ NTSTATUS smbd_smb2_request_dispatch(struct
> smbd_smb2_request *req)
>                 allowed_flags |= SMB2_HDR_FLAG_PRIORITY_MASK;
>         }
>         if (opcode == SMB2_OP_NEGPROT) {
> -               if (lp_server_max_protocol() >= PROTOCOL_SMB3_11) {
> -                       allowed_flags |= SMB2_HDR_FLAG_PRIORITY_MASK;
> -               }
> +               allowed_flags |= SMB2_HDR_FLAG_PRIORITY_MASK;
>         }
>         if (opcode == SMB2_OP_CANCEL) {
>                 allowed_flags |= SMB2_HDR_FLAG_ASYNC;

Steve, re-send as a git-format patch with your 'Signed-off-by:' please,
so we can review.

Cheers,

	Jeremy.



More information about the samba-technical mailing list