Date: Tue, 8 Nov 2016 08:50:56 -0800 From: Conrad Meyer <cem@freebsd.org> To: Baptiste Daroussin <bapt@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308160 - in head: etc etc/mtree usr.sbin/syslogd Message-ID: <CAG6CVpWMRwHMi-AUy4DZZxF2%2BSTyJ0kLTqdEaW79OB=JXXDa3w@mail.gmail.com> In-Reply-To: <201611010141.uA11fOPS086073@repo.freebsd.org> References: <201611010141.uA11fOPS086073@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 31, 2016 at 6:41 PM, Baptiste Daroussin <bapt@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpWMRwHMi-AUy4DZZxF2%2BSTyJ0kLTqdEaW79OB=JXXDa3w>