s3:libsmb: Pass domain to remote_password_change()
authorAndreas Schneider <asn@samba.org>
Fri, 18 Aug 2017 14:08:46 +0000 (16:08 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 23 Aug 2017 11:16:20 +0000 (13:16 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
source3/include/proto.h
source3/libsmb/passchange.c
source3/utils/smbpasswd.c

index c8f6c282b6865cd26dde45c6ca76ffa5efb38470..976f3f921566cd28caca12cca54bf51663b0521e 100644 (file)
@@ -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);
 
index c89b7ca85d19f0ec80ed0aec0ba9fd883c3eb837..48ffba8036f5be4b2be8de2e1d49a0ef08a4e913 100644 (file)
@@ -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 */
index ae9862606f1884e747a89e1d4c5ba45440c32872..00d2acf2a5f8589ee2368f8bdf9a9ca2b2d08eac 100644 (file)
@@ -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,