From owner-freebsd-stable Sat Oct 26 8:27:21 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B719037B401 for ; Sat, 26 Oct 2002 08:27:19 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id A80EA43E42 for ; Sat, 26 Oct 2002 08:27:18 -0700 (PDT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [IPv6:::1]) by lurza.secnetix.de (8.12.6/8.12.5) with ESMTP id g9QFR4in034512 for ; Sat, 26 Oct 2002 17:27:05 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.6/8.12.5/Submit) id g9QFR3G9034511; Sat, 26 Oct 2002 17:27:03 +0200 (CEST) Date: Sat, 26 Oct 2002 17:27:03 +0200 (CEST) Message-Id: <200210261527.g9QFR3G9034511@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG Reply-To: freebsd-stable@FreeBSD.ORG Subject: Re: increasing MAXLINE for syslog In-Reply-To: <20021026224646.A362@grosbein.pp.ru> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.7-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Eugene Grosbein wrote: > On Sat, Oct 26, 2002 at 01:20:24PM +0200, Oliver Fromme wrote: > > Did you inrease the sizes of fmt_cpy[] _and_ tbuf[] > > in src/lib/libc/gen/syslog.c:vsyslog() accordingly? > > Yes, I did that too. I see it's time to show my patches. > [...] Okay, looks good. The syslog(3) function (which is used for local logging by logger(1)) opens a UNIX-domain socket to syslogd and then send(2)s the message to it. The socket(2) manpage says: A SOCK_DGRAM socket supports datagrams (connectionless, unreliable messages of a fixed (typically small) maximum length). And the send(2) manpage: If the message is too long to pass atomically through the underlying protocol, the error EMSGSIZE is returned, and the message is not transmitted. $ sysctl net.local.dgram.maxdgram net.local.dgram.maxdgram: 2048 That would explain that there is a limit, although it is 2 Kb, not 1 Kb ... At least on my machine here. BTW: > - char *stdp, tbuf[2048], fmt_cpy[1024], timbuf[26]; > + char *stdp, tbuf[MAXLINE], fmt_cpy[MAXLINE], timbuf[26]; Note that tbuf should be 1024 bytes larger than fmt_cpy, to account for %m expansions in the message. Regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "All that we see or seem is just a dream within a dream" (E. A. Poe) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message