summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-08 10:23:47 +0100
committerGünther Deschner <gd@samba.org>2008-02-08 10:26:58 +0100
commit5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e (patch)
tree4064ce69cf0c79bc2c8462aa2dab250488ad5a21
parent28ef55cbf1662dfe6b64a837ade830f5c864b4b9 (diff)
downloadsamba-5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e.tar.gz
samba-5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e.tar.xz
samba-5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e.zip
Use rpccli_lsa_QueryInfoPolicy() in net.
Guenther
-rw-r--r--source/utils/net_domain.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/utils/net_domain.c b/source/utils/net_domain.c
index 11099ab233d..a3e9f89e7d3 100644
--- a/source/utils/net_domain.c
+++ b/source/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 */