smbtorture TRANS2SCAN trips over an NT_STATUS_FILE_IS_A_DIRECTORY error ...

Stefan (metze) Metzmacher metze at samba.org
Sun Dec 11 23:10:00 MST 2011


Hi Richard,

>> I was running all the smbtorture tests against a version of 2.5.12
>> with the ACL fixes from 3.6.1 back ported to it, and get this curious
>> error:
>>
>> [2011/12/11 11:25:10.323393, 10] smbd/open.c:3189(create_file_unixpath)
>>  create_file_unixpath: NT_STATUS_FILE_IS_A_DIRECTORY
>>
>> Which seems to occur because:
>>
>>                if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_IS_A_DIRECTORY)) {
>>
>>                        /* A stream open never opens a directory */
>>
>>                        if (base_fsp) {
>>                                status = NT_STATUS_FILE_IS_A_DIRECTORY;
>>                                goto fail;
>>                        }
>>
>> and the scanner test does:
>>
>>        if (!NT_STATUS_IS_OK(cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
>>                         DENY_NONE, &fnum))) {
>>                printf("open of %s failed\n", fname);
>>                return false;
>>        }
>>        if (!NT_STATUS_IS_OK(cli_open(cli, "\\", O_RDONLY, DENY_NONE, &dnum))) {
>>                printf("open of \\ failed\n");
>>                return false;
>>        }
>>
>> Has this test been broken for a while? Did it work at one stage but no more?

all scanner tests are not very useful tests for general testing,
they were written at the time when we didn't had documentation.
They try to workout existing opcodes on windows.

>> A quick check shows that on the wire it was an ordinary open&X ...
> 
> OK, after some more checking, it seems that NTTRANSSCAN also fails but
> for slightly different reasons, and both relied on functionality in
> Samba that Windows did not support it seems.
> 
> The real issue is that the CIFS protocol (MS-CIFS) seems to explicitly
> say that SMB_COM_OPEN_AND_X is only for ordinary files. It would seem
> that you have to use NT_TRANSACT_CREATE to open directories ...

In master cli_open() should try SMB_COM_NTCREATE_AND_X with a fallback
to SMB_COM_OPEN_AND_X.
You may want to do s/cli_openx/cli_open/ there.

I think commit 8cf78ff55312768d0b454b1d7e0560e04e6296da changed the
behavior,
as dnum was just -1 before, but now we check the NTSTATUS and fail.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20111212/f941a62f/attachment.pgp>


More information about the samba-technical mailing list