]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Syslog facilities 'kern' and 'syslog' aren't supported
authorpcarana <pc.moreno2099@gmail.com>
Mon, 15 Jun 2020 23:05:33 +0000 (18:05 -0500)
committerpcarana <pc.moreno2099@gmail.com>
Mon, 15 Jun 2020 23:05:33 +0000 (18:05 -0500)
docs/usage.md
src/config/log_conf.c

index de6311adf430853e7efaa88f06ee1237c0f063c4..20402930a2e4d14889464cf7e5ac5ce26e948a50 100644 (file)
@@ -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=<string>]
         [--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=<string>]
         [--rrdp.enabled=true|false]
         [--rrdp.priority=<unsigned integer>]
index 5e4a5c59df7dcc5bcb8242b53183278a6482d472..da598d96a9b91c3fe61a3b8f33648c7eb980fa1c 100644 (file)
@@ -87,9 +87,6 @@ print_log_facility(struct option_field const *field, void *value)
        char const *str = "<unknown>";
 
        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