From 853194c308a0f2171808b78b17aed50c5fab1b3b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 18 Jul 2008 18:40:19 +1000 Subject: More 'must be ignored' options from the MS-SMB doc. Also in particular the 'sync' flags (which Samba has traditionally ignored). Thanks to Olivier Salamin for pointing out more flags that needed to be handled. Andrew Bartlett (This used to be commit 370bb39cd79fe49efd36a1ceb3e896d386e6d3ce) --- source4/torture/raw/open.c | 56 ++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) (limited to 'source4/torture/raw/open.c') diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index 3e310ebe0b..1901338e21 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -975,40 +975,28 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context smbcli_close(cli->tree, fnum); /* Check some create options (these all should be ignored) */ - io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_OPFILTER; - status = smb_raw_open(cli->tree, tctx, &io); - CHECK_STATUS(status, NT_STATUS_OK); - - CHECK_VAL(io.ntcreatex.out.oplock_level, 0); - CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_EXISTED); - CHECK_NTTIME(io.ntcreatex.out.create_time, create_time); - CHECK_NTTIME(io.ntcreatex.out.access_time, access_time); - CHECK_NTTIME(io.ntcreatex.out.write_time, write_time); - CHECK_NTTIME(io.ntcreatex.out.change_time, change_time); - CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib); - CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size); - CHECK_ALL_INFO(io.ntcreatex.out.size, size); - CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory); - CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); - smbcli_close(cli->tree, fnum); - - io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_FREE_SPACE_QUERY; - status = smb_raw_open(cli->tree, tctx, &io); - CHECK_STATUS(status, NT_STATUS_OK); - fnum = io.ntcreatex.out.file.fnum; - - CHECK_VAL(io.ntcreatex.out.oplock_level, 0); - CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_EXISTED); - CHECK_NTTIME(io.ntcreatex.out.create_time, create_time); - CHECK_NTTIME(io.ntcreatex.out.access_time, access_time); - CHECK_NTTIME(io.ntcreatex.out.write_time, write_time); - CHECK_NTTIME(io.ntcreatex.out.change_time, change_time); - CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib); - CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size); - CHECK_ALL_INFO(io.ntcreatex.out.size, size); - CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory); - CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); - smbcli_close(cli->tree, fnum); + for (i=0; i < 32; i++) { + uint32_t create_option = (1 << i) & NTCREATEX_OPTIONS_MUST_IGNORE_MASK; + if (create_option == 0) { + continue; + } + io.ntcreatex.in.create_options = create_option; + status = smb_raw_open(cli->tree, tctx, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + CHECK_VAL(io.ntcreatex.out.oplock_level, 0); + CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_EXISTED); + CHECK_NTTIME(io.ntcreatex.out.create_time, create_time); + CHECK_NTTIME(io.ntcreatex.out.access_time, access_time); + CHECK_NTTIME(io.ntcreatex.out.write_time, write_time); + CHECK_NTTIME(io.ntcreatex.out.change_time, change_time); + CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib); + CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size); + CHECK_ALL_INFO(io.ntcreatex.out.size, size); + CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory); + CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); + smbcli_close(cli->tree, fnum); + } smbcli_unlink(cli->tree, fname); -- cgit