/****************************************************************************
try and browse available shares on a host
****************************************************************************/
-static bool browse_host(const char *query_host)
+static bool browse_host(struct loadparm_context *lp_ctx, const char *query_host)
{
struct dcerpc_pipe *p;
char *binding;
status = dcerpc_pipe_connect(mem_ctx, &p, binding,
&ndr_table_srvsvc,
- cmdline_credentials, NULL);
+ cmdline_credentials, NULL,
+ lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
d_printf("Failed to connect to %s - %s\n",
binding, nt_errstr(status));
/****************************************************************************
handle a -L query
****************************************************************************/
-static int do_host_query(const char *query_host, const char *workgroup)
+static int do_host_query(struct loadparm_context *lp_ctx, const char *query_host, const char *workgroup)
{
- browse_host(query_host);
+ browse_host(lp_ctx, query_host);
list_servers(workgroup);
return(0);
}
}
if (query_host) {
- return do_host_query(query_host, lp_workgroup(global_loadparm));
+ return do_host_query(global_loadparm, query_host, lp_workgroup(global_loadparm));
}
if (message) {
creq = dcerpc_pipe_connect_b_send(st, conn->binding, &ndr_table_drsuapi,
conn->service->system_session_info->credentials,
- c->event_ctx);
+ c->event_ctx, conn->service->task->lp_ctx);
composite_continue(c, creq, dreplsrv_out_drsuapi_connect_recv, st);
return c;
WERROR reg_open_remote(struct registry_context **ctx,
struct auth_session_info *session_info,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
const char *location, struct event_context *ev);
WERROR reg_open_wine(struct registry_context **ctx, const char *path);
_PUBLIC_ WERROR reg_open_remote(struct registry_context **ctx,
struct auth_session_info *session_info,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
const char *location, struct event_context *ev)
{
NTSTATUS status;
status = dcerpc_pipe_connect(*ctx /* TALLOC_CTX */,
&p, location,
&ndr_table_winreg,
- credentials, ev);
+ credentials, ev, lp_ctx);
rctx->pipe = p;
if(NT_STATUS_IS_ERR(status)) {
error = reg_open_samba(NULL, &ctx, lp_ctx, NULL, cmdline_credentials);
break;
case REG_REMOTE:
- error = reg_open_remote(&ctx, NULL, cmdline_credentials,
+ error = reg_open_remote(&ctx, NULL, cmdline_credentials, lp_ctx,
remote_host, NULL);
break;
case REG_NULL:
#include "lib/events/events.h"
#include "param/param.h"
-struct libnet_context *libnet_context_init(struct event_context *ev)
+struct libnet_context *libnet_context_init(struct event_context *ev,
+ struct loadparm_context *lp_ctx)
{
struct libnet_context *ctx;
}
}
ctx->event_ctx = ev;
+ ctx->lp_ctx = lp_ctx;
/* name resolution methods */
ctx->name_res_methods = str_list_copy(ctx, lp_name_resolve_order(global_loadparm));
const char **name_res_methods;
struct event_context *event_ctx;
+
+ struct loadparm_context *lp_ctx;
};
}
creq = dcerpc_pipe_connect_b_send(s, drsuapi->binding, &ndr_table_drsuapi,
- s->libnet->cred, s->libnet->event_ctx);
+ s->libnet->cred, s->libnet->event_ctx,
+ s->libnet->lp_ctx);
composite_continue(c, creq, recv_fn, s);
}
drsuapi_binding,
&ndr_table_drsuapi,
ctx->cred,
- ctx->event_ctx);
+ ctx->event_ctx,
+ ctx->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
r->out.error_string = talloc_asprintf(r,
"Connection to DRSUAPI pipe of PDC of domain '%s' failed: %s",
status = dcerpc_pipe_auth(tmp_ctx, &samr_pipe,
connect_with_info->out.dcerpc_pipe->binding,
- &ndr_table_samr, ctx->cred);
+ &ndr_table_samr, ctx->cred, ctx->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
r->out.error_string = talloc_asprintf(mem_ctx,
"SAMR bind failed: %s",
/* connect to remote dcerpc pipe */
pipe_connect_req = dcerpc_pipe_connect_b_send(c, b, r->in.dcerpc_iface,
- ctx->cred, c->event_ctx);
+ ctx->cred, c->event_ctx,
+ ctx->lp_ctx);
if (composite_nomem(pipe_connect_req, c)) return c;
composite_continue(c, pipe_connect_req, continue_pipe_connect, c);
if (composite_nomem(talloc_reference(s->final_binding, s->lsa_pipe->binding), c)) return;
epm_map_req = dcerpc_epm_map_binding_send(c, s->final_binding, s->r.in.dcerpc_iface,
- s->lsa_pipe->conn->event_ctx);
+ s->lsa_pipe->conn->event_ctx, s->ctx->lp_ctx);
if (composite_nomem(epm_map_req, c)) return;
composite_continue(c, epm_map_req, continue_epm_map_binding, c);
if (!composite_is_ok(c)) return;
creq = dcerpc_pipe_connect_b_send(s, s->drsuapi.binding, &ndr_table_drsuapi,
- s->libnet->cred, s->libnet->event_ctx);
+ s->libnet->cred, s->libnet->event_ctx,
+ s->libnet->lp_ctx);
composite_continue(c, creq, unbecomeDC_drsuapi_connect_recv, s);
}
}
nt_status = dcerpc_bind_auth_schannel(samsync_ctx, p, &ndr_table_netlogon,
- machine_account, DCERPC_AUTH_LEVEL_PRIVACY);
+ machine_account, ctx->lp_ctx, DCERPC_AUTH_LEVEL_PRIVACY);
if (!NT_STATUS_IS_OK(nt_status)) {
r->out.error_string = talloc_asprintf(mem_ctx,
const char *binding,
const char *pipe_uuid,
uint32_t pipe_version,
- struct cli_credentials *credentials);
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx);
%typemap(in) DATA_BLOB * (DATA_BLOB temp_data_blob) {
temp_data_blob.data = PyString_AsString($input);
struct dcerpc_pipe *p,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
uint8_t auth_type, uint8_t auth_level,
const char *service)
{
c->status = gensec_client_start(p, &sec->generic_state,
p->conn->event_ctx,
- global_loadparm);
+ lp_ctx);
if (!NT_STATUS_IS_OK(c->status)) {
DEBUG(1, ("Failed to start GENSEC client mode: %s\n",
nt_errstr(c->status)));
NTSTATUS dcerpc_bind_auth(struct dcerpc_pipe *p,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
uint8_t auth_type, uint8_t auth_level,
const char *service)
{
struct composite_context *creq;
- creq = dcerpc_bind_auth_send(p, p, table, credentials,
+ creq = dcerpc_bind_auth_send(p, p, table, credentials, lp_ctx,
auth_type, auth_level, service);
return dcerpc_bind_auth_recv(creq);
}
struct dcerpc_binding *binding;
const struct ndr_interface_table *table;
struct cli_credentials *credentials;
+ struct loadparm_context *lp_ctx;
};
}
auth_bind_req = dcerpc_pipe_auth_send(s->pipe, s->binding, s->table,
- s->credentials);
+ s->credentials, s->lp_ctx);
composite_continue(c, auth_bind_req, continue_pipe_auth, c);
}
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
- struct event_context *ev)
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
struct pipe_connect_state *s;
s->binding = binding;
s->table = table;
s->credentials = credentials;
+ s->lp_ctx = lp_ctx;
event_add_timed(c->event_ctx, c,
timeval_current_ofs(DCERPC_REQUEST_TIMEOUT, 0),
case NCA_UNKNOWN: {
struct composite_context *binding_req;
binding_req = dcerpc_epm_map_binding_send(c, s->binding, s->table,
- s->pipe->conn->event_ctx);
+ s->pipe->conn->event_ctx,
+ s->lp_ctx);
composite_continue(c, binding_req, continue_map_binding, c);
return c;
}
if (!s->binding->endpoint) {
struct composite_context *binding_req;
binding_req = dcerpc_epm_map_binding_send(c, s->binding, s->table,
- s->pipe->conn->event_ctx);
+ s->pipe->conn->event_ctx,
+ s->lp_ctx);
composite_continue(c, binding_req, continue_map_binding, c);
return c;
}
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
- struct event_context *ev)
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
c = dcerpc_pipe_connect_b_send(parent_ctx, binding, table,
- credentials, ev);
+ credentials, ev, lp_ctx);
return dcerpc_pipe_connect_b_recv(c, parent_ctx, pp);
}
const char *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
- struct event_context *ev)
+ struct event_context *ev, struct loadparm_context *lp_ctx)
{
struct composite_context *c;
struct pipe_conn_state *s;
is established
*/
pipe_conn_req = dcerpc_pipe_connect_b_send(c, b, table,
- credentials, ev);
+ credentials, ev, lp_ctx);
composite_continue(c, pipe_conn_req, continue_pipe_connect_b, c);
return c;
}
const char *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
- struct event_context *ev)
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
c = dcerpc_pipe_connect_send(parent_ctx, binding,
- table,
- credentials, ev);
+ table, credentials, ev, lp_ctx);
return dcerpc_pipe_connect_recv(c, parent_ctx, pp);
}
struct dcerpc_pipe *pipe;
struct cli_credentials *credentials;
const struct ndr_interface_table *table;
+ struct loadparm_context *lp_ctx;
uint8_t auth_level;
};
/* send bind auth request with received creds */
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table, s->credentials,
+ s->lp_ctx,
DCERPC_AUTH_TYPE_SCHANNEL, s->auth_level,
NULL);
if (composite_nomem(auth_req, c)) return;
struct dcerpc_pipe *p,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
uint8_t auth_level)
{
struct composite_context *c;
s->credentials = credentials;
s->table = table;
s->auth_level = auth_level;
+ s->lp_ctx = lp_ctx;
/* start getting schannel key first */
schan_key_req = dcerpc_schannel_key_send(c, p, credentials);
struct dcerpc_pipe *p,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
uint8_t auth_level)
{
struct composite_context *c;
- c = dcerpc_bind_auth_schannel_send(tmp_ctx, p, table, credentials,
+ c = dcerpc_bind_auth_schannel_send(tmp_ctx, p, table, credentials, lp_ctx,
auth_level);
return dcerpc_bind_auth_schannel_recv(c);
}
const struct ndr_interface_table *table;
struct cli_credentials *credentials;
struct composite_context *ctx;
+ struct loadparm_context *lp_ctx;
};
static void dcerpc_secondary_auth_connection_bind(struct composite_context *ctx);
struct composite_context* dcerpc_secondary_auth_connection_send(struct dcerpc_pipe *p,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
- struct cli_credentials *credentials)
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c, *secondary_conn_ctx;
s->binding = binding;
s->table = table;
s->credentials = credentials;
+ s->lp_ctx = lp_ctx;
secondary_conn_ctx = dcerpc_secondary_connection_send(p, binding);
s->ctx->status = dcerpc_secondary_connection_recv(ctx, &s->pipe2);
if (!composite_is_ok(s->ctx)) return;
- secondary_auth_ctx = dcerpc_pipe_auth_send(s->pipe2, s->binding, s->table, s->credentials);
+ secondary_auth_ctx = dcerpc_pipe_auth_send(s->pipe2, s->binding, s->table, s->credentials,
+ s->lp_ctx);
composite_continue(s->ctx, secondary_auth_ctx, dcerpc_secondary_auth_connection_continue, s);
}
struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
- struct event_context *ev)
+ struct event_context *ev,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
struct epm_map_binding_state *s;
/* initiate rpc pipe connection */
pipe_connect_req = dcerpc_pipe_connect_b_send(c, epmapper_binding,
&ndr_table_epmapper,
- anon_creds, c->event_ctx);
+ anon_creds, c->event_ctx,
+ lp_ctx);
if (composite_nomem(pipe_connect_req, c)) return c;
composite_continue(c, pipe_connect_req, continue_epm_recv_binding, c);
Get endpoint mapping for rpc connection
*/
NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding,
- const struct ndr_interface_table *table, struct event_context *ev)
+ const struct ndr_interface_table *table, struct event_context *ev,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
- c = dcerpc_epm_map_binding_send(mem_ctx, binding, table, ev);
+ c = dcerpc_epm_map_binding_send(mem_ctx, binding, table, ev, lp_ctx);
return dcerpc_epm_map_binding_recv(c);
}
struct dcerpc_pipe *pipe;
struct dcerpc_binding *binding;
const struct ndr_interface_table *table;
+ struct loadparm_context *lp_ctx;
struct cli_credentials *credentials;
};
/* initiate a authenticated bind */
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, DCERPC_AUTH_TYPE_NTLMSSP,
+ s->credentials, s->lp_ctx,
+ DCERPC_AUTH_TYPE_NTLMSSP,
dcerpc_auth_level(s->pipe->conn),
s->table->authservices->names[0]);
composite_continue(c, auth_req, continue_auth, c);
/* initiate a authenticated bind */
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, DCERPC_AUTH_TYPE_SPNEGO,
+ s->credentials, s->lp_ctx, DCERPC_AUTH_TYPE_SPNEGO,
dcerpc_auth_level(s->pipe->conn),
s->table->authservices->names[0]);
composite_continue(c, auth_req, continue_auth, c);
struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
- struct cli_credentials *credentials)
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
struct pipe_auth_state *s;
s->table = table;
s->credentials = credentials;
s->pipe = p;
+ s->lp_ctx = lp_ctx;
conn = s->pipe->conn;
conn->flags = binding->flags;
* the schannel bind, then we have to get these
* first */
auth_schannel_req = dcerpc_bind_auth_schannel_send(c, s->pipe, s->table,
- s->credentials,
+ s->credentials, s->lp_ctx,
dcerpc_auth_level(conn));
composite_continue(c, auth_schannel_req, continue_auth_schannel, c);
return c;
} else {
/* try SPNEGO with fallback to NTLMSSP */
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, DCERPC_AUTH_TYPE_SPNEGO,
+ s->credentials, s->lp_ctx, DCERPC_AUTH_TYPE_SPNEGO,
dcerpc_auth_level(conn),
s->table->authservices->names[0]);
composite_continue(c, auth_req, continue_auth_auto, c);
}
auth_req = dcerpc_bind_auth_send(c, s->pipe, s->table,
- s->credentials, auth_type,
+ s->credentials, s->lp_ctx, auth_type,
dcerpc_auth_level(conn),
s->table->authservices->names[0]);
composite_continue(c, auth_req, continue_auth, c);
struct dcerpc_pipe **p,
struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
- struct cli_credentials *credentials)
+ struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx)
{
struct composite_context *c;
- c = dcerpc_pipe_auth_send(*p, binding, table, credentials);
+ c = dcerpc_pipe_auth_send(*p, binding, table, credentials, lp_ctx);
return dcerpc_pipe_auth_recv(c, mem_ctx, p);
}
SWIGINTERN cli_credentials *new_cli_credentials(){
return cli_credentials_init(NULL);
}
-SWIGINTERN void delete_cli_credentials(cli_credentials *self){
- talloc_free(self);
- }
+SWIGINTERN void delete_cli_credentials(cli_credentials *self){ talloc_free(self); }
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
char *arg4 = (char *) 0 ;
uint32_t arg5 ;
struct cli_credentials *arg6 = (struct cli_credentials *) 0 ;
+ struct loadparm_context *arg7 = (struct loadparm_context *) 0 ;
NTSTATUS result;
struct dcerpc_pipe *temp_dcerpc_pipe2 ;
int res3 ;
int res5 = 0 ;
void *argp6 = 0 ;
int res6 = 0 ;
+ void *argp7 = 0 ;
+ int res7 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
char * kwnames[] = {
- (char *) "binding",(char *) "pipe_uuid",(char *) "pipe_version",(char *) "credentials", NULL
+ (char *) "binding",(char *) "pipe_uuid",(char *) "pipe_version",(char *) "credentials",(char *) "lp_ctx", NULL
};
{
{
arg2 = &temp_dcerpc_pipe2;
}
- if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:pipe_connect",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OO:pipe_connect",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
res3 = SWIG_AsCharPtrAndSize(obj0, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pipe_connect" "', argument " "3"" of type '" "char const *""'");
}
arg6 = (struct cli_credentials *)(argp6);
}
- result = dcerpc_pipe_connect(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6);
+ if (obj4) {
+ res7 = SWIG_ConvertPtr(obj4, &argp7,SWIGTYPE_p_loadparm_context, 0 | 0 );
+ if (!SWIG_IsOK(res7)) {
+ SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "pipe_connect" "', argument " "7"" of type '" "struct loadparm_context *""'");
+ }
+ arg7 = (struct loadparm_context *)(argp7);
+ }
+ result = dcerpc_pipe_connect(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7);
resultobj = SWIG_NewPointerObj((NTSTATUS *)memcpy((NTSTATUS *)malloc(sizeof(NTSTATUS)),&result,sizeof(NTSTATUS)), SWIGTYPE_p_NTSTATUS, SWIG_POINTER_OWN | 0 );
{
/* Set REF_ALLOC flag so we don't have to do too much extra
status = dcerpc_pipe_connect(private,
&(private->c_pipe), binding, table,
- credentials, dce_call->event_ctx);
+ credentials, dce_call->event_ctx,
+ dce_call->conn->dce_ctx->lp_ctx);
talloc_free(credentials);
if (!NT_STATUS_IS_OK(status)) {
creds = cli_credentials_init_anon(mem_ctx); /* FIXME: Use machine credentials instead ? */
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_spoolss,
- creds, NULL);
+ creds, NULL, dce_call->conn->dce_ctx->lp_ctx);
if (NT_STATUS_IS_ERR(status)) {
DEBUG(0, ("unable to call back to %s\n", r->in.str));
}
ev = event_context_find(event_mem_ctx);
- ctx = libnet_context_init(ev);
+ ctx = libnet_context_init(ev, global_loadparm);
/* IF we generated a new event context, it will be under here,
* and we need it to last as long as the libnet context, so
* make it a child */
ev = event_context_find(mprMemCtx());
- status = dcerpc_pipe_connect(this, &p, binding, iface, creds, ev);
+ status = dcerpc_pipe_connect(this, &p, binding, iface, creds, ev,
+ global_loadparm);
if (!NT_STATUS_IS_OK(status)) goto done;
/* callers don't allocate ref vars in the ejs interface */
mem_ctx = talloc_init("test_domain_open");
evt_ctx = event_context_find(torture);
- net_ctx = libnet_context_init(evt_ctx);
+ net_ctx = libnet_context_init(evt_ctx, torture->lp_ctx);
status = torture_rpc_connection(torture,
&net_ctx->samr.pipe,
DEBUG(0,("Open the SAM LDB with system credentials: %s\n",
s->path.samdb_ldb));
- s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
- system_session(s, global_loadparm),
+ s->ldb = ldb_wrap_connect(s, s->tctx->lp_ctx, s->path.samdb_ldb,
+ system_session(s, s->tctx->lp_ctx),
NULL, 0, NULL);
if (!s->ldb) {
DEBUG(0,("Failed to open '%s'\n",
return false;
}
- s->ctx = libnet_context_init(torture->ev);
+ s->ctx = libnet_context_init(torture->ev, torture->lp_ctx);
s->ctx->cred = cmdline_credentials;
s->ldb = ldb_init(s);
of specific server name. */
domain_name = lp_workgroup(torture->lp_ctx);
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
if (ctx == NULL) {
d_printf("failed to create libnet context\n");
return false;
return false;
}
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
if (ctx == NULL) {
d_printf("failed to create libnet context\n");
ret = false;
mem_ctx = talloc_init("torture_domain_close_lsa");
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_lsarpc,
- cmdline_credentials, NULL);
+ cmdline_credentials, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
d_printf("failed to connect to server: %s\n", nt_errstr(status));
ret = false;
mem_ctx = talloc_init("test_domainopen_lsa");
- ctx = libnet_context_init(evt_ctx);
+ ctx = libnet_context_init(evt_ctx, torture->lp_ctx);
ctx->cred = cmdline_credentials;
/* we're accessing domain controller so the domain name should be
return false;
}
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
if (ctx == NULL) {
d_printf("failed to create libnet context\n");
ret = false;
mem_ctx = talloc_init("torture_domain_close_samr");
status = dcerpc_pipe_connect_b(mem_ctx, &p, binding, &ndr_table_samr,
- ctx->cred, NULL);
+ ctx->cred, NULL, torture->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
d_printf("failed to connect to server: %s\n", nt_errstr(status));
ret = false;
return false;
}
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
if (ctx == NULL) {
d_printf("failed to create libnet context\n");
ret = false;
prep_mem_ctx = talloc_init("prepare torture group info");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
status = torture_rpc_connection(torture,
mem_ctx = talloc_init("test_lookup");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
lookup.in.hostname = torture_setting_string(torture, "host", NULL);
mem_ctx = talloc_init("test_lookup_host");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
lookup.in.hostname = torture_setting_string(torture, "host", NULL);
mem_ctx = talloc_init("test_lookup_pdc");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
talloc_steal(ctx, mem_ctx);
struct libnet_context *ctx;
struct libnet_LookupName r;
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
mem_ctx = talloc_init("torture lookup sam name");
{
struct libnet_context *ctx;
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
d_printf("Testing connection to LSA interface\n");
goto done;
}
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, torture->lp_ctx);
if (!libnetctx) {
printf("Couldn't allocate libnet context\n");
ret = false;
status = torture_rpc_binding(torture, &bind);
torture_assert_ntstatus_ok(torture, status, "Failed to get binding");
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, torture->lp_ctx);
libnetctx->cred = cmdline_credentials;
status = torture_rpc_connection(torture,
mem_ctx = talloc_init("test_createuser");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
req.in.user_name = TEST_USERNAME;
prep_mem_ctx = talloc_init("prepare test_deleteuser");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
req.in.user_name = TEST_USERNAME;
prep_mem_ctx = talloc_init("prepare test_deleteuser");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
status = torture_rpc_connection(torture,
prep_mem_ctx = talloc_init("prepare torture user info");
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
status = torture_rpc_connection(torture,
struct libnet_UserList req;
int i;
- ctx = libnet_context_init(NULL);
+ ctx = libnet_context_init(NULL, torture->lp_ctx);
ctx->cred = cmdline_credentials;
domain_name.string = lp_workgroup(torture->lp_ctx);
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 */
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",
}\
static bool test_NetShareAdd(TALLOC_CTX *mem_ctx,
+ struct torture_context *tctx,
const char *host,
const char *sharename,
const char *dir)
printf("Creating share %s\n", sharename);
- if (!(libnetctx = libnet_context_init(NULL))) {
+ if (!(libnetctx = libnet_context_init(NULL, tctx->lp_ctx))) {
return false;
}
}
static bool test_NetShareDel(TALLOC_CTX *mem_ctx,
+ struct torture_context *tctx,
const char *host,
const char *sharename)
{
printf("Deleting share %s\n", sharename);
- if (!(libnetctx = libnet_context_init(NULL))) {
+ if (!(libnetctx = libnet_context_init(NULL, tctx->lp_ctx))) {
return false;
}
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);
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);
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));
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));
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",
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;
&(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");
&(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");
#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
*/
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;
}
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;
}
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));
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:
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,
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",
*/
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,
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,
*/
static bool delete_user(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *admin_creds,
const char *username)
{
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,
*/
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)
}
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$",
*/
static bool schan(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *wks_creds,
struct cli_credentials *user_creds)
{
#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
*/
static bool leave(struct smbcli_state *cli,
+ struct loadparm_context *lp_ctx,
struct cli_credentials *admin_creds,
struct cli_credentials *wks_creds)
{
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
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)) {
}
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;
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));
/* 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)) {
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);
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));
&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));
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));
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");
* 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);
"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,
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);
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");
"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,
/* 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);
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),
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;
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)) {
&join->p,
dc_binding,
&ndr_table_samr,
- cmdline_credentials, NULL);
+ cmdline_credentials, NULL, torture->lp_ctx);
} else {
status = torture_rpc_connection(torture,
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;
domain_name = tmp;
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
new_password = getpass(password_prompt);
}
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
new_password = getpass(password_prompt);
}
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
return net_time_usage(ctx, argc, argv);
}
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
}
/* libnet context init and its params */
- lnet_ctx = libnet_context_init(NULL);
+ lnet_ctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!lnet_ctx) return -1;
lnet_ctx->cred = ctx->credentials;
}
/* libnet context init and its params */
- lnet_ctx = libnet_context_init(NULL);
+ lnet_ctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!lnet_ctx) return -1;
lnet_ctx->cred = ctx->credentials;
break;
}
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
return rc;
}
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
struct libnet_context *libnetctx;
struct libnet_samsync_ldb r;
- libnetctx = libnet_context_init(NULL);
+ libnetctx = libnet_context_init(NULL, ctx->lp_ctx);
if (!libnetctx) {
return -1;
}
ctx = dcerpc_secondary_auth_connection_send(domain->netlogon_pipe,
domain->samr_binding,
&ndr_table_samr,
- domain->libnet_ctx->cred);
+ domain->libnet_ctx->cred,
+ domain->libnet_ctx->lp_ctx);
composite_continue(state->ctx, ctx, connect_samr_recv_pipe, state);
return result;
binding->host = state->domain->dc_address;
/* This shouldn't make a network call, as the mappings for named pipes are well known */
- status = dcerpc_epm_map_binding(binding, binding, table, state->service->task->event_ctx);
+ status = dcerpc_epm_map_binding(binding, binding, table, state->service->task->event_ctx,
+ state->service->task->lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
}
state->domain->dc_name = dom_info->dcs[0].name;
state->domain->dc_address = dom_info->dcs[0].address;
- state->domain->libnet_ctx = libnet_context_init(service->task->event_ctx);
+ state->domain->libnet_ctx = libnet_context_init(service->task->event_ctx,
+ service->task->lp_ctx);
/* Create a credentials structure */
state->domain->libnet_ctx->cred = cli_credentials_init(state->domain);
ctx = dcerpc_pipe_connect_b_send(state, state->domain->netlogon_binding,
&ndr_table_netlogon,
state->domain->libnet_ctx->cred,
- service->task->event_ctx);
+ service->task->event_ctx,
+ service->task->lp_ctx);
if (composite_nomem(ctx, state->ctx)) {
goto failed;
ctx = dcerpc_secondary_auth_connection_send(state->domain->netlogon_pipe,
state->domain->lsa_binding,
&ndr_table_lsarpc,
- state->domain->libnet_ctx->cred
+ state->domain->libnet_ctx->cred,
+ state->domain->libnet_ctx->lp_ctx
);
composite_continue(state->ctx, ctx, init_domain_recv_lsa_pipe, state);
}
ctx = dcerpc_secondary_auth_connection_send(state->domain->netlogon_pipe,
binding,
table,
- state->domain->libnet_ctx->cred);
+ state->domain->libnet_ctx->cred,
+ state->domain->libnet_ctx->lp_ctx);
composite_continue(state->ctx, ctx, continuation, state);
return true;
} else {