Blame SOURCES/mailx-12.5-outof-Introduce-expandaddr-flag.patch

c6c8a7
From 9984ae5cb0ea0d61df1612b06952a61323c083d9 Mon Sep 17 00:00:00 2001
c6c8a7
From: Florian Weimer <fweimer@redhat.com>
c6c8a7
Date: Mon, 17 Nov 2014 11:13:38 +0100
c6c8a7
Subject: [PATCH 1/4] outof: Introduce expandaddr flag
c6c8a7
c6c8a7
Document that address expansion is disabled unless the expandaddr
c6c8a7
binary option is set.
c6c8a7
c6c8a7
This has been assigned CVE-2014-7844 for BSD mailx, but it is not
c6c8a7
a vulnerability in Heirloom mailx because this feature was documented.
c6c8a7
---
c6c8a7
 mailx.1 | 14 ++++++++++++++
c6c8a7
 names.c |  3 +++
c6c8a7
 2 files changed, 17 insertions(+)
c6c8a7
c6c8a7
diff --git a/mailx.1 b/mailx.1
c6c8a7
index 70a7859..22a171b 100644
c6c8a7
--- a/mailx.1
c6c8a7
+++ b/mailx.1
c6c8a7
@@ -656,6 +656,14 @@ but any reply returned to the machine
c6c8a7
 will have the system wide alias expanded
c6c8a7
 as all mail goes through sendmail.
c6c8a7
 .SS "Recipient address specifications"
c6c8a7
+If the
c6c8a7
+.I expandaddr
c6c8a7
+option is not set (the default), recipient addresses must be names of
c6c8a7
+local mailboxes or Internet mail addresses.
c6c8a7
+.PP
c6c8a7
+If the
c6c8a7
+.I expandaddr
c6c8a7
+option is set, the following rules apply:
c6c8a7
 When an address is used to name a recipient
c6c8a7
 (in any of To, Cc, or Bcc),
c6c8a7
 names of local mail folders
c6c8a7
@@ -2391,6 +2399,12 @@ and exits immediately.
c6c8a7
 If this option is set,
c6c8a7
 \fImailx\fR starts even with an empty mailbox.
c6c8a7
 .TP
c6c8a7
+.B expandaddr
c6c8a7
+Causes
c6c8a7
+.I mailx
c6c8a7
+to expand message recipient addresses, as explained in the section,
c6c8a7
+Recipient address specifications.
c6c8a7
+.TP
c6c8a7
 .B flipr
c6c8a7
 Exchanges the
c6c8a7
 .I Respond
c6c8a7
diff --git a/names.c b/names.c
c6c8a7
index 66e976b..c69560f 100644
c6c8a7
--- a/names.c
c6c8a7
+++ b/names.c
c6c8a7
@@ -268,6 +268,9 @@ outof(struct name *names, FILE *fo, struct header *hp)
c6c8a7
 	FILE *fout, *fin;
c6c8a7
 	int ispipe;
c6c8a7
 
c6c8a7
+	if (value("expandaddr") == NULL)
c6c8a7
+		return names;
c6c8a7
+
c6c8a7
 	top = names;
c6c8a7
 	np = names;
c6c8a7
 	time(&now;;
c6c8a7
-- 
c6c8a7
1.9.3
c6c8a7