public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/files/, mail-filter/procmail/
@ 2019-03-24  0:26 Aaron Bauman
  0 siblings, 0 replies; 5+ messages in thread
From: Aaron Bauman @ 2019-03-24  0:26 UTC (permalink / raw
  To: gentoo-commits

commit:     31e0e8db9e641bbe158add9c6d4907f2c3eb2d57
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 24 00:22:31 2019 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Sun Mar 24 00:26:04 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31e0e8db

mail-filter/procmail: revbump to fix longstanding vulnerabilities

This patch is a combination of patches from the OSS ML and the Debian
bug tracker.  Both patches and authors can be found in the below
referenced bugs.

Bug: https://bugs.gentoo.org/522114
Bug: https://bugs.gentoo.org/638108
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 .../files/procmail-CVE-2014-3618-16844.patch       |  25 +++++
 mail-filter/procmail/procmail-3.22-r12.ebuild      | 123 +++++++++++++++++++++
 2 files changed, 148 insertions(+)

diff --git a/mail-filter/procmail/files/procmail-CVE-2014-3618-16844.patch b/mail-filter/procmail/files/procmail-CVE-2014-3618-16844.patch
new file mode 100644
index 00000000000..4f1714063c9
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-CVE-2014-3618-16844.patch
@@ -0,0 +1,25 @@
+--- a/src/formisc.c	2019-03-23 19:52:18.450174402 -0400
++++ b/src/formisc.c	2019-03-23 19:52:47.914351039 -0400
+@@ -84,12 +84,11 @@
+ 	case '"':*target++=delim='"';start++;
+       }
+      ;{ int i;
+-	do
++	while(*start);
+ 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
+ 	      break;
+ 	   else if(i=='\\'&&*start)		    /* skip quoted character */
+ 	      *target++= *start++;
+-	while(*start);						/* anything? */
+       }
+      hitspc=2;
+    }
+@@ -104,7 +103,7 @@
+ }
+ 							    /* append to buf */
+ void loadbuf(text,len)const char*const text;const size_t len;
+-{ if(buffilled+len>buflen)			  /* buf can't hold the text */
++{ while(buffilled+len>buflen)			  /* buf can't hold the text */
+      buf=realloc(buf,buflen+=Bsize);
+   tmemmove(buf+buffilled,text,len);buffilled+=len;
+ }

diff --git a/mail-filter/procmail/procmail-3.22-r12.ebuild b/mail-filter/procmail/procmail-3.22-r12.ebuild
new file mode 100644
index 00000000000..dc9660af9c1
--- /dev/null
+++ b/mail-filter/procmail/procmail-3.22-r12.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Mail delivery agent/filter"
+HOMEPAGE="http://www.procmail.org/"
+SRC_URI="http://www.procmail.org/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="mbox selinux"
+
+DEPEND="virtual/mta"
+RDEPEND="selinux? ( sec-policy/selinux-procmail )"
+
+src_prepare() {
+	# disable flock, using both fcntl and flock style locking
+	# doesn't work with NFS with 2.6.17+ kernels, bug #156493
+
+	sed -e "s:/\*#define NO_flock_LOCK:#define NO_flock_LOCK:" \
+		-i config.h || die "sed failed"
+
+	if ! use mbox ; then
+		echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc || die
+		echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc || die
+		cd "${S}" || die
+		eapply "${FILESDIR}/gentoo-maildir3.diff"
+	else
+		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
+		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
+	fi
+
+	# Do not use lazy bindings on lockfile and procmail
+	if [[ ${CHOST} != *-darwin* ]]; then
+		eapply -p0 "${FILESDIR}/${PN}-lazy-bindings.diff"
+	fi
+
+	# Fix for bug #102340
+	eapply -p0 "${FILESDIR}/${PN}-comsat-segfault.diff"
+
+	# Fix for bug #119890
+	eapply -p0 "${FILESDIR}/${PN}-maxprocs-fix.diff"
+
+	# Prefixify config.h
+	eapply -p0 "${FILESDIR}"/${PN}-prefix.patch
+	eprefixify config.h Makefile src/autoconf src/recommend.c
+
+	# Fix for bug #200006
+	eapply "${FILESDIR}/${PN}-pipealloc.diff"
+
+	# Fix for bug #270551
+	eapply "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
+
+	# Fix security bugs #522114 and #638108
+	eapply "${FILESDIR}/${PN}-CVE-2014-3618-16844.patch"
+
+	eapply_user
+}
+
+src_compile() {
+	# -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
+	# To work around this, we append -fno-inline-functions to CFLAGS
+	# Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
+	# If it's clang, ignore -fno-ipa-cp-clone, as clang doesn't support this
+	case "$(tc-getCC)" in
+		"clang") append-flags -fno-inline-functions ;;
+		"gcc"|*) append-flags -fno-inline-functions -fno-ipa-cp-clone ;;
+	esac
+
+	sed -e "s:CFLAGS0 = -O:CFLAGS0 = ${CFLAGS}:" \
+		-e "s:LDFLAGS0= -s:LDFLAGS0 = ${LDFLAGS}:" \
+		-e "s:LOCKINGTEST=__defaults__:#LOCKINGTEST=__defaults__:" \
+		-e "s:#LOCKINGTEST=/tmp:LOCKINGTEST=/tmp:" \
+		-i Makefile || die "sed failed"
+
+	emake CC="$(tc-getCC)"
+}
+
+src_install() {
+	cd "${S}"/new || die
+	insinto /usr/bin
+	insopts -m 6755
+	doins procmail
+
+	doins lockfile
+	fowners root:mail /usr/bin/lockfile
+	fperms 2755 /usr/bin/lockfile
+
+	dobin formail mailstat
+	insopts -m 0644
+
+	doman *.1 *.5
+
+	cd "${S}" || die
+	dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
+
+	insinto /etc
+	doins procmailrc
+
+	docinto examples
+	dodoc examples/*
+}
+
+pkg_postinst() {
+	if ! use mbox ; then
+		elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
+		elog "that you configure a mail storage location using DEFAULT in"
+		elog "/etc/procmailrc, for example:"
+		elog "\tDEFAULT=\$HOME/.maildir/"
+	fi
+	if has sfperms ${FEATURES}; then
+		ewarn "FEATURES=sfperms removes the read-bit for others from"
+		ewarn "  /usr/bin/procmail"
+		ewarn "  /usr/bin/lockfile"
+		ewarn "If you use procmail from an MTA like Exim, you need to"
+		ewarn "re-add the read-bit or avoid the MTA checking the binary"
+		ewarn "exists."
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/files/, mail-filter/procmail/
@ 2019-03-28  0:44 Thomas Deutschmann
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Deutschmann @ 2019-03-28  0:44 UTC (permalink / raw
  To: gentoo-commits

commit:     038c9f3140b69054f3de9cb4f1a6ccf292510952
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 28 00:44:20 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Mar 28 00:44:20 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=038c9f31

mail-filter/procmail: re-add security fix with crash fix

Bug: https://bugs.gentoo.org/638108
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 .../procmail/files/procmail-3.22-crash-fix.patch   |  58 ++++++++++
 mail-filter/procmail/procmail-3.22-r13.ebuild      | 125 +++++++++++++++++++++
 2 files changed, 183 insertions(+)

diff --git a/mail-filter/procmail/files/procmail-3.22-crash-fix.patch b/mail-filter/procmail/files/procmail-3.22-crash-fix.patch
new file mode 100644
index 00000000000..8563ea3d1d4
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-crash-fix.patch
@@ -0,0 +1,58 @@
+diff --git a/src/cstdio.c b/src/cstdio.c
+index 7b6fe6d..0a0bd5b 100644
+--- a/src/cstdio.c
++++ b/src/cstdio.c
+@@ -144,7 +144,7 @@ int getbl(p,end)char*p,*end;					  /* my gets */
+       { case '\n':case EOF:*q='\0';
+ 	   return overflow?-1:p!=q;	     /* did we read anything at all? */
+       }
+-     if(q==end)	    /* check here so that a trailing backslash won't be lost */
++     if(q>=end)	    /* check here so that a trailing backslash won't be lost */
+ 	q=p,overflow=1;
+      *q++=i;
+    }
+@@ -199,7 +199,7 @@ int getlline(target,end)char*target,*end;
+ 	   if(*(target=strchr(target,'\0')-1)=='\\')
+ 	    { if(chp2!=target)				  /* non-empty line? */
+ 		 target++;		      /* then preserve the backslash */
+-	      if(target>end-2)			  /* space enough for getbl? */
++	      if(target>=end-2)			  /* space enough for getbl? */
+ 		 target=end-linebuf,overflow=1;		/* toss what we have */
+ 	      continue;
+ 	    }
+diff --git a/src/formail.c b/src/formail.c
+index 1f5c9dd..49b9967 100644
+--- a/src/formail.c
++++ b/src/formail.c
+@@ -219,7 +219,8 @@ static char*getsender(namep,fldp,headreply)char*namep;struct field*fldp;
+   if(i>=0&&(i!=maxindex(sest)||fldp==rdheader))		  /* found anything? */
+    { char*saddr;char*tmp;			     /* determine the weight */
+      nowm=areply&&headreply?headreply==1?sest[i].wrepl:sest[i].wrrepl:i;chp+=j;
+-     tmp=malloc(j=fldp->Tot_len-j);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
++     tmp=malloc((j=fldp->Tot_len-j) + 1);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
++     chp[j]='\0';
+      if(sest[i].head==From_)
+       { char*pastad;
+ 	if(strchr(saddr=chp,'\n'))		     /* multiple From_ lines */
+@@ -364,7 +365,7 @@ static PROGID;
+ 
+ int main(lastm,argv)int lastm;const char*const argv[];
+ { int i,split=0,force=0,bogus=1,every=0,headreply=0,digest=0,nowait=0,keepb=0,
+-   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart,
++   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart=0,
+    berkeley=0,forgetclen;
+   long maxlen,ctlength;FILE*idcache=0;pid_t thepid;
+   size_t j,lnl,escaplen;char*chp,*namep,*escap=ESCAP;
+diff --git a/src/formisc.c b/src/formisc.c
+index c48df52..5c2869d 100644
+--- a/src/formisc.c
++++ b/src/formisc.c
+@@ -66,7 +66,7 @@ inc:	   start++;
+ retz:	      *target='\0';
+ ret:	      return start;
+ 	    }
+-	   if(*start=='\\')
++	   if(*start=='\\' && *(start + 1))
+ 	      *target++='\\',start++;
+ 	   hitspc=2;
+ 	   goto normal;					      /* normal word */

diff --git a/mail-filter/procmail/procmail-3.22-r13.ebuild b/mail-filter/procmail/procmail-3.22-r13.ebuild
new file mode 100644
index 00000000000..9597d1ca647
--- /dev/null
+++ b/mail-filter/procmail/procmail-3.22-r13.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Mail delivery agent/filter"
+HOMEPAGE="http://www.procmail.org/"
+SRC_URI="http://www.procmail.org/${P}.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="mbox selinux"
+
+DEPEND="virtual/mta"
+RDEPEND="selinux? ( sec-policy/selinux-procmail )"
+
+src_prepare() {
+	# disable flock, using both fcntl and flock style locking
+	# doesn't work with NFS with 2.6.17+ kernels, bug #156493
+
+	sed -e "s:/\*#define NO_flock_LOCK:#define NO_flock_LOCK:" \
+		-i config.h || die "sed failed"
+
+	if ! use mbox ; then
+		echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc || die
+		echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc || die
+		cd "${S}" || die
+		eapply "${FILESDIR}/gentoo-maildir3.diff"
+	else
+		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
+		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
+	fi
+
+	# Do not use lazy bindings on lockfile and procmail
+	if [[ ${CHOST} != *-darwin* ]]; then
+		eapply -p0 "${FILESDIR}/${PN}-lazy-bindings.diff"
+	fi
+
+	# Fix for bug #102340
+	eapply -p0 "${FILESDIR}/${PN}-comsat-segfault.diff"
+
+	# Fix for bug #119890
+	eapply -p0 "${FILESDIR}/${PN}-maxprocs-fix.diff"
+
+	# Prefixify config.h
+	eapply -p0 "${FILESDIR}"/${PN}-prefix.patch
+	eprefixify config.h Makefile src/autoconf src/recommend.c
+
+	# Fix for bug #200006
+	eapply "${FILESDIR}/${PN}-pipealloc.diff"
+
+	# Fix for bug #270551
+	eapply "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
+
+	# Fix security bugs #522114 and #638108
+	eapply "${FILESDIR}/${PN}-CVE-2014-3618-16844.patch"
+
+	eapply "${FILESDIR}/${PN}-3.22-crash-fix.patch"
+
+	eapply_user
+}
+
+src_compile() {
+	# -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
+	# To work around this, we append -fno-inline-functions to CFLAGS
+	# Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
+	# If it's clang, ignore -fno-ipa-cp-clone, as clang doesn't support this
+	case "$(tc-getCC)" in
+		"clang") append-flags -fno-inline-functions ;;
+		"gcc"|*) append-flags -fno-inline-functions -fno-ipa-cp-clone ;;
+	esac
+
+	sed -e "s:CFLAGS0 = -O:CFLAGS0 = ${CFLAGS}:" \
+		-e "s:LDFLAGS0= -s:LDFLAGS0 = ${LDFLAGS}:" \
+		-e "s:LOCKINGTEST=__defaults__:#LOCKINGTEST=__defaults__:" \
+		-e "s:#LOCKINGTEST=/tmp:LOCKINGTEST=/tmp:" \
+		-i Makefile || die "sed failed"
+
+	emake CC="$(tc-getCC)"
+}
+
+src_install() {
+	cd "${S}"/new || die
+	insinto /usr/bin
+	insopts -m 6755
+	doins procmail
+
+	doins lockfile
+	fowners root:mail /usr/bin/lockfile
+	fperms 2755 /usr/bin/lockfile
+
+	dobin formail mailstat
+	insopts -m 0644
+
+	doman *.1 *.5
+
+	cd "${S}" || die
+	dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
+
+	insinto /etc
+	doins procmailrc
+
+	docinto examples
+	dodoc examples/*
+}
+
+pkg_postinst() {
+	if ! use mbox ; then
+		elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
+		elog "that you configure a mail storage location using DEFAULT in"
+		elog "/etc/procmailrc, for example:"
+		elog "\tDEFAULT=\$HOME/.maildir/"
+	fi
+	if has sfperms ${FEATURES}; then
+		ewarn "FEATURES=sfperms removes the read-bit for others from"
+		ewarn "  /usr/bin/procmail"
+		ewarn "  /usr/bin/lockfile"
+		ewarn "If you use procmail from an MTA like Exim, you need to"
+		ewarn "re-add the read-bit or avoid the MTA checking the binary"
+		ewarn "exists."
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/files/, mail-filter/procmail/
@ 2019-03-30 17:03 Thomas Deutschmann
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Deutschmann @ 2019-03-30 17:03 UTC (permalink / raw
  To: gentoo-commits

commit:     ff36e4f6862f3949e3bfedd7bb352cd9d0602ffe
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 30 17:02:56 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Mar 30 17:02:56 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff36e4f6

mail-filter/procmail: replace patch for CVE-2014-3618

Fixes an infinite loop.

Bug: https://bugs.gentoo.org/638108
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 .../files/procmail-3.22-CVE-2014-3618.patch        | 18 ++++++++++++++++
 .../files/procmail-3.22-CVE-2017-16844.patch       | 13 +++++++++++
 .../files/procmail-CVE-2014-3618-16844.patch       | 25 ----------------------
 ...il-3.22-r13.ebuild => procmail-3.22-r14.ebuild} |  3 ++-
 4 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/mail-filter/procmail/files/procmail-3.22-CVE-2014-3618.patch b/mail-filter/procmail/files/procmail-3.22-CVE-2014-3618.patch
new file mode 100644
index 00000000000..124d1f99685
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-CVE-2014-3618.patch
@@ -0,0 +1,18 @@
+diff --git a/src/formisc.c b/src/formisc.c
+index 338733b..c48df52 100644
+--- a/src/formisc.c
++++ b/src/formisc.c
+@@ -84,12 +84,11 @@ normal:	   *target++= *start++;
+ 	case '"':*target++=delim='"';start++;
+       }
+      ;{ int i;
+-	do
++	while(*start)						/* anything? */
+ 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
+ 	      break;
+ 	   else if(i=='\\'&&*start)		    /* skip quoted character */
+ 	      *target++= *start++;
+-	while(*start);						/* anything? */
+       }
+      hitspc=2;
+    }

