summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-13 11:08:49 +0100
committerGünther Deschner <gd@samba.org>2008-02-13 11:18:36 +0100
commit55a8d956d12a8782c97cbd86723402f50fbcc314 (patch)
tree8631e80fcfa9b212f61e9dd33685258b28204c34
parentee9d033e6550c572de21ade9e5181a59b0844c7e (diff)
downloadsamba-55a8d956d12a8782c97cbd86723402f50fbcc314.tar.gz
samba-55a8d956d12a8782c97cbd86723402f50fbcc314.tar.bz2
samba-55a8d956d12a8782c97cbd86723402f50fbcc314.zip
Convert last caller (in winbindd) to rpccli_samr_EnumDomainGroups.
Guenther (This used to be commit 8890bc481f60cd42d96b240b2ed8e34bc3d81f13)
-rw-r--r--source3/winbindd/winbindd_rpc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 8136175efe..53928225fa 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -150,19 +150,22 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
return status;
do {
- struct acct_info *info2 = NULL;
+ struct samr_SamArray *sam_array = NULL;
uint32 count = 0;
TALLOC_CTX *mem_ctx2;
+ int g;
mem_ctx2 = talloc_init("enum_dom_groups[rpc]");
/* start is updated by this call. */
- status = rpccli_samr_enum_dom_groups(cli, mem_ctx2, &dom_pol,
- &start,
- 0xFFFF, /* buffer size? */
- &info2, &count);
+ status = rpccli_samr_EnumDomainGroups(cli, mem_ctx2,
+ &dom_pol,
+ &start,
+ &sam_array,
+ 0xFFFF, /* buffer size? */
+ &count);
- if (!NT_STATUS_IS_OK(status) &&
+ if (!NT_STATUS_IS_OK(status) &&
!NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
talloc_destroy(mem_ctx2);
break;
@@ -176,7 +179,13 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
return NT_STATUS_NO_MEMORY;
}
- memcpy(&(*info)[*num_entries], info2, count*sizeof(*info2));
+ for (g=0; g < count; g++) {
+
+ fstrcpy((*info)[*num_entries + g].acct_name,
+ sam_array->entries[g].name.string);
+ (*info)[*num_entries + g].rid = sam_array->entries[g].idx;
+ }
+
(*num_entries) += count;
talloc_destroy(mem_ctx2);
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));