summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-07 10:33:02 -0700
committerJeremy Allison <jra@samba.org>2010-04-07 10:33:02 -0700
commit40172f374ba6d5a6edde2834f7f0a28a5fe49928 (patch)
tree14d1510003978091a9dcb28f1e86e313e4a8e1e5
parent556b42a351e3584550f79d1c7ad83b44f3a5562b (diff)
downloadsamba-40172f374ba6d5a6edde2834f7f0a28a5fe49928.tar.gz
samba-40172f374ba6d5a6edde2834f7f0a28a5fe49928.tar.bz2
samba-40172f374ba6d5a6edde2834f7f0a28a5fe49928.zip
Test using (-1) for tid and sessionid in compound related requests.
Jeremy.
-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;