The branch, master has been updated via 8e947f0 s4:torture:smb2:durable-open: prevent using a disconnected handle in reopen4 via 6deec81 s4:torture:smb2:durable-open: introduce new variable for the new session via d5cefee s4:torture:smb2:durable-open: make a comment more precise in the reopen4 test via b041d28 s4:torture:smb2:durable_open: use the correct tree in the final close call from 687e065 provision: Write configuration without help of templates.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8e947f0f5d56969527a40d8148fb773e8c69ea84 Author: Michael Adam <ob...@samba.org> Date: Thu Feb 23 15:49:51 2012 +0100 s4:torture:smb2:durable-open: prevent using a disconnected handle in reopen4 Autobuild-User: Michael Adam <ob...@samba.org> Autobuild-Date: Mon Feb 27 03:44:16 CET 2012 on sn-devel-104 commit 6deec81b8e89e7a525925952159cbb45e5d28647 Author: Michael Adam <ob...@samba.org> Date: Thu Feb 23 23:43:18 2012 +0100 s4:torture:smb2:durable-open: introduce new variable for the new session This is to clarify the code. commit d5cefee6fcb2b06fd25348a057a4eae93a7edf85 Author: Michael Adam <ob...@samba.org> Date: Thu Feb 23 23:25:18 2012 +0100 s4:torture:smb2:durable-open: make a comment more precise in the reopen4 test commit b041d28fea70dce8e94fbe772b39bf3ee678eb4f Author: Michael Adam <ob...@samba.org> Date: Thu Feb 23 15:35:15 2012 +0100 s4:torture:smb2:durable_open: use the correct tree in the final close call ----------------------------------------------------------------------- Summary of changes: source4/torture/smb2/durable_open.c | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index 6ef5a32..3d4744d 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -529,6 +529,7 @@ bool test_durable_open_reopen4(struct torture_context *tctx, struct smb2_create io1, io2; bool ret = true; struct smb2_transport *transport; + struct smb2_session *session2; struct smb2_tree *tree2; /* Choose a random name in case the state is left a little funky. */ @@ -551,17 +552,26 @@ bool test_durable_open_reopen4(struct torture_context *tctx, CHECK_VAL(io1.out.durable_open, true); CHECK_VAL(io1.out.oplock_level, smb2_util_oplock_level("b")); - /* disconnect, reconnect and then do durable reopen */ + /* + * do a session logoff, establish a new session and tree + * connect on the same transport, and try a durable reopen + */ transport = tree->session->transport; status = smb2_logoff(tree->session); CHECK_STATUS(status, NT_STATUS_OK); - if (!torture_smb2_session_setup(tctx, transport, mem_ctx, &tree->session)) { + if (!torture_smb2_session_setup(tctx, transport, mem_ctx, &session2)) { torture_warning(tctx, "session setup failed.\n"); ret = false; goto done; } + /* + * the session setup has talloc-stolen the transport, + * so we can safely free the old tree+session for clarity + */ + TALLOC_FREE(tree); + ZERO_STRUCT(io2); io2.in.fname = fname; io2.in.durable_handle = h; @@ -569,7 +579,7 @@ bool test_durable_open_reopen4(struct torture_context *tctx, status = smb2_create(tree, mem_ctx, &io2); CHECK_STATUS(status, NT_STATUS_NETWORK_NAME_DELETED); - if (!torture_smb2_tree_connect(tctx, tree->session, mem_ctx, &tree2)) { + if (!torture_smb2_tree_connect(tctx, session2, mem_ctx, &tree2)) { torture_warning(tctx, "tree connect failed.\n"); ret = false; goto done; @@ -578,6 +588,7 @@ bool test_durable_open_reopen4(struct torture_context *tctx, ZERO_STRUCT(io2); io2.in.fname = fname; io2.in.durable_handle = h; + h = NULL; status = smb2_create(tree2, mem_ctx, &io2); CHECK_STATUS(status, NT_STATUS_OK); @@ -590,7 +601,7 @@ bool test_durable_open_reopen4(struct torture_context *tctx, done: if (h != NULL) { - smb2_util_close(tree, *h); + smb2_util_close(tree2, *h); } smb2_util_unlink(tree2, fname); -- Samba Shared Repository