Blame SOURCES/0033-Fix-file-descriptor-leak-when-executing-CA-helpers.patch

4d6a9a
From b4c090d2e12956a2df6157592839936adf4024f4 Mon Sep 17 00:00:00 2001
4d6a9a
From: Rob Crittenden <rcritten@redhat.com>
4d6a9a
Date: Thu, 12 Aug 2021 16:26:09 -0400
4d6a9a
Subject: [PATCH] Fix file descriptor leak when executing CA helpers
4d6a9a
4d6a9a
cm_cadata_start_generic() creates a pipe. One half is passed
4d6a9a
to fetch(), the function that does all helper calls,
4d6a9a
via the cm_cadata_state variable ret. The other half is the
4d6a9a
reader and is used to detect execution errors. There is a pair
4d6a9a
of write/read on this descriptor which on error would be the
4d6a9a
errno.
4d6a9a
4d6a9a
This second half wasn't being closed after reading to test for
4d6a9a
errors.
4d6a9a
4d6a9a
https://bugzilla.redhat.com/show_bug.cgi?id=1992439
4d6a9a
4d6a9a
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
4d6a9a
---
4d6a9a
 src/cadata.c | 1 +
4d6a9a
 1 file changed, 1 insertion(+)
4d6a9a
4d6a9a
diff --git a/src/cadata.c b/src/cadata.c
4d6a9a
index cb9c13e2..c2764d3b 100644
4d6a9a
--- a/src/cadata.c
4d6a9a
+++ b/src/cadata.c
4d6a9a
@@ -773,6 +773,7 @@ cm_cadata_start_generic(struct cm_store_ca *ca, const char *op,
4d6a9a
 		       ca->cm_ca_external_helper, strerror(u));
4d6a9a
 		/* return the state so the process can be reaped */
4d6a9a
 	}
4d6a9a
+	close(error_fd[0]);
4d6a9a
 	return ret;
4d6a9a
 }
4d6a9a
 
4d6a9a
-- 
4d6a9a
2.26.3
4d6a9a