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

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