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

Andrea Campi andrea+freebsd_cvs at webcom.it
Sat Oct 9 08:39:20 PDT 2004


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!


More information about the cvs-all mailing list