From 9b62cea7da6efe5fbc9df16b63ae721aa12acfe9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 8 Feb 2008 10:23:47 +0100 Subject: Use rpccli_lsa_QueryInfoPolicy() in net. Guenther (This used to be commit 5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e) --- source3/utils/net_domain.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_domain.c b/source3/utils/net_domain.c index 11099ab233..a3e9f89e7d 100644 --- a/source3/utils/net_domain.c +++ b/source3/utils/net_domain.c @@ -175,6 +175,7 @@ NTSTATUS netdom_get_domain_sid( TALLOC_CTX *mem_ctx, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd = NULL; POLICY_HND lsa_pol; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; + union lsa_PolicyInformation *info = NULL; if ( (pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &status)) == NULL ) { DEBUG(0, ("Error connecting to LSA pipe. Error was %s\n", @@ -187,11 +188,16 @@ NTSTATUS netdom_get_domain_sid( TALLOC_CTX *mem_ctx, struct cli_state *cli, if ( !NT_STATUS_IS_OK(status) ) return status; - status = rpccli_lsa_query_info_policy(pipe_hnd, mem_ctx, - &lsa_pol, 5, domain, sid); + status = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx, + &lsa_pol, + LSA_POLICY_INFO_ACCOUNT_DOMAIN, + &info); if ( !NT_STATUS_IS_OK(status) ) return status; + *domain = info->account_domain.name.string; + *sid = info->account_domain.sid; + rpccli_lsa_Close(pipe_hnd, mem_ctx, &lsa_pol); cli_rpc_pipe_close(pipe_hnd); /* Done with this pipe */ -- cgit