This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[jra/samba/.git] / source3 / libsmb / trust_passwd.c
index fe6b673e39e9acbb2c57867a760f8ca3db5673f4..cf9fd58b13f18743484ae4b133019240c3a6ea57 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "includes.h"
 
-extern pstring global_myname;
-
 /*********************************************************
  Change the domain password on the PDC.
 
@@ -35,8 +33,9 @@ static NTSTATUS just_change_the_password(struct cli_state *cli, TALLOC_CTX *mem_
                                         unsigned char new_trust_passwd_hash[16])
 {
        NTSTATUS result;
-       result = cli_nt_setup_creds(cli, (lp_server_role() == ROLE_DOMAIN_MEMBER) ?
-                                  SEC_CHAN_WKSTA : SEC_CHAN_BDC, orig_trust_passwd_hash);
+       uint32 neg_flags = 0x000001ff;
+
+       result = cli_nt_setup_creds(cli, get_sec_chan(), orig_trust_passwd_hash, &neg_flags, 2);
        
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(1,("just_change_the_password: unable to setup creds (%s)!\n",
@@ -44,7 +43,7 @@ static NTSTATUS just_change_the_password(struct cli_state *cli, TALLOC_CTX *mem_
                return result;
        }
 
-       result = cli_net_srv_pwset(cli, mem_ctx, global_myname, new_trust_passwd_hash);
+       result = cli_net_srv_pwset(cli, mem_ctx, global_myname(), new_trust_passwd_hash);
 
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(0,("just_change_the_password: unable to change password (%s)!\n",
@@ -98,7 +97,7 @@ NTSTATUS trust_pw_change_and_store_it(struct cli_state *cli, TALLOC_CTX *mem_ctx
 **********************************************************/
 
 NTSTATUS trust_pw_find_change_and_store_it(struct cli_state *cli, TALLOC_CTX *mem_ctx, 
-                                          char *domain) 
+                                          const char *domain) 
 {
        unsigned char old_trust_passwd_hash[16];
        char *up_domain;