summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-01-18 12:00:09 +0100
committerGünther Deschner <gd@samba.org>2011-02-01 23:29:14 +0100
commit2a63433e942a8b75c27291fba6d6c230be020b09 (patch)
tree30ba48b8c72060abdddb6afd7105bf47853bcf12
parentd280a52fdd04a02d68525f341ede4d39534f0b4c (diff)
downloadsamba-2a63433e942a8b75c27291fba6d6c230be020b09.tar.gz
samba-2a63433e942a8b75c27291fba6d6c230be020b09.tar.bz2
samba-2a63433e942a8b75c27291fba6d6c230be020b09.zip
s3-net: prefer dcerpc_samr_X functions in rpc_list_group_members.
Guenther
-rw-r--r--source3/utils/net_rpc.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 4d3cdfbf46..21de74a367 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -2789,32 +2789,41 @@ static NTSTATUS rpc_list_group_members(struct net_context *c,
struct policy_handle *domain_pol,
uint32 rid)
{
- NTSTATUS result;
+ NTSTATUS result, status;
struct policy_handle group_pol;
uint32 num_members, *group_rids;
int i;
struct samr_RidAttrArray *rids = NULL;
struct lsa_Strings names;
struct samr_Ids types;
+ struct dcerpc_binding_handle *b = pipe_hnd->binding_handle;
fstring sid_str;
sid_to_fstring(sid_str, domain_sid);
- result = rpccli_samr_OpenGroup(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_OpenGroup(b, mem_ctx,
domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rid,
- &group_pol);
-
- if (!NT_STATUS_IS_OK(result))
+ &group_pol,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ if (!NT_STATUS_IS_OK(result)) {
return result;
+ }
- result = rpccli_samr_QueryGroupMember(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_QueryGroupMember(b, mem_ctx,
&group_pol,
- &rids);
-
- if (!NT_STATUS_IS_OK(result))
+ &rids,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ if (!NT_STATUS_IS_OK(result)) {
return result;
+ }
num_members = rids->count;
group_rids = rids->rids;
@@ -2825,15 +2834,19 @@ static NTSTATUS rpc_list_group_members(struct net_context *c,
if (num_members < this_time)
this_time = num_members;
- result = rpccli_samr_LookupRids(pipe_hnd, mem_ctx,
+ status = dcerpc_samr_LookupRids(b, mem_ctx,
domain_pol,
this_time,
group_rids,
&names,
- &types);
-
- if (!NT_STATUS_IS_OK(result))
+ &types,
+ &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ if (!NT_STATUS_IS_OK(result)) {
return result;
+ }
/* We only have users as members, but make the output
the same as the output of alias members */