summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-08-18 17:30:27 +0200
committerStefan Metzmacher <metze@samba.org>2015-08-31 10:18:16 +0200
commit9de5e9bc471ed0a37763f9ee0313068ef71a3c58 (patch)
tree022d73c56c7591d3869dd28670d669d63bab16c0
parent4fed47622629c18db5374524e6338bbc75314afe (diff)
downloadsamba-9de5e9bc471ed0a37763f9ee0313068ef71a3c58.tar.gz
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 <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464 (cherry picked from commit ad626b9e6b3c200c70b0d840c956f7b6fff20660)
-rw-r--r--source3/winbindd/idmap.c12
1 files changed, 11 insertions, 1 deletions
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; i<num_domains; i++) {
+ if ((id->xid.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;
}