🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.sendmail
Article #2641

Re: Does alias lookup iterate?

#2641
From: Mohamed Ellozy
Date: Fri, 08 Jan 1993 16:03
53 lines
2369 bytes
In article <1huuhfINNjfj@network.ucsd.edu>, brian@ucsd.edu (Brian Kantor) writes:
  > Yes, they iterate, but your problem is that on the second and successive
  > iterations they are case-sensitive.  The patch is simple; in the alias
  > lookup subroutine, use newstring to make a copy of the alias being
  > searched for and downcase it before the search.  As far as I can see,
  > that bug is present in all versions of vanilla sendmail through 5.67.
  > 
  > I seem to recall that it's done correctly in IDA-sendmail.
  > 	- Brian

Talk of luck!  I read this yesterday after having struggled with that problem for a couple of hours.  Thanks Brian.

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!

*** /tmp/,RCSt1a09164	Fri Jan  8 10:58:05 1993
--- alias.c	Fri Jan  8 10:55:32 1993
***************
*** 134,144 ****
--- 134,166 ----
  {
  # ifdef DBM
  	DATUM rhs, lhs;
+ 	char *lowname = newstr(name);
  
  	/* create a key for fetch */
+ 	(void) makelower(lowname);
  	lhs.dptr = name;
  	lhs.dsize = strlen(name) + 1;
  	rhs = fetch(lhs);
+ 	if (rhs.dptr == (char *)NULL)
+ 	{
+ 		/* try null-terminated version */
+ 		lhs.dsize += 1;
+ 		rhs = fetch(lhs);
+ 		lhs.dsize -= 1;
+ 		if (rhs.dptr == (char *)NULL)
+ 		{
+ 			/* try lower-case version */
+ 			lhs.dptr = lowname;
+ 			rhs = fetch(lhs);
+ 			if (rhs.dptr == (char *)NULL)
+ 			{
+ 				/* try null-terminated lower-case version */
+ 				lhs.dsize += 1;
+ 				rhs = fetch(lhs);
+ 			}
+ 		}
+ 	}
+ 	free(lowname);
  	return (rhs.dptr);
  # else DBM
  	register STAB *s;
Technical Details
Message-ID: <1ik8l9INN90r@early-bird.think.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!rpi!think.com!ellozy
References: <1992Dec30.172952.3042@unison.com> <1hsohvINNleo@agate.berkeley.edu> <1huuhfINNjfj@network.ucsd.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!gatech!rpi!think.com!ellozy
From: ellozy@farber.dfci.harvard.edu (Mohamed Ellozy)
Newsgroups: comp.mail.sendmail
Subject: Re: Does alias lookup iterate?
Date: 8 Jan 1993 16:03:53 GMT
Organization: Dana-Farber Cancer Institute
Lines: 53
Sender: ellozy@farber (Mohamed Ellozy)
Distribution: usa
Message-ID: <1ik8l9INN90r@early-bird.think.com>
References: <1992Dec30.172952.3042@unison.com> <1hsohvINNleo@agate.berkeley.edu> <1huuhfINNjfj@network.ucsd.edu>
NNTP-Posting-Host: farber.harvard.edu
Keywords: sendmail alias
Originator: ellozy@farber