From 27979b053f443a4b9dcf5b8ace376c75fe7c7aa5 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 31 Jul 2012 13:21:06 +0300 Subject: [PATCH] weston-launcher: use CLOEXEC on fallback path If there is no weston-launcher available, launcher-util.c will fall back to opening the given file itself. It that case it does not set the close-on-exec flag, and will presumably leak the file descriptor to children. Use O_CLOEXEC on the fallback path, too. Signed-off-by: Pekka Paalanen --- src/launcher-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/launcher-util.c b/src/launcher-util.c index ad03c1d..b4b82f1 100644 --- a/src/launcher-util.c +++ b/src/launcher-util.c @@ -54,7 +54,7 @@ weston_launcher_open(struct weston_compositor *compositor, struct weston_launcher_open *message; if (sock == -1) - return open(path, flags); + return open(path, flags | O_CLOEXEC); n = sizeof(*message) + strlen(path) + 1; message = malloc(n); -- 2.7.4