NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/46613: syslogd is broken



>Number:         46613
>Category:       bin
>Synopsis:       syslogd is broken
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 18 03:25:00 +0000 2012
>Originator:     Valery Ushakov
>Release:        current as of 2012-06-17
>Organization:
>Environment:
>Description:
After installing new current on my machine I see when booting:

Starting syslogd.
Jun 18 06:19:48 felix /netbsd: Copyright (c) 1996, 1997, 1998, 1999, 2000, 
2001, 2002, 2003, 2004, 2005,
Jun 18 06:19:48 felix /netbsd:    2006, 2007, 2008, 2009, 2010, 2011
[...etc...]

After some digging around I tracked it to usr.sbin/syslogd/syslogd.c at 

revision 1.108
date: 2012/06/05 19:33:17;  author: christos;  state: Exp;  lines: +58 -13
Open and write to ttys using non-blocking I/O to prevent DoS when hardware
or software flow control prevents tty writes or when the tty line is too
slow to respond.

One of the hunks in cfline() does

-               if ((f->f_file = open(p, O_WRONLY|O_APPEND, 0)) < 0) {
+               if (isatty(f->f_file)) {
[...]
+               if ((f->f_file = open(p, O_WRONLY|O_APPEND|flags, 0)) < 0) {

In other words, it now checks isatty(f_file) *before* it opens it.


All sort of bad things follow...

>How-To-Repeat:
Boot current.
>Fix:
Redo that change to cfline.



Home | Main Index | Thread Index | Old Index