freebsd-dev/usr.sbin/newsyslog
Eugene Grosbein 01cf0a1724 newsyslog(8): make configuration parser more robust.
Currently newsyslog supports <include> directive that is used
in our default /etc/newsyslog.conf in the following form:

<include> /usr/local/etc/newsyslog.conf.d/*

While this is suitable for ports installing their own rules
for logs rotation, this also makes newsyslog break entire
processing of all files if it encounters single line it cannot parse.
This includes lines referring to nonexistent username/group for log
ownership, so newsyslog stops calling errx() function in the parser.

With this fix, newsyslog uses warnx() instead of errx() in such cases
to print a warning, recover gracefully and continue with execution.

Among other cases, this unbreaks initial creation of log files
having flag "C" at boot time (newsyslog -CN). This is most important
for systems having RAM-based /var file system like nanobsd(8)-based
that rely on newsyslog to bring system log files into existence.

MFC after:	1 month
2020-06-16 17:45:23 +00:00
..
newsyslog.conf.d
tests Add regression tests for newsyslog.conf's p flag. 2020-03-24 18:16:56 +00:00
extern.h
Makefile
Makefile.depend
newsyslog.8
newsyslog.c newsyslog(8): make configuration parser more robust. 2020-06-16 17:45:23 +00:00
newsyslog.conf
newsyslog.conf.5
pathnames.h
ptimes.c newsyslog: Add fallthrough comments to appease Coverity. 2020-03-24 18:17:10 +00:00