summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smb2/compound.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/torture/smb2/compound.c b/source4/torture/smb2/compound.c
index 858ffde20c..bb506a0139 100644
--- a/source4/torture/smb2/compound.c
+++ b/source4/torture/smb2/compound.c
@@ -46,6 +46,8 @@ static bool test_compound_related1(struct torture_context *tctx,
struct smb2_close cl;
bool ret = true;
struct smb2_request *req[2];
+ uint32_t saved_tid = tree->tid;
+ uint64_t saved_uid = tree->session->uid;
smb2_transport_credits_ask_num(tree->session->transport, 2);
@@ -82,6 +84,10 @@ static bool test_compound_related1(struct torture_context *tctx,
ZERO_STRUCT(cl);
cl.in.file.handle = hd;
+
+ tree->tid = 0xFFFFFFFF;
+ tree->session->uid = UINT64_MAX;
+
req[1] = smb2_close_send(tree, &cl);
status = smb2_create_recv(req[0], tree, &cr);
@@ -89,6 +95,9 @@ static bool test_compound_related1(struct torture_context *tctx,
status = smb2_close_recv(req[1], &cl);
CHECK_STATUS(status, NT_STATUS_OK);
+ tree->tid = saved_tid;
+ tree->session->uid = saved_uid;
+
smb2_util_unlink(tree, fname);
done:
return ret;
@@ -104,6 +113,8 @@ static bool test_compound_related2(struct torture_context *tctx,
struct smb2_close cl;
bool ret = true;
struct smb2_request *req[5];
+ uint32_t saved_tid = tree->tid;
+ uint64_t saved_uid = tree->session->uid;
smb2_transport_credits_ask_num(tree->session->transport, 5);
@@ -140,6 +151,9 @@ static bool test_compound_related2(struct torture_context *tctx,
ZERO_STRUCT(cl);
cl.in.file.handle = hd;
+ tree->tid = 0xFFFFFFFF;
+ tree->session->uid = UINT64_MAX;
+
req[1] = smb2_close_send(tree, &cl);
req[2] = smb2_close_send(tree, &cl);
req[3] = smb2_close_send(tree, &cl);
@@ -156,6 +170,9 @@ static bool test_compound_related2(struct torture_context *tctx,
status = smb2_close_recv(req[4], &cl);
CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+ tree->tid = saved_tid;
+ tree->session->uid = saved_uid;
+
smb2_util_unlink(tree, fname);
done:
return ret;
@@ -296,6 +313,8 @@ static bool test_compound_invalid2(struct torture_context *tctx,
struct smb2_close cl;
bool ret = true;
struct smb2_request *req[5];
+ uint32_t saved_tid = tree->tid;
+ uint64_t saved_uid = tree->session->uid;
smb2_transport_credits_ask_num(tree->session->transport, 5);
@@ -332,6 +351,9 @@ static bool test_compound_invalid2(struct torture_context *tctx,
ZERO_STRUCT(cl);
cl.in.file.handle = hd;
+ tree->tid = 0xFFFFFFFF;
+ tree->session->uid = UINT64_MAX;
+
req[1] = smb2_close_send(tree, &cl);
/* strange that this is not generating invalid parameter */
smb2_transport_compound_set_related(tree->session->transport, false);
@@ -351,6 +373,9 @@ static bool test_compound_invalid2(struct torture_context *tctx,
status = smb2_close_recv(req[4], &cl);
CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
+ tree->tid = saved_tid;
+ tree->session->uid = saved_uid;
+
smb2_util_unlink(tree, fname);
done:
return ret;