This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/963] syslog() does not always NL terminate messages


------- Additional Comments From bazsi at balabit dot hu  2005-06-01 15:14 -------
It does not matter whether it is NL or NUL character, syslog-ng accepts both.

The problem is that sometimes neither NL or NUL is present. For example, 
here is an strace dump of syslog-ng, reading sendmail logs, which is using 
the syslog functions from libc:

read(16, "<20>May 20 07:48:02 sendmail[16668]: j4KEkWOv016668: collect:
premature EOM: unexpected close", 2048) = 93

Notice no \0 or \n

Then the next read

read(16, "<21>May 20 07:48:02 sendmail[16668]: j4KEkWOv016668: collect:
unexpected close on connection from [61.43.165.161],
sender=<Hager@indiatimes.com>\0<22>May 20 07:48:02 sendmail[16668]:
j4KEkWOv016668: from=<Hager@indiatimes.com>, size=0, class=0, nrcpts=1,
proto=SMTP, daemon=MTA, relay=[61.43.165.161]\0", 1955) = 300

A more complete strace dump and the mailing list thread leading to this
bugreport can be found at:

https://lists.balabit.hu/pipermail/syslog-ng/2005-May/007474.html

As I see both sendmail process use the same pid and assuming sendmail is not
threaded (which I don't know for sure these days) I doubt the reason for 
the strace dump above would be caused by some kind of race condition at 
writing the same fd. (and judging the libc code this is protected by a mutex anyway)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW


http://sources.redhat.com/bugzilla/show_bug.cgi?id=963

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]