Bugzilla – Attachment 2979 Details for
Bug 2717
MonitoringHosts option - suppress Connection reset entries from known hosts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Allow LogLevel to appear in sshd_config Match blocks
loglevelmatch.diff (text/plain), 3.73 KB, created by
Damien Miller
on 2017-05-17 02:38:47 AEST
(
hide
)
Description:
Allow LogLevel to appear in sshd_config Match blocks
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2017-05-17 02:38:47 AEST
Size:
3.73 KB
patch
obsolete
>diff --git a/auth.c b/auth.c >index 997f2306..686a2e10 100644 >--- a/auth.c >+++ b/auth.c >@@ -661,6 +661,7 @@ getpwnamallow(const char *user) > > ci->user = user; > parse_server_match_config(&options, ci); >+ log_change_level(options.log_level); > > #if defined(_AIX) && defined(HAVE_SETAUTHDB) > aix_setauthdb(user); >diff --git a/log.c b/log.c >index d0f86cf6..565a9056 100644 >--- a/log.c >+++ b/log.c >@@ -256,18 +256,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) > > argv0 = av0; > >- switch (level) { >- case SYSLOG_LEVEL_QUIET: >- case SYSLOG_LEVEL_FATAL: >- case SYSLOG_LEVEL_ERROR: >- case SYSLOG_LEVEL_INFO: >- case SYSLOG_LEVEL_VERBOSE: >- case SYSLOG_LEVEL_DEBUG1: >- case SYSLOG_LEVEL_DEBUG2: >- case SYSLOG_LEVEL_DEBUG3: >- log_level = level; >- break; >- default: >+ if (log_change_level(level) != 0) { > fprintf(stderr, "Unrecognized internal syslog level code %d\n", > (int) level); > exit(1); >@@ -340,13 +329,27 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) > #endif > } > >-void >+int > log_change_level(LogLevel new_log_level) > { > /* no-op if log_init has not been called */ > if (argv0 == NULL) >- return; >- log_init(argv0, new_log_level, log_facility, log_on_stderr); >+ return 0; >+ >+ switch (new_log_level) { >+ case SYSLOG_LEVEL_QUIET: >+ case SYSLOG_LEVEL_FATAL: >+ case SYSLOG_LEVEL_ERROR: >+ case SYSLOG_LEVEL_INFO: >+ case SYSLOG_LEVEL_VERBOSE: >+ case SYSLOG_LEVEL_DEBUG1: >+ case SYSLOG_LEVEL_DEBUG2: >+ case SYSLOG_LEVEL_DEBUG3: >+ log_level = new_log_level; >+ return 0; >+ default: >+ return -1; >+ } > } > > int >diff --git a/log.h b/log.h >index 434b7c81..c44bd6f5 100644 >--- a/log.h >+++ b/log.h >@@ -49,7 +49,7 @@ typedef enum { > typedef void (log_handler_fn)(LogLevel, const char *, void *); > > void log_init(char *, LogLevel, SyslogFacility, int); >-void log_change_level(LogLevel); >+int log_change_level(LogLevel); > int log_is_on_stderr(void); > void log_redirect_stderr_to(const char *); > >diff --git a/monitor_wrap.c b/monitor_wrap.c >index 64ff9288..47dd059a 100644 >--- a/monitor_wrap.c >+++ b/monitor_wrap.c >@@ -295,6 +295,7 @@ out: > #undef M_CP_STRARRAYOPT > > copy_set_server_options(&options, newopts, 1); >+ log_change_level(options.log_level); > free(newopts); > > buffer_free(&m); >diff --git a/servconf.c b/servconf.c >index 73f2c2b1..868aa58a 100644 >--- a/servconf.c >+++ b/servconf.c >@@ -449,7 +449,7 @@ static struct { > { "keyregenerationinterval", sDeprecated, SSHCFG_GLOBAL }, > { "permitrootlogin", sPermitRootLogin, SSHCFG_ALL }, > { "syslogfacility", sLogFacility, SSHCFG_GLOBAL }, >- { "loglevel", sLogLevel, SSHCFG_GLOBAL }, >+ { "loglevel", sLogLevel, SSHCFG_ALL }, > { "rhostsauthentication", sDeprecated, SSHCFG_GLOBAL }, > { "rhostsrsaauthentication", sDeprecated, SSHCFG_ALL }, > { "hostbasedauthentication", sHostbasedAuthentication, SSHCFG_ALL }, >@@ -1345,7 +1345,7 @@ process_server_config_line(ServerOptions *options, char *line, > if (value == SYSLOG_LEVEL_NOT_SET) > fatal("%.200s line %d: unsupported log level '%s'", > filename, linenum, arg ? arg : "<NONE>"); >- if (*log_level_ptr == -1) >+ if (*activep && *log_level_ptr == -1) > *log_level_ptr = (LogLevel) value; > break; > >@@ -1989,6 +1989,7 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth) > M_CP_INTOPT(ip_qos_bulk); > M_CP_INTOPT(rekey_limit); > M_CP_INTOPT(rekey_interval); >+ M_CP_INTOPT(log_level); > > /* > * The bind_mask is a mode_t that may be unsigned, so we can't use >diff --git a/sshd_config.5 b/sshd_config.5 >index 7ccf6fd4..dda9a035 100644 >--- a/sshd_config.5 >+++ b/sshd_config.5 >@@ -1066,6 +1066,7 @@ Available keywords are > .Cm IPQoS , > .Cm KbdInteractiveAuthentication , > .Cm KerberosAuthentication , >+.Cm LogLevel , > .Cm MaxAuthTries , > .Cm MaxSessions , > .Cm PasswordAuthentication ,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2717
: 2979