Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/opendmarc/, mail-filter/opendmarc/files/
Date: Thu, 10 Sep 2020 08:21:26
Message-Id: 1599726066.69c7c3a6972811fa55db4e302dc11fd72dd8eacc.grobian@gentoo
1 commit: 69c7c3a6972811fa55db4e302dc11fd72dd8eacc
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 10 08:21:06 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 10 08:21:06 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69c7c3a6
7
8 mail-filter/opendmarc-1.3.3: version bump for security, bug #734158
9
10 Bug: https://bugs.gentoo.org/734158
11 Package-Manager: Portage-2.3.103, Repoman-2.3.23
12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
13
14 mail-filter/opendmarc/Manifest | 1 +
15 .../files/opendmarc-1.3.3-CVE-2020-12460.patch | 41 ++++++++++++
16 mail-filter/opendmarc/opendmarc-1.3.3.ebuild | 78 ++++++++++++++++++++++
17 3 files changed, 120 insertions(+)
18
19 diff --git a/mail-filter/opendmarc/Manifest b/mail-filter/opendmarc/Manifest
20 index fab6b479efb..905f6981f43 100644
21 --- a/mail-filter/opendmarc/Manifest
22 +++ b/mail-filter/opendmarc/Manifest
23 @@ -1 +1,2 @@
24 DIST opendmarc-1.3.2.tar.gz 593448 BLAKE2B 80f47a82e38c6cdc5791a695485262c50e9363b81537a52d7af204bd6a830df6eea9e9b6f710b72b7934c3ab7df800def7d4b3e54f53b8908a7f1b42bcea2b2d SHA512 6045fb7d2be8f0ffdeca07324857d92908a41c6792749017c2fcc1058f05f55317b1919c67c780827dd7094ec8fff2e1fa4aeb5bab7ff7461537957af2652748
25 +DIST opendmarc-1.3.3.tar.gz 575319 BLAKE2B 72dae5553fea9a51d860aaac6d85171a245584a74134df2249217a88f3da04c4eb518141f6342e281c6a9186345d69a34b585dc3ed18bdb53313374db505f4f5 SHA512 bb4bf8e3ad2d1732b07e55316819d4fd708e529b54a336d7d00763e13bfc62580bb1b30f132fa786dbca15e526e8dd5e146c7be454e1c42714a9f57126fc5e12
26
27 diff --git a/mail-filter/opendmarc/files/opendmarc-1.3.3-CVE-2020-12460.patch b/mail-filter/opendmarc/files/opendmarc-1.3.3-CVE-2020-12460.patch
28 new file mode 100644
29 index 00000000000..334c11d5302
30 --- /dev/null
31 +++ b/mail-filter/opendmarc/files/opendmarc-1.3.3-CVE-2020-12460.patch
32 @@ -0,0 +1,41 @@
33 +From 50d28af25d8735504b6103537228ce7f76ad765f Mon Sep 17 00:00:00 2001
34 +From: "Murray S. Kucherawy" <msk@××××××××.org>
35 +Date: Wed, 5 Aug 2020 21:56:01 +0000
36 +Subject: [PATCH] In opendmarc_xml_parse(), ensure NULL-termination of the
37 + buffer passed to opendmarc_xml().
38 +
39 +---
40 + libopendmarc/opendmarc_xml.c | 6 +++---
41 + 1 file changed, 3 insertions(+), 3 deletions(-)
42 +
43 +diff --git a/libopendmarc/opendmarc_xml.c b/libopendmarc/opendmarc_xml.c
44 +index 26bb9dc..b3ac55a 100644
45 +--- a/libopendmarc/opendmarc_xml.c
46 ++++ b/libopendmarc/opendmarc_xml.c
47 +@@ -158,7 +158,7 @@ opendmarc_xml(char *b, size_t blen, char *e, size_t elen)
48 + if (*cp != '<')
49 + continue;
50 + ++cp;
51 +- for(sp = cp; *sp != '\0'; ++sp)
52 ++ for (sp = cp; *sp != '\0'; ++sp)
53 + {
54 + if (*sp == '?')
55 + break;
56 +@@ -546,7 +546,7 @@ opendmarc_xml_parse(char *fname, char *err_buf, size_t err_len)
57 + if (fname == NULL)
58 + {
59 + xerror = errno;
60 +- (void) snprintf(err_buf, err_len, "%s: %s", fname, "File name was NULL");
61 ++ (void) snprintf(err_buf, err_len, "%s", "File name was NULL");
62 + errno = EINVAL;
63 + return NULL;
64 + }
65 +@@ -572,7 +572,7 @@ opendmarc_xml_parse(char *fname, char *err_buf, size_t err_len)
66 + return NULL;
67 + }
68 +
69 +- bufp = calloc(statb.st_size, 1);
70 ++ bufp = calloc(statb.st_size + 1, 1);
71 + if (bufp == NULL)
72 + {
73 + xerror = errno;
74
75 diff --git a/mail-filter/opendmarc/opendmarc-1.3.3.ebuild b/mail-filter/opendmarc/opendmarc-1.3.3.ebuild
76 new file mode 100644
77 index 00000000000..c572a891d2e
78 --- /dev/null
79 +++ b/mail-filter/opendmarc/opendmarc-1.3.3.ebuild
80 @@ -0,0 +1,78 @@
81 +# Copyright 1999-2020 Gentoo Authors
82 +# Distributed under the terms of the GNU General Public License v2
83 +
84 +EAPI=7
85 +
86 +inherit autotools user multilib systemd
87 +
88 +DESCRIPTION="Open source DMARC implementation "
89 +HOMEPAGE="http://www.trusteddomain.org/opendmarc/"
90 +SRC_URI="https://github.com/trusteddomainproject/OpenDMARC/archive/rel-${PN}-${PV//./-}.tar.gz -> ${P}.tar.gz"
91 +
92 +LICENSE="BSD"
93 +SLOT="0"
94 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
95 +IUSE="spf +reports static-libs"
96 +
97 +DEPEND="reports? ( dev-perl/DBI )
98 + || ( mail-filter/libmilter mail-mta/sendmail )"
99 +RDEPEND="${DEPEND}
100 + reports? (
101 + dev-perl/DBD-mysql
102 + dev-perl/HTTP-Message
103 + dev-perl/Switch
104 + )
105 + spf? ( mail-filter/libspf2 )"
106 +
107 +PATCHES=(
108 + "${FILESDIR}"/${PN}-1.3.2-multiple-From.patch
109 + "${FILESDIR}"/${PN}-1.3.3-CVE-2020-12460.patch
110 +)
111 +
112 +S=${WORKDIR}/OpenDMARC-rel-${PN}-${PV//./-}
113 +
114 +pkg_setup() {
115 + enewgroup milter
116 + enewuser milter -1 -1 /var/lib/milter milter
117 +}
118 +
119 +src_prepare() {
120 + default
121 +
122 + # fix issue after they removed docs
123 + sed -i -e '/^\s\+docs\/Makefile/d' configure.ac || die
124 +
125 + eautoreconf
126 + if use !reports ; then
127 + sed -i -e '/^SUBDIRS =/s/reports//' Makefile.in || die
128 + fi
129 +}
130 +
131 +src_configure() {
132 + econf \
133 + $(use_with spf) \
134 + $(use_with spf spf2-include "${EPREFIX}"/usr/include/spf2) \
135 + $(use_with spf spf2-lib "${EPREFIX}"/usr/$(get_libdir)) \
136 + $(use_enable static-libs static)
137 +}
138 +
139 +src_install() {
140 + default
141 +
142 + use static-libs || rm -f "${ED}"/usr/$(get_libdir)/*.la
143 +
144 + newinitd "${FILESDIR}"/opendmarc.initd opendmarc
145 + newconfd "${FILESDIR}"/opendmarc.confd opendmarc
146 + systemd_dounit "${FILESDIR}/${PN}.service"
147 +
148 + dodir /etc/opendmarc
149 +
150 + # create config file
151 + sed \
152 + -e 's:^# UserID .*$:UserID milter:' \
153 + -e "s:^# PidFile .*:PidFile ${EPREFIX}/var/run/opendmarc/opendmarc.pid:" \
154 + -e '/^# Socket /s:^# ::' \
155 + "${S}"/opendmarc/opendmarc.conf.sample \
156 + > "${ED}"/etc/opendmarc/opendmarc.conf \
157 + || die
158 +}