smbtorture TRANS2SCAN trips over an NT_STATUS_FILE_IS_A_DIRECTORY error ...

Richard Sharpe realrichardsharpe at gmail.com
Sun Dec 11 16:08:56 MST 2011


On Sun, Dec 11, 2011 at 12:06 PM, Richard Sharpe
<realrichardsharpe at gmail.com> wrote:
> Hi,
>
> 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?
>
> 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 ...


-- 
Regards,
Richard Sharpe


More information about the samba-technical mailing list