From owner-freebsd-bugs Tue Jul 3 1:42:49 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id C321737B401; Tue, 3 Jul 2001 01:42:39 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f638gOX16500; Tue, 3 Jul 2001 11:42:24 +0300 (EEST) (envelope-from ru) Date: Tue, 3 Jul 2001 11:42:24 +0300 From: Ruslan Ermilov To: Andy , David Malone Cc: bug-followup@FreeBSD.org, bugs@FreeBSD.org Subject: Re: bin/28634: Bug in syslogd.c prevents #+hostname working Message-ID: <20010703114224.B6517@sunbay.com> Mail-Followup-To: Andy , David Malone , bug-followup@FreeBSD.org, bugs@FreeBSD.org References: <200107021500.f62F0ND66914@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200107021500.f62F0ND66914@freefall.freebsd.org>; from andy@tecc.co.uk on Mon, Jul 02, 2001 at 08:00:23AM -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Jul 02, 2001 at 08:00:23AM -0700, Andy wrote: > > When using the "log from hostname" function in syslog.conf like:- > > #+hostname > local7.=info /var/log/file > #+* > > fails to log to file correctly, in fact, logs nothing. > Works nice here without your patch, modulo the bug David mentioned. If the sending host is within the same domain, using FQDN for the sending host does not work, unless the following patch is applied. I must admit I don't like how the ``#+'' is currently implemented. For example, it is unclear (and undocumented) from the reading of the manpage, that the -n flag affects the hostname specification in syslog.conf(5). Index: syslogd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/syslogd/syslogd.c,v retrieving revision 1.78 diff -u -p -r1.78 syslogd.c --- syslogd.c 2001/05/21 22:13:55 1.78 +++ syslogd.c 2001/07/03 08:33:54 @@ -1524,8 +1524,12 @@ cfline(line, f, prog, host) /* save hostname if any */ if (host && *host == '*') host = NULL; - if (host) + if (host) { + if ((p = strchr(host, '.')) && + strcasecmp(p + 1, LocalDomain) == 0) + *p = '\0'; f->f_host = strdup(host); + } /* save program name if any */ if (prog && *prog == '*') Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message