|
Lines 950-955
client_process_control(fd_set *readset)
Link Here
|
| 950 |
} |
950 |
} |
| 951 |
|
951 |
|
| 952 |
static void |
952 |
static void |
|
|
953 |
ssh_send_signal(char *signame) |
| 954 |
{ |
| 955 |
debug("sending signal %s to session %d", signame, session_ident); |
| 956 |
channel_request_start(session_ident, "signal", 0); |
| 957 |
packet_put_cstring(signame); |
| 958 |
packet_send(); |
| 959 |
packet_write_wait(); |
| 960 |
} |
| 961 |
|
| 962 |
static void |
| 953 |
process_cmdline(void) |
963 |
process_cmdline(void) |
| 954 |
{ |
964 |
{ |
| 955 |
void (*handler)(int); |
965 |
void (*handler)(int); |
|
Lines 982-987
process_cmdline(void)
Link Here
|
| 982 |
"Request remote forward"); |
992 |
"Request remote forward"); |
| 983 |
logit(" -KR[bind_address:]port " |
993 |
logit(" -KR[bind_address:]port " |
| 984 |
"Cancel remote forward"); |
994 |
"Cancel remote forward"); |
|
|
995 |
if (compat20) |
| 996 |
logit(" -S[signal] " |
| 997 |
"Send signal"); |
| 985 |
if (!options.permit_local_command) |
998 |
if (!options.permit_local_command) |
| 986 |
goto out; |
999 |
goto out; |
| 987 |
logit(" !args " |
1000 |
logit(" !args " |
|
Lines 995-1000
process_cmdline(void)
Link Here
|
| 995 |
goto out; |
1008 |
goto out; |
| 996 |
} |
1009 |
} |
| 997 |
|
1010 |
|
|
|
1011 |
if (*s == 'S' && compat20) { |
| 1012 |
s++; |
| 1013 |
ssh_send_signal(s); |
| 1014 |
goto out; |
| 1015 |
} |
| 1016 |
|
| 998 |
if (*s == 'K') { |
1017 |
if (*s == 'K') { |
| 999 |
delete = 1; |
1018 |
delete = 1; |
| 1000 |
s++; |
1019 |
s++; |
|
Lines 1551-1556
client_loop(int have_pty, int escape_cha
Link Here
|
| 1551 |
if (FD_ISSET(connection_out, writeset)) |
1570 |
if (FD_ISSET(connection_out, writeset)) |
| 1552 |
packet_write_poll(); |
1571 |
packet_write_poll(); |
| 1553 |
} |
1572 |
} |
|
|
1573 |
|
| 1574 |
/* |
| 1575 |
* If there was no shell or command requested, there will be no remote |
| 1576 |
* exit status to be returned. In that case, clear error code if the |
| 1577 |
* connection was deliberately terminated at this end. |
| 1578 |
*/ |
| 1579 |
if (no_shell_flag && received_signal == SIGTERM) { |
| 1580 |
received_signal = 0; |
| 1581 |
exit_status = 0; |
| 1582 |
} |
| 1583 |
|
| 1584 |
if (received_signal && compat20) { |
| 1585 |
char *signame = signo2name(received_signal); |
| 1586 |
if (signame != NULL) { |
| 1587 |
debug("passed signal %s to server", signame); |
| 1588 |
ssh_send_signal(signame); |
| 1589 |
} else |
| 1590 |
debug("non-standard signal %s", signame); |
| 1591 |
} |
| 1592 |
|
| 1554 |
if (readset) |
1593 |
if (readset) |
| 1555 |
xfree(readset); |
1594 |
xfree(readset); |
| 1556 |
if (writeset) |
1595 |
if (writeset) |
|
Lines 1573-1588
client_loop(int have_pty, int escape_cha
Link Here
|
| 1573 |
unset_nonblock(fileno(stdout)); |
1612 |
unset_nonblock(fileno(stdout)); |
| 1574 |
if (!isatty(fileno(stderr))) |
1613 |
if (!isatty(fileno(stderr))) |
| 1575 |
unset_nonblock(fileno(stderr)); |
1614 |
unset_nonblock(fileno(stderr)); |
| 1576 |
|
|
|
| 1577 |
/* |
| 1578 |
* If there was no shell or command requested, there will be no remote |
| 1579 |
* exit status to be returned. In that case, clear error code if the |
| 1580 |
* connection was deliberately terminated at this end. |
| 1581 |
*/ |
| 1582 |
if (no_shell_flag && received_signal == SIGTERM) { |
| 1583 |
received_signal = 0; |
| 1584 |
exit_status = 0; |
| 1585 |
} |
| 1586 |
|
1615 |
|
| 1587 |
if (received_signal) |
1616 |
if (received_signal) |
| 1588 |
fatal("Killed by signal %d.", (int) received_signal); |
1617 |
fatal("Killed by signal %d.", (int) received_signal); |