AIX sendmail problem

Andy Linton Andy.Linton at comp.vuw.ac.nz
Thu Mar 28 13:17:50 AEST 1991


In article <759 at bcstec.boeing.com>, ced at bcstec.uucp (Charles Derykus) writes:

|> I note that sendmail on "777sup1" has apparently munched the
|> "s" in its hostname as evidenced by the line:
|> 
|> 	"777 up1.ca.boeing.com Sendmail AIX...."
|> 
|> Other names with 3 initial digits suffer the same fate.

This message occurs because of a bug in (feature of) the routine
message() which lives in err.c in sendmail. This routine is used to
print out messages from inside sendmail. The comment from the code
follows:

**  MESSAGE -- print message (not necessarily an error)
**
**      Parameters:
**              num -- the default ARPANET error number (in ascii)
**              msg -- the message (printf fmt) -- if it begins
**                      with a digit, this number overrides num.
**              a, b, c, d, e -- printf arguments
**
**      Returns:
**              none
**
**      Side Effects:
**              none.
*/

The comment about side effects is dubious (:-)

The offending code is in another routine called fmtmsg() which is called
by message. If the first three characters of the message are digits,
they get used as the reply code and the fourth character is discarded.
        
	/* output the reply code */
        if (isdigit(fmt[0]) && isdigit(fmt[1]) && isdigit(fmt[2]))
        {
                num = fmt;
                fmt += 4;
        }

Try using a hostname with 2 leading digits to confirm.

This is a bug which is exercised by the decision in rfc1123 to allow
hostnames which start with a digit. Previously '777sup1.ca.boeing.com'
would not have been a valid name and so the problem would not have
arisen.



More information about the Comp.unix.aix mailing list