cvs commit: src/lib/libc/gen syslog.c

Brian Fundakowski Feldman green at FreeBSD.org
Sat Oct 9 12:07:16 PDT 2004


On Sat, Oct 09, 2004 at 05:39:17PM +0200, Andrea Campi wrote:
> On Fri, Oct 08, 2004 at 09:15:21PM +0000, Gleb Smirnoff wrote:
> > glebius     2004-10-08 21:15:21 UTC
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     lib/libc/gen         syslog.c 
> >   Log:
> >   When send()ing to syslogd return ENOBUFS keep trying until success.
> >   
> >   This fixes a case, when DoSed syslogd completely loses messages.
> 
> Unless I'm missing something, this would make the calling application
> loop for an unbounded time (potentially forever), thus making the DoS
> even more effective. Personally, I've never thought of syslog as a
> reliable service, and I'm quite sure I prefer to lose messages but
> keep my apps running than the opposite. If an application needs a
> failsafe logging mechanism, chances are it will use something else
> anyway.
> 
> What about:
> 
> retry = 1000;
> do {
> 	usleep(1);
> 	if (send(LogFile, tbuf, cnt, 0) >= 0)
> 		break;
> } while (errno == ENOBUFS && retry-- > 0);

I think that this is something very application-dependant, and it's probably
best to implement as a timeout that it specifies.  But why would a DoSed
syslogd lose messages on its end if we're getting ENOBUFS locally?  The
protocol doesn't provide a way to acknowledge reception, does it?


-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green at FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\


More information about the cvs-src mailing list