Skip to content

Commit

Permalink
discover/ipmi: Open devnode with O_CLOEXEC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sammj committed Aug 22, 2017
1 parent 675eb75 commit efcff09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discover/ipmi.c
Expand Up @@ -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;
Expand Down

0 comments on commit efcff09

Please sign in to comment.