Unverified Commit c6018400 by Stéphane Graber Committed by GitHub

Merge pull request #3506 from brauner/2020-08-05/safe_native_terminal_allocation

macro: define TIOCGPTPEER if missing
parents 1f15c1c3 cfca9ccd
......@@ -1524,7 +1524,7 @@ static int lxc_setup_devpts(struct lxc_handler *handler)
return log_error_errno(-1, errno, "Failed to mount new devpts instance");
DEBUG("Mount new devpts instance with options \"%s\"", *opts);
devpts_fd = open_tree(-EBADF, "/dev/pts", OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC | AT_EMPTY_PATH);
devpts_fd = openat(-EBADF, "/dev/pts", O_CLOEXEC | O_DIRECTORY | O_PATH | O_NOFOLLOW);
if (devpts_fd < 0) {
TRACE("Failed to create detached devpts mount");
ret = lxc_abstract_unix_send_fds(sock, NULL, 0, NULL, 0);
......
......@@ -504,4 +504,12 @@ enum {
typeof(&*(x))), \
sizeof(x) / sizeof((x)[0]), ((void)0)))
#ifndef TIOCGPTPEER
#if defined __sparc__
#define TIOCGPTPEER _IO('t', 137)
#else
#define TIOCGPTPEER _IO('T', 0x41)
#endif
#endif
#endif /* __LXC_MACRO_H */
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