lkundrak / rpms / sendmail

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