diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.156 2003/05/11 20:30:25 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.157 2003/05/14 22:24:42 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1743,6 +1743,26 @@ session_exec_req(Session *s) | |||
1743 | } | 1743 | } |
1744 | 1744 | ||
1745 | static int | 1745 | static int |
1746 | session_break_req(Session *s) | ||
1747 | { | ||
1748 | u_int break_length; | ||
1749 | |||
1750 | break_length = packet_get_int(); | ||
1751 | packet_check_eom(); | ||
1752 | |||
1753 | if (s->ttyfd == -1) | ||
1754 | return 0; | ||
1755 | /* we will sleep from 500ms to 3000ms */ | ||
1756 | break_length = MIN(break_length, 3000); | ||
1757 | break_length = MAX(break_length, 500); | ||
1758 | ioctl(s->ttyfd, TIOCSBRK, NULL); | ||
1759 | /* should we care about EINTR? */ | ||
1760 | usleep(break_length * 1000); | ||
1761 | ioctl(s->ttyfd, TIOCCBRK, NULL); | ||
1762 | return 1; | ||
1763 | } | ||
1764 | |||
1765 | static int | ||
1746 | session_auth_agent_req(Session *s) | 1766 | session_auth_agent_req(Session *s) |
1747 | { | 1767 | { |
1748 | static int called = 0; | 1768 | static int called = 0; |
@@ -1789,6 +1809,8 @@ session_input_channel_req(Channel *c, const char *rtype) | |||
1789 | success = session_auth_agent_req(s); | 1809 | success = session_auth_agent_req(s); |
1790 | } else if (strcmp(rtype, "subsystem") == 0) { | 1810 | } else if (strcmp(rtype, "subsystem") == 0) { |
1791 | success = session_subsystem_req(s); | 1811 | success = session_subsystem_req(s); |
1812 | } else if (strcmp(rtype, "break") == 0) { | ||
1813 | success = session_break_req(s); | ||
1792 | } | 1814 | } |
1793 | } | 1815 | } |
1794 | if (strcmp(rtype, "window-change") == 0) { | 1816 | if (strcmp(rtype, "window-change") == 0) { |