From 4e98f93775762de18b0dfc31080af5c443324c70 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 11 Sep 2009 00:20:59 +0200 Subject: s3-rpcclient: make netlogon credential setup also work for interdomain trusts. Guenther --- source3/rpcclient/rpcclient.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'source3/rpcclient/rpcclient.c') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index b0c27e2484..c0268f348e 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -672,7 +672,7 @@ static NTSTATUS do_cmd(struct cli_state *cli, cli, cmd_entry->interface, default_transport, pipe_default_auth_level, - lp_workgroup(), + get_cmdline_auth_info_domain(auth_info), &cmd_entry->rpc_pipe); break; default: @@ -696,18 +696,20 @@ static NTSTATUS do_cmd(struct cli_state *cli, uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS; uint32 sec_channel_type; uchar trust_password[16]; - - if (!secrets_fetch_trust_account_password(lp_workgroup(), - trust_password, - NULL, &sec_channel_type)) { - return NT_STATUS_UNSUCCESSFUL; + const char *machine_account; + + if (!get_trust_pw_hash(get_cmdline_auth_info_domain(auth_info), + trust_password, &machine_account, + &sec_channel_type)) + { + return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } - + ntresult = rpccli_netlogon_setup_creds(cmd_entry->rpc_pipe, cli->desthost, /* server name */ - lp_workgroup(), /* domain */ + get_cmdline_auth_info_domain(auth_info), /* domain */ global_myname(), /* client name */ - global_myname(), /* machine account name */ + machine_account, /* machine account name */ trust_password, sec_channel_type, &neg_flags); -- cgit