Bug 490897

Summary: syslog does not include a newline when logging to console/tty
Product: Red Hat Enterprise Linux 5 Reporter: Olivier Fourdan <ofourdan>
Component: sysklogdAssignee: Peter Vrabec <pvrabec>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1CC: jonathan, kem, sgrubb, tao
Target Milestone: rcKeywords: Patch, Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:15:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch none

Description Olivier Fourdan 2009-03-18 14:08:26 UTC
Created attachment 335702 [details]
Proposed patch

Description of problem:

The fix for bug #223573 introduced a regression with syslog when logging to the console, no line feed is inserted and all the syslog messages are displayed on a single line.

Version-Release number of selected component (if applicable):

sysklogd-1.4.1-44

How reproducible:

100% reproducible

Steps to Reproduce:
1. Create a user (e.g. "cons")
2. Log syslog messages for that user by modifying syslog.conf to
   
   *.info;mail.none;authpriv.none;cron.none;daemon.warning       cons
   
3. Login as "cons" on a console and observe the messages
  
Actual results:

All messages are printed one after the other on the same line

Expected results:

One line per message

Additional info:

This is a regression that was introduced in sysklogd-1.4.1-40.el5-x86_64 by the fix for the BZ#223573.

An additional field has been added to include priority/facility, but the logging to console has not been modified to include that additional field.

  sysklogd-1.4.1rh/syslogd.c
  @@ -1698,7 +1703,7 @@
        int flags;
        char *msg;
  {
  -      struct iovec iov[6];
  +      struct iovec iov[7];
  [...]
  
  @@ -1859,7 +1907,7 @@
                if (f->f_file == -1)
                        break;
  
  -              if (writev(f->f_file, iov, 6) < 0) {
  +              if (writev(f->f_file, iov, 7) < 0) {
                      int e = errno;

But the same needs to be done for when logging to a tty too.

Proposed patch attached.

Comment 2 RHEL Program Management 2009-03-18 14:21:48 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 8 errata-xmlrpc 2010-03-30 08:15:48 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0211.html