summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-07 02:37:04 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:48:41 +0100
commit4c4323009fa83f00ed319de59a3aad48fcd65994 (patch)
tree4eb290c8e7881e1b9b9f77f8401531443aa81bf4 /source4/torture/rpc
parent485b24fc113fe64507e20b9079948832d63194a3 (diff)
downloadsamba-4c4323009fa83f00ed319de59a3aad48fcd65994.tar.gz
samba-4c4323009fa83f00ed319de59a3aad48fcd65994.tar.bz2
samba-4c4323009fa83f00ed319de59a3aad48fcd65994.zip
r26327: Explicit loadparm_context for RPC client functions.
(This used to be commit eeb2251d22b3d6e0379444a73af69d1014692b07)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/async_bind.c2
-rw-r--r--source4/torture/rpc/bind.c3
-rw-r--r--source4/torture/rpc/dfs.c12
-rw-r--r--source4/torture/rpc/dssync.c2
-rw-r--r--source4/torture/rpc/mgmt.c2
-rw-r--r--source4/torture/rpc/rpc.c8
-rw-r--r--source4/torture/rpc/samba3rpc.c66
-rw-r--r--source4/torture/rpc/samlogon.c2
-rw-r--r--source4/torture/rpc/samr_accessmask.c4
-rw-r--r--source4/torture/rpc/samsync.c4
-rw-r--r--source4/torture/rpc/scanner.c2
-rw-r--r--source4/torture/rpc/schannel.c27
-rw-r--r--source4/torture/rpc/session_key.c2
-rw-r--r--source4/torture/rpc/testjoin.c4
14 files changed, 70 insertions, 70 deletions
diff --git a/source4/torture/rpc/async_bind.c b/source4/torture/rpc/async_bind.c
index 70743bd433..1ca3c62df0 100644
--- a/source4/torture/rpc/async_bind.c
+++ b/source4/torture/rpc/async_bind.c
@@ -78,7 +78,7 @@ bool torture_async_bind(struct torture_context *torture)
for (i = 0; i < torture_numasync; i++) {
table[i] = &ndr_table_lsarpc;
bind_req[i] = dcerpc_pipe_connect_send(mem_ctx, binding_string,
- table[i], creds, evt_ctx);
+ table[i], creds, evt_ctx, torture->lp_ctx);
}
/* recv bind requests */
diff --git a/source4/torture/rpc/bind.c b/source4/torture/rpc/bind.c
index 1800901873..55c9d3686d 100644
--- a/source4/torture/rpc/bind.c
+++ b/source4/torture/rpc/bind.c
@@ -64,7 +64,8 @@ bool torture_multi_bind(struct torture_context *torture)
return false;
}
- status = dcerpc_pipe_auth(mem_ctx, &p, binding, &ndr_table_lsarpc, cmdline_credentials);
+ status = dcerpc_pipe_auth(mem_ctx, &p, binding, &ndr_table_lsarpc, cmdline_credentials,
+ torture->lp_ctx);
if (NT_STATUS_IS_OK(status)) {
printf("(incorrectly) allowed re-bind to uuid %s - %s\n",
diff --git a/source4/torture/rpc/dfs.c b/source4/torture/rpc/dfs.c
index e169876b2b..dc2601d86e 100644
--- a/source4/torture/rpc/dfs.c
+++ b/source4/torture/rpc/dfs.c
@@ -44,6 +44,7 @@
}\
static bool test_NetShareAdd(TALLOC_CTX *mem_ctx,
+ struct torture_context *tctx,
const char *host,
const char *sharename,
const char *dir)
@@ -55,7 +56,7 @@ static bool test_NetShareAdd(TALLOC_CTX *mem_ctx,
printf("Creating share %s\n", sharename);
- if (!(libnetctx = libnet_context_init(NULL))) {
+ if (!(libnetctx = libnet_context_init(NULL, tctx->lp_ctx))) {
return false;
}
@@ -85,6 +86,7 @@ static bool test_NetShareAdd(TALLOC_CTX *mem_ctx,
}
static bool test_NetShareDel(TALLOC_CTX *mem_ctx,
+ struct torture_context *tctx,
const char *host,
const char *sharename)
{
@@ -94,7 +96,7 @@ static bool test_NetShareDel(TALLOC_CTX *mem_ctx,
printf("Deleting share %s\n", sharename);
- if (!(libnetctx = libnet_context_init(NULL))) {
+ if (!(libnetctx = libnet_context_init(NULL, tctx->lp_ctx))) {
return false;
}
@@ -491,7 +493,7 @@ static void test_cleanup_stdroot(struct dcerpc_pipe *p,
printf("Cleaning up StdRoot\n");
test_RemoveStdRoot(p, mem_ctx, host, sharename);
- test_NetShareDel(mem_ctx, host, sharename);
+ test_NetShareDel(mem_ctx, tctx, host, sharename);
torture_open_connection_share(mem_ctx, &cli, tctx, host, "C$", NULL);
test_DeleteDir(cli, dir);
torture_close_connection(cli);
@@ -513,11 +515,11 @@ static bool test_StdRoot(struct dcerpc_pipe *p,
test_cleanup_stdroot(p, mem_ctx, tctx, host, sharename, dir);
ret &= test_CreateDir(mem_ctx, &cli, tctx, host, "C$", dir);
- ret &= test_NetShareAdd(mem_ctx, host, sharename, path);
+ ret &= test_NetShareAdd(mem_ctx, tctx, host, sharename, path);
ret &= test_AddStdRoot(p, mem_ctx, host, sharename);
ret &= test_RemoveStdRoot(p, mem_ctx, host, sharename);
ret &= test_AddStdRootForced(p, mem_ctx, host, sharename);
- ret &= test_NetShareDel(mem_ctx, host, sharename);
+ ret &= test_NetShareDel(mem_ctx, tctx, host, sharename);
ret &= test_DeleteDir(cli, dir);
torture_close_connection(cli);
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 14164321b9..c0deb13570 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -182,7 +182,7 @@ static bool _test_DsBind(struct DsSyncTest *ctx, struct cli_credentials *credent
status = dcerpc_pipe_connect_b(ctx,
&b->pipe, ctx->drsuapi_binding,
&ndr_table_drsuapi,
- credentials, event);
+ credentials, event, global_loadparm);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to server as a BDC: %s\n", nt_errstr(status));
diff --git a/source4/torture/rpc/mgmt.c b/source4/torture/rpc/mgmt.c
index 4ae4ac3b34..d4b5fa9c6f 100644
--- a/source4/torture/rpc/mgmt.c
+++ b/source4/torture/rpc/mgmt.c
@@ -220,7 +220,7 @@ bool torture_rpc_mgmt(struct torture_context *torture)
printf("\nTesting pipe '%s'\n", l->table->name);
- status = dcerpc_epm_map_binding(loop_ctx, b, l->table, NULL);
+ status = dcerpc_epm_map_binding(loop_ctx, b, l->table, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to map port for uuid %s\n",
GUID_string(loop_ctx, &l->table->syntax_id.uuid));
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index c0c75ab21a..198c888f17 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -83,7 +83,7 @@ _PUBLIC_ NTSTATUS torture_rpc_connection(struct torture_context *tctx,
status = dcerpc_pipe_connect_b(tctx,
p, binding, table,
- cmdline_credentials, NULL);
+ cmdline_credentials, NULL, tctx->lp_ctx);
if (NT_STATUS_IS_ERR(status)) {
printf("Failed to connect to remote server: %s %s\n",
@@ -113,7 +113,7 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx,
binding->assoc_group_id = assoc_group_id;
status = dcerpc_pipe_connect_b(tctx, p, binding, table,
- cmdline_credentials, NULL);
+ cmdline_credentials, NULL, tctx->lp_ctx);
if (NT_STATUS_IS_ERR(status)) {
*p = NULL;
@@ -147,7 +147,7 @@ static bool torture_rpc_setup_machine(struct torture_context *tctx,
&(tcase_data->pipe),
binding,
tcase->table,
- tcase_data->credentials, NULL);
+ tcase_data->credentials, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status, "Error connecting to server");
@@ -205,7 +205,7 @@ static bool torture_rpc_setup_anonymous(struct torture_context *tctx,
&(tcase_data->pipe),
binding,
tcase->table,
- tcase_data->credentials, NULL);
+ tcase_data->credentials, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status, "Error connecting to server");
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 184125b493..96ed03fc6f 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -51,20 +51,6 @@
#include "param/param.h"
#include "lib/registry/registry.h"
-static struct cli_credentials *create_anon_creds(TALLOC_CTX *mem_ctx)
-{
- struct cli_credentials *result;
-
- if (!(result = cli_credentials_init(mem_ctx))) {
- return NULL;
- }
-
- cli_credentials_set_conf(result, global_loadparm);
- cli_credentials_set_anonymous(result);
-
- return result;
-}
-
/*
* This tests a RPC call using an invalid vuid
*/
@@ -153,7 +139,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
goto done;
}
- if (!(anon_creds = create_anon_creds(mem_ctx))) {
+ if (!(anon_creds = cli_credentials_init_anon(mem_ctx))) {
d_printf("create_anon_creds failed\n");
goto done;
}
@@ -199,6 +185,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
static bool bindtest(struct smbcli_state *cli,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
uint8_t auth_type, uint8_t auth_level)
{
TALLOC_CTX *mem_ctx;
@@ -232,7 +219,7 @@ static bool bindtest(struct smbcli_state *cli,
}
status = dcerpc_bind_auth(lsa_pipe, &ndr_table_lsarpc,
- credentials, auth_type, auth_level,
+ credentials, lp_ctx, auth_type, auth_level,
NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("dcerpc_bind_auth failed: %s\n", nt_errstr(status));
@@ -310,13 +297,13 @@ bool torture_bind_samba3(struct torture_context *torture)
ret = true;
- ret &= bindtest(cli, cmdline_credentials, DCERPC_AUTH_TYPE_NTLMSSP,
+ ret &= bindtest(cli, cmdline_credentials, torture->lp_ctx, DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_INTEGRITY);
- ret &= bindtest(cli, cmdline_credentials, DCERPC_AUTH_TYPE_NTLMSSP,
+ ret &= bindtest(cli, cmdline_credentials, torture->lp_ctx, DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_PRIVACY);
- ret &= bindtest(cli, cmdline_credentials, DCERPC_AUTH_TYPE_SPNEGO,
+ ret &= bindtest(cli, cmdline_credentials, torture->lp_ctx, DCERPC_AUTH_TYPE_SPNEGO,
DCERPC_AUTH_LEVEL_INTEGRITY);
- ret &= bindtest(cli, cmdline_credentials, DCERPC_AUTH_TYPE_SPNEGO,
+ ret &= bindtest(cli, cmdline_credentials, torture->lp_ctx, DCERPC_AUTH_TYPE_SPNEGO,
DCERPC_AUTH_LEVEL_PRIVACY);
done:
@@ -330,6 +317,7 @@ bool torture_bind_samba3(struct torture_context *torture)
static NTSTATUS get_usr_handle(struct smbcli_state *cli,
TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *admin_creds,
uint8_t auth_type,
uint8_t auth_level,
@@ -372,7 +360,7 @@ static NTSTATUS get_usr_handle(struct smbcli_state *cli,
if (admin_creds != NULL) {
status = dcerpc_bind_auth(samr_pipe, &ndr_table_samr,
- admin_creds, auth_type, auth_level,
+ admin_creds, lp_ctx, auth_type, auth_level,
NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("dcerpc_bind_auth failed: %s\n",
@@ -504,6 +492,7 @@ static NTSTATUS get_usr_handle(struct smbcli_state *cli,
*/
static bool create_user(TALLOC_CTX *mem_ctx, struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *admin_creds,
const char *username, const char *password,
char **domain_name,
@@ -520,7 +509,7 @@ static bool create_user(TALLOC_CTX *mem_ctx, struct smbcli_state *cli,
return false;
}
- status = get_usr_handle(cli, tmp_ctx, admin_creds,
+ status = get_usr_handle(cli, tmp_ctx, lp_ctx, admin_creds,
DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_INTEGRITY,
username, domain_name, &samr_pipe, &wks_handle,
@@ -616,6 +605,7 @@ static bool create_user(TALLOC_CTX *mem_ctx, struct smbcli_state *cli,
*/
static bool delete_user(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *admin_creds,
const char *username)
{
@@ -631,7 +621,7 @@ static bool delete_user(struct smbcli_state *cli,
return false;
}
- status = get_usr_handle(cli, mem_ctx, admin_creds,
+ status = get_usr_handle(cli, mem_ctx, lp_ctx, admin_creds,
DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_INTEGRITY,
username, &dom_name, &samr_pipe,
@@ -667,6 +657,7 @@ static bool delete_user(struct smbcli_state *cli,
*/
static bool join3(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
bool use_level25,
struct cli_credentials *admin_creds,
struct cli_credentials *wks_creds)
@@ -684,7 +675,7 @@ static bool join3(struct smbcli_state *cli,
}
status = get_usr_handle(
- cli, mem_ctx, admin_creds,
+ cli, mem_ctx, lp_ctx, admin_creds,
DCERPC_AUTH_TYPE_NTLMSSP,
DCERPC_AUTH_LEVEL_PRIVACY,
talloc_asprintf(mem_ctx, "%s$",
@@ -908,6 +899,7 @@ static bool auth2(struct smbcli_state *cli,
*/
static bool schan(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *wks_creds,
struct cli_credentials *user_creds)
{
@@ -944,7 +936,7 @@ static bool schan(struct smbcli_state *cli,
#if 1
net_pipe->conn->flags |= (DCERPC_SIGN | DCERPC_SEAL);
status = dcerpc_bind_auth(net_pipe, &ndr_table_netlogon,
- wks_creds, DCERPC_AUTH_TYPE_SCHANNEL,
+ wks_creds, lp_ctx, DCERPC_AUTH_TYPE_SCHANNEL,
DCERPC_AUTH_LEVEL_PRIVACY,
NULL);
#else
@@ -1105,6 +1097,7 @@ static bool schan(struct smbcli_state *cli,
*/
static bool leave(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *admin_creds,
struct cli_credentials *wks_creds)
{
@@ -1112,7 +1105,7 @@ static bool leave(struct smbcli_state *cli,
NULL, "%s$", cli_credentials_get_workstation(wks_creds));
bool ret;
- ret = delete_user(cli, admin_creds, wks_name);
+ ret = delete_user(cli, lp_ctx, admin_creds, wks_name);
talloc_free(wks_name);
return ret;
}
@@ -1144,7 +1137,7 @@ bool torture_netlogon_samba3(struct torture_context *torture)
return false;
}
- if (!(anon_creds = create_anon_creds(mem_ctx))) {
+ if (!(anon_creds = cli_credentials_init_anon(mem_ctx))) {
d_printf("create_anon_creds failed\n");
goto done;
}
@@ -1172,7 +1165,7 @@ bool torture_netlogon_samba3(struct torture_context *torture)
generate_random_str(wks_creds, 8),
CRED_SPECIFIED);
- if (!join3(cli, false, cmdline_credentials, wks_creds)) {
+ if (!join3(cli, torture->lp_ctx, false, cmdline_credentials, wks_creds)) {
d_printf("join failed\n");
goto done;
}
@@ -1195,14 +1188,14 @@ bool torture_netlogon_samba3(struct torture_context *torture)
}
for (j=0; j<2; j++) {
- if (!schan(cli, wks_creds, cmdline_credentials)) {
+ if (!schan(cli, torture->lp_ctx, wks_creds, cmdline_credentials)) {
d_printf("schan failed\n");
goto done;
}
}
}
- if (!leave(cli, cmdline_credentials, wks_creds)) {
+ if (!leave(cli, torture->lp_ctx, cmdline_credentials, wks_creds)) {
d_printf("leave failed\n");
goto done;
}
@@ -1253,7 +1246,7 @@ static bool test_join3(struct torture_context *tctx,
generate_random_str(wks_creds, 8),
CRED_SPECIFIED);
- if (!join3(cli, use_level25, samr_creds, wks_creds)) {
+ if (!join3(cli, tctx->lp_ctx, use_level25, samr_creds, wks_creds)) {
d_printf("join failed\n");
goto done;
}
@@ -1267,7 +1260,7 @@ static bool test_join3(struct torture_context *tctx,
goto done;
}
- if (!leave(cli, samr_creds, wks_creds)) {
+ if (!leave(cli, tctx->lp_ctx, samr_creds, wks_creds)) {
d_printf("leave failed\n");
goto done;
}
@@ -1293,7 +1286,7 @@ bool torture_samba3_sessionkey(struct torture_context *torture)
wks_name = torture_setting_string(torture, "wksname", get_myname());
- if (!(anon_creds = create_anon_creds(torture))) {
+ if (!(anon_creds = cli_credentials_init_anon(torture))) {
d_printf("create_anon_creds failed\n");
goto done;
}
@@ -1611,7 +1604,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
talloc_free(cli);
- if (!(anon_creds = create_anon_creds(mem_ctx))) {
+ if (!(anon_creds = cli_credentials_init_anon(mem_ctx))) {
d_printf("(%s) create_anon_creds failed\n", __location__);
ret = false;
goto done;
@@ -1655,7 +1648,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
generate_random_str(user_creds, 8),
CRED_SPECIFIED);
- if (!create_user(mem_ctx, cli, cmdline_credentials,
+ if (!create_user(mem_ctx, cli, torture->lp_ctx, cmdline_credentials,
cli_credentials_get_username(user_creds),
cli_credentials_get_password(user_creds),
&domain_name, &created_sid)) {
@@ -1720,7 +1713,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
}
delete:
- if (!delete_user(cli, cmdline_credentials,
+ if (!delete_user(cli, torture->lp_ctx,
+ cmdline_credentials,
cli_credentials_get_username(user_creds))) {
d_printf("(%s) delete_user failed\n", __location__);
ret = false;
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index e7f14a89e2..b60cef7d53 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -1598,7 +1598,7 @@ bool torture_rpc_samlogon(struct torture_context *torture)
status = dcerpc_pipe_connect_b(mem_ctx, &p, b,
&ndr_table_netlogon,
- machine_credentials, NULL);
+ machine_credentials, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
d_printf("RPC pipe connect as domain member failed: %s\n", nt_errstr(status));
diff --git a/source4/torture/rpc/samr_accessmask.c b/source4/torture/rpc/samr_accessmask.c
index e64d6a6bce..97fe16101d 100644
--- a/source4/torture/rpc/samr_accessmask.c
+++ b/source4/torture/rpc/samr_accessmask.c
@@ -292,7 +292,7 @@ static bool test_samr_connect_user_acl(struct torture_context *tctx,
/* Try to connect as the test user */
status = dcerpc_pipe_connect(tctx,
&test_p, binding, &ndr_table_samr,
- test_credentials, NULL);
+ test_credentials, NULL, tctx->lp_ctx);
/* connect to SAMR as the user */
status = torture_samr_Connect5(tctx, test_p, SEC_FLAG_MAXIMUM_ALLOWED, &uch);
if (!NT_STATUS_IS_OK(status)) {
@@ -357,7 +357,7 @@ static bool test_samr_connect_user_acl_enforced(struct torture_context *tctx,
status = dcerpc_pipe_connect(tctx,
&test_p, binding, &ndr_table_samr,
- test_credentials, NULL);
+ test_credentials, NULL, tctx->lp_ctx);
/* connect to SAMR as the user */
status = torture_samr_Connect5(tctx, test_p, SAMR_ACCESS_SHUTDOWN_SERVER, &uch);
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index d1d95ce8fd..e94f228589 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -1558,7 +1558,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
status = dcerpc_pipe_connect_b(samsync_state,
&samsync_state->p, b,
&ndr_table_netlogon,
- credentials, NULL);
+ credentials, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to server as a BDC: %s\n", nt_errstr(status));
@@ -1596,7 +1596,7 @@ bool torture_rpc_samsync(struct torture_context *torture)
&samsync_state->p_netlogon_wksta,
b_netlogon_wksta,
&ndr_table_netlogon,
- credentials_wksta, NULL);
+ credentials_wksta, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to server as a Workstation: %s\n", nt_errstr(status));
diff --git a/source4/torture/rpc/scanner.c b/source4/torture/rpc/scanner.c
index a47fbdd667..03a2c9fd07 100644
--- a/source4/torture/rpc/scanner.c
+++ b/source4/torture/rpc/scanner.c
@@ -120,7 +120,7 @@ bool torture_rpc_scanner(struct torture_context *torture)
printf("\nTesting pipe '%s'\n", l->table->name);
if (b->transport == NCACN_IP_TCP) {
- status = dcerpc_epm_map_binding(torture, b, l->table, NULL);
+ status = dcerpc_epm_map_binding(torture, b, l->table, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to map port for uuid %s\n",
GUID_string(loop_ctx, &l->table->syntax_id.uuid));
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index 39cffc8e2a..6b0cbbf525 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -255,7 +255,7 @@ static bool test_schannel(struct torture_context *tctx,
b->flags |= dcerpc_flags;
status = dcerpc_pipe_connect_b(tctx, &p, b, &ndr_table_samr,
- credentials, NULL);
+ credentials, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status,
"Failed to connect with schannel");
@@ -267,15 +267,16 @@ static bool test_schannel(struct torture_context *tctx,
* the second */
/* Swap the binding details from SAMR to NETLOGON */
- status = dcerpc_epm_map_binding(tctx, b, &ndr_table_netlogon, NULL);
+ status = dcerpc_epm_map_binding(tctx, b, &ndr_table_netlogon, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status, "epm map");
status = dcerpc_secondary_connection(p, &p_netlogon,
b);
torture_assert_ntstatus_ok(tctx, status, "seconday connection");
- status = dcerpc_bind_auth(p_netlogon, &ndr_table_netlogon,
- credentials, DCERPC_AUTH_TYPE_SCHANNEL,
+ status = dcerpc_bind_auth(p_netlogon, &ndr_table_netlogon,
+ credentials, tctx->lp_ctx,
+ DCERPC_AUTH_TYPE_SCHANNEL,
dcerpc_auth_level(p->conn),
NULL);
@@ -292,7 +293,7 @@ static bool test_schannel(struct torture_context *tctx,
"Failed to process schannel secured NETLOGON EX ops");
/* Swap the binding details from SAMR to LSARPC */
- status = dcerpc_epm_map_binding(tctx, b, &ndr_table_lsarpc, NULL);
+ status = dcerpc_epm_map_binding(tctx, b, &ndr_table_lsarpc, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status, "epm map");
status = dcerpc_secondary_connection(p, &p_lsa,
@@ -301,7 +302,8 @@ static bool test_schannel(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "seconday connection");
status = dcerpc_bind_auth(p_lsa, &ndr_table_lsarpc,
- credentials, DCERPC_AUTH_TYPE_SCHANNEL,
+ credentials, tctx->lp_ctx,
+ DCERPC_AUTH_TYPE_SCHANNEL,
dcerpc_auth_level(p->conn),
NULL);
@@ -323,7 +325,7 @@ static bool test_schannel(struct torture_context *tctx,
b->flags |= dcerpc_flags;
status = dcerpc_pipe_connect_b(tctx, &p_samr2, b, &ndr_table_samr,
- credentials, NULL);
+ credentials, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status,
"Failed to connect with schannel");
@@ -332,7 +334,7 @@ static bool test_schannel(struct torture_context *tctx,
"Failed to process schannel secured SAMR ops (on fresh connection)");
/* Swap the binding details from SAMR to NETLOGON */
- status = dcerpc_epm_map_binding(tctx, b, &ndr_table_netlogon, NULL);
+ status = dcerpc_epm_map_binding(tctx, b, &ndr_table_netlogon, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status, "epm");
status = dcerpc_secondary_connection(p_samr2, &p_netlogon2,
@@ -341,7 +343,8 @@ static bool test_schannel(struct torture_context *tctx,
/* and now setup an SCHANNEL bind on netlogon */
status = dcerpc_bind_auth(p_netlogon2, &ndr_table_netlogon,
- credentials, DCERPC_AUTH_TYPE_SCHANNEL,
+ credentials, tctx->lp_ctx,
+ DCERPC_AUTH_TYPE_SCHANNEL,
dcerpc_auth_level(p_samr2->conn),
NULL);
@@ -364,7 +367,7 @@ static bool test_schannel(struct torture_context *tctx,
b->flags &= ~DCERPC_AUTH_OPTIONS;
status = dcerpc_pipe_connect_b(tctx, &p_netlogon3, b, &ndr_table_netlogon,
- credentials, NULL);
+ credentials, NULL, tctx->lp_ctx);
torture_assert_ntstatus_ok(tctx, status, "Failed to connect without schannel");
torture_assert(tctx, !test_netlogon_ex_ops(p_netlogon3, tctx, credentials, creds),
@@ -447,12 +450,12 @@ bool torture_rpc_schannel2(struct torture_context *torture)
printf("Opening first connection\n");
status = dcerpc_pipe_connect_b(torture, &p1, b, &ndr_table_netlogon,
- credentials1, NULL);
+ credentials1, NULL, torture->lp_ctx);
torture_assert_ntstatus_ok(torture, status, "Failed to connect with schannel");
torture_comment(torture, "Opening second connection\n");
status = dcerpc_pipe_connect_b(torture, &p2, b, &ndr_table_netlogon,
- credentials2, NULL);
+ credentials2, NULL, torture->lp_ctx);
torture_assert_ntstatus_ok(torture, status, "Failed to connect with schannel");
credentials1->netlogon_creds = NULL;
diff --git a/source4/torture/rpc/session_key.c b/source4/torture/rpc/session_key.c
index 765458c62a..44c3ae2358 100644
--- a/source4/torture/rpc/session_key.c
+++ b/source4/torture/rpc/session_key.c
@@ -158,7 +158,7 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
binding->flags |= settings->bindoptions;
torture_assert_ntstatus_ok(torture,
- dcerpc_pipe_connect_b(torture, &p, binding, &ndr_table_lsarpc, cmdline_credentials, NULL),
+ dcerpc_pipe_connect_b(torture, &p, binding, &ndr_table_lsarpc, cmdline_credentials, NULL, torture->lp_ctx),
"connect");
if (!test_lsa_OpenPolicy2(p, torture, &handle)) {
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
index 23a737c042..02f04946d6 100644
--- a/source4/torture/rpc/testjoin.c
+++ b/source4/torture/rpc/testjoin.c
@@ -142,7 +142,7 @@ struct test_join *torture_create_testuser(struct torture_context *torture,
&join->p,
dc_binding,
&ndr_table_samr,
- cmdline_credentials, NULL);
+ cmdline_credentials, NULL, torture->lp_ctx);
} else {
status = torture_rpc_connection(torture,
@@ -320,7 +320,7 @@ _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx,
return NULL;
}
- libnet_ctx = libnet_context_init(NULL);
+ libnet_ctx = libnet_context_init(NULL, tctx->lp_ctx);
if (!libnet_ctx) {
talloc_free(tj);
return NULL;