summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-15 10:08:04 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-16 15:35:27 +0100
commit119f15132184bd3fdaa664182135db2dfe1cdc37 (patch)
tree96135f055a5b73950ae372454c25c4a49fb87c2a
parent88ab666f191ce36b13e6628ca39b34b0e09a4088 (diff)
downloadsamba-119f15132184bd3fdaa664182135db2dfe1cdc37.tar.gz
samba-119f15132184bd3fdaa664182135db2dfe1cdc37.tar.bz2
samba-119f15132184bd3fdaa664182135db2dfe1cdc37.zip
s4:torture/rpc/srvsvc.c: make use of dcerpc_binding_handle stubs
metze
-rw-r--r--source4/torture/rpc/srvsvc.c65
1 files changed, 42 insertions, 23 deletions
diff --git a/source4/torture/rpc/srvsvc.c b/source4/torture/rpc/srvsvc.c
index 1e5b44c43f..0942258156 100644
--- a/source4/torture/rpc/srvsvc.c
+++ b/source4/torture/rpc/srvsvc.c
@@ -33,6 +33,7 @@ static bool test_NetCharDevGetInfo(struct dcerpc_pipe *p, struct torture_context
union srvsvc_NetCharDevInfo info;
uint32_t levels[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.in.device_name = devname;
@@ -42,7 +43,7 @@ static bool test_NetCharDevGetInfo(struct dcerpc_pipe *p, struct torture_context
r.in.level = levels[i];
torture_comment(tctx, "testing NetCharDevGetInfo level %u on device '%s'\n",
r.in.level, r.in.device_name);
- status = dcerpc_srvsvc_NetCharDevGetInfo(p, tctx, &r);
+ status = dcerpc_srvsvc_NetCharDevGetInfo_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetCharDevGetInfo failed");
torture_assert_werr_ok(tctx, r.out.result, "NetCharDevGetInfo failed");
}
@@ -57,6 +58,7 @@ static bool test_NetCharDevControl(struct dcerpc_pipe *p, struct torture_context
struct srvsvc_NetCharDevControl r;
uint32_t opcodes[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.in.device_name = devname;
@@ -66,7 +68,7 @@ static bool test_NetCharDevControl(struct dcerpc_pipe *p, struct torture_context
r.in.opcode = opcodes[i];
torture_comment(tctx, "testing NetCharDevControl opcode %u on device '%s'\n",
r.in.opcode, r.in.device_name);
- status = dcerpc_srvsvc_NetCharDevControl(p, tctx, &r);
+ status = dcerpc_srvsvc_NetCharDevControl_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetCharDevControl failed");
torture_assert_werr_ok(tctx, r.out.result, "NetCharDevControl failed");
}
@@ -85,6 +87,7 @@ static bool test_NetCharDevEnum(struct torture_context *tctx,
uint32_t totalentries = 0;
uint32_t levels[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info_ctr);
@@ -112,7 +115,7 @@ static bool test_NetCharDevEnum(struct torture_context *tctx,
}
torture_comment(tctx, "testing NetCharDevEnum level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetCharDevEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetCharDevEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetCharDevEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "NetCharDevEnum failed: %s\n", win_errstr(r.out.result));
@@ -148,6 +151,7 @@ static bool test_NetCharDevQGetInfo(struct dcerpc_pipe *p, struct torture_contex
union srvsvc_NetCharDevQInfo info;
uint32_t levels[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.in.queue_name = devicequeue;
@@ -158,7 +162,7 @@ static bool test_NetCharDevQGetInfo(struct dcerpc_pipe *p, struct torture_contex
r.in.level = levels[i];
torture_comment(tctx, "testing NetCharDevQGetInfo level %u on devicequeue '%s'\n",
r.in.level, r.in.queue_name);
- status = dcerpc_srvsvc_NetCharDevQGetInfo(p, tctx, &r);
+ status = dcerpc_srvsvc_NetCharDevQGetInfo_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetCharDevQGetInfo failed");
torture_assert_werr_ok(tctx, r.out.result, "NetCharDevQGetInfo failed");
}
@@ -176,6 +180,7 @@ static bool test_NetCharDevQSetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
uint32_t levels[] = {0, 1};
int i;
bool ret = true;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p));
r.in.queue_name = devicequeue;
@@ -203,7 +208,7 @@ static bool test_NetCharDevQSetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
break;
}
r.in.parm_error = &parm_error;
- status = dcerpc_srvsvc_NetCharDevQSetInfo(p, mem_ctx, &r);
+ status = dcerpc_srvsvc_NetCharDevQSetInfo_r(b, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
d_printf("NetCharDevQSetInfo level %u on devicequeue '%s' failed - %s\n",
r.in.level, r.in.queue_name, nt_errstr(status));
@@ -232,6 +237,7 @@ static bool test_NetCharDevQEnum(struct torture_context *tctx,
uint32_t totalentries = 0;
uint32_t levels[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info_ctr);
@@ -259,7 +265,7 @@ static bool test_NetCharDevQEnum(struct torture_context *tctx,
break;
}
torture_comment(tctx, "testing NetCharDevQEnum level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetCharDevQEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetCharDevQEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetCharDevQEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "NetCharDevQEnum failed: %s\n", win_errstr(r.out.result));
@@ -295,6 +301,7 @@ static bool test_NetConnEnum(struct torture_context *tctx,
uint32_t totalentries = 0;
uint32_t levels[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info_ctr);
@@ -321,7 +328,7 @@ static bool test_NetConnEnum(struct torture_context *tctx,
}
torture_comment(tctx, "testing NetConnEnum level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetConnEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetConnEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetConnEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "NetConnEnum failed: %s\n", win_errstr(r.out.result));
@@ -345,6 +352,7 @@ static bool test_NetFileEnum(struct torture_context *tctx,
uint32_t totalentries = 0;
uint32_t levels[] = {2, 3};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info_ctr);
@@ -371,7 +379,7 @@ static bool test_NetFileEnum(struct torture_context *tctx,
break;
}
torture_comment(tctx, "testing NetFileEnum level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetFileEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetFileEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetFileEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "NetFileEnum failed: %s\n", win_errstr(r.out.result));
@@ -398,6 +406,7 @@ static bool test_NetSessEnum(struct torture_context *tctx,
uint32_t totalentries = 0;
uint32_t levels[] = {0, 1, 2, 10, 502};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info_ctr);
@@ -437,7 +446,7 @@ static bool test_NetSessEnum(struct torture_context *tctx,
}
torture_comment(tctx, "testing NetSessEnum level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetSessEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetSessEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetSessEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "NetSessEnum failed: %s\n", win_errstr(r.out.result));
@@ -456,6 +465,7 @@ static bool test_NetShareCheck(struct dcerpc_pipe *p, struct torture_context *tc
NTSTATUS status;
struct srvsvc_NetShareCheck r;
enum srvsvc_ShareType type;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.device_name = device_name;
@@ -464,7 +474,7 @@ static bool test_NetShareCheck(struct dcerpc_pipe *p, struct torture_context *tc
torture_comment(tctx,
"testing NetShareCheck on device '%s'\n", r.in.device_name);
- status = dcerpc_srvsvc_NetShareCheck(p, tctx, &r);
+ status = dcerpc_srvsvc_NetShareCheck_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "dcerpc_srvsvc_NetShareCheck failed");
torture_assert_werr_ok(tctx, r.out.result, "NetShareCheck failed");
@@ -491,6 +501,7 @@ static bool test_NetShareGetInfo(struct torture_context *tctx,
{ 1005, WERR_OK, WERR_OK },
};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.share_name = sharename;
@@ -506,7 +517,7 @@ static bool test_NetShareGetInfo(struct torture_context *tctx,
torture_comment(tctx, "testing NetShareGetInfo level %u on share '%s'\n",
r.in.level, r.in.share_name);
- status = dcerpc_srvsvc_NetShareGetInfo(p, tctx, &r);
+ status = dcerpc_srvsvc_NetShareGetInfo_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetShareGetInfo failed");
torture_assert_werr_equal(tctx, r.out.result, expected, "NetShareGetInfo failed");
@@ -558,6 +569,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx,
{ 1501, WERR_OK },
};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
a.in.server_unc = r.in.server_unc = q.in.server_unc = d.in.server_unc =
talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
@@ -577,7 +589,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx,
a.in.level = 2;
a.in.parm_error = NULL;
- status = dcerpc_srvsvc_NetShareAdd(p, tctx, &a);
+ status = dcerpc_srvsvc_NetShareAdd_r(b, tctx, &a);
torture_assert_ntstatus_ok(tctx, status, "NetShareAdd level 2 on share 'testshare' failed");
torture_assert_werr_ok(tctx, a.out.result, "NetShareAdd level 2 on share 'testshare' failed");
@@ -660,14 +672,14 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx,
r.in.info = &info;
- status = dcerpc_srvsvc_NetShareSetInfo(p, tctx, &r);
+ status = dcerpc_srvsvc_NetShareSetInfo_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetShareGetInfo failed");
torture_assert_werr_equal(tctx, r.out.result, levels[i].expected, "NetShareSetInfo failed");
q.in.share_name = r.in.share_name;
q.out.info = &info;
- status = dcerpc_srvsvc_NetShareGetInfo(p, tctx, &q);
+ status = dcerpc_srvsvc_NetShareGetInfo_r(b, tctx, &q);
torture_assert_ntstatus_ok(tctx, status, "NetShareGetInfo failed");
torture_assert_werr_ok(tctx, q.out.result, "NetShareGetInfo failed");
@@ -713,7 +725,7 @@ static bool test_NetShareAddSetDel(struct torture_context *tctx,
d.in.share_name = r.in.share_name;
d.in.reserved = 0;
- status = dcerpc_srvsvc_NetShareDel(p, tctx, &d);
+ status = dcerpc_srvsvc_NetShareDel_r(b, tctx, &d);
torture_assert_ntstatus_ok(tctx, status, "NetShareDel on share 'testshare502' failed");
torture_assert_werr_ok(tctx, a.out.result, "NetShareDel on share 'testshare502' failed");
@@ -749,6 +761,7 @@ static bool test_NetShareEnumAll(struct torture_context *tctx,
};
int i;
uint32_t resume_handle;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info_ctr);
@@ -796,7 +809,7 @@ static bool test_NetShareEnumAll(struct torture_context *tctx,
resume_handle = 0;
torture_comment(tctx, "testing NetShareEnumAll level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetShareEnumAll(p, tctx, &r);
+ status = dcerpc_srvsvc_NetShareEnumAll_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetShareEnumAll failed");
torture_assert_werr_equal(tctx, r.out.result, expected, "NetShareEnumAll failed");
@@ -851,6 +864,7 @@ static bool test_NetShareEnum(struct torture_context *tctx,
{ 502, WERR_ACCESS_DENIED, WERR_OK },
};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.in.info_ctr = &info_ctr;
@@ -891,7 +905,7 @@ static bool test_NetShareEnum(struct torture_context *tctx,
if (admin) expected = levels[i].admin_status;
torture_comment(tctx, "testing NetShareEnum level %u\n", info_ctr.level);
- status = dcerpc_srvsvc_NetShareEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetShareEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetShareEnum failed");
torture_assert_werr_equal(tctx, r.out.result, expected, "NetShareEnum failed");
}
@@ -922,6 +936,7 @@ static bool test_NetSrvGetInfo(struct torture_context *tctx,
union srvsvc_NetSrvInfo info;
uint32_t levels[] = {100, 101, 102, 502, 503};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
@@ -929,7 +944,7 @@ static bool test_NetSrvGetInfo(struct torture_context *tctx,
r.in.level = levels[i];
r.out.info = &info;
torture_comment(tctx, "testing NetSrvGetInfo level %u\n", r.in.level);
- status = dcerpc_srvsvc_NetSrvGetInfo(p, tctx, &r);
+ status = dcerpc_srvsvc_NetSrvGetInfo_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetSrvGetInfo failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "NetSrvGetInfo failed: %s\n", win_errstr(r.out.result));
@@ -952,6 +967,7 @@ static bool test_NetDiskEnum(struct torture_context *tctx,
uint32_t levels[] = {0};
int i;
uint32_t resume_handle=0;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(info);
@@ -966,7 +982,7 @@ static bool test_NetDiskEnum(struct torture_context *tctx,
ZERO_STRUCTP(r.out.info);
r.in.level = levels[i];
torture_comment(tctx, "testing NetDiskEnum level %u\n", r.in.level);
- status = dcerpc_srvsvc_NetDiskEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetDiskEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetDiskEnum failed");
torture_assert_werr_ok(tctx, r.out.result, "NetDiskEnum failed");
}
@@ -989,6 +1005,7 @@ static bool test_NetTransportEnum(struct torture_context *tctx,
uint32_t totalentries = 0;
uint32_t levels[] = {0, 1};
int i;
+ struct dcerpc_binding_handle *b = p->binding_handle;
ZERO_STRUCT(transports);
@@ -1012,7 +1029,7 @@ static bool test_NetTransportEnum(struct torture_context *tctx,
break;
}
torture_comment(tctx, "testing NetTransportEnum level %u\n", transports.level);
- status = dcerpc_srvsvc_NetTransportEnum(p, tctx, &r);
+ status = dcerpc_srvsvc_NetTransportEnum_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetTransportEnum failed");
if (!W_ERROR_IS_OK(r.out.result)) {
torture_comment(tctx, "unexpected result: %s\n", win_errstr(r.out.result));
@@ -1031,12 +1048,13 @@ static bool test_NetRemoteTOD(struct torture_context *tctx,
NTSTATUS status;
struct srvsvc_NetRemoteTOD r;
struct srvsvc_NetRemoteTODInfo *info = NULL;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx,"\\\\%s",dcerpc_server_name(p));
r.out.info = &info;
torture_comment(tctx, "testing NetRemoteTOD\n");
- status = dcerpc_srvsvc_NetRemoteTOD(p, tctx, &r);
+ status = dcerpc_srvsvc_NetRemoteTOD_r(b, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "NetRemoteTOD failed");
torture_assert_werr_ok(tctx, r.out.result, "NetRemoteTOD failed");
@@ -1055,6 +1073,7 @@ static bool test_NetNameValidate(struct torture_context *tctx,
char *invalidc;
char *name;
int i, n, min, max;
+ struct dcerpc_binding_handle *b = p->binding_handle;
r.in.server_unc = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.flags = 0x0;
@@ -1079,7 +1098,7 @@ again:
memset(name, 'A', n);
name[n] = '\0';
- status = dcerpc_srvsvc_NetNameValidate(p, tctx, &r);
+ status = dcerpc_srvsvc_NetNameValidate_r(b, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
d_printf("NetNameValidate failed while checking maximum size (%s)\n",
nt_errstr(status));
@@ -1111,7 +1130,7 @@ again:
for (n = 0x20; n < 0x7e; n++) {
r.in.name = name = talloc_asprintf(tctx, "%c", (char)n);
- status = dcerpc_srvsvc_NetNameValidate(p, tctx, &r);
+ status = dcerpc_srvsvc_NetNameValidate_r(b, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
d_printf("NetNameValidate failed while checking valid chars (%s)\n",
nt_errstr(status));