Bug 490897 - syslog does not include a newline when logging to console/tty
Summary: syslog does not include a newline when logging to console/tty
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sysklogd
Version: 5.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-18 14:08 UTC by Olivier Fourdan
Modified: 2018-10-27 14:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:15:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (364 bytes, patch)
2009-03-18 14:08 UTC, Olivier Fourdan
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0211 0 normal SHIPPED_LIVE sysklogd bug fix update 2010-03-29 12:29:55 UTC

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


Note You need to log in before you can comment on or make changes to this bug.