Blame SOURCES/mailx-12.5-unpack-Disable-option-processing-for-email-addresses.patch

9770e7
From e34e2ac67b80497080ebecccec40c3b61456167d Mon Sep 17 00:00:00 2001
9770e7
From: Florian Weimer <fweimer@redhat.com>
9770e7
Date: Mon, 17 Nov 2014 11:14:06 +0100
9770e7
Subject: [PATCH 2/4] unpack: Disable option processing for email addresses
9770e7
 when calling sendmail
9770e7
9770e7
---
9770e7
 extern.h  | 2 +-
9770e7
 names.c   | 8 ++++++--
9770e7
 sendout.c | 2 +-
9770e7
 3 files changed, 8 insertions(+), 4 deletions(-)
9770e7
9770e7
diff --git a/extern.h b/extern.h
9770e7
index 6b85ba0..8873fe8 100644
9770e7
--- a/extern.h
9770e7
+++ b/extern.h
9770e7
@@ -396,7 +396,7 @@ struct name *outof(struct name *names, FILE *fo, struct header *hp);
9770e7
 int is_fileaddr(char *name);
9770e7
 struct name *usermap(struct name *names);
9770e7
 struct name *cat(struct name *n1, struct name *n2);
9770e7
-char **unpack(struct name *np);
9770e7
+char **unpack(struct name *smopts, struct name *np);
9770e7
 struct name *elide(struct name *names);
9770e7
 int count(struct name *np);
9770e7
 struct name *delete_alternates(struct name *np);
9770e7
diff --git a/names.c b/names.c
9770e7
index c69560f..45bbaed 100644
9770e7
--- a/names.c
9770e7
+++ b/names.c
9770e7
@@ -549,7 +549,7 @@ cat(struct name *n1, struct name *n2)
9770e7
  * Return an error if the name list won't fit.
9770e7
  */
9770e7
 char **
9770e7
-unpack(struct name *np)
9770e7
+unpack(struct name *smopts, struct name *np)
9770e7
 {
9770e7
 	char **ap, **top;
9770e7
 	struct name *n;
9770e7
@@ -564,7 +564,7 @@ unpack(struct name *np)
9770e7
 	 * the terminating 0 pointer.  Additional spots may be needed
9770e7
 	 * to pass along -f to the host mailer.
9770e7
 	 */
9770e7
-	extra = 2;
9770e7
+	extra = 3 + count(smopts);
9770e7
 	extra++;
9770e7
 	metoo = value("metoo") != NULL;
9770e7
 	if (metoo)
9770e7
@@ -581,6 +581,10 @@ unpack(struct name *np)
9770e7
 		*ap++ = "-m";
9770e7
 	if (verbose)
9770e7
 		*ap++ = "-v";
9770e7
+	for (; smopts != NULL; smopts = smopts->n_flink)
9770e7
+		if ((smopts->n_type & GDEL) == 0)
9770e7
+			*ap++ = smopts->n_name;
9770e7
+	*ap++ = "--";
9770e7
 	for (; n != NULL; n = n->n_flink)
9770e7
 		if ((n->n_type & GDEL) == 0)
9770e7
 			*ap++ = n->n_name;
9770e7
diff --git a/sendout.c b/sendout.c
9770e7
index 7b7f2eb..c52f15d 100644
9770e7
--- a/sendout.c
9770e7
+++ b/sendout.c
9770e7
@@ -835,7 +835,7 @@ start_mta(struct name *to, struct name *mailargs, FILE *input,
9770e7
 #endif	/* HAVE_SOCKETS */
9770e7
 
9770e7
 	if ((smtp = value("smtp")) == NULL) {
9770e7
-		args = unpack(cat(mailargs, to));
9770e7
+		args = unpack(mailargs, to);
9770e7
 		if (debug || value("debug")) {
9770e7
 			printf(catgets(catd, CATSET, 181,
9770e7
 					"Sendmail arguments:"));
9770e7
-- 
9770e7
1.9.3
9770e7