[Exim] Small annoying bug in exim 4.11 with nis-lookups

Top Page
Delete this message
Reply to this message
Author: Nico Erfurth
Date:  
To: Exim-users
Subject: [Exim] Small annoying bug in exim 4.11 with nis-lookups
Well, this bug seems to be lurking around since a long time, and now it
showed up.

src/search.c has a bug in
search_findtype(uschar *name, int len)

the search starts like this

while (top > bot)
{
int mid = (top + bot)/2;
int c = Ustrncmp(name, lookup_list[mid].name, len);

looks fine for the first look, BUT, if you try to find the nis lookup it
fails (or it will pick nisplus), because the "nis" part of nisplus
matches. I think this bug showed up now, because of the new lookup-type,
so the search first hits "nisplus" before coming to "nis"

changing this (line 68)
int c = Ustrncmp(name, lookup_list[mid].name, len);

to

int c = Ustrcmp(name, lookup_list[mid].name);

solves the problem.

Thanks for your attention ;)