Blame SOURCES/0028-Don-t-close-STDOUT-when-calling-the-CA-fetch_roots-f.patch

5e5f7c
From 205775f73f7eef7b207acccac6b853562adf604b Mon Sep 17 00:00:00 2001
5e5f7c
From: Rob Crittenden <rcritten@redhat.com>
5e5f7c
Date: Fri, 25 Oct 2019 20:25:36 +0000
5e5f7c
Subject: [PATCH] Don't close STDERR when submitting request
5e5f7c
5e5f7c
cm_subproc_mark_most_cloexec() now closes all open file
5e5f7c
descriptors except for up to three requested for stdin, stdout
5e5f7c
and stderr. Before the optimization those three were always
5e5f7c
left open.
5e5f7c
5e5f7c
This was causing errors in the IPA helper ipa-server-guard
5e5f7c
because it tries to display the contents of stderr which was
5e5f7c
always being closed, causing ipa-server-guard to blow up.
5e5f7c
---
5e5f7c
 src/submit-e.c | 4 ++--
5e5f7c
 1 file changed, 2 insertions(+), 2 deletions(-)
5e5f7c
5e5f7c
diff --git a/src/submit-e.c b/src/submit-e.c
5e5f7c
index d6158d7a..69b4f8e2 100644
5e5f7c
--- a/src/submit-e.c
5e5f7c
+++ b/src/submit-e.c
5e5f7c
@@ -941,8 +941,8 @@ cm_submit_e_helper_main(int fd, struct cm_store_ca *ca,
5e5f7c
 		}
5e5f7c
 		return -1;
5e5f7c
 	}
5e5f7c
-	cm_log(2, "Redirecting stdin and stderr to /dev/null, leaving stdout open for child \"%s\".\n", argv[0]);
5e5f7c
-	cm_subproc_mark_most_cloexec(STDOUT_FILENO, -1, -1);
5e5f7c
+	cm_log(2, "Redirecting stdin to /dev/null, leaving stdout and stderr open for child \"%s\".\n", argv[0]);
5e5f7c
+	cm_subproc_mark_most_cloexec(STDOUT_FILENO, STDERR_FILENO, -1);
5e5f7c
 	cm_log(1, "Running enrollment helper \"%s\".\n", argv[0]);
5e5f7c
 	execvp(argv[0], argv);
5e5f7c
 	u = errno;
5e5f7c
-- 
5e5f7c
2.21.0
5e5f7c