From owner-svn-src-all@freebsd.org Tue Nov 8 17:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BBEFC36128; Tue, 8 Nov 2016 17:02:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8BE5168; Tue, 8 Nov 2016 17:02:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f65.google.com with SMTP id q124so17647364itd.1; Tue, 08 Nov 2016 09:02:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=1h6CyAP0NZAbZxKbamt51kO99EwBgSACHhFh82A9t2c=; b=Da53ZpSGqlbNTF+tvLCS1CRT7iI9zCOvtPx/HvAAvca+geQCQVfanipaZmyGuRAW1F ftztNozNlhTHFDx/TZOZ2ItBlWssjRVXzdXwJfNYmepnrKcKnjS+S6c8B2JRmsBujCeN nbVtyD8lSqmgcr+pW6+P2RbcVFh0FBc6D4BwaN6tqMy4UOL5IR4EilPra4YNb7lA2GYC xBEfdYrdC6Tf2NOeaOD/PjdIAGN8U8dlrVuFsxI0N+I9wvZeTxz7fSkdbSsjGYxbcUXC xdtSGVZtM1uCdrrfGVaD1puVh2aspj4+7I48Xn/53qwLV7u1+5+YE5r8hix106qtXc/u ITXw== X-Gm-Message-State: ABUngvd1F0+1fC8Orr767dxU+Smt/A4XFTisglhThd8IKwsOb0uR4R4jmjLb0qD94wW2Zg== X-Received: by 10.36.53.138 with SMTP id k132mr11501418ita.28.1478623859941; Tue, 08 Nov 2016 08:50:59 -0800 (PST) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id c101sm12360077ioj.25.2016.11.08.08.50.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 08:50:59 -0800 (PST) Received: by mail-it0-f48.google.com with SMTP id q124so109984669itd.1; Tue, 08 Nov 2016 08:50:59 -0800 (PST) X-Received: by 10.107.16.170 with SMTP id 42mr13158183ioq.93.1478623856804; Tue, 08 Nov 2016 08:50:56 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.199 with HTTP; Tue, 8 Nov 2016 08:50:56 -0800 (PST) In-Reply-To: <201611010141.uA11fOPS086073@repo.freebsd.org> References: <201611010141.uA11fOPS086073@repo.freebsd.org> From: Conrad Meyer Date: Tue, 8 Nov 2016 08:50:56 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r308160 - in head: etc etc/mtree usr.sbin/syslogd To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 17:02:38 -0000 On Mon, Oct 31, 2016 at 6:41 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Nov 1 01:41:24 2016 > New Revision: 308160 > URL: https://svnweb.freebsd.org/changeset/base/308160 > > Log: > syslogd(8): add an 'include' keyword > > All the '.conf' files not beginning with a '.' contained int he directory > following the keyword will be included. > > This keyword can only be used in the first level configuration files. > > Modify the default syslogd.conf to 'include' /etc/syslog.d and > /usr/local/etc/syslog.d > > It simplify a lot handling of syslog from automation tools. This breaks some paths in init(), as pointed out by Coverity (CID 1365665). See inline below. >... > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================================== > --- head/usr.sbin/syslogd/syslogd.c Tue Nov 1 01:19:48 2016 (r308159) > +++ head/usr.sbin/syslogd/syslogd.c Tue Nov 1 01:41:24 2016 (r308160) > ... > @@ -1601,6 +1604,157 @@ die(int signo) > ... > /* > * INIT -- Initialize syslogd from configuration table > */ > @@ -1611,9 +1765,6 @@ init(int signo) > FILE *cf; > struct filed *f, *next, **nextp; > char *p; > - char cline[LINE_MAX]; > - char prog[LINE_MAX]; > - char host[MAXHOSTNAMELEN]; > char oldLocalHostName[MAXHOSTNAMELEN]; > char hostMsg[2*MAXHOSTNAMELEN+40]; > char bootfileMsg[LINE_MAX]; > @@ -1684,7 +1835,6 @@ init(int signo) > free((char *)f); > } > Files = NULL; > - nextp = &Files; This line leaves nextp uninitialized in init(). > > /* open the configuration file */ > if ((cf = fopen(ConfFile, "r")) == NULL) { Nextp is used in init() between these two hunks: 1838 1839 /* open the configuration file */ 1840 if ((cf = fopen(ConfFile, "r")) == NULL) { 1841 dprintf("cannot open %s\n", ConfFile); 1842 *nextp = (struct filed *)calloc(1, sizeof(*f)); <<<< now bogus 1843 if (*nextp == NULL) { 1844 logerror("calloc"); 1845 exit(1); 1846 } 1847 cfline("*.ERR\t/dev/console", *nextp, "*", "*"); 1848 (*nextp)->f_next = (struct filed *)calloc(1, sizeof(*f)); 1849 if ((*nextp)->f_next == NULL) { 1850 logerror("calloc"); 1851 exit(1); 1852 } 1853 cfline("*.PANIC\t*", (*nextp)->f_next, "*", "*"); 1854 Initialized = 1; 1855 return; 1856 } > @@ -1705,83 +1855,7 @@ init(int signo) > ... Thanks, Conrad