summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-05-15 10:20:13 +1000
committerDamien Miller <djm@mindrot.org>2003-05-15 10:20:13 +1000
commit54c459866e2da288a3895eecf097104ac6f9f4d0 (patch)
tree153fc4387b34aaa23b9e088ceb44fbce325cdda3
parent37876e913a069036501086a247ed2ea430cea206 (diff)
- markus@cvs.openbsd.org 2003/05/14 22:24:42
[clientloop.c session.c ssh.1] allow to send a BREAK to the remote system; ok various
-rw-r--r--ChangeLog5
-rw-r--r--clientloop.c18
-rw-r--r--session.c24
-rw-r--r--ssh.14
4 files changed, 46 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8feae8b2..6ec753ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
add experimental support for verifying hos keys using DNS as described
in draft-ietf-secsh-dns-xx.txt. more information in README.dns.
ok markus@ and henning@
+ - markus@cvs.openbsd.org 2003/05/14 22:24:42
+ [clientloop.c session.c ssh.1]
+ allow to send a BREAK to the remote system; ok various
20030514
- (djm) Bug #117: Don't lie to PAM about username
@@ -1485,4 +1488,4 @@
save auth method before monitor_reset_key_state(); bugzilla bug #284;
ok provos@
-$Id: ChangeLog,v 1.2702 2003/05/15 00:19:46 djm Exp $
+$Id: ChangeLog,v 1.2703 2003/05/15 00:20:13 djm Exp $
diff --git a/clientloop.c b/clientloop.c
index e5270aa5..1c1acf48 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.110 2003/05/11 20:30:24 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.111 2003/05/14 22:24:42 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -574,6 +574,19 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
/* We have been continued. */
continue;
+ case 'B':
+ if (compat20) {
+ snprintf(string, sizeof string,
+ "%cB\r\n", escape_char);
+ buffer_append(berr, string,
+ strlen(string));
+ channel_request_start(session_ident,
+ "break", 0);
+ packet_put_int(1000);
+ packet_send();
+ }
+ continue;
+
case 'R':
if (compat20) {
if (datafellows & SSH_BUG_NOREKEY)
@@ -636,6 +649,7 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
"%c?\r\n\
Supported escape sequences:\r\n\
%c. - terminate connection\r\n\
+%cB - send a BREAK to the remote system\r\n\
%cC - open a command line\r\n\
%cR - Request rekey (SSH protocol 2 only)\r\n\
%c^Z - suspend ssh\r\n\
@@ -646,7 +660,7 @@ Supported escape sequences:\r\n\
(Note that escapes are only recognized immediately after newline.)\r\n",
escape_char, escape_char, escape_char, escape_char,
escape_char, escape_char, escape_char, escape_char,
- escape_char, escape_char);
+ escape_char, escape_char, escape_char);
buffer_append(berr, string, strlen(string));
continue;
diff --git a/session.c b/session.c
index 5b445f93..796c5177 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.156 2003/05/11 20:30:25 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.157 2003/05/14 22:24:42 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -1743,6 +1743,26 @@ session_exec_req(Session *s)
}
static int
+session_break_req(Session *s)
+{
+ u_int break_length;
+
+ break_length = packet_get_int();
+ packet_check_eom();
+
+ if (s->ttyfd == -1)
+ return 0;
+ /* we will sleep from 500ms to 3000ms */
+ break_length = MIN(break_length, 3000);
+ break_length = MAX(break_length, 500);
+ ioctl(s->ttyfd, TIOCSBRK, NULL);
+ /* should we care about EINTR? */
+ usleep(break_length * 1000);
+ ioctl(s->ttyfd, TIOCCBRK, NULL);
+ return 1;
+}
+
+static int
session_auth_agent_req(Session *s)
{
static int called = 0;
@@ -1789,6 +1809,8 @@ session_input_channel_req(Channel *c, const char *rtype)
success = session_auth_agent_req(s);
} else if (strcmp(rtype, "subsystem") == 0) {
success = session_subsystem_req(s);
+ } else if (strcmp(rtype, "break") == 0) {
+ success = session_break_req(s);
}
}
if (strcmp(rtype, "window-change") == 0) {
diff --git a/ssh.1 b/ssh.1
index a7e95c1f..8f91ba75 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,7 +34,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: ssh.1,v 1.169 2003/04/12 11:40:15 naddy Exp $
+.\" $OpenBSD: ssh.1,v 1.170 2003/05/14 22:24:42 markus Exp $
.Dd September 25, 1999
.Dt SSH 1
.Os
@@ -301,6 +301,8 @@ Background ssh at logout when waiting for forwarded connection / X11 sessions
to terminate
.It Cm ~?
Display a list of escape characters
+.It Cm ~B
+Send a BREAK to the remote system.
.It Cm ~C
Open command line (only useful for adding port forwardings using the
.Fl L