зеркало из https://github.com/github/putty.git
Uppity: properly support _POSIX_VDISABLE in tty modes.
The SSH wire protocol for tty modes corresponding to control characters (e.g. configuring what Ctrl-Foo you can press to generate SIGINT or SIGQUIT) specifies (RFC 4254 section 8, under VINTR, saying 'similarly for the other characters') that you should send the value 255 on the wire if you want _no_ character code to map to the action in question. But in the <termios.h> API, that's indicated by setting the appropriate field of 'struct termios' to _POSIX_VDISABLE, which is a platform-dependent value and varies between (at least) Linux and *BSD. On the client side, Unix Plink has always known this: when it copies the local termios settings into a struct ssh_ttymodes to be sent on the wire, it checks for _POSIX_VDISABLE and replaces it with 255. But uxpty.c, mapping ssh_ttymodes back to termios for Uppity's pty sessions, wasn't making the reverse transformation.
This commit is contained in:
Родитель
53747ad3ab
Коммит
bf743bf85c
10
unix/uxpty.c
10
unix/uxpty.c
|
@ -816,9 +816,13 @@ static void pty_uxsel_setup(Pty *pty)
|
||||||
static void copy_ttymodes_into_termios(
|
static void copy_ttymodes_into_termios(
|
||||||
struct termios *attrs, struct ssh_ttymodes modes)
|
struct termios *attrs, struct ssh_ttymodes modes)
|
||||||
{
|
{
|
||||||
#define TTYMODE_CHAR(name, ssh_opcode, cc_index) { \
|
#define TTYMODE_CHAR(name, ssh_opcode, cc_index) { \
|
||||||
if (modes.have_mode[ssh_opcode]) \
|
if (modes.have_mode[ssh_opcode]) { \
|
||||||
attrs->c_cc[cc_index] = modes.mode_val[ssh_opcode]; \
|
unsigned value = modes.mode_val[ssh_opcode]; \
|
||||||
|
/* normalise wire value of 255 to local _POSIX_VDISABLE */ \
|
||||||
|
attrs->c_cc[cc_index] = (value == 255 ? \
|
||||||
|
_POSIX_VDISABLE : value); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TTYMODE_FLAG(flagval, ssh_opcode, field, flagmask) { \
|
#define TTYMODE_FLAG(flagval, ssh_opcode, field, flagmask) { \
|
||||||
|
|
Загрузка…
Ссылка в новой задаче