sendmail/sendmail-8.14.3-exitpanic.patch
Miroslav Lichvar aec43b3124 - fix milter file descriptors leaks (#485426)
- skip colon separator when parsing service name in ServiceSwitchFile
- return with non-zero exit code when free space is below MinFreeBlocks
- fix service stop/restart when only smclient is running
- fix submit.cf and helpfile permissions
- more merge review fixes (#226407)
2009-12-15 14:40:42 +00:00

65 lines
2.2 KiB
Diff

diff -up sendmail-8.14.3/sendmail/envelope.c.exitpanic sendmail-8.14.3/sendmail/envelope.c
--- sendmail-8.14.3/sendmail/envelope.c.exitpanic 2008-03-31 18:32:13.000000000 +0200
+++ sendmail-8.14.3/sendmail/envelope.c 2009-12-15 13:55:52.000000000 +0100
@@ -163,14 +163,14 @@ newenvelope(e, parent, rpool)
** split -- if true, split by recipient if message is queued up
**
** Returns:
-** none.
+** true if savemail panic'ed.
**
** Side Effects:
** housekeeping necessary to dispose of an envelope.
** Unlocks this queue file.
*/
-void
+bool
dropenvelope(e, fulldrop, split)
register ENVELOPE *e;
bool fulldrop;
@@ -209,7 +209,7 @@ dropenvelope(e, fulldrop, split)
/* we must have an id to remove disk files */
if (id == NULL)
- return;
+ return panic;
/* if verify-only mode, we can skip most of this */
if (OpMode == MD_VERIFY)
@@ -618,6 +618,8 @@ simpledrop:
}
e->e_id = NULL;
e->e_flags &= ~EF_HAS_DF;
+
+ return panic;
}
/*
** CLEARENVELOPE -- clear an envelope without unlocking
diff -up sendmail-8.14.3/sendmail/main.c.exitpanic sendmail-8.14.3/sendmail/main.c
--- sendmail-8.14.3/sendmail/main.c.exitpanic 2008-03-31 18:32:13.000000000 +0200
+++ sendmail-8.14.3/sendmail/main.c 2009-12-15 13:55:52.000000000 +0100
@@ -2952,7 +2952,9 @@ finis(drop, cleanup, exitstat)
{
if (CurEnv->e_id != NULL)
{
- dropenvelope(CurEnv, true, false);
+ if (dropenvelope(CurEnv, true, false))
+ /* exit with OS error if savemail panic'ed */
+ exitstat = EX_OSERR;
sm_rpool_free(CurEnv->e_rpool);
CurEnv->e_rpool = NULL;
diff -up sendmail-8.14.3/sendmail/sendmail.h.exitpanic sendmail-8.14.3/sendmail/sendmail.h
--- sendmail-8.14.3/sendmail/sendmail.h.exitpanic 2008-02-16 00:19:58.000000000 +0100
+++ sendmail-8.14.3/sendmail/sendmail.h 2009-12-15 13:55:52.000000000 +0100
@@ -982,7 +982,7 @@ extern ENVELOPE BlankEnvelope;
/* functions */
extern void clearenvelope __P((ENVELOPE *, bool, SM_RPOOL_T *));
-extern void dropenvelope __P((ENVELOPE *, bool, bool));
+extern bool dropenvelope __P((ENVELOPE *, bool, bool));
extern ENVELOPE *newenvelope __P((ENVELOPE *, ENVELOPE *, SM_RPOOL_T *));
extern void clrsessenvelope __P((ENVELOPE *));
extern void printenvflags __P((ENVELOPE *));