Article View: comp.bugs.4bsd
Article #358error handling bug in sendoff() of sendmail 5.65
From: DEMIZU Noritoshi
Date: Sat, 04 May 1991 07:24
Date: Sat, 04 May 1991 07:24
84 lines
2896 bytes
2896 bytes
sendoff() defined in deliver.c calls openmailer(). If the return
value of openmailer() was negative, sendoff() returns -1. This will
cause fatal error. The E-mail will be sent back to sender. But
openmailer() returns negative value even if the error is not fatal.
For example, when it failed to create pipe, or when it failed to fork.
So I think sendoff() returns ExitStat in stead of -1. And the global
variable ExitStat should be set to have proper status in openmailer().
Excuse my English.
--- DEMIZU Noritoshi OMRON Corporation
=====================================================================
*** src/deliver.c.ORG Sat May 4 14:32:51 1991
--- src/deliver.c Sat May 4 14:33:45 1991
***************
*** 600,606 ****
pid = openmailer(m, pvp, ctladdr, FALSE, &mfile, &rfile);
if (pid < 0)
! return (-1);
/*
** Format and send message.
--- 600,606 ----
pid = openmailer(m, pvp, ctladdr, FALSE, &mfile, &rfile);
if (pid < 0)
! return ExitStat;
/*
** Format and send message.
***************
*** 799,804 ****
--- 799,805 ----
if (pipe(mpvect) < 0)
{
syserr("openmailer: pipe (to mailer)");
+ ExitStat = EX_TEMPFAIL;
return (-1);
}
***************
*** 809,814 ****
--- 810,816 ----
syserr("openmailer: pipe (from mailer)");
(void) close(mpvect[0]);
(void) close(mpvect[1]);
+ ExitStat = EX_TEMPFAIL;
return (-1);
}
#endif SMTP
***************
*** 842,847 ****
--- 844,850 ----
(void) close(rpvect[1]);
}
#endif SMTP
+ ExitStat = EX_TEMPFAIL;
return (-1);
}
else if (pid == 0)
*** support/getloadavg.c.ORG Sat May 4 15:58:47 1991
--- support/getloadavg.c Sat May 4 15:58:59 1991
***************
*** 42,47 ****
return (-1);
}
if (lseek(kmem, (off_t) Nl[X_AVENRUN].n_value, 0) == -1 ||
! read(kmem, (char *) avenrun, sizeof(avenrun)) < sizeof(avenrun))
return (-1);
}
--- 42,47 ----
return (-1);
}
if (lseek(kmem, (off_t) Nl[X_AVENRUN].n_value, 0) == -1 ||
! read(kmem, (char *) avenrun, sizeof(*avenrun)) < sizeof(*avenrun))
return (-1);
}
=====================================================================
--
; DEMIZU, Noritoshi OMRON Computer Systems R&D laboratory
; demizu@nff.ncl.omron.co.jp tel: 075-951-5111 fax: 075-956-7403
Technical Details
Message-ID:
<DEMIZU.91May4162444@freezer.nff.ncl.omron.co.jp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!kddlab!icot32!okilab!sh8810!ascgw!ascwide!wnoc-tyo-news!astemgw!choshi!frf!demizuShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!kddlab!icot32!okilab!sh8810!ascgw!ascwide!wnoc-tyo-news!astemgw!choshi!frf!demizu From: demizu@nff.ncl.omron.co.jp (DEMIZU Noritoshi) Newsgroups: comp.bugs.4bsd Subject: error handling bug in sendoff() of sendmail 5.65 Message-ID: <DEMIZU.91May4162444@freezer.nff.ncl.omron.co.jp> Date: 4 May 91 07:24:44 GMT Sender: news@frf.omron.co.jp Distribution: comp Organization: OMRON Corporation, Kyoto, Japan. Lines: 84