From baa6c3c854da6b73e73d93dd85af369a8ce6400a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:19:20 +0000 Subject: import mailx-12.5-16.el7 --- diff --git a/SOURCES/mailx-12.5-empty-from.patch b/SOURCES/mailx-12.5-empty-from.patch new file mode 100644 index 0000000..5117856 --- /dev/null +++ b/SOURCES/mailx-12.5-empty-from.patch @@ -0,0 +1,61 @@ +From dc22d0df73a7ecb036d73cfa1814ddf998ff131b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nikola=20Forr=C3=B3?= +Date: Tue, 17 Jan 2017 14:03:00 +0100 +Subject: [PATCH] Fix SIGSEGV crash in smtp_auth_var() +Add warning message for empty from variable + +--- + sendout.c | 13 +++++++++++++ + smtp.c | 5 ++++- + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/sendout.c b/sendout.c +index c52f15d..f83952a 100644 +--- a/sendout.c ++++ b/sendout.c +@@ -966,6 +966,19 @@ mail1(struct header *hp, int printheaders, struct message *quote, + 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 --git a/smtp.c b/smtp.c +index b4561e3..baab5d1 100644 +--- a/smtp.c ++++ b/smtp.c +@@ -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 char *addr) + 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) +-- +2.7.4 + diff --git a/SOURCES/mailx-12.5-mailx.1-environment-variables.patch b/SOURCES/mailx-12.5-mailx.1-environment-variables.patch new file mode 100644 index 0000000..5719327 --- /dev/null +++ b/SOURCES/mailx-12.5-mailx.1-environment-variables.patch @@ -0,0 +1,26 @@ +From 046f297e41ea7e53c7b2172bf22b6681112efa5f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nikola=20Forr=C3=B3?= +Date: Fri, 10 Feb 2017 15:02:28 +0100 +Subject: [PATCH] mailx.1: environment vairables + +--- + mailx.1 | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/mailx.1 b/mailx.1 +index 05cea6b..6adbada 100644 +--- a/mailx.1 ++++ b/mailx.1 +@@ -2197,7 +2197,8 @@ if it is passed to \fImailx\fR + 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; +-- +2.7.4 + diff --git a/SOURCES/mailx-12.5-mailx.1-from-syntax.patch b/SOURCES/mailx-12.5-mailx.1-from-syntax.patch new file mode 100644 index 0000000..0420aab --- /dev/null +++ b/SOURCES/mailx-12.5-mailx.1-from-syntax.patch @@ -0,0 +1,31 @@ +From bf8f5a6197bb0ad26609f8014ae545a1a0b6c2ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nikola=20Forr=C3=B3?= +Date: Fri, 10 Feb 2017 15:10:17 +0100 +Subject: [PATCH] mailx.1: addition to FROM syntax + +--- + mailx.1 | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/mailx.1 b/mailx.1 +index 6adbada..1184cbf 100644 +--- a/mailx.1 ++++ b/mailx.1 +@@ -219,6 +219,14 @@ and, in case of a string option, + 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 \(dq + .TP + .BI \-T \ name + Writes the `Message-Id:' and `Article-Id:' header fields +-- +2.7.4 + diff --git a/SOURCES/mailx-12.5-nss_check_host-fix.patch b/SOURCES/mailx-12.5-nss_check_host-fix.patch new file mode 100644 index 0000000..5d49b34 --- /dev/null +++ b/SOURCES/mailx-12.5-nss_check_host-fix.patch @@ -0,0 +1,25 @@ +From 21d9c635ed43326a5517c876f4dd9008929de497 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nikola=20Forr=C3=B3?= +Date: Tue, 17 Jan 2017 14:14:11 +0100 +Subject: [PATCH] Fix return value of nss_check_host() + +--- + 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.7.4 + diff --git a/SPECS/mailx.spec b/SPECS/mailx.spec index 37e6418..a243ddb 100644 --- a/SPECS/mailx.spec +++ b/SPECS/mailx.spec @@ -4,7 +4,7 @@ Summary: Enhanced implementation of the mailx command Name: mailx Version: 12.5 -Release: 12%{?dist} +Release: 16%{?dist} # MPLv1.1 .. nss.c, nsserr.c License: BSD with advertising and MPLv1.1 Group: Applications/Internet @@ -23,11 +23,19 @@ Patch3: mailx-12.5-fname-null.patch Patch4: mailx-12.5-collect.patch # resolves: #948869 Patch5: mailx-12.5-usage.patch -# resolves: #1171177 +# resolves: #1171178 Patch6: mailx-12.5-outof-Introduce-expandaddr-flag.patch Patch7: mailx-12.5-unpack-Disable-option-processing-for-email-addresses.patch Patch8: mailx-12.5-fio.c-Unconditionally-require-wordexp-support.patch Patch9: mailx-12.5-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch +# resolves: #1113611 +Patch10: mailx-12.5-empty-from.patch +# resolves: #1290043 +Patch11: mailx-12.5-nss_check_host-fix.patch +# resolves: #1147568 +Patch12: mailx-12.5-mailx.1-environment-variables.patch +# resolves: #1147570 +Patch13: mailx-12.5-mailx.1-from-syntax.patch %if %{use_nss} BuildRequires: nss-devel, pkgconfig, krb5-devel @@ -70,6 +78,10 @@ as well as "nail" (the initial name of this project). %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 sed -i 's,/etc/nail.rc,%{mailrc},g' mailx.1 @@ -145,9 +157,26 @@ popd %changelog +* Fri Feb 10 2017 Nikola Forró - 12.5-16 +- extend description of FROM syntax + resolves: #1147570 + +* Fri Feb 10 2017 Nikola Forró - 12.5-15 +- correct information about environment variables + resolves: #1147568 + +* Tue Jan 17 2017 Nikola Forró - 12.5-14 +- fix return value of nss_check_host() + resolves: #1290043 + +* Tue Jan 17 2017 Nikola Forró - 12.5-13 +- fix SIGSEGV crash in smtp_auth_var() +- add warning message for empty from variable + resolves: #1113611 + * Wed Dec 10 2014 jchaloup - 12.5-12 - CVE-2004-2771 mailx: command execution flaw - resolves: #1171177 + resolves: #1171178 * Fri Jan 24 2014 Daniel Mach - 12.5-11 - Mass rebuild 2014-01-24