Package init
This commit is contained in:
commit
47a0c564ab
34
get-upstream-tarball.sh
Executable file
34
get-upstream-tarball.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Mailx's upstream provides only the CVS method of downloading source code.
|
||||||
|
# This script can be used for downloading the CVS repository and creating
|
||||||
|
# the tarball.
|
||||||
|
#
|
||||||
|
# Usage: ./get-upstream-tarball.sh
|
||||||
|
#
|
||||||
|
# This code is in the public domain; do with it what you wish.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2012 Peter Schiffer <pschiffe@redhat.com>
|
||||||
|
#
|
||||||
|
|
||||||
|
newdir=new-upstream-tarball
|
||||||
|
|
||||||
|
mkdir $newdir
|
||||||
|
cd $newdir
|
||||||
|
|
||||||
|
# checkout cvs
|
||||||
|
echo "== Just press Enter =="
|
||||||
|
cvs -d:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail login
|
||||||
|
cvs -d:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail co nail
|
||||||
|
|
||||||
|
# remove CVS folders
|
||||||
|
rm -rf nail/CVS nail/catd/CVS
|
||||||
|
|
||||||
|
# find version in nail/version.c file defined as: #define V "xxx"
|
||||||
|
ver=$(sed -rn 's/#define\s+V\s+\"([0-9.]+)\"/\1/p' nail/version.c)
|
||||||
|
|
||||||
|
mv nail mailx-$ver
|
||||||
|
tar cJf mailx-$ver.tar.xz mailx-$ver
|
||||||
|
|
||||||
|
rm -rf mailx-$ver
|
||||||
|
|
||||||
12
mailx-12.3-pager.patch
Normal file
12
mailx-12.3-pager.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Nrbu mailx-12.3/cmd1.c mailx-12.3-OK/cmd1.c
|
||||||
|
--- mailx-12.3/cmd1.c 2007-06-16 16:48:39.000000000 +0400
|
||||||
|
+++ mailx-12.3-OK/cmd1.c 2008-06-26 19:57:38.000000000 +0400
|
||||||
|
@@ -78,7 +78,7 @@
|
||||||
|
|
||||||
|
cp = value("PAGER");
|
||||||
|
if (cp == NULL || *cp == '\0')
|
||||||
|
- cp = value("bsdcompat") ? "more" : "pg";
|
||||||
|
+ cp = value("bsdcompat") ? "more" : "less";
|
||||||
|
return cp;
|
||||||
|
}
|
||||||
|
|
||||||
13
mailx-12.5-collect.patch
Normal file
13
mailx-12.5-collect.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- mailx-12.4.orig/collect.c 2012-09-12 16:07:53.653103796 -0400
|
||||||
|
+++ mailx-12.4/collect.c 2012-09-12 21:27:05.092259236 -0400
|
||||||
|
@@ -905,7 +905,9 @@ err:
|
||||||
|
if (collf != NULL) {
|
||||||
|
Fclose(collf);
|
||||||
|
collf = NULL;
|
||||||
|
- }
|
||||||
|
+ } else {
|
||||||
|
+ exit(1);
|
||||||
|
+ }
|
||||||
|
out:
|
||||||
|
if (collf != NULL) {
|
||||||
|
if ((cp = value("MAILX_TAIL")) != NULL) {
|
||||||
45
mailx-12.5-empty-from.patch
Normal file
45
mailx-12.5-empty-from.patch
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
diff -uprN nail/sendout.c nail-patched/sendout.c
|
||||||
|
--- nail/sendout.c 2015-07-16 14:15:22.864905226 +0200
|
||||||
|
+++ nail-patched/sendout.c 2015-07-17 09:41:06.778677181 +0200
|
||||||
|
@@ -966,6 +966,19 @@ mail1(struct header *hp, int printheader
|
||||||
|
return STOP;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Variable "from" is set but empty, let user know
|
||||||
|
+ * that something is wrong.
|
||||||
|
+ */
|
||||||
|
+ if ((cp = value("from")) != NULL && !*cp) {
|
||||||
|
+ fprintf(stderr, "From address is empty. ");
|
||||||
|
+ fprintf(stderr, "Check your mail config ");
|
||||||
|
+ fprintf(stderr, "file for typos. E.g. no ");
|
||||||
|
+ fprintf(stderr, "whitespace after set from=");
|
||||||
|
+ fprintf(stderr, "\n");
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if ((cp = value("autocc")) != NULL && *cp)
|
||||||
|
hp->h_cc = cat(hp->h_cc, checkaddrs(sextract(cp, GCC|GFULL)));
|
||||||
|
if ((cp = value("autobcc")) != NULL && *cp)
|
||||||
|
diff -uprN nail/smtp.c nail-patched/smtp.c
|
||||||
|
--- nail/smtp.c 2015-07-16 14:15:17.626914449 +0200
|
||||||
|
+++ nail-patched/smtp.c 2015-07-17 09:17:43.412730513 +0200
|
||||||
|
@@ -135,7 +135,7 @@ myaddrs(struct header *hp)
|
||||||
|
if (hp->h_from->n_name)
|
||||||
|
return savestr(hp->h_from->n_name);
|
||||||
|
}
|
||||||
|
- if ((cp = value("from")) != NULL)
|
||||||
|
+ if ((cp = value("from")) != NULL && *cp)
|
||||||
|
return cp;
|
||||||
|
/*
|
||||||
|
* When invoking sendmail directly, it's its task
|
||||||
|
@@ -177,6 +177,9 @@ smtp_auth_var(const char *type, const ch
|
||||||
|
char *var, *cp;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
+ if (type == NULL || addr == NULL)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
var = ac_alloc(len = strlen(type) + strlen(addr) + 7);
|
||||||
|
snprintf(var, len, "smtp-auth%s-%s", type, addr);
|
||||||
|
if ((cp = value(var)) != NULL)
|
||||||
174
mailx-12.5-encsplit.patch
Normal file
174
mailx-12.5-encsplit.patch
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
diff --git a/mime.c b/mime.c
|
||||||
|
index 45de80a..ecac85d 100644
|
||||||
|
--- a/mime.c
|
||||||
|
+++ b/mime.c
|
||||||
|
@@ -1109,16 +1109,34 @@ fromhdr_end:
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
+ * return length of this UTF-8 codepoint in bytes
|
||||||
|
+ */
|
||||||
|
+static size_t
|
||||||
|
+codepointsize(char tc)
|
||||||
|
+{
|
||||||
|
+ int rv = 0;
|
||||||
|
+ if ( ! ( tc & 0x80 ) )
|
||||||
|
+ return 1;
|
||||||
|
+ while ( tc & 0x80 )
|
||||||
|
+ {
|
||||||
|
+ rv++;
|
||||||
|
+ tc = tc<<1;
|
||||||
|
+ }
|
||||||
|
+ return rv;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
* Convert header fields to RFC 1522 format and write to the file fo.
|
||||||
|
*/
|
||||||
|
static size_t
|
||||||
|
mime_write_tohdr(struct str *in, FILE *fo)
|
||||||
|
{
|
||||||
|
char *upper, *wbeg, *wend, *charset, *lastwordend = NULL, *lastspc, b,
|
||||||
|
- *charset7;
|
||||||
|
+ *charset7, *cp;
|
||||||
|
struct str cin, cout;
|
||||||
|
- size_t sz = 0, col = 0, wr, charsetlen, charset7len;
|
||||||
|
+ size_t sz = 0, col = 0, wr, charsetlen, charset7len, cpsz;
|
||||||
|
int quoteany, mustquote, broken,
|
||||||
|
+ maxin, maxout, curin, cps,
|
||||||
|
maxcol = 65 /* there is the header field's name, too */;
|
||||||
|
|
||||||
|
upper = in->s + in->l;
|
||||||
|
@@ -1134,41 +1152,75 @@ mime_write_tohdr(struct str *in, FILE *fo)
|
||||||
|
if (mustquote_hdr(wbeg, wbeg == in->s, wbeg == &upper[-1]))
|
||||||
|
quoteany++;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * rfc2047 says we cannot split multi-byte characters over
|
||||||
|
+ * encoded words, so we need to know if we're a multi-byte
|
||||||
|
+ * source stream (UTF-8 specifically) or just an 8 bit
|
||||||
|
+ * stream like ISO-8859-15
|
||||||
|
+ * so test beginning of charset since it is valid to include
|
||||||
|
+ * language in charset "UTF-8*DE" etc as per rfc 2184/2231
|
||||||
|
+ */
|
||||||
|
+ char *thisset = b&0200 ? charset : charset7;
|
||||||
|
+ int is_utf8 = ( strncasecmp( thisset, "utf-8", 5 ) == 0 );
|
||||||
|
+
|
||||||
|
if (2 * quoteany > in->l) {
|
||||||
|
/*
|
||||||
|
* Print the entire field in base64.
|
||||||
|
*/
|
||||||
|
- for (wbeg = in->s; wbeg < upper; wbeg = wend) {
|
||||||
|
+ for (wbeg = in->s; wbeg < upper; ) {
|
||||||
|
wend = upper;
|
||||||
|
cin.s = wbeg;
|
||||||
|
- for (;;) {
|
||||||
|
- cin.l = wend - wbeg;
|
||||||
|
- if (cin.l * 4/3 + 7 + charsetlen
|
||||||
|
- < maxcol - col) {
|
||||||
|
- fprintf(fo, "=?%s?B?",
|
||||||
|
- b&0200 ? charset : charset7);
|
||||||
|
- wr = mime_write_tob64(&cin, fo, 1);
|
||||||
|
- fwrite("?=", sizeof (char), 2, fo);
|
||||||
|
- wr += 7 + charsetlen;
|
||||||
|
- sz += wr, col += wr;
|
||||||
|
- if (wend < upper) {
|
||||||
|
- fwrite("\n ", sizeof (char),
|
||||||
|
- 2, fo);
|
||||||
|
- sz += 2;
|
||||||
|
- col = 0;
|
||||||
|
- maxcol = 76;
|
||||||
|
+ /*
|
||||||
|
+ * we calculate the maximum number of bytes
|
||||||
|
+ * we can use on this output line, and then what
|
||||||
|
+ * this equates to as base64 encoded source bytes
|
||||||
|
+ */
|
||||||
|
+ maxout = maxcol - col - 7 - charsetlen;
|
||||||
|
+ maxin = (maxout - (maxout & 0x03)) * 3/4;
|
||||||
|
+
|
||||||
|
+ /* short enough to finish ? */
|
||||||
|
+ if (maxin > upper - wbeg )
|
||||||
|
+ {
|
||||||
|
+ curin = upper - wbeg;
|
||||||
|
+ wbeg += curin;
|
||||||
|
+ }else
|
||||||
|
+ {
|
||||||
|
+ if (is_utf8)
|
||||||
|
+ {
|
||||||
|
+ /*
|
||||||
|
+ * now scan the input from the beginning
|
||||||
|
+ * to see how many codepoints will fit
|
||||||
|
+ */
|
||||||
|
+ curin = 0;
|
||||||
|
+ while (curin < maxin
|
||||||
|
+ && (cpsz = codepointsize(*wbeg)) <= (maxin - curin))
|
||||||
|
+ {
|
||||||
|
+ curin += cpsz;
|
||||||
|
+ wbeg += cpsz;
|
||||||
|
}
|
||||||
|
- break;
|
||||||
|
- } else {
|
||||||
|
- if (col) {
|
||||||
|
- fprintf(fo, "\n ");
|
||||||
|
- sz += 2;
|
||||||
|
- col = 0;
|
||||||
|
- maxcol = 76;
|
||||||
|
- } else
|
||||||
|
- wend -= 4;
|
||||||
|
+ }else
|
||||||
|
+ {
|
||||||
|
+ curin = maxin;
|
||||||
|
+ wbeg += maxin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ cin.l = curin;
|
||||||
|
+ fprintf(fo, "%s=?%s?B?", (cin.s != in->s) ? " " : "", thisset );
|
||||||
|
+ wr = mime_write_tob64(&cin, fo, 1);
|
||||||
|
+
|
||||||
|
+ if (wbeg < upper)
|
||||||
|
+ {
|
||||||
|
+ wr += fwrite("?=\n ", sizeof (char), 4, fo) * sizeof (char);
|
||||||
|
+ }else
|
||||||
|
+ {
|
||||||
|
+ wr += fwrite("?=", sizeof (char), 2, fo) * sizeof (char);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* and shuffle pointers and counts */
|
||||||
|
+ col = 1;
|
||||||
|
+ maxcol = 76;
|
||||||
|
+ sz += wr + 7 + charsetlen + ((cin.s != in->s) ? 1 : 0 );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
@@ -1243,7 +1295,29 @@ mime_write_tohdr(struct str *in, FILE *fo)
|
||||||
|
maxcol -= wbeg -
|
||||||
|
lastspc;
|
||||||
|
} else {
|
||||||
|
- wend -= 4;
|
||||||
|
+ if (is_utf8)
|
||||||
|
+ {
|
||||||
|
+ /*
|
||||||
|
+ * make sure wend is not pointing to
|
||||||
|
+ * the middle of a codepoint
|
||||||
|
+ */
|
||||||
|
+ cp = wend;
|
||||||
|
+ while (--cp > wbeg)
|
||||||
|
+ {
|
||||||
|
+ cps = codepointsize(*cp);
|
||||||
|
+ if (cps > 1)
|
||||||
|
+ {
|
||||||
|
+ if (wend - cp - cps > 4)
|
||||||
|
+ wend -= 4;
|
||||||
|
+ else
|
||||||
|
+ wend = cp;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if (cp == wbeg)
|
||||||
|
+ wend -= 4;
|
||||||
|
+ } else
|
||||||
|
+ wend -= 4;
|
||||||
|
}
|
||||||
|
free(cout.s);
|
||||||
|
}
|
||||||
108
mailx-12.5-fio.c-Unconditionally-require-wordexp-support.patch
Normal file
108
mailx-12.5-fio.c-Unconditionally-require-wordexp-support.patch
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
From 2bae8ecf04ec2ba6bb9f0af5b80485dd0edb427d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Mon, 17 Nov 2014 12:48:25 +0100
|
||||||
|
Subject: [PATCH 3/4] fio.c: Unconditionally require wordexp support
|
||||||
|
|
||||||
|
---
|
||||||
|
fio.c | 67 +++++--------------------------------------------------------------
|
||||||
|
1 file changed, 5 insertions(+), 62 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/fio.c b/fio.c
|
||||||
|
index 65e8f10..1529236 100644
|
||||||
|
--- a/fio.c
|
||||||
|
+++ b/fio.c
|
||||||
|
@@ -43,12 +43,15 @@ static char sccsid[] = "@(#)fio.c 2.76 (gritter) 9/16/09";
|
||||||
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include "rcv.h"
|
||||||
|
+
|
||||||
|
+#ifndef HAVE_WORDEXP
|
||||||
|
+#error wordexp support is required
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/file.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
-#ifdef HAVE_WORDEXP
|
||||||
|
#include <wordexp.h>
|
||||||
|
-#endif /* HAVE_WORDEXP */
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#if defined (USE_NSS)
|
||||||
|
@@ -481,7 +484,6 @@ next:
|
||||||
|
static char *
|
||||||
|
globname(char *name)
|
||||||
|
{
|
||||||
|
-#ifdef HAVE_WORDEXP
|
||||||
|
wordexp_t we;
|
||||||
|
char *cp;
|
||||||
|
sigset_t nset;
|
||||||
|
@@ -527,65 +529,6 @@ globname(char *name)
|
||||||
|
}
|
||||||
|
wordfree(&we);
|
||||||
|
return cp;
|
||||||
|
-#else /* !HAVE_WORDEXP */
|
||||||
|
- char xname[PATHSIZE];
|
||||||
|
- char cmdbuf[PATHSIZE]; /* also used for file names */
|
||||||
|
- int pid, l;
|
||||||
|
- char *cp, *shell;
|
||||||
|
- int pivec[2];
|
||||||
|
- extern int wait_status;
|
||||||
|
- struct stat sbuf;
|
||||||
|
-
|
||||||
|
- if (pipe(pivec) < 0) {
|
||||||
|
- perror("pipe");
|
||||||
|
- return name;
|
||||||
|
- }
|
||||||
|
- snprintf(cmdbuf, sizeof cmdbuf, "echo %s", name);
|
||||||
|
- if ((shell = value("SHELL")) == NULL)
|
||||||
|
- shell = SHELL;
|
||||||
|
- pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL);
|
||||||
|
- if (pid < 0) {
|
||||||
|
- close(pivec[0]);
|
||||||
|
- close(pivec[1]);
|
||||||
|
- return NULL;
|
||||||
|
- }
|
||||||
|
- close(pivec[1]);
|
||||||
|
-again:
|
||||||
|
- l = read(pivec[0], xname, sizeof xname);
|
||||||
|
- if (l < 0) {
|
||||||
|
- if (errno == EINTR)
|
||||||
|
- goto again;
|
||||||
|
- perror("read");
|
||||||
|
- close(pivec[0]);
|
||||||
|
- return NULL;
|
||||||
|
- }
|
||||||
|
- close(pivec[0]);
|
||||||
|
- if (wait_child(pid) < 0 && WTERMSIG(wait_status) != SIGPIPE) {
|
||||||
|
- fprintf(stderr, catgets(catd, CATSET, 81,
|
||||||
|
- "\"%s\": Expansion failed.\n"), name);
|
||||||
|
- return NULL;
|
||||||
|
- }
|
||||||
|
- if (l == 0) {
|
||||||
|
- fprintf(stderr, catgets(catd, CATSET, 82,
|
||||||
|
- "\"%s\": No match.\n"), name);
|
||||||
|
- return NULL;
|
||||||
|
- }
|
||||||
|
- if (l == sizeof xname) {
|
||||||
|
- fprintf(stderr, catgets(catd, CATSET, 83,
|
||||||
|
- "\"%s\": Expansion buffer overflow.\n"), name);
|
||||||
|
- return NULL;
|
||||||
|
- }
|
||||||
|
- xname[l] = 0;
|
||||||
|
- for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
|
||||||
|
- ;
|
||||||
|
- cp[1] = '\0';
|
||||||
|
- if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) {
|
||||||
|
- fprintf(stderr, catgets(catd, CATSET, 84,
|
||||||
|
- "\"%s\": Ambiguous.\n"), name);
|
||||||
|
- return NULL;
|
||||||
|
- }
|
||||||
|
- return savestr(xname);
|
||||||
|
-#endif /* !HAVE_WORDEXP */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
||||||
12
mailx-12.5-fname-null.patch
Normal file
12
mailx-12.5-fname-null.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -upr mailx-12.5.orig/names.c mailx-12.5/names.c
|
||||||
|
--- mailx-12.5.orig/names.c 2006-03-04 01:32:16.000000000 +0100
|
||||||
|
+++ mailx-12.5/names.c 2012-11-01 15:28:43.883573793 +0100
|
||||||
|
@@ -357,7 +357,7 @@ outof(struct name *names, FILE *fo, stru
|
||||||
|
free_child(pid);
|
||||||
|
} else {
|
||||||
|
int f;
|
||||||
|
- if ((fout = Zopen(fname, "a", NULL)) == NULL) {
|
||||||
|
+ if ((fname == NULL) || ((fout = Zopen(fname, "a", NULL)) == NULL)) {
|
||||||
|
perror(fname);
|
||||||
|
senderr++;
|
||||||
|
goto cant;
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
From 73fefa0c1ac70043ec84f2d8b8f9f683213f168d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Mon, 17 Nov 2014 13:11:32 +0100
|
||||||
|
Subject: [PATCH 4/4] globname: Invoke wordexp with WRDE_NOCMD (CVE-2004-2771)
|
||||||
|
|
||||||
|
---
|
||||||
|
fio.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/fio.c b/fio.c
|
||||||
|
index 1529236..774a204 100644
|
||||||
|
--- a/fio.c
|
||||||
|
+++ b/fio.c
|
||||||
|
@@ -497,7 +497,7 @@ globname(char *name)
|
||||||
|
sigemptyset(&nset);
|
||||||
|
sigaddset(&nset, SIGCHLD);
|
||||||
|
sigprocmask(SIG_BLOCK, &nset, NULL);
|
||||||
|
- i = wordexp(name, &we, 0);
|
||||||
|
+ i = wordexp(name, &we, WRDE_NOCMD);
|
||||||
|
sigprocmask(SIG_UNBLOCK, &nset, NULL);
|
||||||
|
switch (i) {
|
||||||
|
case 0:
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
||||||
12
mailx-12.5-lzw.patch
Normal file
12
mailx-12.5-lzw.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Nrbu mailx-12.5/lzw.c mailx-12.5-OK/lzw.c
|
||||||
|
--- mailx-12.5/lzw.c 2006-03-04 03:32:16.000000000 +0300
|
||||||
|
+++ mailx-12.5-OK/lzw.c 2011-08-17 16:30:01.000000000 +0400
|
||||||
|
@@ -516,6 +516,8 @@
|
||||||
|
|
||||||
|
/* Generate output characters in reverse order. */
|
||||||
|
while (code >= 256) {
|
||||||
|
+ if (stackp - de_stack >= HSIZE - 1)
|
||||||
|
+ return -1;
|
||||||
|
*stackp++ = tab_suffixof(code);
|
||||||
|
code = tab_prefixof(code);
|
||||||
|
}
|
||||||
28
mailx-12.5-man-page-fixes.patch
Normal file
28
mailx-12.5-man-page-fixes.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
diff -ur mailx-12.5.orig/mailx.1 mailx-12.5/mailx.1
|
||||||
|
--- mailx-12.5.orig/mailx.1 2014-06-13 16:28:18.272418000 +0200
|
||||||
|
+++ mailx-12.5/mailx.1 2014-06-13 16:32:06.757714403 +0200
|
||||||
|
@@ -219,6 +219,14 @@
|
||||||
|
assigns
|
||||||
|
.I value
|
||||||
|
to it.
|
||||||
|
+Note, that when setting
|
||||||
|
+.I from
|
||||||
|
+variable, domain name of host is automatically added if value does not contain any.
|
||||||
|
+If you want to enter
|
||||||
|
+.I from
|
||||||
|
+address with owner's name, you can use, for example, following format:
|
||||||
|
+.B -S
|
||||||
|
+.I \(dqfrom=System User <DoNotReply>\(dq
|
||||||
|
.TP
|
||||||
|
.BI \-T \ name
|
||||||
|
Writes the `Message-Id:' and `Article-Id:' header fields
|
||||||
|
@@ -2189,7 +2197,8 @@
|
||||||
|
as part of the environment
|
||||||
|
(this is not restricted to specific variables as in the POSIX standard).
|
||||||
|
A value given in a startup file overrides
|
||||||
|
-a value imported from the environment.
|
||||||
|
+a value imported from the environment, but it is not possible to unset
|
||||||
|
+an environment variable in a startup file.
|
||||||
|
Options may be either binary,
|
||||||
|
in which case it is only significant
|
||||||
|
to see whether they are set or not;
|
||||||
25
mailx-12.5-nss-hostname-matching.patch
Normal file
25
mailx-12.5-nss-hostname-matching.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 5b7f57844682339340333034be1b8f99acafde28 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
|
||||||
|
Date: Thu, 7 Jan 2016 12:26:40 +0100
|
||||||
|
Subject: [PATCH] Fix NSS hostname matching
|
||||||
|
|
||||||
|
---
|
||||||
|
nss.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/nss.c b/nss.c
|
||||||
|
index 96b0ea3..2acbd5f 100644
|
||||||
|
--- a/nss.c
|
||||||
|
+++ b/nss.c
|
||||||
|
@@ -189,7 +189,7 @@ nss_check_host(const char *server, struct sock *sp)
|
||||||
|
fprintf(stderr,
|
||||||
|
"Comparing DNS name: \"%s\"\n",
|
||||||
|
dn);
|
||||||
|
- if (rfc2595_hostname_match(server, dn)
|
||||||
|
+ if ((ok = rfc2595_hostname_match(server, dn))
|
||||||
|
== OKAY) {
|
||||||
|
ac_free(dn);
|
||||||
|
goto out;
|
||||||
|
--
|
||||||
|
2.4.3
|
||||||
|
|
||||||
41
mailx-12.5-openssl.patch
Normal file
41
mailx-12.5-openssl.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
diff --git a/openssl.c b/openssl.c
|
||||||
|
index b4e33fc..9d1eaf4 100644
|
||||||
|
--- a/openssl.c
|
||||||
|
+++ b/openssl.c
|
||||||
|
@@ -136,6 +136,7 @@ ssl_rand_init(void)
|
||||||
|
int state = 0;
|
||||||
|
|
||||||
|
if ((cp = value("ssl-rand-egd")) != NULL) {
|
||||||
|
+#ifndef OPENSSL_NO_EGD
|
||||||
|
cp = expand(cp);
|
||||||
|
if (RAND_egd(cp) == -1) {
|
||||||
|
fprintf(stderr, catgets(catd, CATSET, 245,
|
||||||
|
@@ -143,6 +144,9 @@ ssl_rand_init(void)
|
||||||
|
cp);
|
||||||
|
} else
|
||||||
|
state = 1;
|
||||||
|
+#else
|
||||||
|
+ fprintf(stderr, "entropy daemon not available\n");
|
||||||
|
+#endif
|
||||||
|
} else if ((cp = value("ssl-rand-file")) != NULL) {
|
||||||
|
cp = expand(cp);
|
||||||
|
if (RAND_load_file(cp, 1024) == -1) {
|
||||||
|
@@ -216,9 +220,16 @@ ssl_select_method(const char *uhp)
|
||||||
|
|
||||||
|
cp = ssl_method_string(uhp);
|
||||||
|
if (cp != NULL) {
|
||||||
|
- if (equal(cp, "ssl2"))
|
||||||
|
+ if (equal(cp, "ssl2")) {
|
||||||
|
+#if OPENSSL_VERSION_NUMBER < 0x10100000
|
||||||
|
method = SSLv2_client_method();
|
||||||
|
- else if (equal(cp, "ssl3"))
|
||||||
|
+#else
|
||||||
|
+ /* SSLv2 support was removed in OpenSSL 1.1.0 */
|
||||||
|
+ fprintf(stderr, catgets(catd, CATSET, 244,
|
||||||
|
+ "Unsupported SSL method \"%s\"\n"), cp);
|
||||||
|
+ method = SSLv23_client_method();
|
||||||
|
+#endif
|
||||||
|
+ } else if (equal(cp, "ssl3"))
|
||||||
|
method = SSLv3_client_method();
|
||||||
|
else if (equal(cp, "tls1"))
|
||||||
|
method = TLSv1_client_method();
|
||||||
64
mailx-12.5-outof-Introduce-expandaddr-flag.patch
Normal file
64
mailx-12.5-outof-Introduce-expandaddr-flag.patch
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
From 9984ae5cb0ea0d61df1612b06952a61323c083d9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Mon, 17 Nov 2014 11:13:38 +0100
|
||||||
|
Subject: [PATCH 1/4] outof: Introduce expandaddr flag
|
||||||
|
|
||||||
|
Document that address expansion is disabled unless the expandaddr
|
||||||
|
binary option is set.
|
||||||
|
|
||||||
|
This has been assigned CVE-2014-7844 for BSD mailx, but it is not
|
||||||
|
a vulnerability in Heirloom mailx because this feature was documented.
|
||||||
|
---
|
||||||
|
mailx.1 | 14 ++++++++++++++
|
||||||
|
names.c | 3 +++
|
||||||
|
2 files changed, 17 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/mailx.1 b/mailx.1
|
||||||
|
index 70a7859..22a171b 100644
|
||||||
|
--- a/mailx.1
|
||||||
|
+++ b/mailx.1
|
||||||
|
@@ -656,6 +656,14 @@ but any reply returned to the machine
|
||||||
|
will have the system wide alias expanded
|
||||||
|
as all mail goes through sendmail.
|
||||||
|
.SS "Recipient address specifications"
|
||||||
|
+If the
|
||||||
|
+.I expandaddr
|
||||||
|
+option is not set (the default), recipient addresses must be names of
|
||||||
|
+local mailboxes or Internet mail addresses.
|
||||||
|
+.PP
|
||||||
|
+If the
|
||||||
|
+.I expandaddr
|
||||||
|
+option is set, the following rules apply:
|
||||||
|
When an address is used to name a recipient
|
||||||
|
(in any of To, Cc, or Bcc),
|
||||||
|
names of local mail folders
|
||||||
|
@@ -2391,6 +2399,12 @@ and exits immediately.
|
||||||
|
If this option is set,
|
||||||
|
\fImailx\fR starts even with an empty mailbox.
|
||||||
|
.TP
|
||||||
|
+.B expandaddr
|
||||||
|
+Causes
|
||||||
|
+.I mailx
|
||||||
|
+to expand message recipient addresses, as explained in the section,
|
||||||
|
+Recipient address specifications.
|
||||||
|
+.TP
|
||||||
|
.B flipr
|
||||||
|
Exchanges the
|
||||||
|
.I Respond
|
||||||
|
diff --git a/names.c b/names.c
|
||||||
|
index 66e976b..c69560f 100644
|
||||||
|
--- a/names.c
|
||||||
|
+++ b/names.c
|
||||||
|
@@ -268,6 +268,9 @@ outof(struct name *names, FILE *fo, struct header *hp)
|
||||||
|
FILE *fout, *fin;
|
||||||
|
int ispipe;
|
||||||
|
|
||||||
|
+ if (value("expandaddr") == NULL)
|
||||||
|
+ return names;
|
||||||
|
+
|
||||||
|
top = names;
|
||||||
|
np = names;
|
||||||
|
time(&now);
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
From e34e2ac67b80497080ebecccec40c3b61456167d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Mon, 17 Nov 2014 11:14:06 +0100
|
||||||
|
Subject: [PATCH 2/4] unpack: Disable option processing for email addresses
|
||||||
|
when calling sendmail
|
||||||
|
|
||||||
|
---
|
||||||
|
extern.h | 2 +-
|
||||||
|
names.c | 8 ++++++--
|
||||||
|
sendout.c | 2 +-
|
||||||
|
3 files changed, 8 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/extern.h b/extern.h
|
||||||
|
index 6b85ba0..8873fe8 100644
|
||||||
|
--- a/extern.h
|
||||||
|
+++ b/extern.h
|
||||||
|
@@ -396,7 +396,7 @@ struct name *outof(struct name *names, FILE *fo, struct header *hp);
|
||||||
|
int is_fileaddr(char *name);
|
||||||
|
struct name *usermap(struct name *names);
|
||||||
|
struct name *cat(struct name *n1, struct name *n2);
|
||||||
|
-char **unpack(struct name *np);
|
||||||
|
+char **unpack(struct name *smopts, struct name *np);
|
||||||
|
struct name *elide(struct name *names);
|
||||||
|
int count(struct name *np);
|
||||||
|
struct name *delete_alternates(struct name *np);
|
||||||
|
diff --git a/names.c b/names.c
|
||||||
|
index c69560f..45bbaed 100644
|
||||||
|
--- a/names.c
|
||||||
|
+++ b/names.c
|
||||||
|
@@ -549,7 +549,7 @@ cat(struct name *n1, struct name *n2)
|
||||||
|
* Return an error if the name list won't fit.
|
||||||
|
*/
|
||||||
|
char **
|
||||||
|
-unpack(struct name *np)
|
||||||
|
+unpack(struct name *smopts, struct name *np)
|
||||||
|
{
|
||||||
|
char **ap, **top;
|
||||||
|
struct name *n;
|
||||||
|
@@ -564,7 +564,7 @@ unpack(struct name *np)
|
||||||
|
* the terminating 0 pointer. Additional spots may be needed
|
||||||
|
* to pass along -f to the host mailer.
|
||||||
|
*/
|
||||||
|
- extra = 2;
|
||||||
|
+ extra = 3 + count(smopts);
|
||||||
|
extra++;
|
||||||
|
metoo = value("metoo") != NULL;
|
||||||
|
if (metoo)
|
||||||
|
@@ -581,6 +581,10 @@ unpack(struct name *np)
|
||||||
|
*ap++ = "-m";
|
||||||
|
if (verbose)
|
||||||
|
*ap++ = "-v";
|
||||||
|
+ for (; smopts != NULL; smopts = smopts->n_flink)
|
||||||
|
+ if ((smopts->n_type & GDEL) == 0)
|
||||||
|
+ *ap++ = smopts->n_name;
|
||||||
|
+ *ap++ = "--";
|
||||||
|
for (; n != NULL; n = n->n_flink)
|
||||||
|
if ((n->n_type & GDEL) == 0)
|
||||||
|
*ap++ = n->n_name;
|
||||||
|
diff --git a/sendout.c b/sendout.c
|
||||||
|
index 7b7f2eb..c52f15d 100644
|
||||||
|
--- a/sendout.c
|
||||||
|
+++ b/sendout.c
|
||||||
|
@@ -835,7 +835,7 @@ start_mta(struct name *to, struct name *mailargs, FILE *input,
|
||||||
|
#endif /* HAVE_SOCKETS */
|
||||||
|
|
||||||
|
if ((smtp = value("smtp")) == NULL) {
|
||||||
|
- args = unpack(cat(mailargs, to));
|
||||||
|
+ args = unpack(mailargs, to);
|
||||||
|
if (debug || value("debug")) {
|
||||||
|
printf(catgets(catd, CATSET, 181,
|
||||||
|
"Sendmail arguments:"));
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
||||||
12
mailx-12.5-usage.patch
Normal file
12
mailx-12.5-usage.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -upr mailx-12.5.orig/main.c mailx-12.5/main.c
|
||||||
|
--- mailx-12.5.orig/main.c 2007-10-02 14:15:50.000000000 +0200
|
||||||
|
+++ mailx-12.5/main.c 2013-07-22 16:06:56.960765683 +0200
|
||||||
|
@@ -353,7 +353,7 @@ main(int argc, char *argv[])
|
||||||
|
case '?':
|
||||||
|
usage:
|
||||||
|
fprintf(stderr, catgets(catd, CATSET, 135,
|
||||||
|
-"Usage: %s -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users\n"), progname);
|
||||||
|
+"Usage: %s -eiIUdEFntBDNHRVv~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users\n"), progname);
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
mailx-12.5.tar.xz
Normal file
BIN
mailx-12.5.tar.xz
Normal file
Binary file not shown.
110
mailx.spec
Normal file
110
mailx.spec
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
Name: mailx
|
||||||
|
Version: 12.5
|
||||||
|
Release: 31
|
||||||
|
License: BSD with advertising and MPLv1.1
|
||||||
|
Summary: Enhanced implementation of the mailx command
|
||||||
|
URL: http://heirloom.sourceforge.net/mailx.html
|
||||||
|
Source0: %{name}-%{version}.tar.xz
|
||||||
|
Source1: get-upstream-tarball.sh
|
||||||
|
|
||||||
|
Patch0: nail-11.25-config.patch
|
||||||
|
Patch1: mailx-12.3-pager.patch
|
||||||
|
Patch2: mailx-12.5-lzw.patch
|
||||||
|
Patch3: mailx-12.5-fname-null.patch
|
||||||
|
Patch4: mailx-12.5-collect.patch
|
||||||
|
Patch5: mailx-12.5-usage.patch
|
||||||
|
Patch6: mailx-12.5-man-page-fixes.patch
|
||||||
|
#From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Patch7: mailx-12.5-outof-Introduce-expandaddr-flag.patch
|
||||||
|
#From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Patch8: mailx-12.5-fio.c-Unconditionally-require-wordexp-support.patch
|
||||||
|
#From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Patch9: mailx-12.5-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch
|
||||||
|
#From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Patch10: mailx-12.5-unpack-Disable-option-processing-for-email-addresses.patch
|
||||||
|
Patch11: mailx-12.5-empty-from.patch
|
||||||
|
#From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
|
||||||
|
Patch12: mailx-12.5-nss-hostname-matching.patch
|
||||||
|
Patch13: mailx-12.5-encsplit.patch
|
||||||
|
Patch14: mailx-12.5-openssl.patch
|
||||||
|
Patch9000: set-mail-defualt-did-not-record-failsend.patch
|
||||||
|
|
||||||
|
BuildRequires: gcc openssl-devel git
|
||||||
|
|
||||||
|
Obsoletes: nail < %{version}
|
||||||
|
Provides: nail = %{version} /bin/mail /bin/mailx
|
||||||
|
|
||||||
|
%description
|
||||||
|
Heirloom mailx (previously known as nail) is a mail user agent for Unix systems.
|
||||||
|
|
||||||
|
%package_help
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{name}-%{version} -p1 -S git
|
||||||
|
|
||||||
|
sed -i 's,/etc/nail.rc,%{_sysconfdir}/mail.rc,g' mailx.1
|
||||||
|
|
||||||
|
%build
|
||||||
|
export LDFLAGS="%{build_ldflags}"
|
||||||
|
|
||||||
|
echo PREFIX=%{_prefix} \
|
||||||
|
BINDIR=%{_bindir} \
|
||||||
|
MANDIR=%{_mandir} \
|
||||||
|
SYSCONFDIR=%{_sysconfdir} \
|
||||||
|
MAILRC=%{_sysconfdir}/mail.rc \
|
||||||
|
MAILSPOOL=%{_localstatedir}/mail \
|
||||||
|
SENDMAIL=%{_sbindir}/sendmail \
|
||||||
|
UCBINSTALL=install \
|
||||||
|
> makeflags
|
||||||
|
|
||||||
|
make `cat makeflags` CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" IPv6=-DHAVE_IPv6_FUNCS
|
||||||
|
|
||||||
|
%install
|
||||||
|
%make_install STRIP=: `cat makeflags`
|
||||||
|
|
||||||
|
pushd $RPM_BUILD_ROOT%{_bindir}
|
||||||
|
ln -s mailx mail
|
||||||
|
ln -s mailx Mail
|
||||||
|
ln -s mailx nail
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd $RPM_BUILD_ROOT%{_mandir}/man1
|
||||||
|
ln -s mailx.1 mail.1
|
||||||
|
ln -s mailx.1 Mail.1
|
||||||
|
ln -s mailx.1 nail.1
|
||||||
|
popd
|
||||||
|
|
||||||
|
%triggerpostun -- mailx < 12
|
||||||
|
[[ -f %{_sysconfdir}/mail.rc.rpmnew ]] && {
|
||||||
|
( echo '# The settings above was inherited from the old mailx-8.x config'
|
||||||
|
echo
|
||||||
|
cat %{_sysconfdir}/mail.rc.rpmnew
|
||||||
|
) >>%{_sysconfdir}/mail.rc
|
||||||
|
} || :
|
||||||
|
|
||||||
|
|
||||||
|
%triggerpostun -- nail <= 12.3
|
||||||
|
[[ -f %{_sysconfdir}/nail.rc.rpmsave ]] && {
|
||||||
|
save=%{_sysconfdir}/mail.rc.rpmnew
|
||||||
|
[[ -f $save ]] && save=%{_sysconfdir}/mail.rc.rpmsave
|
||||||
|
|
||||||
|
mv -f %{_sysconfdir}/mail.rc $save
|
||||||
|
mv -f %{_sysconfdir}/nail.rc.rpmsave %{_sysconfdir}/mail.rc
|
||||||
|
} || :
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc COPYING AUTHORS
|
||||||
|
%config(noreplace) %{_sysconfdir}/mail.rc
|
||||||
|
%{_bindir}/*
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc README
|
||||||
|
%{_mandir}/*/*
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 12.5-31
|
||||||
|
- Package init
|
||||||
11
nail-11.25-config.patch
Normal file
11
nail-11.25-config.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
diff -Nrbu nail-11.25/nail.rc nail-11.25-OK/nail.rc
|
||||||
|
--- nail-11.25/nail.rc 2005-01-15 17:33:16.000000000 +0300
|
||||||
|
+++ nail-11.25-OK/nail.rc 2005-08-19 16:55:09.000000000 +0400
|
||||||
|
@@ -60,3 +60,7 @@
|
||||||
|
|
||||||
|
# Only include selected header fields when forwarding messages.
|
||||||
|
fwdretain subject date from to
|
||||||
|
+
|
||||||
|
+# For Linux and BSD, this should be set.
|
||||||
|
+set bsdcompat
|
||||||
|
+
|
||||||
9
set-mail-defualt-did-not-record-failsend.patch
Normal file
9
set-mail-defualt-did-not-record-failsend.patch
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
diff -Nur mailx-12.5-bak/nail.rc mailx-12.5/nail.rc
|
||||||
|
--- mailx-12.5-bak/nail.rc 2018-03-20 11:12:41.453000000 +0800
|
||||||
|
+++ mailx-12.5/nail.rc 2018-03-20 11:48:30.243000000 +0800
|
||||||
|
@@ -67,4 +67,4 @@
|
||||||
|
|
||||||
|
# For Linux and BSD, this should be set.
|
||||||
|
set bsdcompat
|
||||||
|
-
|
||||||
|
+set -S DEAD=""
|
||||||
Loading…
x
Reference in New Issue
Block a user