summaryrefslogtreecommitdiff
path: root/source4/torture/raw/open.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-07-18 18:40:19 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-07-18 18:40:19 +1000
commit853194c308a0f2171808b78b17aed50c5fab1b3b (patch)
tree2062b2c6481665dfd3e064733103cbf58418087d /source4/torture/raw/open.c
parent8025edf335dbb66c7efa1d51a0e600a9e3c13bba (diff)
downloadsamba-853194c308a0f2171808b78b17aed50c5fab1b3b.tar.gz
samba-853194c308a0f2171808b78b17aed50c5fab1b3b.tar.bz2
samba-853194c308a0f2171808b78b17aed50c5fab1b3b.zip
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 <olivier.salamin@gmail.com> for pointing out more flags that needed to be handled. Andrew Bartlett (This used to be commit 370bb39cd79fe49efd36a1ceb3e896d386e6d3ce)
Diffstat (limited to 'source4/torture/raw/open.c')
-rw-r--r--source4/torture/raw/open.c56
1 files changed, 22 insertions, 34 deletions
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);