summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-09-21 20:56:23 -0700
committerGünther Deschner <gd@samba.org>2010-09-23 10:26:25 -0700
commitffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227 (patch)
tree536860be90ee3531863894f87e5c24b1cb523702 /source3/lib
parentc3f5d990652aec4b4f1f23a5e1c7b644cd46cbe7 (diff)
downloadsamba-ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227.tar.gz
samba-ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227.tar.bz2
samba-ffdfcfb514c1a0849ba334ae6b9b00d3ad3c2227.zip
s3-dsgetdcname: always pass in messaging context.
Volker, please check. Guenther
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/netapi/getdc.c6
-rw-r--r--source3/lib/netapi/joindomain.c18
-rw-r--r--source3/lib/netapi/netapi_private.h2
3 files changed, 22 insertions, 4 deletions
diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c
index 565ccbc14b..904270242a 100644
--- a/source3/lib/netapi/getdc.c
+++ b/source3/lib/netapi/getdc.c
@@ -112,9 +112,13 @@ WERROR DsGetDcName_l(struct libnetapi_ctx *ctx,
struct DsGetDcName *r)
{
NTSTATUS status;
+ struct libnetapi_private_ctx *priv;
+
+ priv = talloc_get_type_abort(ctx->private_data,
+ struct libnetapi_private_ctx);
status = dsgetdcname(ctx,
- NULL,
+ priv->msg_ctx,
r->in.domain_name,
r->in.domain_guid,
r->in.site_name,
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 89a7c93d5e..e5777a0d33 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -36,8 +36,12 @@ WERROR NetJoinDomain_l(struct libnetapi_ctx *mem_ctx,
struct NetJoinDomain *r)
{
struct libnet_JoinCtx *j = NULL;
+ struct libnetapi_private_ctx *priv;
WERROR werr;
+ priv = talloc_get_type_abort(mem_ctx->private_data,
+ struct libnetapi_private_ctx);
+
if (!r->in.domain) {
return WERR_INVALID_PARAM;
}
@@ -55,7 +59,7 @@ WERROR NetJoinDomain_l(struct libnetapi_ctx *mem_ctx,
uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED |
DS_WRITABLE_REQUIRED |
DS_RETURN_DNS_NAME;
- status = dsgetdcname(mem_ctx, NULL, r->in.domain,
+ status = dsgetdcname(mem_ctx, priv->msg_ctx, r->in.domain,
NULL, NULL, flags, &info);
if (!NT_STATUS_IS_OK(status)) {
libnetapi_set_error_string(mem_ctx,
@@ -154,6 +158,10 @@ WERROR NetUnjoinDomain_l(struct libnetapi_ctx *mem_ctx,
struct dom_sid domain_sid;
const char *domain = NULL;
WERROR werr;
+ struct libnetapi_private_ctx *priv;
+
+ priv = talloc_get_type_abort(mem_ctx->private_data,
+ struct libnetapi_private_ctx);
if (!secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
return WERR_SETUP_NOT_JOINED;
@@ -178,7 +186,7 @@ WERROR NetUnjoinDomain_l(struct libnetapi_ctx *mem_ctx,
uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED |
DS_WRITABLE_REQUIRED |
DS_RETURN_DNS_NAME;
- status = dsgetdcname(mem_ctx, NULL, domain,
+ status = dsgetdcname(mem_ctx, priv->msg_ctx, domain,
NULL, NULL, flags, &info);
if (!NT_STATUS_IS_OK(status)) {
libnetapi_set_error_string(mem_ctx,
@@ -348,8 +356,12 @@ WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx,
const char *dc = NULL;
uint32_t flags = DS_DIRECTORY_SERVICE_REQUIRED |
DS_RETURN_DNS_NAME;
+ struct libnetapi_private_ctx *priv;
+
+ priv = talloc_get_type_abort(ctx->private_data,
+ struct libnetapi_private_ctx);
- status = dsgetdcname(ctx, NULL, r->in.domain,
+ status = dsgetdcname(ctx, priv->msg_ctx, r->in.domain,
NULL, NULL, flags, &info);
if (!NT_STATUS_IS_OK(status)) {
libnetapi_set_error_string(ctx, "%s",
diff --git a/source3/lib/netapi/netapi_private.h b/source3/lib/netapi/netapi_private.h
index d0f7756d16..859c064223 100644
--- a/source3/lib/netapi/netapi_private.h
+++ b/source3/lib/netapi/netapi_private.h
@@ -44,6 +44,8 @@ struct libnetapi_private_ctx {
} samr;
struct client_ipc_connection *ipc_connections;
+
+ struct messaging_context *msg_ctx;
};
NET_API_STATUS libnetapi_get_password(struct libnetapi_ctx *ctx, char **password);