summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-05 17:04:52 +0200
committerGünther Deschner <gd@samba.org>2009-10-06 16:50:23 +0200
commit0c2fc9eedf241746067d1625f643c894bfa11394 (patch)
tree4839e0b0321b0784dce7eb92ee58bf942f28da39 /source3
parente9f126421d21a66cc695039f798d252e9f98fef9 (diff)
downloadsamba-0c2fc9eedf241746067d1625f643c894bfa11394.tar.gz
samba-0c2fc9eedf241746067d1625f643c894bfa11394.tar.bz2
samba-0c2fc9eedf241746067d1625f643c894bfa11394.zip
s3-netlogon: setup NETLOGON credential chain in rpccli_netlogon_set_trust_password() only when needed.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_netlogon.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 911a50f393..6caffd74a6 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -518,19 +518,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_authenticator(cli->dc, &clnt_creds);