diff options
| author | Daniel Golle | 2020-05-20 13:57:21 +0000 |
|---|---|---|
| committer | Daniel Golle | 2020-05-28 10:42:34 +0000 |
| commit | b84a3294384cb9250f594be50ddfe22c80a003b6 (patch) | |
| tree | 7cd13bbac3a85a270c6d75d93ccdad39376ab014 | |
| parent | 1ab539b3a8a0070b493112c8263ab380a689db66 (diff) | |
| download | procd-b84a3294384cb9250f594be50ddfe22c80a003b6.tar.gz | |
jail: use sane termios settings for console pts
The previously used expression (inpired by LXC) didn't actually make
a lot of sense. Replace it with something inspired by a more recent
version of LXC...
Reported-by: Oldřich Jedlička <oldium.pro@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | jail/console.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jail/console.c b/jail/console.c index 75ce9c5..d03edc5 100644 --- a/jail/console.c +++ b/jail/console.c @@ -38,11 +38,12 @@ static inline int setup_tios(int fd, struct termios *oldtios) newtios = *oldtios; - /* Remove the echo characters and signal reception, the echo - * will be done with master proxying */ - newtios.c_iflag &= ~IGNBRK; - newtios.c_iflag &= BRKINT; - newtios.c_lflag &= ~(ECHO|ICANON|ISIG); + /* We use the same settings that ssh does. */ + newtios.c_iflag |= IGNPAR; + newtios.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); + newtios.c_lflag &= ~(TOSTOP | ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); + newtios.c_oflag &= ~ONLCR; + newtios.c_oflag |= OPOST; newtios.c_cc[VMIN] = 1; newtios.c_cc[VTIME] = 0; |