diff --git a/mail-filter/procmail/files/procmail-3.22-CVE-2017-16844.patch b/mail-filter/procmail/files/procmail-3.22-CVE-2017-16844.patch
new file mode 100644
index 00000000000..5e610d723da
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.22-CVE-2017-16844.patch
@@ -0,0 +1,13 @@
+diff --git a/src/formisc.c b/src/formisc.c
+index 5c2869d..54fd013 100644
+--- a/src/formisc.c
++++ b/src/formisc.c
+@@ -103,7 +103,7 @@ void loadsaved(sp)const struct saved*const sp;	     /* load some saved text */
+ }
+ 							    /* append to buf */
+ void loadbuf(text,len)const char*const text;const size_t len;
+-{ if(buffilled+len>buflen)			  /* buf can't hold the text */
++{ while(buffilled+len>buflen)			  /* buf can't hold the text */
+      buf=realloc(buf,buflen+=Bsize);
+   tmemmove(buf+buffilled,text,len);buffilled+=len;
+ }

diff --git a/mail-filter/procmail/files/procmail-CVE-2014-3618-16844.patch b/mail-filter/procmail/files/procmail-CVE-2014-3618-16844.patch
deleted file mode 100644
index 4f1714063c9..00000000000
--- a/mail-filter/procmail/files/procmail-CVE-2014-3618-16844.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- a/src/formisc.c	2019-03-23 19:52:18.450174402 -0400
-+++ b/src/formisc.c	2019-03-23 19:52:47.914351039 -0400
-@@ -84,12 +84,11 @@
- 	case '"':*target++=delim='"';start++;
-       }
-      ;{ int i;
--	do
-+	while(*start);
- 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
- 	      break;
- 	   else if(i=='\\'&&*start)		    /* skip quoted character */
- 	      *target++= *start++;
--	while(*start);						/* anything? */
-       }
-      hitspc=2;
-    }
-@@ -104,7 +103,7 @@
- }
- 							    /* append to buf */
- void loadbuf(text,len)const char*const text;const size_t len;
--{ if(buffilled+len>buflen)			  /* buf can't hold the text */
-+{ while(buffilled+len>buflen)			  /* buf can't hold the text */
-      buf=realloc(buf,buflen+=Bsize);
-   tmemmove(buf+buffilled,text,len);buffilled+=len;
- }

diff --git a/mail-filter/procmail/procmail-3.22-r13.ebuild b/mail-filter/procmail/procmail-3.22-r14.ebuild
similarity index 97%
rename from mail-filter/procmail/procmail-3.22-r13.ebuild
rename to mail-filter/procmail/procmail-3.22-r14.ebuild
index 9534c350bf8..d99a4ffde72 100644
--- a/mail-filter/procmail/procmail-3.22-r13.ebuild
+++ b/mail-filter/procmail/procmail-3.22-r14.ebuild
@@ -56,7 +56,8 @@ src_prepare() {
 	eapply "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
 
 	# Fix security bugs #522114 and #638108
-	eapply "${FILESDIR}/${PN}-CVE-2014-3618-16844.patch"
+	eapply "${FILESDIR}/${PN}-3.22-CVE-2014-3618.patch"
+	eapply "${FILESDIR}/${PN}-3.22-CVE-2017-16844.patch"
 
 	eapply "${FILESDIR}/${PN}-3.22-crash-fix.patch"
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/files/, mail-filter/procmail/
@ 2024-02-25  9:27 Yixun Lan
  0 siblings, 0 replies; 5+ messages in thread
From: Yixun Lan @ 2024-02-25  9:27 UTC (permalink / raw
  To: gentoo-commits

commit:     7a66af10677517dfca3ddfe3d3599b2e53ba45f9
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 25 09:12:35 2024 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sun Feb 25 09:27:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a66af10

mail-filter/procmail: drop 3.22-r15, 3.22-r16

cleanup old EAPI=6 after stabilization

Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 mail-filter/procmail/Manifest                      |   1 -
 mail-filter/procmail/files/gentoo-maildir3.diff    |  12 --
 .../files/procmail-3.22-CVE-2014-3618.patch        |  18 ---
 .../files/procmail-3.22-CVE-2017-16844.patch       |  13 --
 .../procmail/files/procmail-3.22-crash-fix.patch   |  58 --------
 .../procmail/files/procmail-3.22-glibc-2.10.patch  |  70 ----------
 .../procmail/files/procmail-comsat-segfault.diff   |  20 ---
 .../procmail/files/procmail-lazy-bindings.diff     |  16 ---
 .../procmail/files/procmail-maxprocs-fix.diff      |  11 --
 mail-filter/procmail/files/procmail-pipealloc.diff |  21 ---
 mail-filter/procmail/files/procmail-prefix.patch   | 155 ---------------------
 mail-filter/procmail/procmail-3.22-r15.ebuild      | 125 -----------------
 mail-filter/procmail/procmail-3.22-r16.ebuild      | 135 ------------------
 13 files changed, 655 deletions(-)

diff --git a/mail-filter/procmail/Manifest b/mail-filter/procmail/Manifest
index e05644b06225..24540afb4bdf 100644
--- a/mail-filter/procmail/Manifest
+++ b/mail-filter/procmail/Manifest
@@ -1,2 +1 @@
-DIST procmail-3.22.tar.gz 226817 BLAKE2B 4fd4641abcd3a897ea19bd8f76446f88806d22649d5221f8cef6f9efc29f7fcc02c9707cbf00c32fe247f16579d28fd887d3c18c4d3a2f8877c351bf92e85866 SHA512 3d0658329a55957a8d5741e03b0853b030c4524acef30641663213aa9eefc8264f8cc2b68a00a89e5f9f0f7c916c41a42e1b6c8df562c545ba97d8ab9049a936
 DIST procmail-3.24.gh.tar.gz 299704 BLAKE2B 3223e9551a48329da88545bc8b90a346dea1182ba5ec6221acbe7a76cf01485b7115194087104bd042eeec3660de9f6146c5b9d984763fee1e2174f1edd59c11 SHA512 ce3763205d7e34c8a096c411487de296ecfb190ba817ad07926d44811222e689faedb97a3d4e85989db70e5a2298b26fff70c9d0cb0324a447ddc8988d7fe8ea

diff --git a/mail-filter/procmail/files/gentoo-maildir3.diff b/mail-filter/procmail/files/gentoo-maildir3.diff
deleted file mode 100644
index 51dfef64ae8b..000000000000
--- a/mail-filter/procmail/files/gentoo-maildir3.diff
+++ /dev/null
@@ -1,12 +0,0 @@
---- procmail-3.22/src/authenticate.c.orig	2002-07-26 20:38:52.000000000 -0400
-+++ procmail-3.22/src/authenticate.c	2002-07-26 20:57:56.000000000 -0400
-@@ -39,7 +39,7 @@
- #include "authenticate.h"
- 
- #ifndef MAILSPOOLDIR
--#define MAILSPOOLDIR	"/var/spool/mail/"	     /* watch the trailing / */
-+#define MAILSPOOLDIR	""	     /* watch the trailing / */
- #endif
- #ifndef MAILSPOOLSUFFIX
- #define MAILSPOOLSUFFIX ""	      /* suffix to force maildir or MH style */
- 

diff --git a/mail-filter/procmail/files/procmail-3.22-CVE-2014-3618.patch b/mail-filter/procmail/files/procmail-3.22-CVE-2014-3618.patch
deleted file mode 100644
index 124d1f996852..000000000000
--- a/mail-filter/procmail/files/procmail-3.22-CVE-2014-3618.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/src/formisc.c b/src/formisc.c
-index 338733b..c48df52 100644
---- a/src/formisc.c
-+++ b/src/formisc.c
-@@ -84,12 +84,11 @@ normal:	   *target++= *start++;
- 	case '"':*target++=delim='"';start++;
-       }
-      ;{ int i;
--	do
-+	while(*start)						/* anything? */
- 	   if((i= *target++= *start++)==delim)	 /* corresponding delimiter? */
- 	      break;
- 	   else if(i=='\\'&&*start)		    /* skip quoted character */
- 	      *target++= *start++;
--	while(*start);						/* anything? */
-       }
-      hitspc=2;
-    }

diff --git a/mail-filter/procmail/files/procmail-3.22-CVE-2017-16844.patch b/mail-filter/procmail/files/procmail-3.22-CVE-2017-16844.patch
deleted file mode 100644
index 5e610d723da0..000000000000
--- a/mail-filter/procmail/files/procmail-3.22-CVE-2017-16844.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/formisc.c b/src/formisc.c
-index 5c2869d..54fd013 100644
---- a/src/formisc.c
-+++ b/src/formisc.c
-@@ -103,7 +103,7 @@ void loadsaved(sp)const struct saved*const sp;	     /* load some saved text */
- }
- 							    /* append to buf */
- void loadbuf(text,len)const char*const text;const size_t len;
--{ if(buffilled+len>buflen)			  /* buf can't hold the text */
-+{ while(buffilled+len>buflen)			  /* buf can't hold the text */
-      buf=realloc(buf,buflen+=Bsize);
-   tmemmove(buf+buffilled,text,len);buffilled+=len;
- }

diff --git a/mail-filter/procmail/files/procmail-3.22-crash-fix.patch b/mail-filter/procmail/files/procmail-3.22-crash-fix.patch
deleted file mode 100644
index 8563ea3d1d4c..000000000000
--- a/mail-filter/procmail/files/procmail-3.22-crash-fix.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/src/cstdio.c b/src/cstdio.c
-index 7b6fe6d..0a0bd5b 100644
---- a/src/cstdio.c
-+++ b/src/cstdio.c
-@@ -144,7 +144,7 @@ int getbl(p,end)char*p,*end;					  /* my gets */
-       { case '\n':case EOF:*q='\0';
- 	   return overflow?-1:p!=q;	     /* did we read anything at all? */
-       }
--     if(q==end)	    /* check here so that a trailing backslash won't be lost */
-+     if(q>=end)	    /* check here so that a trailing backslash won't be lost */
- 	q=p,overflow=1;
-      *q++=i;
-    }
-@@ -199,7 +199,7 @@ int getlline(target,end)char*target,*end;
- 	   if(*(target=strchr(target,'\0')-1)=='\\')
- 	    { if(chp2!=target)				  /* non-empty line? */
- 		 target++;		      /* then preserve the backslash */
--	      if(target>end-2)			  /* space enough for getbl? */
-+	      if(target>=end-2)			  /* space enough for getbl? */
- 		 target=end-linebuf,overflow=1;		/* toss what we have */
- 	      continue;
- 	    }
-diff --git a/src/formail.c b/src/formail.c
-index 1f5c9dd..49b9967 100644
---- a/src/formail.c
-+++ b/src/formail.c
-@@ -219,7 +219,8 @@ static char*getsender(namep,fldp,headreply)char*namep;struct field*fldp;
-   if(i>=0&&(i!=maxindex(sest)||fldp==rdheader))		  /* found anything? */
-    { char*saddr;char*tmp;			     /* determine the weight */
-      nowm=areply&&headreply?headreply==1?sest[i].wrepl:sest[i].wrrepl:i;chp+=j;
--     tmp=malloc(j=fldp->Tot_len-j);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
-+     tmp=malloc((j=fldp->Tot_len-j) + 1);tmemmove(tmp,chp,j);(chp=tmp)[j-1]='\0';
-+     chp[j]='\0';
-      if(sest[i].head==From_)
-       { char*pastad;
- 	if(strchr(saddr=chp,'\n'))		     /* multiple From_ lines */
-@@ -364,7 +365,7 @@ static PROGID;
- 
- int main(lastm,argv)int lastm;const char*const argv[];
- { int i,split=0,force=0,bogus=1,every=0,headreply=0,digest=0,nowait=0,keepb=0,
--   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart,
-+   minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart=0,
-    berkeley=0,forgetclen;
-   long maxlen,ctlength;FILE*idcache=0;pid_t thepid;
-   size_t j,lnl,escaplen;char*chp,*namep,*escap=ESCAP;
-diff --git a/src/formisc.c b/src/formisc.c
-index c48df52..5c2869d 100644
---- a/src/formisc.c
-+++ b/src/formisc.c
-@@ -66,7 +66,7 @@ inc:	   start++;
- retz:	      *target='\0';
- ret:	      return start;
- 	    }
--	   if(*start=='\\')
-+	   if(*start=='\\' && *(start + 1))
- 	      *target++='\\',start++;
- 	   hitspc=2;
- 	   goto normal;					      /* normal word */

diff --git a/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch b/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch
deleted file mode 100644
index 2663bf501188..000000000000
--- a/mail-filter/procmail/files/procmail-3.22-glibc-2.10.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff -NrU5 procmail-3.22.orig/src/fields.c procmail-3.22/src/fields.c
---- procmail-3.22.orig/src/fields.c	2009-05-21 18:21:25.000000000 +0200
-+++ procmail-3.22/src/fields.c	2009-05-21 18:22:14.000000000 +0200
-@@ -108,20 +108,20 @@
- 	extractfield(p);
- }
- 		    /* try and append one valid field to rdheader from stdin */
- int readhead P((void))
- { int idlen;
--  getline();
-+  procmail_getline();
-   if((idlen=breakfield(buf,buffilled))<=0) /* not the start of a valid field */
-      return 0;
-   if(idlen==STRLEN(FROM)&&eqFrom_(buf))			/* it's a From_ line */
-    { if(rdheader)
- 	return 0;			       /* the From_ line was a fake! */
--     for(;buflast=='>';getline());	    /* gather continued >From_ lines */
-+     for(;buflast=='>';procmail_getline());	    /* gather continued >From_ lines */
-    }
-   else
--     for(;;getline())		      /* get the rest of the continued field */
-+     for(;;procmail_getline())		      /* get the rest of the continued field */
-       { switch(buflast)			     /* will this line be continued? */
- 	 { case ' ':case '\t':				  /* yep, it sure is */
- 	      continue;
- 	 }
- 	break;
-diff -NrU5 procmail-3.22.orig/src/formail.c procmail-3.22/src/formail.c
---- procmail-3.22.orig/src/formail.c	2009-05-21 18:21:25.000000000 +0200
-+++ procmail-3.22/src/formail.c	2009-05-21 18:22:14.000000000 +0200
-@@ -817,11 +817,11 @@
- #ifdef MAILBOX_SEPARATOR
-      if(!strncmp(emboxsep,buf,STRLEN(emboxsep)))	     /* end of mail? */
-       { if(split)		       /* gobble up the next start separator */
- 	 { buffilled=0;
- #ifdef sMAILBOX_SEPARATOR
--	   getline();buffilled=0;		 /* but only if it's defined */
-+	   procmail_getline();buffilled=0;		 /* but only if it's defined */
- #endif
- 	   if(buflast!=EOF)					   /* if any */
- 	      goto splitit;
- 	   break;
- 	 }
-diff -NrU5 procmail-3.22.orig/src/formisc.c procmail-3.22/src/formisc.c
---- procmail-3.22.orig/src/formisc.c	2009-05-21 18:21:25.000000000 +0200
-+++ procmail-3.22/src/formisc.c	2009-05-21 18:22:14.000000000 +0200
-@@ -113,11 +113,11 @@
- { if(buffilled==buflen)
-      buf=realloc(buf,buflen+=Bsize);
-   buf[buffilled++]=c;
- }
- 
--int getline P((void))			   /* read a newline-terminated line */
-+int procmail_getline P((void))			   /* read a newline-terminated line */
- { if(buflast==EOF)			 /* at the end of our Latin already? */
-    { loadchar('\n');					  /* fake empty line */
-      return EOF;					  /* spread the word */
-    }
-   loadchar(buflast);			    /* load leftover into the buffer */
-diff -NrU5 procmail-3.22.orig/src/formisc.h procmail-3.22/src/formisc.h
---- procmail-3.22.orig/src/formisc.h	2009-05-21 18:21:25.000000000 +0200
-+++ procmail-3.22/src/formisc.h	2009-05-21 18:22:14.000000000 +0200
-@@ -15,6 +15,6 @@
-  closemine P((void)),
-  opensink P((void));
- char*
-  skipwords P((char*start));
- int
-- getline P((void));
-+ procmail_getline P((void));

diff --git a/mail-filter/procmail/files/procmail-comsat-segfault.diff b/mail-filter/procmail/files/procmail-comsat-segfault.diff
deleted file mode 100644
index e96bb5d94a38..000000000000
--- a/mail-filter/procmail/files/procmail-comsat-segfault.diff
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/comsat.c.old	2005-08-17 19:17:20.000000000 +0200
-+++ src/comsat.c	2005-08-17 19:18:19.000000000 +0200
-@@ -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;

diff --git a/mail-filter/procmail/files/procmail-lazy-bindings.diff b/mail-filter/procmail/files/procmail-lazy-bindings.diff
deleted file mode 100644
index f1c4221650e6..000000000000
--- a/mail-filter/procmail/files/procmail-lazy-bindings.diff
+++ /dev/null
@@ -1,16 +0,0 @@
---- src/Makefile.0.old	2005-05-23 10:34:25.000000000 +0200
-+++ src/Makefile.0	2005-05-23 10:34:52.000000000 +0200
-@@ -18,11 +18,11 @@
- .PRECIOUS: Makefile
- 
- procmail: procmail.$(O) $(PM_OBJ) setid
--	$(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ $(LDFLAGS)
-+	$(CC) $(CFLAGS) $@.$(O) $(PM_OBJ) -o $@ -Wl,-z,now $(LDFLAGS)
- 	@test -z "$(STRIP)" || ( echo $(STRIP) $@; $(STRIP) $@ )
- 
- lockfile: lockfile.$(O) $(LF_OBJ)
--	$(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ $(LDFLAGS)
-+	$(CC) $(CFLAGS) $@.$(O) $(LF_OBJ) -o $@ -Wl,-z,now $(LDFLAGS)
- 	@test -z "$(STRIP)" || ( echo $(STRIP) $@; $(STRIP) $@ )
- 
- formail: formail.$(O) $(FM_OBJ)

diff --git a/mail-filter/procmail/files/procmail-maxprocs-fix.diff b/mail-filter/procmail/files/procmail-maxprocs-fix.diff
deleted file mode 100644
index c78b000a8b92..000000000000
--- a/mail-filter/procmail/files/procmail-maxprocs-fix.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/formisc.c.orig	2006-01-22 00:35:30.000000000 -0800
-+++ src/formisc.c	2006-01-22 00:35:55.000000000 -0800
-@@ -183,7 +183,7 @@
- 		 retval=excode;
- 	    }					       /* reap some children */
- 	while(childlimit&&children>=childlimit||(child=fork())==-1&&children)
--	   for(--children;(excode=waitfor((pid_t)0))!=NO_PROCESS;)
-+	   for(;(excode=waitfor((pid_t)0))!=NO_PROCESS;)
- 	    { if(excode!=EXIT_SUCCESS)
- 		 retval=excode;
- 	      if(--children<=maxchild)

diff --git a/mail-filter/procmail/files/procmail-pipealloc.diff b/mail-filter/procmail/files/procmail-pipealloc.diff
deleted file mode 100644
index fdd5cc97328a..000000000000
--- a/mail-filter/procmail/files/procmail-pipealloc.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rc procmail-3.22/src/pipes.c procmail-3.22-fixed/src/pipes.c
-*** procmail-3.22/src/pipes.c   Tue Sep 11 00:58:44 2001
---- procmail-3.22-fixed/src/pipes.c     Wed Nov 21 23:53:39 2007
-***************
-*** 194,200 ****
-       makeblock(&temp,Stdfilled);
-       tmemmove(temp.p,Stdout,Stdfilled);
-       readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
-!      Stdout=realloc(Stdout,&Stdfilled+1);
-       tmemmove(Stdout,temp.p,Stdfilled+1);
-       freeblock(&temp);
-       retStdout(Stdout,pwait&&pipw,!backblock);
---- 194,200 ----
-       makeblock(&temp,Stdfilled);
-       tmemmove(temp.p,Stdout,Stdfilled);
-       readdyn(&temp,&Stdfilled,Stdfilled+backlen+1);
-!      Stdout=realloc(Stdout,Stdfilled+1);
-       tmemmove(Stdout,temp.p,Stdfilled+1);
-       freeblock(&temp);
-       retStdout(Stdout,pwait&&pipw,!backblock);
-

diff --git a/mail-filter/procmail/files/procmail-prefix.patch b/mail-filter/procmail/files/procmail-prefix.patch
deleted file mode 100644
index 6063b92db2b8..000000000000
--- a/mail-filter/procmail/files/procmail-prefix.patch
+++ /dev/null
@@ -1,155 +0,0 @@
---- config.h~	2007-10-03 17:55:24 +0200
-+++ config.h	2007-10-03 18:01:38 +0200
-@@ -116,11 +116,11 @@
- 	is not found, maildelivery will proceed as normal to the default
- 	system mailbox.	 This also must be an absolute path */
- 
--#define ETCRC	"/etc/procmailrc"	/* optional global procmailrc startup
-+#define ETCRC	"@GENTOO_PORTAGE_EPREFIX@/etc/procmailrc"	/* optional global procmailrc startup
- 					   file (will only be read if procmail
- 	is started with no rcfile on the command line). */
- 
--#define ETCRCS	"/etc/procmailrcs/"	/* optional trusted path prefix for
-+#define ETCRCS	"@GENTOO_PORTAGE_EPREFIX@/etc/procmailrcs/"	/* optional trusted path prefix for
- 					   rcfiles which will be executed with
- 	the uid of the owner of the rcfile (this only happens if procmail is
- 	called with the -m option, without variable assignments on the command
-@@ -168,7 +168,7 @@
- #define INEFFICIENTrealloc			  /* don't pussy-foot around */
- #endif
- #define MAXinMEM	(1024*1024)		 /* when to switch to mmap() */
--#define MMAP_DIR	"/var/spool/procmail/"		     /* where to put */
-+#define MMAP_DIR	"@GENTOO_PORTAGE_EPREFIX@/var/spool/procmail/"		     /* where to put */
- #endif								/* the files */
- #define MINlogbuf	81			       /* fit an entire line */
- #define MAXlogbuf	1000		       /* in case someone abuses LOG */
-@@ -220,8 +220,8 @@
- #define DEFcomsat	offvalue	/* when an rcfile has been specified */
- 				      /* set to either "offvalue" or "empty" */
- 
--#define BinSh		"/bin/sh"
--#define ROOT_DIR	"/"
-+#define BinSh		"@GENTOO_PORTAGE_EPREFIX@/bin/sh"
-+#define ROOT_DIR	"@GENTOO_PORTAGE_EPREFIX@"
- #define DEAD_LETTER	"/tmp/dead.letter"    /* $ORGMAIL if no passwd entry */
- #define DevNull		"/dev/null"
- #define NICE_RANGE	39			  /* maximal nice difference */
---- Makefile~	2007-10-03 18:07:51 +0200
-+++ Makefile	2007-10-03 18:10:07 +0200
-@@ -2,7 +2,7 @@
- 
- # BASENAME should point to where the whole lot will be installed
- # change BASENAME to your home directory if need be
--BASENAME	= /usr
-+BASENAME	= @GENTOO_PORTAGE_EPREFIX@/usr
- # For display in the man pages
- VISIBLE_BASENAME= $(BASENAME)
- 
-@@ -79,7 +79,7 @@
- #			-lresolv	# not really needed, is it?
- 
- # Informal list of directories where we look for the libraries in SEARCHLIBS
--LIBPATHS=/lib /usr/lib /usr/local/lib
-+LIBPATHS=@GENTOO_PORTAGE_EPREFIX@/lib @GENTOO_PORTAGE_EPREFIX@/usr/lib
- 
- GCC_WARNINGS = -O2 -pedantic -Wreturn-type -Wunused -Wformat -Wtraditional \
-  -Wpointer-arith -Wconversion -Waggregate-return \
-@@ -97,10 +97,10 @@
- ####CC	= cc # gcc
- # object file extension
- O	= o
--RM	= /bin/rm -f
-+RM	= @GENTOO_PORTAGE_EPREFIX@/bin/rm -f
- MV	= mv -f
- LN	= ln
--BSHELL	= /bin/sh
-+BSHELL	= @GENTOO_PORTAGE_EPREFIX@/bin/sh
- INSTALL = cp
- DEVNULL = /dev/null
- STRIP	= strip
-@@ -112,7 +112,7 @@
- MANS5S	= procmailrc procmailsc procmailex
- 
- # Possible locations for the sendmail.cf file
--SENDMAILCFS = /etc/mail/sendmail.cf /etc/sendmail.cf /usr/lib/sendmail.cf
-+SENDMAILCFS = @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf
- 
- # Makefile.1 - mark, don't (re)move this, a sed script needs it
- 
---- src/autoconf~	2001-09-11 06:55:46 +0200
-+++ src/autoconf	2007-10-03 19:17:51 +0200
-@@ -1,4 +1,4 @@
--#! /bin/sh
-+#! @GENTOO_PORTAGE_EPREFIX@/bin/sh
- :
- # Copyright (c) 1990-1997, S.R. van den Berg, The Netherlands
- # $Id$
-@@ -1416,20 +1416,10 @@
- 
- found=no
- 
--for a in /var/spool/mail /usr/spool/mail /var/mail /usr/mail /spool/mail
--do
--  test -d $a -a $found != yes &&
--   echo '#define MAILSPOOLDIR "'$a'/"' >>$ACONF && found=yes
--done
--if test $found != yes
--then
-- echo '#define MAILSPOOLDIR "/var/spool/mail/"' >>$ACONF
-- echo Could not find the system-mailbox directory, supplied default.
--fi
-+echo '#define MAILSPOOLDIR "@GENTOO_PORTAGE_EPREFIX@/var/spool/mail/"' >>$ACONF
- 
- cat >lookfor <<HERE
--for a in /usr/sbin /usr/lib /lib /usr/etc /etc /usr/bin /bin /usr/local/bin \
-- /usr/lbin /usr/local/lib /usr/local /usr/.lib /local/bin /sbin
-+for a in @GENTOO_PORTAGE_EPREFIX@/usr/sbin
- do
-  if test -f "\$a/\$1"
-  then
-@@ -1458,7 +1448,7 @@
- grep '^#define SENDMAIL ".*/sendmail"' $ACONF >$DEVNULL ||
-  echo "#define DEFflagsendmail \"\"" >>$ACONF
- 
--a=/tmp/_chowntst.$$
-+a=@GENTOO_PORTAGE_EPREFIX@/tmp/_chowntst.$$
- $RM -r $a
- OLDTESTDIRS="$a $OLDTESTDIRS"
- mkdir $a
-@@ -1466,19 +1456,18 @@
- 
- _autotst $a/__ $a/__/__ 4 >>$ACONF
- 
--cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
-+cat @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf 2>$DEVNULL |
-  grep 'Mlocal.*procmail' >$DEVNULL ||
-  echo '#define CF_no_procmail_yet' >>$ACONF
- 
--cat /usr/lib/sendmail.cf /etc/sendmail.cf /etc/mail/sendmail.cf 2>$DEVNULL |
-+cat @GENTOO_PORTAGE_EPREFIX@/usr/lib/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/sendmail.cf @GENTOO_PORTAGE_EPREFIX@/etc/mail/sendmail.cf 2>$DEVNULL |
-  grep '^V' >$DEVNULL ||
-  echo '#define buggy_SENDMAIL' >>$ACONF
- 
--lpath='/bin'
--bins="/bin"
-+lpath='@GENTOO_PORTAGE_EPREFIX@/bin'
-+bins='@GENTOO_PORTAGE_EPREFIX@/bin'
- 
--for newd in /usr/bin /usr/ucb /usr/5bin $BINDIR /local/bin /usr/local/bin \
-- /global/bin /usr/bin/X11 /usr/X*/bin
-+for newd in @GENTOO_PORTAGE_EPREFIX@/usr/bin
- do
-   if test -d $newd
-   then
---- src/recommend.c~	2007-10-03 19:10:01 +0200
-+++ src/recommend.c	2007-10-03 19:11:04 +0200
-@@ -9,8 +9,7 @@
- 
- char mailspooldir[]=MAILSPOOLDIR;
- const char dirsep[]=DIRSEP,
-- *const checkf[]={"/bin/mail","/bin/lmail","/usr/lib/sendmail",
-- "/usr/lib/smail",0};
-+ *const checkf[]={"@GENTOO_PORTAGE_EPREFIX@/usr/bin/sendmail",0};
- 
- int main(argc,argv)const int argc;const char*const argv[];
- { struct group*grp;struct stat stbuf;gid_t gid=(gid_t)-1;

diff --git a/mail-filter/procmail/procmail-3.22-r15.ebuild b/mail-filter/procmail/procmail-3.22-r15.ebuild
deleted file mode 100644
index cf0d76a7468d..000000000000
--- a/mail-filter/procmail/procmail-3.22-r15.ebuild
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs prefix
-
-DESCRIPTION="Mail delivery agent/filter"
-HOMEPAGE="http://www.procmail.org/"
-SRC_URI="http://www.procmail.org/${P}.tar.gz"
-
-LICENSE="|| ( Artistic GPL-2 )"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="mbox selinux"
-
-DEPEND="acct-group/mail
-	virtual/mta"
-RDEPEND="selinux? ( sec-policy/selinux-procmail )"
-
-src_prepare() {
-	# disable flock, using both fcntl and flock style locking
-	# doesn't work with NFS with 2.6.17+ kernels, bug #156493
-
-	sed -e "s|/\*#define NO_flock_LOCK|#define NO_flock_LOCK|" \
-		-i config.h || die "sed failed"
-
-	if ! use mbox ; then
-		echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc || die
-		echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc || die
-		cd "${S}" || die
-		eapply "${FILESDIR}/gentoo-maildir3.diff"
-	else
-		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
-		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
-	fi
-
-	# Do not use lazy bindings on lockfile and procmail
-	if [[ ${CHOST} != *-darwin* ]]; then
-		eapply -p0 "${FILESDIR}/${PN}-lazy-bindings.diff"
-	fi
-
-	# Fix for bug #102340
-	eapply -p0 "${FILESDIR}/${PN}-comsat-segfault.diff"
-
-	# Fix for bug #119890
-	eapply -p0 "${FILESDIR}/${PN}-maxprocs-fix.diff"
-
-	# Prefixify config.h
-	eapply -p0 "${FILESDIR}"/${PN}-prefix.patch
-	eprefixify config.h Makefile src/autoconf src/recommend.c
-
-	# Fix for bug #200006
-	eapply "${FILESDIR}/${PN}-pipealloc.diff"
-
-	# Fix for bug #270551
-	eapply "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
-
-	# Fix security bugs #522114 and #638108
-	eapply "${FILESDIR}/${PN}-3.22-CVE-2014-3618.patch"
-	eapply "${FILESDIR}/${PN}-3.22-CVE-2017-16844.patch"
-
-	eapply "${FILESDIR}/${PN}-3.22-crash-fix.patch"
-
-	eapply_user
-}
-
-src_compile() {
-	# -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
-	# To work around this, we append -fno-inline-functions to CFLAGS
-	# Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
-	# If it's clang, ignore -fno-ipa-cp-clone, as clang doesn't support this
-	append-flags -fno-inline-functions
-	tc-is-clang || append-flags -fno-ipa-cp-clone
-
-	sed -e "s|CFLAGS0 = -O|CFLAGS0 = ${CFLAGS}|" \
-		-e "s|LDFLAGS0= -s|LDFLAGS0 = ${LDFLAGS}|" \
-		-e "s|LOCKINGTEST=__defaults__|#LOCKINGTEST=__defaults__|" \
-		-e "s|#LOCKINGTEST=/tmp|LOCKINGTEST=/tmp|" \
-		-i Makefile || die "sed failed"
-
-	emake CC="$(tc-getCC)"
-}
-
-src_install() {
-	cd "${S}"/new || die
-	insinto /usr/bin
-	insopts -m 6755
-	doins procmail
-
-	doins lockfile
-	fowners root:mail /usr/bin/lockfile
-	fperms 2755 /usr/bin/lockfile
-
-	dobin formail mailstat
-	insopts -m 0644
-
-	doman *.1 *.5
-
-	cd "${S}" || die
-	dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
-
-	insinto /etc
-	doins procmailrc
-
-	docinto examples
-	dodoc examples/*
-}
-
-pkg_postinst() {
-	if ! use mbox ; then
-		elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
-		elog "that you configure a mail storage location using DEFAULT in"
-		elog "/etc/procmailrc, for example:"
-		elog "\tDEFAULT=\$HOME/.maildir/"
-	fi
-	if has sfperms ${FEATURES}; then
-		ewarn "FEATURES=sfperms removes the read-bit for others from"
-		ewarn "  /usr/bin/procmail"
-		ewarn "  /usr/bin/lockfile"
-		ewarn "If you use procmail from an MTA like Exim, you need to"
-		ewarn "re-add the read-bit or avoid the MTA checking the binary"
-		ewarn "exists."
-	fi
-}

diff --git a/mail-filter/procmail/procmail-3.22-r16.ebuild b/mail-filter/procmail/procmail-3.22-r16.ebuild
deleted file mode 100644
index b53f7b58ddfe..000000000000
--- a/mail-filter/procmail/procmail-3.22-r16.ebuild
+++ /dev/null
@@ -1,135 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit flag-o-matic toolchain-funcs prefix
-
-DESCRIPTION="Mail delivery agent/filter"
-HOMEPAGE="http://www.procmail.org/"
-SRC_URI="http://www.procmail.org/${P}.tar.gz"
-
-LICENSE="|| ( Artistic GPL-2 )"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
-IUSE="mbox selinux"
-
-DEPEND="
-	acct-group/mail
-	virtual/mta
-"
-RDEPEND="
-	${DEPEND}
-	selinux? ( sec-policy/selinux-procmail )
-"
-
-src_prepare() {
-	# disable flock, using both fcntl and flock style locking
-	# doesn't work with NFS with 2.6.17+ kernels, bug #156493
-
-	sed -e "s|/\*#define NO_flock_LOCK|#define NO_flock_LOCK|" \
-		-i config.h || die "sed failed"
-
-	if ! use mbox ; then
-		echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc || die
-		echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc || die
-		cd "${S}" || die
-		eapply "${FILESDIR}/gentoo-maildir3.diff"
-	else
-		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
-		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
-	fi
-
-	# Do not use lazy bindings on lockfile and procmail
-	if [[ ${CHOST} != *-darwin* ]]; then
-		eapply -p0 "${FILESDIR}/${PN}-lazy-bindings.diff"
-	fi
-
-	# Fix for bug #102340
-	eapply -p0 "${FILESDIR}/${PN}-comsat-segfault.diff"
-
-	# Fix for bug #119890
-	eapply -p0 "${FILESDIR}/${PN}-maxprocs-fix.diff"
-
-	# Prefixify config.h
-	eapply -p0 "${FILESDIR}"/${PN}-prefix.patch
-	eprefixify config.h Makefile src/autoconf src/recommend.c
-
-	# Fix for bug #200006
-	eapply "${FILESDIR}/${PN}-pipealloc.diff"
-
-	# Fix for bug #270551
-	eapply "${FILESDIR}/${PN}-3.22-glibc-2.10.patch"
-
-	# Fix security bugs #522114 and #638108
-	eapply "${FILESDIR}/${PN}-3.22-CVE-2014-3618.patch"
-	eapply "${FILESDIR}/${PN}-3.22-CVE-2017-16844.patch"
-
-	eapply "${FILESDIR}/${PN}-3.22-crash-fix.patch"
-
-	eapply_user
-}
-
-src_compile() {
-	# bug #875251, bug #896052
-	append-flags -std=gnu89
-	# bug #859517
-	filter-lto
-
-	# -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
-	# To work around this, we append -fno-inline-functions to CFLAGS
-	# Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
-	# If it's clang, ignore -fno-ipa-cp-clone, as clang doesn't support this
-	append-flags -fno-inline-functions
-	tc-is-clang || append-flags -fno-ipa-cp-clone
-
-	sed -e "s|CFLAGS0 = -O|CFLAGS0 = ${CFLAGS}|" \
-		-e "s|LDFLAGS0= -s|LDFLAGS0 = ${LDFLAGS}|" \
-		-e "s|LOCKINGTEST=__defaults__|#LOCKINGTEST=__defaults__|" \
-		-e "s|#LOCKINGTEST=/tmp|LOCKINGTEST=/tmp|" \
-		-i Makefile || die "sed failed"
-
-	emake CC="$(tc-getCC)"
-}
-
-src_install() {
-	cd "${S}"/new || die
-	insinto /usr/bin
-	insopts -m 6755
-	doins procmail
-
-	doins lockfile
-	fowners root:mail /usr/bin/lockfile
-	fperms 2755 /usr/bin/lockfile
-
-	dobin formail mailstat
-	insopts -m 0644
-
-	doman *.1 *.5
-
-	cd "${S}" || die
-	dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
-
-	insinto /etc
-	doins procmailrc
-
-	docinto examples
-	dodoc examples/*
-}
-
-pkg_postinst() {
-	if ! use mbox ; then
-		elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
-		elog "that you configure a mail storage location using DEFAULT in"
-		elog "/etc/procmailrc, for example:"
-		elog "\tDEFAULT=\$HOME/.maildir/"
-	fi
-	if has sfperms ${FEATURES}; then
-		ewarn "FEATURES=sfperms removes the read-bit for others from"
-		ewarn "  /usr/bin/procmail"
-		ewarn "  /usr/bin/lockfile"
-		ewarn "If you use procmail from an MTA like Exim, you need to"
-		ewarn "re-add the read-bit or avoid the MTA checking the binary"
-		ewarn "exists."
-	fi
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/files/, mail-filter/procmail/
@ 2024-05-22 19:24 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2024-05-22 19:24 UTC (permalink / raw
  To: gentoo-commits

commit:     47750a2e4af92aa6566c3225985f7515b63b61dd
Author:     Gabi Falk <gabifalk <AT> gmx <DOT> com>
AuthorDate: Sun May 19 20:00:00 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 22 19:18:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47750a2e

mail-filter/procmail: fix modern C issues

Added the patch from the upstream pull request (thanks to
Jaroslav Škarvada).

Link: https://github.com/BuGlessRB/procmail/pull/7
Closes: https://bugs.gentoo.org/919024
Signed-off-by: Gabi Falk <gabifalk <AT> gmx.com>
Closes: https://github.com/gentoo/gentoo/pull/36747
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../procmail/files/procmail-3.24-modern-c.patch    | 255 +++++++++++++++++++++
 mail-filter/procmail/procmail-3.24-r1.ebuild       | 119 ++++++++++
 2 files changed, 374 insertions(+)

diff --git a/mail-filter/procmail/files/procmail-3.24-modern-c.patch b/mail-filter/procmail/files/procmail-3.24-modern-c.patch
new file mode 100644
index 000000000000..dba497304957
--- /dev/null
+++ b/mail-filter/procmail/files/procmail-3.24-modern-c.patch
@@ -0,0 +1,255 @@
+From 8cfd570fd14c8fb9983859767ab1851bfd064b64 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
+Date: Wed, 31 Jan 2024 18:41:21 +0100
+Subject: [PATCH] Fixed build with gcc-14
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
+---
+ initmake     |   4 +-
+ src/autoconf | 173 ++++++++++++++++++++++++++-------------------------
+ 2 files changed, 91 insertions(+), 86 deletions(-)
+
+diff --git a/initmake b/initmake
+index b901add..703d651 100755
+--- a/initmake
++++ b/initmake
+@@ -124,7 +124,7 @@ else
+ fi
+ 
+ cat >_autotst.c <<HERE
+-main()
++int main()
+ { return 0;
+ }
+ HERE
+@@ -200,7 +200,7 @@ cat >_autotst.c <<HERE
+ #include <sys/types.h>
+ #include <stdio.h>
+ #include <sys/stat.h>
+-main()
++int main()
+ { struct stat buf;return!&buf;
+ }
+ HERE
+diff --git a/src/autoconf b/src/autoconf
+index 7c46487..97c0bce 100755
+--- a/src/autoconf
++++ b/src/autoconf
+@@ -363,6 +363,7 @@ cat >_autotst.c <<HERE
+ #include <unistd.h>		/* getpid() getppid() */
+ #endif
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <time.h>
+ #include <fcntl.h>
+ #include <signal.h>		/* SIGKILL */
+@@ -416,6 +417,16 @@ cat >_autotst.c <<HERE
+ int dolock,child[NR_of_forks],timeout,fdcollect;
+ char dirlocktest[]="_locktest";
+ 
++int killchildren()
++{ int i;
++  i=NR_of_forks;
++  do
++     if(child[--i]>0)
++	kill(child[i],SIGTERM),child[i]=0;
++  while(i);
++  return 0;
++}
++
+ void stimeout()
+ { timeout=1;close(fdcollect);killchildren();
+ }
+@@ -437,7 +448,79 @@ unsigned sfork()
+   return pid;
+ }
+ 
+-int main(argc,argv)char*argv[];
++static int oldfdlock;
++#ifdef F_SETLKW
++static struct flock flck;		/* why can't it be a local variable? */
++#endif
++#ifdef F_LOCK
++static off_t oldlockoffset;
++#endif
++
++int fdlock(int fd)
++{ int i;unsigned gobble[GOBBLE>>2];
++  for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
++  oldfdlock=fd;fd=0;
++  if(MSK_fcntl&dolock)
++#ifdef F_SETLKW
++   { static unsigned extra;
++     flck.l_type=F_WRLCK;flck.l_whence=SEEK_SET;flck.l_start=tell(oldfdlock);
++     if(!extra--)
++	extra=MIN_locks/4,flck.l_len=2,i|=fcntl(oldfdlock,F_SETLK,&flck);
++     flck.l_len=0;fd|=fcntl(oldfdlock,F_SETLKW,&flck);
++   }
++#else
++     fd=1;
++#endif
++  if(MSK_lockf&dolock)
++#ifdef F_LOCK
++     oldlockoffset=tell(oldfdlock),fd|=lockf(oldfdlock,F_LOCK,(off_t)0);
++#else
++     fd=1;
++#endif
++  if(MSK_flock&dolock)
++#ifdef LOCK_EX
++     fd|=flock(oldfdlock,LOCK_EX);
++#else
++     fd=1;
++#endif
++  return fd;
++}
++
++int sfdlock(int fd)
++{ int i;unsigned gobble[GOBBLE>>2];
++  for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
++  return fdlock(fd);
++}
++
++int fdunlock()
++{ int i;unsigned gobble[GOBBLE];
++  for(i=GOBBLE;i;gobble[--i]=~(unsigned)0);  /* some SunOS libs mess this up */
++  if(MSK_flock&dolock)
++#ifdef LOCK_EX
++     i|=flock(oldfdlock,LOCK_UN);
++#else
++     i=1;
++#endif
++  if(MSK_lockf&dolock)
++#ifdef F_LOCK
++   { lseek(oldfdlock,oldlockoffset,SEEK_SET);
++     i|=lockf(oldfdlock,F_LOCK,(off_t)2);i|=lockf(oldfdlock,F_ULOCK,(off_t)0);
++   }
++#else
++     i=1;
++#endif
++  if(MSK_fcntl&dolock)
++#ifdef F_SETLKW
++     flck.l_type=F_UNLCK,flck.l_len=0,i|=fcntl(oldfdlock,F_SETLK,&flck);
++#else
++     i=1;
++#endif
++  if(!i)
++     for(i=GOBBLE;i&&gobble[--i]==~(unsigned)0;);
++  return i;
++}
++
++int main(argc,argv)int argc;char*argv[];
+ { int goodlock,testlock,i,pip[2],pipw[2];time_t otimet;unsigned dtimet;
+   static char filename[]="_locktst.l0";
+   close(0);goodlock=0;testlock=FIRST_lock;signal(SIGPIPE,SIG_DFL);
+@@ -576,88 +659,6 @@ skip_tests:
+   puts("Kernel-locking tests completed.");fprintf(stderr,"\n");
+   return EXIT_SUCCESS;
+ }
+-
+-int killchildren()
+-{ int i;
+-  i=NR_of_forks;
+-  do
+-     if(child[--i]>0)
+-	kill(child[i],SIGTERM),child[i]=0;
+-  while(i);
+-  return 0;
+-}
+-
+-int sfdlock(fd)
+-{ int i;unsigned gobble[GOBBLE>>2];
+-  for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
+-  return fdlock(fd);
+-}
+-
+-static oldfdlock;
+-#ifdef F_SETLKW
+-static struct flock flck;		/* why can't it be a local variable? */
+-#endif
+-#ifdef F_LOCK
+-static off_t oldlockoffset;
+-#endif
+-
+-int fdlock(fd)
+-{ int i;unsigned gobble[GOBBLE>>2];
+-  for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
+-  oldfdlock=fd;fd=0;
+-  if(MSK_fcntl&dolock)
+-#ifdef F_SETLKW
+-   { static unsigned extra;
+-     flck.l_type=F_WRLCK;flck.l_whence=SEEK_SET;flck.l_start=tell(oldfdlock);
+-     if(!extra--)
+-	extra=MIN_locks/4,flck.l_len=2,i|=fcntl(oldfdlock,F_SETLK,&flck);
+-     flck.l_len=0;fd|=fcntl(oldfdlock,F_SETLKW,&flck);
+-   }
+-#else
+-     fd=1;
+-#endif
+-  if(MSK_lockf&dolock)
+-#ifdef F_LOCK
+-     oldlockoffset=tell(oldfdlock),fd|=lockf(oldfdlock,F_LOCK,(off_t)0);
+-#else
+-     fd=1;
+-#endif
+-  if(MSK_flock&dolock)
+-#ifdef LOCK_EX
+-     fd|=flock(oldfdlock,LOCK_EX);
+-#else
+-     fd=1;
+-#endif
+-  return fd;
+-}
+-
+-int fdunlock()
+-{ int i;unsigned gobble[GOBBLE];
+-  for(i=GOBBLE;i;gobble[--i]=~(unsigned)0);  /* some SunOS libs mess this up */
+-  if(MSK_flock&dolock)
+-#ifdef LOCK_EX
+-     i|=flock(oldfdlock,LOCK_UN);
+-#else
+-     i=1;
+-#endif
+-  if(MSK_lockf&dolock)
+-#ifdef F_LOCK
+-   { lseek(oldfdlock,oldlockoffset,SEEK_SET);
+-     i|=lockf(oldfdlock,F_LOCK,(off_t)2);i|=lockf(oldfdlock,F_ULOCK,(off_t)0);
+-   }
+-#else
+-     i=1;
+-#endif
+-  if(MSK_fcntl&dolock)
+-#ifdef F_SETLKW
+-     flck.l_type=F_UNLCK,flck.l_len=0,i|=fcntl(oldfdlock,F_SETLK,&flck);
+-#else
+-     i=1;
+-#endif
+-  if(!i)
+-     for(i=GOBBLE;i&&gobble[--i]==~(unsigned)0;);
+-  return i;
+-}
+ HERE
+ 
+ if $MAKE _autotst >_autotst.rrr 2>&1
+@@ -1033,6 +1034,10 @@ cat >_autotst.c <<HERE
+ #ifndef NO_COMSAT
+ #include "network.h"
+ #endif
++#include <string.h>
++#include <unistd.h>
++int setrgid();
++int setresgid();
+ int main(){char a[2];
+  endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0");
+  strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0");
+@@ -1059,7 +1064,7 @@ echo 'Testing for memmove, strchr, strpbrk, strcspn, strtol, strstr,'
+ echo '	rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,'
+ echo '	ftruncate, strtod, strncasecmp, strerror, strlcat,'
+ echo '	memset, bzero, and _exit'
+-if $MAKE _autotst.$O >$DEVNULL 2>&1
++if $MAKE _autotst.$O >_autotst.rrr 2>&1
+ then
+ :
+ else

diff --git a/mail-filter/procmail/procmail-3.24-r1.ebuild b/mail-filter/procmail/procmail-3.24-r1.ebuild
new file mode 100644
index 000000000000..07ee45bb8869
--- /dev/null
+++ b/mail-filter/procmail/procmail-3.24-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Mail delivery agent/filter"
+HOMEPAGE="https://www.procmail.org/"
+SRC_URI="https://github.com/BuGlessRB/procmail/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="|| ( Artistic GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="mbox selinux"
+
+DEPEND="
+	acct-group/mail
+	virtual/mta
+"
+RDEPEND="
+	${DEPEND}
+	selinux? ( sec-policy/selinux-procmail )
+"
+
+src_prepare() {
+	# disable flock, using both fcntl and flock style locking
+	# doesn't work with NFS with 2.6.17+ kernels, bug #156493
+
+	sed -e "s|/\*#define NO_flock_LOCK|#define NO_flock_LOCK|" \
+		-i config.h || die "sed failed"
+
+	eapply "${FILESDIR}/${P}-modern-c.patch"
+
+	if ! use mbox ; then
+		echo "# Use maildir-style mailbox in user's home directory" > "${S}"/procmailrc || die
+		echo 'DEFAULT=$HOME/.maildir/' >> "${S}"/procmailrc || die
+		cd "${S}" || die
+		eapply "${FILESDIR}/${P}-maildir.patch"
+	else
+		echo '# Use mbox-style mailbox in /var/spool/mail' > "${S}"/procmailrc || die
+		echo 'DEFAULT=${EPREFIX}/var/spool/mail/$LOGNAME' >> "${S}"/procmailrc || die
+	fi
+
+	# Do not use lazy bindings on lockfile and procmail
+	if [[ ${CHOST} != *-darwin* ]]; then
+		eapply "${FILESDIR}/${P}-lazy-bindings.patch"
+	fi
+
+	# Prefixify config.h
+	eapply "${FILESDIR}/${P}-gentoo-prefix.patch"
+	eprefixify config.h Makefile src/autoconf src/recommend.c
+
+	default
+}
+
+src_compile() {
+	# bug #875251, bug #896052
+	append-flags -std=gnu89
+	# bug #859517
+	filter-lto
+
+	# -finline-functions (implied by -O3) leaves strstr() in an infinite loop.
+	# To work around this, we append -fno-inline-functions to CFLAGS
+	# Since GCC 4.7 we also need -fno-ipa-cp-clone (bug #466552)
+	# If it's clang, ignore -fno-ipa-cp-clone, as clang doesn't support this
+	append-flags -fno-inline-functions
+	tc-is-clang || append-flags -fno-ipa-cp-clone
+
+	sed -e "s|CFLAGS0 = -O|CFLAGS0 = ${CFLAGS}|" \
+		-e "s|LDFLAGS0= -s|LDFLAGS0 = ${LDFLAGS}|" \
+		-e "s|LOCKINGTEST=__defaults__|#LOCKINGTEST=__defaults__|" \
+		-e "s|#LOCKINGTEST=/tmp|LOCKINGTEST=/tmp|" \
+		-i Makefile || die "sed failed"
+
+	emake CC="$(tc-getCC)"
+}
+
+src_install() {
+	cd "${S}"/new || die
+	insinto /usr/bin
+	insopts -m 6755
+	doins procmail
+
+	doins lockfile
+	fowners root:mail /usr/bin/lockfile
+	fperms 2755 /usr/bin/lockfile
+
+	dobin formail mailstat
+	insopts -m 0644
+
+	doman *.1 *.5
+
+	cd "${S}" || die
+	dodoc FAQ FEATURES HISTORY INSTALL KNOWN_BUGS README
+
+	insinto /etc
+	doins procmailrc
+
+	docinto examples
+	dodoc examples/*
+}
+
+pkg_postinst() {
+	if ! use mbox ; then
+		elog "Starting with mail-filter/procmail-3.22-r9 you'll need to ensure"
+		elog "that you configure a mail storage location using DEFAULT in"
+		elog "/etc/procmailrc, for example:"
+		elog "\tDEFAULT=\$HOME/.maildir/"
+	fi
+	if has sfperms ${FEATURES}; then
+		ewarn "FEATURES=sfperms removes the read-bit for others from"
+		ewarn "  /usr/bin/procmail"
+		ewarn "  /usr/bin/lockfile"
+		ewarn "If you use procmail from an MTA like Exim, you need to"
+		ewarn "re-add the read-bit or avoid the MTA checking the binary"
+		ewarn "exists."
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-22 19:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22 19:24 [gentoo-commits] repo/gentoo:master commit in: mail-filter/procmail/files/, mail-filter/procmail/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-02-25  9:27 Yixun Lan
2019-03-30 17:03 Thomas Deutschmann
2019-03-28  0:44 Thomas Deutschmann
2019-03-24  0:26 Aaron Bauman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox