mirror of
https://github.com/samba-team/samba.git
synced 2025-03-12 20:58:37 +03:00
winbindd: pass domain SID to wbint_UnixIDs2Sids
This makes the domain SID available to the idmap child for wbint_UnixIDs2Sids mapping request. It's not used yet anywhere, this comes in the next commit. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13052 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 71f99cb132f4c26f9febac6cb7dcd79f4940216a)
This commit is contained in:
parent
e16ef9fe6a
commit
96cc7e0fe3
@ -58,6 +58,7 @@ interface winbind
|
||||
|
||||
NTSTATUS wbint_UnixIDs2Sids(
|
||||
[in,string,charset(UTF8)] char *domain_name,
|
||||
[in] dom_sid domain_sid,
|
||||
[in] uint32 num_ids,
|
||||
[in,out] unixid xids[num_ids],
|
||||
[out] dom_sid sids[num_ids]
|
||||
|
@ -36,6 +36,11 @@ struct wbint_userinfo;
|
||||
|
||||
struct idmap_domain {
|
||||
const char *name;
|
||||
/*
|
||||
* dom_sid is currently only initialized in the unixids_to_sids request,
|
||||
* so don't rely on this being filled out everywhere!
|
||||
*/
|
||||
struct dom_sid dom_sid;
|
||||
struct idmap_methods *methods;
|
||||
NTSTATUS (*query_user)(struct idmap_domain *domain,
|
||||
struct wbint_userinfo *info);
|
||||
|
@ -589,7 +589,8 @@ NTSTATUS idmap_allocate_gid(struct unixid *id)
|
||||
}
|
||||
|
||||
NTSTATUS idmap_backend_unixids_to_sids(struct id_map **maps,
|
||||
const char *domain_name)
|
||||
const char *domain_name,
|
||||
struct dom_sid domain_sid)
|
||||
{
|
||||
struct idmap_domain *dom = NULL;
|
||||
NTSTATUS status;
|
||||
@ -610,6 +611,7 @@ NTSTATUS idmap_backend_unixids_to_sids(struct id_map **maps,
|
||||
return NT_STATUS_NONE_MAPPED;
|
||||
}
|
||||
|
||||
dom->dom_sid = domain_sid;
|
||||
status = dom->methods->unixids_to_sids(dom, maps);
|
||||
|
||||
DBG_DEBUG("unixid_to_sids for domain %s returned %s\n",
|
||||
|
@ -35,7 +35,8 @@ void idmap_close(void);
|
||||
NTSTATUS idmap_allocate_uid(struct unixid *id);
|
||||
NTSTATUS idmap_allocate_gid(struct unixid *id);
|
||||
NTSTATUS idmap_backend_unixids_to_sids(struct id_map **maps,
|
||||
const char *domain_name);
|
||||
const char *domain_name,
|
||||
struct dom_sid domain_sid);
|
||||
struct idmap_domain *idmap_find_domain(const char *domname);
|
||||
|
||||
/* The following definitions come from winbindd/idmap_nss.c */
|
||||
|
@ -314,7 +314,7 @@ static struct tevent_req *wb_xids2sids_dom_send(
|
||||
|
||||
child = idmap_child();
|
||||
subreq = dcerpc_wbint_UnixIDs2Sids_send(
|
||||
state, ev, child->binding_handle, dom_map->name,
|
||||
state, ev, child->binding_handle, dom_map->name, dom_map->sid,
|
||||
state->num_dom_xids, state->dom_xids, state->dom_sids);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
@ -417,7 +417,8 @@ static void wb_xids2sids_dom_gotdc(struct tevent_req *subreq)
|
||||
child = idmap_child();
|
||||
subreq = dcerpc_wbint_UnixIDs2Sids_send(
|
||||
state, state->ev, child->binding_handle, state->dom_map->name,
|
||||
state->num_dom_xids, state->dom_xids, state->dom_sids);
|
||||
state->dom_map->sid, state->num_dom_xids,
|
||||
state->dom_xids, state->dom_sids);
|
||||
if (tevent_req_nomem(subreq, req)) {
|
||||
return;
|
||||
}
|
||||
|
@ -226,7 +226,8 @@ NTSTATUS _wbint_UnixIDs2Sids(struct pipes_struct *p,
|
||||
maps[i]->xid = r->in.xids[i];
|
||||
}
|
||||
|
||||
status = idmap_backend_unixids_to_sids(maps, r->in.domain_name);
|
||||
status = idmap_backend_unixids_to_sids(maps, r->in.domain_name,
|
||||
r->in.domain_sid);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
TALLOC_FREE(maps);
|
||||
return status;
|
||||
|
Loading…
x
Reference in New Issue
Block a user