Without this change, a process started by procd can have access to
stdout/err of processes started by procd before.
Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
if (pid) {
close(pipefd[1]);
if (pid) {
close(pipefd[1]);
+ fcntl(pipefd[0], F_SETFD, FD_CLOEXEC);
s->fd.stream.string_data = true,
s->fd.stream.notify_read = pipe_cb,
runqueue_process_add(q, &s->proc, pid);
s->fd.stream.string_data = true,
s->fd.stream.notify_read = pipe_cb,
runqueue_process_add(q, &s->proc, pid);
if (opipe[0] > -1) {
ustream_fd_init(&in->_stdout, opipe[0]);
closefd(opipe[1]);
if (opipe[0] > -1) {
ustream_fd_init(&in->_stdout, opipe[0]);
closefd(opipe[1]);
+ fcntl(opipe[0], F_SETFD, FD_CLOEXEC);
}
if (epipe[0] > -1) {
ustream_fd_init(&in->_stderr, epipe[0]);
closefd(epipe[1]);
}
if (epipe[0] > -1) {
ustream_fd_init(&in->_stderr, epipe[0]);
closefd(epipe[1]);
+ fcntl(epipe[0], F_SETFD, FD_CLOEXEC);
}
service_event("instance.start", in->srv->name, in->name);
}
service_event("instance.start", in->srv->name, in->name);