diff -Nru dma-0.0.2010.06.17/debian/changelog dma-0.0.2010.06.17/debian/changelog --- dma-0.0.2010.06.17/debian/changelog 2011-07-06 09:04:07.000000000 +0000 +++ dma-0.0.2010.06.17/debian/changelog 2011-12-26 14:10:38.000000000 +0000 @@ -1,3 +1,20 @@ +dma (0.0.2010.06.17-12) unstable; urgency=low + + * This is hopefully the last upload before the long overdue update of + dma to a newer upstream release. + * Fix the syntax of the dfcompat.c entry in debian/copyright. + * Add the 44-newline patch (upstream rev. 807f777) to allow the last + input line to not be terminated with a newline character. + Closes: #648369 + * Add the 45-received patch to fix the format of the Received header. + Closes: #650268 + * Add the 46-smtp-newline patch to deal with SMTP servers that may + send a response in more than one TCP packet. Closes: #650265 + * Amend the 13-hardening patch to also change three instances of + strncpy() to snprintf() to ensure null-termination. + + -- Peter Pentchev Mon, 26 Dec 2011 16:10:36 +0200 + dma (0.0.2010.06.17-11) unstable; urgency=low * Add the 42-fix-ftbfs-binutils-gold patch to fix the build on Ubuntu natty diff -Nru dma-0.0.2010.06.17/debian/copyright dma-0.0.2010.06.17/debian/copyright --- dma-0.0.2010.06.17/debian/copyright 2011-07-05 13:33:34.000000000 +0000 +++ dma-0.0.2010.06.17/debian/copyright 2011-12-24 00:08:44.000000000 +0000 @@ -20,7 +20,7 @@ Files: dfcompat.c Copyright: Copyright (c) 1998 Todd C. Miller Copyright (c) 1998, M. Warner Losh All rights reserved. -License: BSD-1 BSD-2 +License: BSD-1 and BSD-2 Files: dma.8 Copyright: Copyright (c) 2008 The DragonFly Project. All rights reserved. diff -Nru dma-0.0.2010.06.17/debian/patches/13-hardening.patch dma-0.0.2010.06.17/debian/patches/13-hardening.patch --- dma-0.0.2010.06.17/debian/patches/13-hardening.patch 2010-11-17 08:53:09.000000000 +0000 +++ dma-0.0.2010.06.17/debian/patches/13-hardening.patch 2011-12-25 15:47:55.000000000 +0000 @@ -1,8 +1,8 @@ -Description: Build hardening: check a few more return values. +Description: Build hardening: check a few more return values, use snprintf() Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/ Forwarded: yes Author: Peter Pentchev -Last-Update: 2010-06-21 +Last-Update: 2011-12-25 --- a/util.c +++ b/util.c @@ -50,3 +50,29 @@ return; username = "unknown-or-invalid-username"; } +--- a/net.c ++++ b/net.c +@@ -103,7 +103,7 @@ + s = SSL_get_error(config.ssl, s); + if (s != SSL_ERROR_WANT_READ && + s != SSL_ERROR_WANT_WRITE) { +- strncpy(neterr, ssl_errstr(), sizeof(neterr)); ++ snprintf(neterr, sizeof(neterr), "%s", ssl_errstr()); + return (-1); + } + } +@@ -155,12 +155,12 @@ + (config.features & NOSSL) == 0) { + if ((rlen = SSL_read(config.ssl, buff + len, + sizeof(buff) - len)) == -1) { +- strncpy(neterr, ssl_errstr(), sizeof(neterr)); ++ snprintf(neterr, sizeof(neterr), "%s", ssl_errstr()); + return (-1); + } + } else { + if ((rlen = read(fd, buff + len, sizeof(buff) - len)) == -1) { +- strncpy(neterr, strerror(errno), sizeof(neterr)); ++ snprintf(neterr, sizeof(neterr), "%s", strerror(errno)); + return (-1); + } + } diff -Nru dma-0.0.2010.06.17/debian/patches/44-newline.patch dma-0.0.2010.06.17/debian/patches/44-newline.patch --- dma-0.0.2010.06.17/debian/patches/44-newline.patch 1970-01-01 00:00:00.000000000 +0000 +++ dma-0.0.2010.06.17/debian/patches/44-newline.patch 2011-12-24 00:25:14.000000000 +0000 @@ -0,0 +1,40 @@ +Description: Accept mail without newline at the end. +Origin: upstream +Author: Simon Schubert <2@0x2c.org> +Bug-Debian: http://bugs.debian.org/648369 +Last-Update: 2011-12-24 + +--- a/mail.c ++++ b/mail.c +@@ -444,6 +444,7 @@ + int had_from = 0; + int had_messagid = 0; + int had_date = 0; ++ int had_last_line = 0; + int nocopy = 0; + + parse_state.state = NONE; +@@ -463,12 +464,20 @@ + return (-1); + + while (!feof(stdin)) { +- if (fgets(line, sizeof(line), stdin) == NULL) ++ if (fgets(line, sizeof(line) - 1, stdin) == NULL) + break; ++ if (had_last_line) ++ errlogx(1, "bad mail input format"); + linelen = strlen(line); + if (linelen == 0 || line[linelen - 1] != '\n') { +- errno = EINVAL; /* XXX mark permanent errors */ +- return (-1); ++ /* ++ * This line did not end with a newline character. ++ * If we fix it, it better be the last line of ++ * the file. ++ */ ++ line[linelen] = '\n'; ++ line[linelen + 1] = 0; ++ had_last_line = 1; + } + if (!had_headers) { + /* diff -Nru dma-0.0.2010.06.17/debian/patches/45-received.patch dma-0.0.2010.06.17/debian/patches/45-received.patch --- dma-0.0.2010.06.17/debian/patches/45-received.patch 1970-01-01 00:00:00.000000000 +0000 +++ dma-0.0.2010.06.17/debian/patches/45-received.patch 2011-12-25 15:13:06.000000000 +0000 @@ -0,0 +1,25 @@ +Description: Add semicolon before date in received: header +Author: Miquel van Smoorenburg +Bug-Debian: http://bugs.debian.org/650268 +Last-Update: 2011-11-28 + +--- a/mail.c ++++ b/mail.c +@@ -174,7 +174,7 @@ + error = fprintf(bounceq.mailf, + "Received: from MAILER-DAEMON\n" + "\tid %s\n" +- "\tby %s (%s)\n" ++ "\tby %s (%s);\n" + "\t%s\n" + "X-Original-To: <%s>\n" + "From: MAILER-DAEMON <>\n" +@@ -453,7 +453,7 @@ + "Received: from %s (uid %d)\n" + "\t(envelope-from %s)\n" + "\tid %s\n" +- "\tby %s (%s)\n" ++ "\tby %s (%s);\n" + "\t%s\n", + username, getuid(), + queue->sender, diff -Nru dma-0.0.2010.06.17/debian/patches/46-smtp-newline.patch dma-0.0.2010.06.17/debian/patches/46-smtp-newline.patch --- dma-0.0.2010.06.17/debian/patches/46-smtp-newline.patch 1970-01-01 00:00:00.000000000 +0000 +++ dma-0.0.2010.06.17/debian/patches/46-smtp-newline.patch 2011-12-25 15:14:12.000000000 +0000 @@ -0,0 +1,22 @@ +Description: Read the response from an SMTP server all the way to CR/LF +Author: Miquel van Smoorenburg +Bug-Debian: http://bugs.debian.org/650265 +Last-Update: 2011-11-28 + +--- a/net.c ++++ b/net.c +@@ -166,6 +166,14 @@ + } + len += rlen; + } ++ /* read up to \n */ ++ if (memchr(buff + pos, '\n', len - pos) == NULL) { ++ if (len < sizeof(buff)) ++ continue; ++ strcpy(neterr, "line too long in reply from server"); ++ return (-1); ++ } ++ + /* + * If there is an external buffer with a size bigger than zero + * and as long as there is space in the external buffer and diff -Nru dma-0.0.2010.06.17/debian/patches/series dma-0.0.2010.06.17/debian/patches/series --- dma-0.0.2010.06.17/debian/patches/series 2011-07-05 12:07:32.000000000 +0000 +++ dma-0.0.2010.06.17/debian/patches/series 2011-12-25 15:13:13.000000000 +0000 @@ -26,3 +26,6 @@ 41-cppcheck.patch 42-fix-ftbfs-binutils-gold.patch 43-const.patch +44-newline.patch +45-received.patch +46-smtp-newline.patch