Commit 27979b05 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Kristian H. Kristensen

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's avatarPekka Paalanen <ppaalanen@gmail.com>
parent 8ff69159
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment