Syslogd does not properly handle:
1) the ADDDATE flag which is set with -T invocation and when messages
come from the kernel. Other cases where it is set it is ignored
as timestamping is always done (e.g. logmsg_async())
2) the variable found_ts in check_timestamp(). It would determine
whether or not the message had a (possibly valid) timestamp, set
found_ts to true, then ignore that in most cases. If we can't find
a timestamp return.
3) messages without a parsable timestamp should get one when outputting
the BSD syslog format so that a syslog-protocol timestamp isn't
injected (chopped off with BSD syslog length) giving something like:
"2008-11-27T15:0 cisco -: 1790:"
^ time might have been 2008-11-27T15:02:35.296497+11:00
4) syslog protocol version checking only checked for a leading numeral
one (1) then skipped two places (presuming a space). Messages sent
from some sources (e.g. my cisco) may be
"1795: Nov 27 04:12:52: %LINEPROTO-5-..."
which would be chopped to
"95: Nov 27 04:12:52: %LINEPROTO-5-..."
- new syslog protocol api syslogp(3) that supports structured data
and draft-rfc timestamps
- reliable tcp connections with queueing
- encrypted connections
(the utmpentry.c code), specifically with respect to who owns them and
when to free them. Now they're owned by utmpentry.c, only. Abolish the
freeutentries() function, which was the wrong abstraction; add instead
endutentries(), which flushes out the internally managed memory.
Update callers as necessary. Some (e.g. talkd) had been leaking memory;
others (e.g. syslogd) had been accidentally freeing and reloading utmp
more often than necessary. There are a couple untidy bits in users and
rwhod that someone should look after sometime, maybe.
Fixes PR bin/35131, which was about talkd's memory leak.
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry. RedHat has
evidently built all "core system packages" with this option for some time.
This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.
This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros. Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.
Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default. Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
messages received from the network. Useful for collecting logs from
devices which do not have correct time.
Add it to usage.
Document it, also document that syslogd adds a timestamp with the local
time if it does not recognize the original timestamp field. Bump date.
Approved by wrstuden@.
kqueue descriptor, because we set up events after we parse the file.
Unfortuntately, this means that we also have to do the chroot before
we read the config file. But this is OK -- the config file has to be
in the chroot environment anyway, because it has to be able to get to
it after SIGHUP.
Grrr, all because stupid kqueue descriptors are not inherited across
a fork. LAME.
include:
- Extend the syntax of syslog.conf to allow selections of log destinations
by comma-separated lists of program name (including kernel-generated
messages) and originating host name.
- Ability to pipe selected messages through arbitrary filter commands.
- Ability to specify priority comparison operations.
- Improvements to domain name handling.
- Conversion to use kqueue for communication and signal events, eliminating
all unsafe signal handlers.
- Allow spaces as well as tabs in syslog.conf.
- Log kernel printfs at LOG_NOTICE instad of LOG_CRIT.
- Ability to log facility/priority with a log message.
- Reliability improvements.