summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-22 11:36:06 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-22 15:06:45 +1000
commitefcff0996d8c9a42e3bbef4a805ff65974684ff0 (patch)
treecf62c859753c3564e3a52fbd54bc225398e5977b
parent675eb751ff84e80f286da808daa931a84baf9302 (diff)
downloadtalos-petitboot-efcff0996d8c9a42e3bbef4a805ff65974684ff0.zip
talos-petitboot-efcff0996d8c9a42e3bbef4a805ff65974684ff0.tar.gz
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 <sam@mendozajonas.com>
-rw-r--r--discover/ipmi.c2
1 files changed, 1 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud