scan tests in make test (was Re: Retiring or fixing smbtorture?)
realrichardsharpe at gmail.com
Fri Oct 26 11:28:29 MDT 2012
On Wed, Oct 24, 2012 at 3:17 PM, Jeremy Allison <jra at samba.org> wrote:
> On Wed, Oct 24, 2012 at 10:17:20AM -0700, Richard Sharpe wrote:
>> > a change to the underlying cli_open code, it looks like. Probably a
>> > separate cli_opendir function should be created, but I am not sure
>> > that is useful.
>> > It might simply be better to delete those two tests.
>> Even the equivalent test in the Samba4 version of smbtorture seems broken.
>> Here is the open request in torture/basic/scanner.c:torture_nttrans_scan:
>> dnum = smbcli_open(cli->tree, "\\", O_RDONLY, DENY_NONE);
>> And here is the block of code in smbcli_open that initializes the SMB:
>> open_parms.openx.level = RAW_OPEN_OPENX;
>> open_parms.openx.in.flags = 0;
>> open_parms.openx.in.open_mode = accessmode;
>> open_parms.openx.in.search_attrs = FILE_ATTRIBUTE_SYSTEM |
>> open_parms.openx.in.file_attrs = 0;
>> open_parms.openx.in.write_time = 0;
>> open_parms.openx.in.open_func = openfn;
>> open_parms.openx.in.size = 0;
>> open_parms.openx.in.timeout = 0;
>> open_parms.openx.in.fname = fname;
>> As you can see, we insist that it is a file, not a directory.
> Quick and dirty fix - set FILE_ATTRIBUTE_DIRECTORY if
> the name ends in '\\' ? :-).
Well, it turns out that that is not enough. After making such a Q&D
change and observing that it fails against Windows, I was forced to
read the CIFS spec :-)
You cannot open a directory with SMB_COM_OPEN_ANDX. You have to use
So, a bit more work is required.
More information about the samba-technical