Commit 5583a41c authored by Niels Möller's avatar Niels Möller

* src/unix_random.c (do_device_source, random_init): Use

io_set_close_on_exec, to avoid fd:s leaking to user shells.
* src/werror.c (werror_argp_parser): Likewise.
* src/server_pty.c (pty_open_master): Likewise.
* src/unix_interact.c (make_unix_interact): Likewise (even if this
is in the client).
* src/io.c (lsh_pushd_fd): Likewise.
(lsh_pushd): Likewise. Also fixed EINTR logic.

Rev: src/unix_interact.c:1.29
Rev: src/werror.c:1.74
parent d041d136
......@@ -522,8 +522,10 @@ make_unix_interact(void)
#endif
if (self->tty_fd >= 0)
/* Restore and reset tty if process is suspended. */
suspend_handle_tty(self->tty_fd);
{
io_set_close_on_exec(self->tty_fd);
/* Restore and reset tty if process is suspended. */
suspend_handle_tty(self->tty_fd);
}
return &self->super;
}
......@@ -114,7 +114,10 @@ werror_argp_parser(int key, char *arg,
if (fd < 0)
argp_error(state, "Failed to open log file `%s'.", arg);
else
set_error_stream(fd);
{
io_set_close_on_exec(fd);
set_error_stream(fd);
}
}
}
return 0;
......
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