summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc.i3
-rw-r--r--source4/librpc/rpc/dcerpc_auth.c6
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c28
-rw-r--r--source4/librpc/rpc/dcerpc_schannel.c7
-rw-r--r--source4/librpc/rpc/dcerpc_secondary.c8
-rw-r--r--source4/librpc/rpc/dcerpc_util.c32
-rw-r--r--source4/librpc/rpc/dcerpc_wrap.c21
7 files changed, 70 insertions, 35 deletions
diff --git a/source4/librpc/rpc/dcerpc.i b/source4/librpc/rpc/dcerpc.i
index 4a58b43085..862ba7d1b2 100644
--- a/source4/librpc/rpc/dcerpc.i
+++ b/source4/librpc/rpc/dcerpc.i
@@ -68,7 +68,8 @@ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_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);
diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c
index 0012b38f2e..f80ef86413 100644
--- a/source4/librpc/rpc/dcerpc_auth.c
+++ b/source4/librpc/rpc/dcerpc_auth.c
@@ -212,6 +212,7 @@ struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx,
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)
{
@@ -240,7 +241,7 @@ struct composite_context *dcerpc_bind_auth_send(TALLOC_CTX *mem_ctx,
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)));
@@ -374,11 +375,12 @@ NTSTATUS dcerpc_bind_auth_recv(struct composite_context *creq)
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);
}
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index b9913106f0..c39a944fdb 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -468,6 +468,7 @@ struct pipe_connect_state {
struct dcerpc_binding *binding;
const struct ndr_interface_table *table;
struct cli_credentials *credentials;
+ struct loadparm_context *lp_ctx;
};
@@ -663,7 +664,7 @@ static void continue_pipe_connect(struct composite_context *c, struct pipe_conne
}
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);
}
@@ -703,7 +704,8 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
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;
@@ -735,6 +737,7 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
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),
@@ -744,7 +747,8 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
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;
}
@@ -755,7 +759,8 @@ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
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;
}
@@ -799,12 +804,13 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
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);
}
@@ -826,7 +832,7 @@ struct composite_context* dcerpc_pipe_connect_send(TALLOC_CTX *parent_ctx,
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;
@@ -867,7 +873,7 @@ struct composite_context* dcerpc_pipe_connect_send(TALLOC_CTX *parent_ctx,
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;
}
@@ -922,12 +928,12 @@ NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
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);
}
diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c
index c6b3a5fc0f..fadf0add8c 100644
--- a/source4/librpc/rpc/dcerpc_schannel.c
+++ b/source4/librpc/rpc/dcerpc_schannel.c
@@ -286,6 +286,7 @@ struct auth_schannel_state {
struct dcerpc_pipe *pipe;
struct cli_credentials *credentials;
const struct ndr_interface_table *table;
+ struct loadparm_context *lp_ctx;
uint8_t auth_level;
};
@@ -315,6 +316,7 @@ static void continue_schannel_key(struct composite_context *ctx)
/* 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;
@@ -346,6 +348,7 @@ struct composite_context *dcerpc_bind_auth_schannel_send(TALLOC_CTX *tmp_ctx,
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;
@@ -365,6 +368,7 @@ struct composite_context *dcerpc_bind_auth_schannel_send(TALLOC_CTX *tmp_ctx,
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);
@@ -394,11 +398,12 @@ NTSTATUS dcerpc_bind_auth_schannel(TALLOC_CTX *tmp_ctx,
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);
}
diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c
index 4d3547b60c..1c4de0a2f2 100644
--- a/source4/librpc/rpc/dcerpc_secondary.c
+++ b/source4/librpc/rpc/dcerpc_secondary.c
@@ -226,6 +226,7 @@ struct sec_auth_conn_state {
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);
@@ -234,7 +235,8 @@ static void dcerpc_secondary_auth_connection_continue(struct composite_context *
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;
@@ -252,6 +254,7 @@ struct composite_context* dcerpc_secondary_auth_connection_send(struct dcerpc_pi
s->binding = binding;
s->table = table;
s->credentials = credentials;
+ s->lp_ctx = lp_ctx;
secondary_conn_ctx = dcerpc_secondary_connection_send(p, binding);
@@ -278,7 +281,8 @@ static void dcerpc_secondary_auth_connection_bind(struct composite_context *ctx)
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);
}
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 6c23ec20a0..32cee4308e 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -895,7 +895,8 @@ static void continue_epm_map(struct rpc_request *req)
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;
@@ -984,7 +985,8 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
/* 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);
@@ -1008,11 +1010,12 @@ NTSTATUS dcerpc_epm_map_binding_recv(struct composite_context *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);
}
@@ -1021,6 +1024,7 @@ struct pipe_auth_state {
struct dcerpc_pipe *pipe;
struct dcerpc_binding *binding;
const struct ndr_interface_table *table;
+ struct loadparm_context *lp_ctx;
struct cli_credentials *credentials;
};
@@ -1124,7 +1128,8 @@ static void continue_ntlmssp_connection(struct composite_context *ctx)
/* 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);
@@ -1155,7 +1160,7 @@ static void continue_spnego_after_wrong_pass(struct composite_context *ctx)
/* 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);
@@ -1184,7 +1189,8 @@ static void continue_auth_none(struct composite_context *ctx)
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;
@@ -1207,6 +1213,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
s->table = table;
s->credentials = credentials;
s->pipe = p;
+ s->lp_ctx = lp_ctx;
conn = s->pipe->conn;
conn->flags = binding->flags;
@@ -1226,7 +1233,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
* 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;
@@ -1272,7 +1279,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
} 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);
@@ -1280,7 +1287,7 @@ struct composite_context *dcerpc_pipe_auth_send(struct dcerpc_pipe *p,
}
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);
@@ -1326,11 +1333,12 @@ NTSTATUS dcerpc_pipe_auth(TALLOC_CTX *mem_ctx,
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);
}
diff --git a/source4/librpc/rpc/dcerpc_wrap.c b/source4/librpc/rpc/dcerpc_wrap.c
index 48dd3b30a8..c9eb72fb9e 100644
--- a/source4/librpc/rpc/dcerpc_wrap.c
+++ b/source4/librpc/rpc/dcerpc_wrap.c
@@ -2523,9 +2523,7 @@ typedef struct cli_credentials cli_credentials;
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)
@@ -3550,6 +3548,7 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
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 ;
@@ -3562,12 +3561,15 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
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
};
{
@@ -3579,7 +3581,7 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
{
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 *""'");
@@ -3608,7 +3610,14 @@ SWIGINTERN PyObject *_wrap_pipe_connect(PyObject *SWIGUNUSEDPARM(self), PyObject
}
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