summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-05-22 15:36:29 +0200
committerStefan Metzmacher <metze@samba.org>2017-07-13 20:01:28 +0200
commitd41f361e86c61929cf02e9465a7b81c56c4d4215 (patch)
treeb87061b1199af3ffb417ea1846f2a5fbc04b2309
parent324af7571c9fe96c77ff3dce1adcceb2870a53ab (diff)
downloadsamba-d41f361e86c61929cf02e9465a7b81c56c4d4215.tar.gz
s3:trusts_util: pass dcname to trust_pw_change()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 1421abfc733247a6b71eefd819dfeae7151a6d78)
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/libsmb/trusts_util.c1
-rw-r--r--source3/rpcclient/cmd_netlogon.c2
-rw-r--r--source3/utils/net_rpc.c8
-rw-r--r--source3/winbindd/winbindd_dual.c1
-rw-r--r--source3/winbindd/winbindd_dual_srv.c2
6 files changed, 15 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c18e88f663d..baa579995a5 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -869,6 +869,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
struct messaging_context *msg_ctx,
struct dcerpc_binding_handle *b,
const char *domain,
+ const char *dcname,
bool force);
/* The following definitions come from param/loadparm.c */
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 2cc6264c905..47b79b73369 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -107,6 +107,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
struct messaging_context *msg_ctx,
struct dcerpc_binding_handle *b,
const char *domain,
+ const char *dcname,
bool force)
{
TALLOC_CTX *frame = talloc_stackframe();
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index f65717287f4..7d12f17943a 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -831,6 +831,7 @@ static NTSTATUS cmd_netlogon_change_trust_pw(struct rpc_pipe_client *cli,
const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ const char *dcname = cli->desthost;
/* Check arguments */
@@ -843,6 +844,7 @@ static NTSTATUS cmd_netlogon_change_trust_pw(struct rpc_pipe_client *cli,
rpcclient_msg_ctx,
cli->binding_handle,
lp_workgroup(),
+ dcname,
true); /* force */
if (!NT_STATUS_IS_OK(result))
goto done;
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 17b3e4dec30..c179cc2e54f 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -279,11 +279,19 @@ static NTSTATUS rpc_changetrustpw_internals(struct net_context *c,
const char **argv)
{
NTSTATUS status;
+ const char *dcname = NULL;
+
+ if (cli == NULL) {
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
+ dcname = smbXcli_conn_remote_name(cli->conn);
status = trust_pw_change(c->netlogon_creds,
c->msg_ctx,
pipe_hnd->binding_handle,
c->opt_target_workgroup,
+ dcname,
true); /* force */
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, _("Failed to change machine account password: %s\n"),
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index c389e0013ad..8636ccd7e0a 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1095,6 +1095,7 @@ static void machine_password_change_handler(struct tevent_context *ctx,
msg_ctx,
netlogon_pipe->binding_handle,
child->domain->name,
+ child->domain->dcname,
false); /* force */
DEBUG(10, ("machine_password_change_handler: "
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index 52e86291dc1..0a2a5e27f8f 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -730,6 +730,7 @@ NTSTATUS _wbint_ChangeMachineAccount(struct pipes_struct *p,
msg_ctx,
netlogon_pipe->binding_handle,
domain->name,
+ domain->dcname,
true); /* force */
/* Pass back result code - zero for success, other values for
@@ -1406,6 +1407,7 @@ reconnect:
status = trust_pw_change(domain->conn.netlogon_creds,
msg_ctx, b, domain->name,
+ domain->dcname,
true); /* force */
if (!NT_STATUS_IS_OK(status)) {
if (!retry && dcerpc_binding_handle_is_connected(b)) {