s3-netlogon: setup NETLOGON credential chain in rpccli_netlogon_set_trust_password...
authorGünther Deschner <gd@samba.org>
Mon, 5 Oct 2009 15:04:52 +0000 (17:04 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:16 +0000 (13:22 +0100)
Guenther

Signed-off-by: Michael Adam <obnox@samba.org>
source3/rpc_client/cli_netlogon.c

index d9e81ef1cb7f0fba8813628867dfc90479a2b21d..cb0aaa38ddfac6d4dc33801f8f5f8edb88c485de 100644 (file)
@@ -559,19 +559,20 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
        uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
        struct netr_Authenticator clnt_creds, srv_cred;
 
-       result = rpccli_netlogon_setup_creds(cli,
-                                            cli->desthost, /* server name */
-                                            lp_workgroup(), /* domain */
-                                            global_myname(), /* client name */
-                                            global_myname(), /* machine account name */
-                                            orig_trust_passwd_hash,
-                                            sec_channel_type,
-                                            &neg_flags);
-
-       if (!NT_STATUS_IS_OK(result)) {
-               DEBUG(3,("rpccli_netlogon_set_trust_password: unable to setup creds (%s)!\n",
-                        nt_errstr(result)));
-               return result;
+       if (!cli->dc) {
+               result = rpccli_netlogon_setup_creds(cli,
+                                                    cli->desthost, /* server name */
+                                                    lp_workgroup(), /* domain */
+                                                    global_myname(), /* client name */
+                                                    global_myname(), /* machine account name */
+                                                    orig_trust_passwd_hash,
+                                                    sec_channel_type,
+                                                    &neg_flags);
+               if (!NT_STATUS_IS_OK(result)) {
+                       DEBUG(3,("rpccli_netlogon_set_trust_password: unable to setup creds (%s)!\n",
+                                nt_errstr(result)));
+                       return result;
+               }
        }
 
        netlogon_creds_client_step(cli->dc, &clnt_creds);