mirror of
https://github.com/tmate-io/tmate.git
synced 2024-12-27 00:58:56 +01:00
Allow the file descriptor received from the client to be -1 - it can be on
Cygwin when stdin is not a terminal. Reported by A Young, SF bug 52.
This commit is contained in:
parent
bcd9bcae2a
commit
3a13e066ba
@ -829,9 +829,6 @@ server_client_msg_dispatch(struct client *c)
|
|||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
imsg.fd = open(identifydata.ttyname, O_RDWR|O_NOCTTY);
|
imsg.fd = open(identifydata.ttyname, O_RDWR|O_NOCTTY);
|
||||||
#endif
|
#endif
|
||||||
if (imsg.fd == -1)
|
|
||||||
fatalx("MSG_IDENTIFY missing fd");
|
|
||||||
|
|
||||||
server_client_msg_identify(c, &identifydata, imsg.fd);
|
server_client_msg_identify(c, &identifydata, imsg.fd);
|
||||||
break;
|
break;
|
||||||
case MSG_STDIN:
|
case MSG_STDIN:
|
||||||
@ -975,6 +972,8 @@ server_client_msg_identify(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fd == -1)
|
||||||
|
return;
|
||||||
if (!isatty(fd)) {
|
if (!isatty(fd)) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user