summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-14 15:33:26 +0100
committerGünther Deschner <gd@samba.org>2008-01-14 15:33:42 +0100
commitcb1a0905779a9e4be2894f14a62bc7f950e2140b (patch)
tree83e588fc5b31341108dcea23b3eda9fb71b9fd8e /source3/utils
parent08946cc54669e63306ca7f388930f2020a982fcd (diff)
downloadsamba-cb1a0905779a9e4be2894f14a62bc7f950e2140b.tar.gz
samba-cb1a0905779a9e4be2894f14a62bc7f950e2140b.tar.bz2
samba-cb1a0905779a9e4be2894f14a62bc7f950e2140b.zip
Use pidl generated rpccli_lsa_QueryTrustedDomainInfoBySid when vampiring trusted
domain secrets. Guenther (This used to be commit aa3de6f9f5b5375ca9f1e8a60a378afba1c0848b)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 155cda64df..2bd867fff3 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -5850,24 +5850,30 @@ static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd,
const char *trusted_dom_name)
{
NTSTATUS nt_status;
- LSA_TRUSTED_DOMAIN_INFO *info;
+ union lsa_TrustedDomainInfo info;
char *cleartextpwd = NULL;
DATA_BLOB data;
- nt_status = rpccli_lsa_query_trusted_domain_info_by_sid(pipe_hnd, mem_ctx, pol, 4, &dom_sid, &info);
-
+ nt_status = rpccli_lsa_QueryTrustedDomainInfoBySid(pipe_hnd, mem_ctx,
+ pol,
+ &dom_sid,
+ LSA_TRUSTED_DOMAIN_INFO_PASSWORD,
+ &info);
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0,("Could not query trusted domain info. Error was %s\n",
nt_errstr(nt_status)));
goto done;
}
- data = data_blob(NULL, info->password.password.length);
+ data = data_blob(NULL, info.password.password->length);
- memcpy(data.data, info->password.password.data, info->password.password.length);
- data.length = info->password.password.length;
-
- cleartextpwd = decrypt_trustdom_secret(pipe_hnd->cli->pwd.password, &data);
+ memcpy(data.data,
+ info.password.password->data,
+ info.password.password->length);
+ data.length = info.password.password->length;
+
+ cleartextpwd = decrypt_trustdom_secret(pipe_hnd->cli->pwd.password,
+ &data);
if (cleartextpwd == NULL) {
DEBUG(0,("retrieved NULL password\n"));