s3-netlogon: pass down account name to remote password set functions.
authorGünther Deschner <gd@samba.org>
Wed, 7 Oct 2009 22:34:05 +0000 (00:34 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 12 Oct 2009 22:07:45 +0000 (00:07 +0200)
Guenther

source3/include/proto.h
source3/libnet/libnet_join.c
source3/libsmb/trusts_util.c
source3/rpc_client/cli_netlogon.c
source3/utils/net_rpc.c

index a75904248a4d3b277de8a5d4b72e82a22a6ea090..7e31da064fabc12ae2a3ff0d3dcfb3ffe8f8ed45 100644 (file)
@@ -3307,6 +3307,7 @@ void update_trustdom_cache( void );
 
 NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, 
                                      const char *domain,
+                                     const char *account_name,
                                      unsigned char orig_trust_passwd_hash[16],
                                      uint32 sec_channel_type);
 NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli, 
@@ -5238,6 +5239,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
                                              struct netr_SamInfo3 **info3);
 NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
+                                           const char *account_name,
                                            const unsigned char orig_trust_passwd_hash[16],
                                            const char *new_trust_pwd_cleartext,
                                            const unsigned char new_trust_passwd_hash[16],
index 8c3030711bf55d012066f68fe941cd381a24494e..aa5f54adaf6035fd7bcfb3934c1a102ee51fc4c8 100644 (file)
@@ -789,6 +789,7 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx,
        E_md4hash(trust_passwd, orig_trust_passwd_hash);
 
        status = rpccli_netlogon_set_trust_password(pipe_hnd, mem_ctx,
+                                                   r->in.machine_name,
                                                    orig_trust_passwd_hash,
                                                    r->in.machine_password,
                                                    new_trust_passwd_hash,
index adf15258122d6cb08f0ff881d1a1b855ba967645..e201814163233b7eb43dca2d94d9b50f71168d77 100644 (file)
@@ -29,6 +29,7 @@
 
 NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, 
                                      const char *domain,
+                                     const char *account_name,
                                      unsigned char orig_trust_passwd_hash[16],
                                      uint32 sec_channel_type)
 {
@@ -47,6 +48,7 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
        E_md4hash(new_trust_passwd, new_trust_passwd_hash);
 
        nt_status = rpccli_netlogon_set_trust_password(cli, mem_ctx,
+                                                      account_name,
                                                       orig_trust_passwd_hash,
                                                       new_trust_passwd,
                                                       new_trust_passwd_hash,
@@ -88,6 +90,7 @@ NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli,
        }
 
        return trust_pw_change_and_store_it(cli, mem_ctx, domain,
+                                           global_myname(),
                                            old_trust_passwd_hash,
                                            sec_channel_type);
 }
index 6caffd74a679abafee545a4a830bc7a40a750d78..5e116c95deecea6182d9be32eefd613a6093f87c 100644 (file)
@@ -509,6 +509,7 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
 
 NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                                            TALLOC_CTX *mem_ctx,
+                                           const char *account_name,
                                            const unsigned char orig_trust_passwd_hash[16],
                                            const char *new_trust_pwd_cleartext,
                                            const unsigned char new_trust_passwd_hash[16],
@@ -523,7 +524,7 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                                                     cli->desthost, /* server name */
                                                     lp_workgroup(), /* domain */
                                                     global_myname(), /* client name */
-                                                    global_myname(), /* machine account name */
+                                                    account_name, /* machine account name */
                                                     orig_trust_passwd_hash,
                                                     sec_channel_type,
                                                     &neg_flags);
index c3d002c1b104c8675800bdabeb2dd0e8de602267..896ea8cc653217646f1172edb86089c86c41ca63 100644 (file)
@@ -344,6 +344,7 @@ static NTSTATUS rpc_oldjoin_internals(struct net_context *c,
        E_md4hash(trust_passwd, orig_trust_passwd_hash);
 
        result = trust_pw_change_and_store_it(pipe_hnd, mem_ctx, c->opt_target_workgroup,
+                                             global_myname(),
                                              orig_trust_passwd_hash,
                                              sec_channel_type);