Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit a526923

Browse files
committed
setup cloexec flag for stdioevfd in tty case
otherwise these fds will be seen by other execs and new containers Signed-off-by: Gao feng <omarapazanadi@gmail.com>
1 parent e30aa61 commit a526923

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/exec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,12 @@ static int hyper_setup_stdio_events(struct hyper_exec *exec, struct stdio_config
444444
{
445445
if (exec->tty) {
446446
io->stdinevfd = dup(exec->ptyfd);
447+
hyper_setfd_cloexec(io->stdinevfd);
447448
io->stdoutevfd = dup(exec->ptyfd);
449+
hyper_setfd_cloexec(io->stdoutevfd);
448450
if (exec->errseq == 0) {
449451
io->stderrevfd = dup(exec->ptyfd);
452+
hyper_setfd_cloexec(io->stderrevfd);
450453
}
451454
}
452455

0 commit comments

Comments
 (0)