summaryrefslogtreecommitdiff
path: root/source4/torture/libnet/libnet_domain.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-28 19:03:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:03 -0500
commit3e7203d0b34a031e10aeaaf04f246a1de8376ab4 (patch)
treecb3b6303112f2b945650b2a778d2eb32cbba3e59 /source4/torture/libnet/libnet_domain.c
parent53d10b44faa77293e380bd1cda6168acc05a5493 (diff)
downloadsamba-3e7203d0b34a031e10aeaaf04f246a1de8376ab4.tar.gz
samba-3e7203d0b34a031e10aeaaf04f246a1de8376ab4.tar.bz2
samba-3e7203d0b34a031e10aeaaf04f246a1de8376ab4.zip
r24755: Use common code for finding the RPC binding in the torture tests.
(This used to be commit e3310e773924ddd2129e8ca1a86e23d0f713c19c)
Diffstat (limited to 'source4/torture/libnet/libnet_domain.c')
-rw-r--r--source4/torture/libnet/libnet_domain.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/source4/torture/libnet/libnet_domain.c b/source4/torture/libnet/libnet_domain.c
index 915054bf50..675ab9f099 100644
--- a/source4/torture/libnet/libnet_domain.c
+++ b/source4/torture/libnet/libnet_domain.c
@@ -179,17 +179,14 @@ BOOL torture_domain_close_lsa(struct torture_context *torture)
struct libnet_context *ctx;
struct lsa_String domain_name;
struct dcerpc_binding *binding;
- const char *bindstr;
uint32_t access_mask;
struct policy_handle h;
struct dcerpc_pipe *p;
struct libnet_DomainClose r;
- bindstr = torture_setting_string(torture, "binding", NULL);
- status = dcerpc_parse_binding(torture, bindstr, &binding);
+ status = torture_rpc_binding(torture, &binding);
if (!NT_STATUS_IS_OK(status)) {
- d_printf("failed to parse binding string\n");
- return False;
+ return false;
}
ctx = libnet_context_init(NULL);
@@ -202,11 +199,10 @@ BOOL torture_domain_close_lsa(struct torture_context *torture)
ctx->cred = cmdline_credentials;
mem_ctx = talloc_init("torture_domain_close_lsa");
- status = dcerpc_pipe_connect(mem_ctx, &p, bindstr, &ndr_table_lsarpc,
+ status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_lsarpc,
cmdline_credentials, NULL);
if (!NT_STATUS_IS_OK(status)) {
- d_printf("failed to connect to server %s: %s\n", bindstr,
- nt_errstr(status));
+ d_printf("failed to connect to server: %s\n", nt_errstr(status));
ret = False;
goto done;
}
@@ -247,7 +243,6 @@ done:
BOOL torture_domain_open_samr(struct torture_context *torture)
{
NTSTATUS status;
- const char *binding;
struct libnet_context *ctx;
struct event_context *evt_ctx=NULL;
TALLOC_CTX *mem_ctx;
@@ -258,7 +253,6 @@ BOOL torture_domain_open_samr(struct torture_context *torture)
BOOL ret = True;
mem_ctx = talloc_init("test_domainopen_lsa");
- binding = torture_setting_string(torture, "binding", NULL);
ctx = libnet_context_init(evt_ctx);
ctx->cred = cmdline_credentials;
@@ -314,18 +308,15 @@ BOOL torture_domain_close_samr(struct torture_context *torture)
struct libnet_context *ctx;
struct lsa_String domain_name;
struct dcerpc_binding *binding;
- const char *bindstr;
uint32_t access_mask;
struct policy_handle h;
struct dcerpc_pipe *p;
struct libnet_DomainClose r;
struct dom_sid *sid;
- bindstr = torture_setting_string(torture, "binding", NULL);
- status = dcerpc_parse_binding(torture, bindstr, &binding);
+ status = torture_rpc_binding(torture, &binding);
if (!NT_STATUS_IS_OK(status)) {
- d_printf("failed to parse binding string\n");
- return False;
+ return false;
}
ctx = libnet_context_init(NULL);
@@ -338,11 +329,10 @@ BOOL torture_domain_close_samr(struct torture_context *torture)
ctx->cred = cmdline_credentials;
mem_ctx = talloc_init("torture_domain_close_samr");
- status = dcerpc_pipe_connect(mem_ctx, &p, bindstr, &ndr_table_samr,
+ status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_samr,
ctx->cred, NULL);
if (!NT_STATUS_IS_OK(status)) {
- d_printf("failed to connect to server %s: %s\n", bindstr,
- nt_errstr(status));
+ d_printf("failed to connect to server: %s\n", nt_errstr(status));
ret = False;
goto done;
}
@@ -387,17 +377,14 @@ BOOL torture_domain_list(struct torture_context *torture)
BOOL ret = True;
NTSTATUS status;
TALLOC_CTX *mem_ctx = NULL;
- const char *bindstr;
struct dcerpc_binding *binding;
struct libnet_context *ctx;
struct libnet_DomainList r;
int i;
- bindstr = torture_setting_string(torture, "binding", NULL);
- status = dcerpc_parse_binding(torture, bindstr, &binding);
+ status = torture_rpc_binding(torture, &binding);
if (!NT_STATUS_IS_OK(status)) {
- d_printf("failed to parse binding string\n");
- return False;
+ return false;
}
ctx = libnet_context_init(NULL);