From 1f860164f4ff69b960388b587cdd679687662933 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 4 Mar 2015 14:43:00 +0100 Subject: [PATCH] initctl: Make sure to open fifo with CLOEXEC With O_CLOEXEC we prevent forked+exec'ed children from accessing the initctl fifo via that socket. Signed-off-by: Joachim Nilsson --- plugins/initctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/initctl.c b/plugins/initctl.c index b31fbd36..0474d8ff 100644 --- a/plugins/initctl.c +++ b/plugins/initctl.c @@ -45,7 +45,7 @@ static plugin_t plugin = { static void fifo_open(void) { - plugin.io.fd = open(FINIT_FIFO, O_RDONLY | O_NONBLOCK); + plugin.io.fd = open(FINIT_FIFO, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (-1 == plugin.io.fd) { _e("Failed opening %s FIFO, error %d: %s", FINIT_FIFO, errno, strerror(errno)); return;