diff options
Diffstat (limited to 'debian/patches/syslog-level-silent.patch')
-rw-r--r-- | debian/patches/syslog-level-silent.patch | 176 |
1 files changed, 176 insertions, 0 deletions
diff --git a/debian/patches/syslog-level-silent.patch b/debian/patches/syslog-level-silent.patch new file mode 100644 index 000000000..492d61983 --- /dev/null +++ b/debian/patches/syslog-level-silent.patch | |||
@@ -0,0 +1,176 @@ | |||
1 | Index: b/clientloop.c | ||
2 | =================================================================== | ||
3 | --- a/clientloop.c | ||
4 | +++ b/clientloop.c | ||
5 | @@ -1533,7 +1533,7 @@ | ||
6 | * In interactive mode (with pseudo tty) display a message indicating | ||
7 | * that the connection has been closed. | ||
8 | */ | ||
9 | - if (have_pty && options.log_level != SYSLOG_LEVEL_QUIET) { | ||
10 | + if (have_pty && options.log_level > SYSLOG_LEVEL_QUIET) { | ||
11 | snprintf(buf, sizeof buf, | ||
12 | "Connection to %.64s closed.\r\n", host); | ||
13 | buffer_append(&stderr_buffer, buf, strlen(buf)); | ||
14 | Index: b/log.c | ||
15 | =================================================================== | ||
16 | --- a/log.c | ||
17 | +++ b/log.c | ||
18 | @@ -90,6 +90,7 @@ | ||
19 | LogLevel val; | ||
20 | } log_levels[] = | ||
21 | { | ||
22 | + { "SILENT", SYSLOG_LEVEL_SILENT }, | ||
23 | { "QUIET", SYSLOG_LEVEL_QUIET }, | ||
24 | { "FATAL", SYSLOG_LEVEL_FATAL }, | ||
25 | { "ERROR", SYSLOG_LEVEL_ERROR }, | ||
26 | @@ -244,6 +245,7 @@ | ||
27 | argv0 = av0; | ||
28 | |||
29 | switch (level) { | ||
30 | + case SYSLOG_LEVEL_SILENT: | ||
31 | case SYSLOG_LEVEL_QUIET: | ||
32 | case SYSLOG_LEVEL_FATAL: | ||
33 | case SYSLOG_LEVEL_ERROR: | ||
34 | Index: b/log.h | ||
35 | =================================================================== | ||
36 | --- a/log.h | ||
37 | +++ b/log.h | ||
38 | @@ -35,6 +35,7 @@ | ||
39 | } SyslogFacility; | ||
40 | |||
41 | typedef enum { | ||
42 | + SYSLOG_LEVEL_SILENT, | ||
43 | SYSLOG_LEVEL_QUIET, | ||
44 | SYSLOG_LEVEL_FATAL, | ||
45 | SYSLOG_LEVEL_ERROR, | ||
46 | Index: b/mux.c | ||
47 | =================================================================== | ||
48 | --- a/mux.c | ||
49 | +++ b/mux.c | ||
50 | @@ -721,7 +721,7 @@ | ||
51 | } else | ||
52 | debug2("Received exit status from master %d", exitval[0]); | ||
53 | |||
54 | - if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) | ||
55 | + if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET) | ||
56 | fprintf(stderr, "Shared connection to %s closed.\r\n", host); | ||
57 | |||
58 | exit(exitval[0]); | ||
59 | Index: b/sftp-server.8 | ||
60 | =================================================================== | ||
61 | --- a/sftp-server.8 | ||
62 | +++ b/sftp-server.8 | ||
63 | @@ -64,7 +64,7 @@ | ||
64 | Specifies which messages will be logged by | ||
65 | .Nm . | ||
66 | The possible values are: | ||
67 | -QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
68 | +SILENT, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
69 | INFO and VERBOSE log transactions that | ||
70 | .Nm | ||
71 | performs on behalf of the client. | ||
72 | Index: b/ssh.1 | ||
73 | =================================================================== | ||
74 | --- a/ssh.1 | ||
75 | +++ b/ssh.1 | ||
76 | @@ -500,6 +500,11 @@ | ||
77 | .It Fl q | ||
78 | Quiet mode. | ||
79 | Causes most warning and diagnostic messages to be suppressed. | ||
80 | +Only fatal errors are displayed. | ||
81 | +If a second | ||
82 | +.Fl q | ||
83 | +is given then even fatal errors are suppressed, except for those produced | ||
84 | +due solely to bad arguments. | ||
85 | .It Fl R Xo | ||
86 | .Sm off | ||
87 | .Oo Ar bind_address : Oc | ||
88 | Index: b/ssh.c | ||
89 | =================================================================== | ||
90 | --- a/ssh.c | ||
91 | +++ b/ssh.c | ||
92 | @@ -389,7 +389,12 @@ | ||
93 | } | ||
94 | break; | ||
95 | case 'q': | ||
96 | - options.log_level = SYSLOG_LEVEL_QUIET; | ||
97 | + if (options.log_level == SYSLOG_LEVEL_QUIET) { | ||
98 | + options.log_level = SYSLOG_LEVEL_SILENT; | ||
99 | + } | ||
100 | + else if (options.log_level != SYSLOG_LEVEL_SILENT) { | ||
101 | + options.log_level = SYSLOG_LEVEL_QUIET; | ||
102 | + } | ||
103 | break; | ||
104 | case 'e': | ||
105 | if (optarg[0] == '^' && optarg[2] == 0 && | ||
106 | @@ -592,7 +597,7 @@ | ||
107 | tty_flag = 0; | ||
108 | /* Do not allocate a tty if stdin is not a tty. */ | ||
109 | if ((!isatty(fileno(stdin)) || stdin_null_flag) && !force_tty_flag) { | ||
110 | - if (tty_flag) | ||
111 | + if (tty_flag && options.log_level > SYSLOG_LEVEL_QUIET) | ||
112 | logit("Pseudo-terminal will not be allocated because " | ||
113 | "stdin is not a terminal."); | ||
114 | tty_flag = 0; | ||
115 | Index: b/ssh_config.5 | ||
116 | =================================================================== | ||
117 | --- a/ssh_config.5 | ||
118 | +++ b/ssh_config.5 | ||
119 | @@ -685,7 +685,7 @@ | ||
120 | Gives the verbosity level that is used when logging messages from | ||
121 | .Xr ssh 1 . | ||
122 | The possible values are: | ||
123 | -QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
124 | +SILENT, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
125 | The default is INFO. | ||
126 | DEBUG and DEBUG1 are equivalent. | ||
127 | DEBUG2 and DEBUG3 each specify higher levels of verbose output. | ||
128 | Index: b/sshd.8 | ||
129 | =================================================================== | ||
130 | --- a/sshd.8 | ||
131 | +++ b/sshd.8 | ||
132 | @@ -207,9 +207,12 @@ | ||
133 | option override command-line ports. | ||
134 | .It Fl q | ||
135 | Quiet mode. | ||
136 | -Nothing is sent to the system log. | ||
137 | +Only fatal errors are sent to the system log. | ||
138 | Normally the beginning, | ||
139 | authentication, and termination of each connection is logged. | ||
140 | +If a second | ||
141 | +.Fl q | ||
142 | +is given then nothing is sent to the system log. | ||
143 | .It Fl T | ||
144 | Extended test mode. | ||
145 | Check the validity of the configuration file, output the effective configuration | ||
146 | Index: b/sshd.c | ||
147 | =================================================================== | ||
148 | --- a/sshd.c | ||
149 | +++ b/sshd.c | ||
150 | @@ -1355,7 +1355,12 @@ | ||
151 | /* ignored */ | ||
152 | break; | ||
153 | case 'q': | ||
154 | - options.log_level = SYSLOG_LEVEL_QUIET; | ||
155 | + if (options.log_level == SYSLOG_LEVEL_QUIET) { | ||
156 | + options.log_level = SYSLOG_LEVEL_SILENT; | ||
157 | + } | ||
158 | + else if (options.log_level != SYSLOG_LEVEL_SILENT) { | ||
159 | + options.log_level = SYSLOG_LEVEL_QUIET; | ||
160 | + } | ||
161 | break; | ||
162 | case 'b': | ||
163 | options.server_key_bits = (int)strtonum(optarg, 256, | ||
164 | Index: b/sshd_config.5 | ||
165 | =================================================================== | ||
166 | --- a/sshd_config.5 | ||
167 | +++ b/sshd_config.5 | ||
168 | @@ -567,7 +567,7 @@ | ||
169 | Gives the verbosity level that is used when logging messages from | ||
170 | .Xr sshd 8 . | ||
171 | The possible values are: | ||
172 | -QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
173 | +SILENT, QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. | ||
174 | The default is INFO. | ||
175 | DEBUG and DEBUG1 are equivalent. | ||
176 | DEBUG2 and DEBUG3 each specify higher levels of debugging output. | ||