mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 parent
e29c5c069b
commit
1f860164f4
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user