summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libnet/libnet_proto.h1
-rw-r--r--source3/libnet/libnet_samsync.c4
-rw-r--r--source3/libnet/libnet_samsync.h1
-rw-r--r--source3/utils/net_rpc_samsync.c3
4 files changed, 9 insertions, 0 deletions
diff --git a/source3/libnet/libnet_proto.h b/source3/libnet/libnet_proto.h
index eeb4a72644..b30b94a54b 100644
--- a/source3/libnet/libnet_proto.h
+++ b/source3/libnet/libnet_proto.h
@@ -52,6 +52,7 @@ NTSTATUS samsync_fix_delta_array(TALLOC_CTX *mem_ctx,
struct netr_DELTA_ENUM_ARRAY *r);
NTSTATUS samsync_init_context(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
+ const char *domain_name,
enum net_samsync_mode mode,
struct samsync_context **ctx_p);
NTSTATUS samsync_process_database(struct rpc_pipe_client *pipe_hnd,
diff --git a/source3/libnet/libnet_samsync.c b/source3/libnet/libnet_samsync.c
index 3c6a87a495..b5632aed69 100644
--- a/source3/libnet/libnet_samsync.c
+++ b/source3/libnet/libnet_samsync.c
@@ -193,6 +193,7 @@ NTSTATUS samsync_fix_delta_array(TALLOC_CTX *mem_ctx,
NTSTATUS samsync_init_context(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
+ const char *domain_name,
enum net_samsync_mode mode,
struct samsync_context **ctx_p)
{
@@ -205,6 +206,9 @@ NTSTATUS samsync_init_context(TALLOC_CTX *mem_ctx,
ctx->mode = mode;
+ ctx->domain_name = talloc_strdup(mem_ctx, domain_name);
+ NT_STATUS_HAVE_NO_MEMORY(ctx->domain_name);
+
if (domain_sid) {
ctx->domain_sid = sid_dup_talloc(mem_ctx, domain_sid);
NT_STATUS_HAVE_NO_MEMORY(ctx->domain_sid);
diff --git a/source3/libnet/libnet_samsync.h b/source3/libnet/libnet_samsync.h
index 38ef9c56a5..1e3995614f 100644
--- a/source3/libnet/libnet_samsync.h
+++ b/source3/libnet/libnet_samsync.h
@@ -28,6 +28,7 @@ struct samsync_context {
enum net_samsync_mode mode;
const struct dom_sid *domain_sid;
const char *domain_sid_str;
+ const char *domain_name;
const char *output_filename;
void *private_data;
};
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index 90637e294d..797598c48e 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -354,6 +354,7 @@ NTSTATUS rpc_samdump_internals(struct net_context *c,
status = samsync_init_context(mem_ctx,
domain_sid,
+ domain_name,
NET_SAMSYNC_MODE_DUMP,
&ctx);
if (!NT_STATUS_IS_OK(status)) {
@@ -1173,6 +1174,7 @@ NTSTATUS rpc_vampire_internals(struct net_context *c,
result = samsync_init_context(mem_ctx,
domain_sid,
+ domain_name,
NET_SAMSYNC_MODE_FETCH_PASSDB,
&ctx);
if (!NT_STATUS_IS_OK(result)) {
@@ -1237,6 +1239,7 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c,
status = samsync_init_context(mem_ctx,
domain_sid,
+ domain_name,
NET_SAMSYNC_MODE_FETCH_LDIF,
&ctx);
if (!NT_STATUS_IS_OK(status)) {