From 608b2e2647407e79b95679ab151ef6b9e0286d5b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 27 Aug 2008 10:00:10 +0200 Subject: [PATCH] dbus, lua: set CLOEXEC on fds Signed-off-by: Julien Danjou --- awesomerc.lua.in | 2 +- dbus.c | 4 ++++ lua.c | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 1b39b08b..132933e6 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -438,5 +438,5 @@ awful.hooks.unmarked.register(hook_unmarked) awful.hooks.manage.register(hook_manage) awful.hooks.mouseover.register(hook_mouseover) awful.hooks.arrange.register(hook_arrange) -awful.hooks.timer.register(1, hook_timer) + -- awful.hooks.timer.register(1, hook_timer) -- }}} diff --git a/dbus.c b/dbus.c index a89e4d3e..7a406f7d 100644 --- a/dbus.c +++ b/dbus.c @@ -24,6 +24,8 @@ #include #include +#include +#include #include "dbus.h" #include "widget.h" @@ -163,6 +165,8 @@ a_dbus_init(void) return false; } + fcntl(fd, F_SETFD, FD_CLOEXEC); + ev_io_init(&dbusio, a_dbus_process_requests, fd, EV_READ); ev_io_start(EV_DEFAULT_UC_ &dbusio); ev_unref(EV_DEFAULT_UC); diff --git a/lua.c b/lua.c index 9b668c9d..027ea2b4 100644 --- a/lua.c +++ b/lua.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include @@ -765,8 +767,9 @@ luaA_cs_init(void) { int csfd = socket_getclient(); - if (csfd < 0) + if (csfd < 0 || fcntl(csfd, F_SETFD, FD_CLOEXEC) == -1) return; + addr = socket_getaddr(getenv("DISPLAY")); if(bind(csfd, (const struct sockaddr *) addr, SUN_LEN(addr)))