From 5285f64fa9fffa30bff31b03d79cde9ddd32fa97 Mon Sep 17 00:00:00 2001 From: pcarana Date: Mon, 15 Jun 2020 18:05:33 -0500 Subject: [PATCH] Syslog facilities 'kern' and 'syslog' aren't supported --- docs/usage.md | 4 ++-- src/config/log_conf.c | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index de6311ad..20402930 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -98,14 +98,14 @@ command: fort [--log.output=syslog|console] [--log.color-output] [--log.file-name-format=global-url|local-path|file-name] - [--log.facility=auth|authpriv|cron|daemon|ftp|kern|lpr|mail|news|syslog|user|uucp|local0|local1|local2|local3|local4|local5|local6|local7] + [--log.facility=auth|authpriv|cron|daemon|ftp|lpr|mail|news|user|uucp|local0|local1|local2|local3|local4|local5|local6|local7] [--log.tag=] [--validation-log.enabled=true|false] [--validation-log.level=error|warning|info|debug] [--validation-log.output=syslog|console] [--validation-log.color-output] [--validation-log.file-name-format=global-url|local-path|file-name] - [--validation-log.facility=auth|authpriv|cron|daemon|ftp|kern|lpr|mail|news|syslog|user|uucp|local0|local1|local2|local3|local4|local5|local6|local7] + [--validation-log.facility=auth|authpriv|cron|daemon|ftp|lpr|mail|news|user|uucp|local0|local1|local2|local3|local4|local5|local6|local7] [--validation-log.tag=] [--rrdp.enabled=true|false] [--rrdp.priority=] diff --git a/src/config/log_conf.c b/src/config/log_conf.c index 5e4a5c59..da598d96 100644 --- a/src/config/log_conf.c +++ b/src/config/log_conf.c @@ -87,9 +87,6 @@ print_log_facility(struct option_field const *field, void *value) char const *str = ""; switch (DEREFERENCE_UINT32(value)) { - case LOG_KERN: - str = LOG_FACILITY_VALUE_KERN; - break; case LOG_USER: str = LOG_FACILITY_VALUE_USER; break; @@ -102,9 +99,6 @@ print_log_facility(struct option_field const *field, void *value) case LOG_AUTH: str = LOG_FACILITY_VALUE_AUTH; break; - case LOG_SYSLOG: - str = LOG_FACILITY_VALUE_SYSLOG; - break; case LOG_LPR: str = LOG_FACILITY_VALUE_LPR; break; @@ -198,16 +192,12 @@ parse_argv_log_facility(struct option_field const *field, char const *str, DEREFERENCE_UINT32(result) = LOG_DAEMON; else if (strcmp(str, LOG_FACILITY_VALUE_FTP) == 0) DEREFERENCE_UINT32(result) = LOG_FTP; - else if (strcmp(str, LOG_FACILITY_VALUE_KERN) == 0) - DEREFERENCE_UINT32(result) = LOG_KERN; else if (strcmp(str, LOG_FACILITY_VALUE_LPR) == 0) DEREFERENCE_UINT32(result) = LOG_LPR; else if (strcmp(str, LOG_FACILITY_VALUE_MAIL) == 0) DEREFERENCE_UINT32(result) = LOG_MAIL; else if (strcmp(str, LOG_FACILITY_VALUE_NEWS) == 0) DEREFERENCE_UINT32(result) = LOG_NEWS; - else if (strcmp(str, LOG_FACILITY_VALUE_SYSLOG) == 0) - DEREFERENCE_UINT32(result) = LOG_SYSLOG; else if (strcmp(str, LOG_FACILITY_VALUE_USER) == 0) DEREFERENCE_UINT32(result) = LOG_USER; else if (strcmp(str, LOG_FACILITY_VALUE_UUCP) == 0) @@ -228,6 +218,10 @@ parse_argv_log_facility(struct option_field const *field, char const *str, DEREFERENCE_UINT32(result) = LOG_LOCAL6; else if (strcmp(str, LOG_FACILITY_VALUE_LOCAL7) == 0) DEREFERENCE_UINT32(result) = LOG_LOCAL7; + else if (strcmp(str, LOG_FACILITY_VALUE_KERN) == 0 || + strcmp(str, LOG_FACILITY_VALUE_SYSLOG) == 0) + return pr_op_err("Unsupported %s: '%s', use another value", + field->name, str); else return pr_op_err("Unknown %s: '%s'", field->name, str); @@ -299,11 +293,9 @@ const struct global_type gt_log_facility = { "|" LOG_FACILITY_VALUE_CRON "|" LOG_FACILITY_VALUE_DAEMON "|" LOG_FACILITY_VALUE_FTP - "|" LOG_FACILITY_VALUE_KERN "|" LOG_FACILITY_VALUE_LPR "|" LOG_FACILITY_VALUE_MAIL "|" LOG_FACILITY_VALUE_NEWS - "|" LOG_FACILITY_VALUE_SYSLOG "|" LOG_FACILITY_VALUE_USER "|" LOG_FACILITY_VALUE_UUCP "|" LOG_FACILITY_VALUE_LOCAL0 -- 2.47.2