From 7a554ee7dcefdff599ebc6fbf4e128b33ffccf29 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 18 Aug 2017 16:08:46 +0200 Subject: [PATCH] s3:libsmb: Pass domain to remote_password_change() BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlet --- source3/include/proto.h | 3 ++- source3/libsmb/passchange.c | 5 +++-- source3/utils/smbpasswd.c | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index c8f6c282b68..976f3f92156 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -823,7 +823,8 @@ bool get_dc_name(const char *domain, /* The following definitions come from libsmb/passchange.c */ -NTSTATUS remote_password_change(const char *remote_machine, const char *user_name, +NTSTATUS remote_password_change(const char *remote_machine, + const char *domain, const char *user_name, const char *old_passwd, const char *new_passwd, char **err_str); diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index c89b7ca85d1..48ffba8036f 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -30,7 +30,8 @@ Change a password on a remote machine using IPC calls. *************************************************************/ -NTSTATUS remote_password_change(const char *remote_machine, const char *user_name, +NTSTATUS remote_password_change(const char *remote_machine, + const char *domain, const char *user_name, const char *old_passwd, const char *new_passwd, char **err_str) { @@ -55,7 +56,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam creds = cli_session_creds_init(cli, user_name, - NULL, /* domain */ + domain, NULL, /* realm */ old_passwd, false, /* use_kerberos */ diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index ae9862606f1..00d2acf2a5f 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -258,7 +258,8 @@ static NTSTATUS password_change(const char *remote_mach, char *username, fprintf(stderr, "Invalid remote operation!\n"); return NT_STATUS_UNSUCCESSFUL; } - ret = remote_password_change(remote_mach, username, + ret = remote_password_change(remote_mach, + NULL, username, old_passwd, new_pw, &err_str); } else { ret = local_password_change(username, local_flags, new_pw, -- 2.11.4.GIT