[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

zmailer router cache bug (db.c:db())



On Sun, 9 May 1999, Michael Smith wrote:

> We have mixed-case accounts with names like Ab_37 on our system.
> We have lower-case aliases pointing to the mixed-case accounts, like
> 
> ab_37:Ab_37
> 
> After upgrading from zmailer 2.99.49p10 to 2.99.50-s11, mail to ab_37 or
> Ab_37 ends up in the bitbucket. It looks like the router wants to
> infinite-loop on the address for some reason, so it gives up and sends it
> to bitbucket.

I changed aliasesdb in aliases.cf to be case-sensitive, and mail to Ab_37
now works (but ab_37 still goes to the bitbucket). I changed the
expansions database in standard.cf to be case-sensitive, and it would've
worked, but the database cache in router/db.c:db() is always
case-insensitive, regardless of the case flags on the database it's
caching.

I'm running ZMailer 2.99.50-s11.
In router/db.c around line 741, I have:
                        if (D_db)
                                fprintf(stderr,
                                        "... comparing %s and %s in cache\n",
                                        CACHE(i,key), key);
                        if (CISTREQ(CACHE(i,key), key)) {
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                /* cache maintenance */
                                tce = *(dbip->cache+i);

Should it be checking whether dbip->flags & (DB_MAPTOLOWER | DB_MAPTOUPPER),
and calling STREQ instead of CISTREQ if it isn't?