diff options
author | Ralph Boehme <slow@samba.org> | 2018-10-09 18:48:08 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-11-06 09:10:23 +0100 |
commit | b58b0002802b86d8ee5e10893e8afc59c952d7b0 (patch) | |
tree | 188f697f1662f4c27177bee95aa116c833491472 /source4 | |
parent | 758ab1e30d409298f59e3f32596e48803f429de8 (diff) | |
download | samba-b58b0002802b86d8ee5e10893e8afc59c952d7b0.tar.gz |
s4:torture/vfs/fruit: expand existing test "setinfo delete-on-close AFP_AfpInfo" a little bit
Add a check that verifies a create on a stream gets
NT_STATUS_DELETE_PENDING after delete-on-close has been set.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0d9a80b6b2e3f51cad122ee0dc78c2f4dfdebcb5)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/vfs/fruit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index 83b19d4694c..ac7b6682e6d 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -3450,6 +3450,10 @@ static bool test_setinfo_delete_on_close(struct torture_context *tctx, const char *sname = BASEDIR "\\file" AFPINFO_STREAM_NAME; const char *type_creator = "SMB,OLE!"; AfpInfo *info = NULL; + const char *streams[] = { + AFPINFO_STREAM, + "::$DATA" + }; const char *streams_basic[] = { "::$DATA" }; @@ -3491,6 +3495,19 @@ static bool test_setinfo_delete_on_close(struct torture_context *tctx, status = smb2_setinfo_file(tree, &sfinfo); torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "set delete-on-close failed"); + ret = check_stream_list(tree, tctx, fname, 2, streams, false); + torture_assert_goto(tctx, ret == true, ret, done, "Bad streams"); + + ZERO_STRUCT(create); + create.in.create_disposition = NTCREATEX_DISP_OPEN; + create.in.desired_access = SEC_FILE_ALL; + create.in.fname = sname; + create.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION; + status = smb2_create(tree, mem_ctx, &create); + torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_DELETE_PENDING, + ret, done, "Got unexpected AFP_AfpInfo stream"); + smb2_util_close(tree, h1); ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false); |