From 58c1210f4b0d85eec0f7df539643ac3c705862fc Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 13 Jun 2007 00:18:25 +0000 Subject: * Suppress "Connection to closed" and "Connection to master closed" messages at loglevel SILENT (thanks, Jaap Eldering; closes: #409788). * Suppress "Pseudo-terminal will not be allocated because stdin is not a terminal" message at loglevels QUIET and SILENT (closes: #366814). --- clientloop.c | 2 +- debian/changelog | 4 ++++ ssh.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/clientloop.c b/clientloop.c index ae93dcdf3..766a4b3bf 100644 --- a/clientloop.c +++ b/clientloop.c @@ -1563,7 +1563,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) * In interactive mode (with pseudo tty) display a message indicating * that the connection has been closed. */ - if (have_pty && options.log_level != SYSLOG_LEVEL_QUIET) { + if (have_pty && options.log_level > SYSLOG_LEVEL_QUIET) { snprintf(buf, sizeof buf, "Connection to %.64s closed.\r\n", host); buffer_append(&stderr_buffer, buf, strlen(buf)); } diff --git a/debian/changelog b/debian/changelog index 39ecb447c..3a1659e9f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ openssh (1:4.6p1-2) UNRELEASED; urgency=low * Fix ordering of SYSLOG_LEVEL_QUIET and SYSLOG_LEVEL_FATAL. * Clarify that 'ssh -q -q' still prints errors caused by bad arguments (i.e. before the logging system is initialised). + * Suppress "Connection to closed" and "Connection to master closed" + messages at loglevel SILENT (thanks, Jaap Eldering; closes: #409788). + * Suppress "Pseudo-terminal will not be allocated because stdin is not a + terminal" message at loglevels QUIET and SILENT (closes: #366814). -- Colin Watson Wed, 13 Jun 2007 00:56:45 +0100 diff --git a/ssh.c b/ssh.c index c75decc1b..1d98a7034 100644 --- a/ssh.c +++ b/ssh.c @@ -602,7 +602,7 @@ main(int ac, char **av) tty_flag = 0; /* Do not allocate a tty if stdin is not a tty. */ if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { - if (tty_flag) + if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET) logit("Pseudo-terminal will not be allocated because stdin is not a terminal."); tty_flag = 0; } @@ -1485,7 +1485,7 @@ control_client(const char *path) leave_raw_mode(); - if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) + if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET) fprintf(stderr, "Connection to master closed.\r\n"); exit(exitval); -- cgit v1.2.3