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

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