From 64caf59e84c3ae1c06773bb8ec91165eeedabe6d Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 23 Sep 2009 06:05:02 +0000 Subject: Don't attempt to open() the tty path, rely on the client sending its stdin fd with imsg and fatal if it doesn't, then set the FD_CLOEXEC flag in tty_init instead of tty_open to prevent them leaking into child processes if any are created between the two calls. This bumps the protocol version, so the tmux server should be killed before upgrading. --- tmux.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 0ffb0b53..bdaf5f6e 100644 --- a/tmux.h +++ b/tmux.h @@ -19,7 +19,7 @@ #ifndef TMUX_H #define TMUX_H -#define PROTOCOL_VERSION 1 +#define PROTOCOL_VERSION 2 #include #include @@ -328,8 +328,6 @@ struct msg_command_data { }; struct msg_identify_data { - char tty[TTY_NAME_MAX]; - char cwd[MAXPATHLEN]; char term[TERMINAL_LENGTH]; @@ -1200,7 +1198,7 @@ void tty_putcode2(struct tty *, enum tty_code_code, int, int); void tty_puts(struct tty *, const char *); void tty_putc(struct tty *, u_char); void tty_pututf8(struct tty *, const struct grid_utf8 *); -void tty_init(struct tty *, int, char *, char *); +void tty_init(struct tty *, int, char *); void tty_start_tty(struct tty *); void tty_stop_tty(struct tty *); void tty_detect_utf8(struct tty *); -- cgit