smbtorture failures in smb2.create.gentest

Jeremy Allison jra at samba.org
Fri Mar 31 22:06:48 UTC 2017


On Fri, Mar 31, 2017 at 01:26:05AM -0500, Steve French via samba-technical wrote:
> I noticed that smbtorture smb2.create.gentest fails for multiple reasons to
> Samba (but gets much farther to Windows).   Samba looks like it is is
> missing at least three checks during open:
> 
> Thoughts on adding something similar to the following (so that
> smb2.create.gentest would pass and our behavior would better match windows
> in validating opens):
> 
> sfrench at ubuntu:~/samba/source3$ git diff -a
> diff --git a/source3/smbd/open.c b/source3/smbd/open.c
> index 3368bae..4a5ff87 100644
> --- a/source3/smbd/open.c
> +++ b/source3/smbd/open.c
> @@ -4997,6 +4997,17 @@ static NTSTATUS
> create_file_unixpath(connection_struct *c
>                 goto fail;
>         }
> 
> +       if ((file_attributes & FILE_ATTRIBUTE_DEVICE) ||
> +           (file_attributes & FILE_ATTRIBUTE_VOLUME)) {
> +               status = NT_STATUS_INVALID_PARAMETER;
> +               goto fail;
> +       }
> +
> +       if (access_mask & 0x0C000000) {
> +               status = NT_STATUS_ACCESS_DENIED;
> +               goto fail;
> +       }
> +
>         if (req == NULL) {
>                 oplock_request |= INTERNAL_OPEN_ONLY;
>         }

Hmmmm. Maybe. Before adding this we'd need torture
tests that pass against Windows that show the same
error returns..



More information about the samba-technical mailing list