summaryrefslogtreecommitdiff
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
commit9b62cea7da6efe5fbc9df16b63ae721aa12acfe9 (patch)
tree197dad3cb8b97290b8cef5f4b379082c0242e991
parentadeb94a9a6444facf330337142997210940c9137 (diff)
downloadsamba-9b62cea7da6efe5fbc9df16b63ae721aa12acfe9.tar.gz
samba-9b62cea7da6efe5fbc9df16b63ae721aa12acfe9.tar.bz2
samba-9b62cea7da6efe5fbc9df16b63ae721aa12acfe9.zip
Use rpccli_lsa_QueryInfoPolicy() in net.
Guenther (This used to be commit 5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e)
-rw-r--r--source3/utils/net_domain.c10
1 files changed, 8 insertions, 2 deletions
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 */