Verified Commit f0d39b22 authored by Derek Foreman's avatar Derek Foreman Committed by Quentin Glidic

weston: Set CLOEXEC on stdin

We don't want to leak this into apps launched from the panel.

stdout and stderr are left for now because some things launched
by weston - such as weston-keyboard - share weston's log by
printing to those fds.

I'm singling out stdin because it's never needed by a child process
and because it's value is 0, which makes it easy to accidentally
do bad things to (commit 5c611d93)
Signed-off-by: default avatarDerek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic's avatarQuentin Glidic <sardemff7+git@sardemff7.net>
parent 5ef6bd7e
......@@ -1800,6 +1800,11 @@ int main(int argc, char *argv[])
{ WESTON_OPTION_STRING, "config", 'c', &config_file },
};
if (os_fd_set_cloexec(fileno(stdin))) {
printf("Unable to set stdin as close on exec().\n");
return EXIT_FAILURE;
}
cmdline = copy_command_line(argc, argv);
parse_options(core_options, ARRAY_LENGTH(core_options), &argc, argv);
......
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