home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / mail / sendmail / 3125 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.2 KB

  1. Path: sparky!uunet!destroyer!gatech!rpi!think.com!ellozy
  2. From: ellozy@farber.dfci.harvard.edu (Mohamed Ellozy)
  3. Newsgroups: comp.mail.sendmail
  4. Subject: Re: Does alias lookup iterate?
  5. Date: 8 Jan 1993 16:03:53 GMT
  6. Organization: Dana-Farber Cancer Institute
  7. Lines: 53
  8. Sender: ellozy@farber (Mohamed Ellozy)
  9. Distribution: usa
  10. Message-ID: <1ik8l9INN90r@early-bird.think.com>
  11. References: <1992Dec30.172952.3042@unison.com> <1hsohvINNleo@agate.berkeley.edu> <1huuhfINNjfj@network.ucsd.edu>
  12. NNTP-Posting-Host: farber.harvard.edu
  13. Keywords: sendmail alias
  14. Originator: ellozy@farber
  15.  
  16.  
  17. In article <1huuhfINNjfj@network.ucsd.edu>, brian@ucsd.edu (Brian Kantor) writes:
  18.   > Yes, they iterate, but your problem is that on the second and successive
  19.   > iterations they are case-sensitive.  The patch is simple; in the alias
  20.   > lookup subroutine, use newstring to make a copy of the alias being
  21.   > searched for and downcase it before the search.  As far as I can see,
  22.   > that bug is present in all versions of vanilla sendmail through 5.67.
  23.   > 
  24.   > I seem to recall that it's done correctly in IDA-sendmail.
  25.   >     - Brian
  26.  
  27. Talk of luck!  I read this yesterday after having struggled with that problem for a couple of hours.  Thanks Brian.
  28.  
  29. The following patch is taken from IDA, I am not sure why they try null-terminated strings but decided to include that part.  This is a context diff from a previously unmodiffied alias.c from berkeley 5.65, as usual your mileage may differ!
  30.  
  31. *** /tmp/,RCSt1a09164    Fri Jan  8 10:58:05 1993
  32. --- alias.c    Fri Jan  8 10:55:32 1993
  33. ***************
  34. *** 134,144 ****
  35. --- 134,166 ----
  36.   {
  37.   # ifdef DBM
  38.       DATUM rhs, lhs;
  39. +     char *lowname = newstr(name);
  40.   
  41.       /* create a key for fetch */
  42. +     (void) makelower(lowname);
  43.       lhs.dptr = name;
  44.       lhs.dsize = strlen(name) + 1;
  45.       rhs = fetch(lhs);
  46. +     if (rhs.dptr == (char *)NULL)
  47. +     {
  48. +         /* try null-terminated version */
  49. +         lhs.dsize += 1;
  50. +         rhs = fetch(lhs);
  51. +         lhs.dsize -= 1;
  52. +         if (rhs.dptr == (char *)NULL)
  53. +         {
  54. +             /* try lower-case version */
  55. +             lhs.dptr = lowname;
  56. +             rhs = fetch(lhs);
  57. +             if (rhs.dptr == (char *)NULL)
  58. +             {
  59. +                 /* try null-terminated lower-case version */
  60. +                 lhs.dsize += 1;
  61. +                 rhs = fetch(lhs);
  62. +             }
  63. +         }
  64. +     }
  65. +     free(lowname);
  66.       return (rhs.dptr);
  67.   # else DBM
  68.       register STAB *s;
  69.