From owner-cvs-src@FreeBSD.ORG Sat Oct 9 19:07:16 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A8FE616A4CE; Sat, 9 Oct 2004 19:07:15 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id i99J7FQk003413; Sat, 9 Oct 2004 15:07:15 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i99J7EdL003412; Sat, 9 Oct 2004 15:07:14 -0400 (EDT) (envelope-from green) Date: Sat, 9 Oct 2004 15:07:14 -0400 From: Brian Fundakowski Feldman To: Andrea Campi Message-ID: <20041009190714.GB1093@green.homeunix.org> References: <200410082115.i98LFLMU034965@repoman.freebsd.org> <20041009153916.GA2003@webcom.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041009153916.GA2003@webcom.it> User-Agent: Mutt/1.5.6i cc: cvs-src@FreeBSD.org cc: Gleb Smirnoff cc: cvs-all@FreeBSD.org cc: src-committers@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/gen syslog.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 19:07:16 -0000 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. \,,,,,,,,,,,,,,,,,,,,,,\