summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2001-05-24 18:57:54 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2001-05-24 18:57:54 +0000
commit2b69e35d06300fff419628bd5f4d3ca67414e15d (patch)
tree57d04a27f19cb114017a81e0bf6dcbeababe86a9 /usr.bin
parentb491fe3a15d9f949bba868e893624691d83aa815 (diff)
don't perform escape processing when ``EscapeChar none''; ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/clientloop.c12
-rw-r--r--usr.bin/ssh/readconf.c4
-rw-r--r--usr.bin/ssh/ssh.c10
-rw-r--r--usr.bin/ssh/ssh.h5
4 files changed, 18 insertions, 13 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index cea6e77dcee..74926836d22 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.71 2001/05/16 21:53:53 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.72 2001/05/24 18:57:53 stevesk Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -572,7 +572,7 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
"%c?\r\n\
Supported escape sequences:\r\n\
~. - terminate connection\r\n\
-~R - Request rekey (SSH protocol 2 only)\r\n\
+~R - Request rekey (SSH protocol 2 only)\r\n\
~^Z - suspend ssh\r\n\
~# - list forwarded connections\r\n\
~& - background ssh (when waiting for connections to terminate)\r\n\
@@ -657,7 +657,7 @@ client_process_input(fd_set * readset)
packet_start(SSH_CMSG_EOF);
packet_send();
}
- } else if (escape_char == -1) {
+ } else if (escape_char == SSH_ESCAPECHAR_NONE) {
/*
* Normal successful read, and no escape character.
* Just append the data to buffer.
@@ -765,8 +765,8 @@ client_channel_closed(int id, void *arg)
/*
* Implements the interactive session with the server. This is called after
* the user has been authenticated, and a command has been started on the
- * remote host. If escape_char != -1, it is the character used as an escape
- * character for terminating or suspending the session.
+ * remote host. If escape_char != SSH_ESCAPECHAR_NONE, it is the character
+ * used as an escape character for terminating or suspending the session.
*/
int
@@ -829,7 +829,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
if (compat20) {
session_ident = ssh2_chan_id;
- if (escape_char != -1)
+ if (escape_char != SSH_ESCAPECHAR_NONE)
channel_register_filter(session_ident,
simple_escape_filter);
if (session_ident != -1)
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index ca17ef4ee0c..da15aa5c10f 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.78 2001/05/18 14:13:28 markus Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.79 2001/05/24 18:57:53 stevesk Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -639,7 +639,7 @@ parse_int:
else if (strlen(arg) == 1)
value = (u_char) arg[0];
else if (strcmp(arg, "none") == 0)
- value = -2;
+ value = SSH_ESCAPECHAR_NONE;
else {
fatal("%.200s line %d: Bad escape character.",
filename, linenum);
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 56d6b9613b7..4ff30bc0640 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.118 2001/05/04 23:47:34 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.119 2001/05/24 18:57:53 stevesk Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
@@ -409,7 +409,7 @@ main(int ac, char **av)
else if (strlen(optarg) == 1)
options.escape_char = (u_char) optarg[0];
else if (strcmp(optarg, "none") == 0)
- options.escape_char = -2;
+ options.escape_char = SSH_ESCAPECHAR_NONE;
else {
fprintf(stderr, "Bad escape character '%s'.\n", optarg);
exit(1);
@@ -940,7 +940,8 @@ ssh_session(void)
}
/* Enter the interactive session. */
- return client_loop(have_tty, tty_flag ? options.escape_char : -1, 0);
+ return client_loop(have_tty, tty_flag ?
+ options.escape_char : SSH_ESCAPECHAR_NONE, 0);
}
void
@@ -1096,7 +1097,8 @@ ssh_session2(void)
if (daemon(1, 1) < 0)
fatal("daemon() failed: %.200s", strerror(errno));
- return client_loop(tty_flag, tty_flag ? options.escape_char : -1, id);
+ return client_loop(tty_flag, tty_flag ?
+ options.escape_char : SSH_ESCAPECHAR_NONE, id);
}
void
diff --git a/usr.bin/ssh/ssh.h b/usr.bin/ssh/ssh.h
index 63c75875c05..0db7e6b88ff 100644
--- a/usr.bin/ssh/ssh.h
+++ b/usr.bin/ssh/ssh.h
@@ -10,7 +10,7 @@
* called by a name other than "ssh" or "Secure Shell".
*/
-/* RCSID("$OpenBSD: ssh.h,v 1.62 2001/01/23 10:45:10 markus Exp $"); */
+/* RCSID("$OpenBSD: ssh.h,v 1.63 2001/05/24 18:57:53 stevesk Exp $"); */
#ifndef SSH_H
#define SSH_H
@@ -82,4 +82,7 @@
/* Name of Kerberos service for SSH to use. */
#define KRB4_SERVICE_NAME "rcmd"
+/* Used to identify ``EscapeChar none'' */
+#define SSH_ESCAPECHAR_NONE -2
+
#endif /* SSH_H */