From 49f08d1d7cd9a8bd9e7757ec2575175b79255e14 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 18 Jan 2011 12:05:38 +0100 Subject: s3-net: prefer dcerpc_samr_X functions in rpc_aliaslist_internals. Guenther --- source3/utils/net_rpc.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'source3') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 8d636d402e..6c98e4b738 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -4474,29 +4474,35 @@ static NTSTATUS rpc_aliaslist_internals(struct net_context *c, int argc, const char **argv) { - NTSTATUS result; + NTSTATUS result, status; struct policy_handle connect_pol; + struct dcerpc_binding_handle *b = pipe_hnd->binding_handle; - result = rpccli_samr_Connect2(pipe_hnd, mem_ctx, + status = dcerpc_samr_Connect2(b, mem_ctx, pipe_hnd->desthost, MAXIMUM_ALLOWED_ACCESS, - &connect_pol); - - if (!NT_STATUS_IS_OK(result)) + &connect_pol, + &result); + if (!NT_STATUS_IS_OK(status)) { goto done; + } + if (!NT_STATUS_IS_OK(result)) { + status = result; + goto done; + } - result = rpc_fetch_domain_aliases(pipe_hnd, mem_ctx, &connect_pol, + status = rpc_fetch_domain_aliases(pipe_hnd, mem_ctx, &connect_pol, &global_sid_Builtin); - - if (!NT_STATUS_IS_OK(result)) + if (!NT_STATUS_IS_OK(status)) { goto done; + } - result = rpc_fetch_domain_aliases(pipe_hnd, mem_ctx, &connect_pol, + status = rpc_fetch_domain_aliases(pipe_hnd, mem_ctx, &connect_pol, domain_sid); - rpccli_samr_Close(pipe_hnd, mem_ctx, &connect_pol); + dcerpc_samr_Close(b, mem_ctx, &connect_pol, &result); done: - return result; + return status; } static void init_user_token(struct security_token *token, struct dom_sid *user_sid) -- cgit