diff options
author | Günther Deschner <gd@samba.org> | 2008-02-13 11:15:40 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-13 11:18:36 +0100 |
commit | ce7d5975b48e538779c5bd10f45677b0ea23ae80 (patch) | |
tree | 61e19cda6957238a04fc98336237ea6c6c9e33df /source3/winbindd | |
parent | 4843df31de6f52b1e790bbd603ff1ac999176ca3 (diff) | |
download | samba-ce7d5975b48e538779c5bd10f45677b0ea23ae80.tar.gz samba-ce7d5975b48e538779c5bd10f45677b0ea23ae80.tar.bz2 samba-ce7d5975b48e538779c5bd10f45677b0ea23ae80.zip |
Convert last caller (in winbindd) to rpccli_samr_EnumDomainAliases.
Guenther
(This used to be commit 33a97b447c1875bf1cd5a703871a84a7fb359fec)
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_rpc.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index 53928225fa..585923410f 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -220,18 +220,21 @@ static NTSTATUS enum_local_groups(struct winbindd_domain *domain, return result; do { - struct acct_info *info2 = NULL; + struct samr_SamArray *sam_array = NULL; uint32 count = 0, start = *num_entries; TALLOC_CTX *mem_ctx2; + int g; mem_ctx2 = talloc_init("enum_dom_local_groups[rpc]"); - result = rpccli_samr_enum_als_groups( cli, mem_ctx2, &dom_pol, - &start, 0xFFFF, &info2, - &count); - + result = rpccli_samr_EnumDomainAliases(cli, mem_ctx2, + &dom_pol, + &start, + &sam_array, + 0xFFFF, /* buffer size? */ + &count); if (!NT_STATUS_IS_OK(result) && - !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES) ) + !NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES) ) { talloc_destroy(mem_ctx2); return result; @@ -245,7 +248,13 @@ static NTSTATUS enum_local_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); |