Your message dated Sat, 02 Jun 2012 13:03:51 +0000
with message-id <[email protected]>
and subject line Bug#339749: fixed in maildrop 2.5.5-2
has caused the Debian Bug report #339749,
regarding maildrop: sets and later kills its process group, thereby sometimes 
killing processes it shouldn't
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
339749: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=339749
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: vacation
Version: 3.3.0
Severity: grave
Tags: patch

Vacation does not wait for its sendmail child to die in any way and exits!

Therefore accurate vacation parent (such as maildrop MDA) wipes forked
and executed sendmail before it could send any message...

Also multiple events that deserve it are not logged.

Patch for both flaws is attached.

-- 

\//\/\
(Sometimes credited as 1494 F8DD 6379 4CD7 E7E3 1FC9 D750 4243 1F05 9424.)

diff -U3 -r vacation-3.3.0-orig/vacation.c vacation-3.3.0/vacation.c
--- vacation-3.3.0-orig/vacation.c	2005-11-17 23:42:32.000000000 +0100
+++ vacation-3.3.0/vacation.c	2005-11-18 00:55:30.000000000 +0100
@@ -74,6 +74,9 @@
 #include <fcntl.h>
 #include <sys/param.h>
 #include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
 #ifdef HAVE_PATHS_H
 # include <paths.h>
 #else
@@ -232,7 +235,7 @@
 	}
 	if (msgfilename[0] != '/' || dbfilename[0] != '/')
 		if (chdir(pw->pw_dir)) {
-			msglog(LOG_ERR, "no such directory %s.\n", pw->pw_dir);
+			msglog(LOG_ERR, "error changing to directory %s: %s\n", pw->pw_dir, strerror(errno));
 			exit(1);
 		}
 
@@ -505,8 +508,8 @@
 void sendmessage(const char *myname, const char *msgfile)
 {
 	FILE *mfp, *sfp;
-	int i;
-	int pvect[2];
+	pid_t pid, wpid;
+	int pvect[2], wstatus;
 	char buf[MAXLINE];
 
 	mfp = fopen(msgfile, "r");
@@ -518,12 +521,12 @@
 		msglog(LOG_ERR, "pipe: %m");
 		exit(1);
 	}
-	i = fork();
-	if (i < 0) {
+	pid = fork();
+	if (pid < 0) {
 		msglog(LOG_ERR, "fork: %m");
 		exit(1);
 	}
-	if (i == 0) {
+	if (pid == 0) {
 		dup2(pvect[0], 0);
 		close(pvect[0]);
 		close(pvect[1]);
@@ -534,6 +537,7 @@
 		exit(1);
 	}
 	close(pvect[0]);
+
 	sfp = fdopen(pvect[1], "w");
 	fprintf(sfp, "To: %s\n", from);
 	while (fgets(buf, sizeof buf, mfp)) {
@@ -547,8 +551,31 @@
 			fputs(buf, sfp);
 		}
 	}
+
+	if (ferror(mfp)) {
+		msglog(LOG_ERR, "error reading file %s: %s\n", msgfile, strerror(errno));
+	} else if (ferror(sfp)) {
+		msglog(LOG_ERR, "error piping message to %s[%d]: %s\n", _PATH_SENDMAIL, pid, strerror(errno));
+	} else {
+		msglog(LOG_INFO, "response message passed to %s[%d].\n", _PATH_SENDMAIL, pid);
+	}
+
 	fclose(mfp);
 	fclose(sfp);
+
+	do {
+		wpid = waitpid(pid, &wstatus, 0);
+	} while (wpid == -1 && errno == EINTR);
+
+	if (wpid == -1) {
+		msglog(LOG_ERR, "error waiting for death of child %s[%d]: %s\n", _PATH_SENDMAIL, pid, strerror(errno));
+	} else if (WIFEXITED(wstatus)) {
+		if (WEXITSTATUS(wstatus) != 0) {
+			msglog(LOG_ERR, "process %s[%d] exited with return code %d\n", _PATH_SENDMAIL, pid, WEXITSTATUS(wstatus));
+		}
+	} else if (WIFSIGNALED(wstatus)) {
+		msglog(LOG_ERR, "process %s[%d] died with signal %d\n", _PATH_SENDMAIL, pid, WTERMSIG(wstatus));
+	}
 }
 
 void usage(void)

--- End Message ---
--- Begin Message ---
Source: maildrop
Source-Version: 2.5.5-2

We believe that the bug you reported is fixed in the latest version of
maildrop, which is due to be installed in the Debian FTP archive:

maildrop_2.5.5-2.debian.tar.gz
  to main/m/maildrop/maildrop_2.5.5-2.debian.tar.gz
maildrop_2.5.5-2.dsc
  to main/m/maildrop/maildrop_2.5.5-2.dsc
maildrop_2.5.5-2_amd64.deb
  to main/m/maildrop/maildrop_2.5.5-2_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Osamu Aoki <[email protected]> (supplier of updated maildrop package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 02 Jun 2012 12:37:16 +0900
Source: maildrop
Binary: maildrop
Architecture: source amd64
Version: 2.5.5-2
Distribution: unstable
Urgency: low
Maintainer: Josip Rodin <[email protected]>
Changed-By: Osamu Aoki <[email protected]>
Description: 
 maildrop   - mail delivery agent with filtering abilities
Closes: 339749 394779 660872 661156
Changes: 
 maildrop (2.5.5-2) unstable; urgency=low
 .
   * Skip patching makefile.in. Closes: #661156
   * Add URLs for upstream and VCS.
   * NMU fix in 2.2.0-3.1 is included in 2.5.5-1. Closes: #660872
   * Update copyright to DEP-5.
   * Document use of GID mail in README.Debian and manpage. Closes: #394779
   * Document killing of child processes in README.Debian. Closes: #339749
Checksums-Sha1: 
 007c6700cba645fd3dbbe03a841f0edadda6c26d 1404 maildrop_2.5.5-2.dsc
 cd38dee0942171726d1a6cd1a013c49306a25509 27279 maildrop_2.5.5-2.debian.tar.gz
 03caef2b8db172ea25ba805f1b48792e3a2ab5b4 468782 maildrop_2.5.5-2_amd64.deb
Checksums-Sha256: 
 a6959602b61f95874efd7f150951d46aab98c7a5adc787cbf69893cfd00b7d72 1404 
maildrop_2.5.5-2.dsc
 9d210aa79721c3f38e984764d5ffc0fc3fbc8ee3ef92fa2cdaa404a6463e0542 27279 
maildrop_2.5.5-2.debian.tar.gz
 8e964dd3c5c19421457c6906cfc28f9bf6f22bcc523163c4d6596ed06155a5da 468782 
maildrop_2.5.5-2_amd64.deb
Files: 
 e9f2deb948681f30b7446debb414ed89 1404 mail optional maildrop_2.5.5-2.dsc
 d6a07933f50e6da4ab19d5ccdc2777eb 27279 mail optional 
maildrop_2.5.5-2.debian.tar.gz
 90b6f02e1e7e64bd1de46d7ce28a8bdf 468782 mail optional 
maildrop_2.5.5-2_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAk/KDP8ACgkQ6A/EwagGHzJlWACdEshZuVDBB1lT7LrYSi0FQ2DY
dfoAnircALTBNN4tNTSg7oLuI/zGhmx9
=okqz
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to