1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Use rpccli_lsa_QueryInfoPolicy() in net.

Guenther
This commit is contained in:
Günther Deschner 2008-02-08 10:23:47 +01:00
parent 28ef55cbf1
commit 5ddfa6cbe9

View File

@ -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 */