1 |
commit: bf03d01bf3ef47f987527fb5fa6edb3ebf78050f |
2 |
Author: Marcin Woźniak <y0rune <AT> aol <DOT> com> |
3 |
AuthorDate: Sun Oct 11 12:39:55 2020 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Sun Oct 11 12:39:55 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bf03d01b |
7 |
|
8 |
mail-client/heirloom-mailx: Added heirloom-mailx-12.5 |
9 |
|
10 |
Signed-off-by: Marcin Woźniak <y0rune <AT> aol.com> |
11 |
|
12 |
mail-client/heirloom-mailx/Manifest | 1 + |
13 |
.../files/heirloom-mailx-12.5-fixes-1.patch | 232 +++++++++++++++++++++ |
14 |
.../heirloom-mailx/heirloom-mailx-12.5.ebuild | 39 ++++ |
15 |
mail-client/heirloom-mailx/metadata.xml | 8 + |
16 |
4 files changed, 280 insertions(+) |
17 |
|
18 |
diff --git a/mail-client/heirloom-mailx/Manifest b/mail-client/heirloom-mailx/Manifest |
19 |
new file mode 100644 |
20 |
index 00000000..f70413e5 |
21 |
--- /dev/null |
22 |
+++ b/mail-client/heirloom-mailx/Manifest |
23 |
@@ -0,0 +1 @@ |
24 |
+DIST heirloom-mailx_12.5.orig.tar.gz 324085 BLAKE2B 8f3b7177d9db8bb399f9e3e8d51258d93ea6ea9556f514c9107b0733f2f999ec9c685107c8a11717526051c242d5f20d4b6fc1a572175539874904cb31fcc452 SHA512 eb4aea0c668354f6fe28137f72bf49d291ce58671a7b70c7775777532e17e59ac52156e68f02937256f0a2f90c132b7c0948553b55daad92a664bd8bbb64774f |
25 |
|
26 |
diff --git a/mail-client/heirloom-mailx/files/heirloom-mailx-12.5-fixes-1.patch b/mail-client/heirloom-mailx/files/heirloom-mailx-12.5-fixes-1.patch |
27 |
new file mode 100644 |
28 |
index 00000000..fa6d5119 |
29 |
--- /dev/null |
30 |
+++ b/mail-client/heirloom-mailx/files/heirloom-mailx-12.5-fixes-1.patch |
31 |
@@ -0,0 +1,232 @@ |
32 |
+Submitted By: Ken Moffat <ken at linuxfromscratch dot org> |
33 |
+Date: 2014-12-27 |
34 |
+Initial Package Version: 12.5 |
35 |
+Upstream Status: Unknown |
36 |
+Origin: Changes to remove SSL2 found at debian, remainder from redhat. |
37 |
+Description: Removes support for SSL2 (openssl no longer supports it) |
38 |
+and fixes CVE-2004-2771 [sic] and CVE-2014-7844. |
39 |
+ |
40 |
+diff -Naur heirloom-mailx-12.5/extern.h heirloom-mailx-12.5-patched/extern.h |
41 |
+--- heirloom-mailx-12.5/extern.h 2011-04-26 22:23:22.000000000 +0100 |
42 |
++++ heirloom-mailx-12.5-patched/extern.h 2014-12-27 01:26:59.654169487 +0000 |
43 |
+@@ -396,7 +396,7 @@ |
44 |
+ int is_fileaddr(char *name); |
45 |
+ struct name *usermap(struct name *names); |
46 |
+ struct name *cat(struct name *n1, struct name *n2); |
47 |
+-char **unpack(struct name *np); |
48 |
++char **unpack(struct name *smopts, struct name *np); |
49 |
+ struct name *elide(struct name *names); |
50 |
+ int count(struct name *np); |
51 |
+ struct name *delete_alternates(struct name *np); |
52 |
+diff -Naur heirloom-mailx-12.5/fio.c heirloom-mailx-12.5-patched/fio.c |
53 |
+--- heirloom-mailx-12.5/fio.c 2011-04-26 22:23:22.000000000 +0100 |
54 |
++++ heirloom-mailx-12.5-patched/fio.c 2014-12-27 01:27:15.634561413 +0000 |
55 |
+@@ -43,12 +43,15 @@ |
56 |
+ #endif /* not lint */ |
57 |
+ |
58 |
+ #include "rcv.h" |
59 |
++ |
60 |
++#ifndef HAVE_WORDEXP |
61 |
++#error wordexp support is required |
62 |
++#endif |
63 |
++ |
64 |
+ #include <sys/stat.h> |
65 |
+ #include <sys/file.h> |
66 |
+ #include <sys/wait.h> |
67 |
+-#ifdef HAVE_WORDEXP |
68 |
+ #include <wordexp.h> |
69 |
+-#endif /* HAVE_WORDEXP */ |
70 |
+ #include <unistd.h> |
71 |
+ |
72 |
+ #if defined (USE_NSS) |
73 |
+@@ -481,7 +484,6 @@ |
74 |
+ static char * |
75 |
+ globname(char *name) |
76 |
+ { |
77 |
+-#ifdef HAVE_WORDEXP |
78 |
+ wordexp_t we; |
79 |
+ char *cp; |
80 |
+ sigset_t nset; |
81 |
+@@ -495,7 +497,7 @@ |
82 |
+ sigemptyset(&nset); |
83 |
+ sigaddset(&nset, SIGCHLD); |
84 |
+ sigprocmask(SIG_BLOCK, &nset, NULL); |
85 |
+- i = wordexp(name, &we, 0); |
86 |
++ i = wordexp(name, &we, WRDE_NOCMD); |
87 |
+ sigprocmask(SIG_UNBLOCK, &nset, NULL); |
88 |
+ switch (i) { |
89 |
+ case 0: |
90 |
+@@ -527,65 +529,6 @@ |
91 |
+ } |
92 |
+ wordfree(&we); |
93 |
+ return cp; |
94 |
+-#else /* !HAVE_WORDEXP */ |
95 |
+- char xname[PATHSIZE]; |
96 |
+- char cmdbuf[PATHSIZE]; /* also used for file names */ |
97 |
+- int pid, l; |
98 |
+- char *cp, *shell; |
99 |
+- int pivec[2]; |
100 |
+- extern int wait_status; |
101 |
+- struct stat sbuf; |
102 |
+- |
103 |
+- if (pipe(pivec) < 0) { |
104 |
+- perror("pipe"); |
105 |
+- return name; |
106 |
+- } |
107 |
+- snprintf(cmdbuf, sizeof cmdbuf, "echo %s", name); |
108 |
+- if ((shell = value("SHELL")) == NULL) |
109 |
+- shell = SHELL; |
110 |
+- pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL); |
111 |
+- if (pid < 0) { |
112 |
+- close(pivec[0]); |
113 |
+- close(pivec[1]); |
114 |
+- return NULL; |
115 |
+- } |
116 |
+- close(pivec[1]); |
117 |
+-again: |
118 |
+- l = read(pivec[0], xname, sizeof xname); |
119 |
+- if (l < 0) { |
120 |
+- if (errno == EINTR) |
121 |
+- goto again; |
122 |
+- perror("read"); |
123 |
+- close(pivec[0]); |
124 |
+- return NULL; |
125 |
+- } |
126 |
+- close(pivec[0]); |
127 |
+- if (wait_child(pid) < 0 && WTERMSIG(wait_status) != SIGPIPE) { |
128 |
+- fprintf(stderr, catgets(catd, CATSET, 81, |
129 |
+- "\"%s\": Expansion failed.\n"), name); |
130 |
+- return NULL; |
131 |
+- } |
132 |
+- if (l == 0) { |
133 |
+- fprintf(stderr, catgets(catd, CATSET, 82, |
134 |
+- "\"%s\": No match.\n"), name); |
135 |
+- return NULL; |
136 |
+- } |
137 |
+- if (l == sizeof xname) { |
138 |
+- fprintf(stderr, catgets(catd, CATSET, 83, |
139 |
+- "\"%s\": Expansion buffer overflow.\n"), name); |
140 |
+- return NULL; |
141 |
+- } |
142 |
+- xname[l] = 0; |
143 |
+- for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--) |
144 |
+- ; |
145 |
+- cp[1] = '\0'; |
146 |
+- if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) { |
147 |
+- fprintf(stderr, catgets(catd, CATSET, 84, |
148 |
+- "\"%s\": Ambiguous.\n"), name); |
149 |
+- return NULL; |
150 |
+- } |
151 |
+- return savestr(xname); |
152 |
+-#endif /* !HAVE_WORDEXP */ |
153 |
+ } |
154 |
+ |
155 |
+ /* |
156 |
+diff -Naur heirloom-mailx-12.5/mailx.1 heirloom-mailx-12.5-patched/mailx.1 |
157 |
+--- heirloom-mailx-12.5/mailx.1 2011-04-26 22:23:22.000000000 +0100 |
158 |
++++ heirloom-mailx-12.5-patched/mailx.1 2014-12-27 01:26:53.838026857 +0000 |
159 |
+@@ -656,6 +656,14 @@ |
160 |
+ will have the system wide alias expanded |
161 |
+ as all mail goes through sendmail. |
162 |
+ .SS "Recipient address specifications" |
163 |
++If the |
164 |
++.I expandaddr |
165 |
++option is not set (the default), recipient addresses must be names of |
166 |
++local mailboxes or Internet mail addresses. |
167 |
++.PP |
168 |
++If the |
169 |
++.I expandaddr |
170 |
++option is set, the following rules apply: |
171 |
+ When an address is used to name a recipient |
172 |
+ (in any of To, Cc, or Bcc), |
173 |
+ names of local mail folders |
174 |
+@@ -2391,6 +2399,12 @@ |
175 |
+ If this option is set, |
176 |
+ \fImailx\fR starts even with an empty mailbox. |
177 |
+ .TP |
178 |
++.B expandaddr |
179 |
++Causes |
180 |
++.I mailx |
181 |
++to expand message recipient addresses, as explained in the section, |
182 |
++Recipient address specifications. |
183 |
++.TP |
184 |
+ .B flipr |
185 |
+ Exchanges the |
186 |
+ .I Respond |
187 |
+@@ -3575,7 +3589,7 @@ |
188 |
+ .TP |
189 |
+ .B ssl-method |
190 |
+ Selects a SSL/TLS protocol version; |
191 |
+-valid values are `ssl2', `ssl3', and `tls1'. |
192 |
++valid values are `ssl3', and `tls1'. |
193 |
+ If unset, the method is selected automatically, |
194 |
+ if possible. |
195 |
+ .TP |
196 |
+diff -Naur heirloom-mailx-12.5/names.c heirloom-mailx-12.5-patched/names.c |
197 |
+--- heirloom-mailx-12.5/names.c 2011-04-26 22:23:22.000000000 +0100 |
198 |
++++ heirloom-mailx-12.5-patched/names.c 2014-12-27 01:26:59.654169487 +0000 |
199 |
+@@ -268,6 +268,9 @@ |
200 |
+ FILE *fout, *fin; |
201 |
+ int ispipe; |
202 |
+ |
203 |
++ if (value("expandaddr") == NULL) |
204 |
++ return names; |
205 |
++ |
206 |
+ top = names; |
207 |
+ np = names; |
208 |
+ time(&now); |
209 |
+@@ -546,7 +549,7 @@ |
210 |
+ * Return an error if the name list won't fit. |
211 |
+ */ |
212 |
+ char ** |
213 |
+-unpack(struct name *np) |
214 |
++unpack(struct name *smopts, struct name *np) |
215 |
+ { |
216 |
+ char **ap, **top; |
217 |
+ struct name *n; |
218 |
+@@ -561,7 +564,7 @@ |
219 |
+ * the terminating 0 pointer. Additional spots may be needed |
220 |
+ * to pass along -f to the host mailer. |
221 |
+ */ |
222 |
+- extra = 2; |
223 |
++ extra = 3 + count(smopts); |
224 |
+ extra++; |
225 |
+ metoo = value("metoo") != NULL; |
226 |
+ if (metoo) |
227 |
+@@ -578,6 +581,10 @@ |
228 |
+ *ap++ = "-m"; |
229 |
+ if (verbose) |
230 |
+ *ap++ = "-v"; |
231 |
++ for (; smopts != NULL; smopts = smopts->n_flink) |
232 |
++ if ((smopts->n_type & GDEL) == 0) |
233 |
++ *ap++ = smopts->n_name; |
234 |
++ *ap++ = "--"; |
235 |
+ for (; n != NULL; n = n->n_flink) |
236 |
+ if ((n->n_type & GDEL) == 0) |
237 |
+ *ap++ = n->n_name; |
238 |
+diff -Naur heirloom-mailx-12.5/openssl.c heirloom-mailx-12.5-patched/openssl.c |
239 |
+--- heirloom-mailx-12.5/openssl.c 2011-04-26 22:23:22.000000000 +0100 |
240 |
++++ heirloom-mailx-12.5-patched/openssl.c 2014-12-27 01:26:34.385549867 +0000 |
241 |
+@@ -216,9 +216,7 @@ |
242 |
+ |
243 |
+ cp = ssl_method_string(uhp); |
244 |
+ if (cp != NULL) { |
245 |
+- if (equal(cp, "ssl2")) |
246 |
+- method = SSLv2_client_method(); |
247 |
+- else if (equal(cp, "ssl3")) |
248 |
++ if (equal(cp, "ssl3")) |
249 |
+ method = SSLv3_client_method(); |
250 |
+ else if (equal(cp, "tls1")) |
251 |
+ method = TLSv1_client_method(); |
252 |
+diff -Naur heirloom-mailx-12.5/sendout.c heirloom-mailx-12.5-patched/sendout.c |
253 |
+--- heirloom-mailx-12.5/sendout.c 2011-04-26 22:23:22.000000000 +0100 |
254 |
++++ heirloom-mailx-12.5-patched/sendout.c 2014-12-27 01:26:59.654169487 +0000 |
255 |
+@@ -835,7 +835,7 @@ |
256 |
+ #endif /* HAVE_SOCKETS */ |
257 |
+ |
258 |
+ if ((smtp = value("smtp")) == NULL) { |
259 |
+- args = unpack(cat(mailargs, to)); |
260 |
++ args = unpack(mailargs, to); |
261 |
+ if (debug || value("debug")) { |
262 |
+ printf(catgets(catd, CATSET, 181, |
263 |
+ "Sendmail arguments:")); |
264 |
|
265 |
diff --git a/mail-client/heirloom-mailx/heirloom-mailx-12.5.ebuild b/mail-client/heirloom-mailx/heirloom-mailx-12.5.ebuild |
266 |
new file mode 100644 |
267 |
index 00000000..9ac71c46 |
268 |
--- /dev/null |
269 |
+++ b/mail-client/heirloom-mailx/heirloom-mailx-12.5.ebuild |
270 |
@@ -0,0 +1,39 @@ |
271 |
+# Copyright 2020 Gentoo Authors |
272 |
+# Distributed under the terms of the GNU General Public License v2 |
273 |
+ |
274 |
+EAPI=7 |
275 |
+ |
276 |
+LICENSE="BSD" |
277 |
+DESCRIPTION="The heirloom-mailx, this is version mailx in CentOS" |
278 |
+HOMEPAGE="https://www.debian.org/" |
279 |
+SRC_URI="https://yorune.pl/gentoo/${CATEGORY}/${PN}/${PN}_${PVR}.orig.tar.gz http://ftp.debian.org/debian/pool/main/h/${PN}/${PN}_${PVR}.orig.tar.gz" |
280 |
+KEYWORDS="~amd64" |
281 |
+ |
282 |
+DEPEND="net-libs/liblockfile |
283 |
+ dev-libs/libbsd |
284 |
+ virtual/mta |
285 |
+ mail-client/mailx-support" |
286 |
+ |
287 |
+RDEPEND="${DEPEND} |
288 |
+ !virtual/mailx |
289 |
+ !mail-client/nail |
290 |
+ !net-mail/mailutils |
291 |
+ !mail-client/mailx" |
292 |
+ |
293 |
+SLOT="0" |
294 |
+ |
295 |
+src_prepare() { |
296 |
+ eapply -p1 "${FILESDIR}/${PN}-${PVR}-fixes-1.patch" |
297 |
+ eapply_user |
298 |
+} |
299 |
+ |
300 |
+src_compile(){ |
301 |
+ sed 's@<openssl@<openssl-1.0/openssl@' -i openssl.c fio.c makeconfig |
302 |
+ emake LDFLAGS+="-L /usr/lib/openssl-1.0/" SENDMAIL=/usr/sbin/sendmail |
303 |
+} |
304 |
+ |
305 |
+src_install(){ |
306 |
+ emake PREFIX=${D}/usr SYSCONFDIR=${D}/etc UCBINSTALL=/usr/bin/install install |
307 |
+ install -v -m755 -d ${D}/usr/share/doc/heirloom-mailx-12.5 |
308 |
+ install -v -m644 README ${D}/usr/share/doc/heirloom-mailx-12.5 |
309 |
+} |
310 |
|
311 |
diff --git a/mail-client/heirloom-mailx/metadata.xml b/mail-client/heirloom-mailx/metadata.xml |
312 |
new file mode 100644 |
313 |
index 00000000..7bb0ff77 |
314 |
--- /dev/null |
315 |
+++ b/mail-client/heirloom-mailx/metadata.xml |
316 |
@@ -0,0 +1,8 @@ |
317 |
+<?xml version="1.0" encoding="UTF-8"?> |
318 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
319 |
+<pkgmetadata> |
320 |
+ <maintainer type="person"> |
321 |
+ <email>y0rune@×××.com</email> |
322 |
+ <name>Marcin Woźniak</name> |
323 |
+ </maintainer> |
324 |
+</pkgmetadata> |