From 9de5e9bc471ed0a37763f9ee0313068ef71a3c58 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 18 Aug 2015 17:30:27 +0200 Subject: idmap: Use a range search in idmap_backends_unixid_to_sid This obsoletes the domain name in the xid2sid calls Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464 (cherry picked from commit ad626b9e6b3c200c70b0d840c956f7b6fff20660) --- source3/winbindd/idmap.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 7b4a84d030f..24277cac008 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -507,6 +507,7 @@ NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id) struct idmap_domain *dom; struct id_map *maps[2]; bool ok; + int i; ok = idmap_init(); if (!ok) { @@ -531,7 +532,16 @@ NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id) return NT_STATUS_OK; } - dom = idmap_find_domain(domname); + dom = default_idmap_domain; + + for (i=0; ixid.id >= idmap_domains[i]->low_id) && + (id->xid.id <= idmap_domains[i]->high_id)) { + dom = idmap_domains[i]; + break; + } + } + if (dom == NULL) { return NT_STATUS_NONE_MAPPED; } -- cgit v1.2.1