|
From: Helen F. <hel...@gm...> - 2016-03-31 22:55:13
|
I can see 2 bugs in LIRC's logprintf. The first problem is with inconsistent checks for whether the priority fits. log_debug, log_trace etc are macros in lirc_log.h which call logprintf only if the priority fits with the current log level. logprintf, in lirc_log.h says "Write a message to log", and in lirc_log.c says "Prints the log request to the log, if the priority fits." If logging to a file, logprintf only adds the message if the priority fits. If using syslog, it adds the message regardless of priority. The second problem is, if using syslog, logprintf passes the prio parameter onto the vsyslog function without checking it first. If prio > 7 (less important than LOG_DEBUG), it should be changed to LOG_DEBUG=7. vsyslog takes the bottom 3 bits as the priority, so numbers greater than 7 wrap around. LIRC_TRACE2=10 -> LOG_CRIT=2 LIRC_TRACE1=9 -> LOG_ALERT=1 LIRC_TRACE=8 -> LOG_EMERG=0 So LIRC's trace messages are becoming emergencies when passed to syslog, and hence the broadcast message spam on Fedora. |