This patch updates the sysklogd local copy of the GPL to the official
new/upstream GPL v2 license.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This applies to both the command line '-b SIZE' option and the
optional per log file setting. Modifiers supported are: k, M, G
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
These feature flags are required to build with modern GCC that default
to newser C standard. However, we should never enforce a standard on
the user -- there are far too many old/embedded systems out there with
very old toolchains that just want bug fixes and minor features for an
otherwise stable system.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
May need to build on/for systems with quite old GCC version. Also,
fixes build on Travis-CI. (Enabling C99 brings in a lot of other
warnings that we'll take care of at a later stage.)
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for rotating compressed files as well as
compressing (gzip) all files older than .1.
Props goes to @Znahoj for the first prototype implementation made at
Westermo. Only minor changes to his draft were made.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This enables the same functionality as the old build system, only
slightly more flexible since you don't need to edit the Makefile.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This enables the same functionality as the old build system, only
slightly more flexible since you don't need to edit the Makefile.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
A local variables section must start with /** otherwise Emacs will
prompt the user every time if the settings should be applied.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Basically just removes the #ifdef blocks around the code. With the
feature disabled by defult this should be safe.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Also, remove DEBRELEASE, no longer a package with Debian focus, and add
'v' before version number in logs/usage text.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Relocate all source files to src/ and manual pages to man/
- Replace static Makefile with GNU configure and build system
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When sysklogd is built with SYSLOG_INET the user can now optionally also
define the INET_SUSPEND_TIME. The default is 180 sec, which may be a
bit too long for some systems.
In practice when a system comes up syslogd+klogd starts before all other
processes, even those that bring up the network, so waiting 3 minutes
before trying again to send to a remote syslog server would mean losing
a lot of info from the bootstrapping of a system.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
When used with Finit a daemon is expected to acknowledge SIGHUP
by touching its PID file. Finit can do this by itself, however,
but having native support for this in sysklgod is highly useful.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Port log rotation from BusyBox syslogd, see SYSLOG_ROTATE_FILES.
This adds support for -b and -c options for size and rotate count.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Rainer Gerhards, rsyslog project leader, discovered an issue in rsyslogd
where invalid priority values can trigger DoS and potentially RCE.
As his analysis reveals, the cause of the problem identified in rsyslog's
rsyslogd also exists in sysklogd's syslogd (from which rsyslogd was forked)
and stems from the use of a (LOG_FACMASK|LOG_PRIMASK) mask to detect invalid
priority values.
In sysklogd's syslogd, invalid priority values between 192 and 1023 (directly
or arrived at via overflow wraparound) can propagate through code causing
out-of-bounds access to the f_pmask array within the 'filed' structure by up
to 104 bytes past its end. Though most likely insufficient to reach
unallocated memory because there are around 544 bytes past f_pmask in 'filed'
(mod packing and other differences), incorrect access of fields at higher
positions of the 'filed' structure definition can cause unexpected behavior
including message mis-classification, forwarding issues, message loss,
or other.
This patch imposes a restriction on PRI message parts and requires they
be properly-delimited priority value strings that have non-negative
numerical values not exceeding 191. As before, sysklogd's syslogd permits
zero padding to not break compatibility with RFC-non-compliant loggers that
issue PRIs such as <0091>. Messages without well-formed PRI parts get
logged with priority user.notice (13). (c.f. RFC 3164)
Thanks to Rainer Gerhards for the initial report and analysis.