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 c8f6c28..976f3f9 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 c89b7ca..48ffba8 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 ae98626..00d2acf 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,