From 0160f27a8b3a094686c8d56742eab97fea3aedb7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 31 Mar 2017 15:20:07 +0000 Subject: [PATCH] idmap_rfc2307: Don't stop after 30 entries We start over again and again, so we need to search in the whole list. This is a quick hack generating a bad O(n^2). The real fix is to call idmap_rfc2307_find_map with "maps" starting at the right offset, but that's an optimization for later when it's restructured BUG: https://bugzilla.samba.org/show_bug.cgi?id=12757 Signed-off-by: Volker Lendecke Reviewed-by: Christof Schmitt (cherry picked from commit c0f12170e8b9fb3ab75f53bba637c72f6465192e) --- source3/winbindd/idmap_util.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index 196b4adf247..fd2ae4a15ac 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -52,10 +52,7 @@ struct id_map *idmap_find_map_by_id(struct id_map **maps, enum id_type type, { int i; - for (i = 0; i < IDMAP_LDAP_MAX_IDS; i++) { - if (maps[i] == NULL) { /* end of the run */ - return NULL; - } + for (i = 0; maps[i] != NULL; i++) { if ((maps[i]->xid.type == type) && (maps[i]->xid.id == id)) { return maps[i]; } -- 2.11.4.GIT