This patch, apparently, came from the freebsd syslogd.
The patch was subsequently lost although the old Fedora RPM can still
be found.
I took that patch, the current freebsd sources and a dash of salt to
produce a new patch which I have attached.
The patch does two things: it will arrange for syslogd to listen on an
IPv6 socket in addition to the IPv4 socket and it uses getaddrinfo()
and getnameinfo() rather than gethostby[name|addr] and getservbyname.
It would be possible to use a single socket that accepts both IPv6 and
IPv4 datagrams, but this would mean that numeric IPv4 addresses would
be prefixed with ::ffff and this could cause some confusion -- and I'm
also not sure that everything that sysklogd runs on has a dual stack
like that.
I've also introduced the -4, -6 and -A with the same meanings that the
freebsd and rsyslog variants do.
. Changed SOCK_STREAM to SOCK_DGRAM in syslog.c
. klogd will only change the console log level if `-c' is supplied
. syslogd.c by Bill Nottingham <notting@redhat.com>
Um, if the directory is invalid, the bind() call in
create_unix_socket fails. Without the return -1, we return the
invalid fd that we just closed. When syslogd then starts
listening, select goes into a hard loop getting EBADF, IIRC.
. klogd.c by Troels Walsted Hansen <troels@thule.no>
I found a bug in the sysklogd package version 1.4. When it
encounters a zero byte in the kernel logging output, the text
parser enters a busy loop. I came upon it when the 3c59x driver
from kernel 2.4.0 started outputting two zero bytes for the product
code of my laptop's 3Com card. It could be argued that the kernel
should never output zero bytes in the logging info, but obviously
that will happen from time to time.
I fear this bug might be considered a security issue as well, if
the kernel can be coerced to output a zero byte somehow, all kernel
logging will stop.
Wolfgang Oertl <Wolfgang.Oertl@uibk.ac.at> had a similar bugfix
idea
. klogd.c by Thomas Roessler <roessler@does-not-exist.org>
Additionally, the patch prevents LogLine from being invoked with a
negative counter as an argument.
* Changed Greg's e-mail address to represent his current one.
* Shortened line length for kernel logging slightly.
* Corrected return value of AddModule (closes: Bug#30093)
* Finally fixed an error with `-a' processing, thanks to Topi Miettinen
<tom@medialab.sonera.net> (closes: Bug#30462)
from OpenBSD. This provides the additional '-a' argument used for
specifying additional UNIX domain sockets to listen to. This is been
used with chroot()'ed named's for example. An example is described at
http://www.psionic.com/papers/dns.html. This time the patch doesn't
stall syslogd. Thanks to Topi Miettinen <tom@medialab.sonera.net>
(closes: Bug#24893)
syslogd to not accept more sockets after a certain (undefinitve)
time. (opens: Bug#24893)
* The complete code is still present, search for `Bug#24893'
* Commented out `-a' in the syslogd.8 manpage
<F.Potorti@cnuce.cnr.it> (closes: Bug#20903)
* Corrected email address for Shane Alderton (closes: Bug#20765)
* Fixed manpage to not reflect reverse implementated SIGALRM signal
handler (closes: Bug#20647)
* Modified behaviour with including <sys/module.h> (closes: Bug#20556)
* Added correct prototype for llseek() (closes: Bug#20507, Bug#20220)
* Added more log information if problems occurr while reading a system
map file.
* Modified System.map read function to try all possible map files until
a file with matching version is found.
* Added Debian release to klogd
* Switched to fgets() as gets() is not buffer overrun secure.
* Modified loop for detecting the correct system map.