diff options
author | Volker Lendecke <vl@samba.org> | 2008-07-14 12:32:18 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-08-12 11:28:28 +0200 |
commit | 0c1e27abf69855abef396e4c93989964b70fcf1f (patch) | |
tree | 3d541583df6ecc789fb7c9028dee8eca47ba58ef /source3/winbindd/idmap.c | |
parent | 1bdbe772ada5aeb1eeb98e78759ae7235d098085 (diff) | |
download | samba-0c1e27abf69855abef396e4c93989964b70fcf1f.tar.gz samba-0c1e27abf69855abef396e4c93989964b70fcf1f.tar.bz2 samba-0c1e27abf69855abef396e4c93989964b70fcf1f.zip |
Directly call backends from idmap_[ugs]_to_[ugs]id
(This used to be commit f955407042e6d2384acccc399d72ff65ba0e721c)
Diffstat (limited to 'source3/winbindd/idmap.c')
-rw-r--r-- | source3/winbindd/idmap.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 95ff923d0f..f0d2c03e0b 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -1282,6 +1282,45 @@ done: return ret; } +NTSTATUS idmap_backends_unixid_to_sid(struct id_map *id) +{ + struct id_map *maps[2]; + int i; + + maps[0] = id; + maps[1] = NULL; + + for (i = num_domains-1; i>=0; i--) { + struct idmap_domain *dom = idmap_domains[i]; + NTSTATUS status; + + DEBUG(10, ("Query sids from domain %s\n", dom->name)); + + status = dom->methods->unixids_to_sids(dom, maps); + if (NT_STATUS_IS_OK(status)) { + return NT_STATUS_OK; + } + } + + return NT_STATUS_NONE_MAPPED; +} + +NTSTATUS idmap_backends_sid_to_unixid(struct id_map *id) +{ + struct idmap_domain *dom; + struct id_map *maps[2]; + + dom = find_idmap_domain_from_sid(id->sid); + if (dom == NULL) { + return NT_STATUS_NONE_MAPPED; + } + + maps[0] = id; + maps[1] = NULL; + + return dom->methods->sids_to_unixids(dom, maps); +} + /************************************************************************** idmap interface functions **************************************************************************/ |