From efcff0996d8c9a42e3bbef4a805ff65974684ff0 Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Tue, 22 Aug 2017 11:36:06 +1000 Subject: [PATCH 1/1] discover/ipmi: Open devnode with O_CLOEXEC The IPMI device node is kept open for the life of the platform - include the O_CLOEXEC flag so it is not kept open for child processes. Signed-off-by: Samuel Mendoza-Jonas --- discover/ipmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discover/ipmi.c b/discover/ipmi.c index 2aaf114..d652e9f 100644 --- a/discover/ipmi.c +++ b/discover/ipmi.c @@ -201,7 +201,7 @@ struct ipmi *ipmi_open(void *ctx) struct ipmi *ipmi; int fd; - fd = open(ipmi_devnode, O_RDWR); + fd = open(ipmi_devnode, O_RDWR | O_CLOEXEC); if (fd < 0) { pb_log("IPMI: can't open IPMI device %s: %m\n", ipmi_devnode); return NULL; -- 2.39.2