From owner-cvs-all@FreeBSD.ORG Sat Oct 9 15:39:19 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAD8416A4CE; Sat, 9 Oct 2004 15:39:19 +0000 (GMT) Received: from sardine.webcom.it (gen053.n002.c03.escapebox.net [213.73.82.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64D5243D2D; Sat, 9 Oct 2004 15:39:19 +0000 (GMT) (envelope-from "") Received: from [213.140.22.73] (helo=brian) by webcom.it with asmtp (Exim 3.36 #1) id 1CGJJW-0007cF-00; Sat, 09 Oct 2004 15:39:18 +0000 Date: Sat, 9 Oct 2004 17:39:17 +0200 From: Andrea Campi To: Gleb Smirnoff Message-ID: <20041009153916.GA2003@webcom.it> References: <200410082115.i98LFLMU034965@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410082115.i98LFLMU034965@repoman.freebsd.org> User-Agent: Mutt/1.5.6i Received: from andrea by webcom.it with asmtp (Exim 3.36 #1) id 1CGJJW-0007cF-00; Sat, 09 Oct 2004 15:39:18 +0000 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/gen syslog.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 15:39:20 -0000 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!