mirror of
https://github.com/samba-team/samba.git
synced 2025-02-15 05:57:49 +03:00
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)
This commit is contained in:
parent
758ab1e30d
commit
b58b000280
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user