summaryrefslogtreecommitdiffstats
path: root/clientloop.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2012-09-06 21:25:37 +1000
committerDarren Tucker <dtucker@zip.com.au>2012-09-06 21:25:37 +1000
commit50a48d025ffc961c3f5e48f521b406d7c49681bb (patch)
tree03407276678e5a2e9b4e5a9a21ce73c1a6857e07 /clientloop.c
parent00c1518a4d0e610e319433fa588cc1fbdfbff0b1 (diff)
- dtucker@cvs.openbsd.org 2012/09/06 04:37:39
[clientloop.c log.c ssh.1 log.h] Add ~v and ~V escape sequences to raise and lower the logging level respectively. Man page help from jmc, ok deraadt jmc
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/clientloop.c b/clientloop.c
index 65664cbc..0e5c45a9 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.241 2012/08/17 00:45:45 dtucker Exp $ */
+/* $OpenBSD: clientloop.c,v 1.242 2012/09/06 04:37:38 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1099,6 +1099,31 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr,
}
continue;
+ case 'V':
+ /* FALLTHROUGH */
+ case 'v':
+ if (c && c->ctl_chan != -1)
+ goto noescape;
+ if (!log_is_on_stderr()) {
+ snprintf(string, sizeof string,
+ "%c%c [Logging to syslog]\r\n",
+ escape_char, ch);
+ buffer_append(berr, string,
+ strlen(string));
+ continue;
+ }
+ if (ch == 'V' && options.log_level >
+ SYSLOG_LEVEL_QUIET)
+ log_change_level(--options.log_level);
+ if (ch == 'v' && options.log_level <
+ SYSLOG_LEVEL_DEBUG3)
+ log_change_level(++options.log_level);
+ snprintf(string, sizeof string,
+ "%c%c [LogLevel %s]\r\n", escape_char, ch,
+ log_level_name(options.log_level));
+ buffer_append(berr, string, strlen(string));
+ continue;
+
case '&':
if (c && c->ctl_chan != -1)
goto noescape;
@@ -1175,6 +1200,8 @@ Supported escape sequences:\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\
+ %cV - Increase verbosity (LogLevel)\r\n\
+ %cv - Decrease verbosity (LogLevel)\r\n\
%c^Z - suspend ssh\r\n\
%c# - list forwarded connections\r\n\
%c& - background ssh (when waiting for connections to terminate)\r\n\
@@ -1186,6 +1213,7 @@ Supported escape sequences:\r\n\
escape_char, escape_char,
escape_char, escape_char,
escape_char, escape_char,
+ escape_char, escape_char,
escape_char);
}
buffer_append(berr, string, strlen(string));