aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rennie-Waldock <nathan.renniewaldock@gmail.com>2017-12-11 08:13:13 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-12-13 10:01:15 +0000
commit49430d559b95af362e45f00ebe8f683294ac3d5f (patch)
treed5fe1f2e0b26a848199abd0e39d26d97cdcf075d
parentcaeb825fdbf414c235f7279e73ec1a0393b6dfba (diff)
downloadaports-49430d559b95af362e45f00ebe8f683294ac3d5f.tar.gz
aports-49430d559b95af362e45f00ebe8f683294ac3d5f.tar.bz2
aports-49430d559b95af362e45f00ebe8f683294ac3d5f.tar.xz
main/procmail: import procmail-3.23pre patch from Debian
Fixes #8259 (cherry picked from commit b7237382f0459b1c33c578412fac2cc0bb2c1cbb)
-rw-r--r--main/procmail/APKBUILD12
-rw-r--r--main/procmail/procmail-3.23pre.patch257
2 files changed, 261 insertions, 8 deletions
diff --git a/main/procmail/APKBUILD b/main/procmail/APKBUILD
index d3672c381b..39fbc63190 100644
--- a/main/procmail/APKBUILD
+++ b/main/procmail/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=procmail
pkgver=3.22
-pkgrel=2
+pkgrel=3
pkgdesc="Highly configurable auto mail processing"
url="http://www.procmail.org"
arch="all"
@@ -15,6 +15,7 @@ subpackages="$pkgname-doc"
source="ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/procmail-$pkgver.tar.gz
procmail-3.22-getline.patch
CVE-2014-3618.patch
+ procmail-3.23pre.patch
"
_builddir="$srcdir"/procmail-$pkgver
@@ -43,12 +44,7 @@ package() {
install -m644 examples/* ${pkgdir}/usr/share/doc/${pkgname}/examples/
}
-md5sums="1678ea99b973eb77eda4ecf6acae53f1 procmail-3.22.tar.gz
-cf8e5d4854050ab0c836e07406a3dfa9 procmail-3.22-getline.patch
-a24e86941e3357ef4fe51e2ec02b32b1 CVE-2014-3618.patch"
-sha256sums="087c75b34dd33d8b9df5afe9e42801c9395f4bf373a784d9bc97153b0062e117 procmail-3.22.tar.gz
-aaa5ce562e5ef65f56a0225eedda3fcc7ab2938da6097ed4d9b11abf861929de procmail-3.22-getline.patch
-024e6d599abf585d181d8871c5dd69bf9480fee177832a72e7240d351b7954df CVE-2014-3618.patch"
sha512sums="3d0658329a55957a8d5741e03b0853b030c4524acef30641663213aa9eefc8264f8cc2b68a00a89e5f9f0f7c916c41a42e1b6c8df562c545ba97d8ab9049a936 procmail-3.22.tar.gz
b0a908a04d1af27b3ff98326d00d2dde3e6c0ed0d63eec1884bec6a5e9e8d8846140993322ef609b4a7eb882f077581b5a9d56d81c8160b7c29ca95a3aaca868 procmail-3.22-getline.patch
-2d7f9983dd49afcb33de5a856bdc21cfd972b50e8df5ba46b2f61a521f32d842e50f73b34e32f8adbab2acb572d8da4f512bc9f7a2a909584a7b15be9ad9cfcd CVE-2014-3618.patch"
+2d7f9983dd49afcb33de5a856bdc21cfd972b50e8df5ba46b2f61a521f32d842e50f73b34e32f8adbab2acb572d8da4f512bc9f7a2a909584a7b15be9ad9cfcd CVE-2014-3618.patch
+2048e3098daff1cae351dc8212d716f07ed47cd7be64af661e795f3d77c08a082d07ef23e04288f0922b4eceb114917eac2c67046ac7e55146584dcf7e1fadc2 procmail-3.23pre.patch"
diff --git a/main/procmail/procmail-3.23pre.patch b/main/procmail/procmail-3.23pre.patch
new file mode 100644
index 0000000000..4250a5bf54
--- /dev/null
+++ b/main/procmail/procmail-3.23pre.patch
@@ -0,0 +1,257 @@
+From: Santiago Vila <sanvila@debian.org>
+Subject: diff from procmail-3.22 to procmail-3.23pre
+X-Debian-version: 3.22-1
+
+--- a/HISTORY
++++ b/HISTORY
+@@ -491,8 +491,8 @@
+ - Root owned lockfiles aren't bogus
+ - A lone trailing '$' wasn't terminated properly when expanded
+ Changes to formail:
+- - Replies without the -t flag go to the envelope sender
+- - Replies without "-a Resent-" and -t flag ignore the
++ - Replies without the -t option go to the envelope sender
++ - Replies without "-a Resent-" and -t option ignore the
+ Resent-* headers
+ - Prevent corrupt idcaches by suppressing the -n option when
+ splitting with the -D option
+@@ -509,7 +509,7 @@
+ Changed the form of tempfile names to make them `more' unique
+ and deal with filename length limits more gracefully
+ Updated the FAQ and the list of mirrors in the README
+- Documented the exact behavior of lockfile's -! flag
++ Documented the exact behavior of lockfile's -! option
+ Documented the suggested usage of -r vs -rt
+ 2000/08/25: v3.15
+ Changes to procmail:
+@@ -588,7 +588,7 @@
+ Changes to lockfile:
+ - Include the system mailbox lockfile path in the -v output
+ - Resist attempts to use a setuid lockfile command
+- - Fix infinite loop on -l, -r, or -s flag with no value
++ - Fix infinite loop on -l, -r, or -s option with no value
+ Documented formail's treatment of >From_ lines as continuations
+ of the From_ line and warned of problems caused by non-RFC822
+ field names like 'Old-From '
+@@ -623,3 +623,8 @@
+ More paranoia: start to use strlcpy()
+ Generate safe temp and maildir filenames when the hostname
+ contains / or : by mapping them to \ooo
++2001/09/13: v3.23pre
++ Changes to procmail:
++ - Don't coredump in comsat code if interrupted early
++ - Correctly handle COMSAT=on
++ - Once used the 'H' flag would never be cleared
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -1,5 +1,5 @@
+ #define VERSION "\
+- v3.22 2001/09/10\n\
++ v3.23pre 2001/09/13\n\
+ Copyright (c) 1990-2001, Stephen R. van den Berg\t<srb@cuci.nl>\n\
+ Copyright (c) 1997-2001, Philip A. Guenther\t\t<guenther@sendmail.com>\n\
+ \n\
+--- a/src/comsat.c
++++ b/src/comsat.c
+@@ -9,7 +9,7 @@
+
+ #ifdef RCS
+ static /*const*/char rcsid[]=
+- "$Id: comsat.c,v 1.5 2001/07/03 15:05:47 guenther Exp $";
++ "$Id: comsat.c,v 1.7 2001/09/13 19:08:49 guenther Exp $";
+ #endif
+
+ #include "procmail.h"
+@@ -92,7 +92,7 @@
+ }
+ if(newvalid) /* so far, so good */
+ { int s;
+- if(!*chp) /* no service */
++ if(!chad||!*chp) /* no service */
+ chp=BIFF_serviceport; /* new balls please! */
+ s=strtol(chp,&chad,10);
+ if(chp!=chad) /* the service is not numeric */
+@@ -120,7 +120,7 @@
+ { int s;const char*p;
+ if(!csvalid||!buf) /* is comat on and set to a valid address? */
+ return;
+- if(!*cslgname||strlen(cslgname)+2>linebuf) /* is $LOGNAME bogus? */
++ if(!cslgname||!*cslgname||strlen(cslgname)+2>linebuf)/* is $LOGNAME bogus? */
+ return;
+ if(!(p=folder?folder:cslastf)) /* do we have a folder? */
+ return;
+--- a/src/header.h
++++ b/src/header.h
+@@ -4,12 +4,11 @@
+ * "-m nnn" fields encountered should be among them or one of *
+ * the special From_, Article_ or X- fields). *
+ * *
+- * If you need to add one (be sure to update "cdigest" below as *
+- * well!), drop me a mail, I might be interested in including *
+- * it in the next release. *
++ * If you need to add one, drop me an email at bug@procmail.org. *
++ * I might be interested in including it in the next release. *
+ * *
+ ************************************************************************/
+-/*$Id: header.h,v 1.44 1999/07/06 06:12:22 guenther Exp $*/
++/*$Id: header.h,v 1.45 2001/09/24 03:38:08 guenther Exp $*/
+
+ X(returnpath, "Return-Path:") /* RFC 822 */
+ X(received, "Received:") /* ditto ... */
+--- a/src/lmtp.c
++++ b/src/lmtp.c
+@@ -7,7 +7,7 @@
+ ************************************************************************/
+ #ifdef RCS
+ static /*const*/char rcsid[]=
+- "$Id: lmtp.c,v 1.13 2001/06/28 21:44:28 guenther Exp $"
++ "$Id: lmtp.c,v 1.14 2001/09/23 20:17:57 guenther Exp $"
+ #endif
+ #include "procmail.h"
+ #ifdef LMTP
+@@ -708,7 +708,7 @@
+ got-=in-p; /* correct for what disappeared */
+ }
+ while(left-=got); /* change listed buffer size */
+- *(long*)statep=state; /* save state */
++ *(int*)statep=state; /* save state */
+ return 0;
+ }
+
+@@ -765,7 +765,7 @@
+ got-=in-p; /* correct for what disappeared */
+ }
+ while(left-=got); /* change listed buffer size */
+- *(long*)statep=state; /* save state */
++ *(int*)statep=state; /* save state */
+ return 0;
+ }
+
+--- a/src/memblk.c
++++ b/src/memblk.c
+@@ -8,7 +8,7 @@
+ ************************************************************************/
+ #ifdef RCS
+ static /*const*/char rcsid[]=
+- "$Id: memblk.c,v 1.6 2001/06/28 22:55:09 guenther Exp $"
++ "$Id: memblk.c,v 1.7 2001/09/18 21:59:08 guenther Exp $"
+ #endif
+ #include "procmail.h"
+ #include "robust.h"
+@@ -51,11 +51,11 @@
+ {
+ #ifdef USE_MMAP
+ if(mb->fd>=0)
+- { long len=mb->len+1;
+- if(munmap(mb->p,len))
+- mmapfailed(len); /* don't want to continue here */
+- if((mb->p=mmap(0,len,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
+- mmapfailed(len);
++ { long mlen=mb->len+1;
++ if(munmap(mb->p,mlen))
++ mmapfailed(mlen); /* don't want to continue here */
++ if((mb->p=mmap(0,mlen,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
++ mmapfailed(mlen);
+ close(mb->fd);
+ mb->fd=ropen(devnull,O_RDWR,0); /* XXX Perhaps -1 is better? */
+ }
+@@ -77,8 +77,8 @@
+ strcpy(filename,MMAP_DIR);
+ if(unique(filename,strchr(filename,'\0'),MMAP_FILE_LEN,MMAP_PERM,0,0)&&
+ (mb->fd=ropen(filename,O_RDWR,MMAP_PERM),unlink(filename),mb->fd>=0))
+- { mb->filelen=len;
+- if(lseek(mb->fd,mb->filelen-1,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
++ { mb->filelen=len+1;
++ if(lseek(mb->fd,len,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
+ dropf: { close(mb->fd);mb->fd= -1;
+ if(verbose)nlog("Unable to extend or use tempfile");
+ }
+@@ -98,9 +98,9 @@
+ }
+ }
+ if(mb->fd>=0)
+- { if(len>mb->filelen) /* need to extend? */
+- { mb->filelen=len;
+- if(lseek(mb->fd,mb->filelen-1,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
++ { if(len>=mb->filelen) /* need to extend? */
++ { mb->filelen=len+1;
++ if(lseek(mb->fd,len,SEEK_SET)<0||1!=rwrite(mb->fd,empty,1))
+ { char*p=malloc(len+1); /* can't extend, switch to malloc */
+ tmemmove(p,mb->p,mb->len);
+ munmap(mb->p,mb->len+1);
+@@ -124,9 +124,9 @@
+ }
+ else
+ mb->p=realloc(mb->p,len+1);
+- mb->len=len+1;
+- mb->p[len]='\0';
++ mb->len=len;
+ ret1:
++ mb->p[len]='\0';
+ return 1;
+ }
+
+--- a/src/memblk.h
++++ b/src/memblk.h
+@@ -1,6 +1,6 @@
+ typedef struct memblk {
+ char*p; /* where it starts */
+- long len; /* currently allocated size */
++ long len; /* current size, not including trailing NUL */
+ #ifdef USE_MMAP
+ off_t filelen; /* how long is the file */
+ int fd; /* file which is mmap()ed */
+--- a/src/pipes.c
++++ b/src/pipes.c
+@@ -8,7 +8,7 @@
+ ************************************************************************/
+ #ifdef RCS
+ static /*const*/char rcsid[]=
+- "$Id: pipes.c,v 1.73 2001/08/27 08:43:59 guenther Exp $";
++ "$Id: pipes.c,v 1.74 2001/09/18 22:01:27 guenther Exp $";
+ #endif
+ #include "procmail.h"
+ #include "robust.h"
+@@ -145,7 +145,9 @@
+ if(Stdout)
+ { *(eq=strchr(Stdout,'\0')-1)='\0'; /* chop the '=' */
+ if(!(backblock=getenv(Stdout))) /* no current value? */
+- PRDB=PWRB= -1;
++ { PRDB=PWRB= -1;
++ backlen=0;
++ }
+ else
+ { backlen=strlen(backblock);
+ goto pip;
+@@ -155,9 +157,7 @@
+ pip: rpipe(pbackfd);
+ rpipe(pinfd); /* main pipes setup */
+ if(!(pidchild=sfork())) /* create a sending procmail */
+- { if(Stdout&&backblock)
+- backlen=strlen(backblock);
+- else
++ { if(!Stdout)
+ backblock=source,backlen=len;
+ childsetup();rclose(PRDI);rclose(PRDB);
+ rpipe(poutfd);rclose(STDOUT);
+--- a/src/procmail.c
++++ b/src/procmail.c
+@@ -14,7 +14,7 @@
+ ************************************************************************/
+ #ifdef RCS
+ static /*const*/char rcsid[]=
+- "$Id: procmail.c,v 1.183 2001/08/31 04:57:36 guenther Exp $";
++ "$Id: procmail.c,v 1.184 2001/09/14 05:54:19 guenther Exp $";
+ #endif
+ #include "../patchlevel.h"
+ #include "procmail.h"
+@@ -652,8 +652,7 @@
+ nrcond= -1;
+ if(tolock) /* clear temporary buffer for lockfile name */
+ free(tolock);
+- for(i=maxindex(flags);i;i--) /* clear the flags */
+- flags[i]=0;
++ bbzero(flags,maxindex(flags)); /* clear the flags */
+ for(tolock=0,locknext=0;;)
+ { chp=skpspace(chp);
+ switch(i= *chp++)