summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 9d59493f0..013c19f59 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.270 2017/03/10 04:27:32 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.271 2017/04/28 03:20:27 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -152,7 +152,7 @@ typedef enum {
152 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, 152 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
153 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, 153 oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression,
154 oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts, 154 oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,
155 oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs, 155 oUsePrivilegedPort, oLogFacility, oLogLevel, oCiphers, oProtocol, oMacs,
156 oPubkeyAuthentication, 156 oPubkeyAuthentication,
157 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, 157 oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
158 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, 158 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
@@ -265,6 +265,7 @@ static struct {
265 { "tcpkeepalive", oTCPKeepAlive }, 265 { "tcpkeepalive", oTCPKeepAlive },
266 { "keepalive", oTCPKeepAlive }, /* obsolete */ 266 { "keepalive", oTCPKeepAlive }, /* obsolete */
267 { "numberofpasswordprompts", oNumberOfPasswordPrompts }, 267 { "numberofpasswordprompts", oNumberOfPasswordPrompts },
268 { "syslogfacility", oLogFacility },
268 { "loglevel", oLogLevel }, 269 { "loglevel", oLogLevel },
269 { "dynamicforward", oDynamicForward }, 270 { "dynamicforward", oDynamicForward },
270 { "preferredauthentications", oPreferredAuthentications }, 271 { "preferredauthentications", oPreferredAuthentications },
@@ -830,6 +831,7 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host,
830 u_int i, *uintptr, max_entries = 0; 831 u_int i, *uintptr, max_entries = 0;
831 int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0; 832 int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0;
832 LogLevel *log_level_ptr; 833 LogLevel *log_level_ptr;
834 SyslogFacility *log_facility_ptr;
833 long long val64; 835 long long val64;
834 size_t len; 836 size_t len;
835 struct Forward fwd; 837 struct Forward fwd;
@@ -1264,6 +1266,17 @@ parse_keytypes:
1264 *log_level_ptr = (LogLevel) value; 1266 *log_level_ptr = (LogLevel) value;
1265 break; 1267 break;
1266 1268
1269 case oLogFacility:
1270 log_facility_ptr = &options->log_facility;
1271 arg = strdelim(&s);
1272 value = log_facility_number(arg);
1273 if (value == SYSLOG_FACILITY_NOT_SET)
1274 fatal("%.200s line %d: unsupported log facility '%s'",
1275 filename, linenum, arg ? arg : "<NONE>");
1276 if (*log_facility_ptr == -1)
1277 *log_facility_ptr = (SyslogFacility) value;
1278 break;
1279
1267 case oLocalForward: 1280 case oLocalForward:
1268 case oRemoteForward: 1281 case oRemoteForward:
1269 case oDynamicForward: 1282 case oDynamicForward:
@@ -1838,6 +1851,7 @@ initialize_options(Options * options)
1838 options->num_local_forwards = 0; 1851 options->num_local_forwards = 0;
1839 options->remote_forwards = NULL; 1852 options->remote_forwards = NULL;
1840 options->num_remote_forwards = 0; 1853 options->num_remote_forwards = 0;
1854 options->log_facility = SYSLOG_FACILITY_NOT_SET;
1841 options->log_level = SYSLOG_LEVEL_NOT_SET; 1855 options->log_level = SYSLOG_LEVEL_NOT_SET;
1842 options->preferred_authentications = NULL; 1856 options->preferred_authentications = NULL;
1843 options->bind_address = NULL; 1857 options->bind_address = NULL;
@@ -2014,6 +2028,8 @@ fill_default_options(Options * options)
2014 } 2028 }
2015 if (options->log_level == SYSLOG_LEVEL_NOT_SET) 2029 if (options->log_level == SYSLOG_LEVEL_NOT_SET)
2016 options->log_level = SYSLOG_LEVEL_INFO; 2030 options->log_level = SYSLOG_LEVEL_INFO;
2031 if (options->log_facility == SYSLOG_FACILITY_NOT_SET)
2032 options->log_facility = SYSLOG_FACILITY_USER;
2017 if (options->no_host_authentication_for_localhost == - 1) 2033 if (options->no_host_authentication_for_localhost == - 1)
2018 options->no_host_authentication_for_localhost = 0; 2034 options->no_host_authentication_for_localhost = 0;
2019 if (options->identities_only == -1) 2035 if (options->identities_only == -1)