diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-07-16 14:00:18 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-07-16 14:00:18 +1000 |
commit | e92125e6319d49185a3d0456a8a0e5c1b8d364e7 (patch) | |
tree | 04e5ff58c418118219b05d25e1935c07c3304a15 /source4/torture/raw | |
parent | 376b2a29d6a5d56be8539beec80540772cda875e (diff) | |
download | samba-e92125e6319d49185a3d0456a8a0e5c1b8d364e7.tar.gz samba-e92125e6319d49185a3d0456a8a0e5c1b8d364e7.tar.bz2 samba-e92125e6319d49185a3d0456a8a0e5c1b8d364e7.zip |
Ignore and handle more NT Create & X options.
The MS-SMB document explains that some of these options should be
ignored. The test proves it.
/* Must be ignored by the server, per MS-SMB 2.2.8 */
/* Must be ignored by the server, per MS-SMB 2.2.8 */
If we implement HSM in samba4 (likely) we should honour this bit.
/* Don't pull this file off tape in a HSM system */
Andrew Bartlett
(This used to be commit 502739ff90d56d2c9aabe8e224317f6ceb175c17)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/open.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index c6ba0d2571..3e310ebe0b 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -954,6 +954,62 @@ static bool test_nttrans_create(struct smbcli_state *cli, struct torture_context CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory); CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); smbcli_close(cli->tree, fnum); + + /* check no-recall - don't pull a file from tape on a HSM */ + io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_NO_RECALL; + 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); + + /* 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); + smbcli_unlink(cli->tree, fname); |