diff options
author | Volker Lendecke <vl@samba.org> | 2009-08-27 19:54:18 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-08-29 19:42:27 +0200 |
commit | 2555c12bcefa212d482c9acaa5ae87b6107fa1a2 (patch) | |
tree | b2ebcbf8afa7b73d570ce7ca346efd2a077c53ed /source3/winbindd | |
parent | 50d9fb42fc771e07326f3f47103676f2ef88107e (diff) | |
download | samba-2555c12bcefa212d482c9acaa5ae87b6107fa1a2.tar.gz samba-2555c12bcefa212d482c9acaa5ae87b6107fa1a2.tar.bz2 samba-2555c12bcefa212d482c9acaa5ae87b6107fa1a2.zip |
s3:winbind: Add async QueryGroupList
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_dual_srv.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c index b46b3d511e..0f0802109a 100644 --- a/source3/winbindd/winbindd_dual_srv.c +++ b/source3/winbindd/winbindd_dual_srv.c @@ -209,6 +209,46 @@ NTSTATUS _wbint_QueryUserList(pipes_struct *p, struct wbint_QueryUserList *r) &r->out.users->userinfos); } +NTSTATUS _wbint_QueryGroupList(pipes_struct *p, struct wbint_QueryGroupList *r) +{ + struct winbindd_domain *domain = wb_child_domain(); + uint32_t i, num_groups; + struct acct_info *groups; + struct wbint_Principal *result; + NTSTATUS status; + + if (domain == NULL) { + return NT_STATUS_REQUEST_NOT_ACCEPTED; + } + + status = domain->methods->enum_dom_groups(domain, talloc_tos(), + &num_groups, &groups); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + result = talloc_array(r->out.groups, struct wbint_Principal, + num_groups); + if (result == NULL) { + return NT_STATUS_NO_MEMORY; + } + + for (i=0; i<num_groups; i++) { + sid_compose(&result[i].sid, &domain->sid, groups[i].rid); + result[i].type = SID_NAME_DOM_GRP; + result[i].name = talloc_strdup(result, groups[i].acct_name); + if (result[i].name == NULL) { + TALLOC_FREE(result); + TALLOC_FREE(groups); + return NT_STATUS_NO_MEMORY; + } + } + + r->out.groups->num_principals = num_groups; + r->out.groups->principals = result; + return NT_STATUS_OK; +} + NTSTATUS _wbint_DsGetDcName(pipes_struct *p, struct wbint_DsGetDcName *r) { struct winbindd_domain *domain = wb_child_domain(); |