summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-17 05:58:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:54 -0500
commitae7caf08c1f47f3ad08856cfea2a3e6e956b48ab (patch)
treea70a8867b4d85c5d34a1f30e6aff22cf37052d6f /source4/torture/raw
parentca90965a3a2dabfc50be6d155c20004a61f81318 (diff)
downloadsamba-ae7caf08c1f47f3ad08856cfea2a3e6e956b48ab.tar.gz
samba-ae7caf08c1f47f3ad08856cfea2a3e6e956b48ab.tar.bz2
samba-ae7caf08c1f47f3ad08856cfea2a3e6e956b48ab.zip
r3798: added support for alternate data streams in xattrs into pvfs.
The trickiest part about this was getting the sharing and locking rules right, as alternate streams are separate locking spaces from the main file for the purposes of byte range locking, and separate for most share violation rules. I suspect there are still problems with delete on close with alternate data streams. I'll look at that next. (This used to be commit b6452c4a2068cf7e837778559da002ae191b508a)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/streams.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 239955fd93..7bc80b8502 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -108,12 +108,10 @@ static BOOL test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
io.generic.level = RAW_OPEN_NTCREATEX;
io.ntcreatex.in.root_fid = 0;
io.ntcreatex.in.flags = 0;
- io.ntcreatex.in.access_mask = SEC_RIGHT_MAXIMUM_ALLOWED;
+ io.ntcreatex.in.access_mask = SA_RIGHT_FILE_WRITE_DATA;
io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
- io.ntcreatex.in.share_access =
- NTCREATEX_SHARE_ACCESS_READ |
- NTCREATEX_SHARE_ACCESS_WRITE;
+ io.ntcreatex.in.share_access = 0;
io.ntcreatex.in.alloc_size = 0;
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
@@ -131,6 +129,13 @@ static BOOL test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
ret &= check_stream(cli, mem_ctx, fname, "Stream One", NULL);
+ printf("check that open of base file is allowed\n");
+ io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+ io.ntcreatex.in.fname = fname;
+ status = smb_raw_open(cli->tree, mem_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ smbcli_close(cli->tree, io.ntcreatex.out.fnum);
+
printf("writing to stream\n");
retsize = smbcli_write(cli->tree, fnum, 0, "test data", 0, 9);
CHECK_VALUE(retsize, 9);
@@ -140,6 +145,7 @@ static BOOL test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
ret &= check_stream(cli, mem_ctx, fname, "Stream One", "test data");
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+ io.ntcreatex.in.fname = sname1;
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatex.out.fnum;