smbtorture failures in smb2.create.gentest

Steve French smfrench at gmail.com
Sun Apr 2 23:35:36 UTC 2017


We are getting much closer with the three minor smbd fixes at the bottom of
this note, but this smb2.create.gentest still shows some interesting
problems.

How are we going to persist the 'temporary' DOS attribute to get past the
create of temporary file attribute bug?

sfrench at ubuntu:~/samba$ smbtorture //localhost/test -T win7 -U admin%admin
smb2.create.gentest

failure: gentest [
(../source4/torture/smb2/create.c:279) Incorrect value for io.out.file_attr
0x00000020 - should be 0x00000120



To Windows of course this check works, but note that there are couple minor
testcase bugs in gentest test (wrong mask checking in two places) - see
below:

sfrench at ubuntu:~/samba$ smbtorture //192.168.93.130/public  -U
admin%Tonian2013 smb2.create.gentest

failure: gentest [
(../source4/torture/smb2/create.c:252) Incorrect value for access_mask
0x0de0fe00 - should be 0x0df0fe00

I can skip that error (see below) by passing a target of 'win7' in of
course - but Windows 8.1 and Windows 2012R2 would otherwise fail on line
252 (see above), but there is also one more access mask bug in gentest
sfrench at ubuntu:~/samba$ smbtorture //192.168.93.130/public -T win7 -U
admin%Tonian2013 smb2.create.gentest

failure: gentest [
(../source4/torture/smb2/create.c:293) Incorrect value for ok_mask
0x0002bfb7 - should be 0x00003fb7



FYI I had a typo in my earlier patch - the correct one is:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 3368bae..30ce897 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -4992,11 +4992,28 @@ static NTSTATUS
create_file_unixpath(connection_struct *conn,
                goto fail;
        }

+       if (create_options & NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK) {
+               /* See note 35 of MS-SMB2 Section 2.2.13 */
+               status = NT_STATUS_NOT_SUPPORTED;
+               goto fail;
+       }
+
        if (create_options & NTCREATEX_OPTIONS_INVALID_PARAM_MASK) {
                status = NT_STATUS_INVALID_PARAMETER;
                goto fail;
        }

+       if (access_mask & 0x0C000000) {
+               status = NT_STATUS_ACCESS_DENIED;
+               goto fail;
+       }
+
+       if ((file_attributes & FILE_ATTRIBUTE_DEVICE) ||
+           (file_attributes & FILE_ATTRIBUTE_VOLUME)) {
+               status = NT_STATUS_INVALID_PARAMETER;
+               goto fail;
+       }
+
        if (req == NULL) {
                oplock_request |= INTERNAL_OPEN_ONLY;
        }


On Fri, Mar 31, 2017 at 5:43 PM, Steve French <smfrench at gmail.com> wrote:

> Well ... the torture test fails to Samba and works to Windows (almost - it
> fails near the end for an unrelated reason).
>
>
> On Fri, Mar 31, 2017 at 5:06 PM, Jeremy Allison <jra at samba.org> wrote:
>
>> 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:
>> request |= INTERNAL_OPEN_ONLY;
>>
>> Hmmmm. Maybe. Before adding this we'd need torture
>> tests that pass against Windows that show the same
>> error returns..
>>
>
>
>
> --
> Thanks,
>
> Steve
>



-- 
Thanks,

Steve


More information about the samba-technical mailing list