diff options
Diffstat (limited to 'debian/patches/syslog-level-silent.patch')
-rw-r--r-- | debian/patches/syslog-level-silent.patch | 177 |
1 files changed, 11 insertions, 166 deletions
diff --git a/debian/patches/syslog-level-silent.patch b/debian/patches/syslog-level-silent.patch index 3ed46c8f8..2dc912b8e 100644 --- a/debian/patches/syslog-level-silent.patch +++ b/debian/patches/syslog-level-silent.patch | |||
@@ -1,32 +1,15 @@ | |||
1 | Description: Add "LogLevel SILENT" (-qq), suppressing even fatal errors | 1 | Description: "LogLevel SILENT" compatibility |
2 | It's not clear that this is as useful as originally intended, or | 2 | "LogLevel SILENT" (-qq) was introduced in Debian openssh 1:3.0.1p1-1 to |
3 | implemented correctly, and there's no bug trail to be found for the | 3 | match the behaviour of non-free SSH, in which -q does not suppress fatal |
4 | original feature (although it has been tweaked by bug reports since it was | 4 | errors. However, this was unintentionally broken in 1:4.6p1-2 and nobody |
5 | added in Debian openssh 1:3.0.1p1-1). Needs review. | 5 | complained, so we've dropped most of it. The parts that remain are basic |
6 | . | 6 | configuration file compatibility, and an adjustment to "Pseudo-terminal |
7 | Jonathan says that this patch was originally meant to match the behaviour | 7 | will not be allocated ..." which should be split out into a separate patch. |
8 | of non-free SSH, in which -q does not suppress fatal errors. Given that | ||
9 | this was unintentionally broken in 1:4.6p1-2 and nobody's complained, we | ||
10 | can probably drop most of this. The adjustment to "Pseudo-terminal will | ||
11 | not be allocated ..." should be split out into a separate patch. | ||
12 | Author: Jonathan David Amery <jdamery@ysolde.ucam.org> | 8 | Author: Jonathan David Amery <jdamery@ysolde.ucam.org> |
13 | Author: Matthew Vernon <matthew@debian.org> | 9 | Author: Matthew Vernon <matthew@debian.org> |
14 | Author: Colin Watson <cjwatson@debian.org> | 10 | Author: Colin Watson <cjwatson@debian.org> |
15 | Last-Update: 2010-02-27 | 11 | Last-Update: 2010-03-31 |
16 | 12 | ||
17 | Index: b/clientloop.c | ||
18 | =================================================================== | ||
19 | --- a/clientloop.c | ||
20 | +++ b/clientloop.c | ||
21 | @@ -1536,7 +1536,7 @@ | ||
22 | * In interactive mode (with pseudo tty) display a message indicating | ||
23 | * that the connection has been closed. | ||
24 | */ | ||
25 | - if (have_pty && options.log_level != SYSLOG_LEVEL_QUIET) { | ||
26 | + if (have_pty && options.log_level > SYSLOG_LEVEL_QUIET) { | ||
27 | snprintf(buf, sizeof buf, | ||
28 | "Connection to %.64s closed.\r\n", host); | ||
29 | buffer_append(&stderr_buffer, buf, strlen(buf)); | ||
30 | Index: b/log.c | 13 | Index: b/log.c |
31 | =================================================================== | 14 | =================================================================== |
32 | --- a/log.c | 15 | --- a/log.c |
@@ -35,158 +18,20 @@ Index: b/log.c | |||
35 | LogLevel val; | 18 | LogLevel val; |
36 | } log_levels[] = | 19 | } log_levels[] = |
37 | { | 20 | { |
38 | + { "SILENT", SYSLOG_LEVEL_SILENT }, | 21 | + { "SILENT", SYSLOG_LEVEL_QUIET }, /* compatibility */ |
39 | { "QUIET", SYSLOG_LEVEL_QUIET }, | 22 | { "QUIET", SYSLOG_LEVEL_QUIET }, |
40 | { "FATAL", SYSLOG_LEVEL_FATAL }, | 23 | { "FATAL", SYSLOG_LEVEL_FATAL }, |
41 | { "ERROR", SYSLOG_LEVEL_ERROR }, | 24 | { "ERROR", SYSLOG_LEVEL_ERROR }, |
42 | @@ -244,6 +245,7 @@ | ||
43 | argv0 = av0; | ||
44 | |||
45 | switch (level) { | ||
46 | + case SYSLOG_LEVEL_SILENT: | ||
47 | case SYSLOG_LEVEL_QUIET: | ||
48 | case SYSLOG_LEVEL_FATAL: | ||
49 | case SYSLOG_LEVEL_ERROR: | ||
50 | Index: b/log.h | ||
51 | =================================================================== | ||
52 | --- a/log.h | ||
53 | +++ b/log.h | ||
54 | @@ -35,6 +35,7 @@ | ||
55 | } SyslogFacility; | ||
56 | |||
57 | typedef enum { | ||
58 | + SYSLOG_LEVEL_SILENT, | ||
59 | SYSLOG_LEVEL_QUIET, | ||
60 | SYSLOG_LEVEL_FATAL, | ||
61 | SYSLOG_LEVEL_ERROR, | ||
62 | Index: b/mux.c | ||
63 | =================================================================== | ||
64 | --- a/mux.c | ||
65 | +++ b/mux.c | ||
66 | @@ -1553,7 +1553,7 @@ | ||
67 | } else | ||
68 | debug2("Received exit status from master %d", exitval); | ||
69 | |||
70 | - if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) | ||
71 | + if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET) | ||
72 | fprintf(stderr, "Shared connection to %s closed.\r\n", host); | ||
73 | |||
74 | exit(exitval); | ||
75 | Index: b/sftp-server.8 | ||
76 | =================================================================== | ||
77 | --- a/sftp-server.8 | ||
78 | +++ b/sftp-server.8 | ||
79 | @@ -74,7 +74,7 @@ | ||
80 | Specifies which messages will be logged by | ||
81 | .Nm . | ||
82 | The possible values are: | ||
83 | -QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
84 | +SILENT, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
85 | INFO and VERBOSE log transactions that | ||
86 | .Nm | ||
87 | performs on behalf of the client. | ||
88 | Index: b/ssh.1 | ||
89 | =================================================================== | ||
90 | --- a/ssh.1 | ||
91 | +++ b/ssh.1 | ||
92 | @@ -504,6 +504,11 @@ | ||
93 | .It Fl q | ||
94 | Quiet mode. | ||
95 | Causes most warning and diagnostic messages to be suppressed. | ||
96 | +Only fatal errors are displayed. | ||
97 | +If a second | ||
98 | +.Fl q | ||
99 | +is given then even fatal errors are suppressed, except for those produced | ||
100 | +due solely to bad arguments. | ||
101 | .It Fl R Xo | ||
102 | .Sm off | ||
103 | .Oo Ar bind_address : Oc | ||
104 | Index: b/ssh.c | 25 | Index: b/ssh.c |
105 | =================================================================== | 26 | =================================================================== |
106 | --- a/ssh.c | 27 | --- a/ssh.c |
107 | +++ b/ssh.c | 28 | +++ b/ssh.c |
108 | @@ -421,7 +421,12 @@ | 29 | @@ -624,7 +624,7 @@ |
109 | options.exit_on_forward_failure = 1; | ||
110 | break; | ||
111 | case 'q': | ||
112 | - options.log_level = SYSLOG_LEVEL_QUIET; | ||
113 | + if (options.log_level == SYSLOG_LEVEL_QUIET) { | ||
114 | + options.log_level = SYSLOG_LEVEL_SILENT; | ||
115 | + } | ||
116 | + else if (options.log_level != SYSLOG_LEVEL_SILENT) { | ||
117 | + options.log_level = SYSLOG_LEVEL_QUIET; | ||
118 | + } | ||
119 | break; | ||
120 | case 'e': | ||
121 | if (optarg[0] == '^' && optarg[2] == 0 && | ||
122 | @@ -624,7 +629,7 @@ | ||
123 | tty_flag = 0; | 30 | tty_flag = 0; |
124 | /* Do not allocate a tty if stdin is not a tty. */ | 31 | /* Do not allocate a tty if stdin is not a tty. */ |
125 | if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { | 32 | if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { |
126 | - if (tty_flag) | 33 | - if (tty_flag) |
127 | + if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET) | 34 | + if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) |
128 | logit("Pseudo-terminal will not be allocated because " | 35 | logit("Pseudo-terminal will not be allocated because " |
129 | "stdin is not a terminal."); | 36 | "stdin is not a terminal."); |
130 | tty_flag = 0; | 37 | tty_flag = 0; |
131 | Index: b/ssh_config.5 | ||
132 | =================================================================== | ||
133 | --- a/ssh_config.5 | ||
134 | +++ b/ssh_config.5 | ||
135 | @@ -698,7 +698,7 @@ | ||
136 | Gives the verbosity level that is used when logging messages from | ||
137 | .Xr ssh 1 . | ||
138 | The possible values are: | ||
139 | -QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
140 | +SILENT, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
141 | The default is INFO. | ||
142 | DEBUG and DEBUG1 are equivalent. | ||
143 | DEBUG2 and DEBUG3 each specify higher levels of verbose output. | ||
144 | Index: b/sshd.8 | ||
145 | =================================================================== | ||
146 | --- a/sshd.8 | ||
147 | +++ b/sshd.8 | ||
148 | @@ -217,9 +217,12 @@ | ||
149 | option override command-line ports. | ||
150 | .It Fl q | ||
151 | Quiet mode. | ||
152 | -Nothing is sent to the system log. | ||
153 | +Only fatal errors are sent to the system log. | ||
154 | Normally the beginning, | ||
155 | authentication, and termination of each connection is logged. | ||
156 | +If a second | ||
157 | +.Fl q | ||
158 | +is given then nothing is sent to the system log. | ||
159 | .It Fl T | ||
160 | Extended test mode. | ||
161 | Check the validity of the configuration file, output the effective configuration | ||
162 | Index: b/sshd.c | ||
163 | =================================================================== | ||
164 | --- a/sshd.c | ||
165 | +++ b/sshd.c | ||
166 | @@ -1370,7 +1370,12 @@ | ||
167 | /* ignored */ | ||
168 | break; | ||
169 | case 'q': | ||
170 | - options.log_level = SYSLOG_LEVEL_QUIET; | ||
171 | + if (options.log_level == SYSLOG_LEVEL_QUIET) { | ||
172 | + options.log_level = SYSLOG_LEVEL_SILENT; | ||
173 | + } | ||
174 | + else if (options.log_level != SYSLOG_LEVEL_SILENT) { | ||
175 | + options.log_level = SYSLOG_LEVEL_QUIET; | ||
176 | + } | ||
177 | break; | ||
178 | case 'b': | ||
179 | options.server_key_bits = (int)strtonum(optarg, 256, | ||
180 | Index: b/sshd_config.5 | ||
181 | =================================================================== | ||
182 | --- a/sshd_config.5 | ||
183 | +++ b/sshd_config.5 | ||
184 | @@ -575,7 +575,7 @@ | ||
185 | Gives the verbosity level that is used when logging messages from | ||
186 | .Xr sshd 8 . | ||
187 | The possible values are: | ||
188 | -QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
189 | +SILENT, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
190 | The default is INFO. | ||
191 | DEBUG and DEBUG1 are equivalent. | ||
192 | DEBUG2 and DEBUG3 each specify higher levels of debugging output. | ||