summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-11 00:20:59 +0200
committerGünther Deschner <gd@samba.org>2009-09-11 09:59:05 +0200
commit4e98f93775762de18b0dfc31080af5c443324c70 (patch)
tree20d9f7677a68bdb56b435781582b70588ce95413 /source3
parent12c70251568a0c8b30215e5453c3ea6194c3503c (diff)
downloadsamba-4e98f93775762de18b0dfc31080af5c443324c70.tar.gz
samba-4e98f93775762de18b0dfc31080af5c443324c70.tar.bz2
samba-4e98f93775762de18b0dfc31080af5c443324c70.zip
s3-rpcclient: make netlogon credential setup also work for interdomain trusts.
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpcclient/rpcclient.c20
1 files changed, 11 insertions, 9 deletions
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);