]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Remove logging default severity
authorGreg Hudson <ghudson@mit.edu>
Mon, 8 Jan 2018 16:14:06 +0000 (11:14 -0500)
committerGreg Hudson <ghudson@mit.edu>
Tue, 16 Jan 2018 16:54:20 +0000 (11:54 -0500)
The default severity for syslog outputs was only used for com_err()
messages (which are rare so far), and doesn't really make sense;
severity is a property of an individual message, not of a device.
Remove the severity field in a backward-compatible manner.

ticket: 8630

doc/admin/conf_files/kdc_conf.rst
src/lib/kadm5/logger.c

index 3af1c3796e6b54177ae10616f1a8b788f47f6b92..395907968c2733626189c982e8daf2896f15d359 100644 (file)
@@ -599,19 +599,15 @@ Logging specifications may have the following forms:
 **SYSLOG**\ [\ **:**\ *severity*\ [\ **:**\ *facility*\ ]]
     This causes the daemon's logging messages to go to the system log.
 
-    The severity argument specifies the default severity of system log
-    messages.  This may be any of the following severities supported
-    by the syslog(3) call, minus the ``LOG_`` prefix: **EMERG**,
-    **ALERT**, **CRIT**, **ERR**, **WARNING**, **NOTICE**, **INFO**,
-    and **DEBUG**.
+    For backward compatibility, a severity argument may be specified,
+    and must be specified in order to specify a facility.  This
+    argument will be ignored.
 
     The facility argument specifies the facility under which the
     messages are logged.  This may be any of the following facilities
     supported by the syslog(3) call minus the LOG\_ prefix: **KERN**,
     **USER**, **MAIL**, **DAEMON**, **AUTH**, **LPR**, **NEWS**,
-    **UUCP**, **CRON**, and **LOCAL0** through **LOCAL7**.
-
-    If no severity is specified, the default is **ERR**.  If no
+    **UUCP**, **CRON**, and **LOCAL0** through **LOCAL7**.  If no
     facility is specified, the default is **AUTH**.
 
 In the following example, the logging messages from the KDC will go to
index e113af9d20bd200fd31c6d52b2a6d3054a4e991c..771ab677d4d673fb6deda5da93db7bc841447173 100644 (file)
@@ -116,7 +116,6 @@ struct log_entry {
         } log_file;
         struct log_syslog {
             int         ls_facility;
-            int         ls_severity;
         } log_syslog;
         struct log_device {
             FILE        *ld_filep;
@@ -127,7 +126,6 @@ struct log_entry {
 #define lfu_filep       log_union.log_file.lf_filep
 #define lfu_fname       log_union.log_file.lf_fname
 #define lsu_facility    log_union.log_syslog.ls_facility
-#define lsu_severity    log_union.log_syslog.ls_severity
 #define ldu_filep       log_union.log_device.ld_filep
 #define ldu_devname     log_union.log_device.ld_devname
 
@@ -332,9 +330,8 @@ krb5_klog_init(krb5_context kcontext, char *ename, char *whoami, krb5_boolean do
                 else if (!strncasecmp(cp, "SYSLOG", 6)) {
                     error = 0;
                     log_control.log_entries[i].lsu_facility = LOG_AUTH;
-                    log_control.log_entries[i].lsu_severity = LOG_ERR;
                     /*
-                     * Is there a severify specified?
+                     * Is there a severify (which is now ignored) specified?
                      */
                     if (cp[6] == ':') {
                         /*
@@ -347,41 +344,6 @@ krb5_klog_init(krb5_context kcontext, char *ename, char *whoami, krb5_boolean do
                             cp2++;
                         }
 
-                        /*
-                         * Match a severity.
-                         */
-                        if (!strcasecmp(&cp[7], "ERR")) {
-                            log_control.log_entries[i].lsu_severity = LOG_ERR;
-                        }
-                        else if (!strcasecmp(&cp[7], "EMERG")) {
-                            log_control.log_entries[i].lsu_severity =
-                                LOG_EMERG;
-                        }
-                        else if (!strcasecmp(&cp[7], "ALERT")) {
-                            log_control.log_entries[i].lsu_severity =
-                                LOG_ALERT;
-                        }
-                        else if (!strcasecmp(&cp[7], "CRIT")) {
-                            log_control.log_entries[i].lsu_severity = LOG_CRIT;
-                        }
-                        else if (!strcasecmp(&cp[7], "WARNING")) {
-                            log_control.log_entries[i].lsu_severity =
-                                LOG_WARNING;
-                        }
-                        else if (!strcasecmp(&cp[7], "NOTICE")) {
-                            log_control.log_entries[i].lsu_severity =
-                                LOG_NOTICE;
-                        }
-                        else if (!strcasecmp(&cp[7], "INFO")) {
-                            log_control.log_entries[i].lsu_severity = LOG_INFO;
-                        }
-                        else if (!strcasecmp(&cp[7], "DEBUG")) {
-                            log_control.log_entries[i].lsu_severity =
-                                LOG_DEBUG;
-                        }
-                        else
-                            error = 1;
-
                         /*
                          * If there is a facility present, then parse that.
                          */
@@ -535,7 +497,6 @@ krb5_klog_init(krb5_context kcontext, char *ename, char *whoami, krb5_boolean do
         log_control.log_entries->log_type = K_LOG_SYSLOG;
         log_control.log_entries->log_2free = (krb5_pointer) NULL;
         log_facility = log_control.log_entries->lsu_facility = LOG_AUTH;
-        log_control.log_entries->lsu_severity = LOG_ERR;
         do_openlog = 1;
         log_control.log_nentries = 1;
     }