Sendmail bug
Bruce Israel
israel at tove.UUCP
Sat Feb 2 11:17:09 AEST 1985
Index: usr.lib/sendmail/readcf.c 4.2BSD Fix
Description:
If a space is embedded in the tabs that separate the LHS of
a re-write rule in sendmail.cf from the RHS, sendmail sees
the space as the right-hand-side and hits a segmentation
violation.
Repeat-by:
Add a rule set S29 to the bottom of your sendmail.cf file, with
one rule in it that looks like:
R$+<@$+>{tab}{space}{tab}$1@$2
where {space} and {tab} are those respective characters, and then
go into address test mode (/usr/lib/sendmail -bt), and type
"29 foo at bar".
Fix:
The fix is to check for spaces in the rule-reading section of the
readcf() function in readcf.c. Below is a diff -c for the modified
file.
*** readcf.c.old Fri Feb 1 18:05:40 1985
--- readcf.c Fri Feb 1 17:59:14 1985
***************
*** 110,116
rwp->r_lhs = copyplist(rwp->r_lhs, TRUE);
/* expand and save the RHS */
! while (*++p == '\t')
continue;
q = p;
while (*p != '\0' && *p != '\t')
--- 110,116 -----
rwp->r_lhs = copyplist(rwp->r_lhs, TRUE);
/* expand and save the RHS */
! while (*++p == '\t' || *p == ' ')
continue;
q = p;
while (*p != '\0' && *p != '\t' && *p != ' ')
***************
*** 113,119
while (*++p == '\t')
continue;
q = p;
! while (*p != '\0' && *p != '\t')
p++;
*p = '\0';
expand(q, exbuf, &exbuf[sizeof exbuf], CurEnv);
--- 113,119 -----
while (*++p == '\t' || *p == ' ')
continue;
q = p;
! while (*p != '\0' && *p != '\t' && *p != ' ')
p++;
*p = '\0';
expand(q, exbuf, &exbuf[sizeof exbuf], CurEnv);
--
Bruce Israel
University of Maryland, Computer Science
{rlgvax,seismo}!umcp-cs!israel (Usenet) israel at Maryland (Arpanet)
More information about the Comp.unix.wizards
mailing list