From 8b5fd3e9d6e8dd45f58a36d26f6b5aa0414cc283 Mon Sep 17 00:00:00 2001 From: woodsb02 Date: Sat, 10 Nov 2018 10:46:38 +0000 Subject: [PATCH] newsyslog.conf: Restrict included files in default config to [!.]*.conf The new default config will only include files from the following directories which end with '.conf' and do not beginning with a '.' character: - /etc/newsyslog.conf.d/ - /usr/local/etc/newsyslog.conf.d/ This matches the syslog.conf(5) functionality, and also prevents '.sample' or '.pkgnew' files being included. This is important for ports which install files in /usr/local/etc/newsyslog.conf.d/ and also for pkgbase. Approved by: eadler Approved by: bapt Relnotes: yes Differential Revision: https://reviews.freebsd.org/D17086 --- usr.sbin/newsyslog/newsyslog.8 | 8 +++++--- usr.sbin/newsyslog/newsyslog.conf | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/usr.sbin/newsyslog/newsyslog.8 b/usr.sbin/newsyslog/newsyslog.8 index e06791d5892..a85f8ac7054 100644 --- a/usr.sbin/newsyslog/newsyslog.8 +++ b/usr.sbin/newsyslog/newsyslog.8 @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd July 19, 2018 +.Dd November 10, 2018 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -268,10 +268,12 @@ will examine all files listed in the configuration file. .Nm configuration file .It Pa /etc/newsyslog.conf.d -Each file in this directory will be included by the default +By default each file in this directory ending in '.conf' and not beginning with +a '.' will be included by the default .Pa newsyslog.conf . .It Pa /usr/local/etc/newsyslog.conf.d -Each file in this directory will be included by the default +By default each file in this directory ending in '.conf' and not beginning with +a '.' will be included by the default .Pa newsyslog.conf . .El .Sh COMPATIBILITY diff --git a/usr.sbin/newsyslog/newsyslog.conf b/usr.sbin/newsyslog/newsyslog.conf index 51ac310ed44..43528a9a2b1 100644 --- a/usr.sbin/newsyslog/newsyslog.conf +++ b/usr.sbin/newsyslog/newsyslog.conf @@ -31,5 +31,5 @@ /var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 * $W6D0 JN - /etc/newsyslog.conf.d/* - /usr/local/etc/newsyslog.conf.d/* + /etc/newsyslog.conf.d/[!.]*.conf + /usr/local/etc/newsyslog.conf.d/[!.]*.conf -- 2.45.0