summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-17 06:44:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:55 -0500
commit856f663adc2459044f7a20c2974bcb41ed561f77 (patch)
tree3aefe3b37e74025d61d5930360a77c2401c6a91c /source4/torture/raw
parent5a34ef4df6152f5e970afbfb463d4665a823deb7 (diff)
downloadsamba-856f663adc2459044f7a20c2974bcb41ed561f77.tar.gz
samba-856f663adc2459044f7a20c2974bcb41ed561f77.tar.bz2
samba-856f663adc2459044f7a20c2974bcb41ed561f77.zip
r3800: - fixed delete-on-close behaviour for streams
- added a delete-on-close test to RAW-STREAMS - don't allow rename of streams at the moment (I need to work out if its supposed to be allowed first) (This used to be commit f4b2b1311da6e37ac0947a3419d89c77ebbd6b63)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/streams.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 7bc80b8502..933a102989 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -183,6 +183,21 @@ static BOOL test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smbcli_unlink(cli->tree, sname1);
CHECK_STATUS(status, NT_STATUS_OK);
+ printf("delete a stream via delete-on-close\n");
+ io.ntcreatex.in.fname = sname2;
+ io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DELETE_ON_CLOSE;
+ io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE;
+ io.ntcreatex.in.access_mask = GENERIC_RIGHTS_FILE_ALL_ACCESS;
+ io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+ status = smb_raw_open(cli->tree, mem_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ fnum = io.ntcreatex.out.fnum;
+
+ smbcli_close(cli->tree, fnum);
+ status = smbcli_unlink(cli->tree, sname2);
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+
+
printf("deleting file\n");
status = smbcli_unlink(cli->tree, fname);
CHECK_STATUS(status, NT_STATUS_OK);