diff options
author | nicm <nicm> | 2017-01-23 10:09:43 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-01-23 10:09:43 +0000 |
commit | 98e7fbb2acee0238381feea5d583fc439aae08e2 (patch) | |
tree | 8962da4c7e86b1dbb64438e14a7de69a0d58ed73 /tmux.c | |
parent | 4ede35c48c089abe3fca0d94dbeac44b2ac442a1 (diff) | |
download | rtmux-98e7fbb2acee0238381feea5d583fc439aae08e2.tar.gz rtmux-98e7fbb2acee0238381feea5d583fc439aae08e2.tar.bz2 rtmux-98e7fbb2acee0238381feea5d583fc439aae08e2.zip |
Open /dev/ptm before pledge() and save it to be used for PTMGET later
(this means inlining forkpty()).
ok deraadt
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -43,6 +43,7 @@ struct hooks *global_hooks; struct timeval start_time; const char *socket_path; +int ptm_fd = -1; static __dead void usage(void); static char *make_label(const char *); @@ -258,6 +259,8 @@ main(int argc, char **argv) if (shellcmd != NULL && argc != 0) usage(); + if (pty_open(&ptm_fd) != 0) + errx(1, "open(\"/dev/ptm\""); if (pledge("stdio rpath wpath cpath flock fattr unix getpw sendfd " "recvfd proc exec tty ps", NULL) != 0) err(1, "pledge"); |