From: Eric Allman Date: Wed, 15 Mar 1995 10:38:09 +0000 (-0800) Subject: hacks to make it more IDA-like -- they have other problems X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/d30b0654393b1582e47ab3b2eab896e6114de5cf hacks to make it more IDA-like -- they have other problems SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.58.1.1 SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.74.1.1 --- diff --git a/usr/src/usr.sbin/sendmail/src/parseaddr.c b/usr/src/usr.sbin/sendmail/src/parseaddr.c index f3fe77b65b..b6bed8000a 100644 --- a/usr/src/usr.sbin/sendmail/src/parseaddr.c +++ b/usr/src/usr.sbin/sendmail/src/parseaddr.c @@ -7,11 +7,13 @@ */ #ifndef lint -static char sccsid[] = "@(#)parseaddr.c 8.58 (Berkeley) %G%"; +static char sccsid[] = "@(#)parseaddr.c 8.58.1.1 (Berkeley) %G%"; #endif /* not lint */ #include "sendmail.h" +static int callsubr __P((char **, int, ENVELOPE *)); + #ifdef CC_WONT_PROMOTE static int toktype __P((char)); #else /* !CC_WONT_PROMOTE */ @@ -1433,11 +1435,6 @@ backup: ** Then copy vector back into original space. */ - callsubr(npvp); - - for (avp = npvp; *avp++ != NULL;); - subr = atoi(*++rvp); - rvp++; else subr = -1; @@ -1495,6 +1492,70 @@ backup: ** pvp is modified. */ +static int +callsubr(pvp, reclevel, e) + char **pvp; + int reclevel; + ENVELOPE *e; +{ + char **rvp; + int subr; + int stat; + STAB *s; + + for (; *pvp != NULL; pvp++) + { + if ((**pvp & 0377) == CALLSUBR && pvp[1] != NULL) + break; + } + if (*pvp == NULL) + return EX_OK; + + if (tTd(21, 3)) + printf("-----callsubr %s\n", pvp[1]); + + s = stab(pvp[1], ST_RULESET, ST_FIND); + if (s == NULL) + subr = atoi(pvp[1]); + else + subr = s->s_ruleset; + + /* + ** Take care of possible inner calls. + */ + + stat = callsubr(&pvp[2], reclevel, e); + if (stat != EX_OK) + return stat; + + /* + ** Move vector up over calling opcode. + */ + + for (rvp = &pvp[2]; *rvp != NULL; rvp++) + rvp[-2] = rvp[0]; + rvp[-2] = NULL; + + /* + ** Call inferior ruleset. + */ + + stat = rewrite(pvp, subr, reclevel, e); + return stat; +} + /* +** CALLSUBR -- call subroutines in rewrite vector +** +** Parameters: +** pvp -- pointer to token vector. +** +** Returns: +** none. +** +** Side Effects: +** pvp is modified. +*/ + static void callsubr(pvp) char **pvp; diff --git a/usr/src/usr.sbin/sendmail/src/readcf.c b/usr/src/usr.sbin/sendmail/src/readcf.c index 413a85cf41..c413812952 100644 --- a/usr/src/usr.sbin/sendmail/src/readcf.c +++ b/usr/src/usr.sbin/sendmail/src/readcf.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)readcf.c 8.74 (Berkeley) %G%"; +static char sccsid[] = "@(#)readcf.c 8.74.1.1 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -251,6 +251,7 @@ readcf(cfname) botch = "$0-$9"; break; +#if 0 case CANONNET: botch = "$#"; break; @@ -258,6 +259,7 @@ readcf(cfname) case CANONUSER: botch = "$:"; break; +#endif /* 0 */ case CALLSUBR: botch = "$>";