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

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