Bugzilla – Attachment 2973 Details for
Bug 2705
Allow configuring syslog facility for the SSH client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch to fix bug
0001-Add-SyslogFacility-setting-to-ssh-client-program.-Al.patch (text/plain), 4.95 KB, created by
erahn
on 2017-04-08 04:38:22 AEST
(
hide
)
Description:
Proposed patch to fix bug
Filename:
MIME Type:
Creator:
erahn
Created:
2017-04-08 04:38:22 AEST
Size:
4.95 KB
patch
obsolete
>From 59b65567db784f4af7c64a59ddd595011f95e4b7 Mon Sep 17 00:00:00 2001 >From: Ethan Rahn <erahn@arista.com> >Date: Fri, 7 Apr 2017 11:08:05 -0700 >Subject: [PATCH 1/1] Add SyslogFacility setting to 'ssh' client program. Also > update ssh_config.5 man page to mention the new command. > >--- > readconf.c | 18 +++++++++++++++++- > readconf.h | 1 + > ssh.c | 9 ++++++--- > ssh_config.5 | 6 ++++++ > 4 files changed, 30 insertions(+), 4 deletions(-) > >diff --git a/readconf.c b/readconf.c >index 9d59493..f3d8aa9 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -152,7 +152,7 @@ typedef enum { > oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, > oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, > oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts, >- oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, >+ oUsePrivilegedPort, oLogFacility, oLogLevel, oCiphers, oProtocol, oMacs, > oPubkeyAuthentication, > oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, > oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, >@@ -265,6 +265,7 @@ static struct { > { "tcpkeepalive", oTCPKeepAlive }, > { "keepalive", oTCPKeepAlive }, /* obsolete */ > { "numberofpasswordprompts", oNumberOfPasswordPrompts }, >+ { "syslogfacility", oLogFacility }, > { "loglevel", oLogLevel }, > { "dynamicforward", oDynamicForward }, > { "preferredauthentications", oPreferredAuthentications }, >@@ -830,6 +831,7 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host, > u_int i, *uintptr, max_entries = 0; > int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0; > LogLevel *log_level_ptr; >+ SyslogFacility *log_facility_ptr; > long long val64; > size_t len; > struct Forward fwd; >@@ -1264,6 +1266,17 @@ parse_keytypes: > *log_level_ptr = (LogLevel) value; > break; > >+ case oLogFacility: >+ log_facility_ptr = &options->log_facility; >+ arg = strdelim(&s); >+ value = log_facility_number(arg); >+ if (value == SYSLOG_FACILITY_NOT_SET) >+ fatal("%.200s line %d: unsupported log facility '%s'", >+ filename, linenum, arg ? arg : "<NONE>"); >+ if (*log_facility_ptr == -1) >+ *log_facility_ptr = (SyslogFacility) value; >+ break; >+ > case oLocalForward: > case oRemoteForward: > case oDynamicForward: >@@ -1838,6 +1851,7 @@ initialize_options(Options * options) > options->num_local_forwards = 0; > options->remote_forwards = NULL; > options->num_remote_forwards = 0; >+ options->log_facility = SYSLOG_FACILITY_NOT_SET; > options->log_level = SYSLOG_LEVEL_NOT_SET; > options->preferred_authentications = NULL; > options->bind_address = NULL; >@@ -2014,6 +2028,8 @@ fill_default_options(Options * options) > } > if (options->log_level == SYSLOG_LEVEL_NOT_SET) > options->log_level = SYSLOG_LEVEL_INFO; >+ if (options->log_facility == SYSLOG_FACILITY_NOT_SET) >+ options->log_facility = SYSLOG_FACILITY_USER; > if (options->no_host_authentication_for_localhost == - 1) > options->no_host_authentication_for_localhost = 0; > if (options->identities_only == -1) >diff --git a/readconf.h b/readconf.h >index cef55f7..9e7e47b 100644 >--- a/readconf.h >+++ b/readconf.h >@@ -59,6 +59,7 @@ typedef struct { > int tcp_keep_alive; /* Set SO_KEEPALIVE. */ > int ip_qos_interactive; /* IP ToS/DSCP/class for interactive */ > int ip_qos_bulk; /* IP ToS/DSCP/class for bulk traffic */ >+ SyslogFacility log_facility; /* Facility for system logging. */ > LogLevel log_level; /* Level for logging. */ > > int port; /* Port to connect. */ >diff --git a/ssh.c b/ssh.c >index 32b27bb..ebe18c9 100644 >--- a/ssh.c >+++ b/ssh.c >@@ -1007,8 +1007,11 @@ main(int ac, char **av) > if (logfile != NULL) > log_redirect_stderr_to(logfile); > log_init(argv0, >- options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, >- SYSLOG_FACILITY_USER, !use_syslog); >+ options.log_level == SYSLOG_LEVEL_NOT_SET ? >+ SYSLOG_LEVEL_INFO : options.log_level, >+ options.log_facility == SYSLOG_FACILITY_NOT_SET ? >+ SYSLOG_FACILITY_USER : options.log_facility, >+ !use_syslog); > > if (debug_flag) > logit("%s, %s", SSH_RELEASE, >@@ -1150,7 +1153,7 @@ main(int ac, char **av) > #endif > > /* reinit */ >- log_init(argv0, options.log_level, SYSLOG_FACILITY_USER, !use_syslog); >+ log_init(argv0, options.log_level, options.log_facility, !use_syslog); > > if (options.request_tty == REQUEST_TTY_YES || > options.request_tty == REQUEST_TTY_FORCE) >diff --git a/ssh_config.5 b/ssh_config.5 >index 532745b..a46c13e 100644 >--- a/ssh_config.5 >+++ b/ssh_config.5 >@@ -1101,6 +1101,12 @@ indicates that the listening port be bound for local use only, while an > empty address or > .Sq * > indicates that the port should be available from all interfaces. >+.It Cm SyslogFacility >+Gives the facility code that is used when logging messages from >+.Xr ssh 1 . >+The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, >+LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. >+The default is USER. > .It Cm LogLevel > Gives the verbosity level that is used when logging messages from > .Xr ssh 1 . >-- >1.8.1.4 >
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:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2705
: 2973