Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jul 2001 11:42:24 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Andy <andy@tecc.co.uk>, David Malone <dwmalone@FreeBSD.org>
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>
In-Reply-To: <200107021500.f62F0ND66914@freefall.freebsd.org>; from andy@tecc.co.uk on Mon, Jul 02, 2001 at 08:00:23AM -0700
References:  <200107021500.f62F0ND66914@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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  <tab> <tab>  /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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010703114224.B6517>