Commit b035ad62 by Môshe van der Sterre Committed by Daniel Lezcano

prevent tty fd to be inherited in the container

Set the close on exec flag on the pty fd so they are automatically closed when execing the container. Signed-off-by: 's avatarMôshe van der Sterre <me@moshe.nl> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 8de09ef5
......@@ -1738,6 +1738,10 @@ int lxc_create_tty(const char *name, struct lxc_tty_info *tty_info)
goto out_free;
}
/* Prevent leaking the file descriptors to the container */
fcntl(pty_info->master, F_SETFD, FD_CLOEXEC);
fcntl(pty_info->slave, F_SETFD, FD_CLOEXEC);
pty_info->busy = 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