Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Oct 2004 15:07:14 -0400
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        Andrea Campi <andrea+freebsd_cvs@webcom.it>
Cc:        src-committers@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/gen syslog.c
Message-ID:  <20041009190714.GB1093@green.homeunix.org>
In-Reply-To: <20041009153916.GA2003@webcom.it>
References:  <200410082115.i98LFLMU034965@repoman.freebsd.org> <20041009153916.GA2003@webcom.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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@FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041009190714.GB1093>