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

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