summaryrefslogtreecommitdiff
path: root/source4/lib/com/dcom
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/com/dcom')
-rw-r--r--source4/lib/com/dcom/dcom.h4
-rw-r--r--source4/lib/com/dcom/main.c20
2 files changed, 7 insertions, 17 deletions
diff --git a/source4/lib/com/dcom/dcom.h b/source4/lib/com/dcom/dcom.h
index 668d952124..1e15daf830 100644
--- a/source4/lib/com/dcom/dcom.h
+++ b/source4/lib/com/dcom/dcom.h
@@ -22,9 +22,7 @@
#define _DCOM_H
struct dcom_client_context {
- const char *domain;
- const char *user;
- const char *password;
+ struct cli_credentials *credentials;
struct dcom_object_exporter {
uint64_t oxid;
struct DUALSTRINGARRAY bindings;
diff --git a/source4/lib/com/dcom/main.c b/source4/lib/com/dcom/main.c
index d3d44edc71..be350c32f5 100644
--- a/source4/lib/com/dcom/main.c
+++ b/source4/lib/com/dcom/main.c
@@ -30,12 +30,10 @@
#define DCOM_NEGOTIATED_PROTOCOLS { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB, EPM_PROTOCOL_NCALRPC }
-struct dcom_client_context *dcom_client_init(struct com_context *ctx, const char *domain, const char *user, const char *password)
+struct dcom_client_context *dcom_client_init(struct com_context *ctx, struct cli_credentials *credentials)
{
ctx->dcom = talloc(ctx, struct dcom_client_context);
- ctx->dcom->domain = domain;
- ctx->dcom->user = user;
- ctx->dcom->password = password;
+ ctx->dcom->credentials = credentials;
return ctx->dcom;
}
@@ -86,8 +84,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, struct dcerpc_pipe **
return dcerpc_pipe_connect(p, "ncalrpc",
DCERPC_IREMOTEACTIVATION_UUID,
DCERPC_IREMOTEACTIVATION_VERSION,
- lp_netbios_name(),
- ctx->dcom->domain, ctx->dcom->user, ctx->dcom->password);
+ ctx->dcom->credentials);
}
/* Allow server name to contain a binding string */
@@ -95,8 +92,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, struct dcerpc_pipe **
status = dcerpc_pipe_connect_b(p, bd,
DCERPC_IREMOTEACTIVATION_UUID,
DCERPC_IREMOTEACTIVATION_VERSION,
- lp_netbios_name(),
- ctx->dcom->domain, ctx->dcom->user, ctx->dcom->password);
+ ctx->dcom->credentials);
talloc_free(mem_ctx);
return status;
@@ -113,8 +109,7 @@ static NTSTATUS dcom_connect_host(struct com_context *ctx, struct dcerpc_pipe **
status = dcerpc_pipe_connect(p, binding,
DCERPC_IREMOTEACTIVATION_UUID,
DCERPC_IREMOTEACTIVATION_VERSION,
- lp_netbios_name(),
- ctx->dcom->domain, ctx->dcom->user, ctx->dcom->password);
+ ctx->dcom->credentials);
if (NT_STATUS_IS_OK(status)) {
talloc_free(mem_ctx);
@@ -308,10 +303,7 @@ NTSTATUS dcom_get_pipe (struct IUnknown *iface, struct dcerpc_pipe **pp)
} else {
status = dcerpc_pipe_connect_b(&p, binding,
uuid, 0.0,
- lp_netbios_name(),
- iface->ctx->dcom->domain,
- iface->ctx->dcom->user,
- iface->ctx->dcom->password);
+ iface->ctx->dcom->credentials);
}
talloc_free(binding);
i++;