From owner-freebsd-bugs@FreeBSD.ORG Sun Oct 30 07:30:17 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EEFC16A41F for ; Sun, 30 Oct 2005 07:30:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7AF6543D4C for ; Sun, 30 Oct 2005 07:30:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9U7UGIZ081982 for ; Sun, 30 Oct 2005 07:30:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9U7UGWI081981; Sun, 30 Oct 2005 07:30:16 GMT (envelope-from gnats) Resent-Date: Sun, 30 Oct 2005 07:30:16 GMT Resent-Message-Id: <200510300730.j9U7UGWI081981@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Daniel Molina Wegener Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23F0C16A41F for ; Sun, 30 Oct 2005 07:22:20 +0000 (GMT) (envelope-from dmw@unete.cl) Received: from qmail2.ifxnetworks.com (qmail2.ifxnetworks.com [200.110.128.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9252743D48 for ; Sun, 30 Oct 2005 07:22:19 +0000 (GMT) (envelope-from dmw@unete.cl) Received: (qmail 19352 invoked from network); 30 Oct 2005 07:22:19 -0000 Received: from unknown (HELO hopto.org) ([200.73.29.115]) (envelope-sender ) by qmail2.ifxnetworks.com (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 30 Oct 2005 07:22:08 -0000 Received: from hopto.org (fv7cq6xcvc83a33p@localhost.daemon.cl [127.0.0.1]) by hopto.org (8.13.4/8.13.1) with ESMTP id j9U7MgEH066602 for ; Sun, 30 Oct 2005 04:22:42 -0300 (CLST) (envelope-from dmw@unete.cl) Received: (from dmw@localhost) by hopto.org (8.13.4/8.13.1/Submit) id j9U7Mgjc066601; Sun, 30 Oct 2005 04:22:42 -0300 (CLST) (envelope-from dmw@unete.cl) Message-Id: <200510300722.j9U7Mgjc066601@hopto.org> Date: Sun, 30 Oct 2005 04:22:42 -0300 (CLST) From: Daniel Molina Wegener To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/88215: [PATCH] syslogd does not pass cleanly parameters to cfline() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Molina Wegener List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2005 07:30:17 -0000 >Number: 88215 >Category: bin >Synopsis: [PATCH] syslogd does not pass cleanly parameters to cfline() >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 30 07:30:15 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Daniel Molina Wegener >Release: FreeBSD 5.4-STABLE i386 >Organization: Daniel Molina Wegener >Environment: System: FreeBSD dmw.hopto.org 5.4-STABLE FreeBSD 5.4-STABLE #10: Wed Oct 26 22:37:00 CLST 2005 root@dmw.hopto.org:/usr/obj/usr/src/sys/PHOBOS i386 >Description: In the syslogd function init(), parameters passed to cfline() are not clean when the user attempt to use a remote host entry as the source of syslog messages. Instead of a clean host name, it passes the hostname and the last program specification in the syslog.conf file. >How-To-Repeat: Put any program specification and start syslogd with -vv and -d flags, you can see the parameters passed to cfline() function in a list. >Fix: Apply the next patch from the source tree: --- usr.sbin/syslogd/syslogd.c.dist Sun Oct 30 02:05:56 2005 +++ usr.sbin/syslogd/syslogd.c Sun Oct 30 04:04:10 2005 @@ -1,3 +1,4 @@ +/* -*- mode: c; c-basic-offset: 4; c-default-style: "bsd" -*- */ /* * Copyright (c) 1983, 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -734,7 +735,7 @@ *q++ = '-'; } if (isascii(c) && iscntrl(c)) { - if (c == '\n') { + if (c == '\n' || c == '\r') { *q++ = ' '; } else if (c == '\t') { *q++ = '\t'; @@ -747,7 +748,6 @@ } } *q = '\0'; - logmsg(pri, line, hname, 0); } @@ -1588,6 +1588,7 @@ continue; } if (*p == '+' || *p == '-') { + (void)strlcpy(prog, "*", sizeof(prog)); host[0] = *p++; while (isspace(*p)) p++; @@ -1607,6 +1608,7 @@ continue; } if (*p == '!') { + (void)strlcpy(host, "*", sizeof(host)); p++; while (isspace(*p)) p++; if ((!*p) || (*p == '*')) { >Release-Note: >Audit-Trail: >Unformatted: