Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Oct 2004 17:39:17 +0200
From:      Andrea Campi <andrea+freebsd_cvs@webcom.it>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/gen syslog.c
Message-ID:  <20041009153916.GA2003@webcom.it>
In-Reply-To: <200410082115.i98LFLMU034965@repoman.freebsd.org>
References:  <200410082115.i98LFLMU034965@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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);


Bye,
	Andrea
-- 
           Intel: where Quality is job number 0.9998782345!



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