summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_dual_srv.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-08-27 17:11:24 +0200
committerVolker Lendecke <vl@samba.org>2009-08-29 19:42:26 +0200
commit50d9fb42fc771e07326f3f47103676f2ef88107e (patch)
tree67239f96f1154386cf5ca874bdec731fa48ac58b /source3/winbindd/winbindd_dual_srv.c
parent425239caeeb22cb0a221a38b70f2f2dc8b64bdcc (diff)
downloadsamba-50d9fb42fc771e07326f3f47103676f2ef88107e.tar.gz
samba-50d9fb42fc771e07326f3f47103676f2ef88107e.tar.bz2
samba-50d9fb42fc771e07326f3f47103676f2ef88107e.zip
w3:winbind: Convert WINBINDD_LOOKUPRIDS to the new API
Diffstat (limited to 'source3/winbindd/winbindd_dual_srv.c')
-rw-r--r--source3/winbindd/winbindd_dual_srv.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index 6b1a4b3615..b46b3d511e 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -289,3 +289,43 @@ done:
return status;
}
+
+NTSTATUS _wbint_LookupRids(pipes_struct *p, struct wbint_LookupRids *r)
+{
+ struct winbindd_domain *domain = wb_child_domain();
+ char *domain_name;
+ char **names;
+ enum lsa_SidType *types;
+ struct wbint_Principal *result;
+ NTSTATUS status;
+ int i;
+
+ if (domain == NULL) {
+ return NT_STATUS_REQUEST_NOT_ACCEPTED;
+ }
+
+ status = domain->methods->rids_to_names(
+ domain, talloc_tos(), &domain->sid, r->in.rids->rids,
+ r->in.rids->num_rids, &domain_name, &names, &types);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ result = talloc_array(p->mem_ctx, struct wbint_Principal,
+ r->in.rids->num_rids);
+ if (result == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ for (i=0; i<r->in.rids->num_rids; i++) {
+ sid_compose(&result[i].sid, &domain->sid, r->in.rids->rids[i]);
+ result[i].type = types[i];
+ result[i].name = talloc_move(result, &names[i]);
+ }
+ TALLOC_FREE(types);
+ TALLOC_FREE(names);
+
+ r->out.names->num_principals = r->in.rids->num_rids;
+ r->out.names->principals = result;
+ return NT_STATUS_OK;
+}