The strlcat() and strlcpy() functions are only intended to be used
by syslog.c internally (and syslogd), when building libsyslog.
A user linking with libsyslog may have another library that provides
strlcat() or strlcpy() replacements. We must therefore mark ours as
weak functions so they can be overridden.
This patch also add a convenience library for libsyslog, to control
the build deps. for libsyslog. This is where external dependencies
should be addded (explicitly) when syslog.c is updated from NetBSD.
If you add new deps you likely want to mark them too as weak refs.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Terminate action filename/pipe/host so we don't get any trailing tab or
space character in file or host names.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Update last paragraph, with FSF address
- Drop gratuitous "this file is part of the sysklogd package"
- Fix indentation
- Update copyright years for my own contributions
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch changes the syntax for per-rule log rotation and makes it
possible to have enable log rotation and RFC5424 output formatting.
The new syntax looks like this:
EXPR ACTION ;OPT,OPT,...
Example:
*.notice -/var/log/messages ;rotate=1M:5,RFC5424
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch is a major refactor of the priority and facility parsing in
syslogd. The "new" facilities are taken from FreeBSD and are de facto
interpretations of facilities otherwise "reserved for system use", as
GLIBC syslog.h puts it.
___
... and LOG_CRON_SOL, but only for completness.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Import pidfile() v1.11 from OpenBSD and libite (-lite) project
- Import utimensat() replacement, for systems that don't have it
- Simplify syslogd and klogd program start and PID file creation
- Rip out -i and -I from klogd, uses old PID file functions, and
they're only kill(1) wrappers anyway
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Massive refactor of the .conf file parsing
- Add queue.h v1.43 from OpenBSD, has _SAFE versions unlike GLIBC queue.h
- Use queue.h list macros instead of homegrown linked list
- Adopt NetBSD reconf style; on failure to reload keep old config
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This special build option enabled reading syslog messages from stdin on
syslogd. It also disabled all other standard features of syslogd, which
made it a bit too far from the real thing.
A better approac is to start syslogd with -p /tmp/foo and let a test
application, e.g. logger -u /tmp/foo, connect using the standard UNIX
domain socket API.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This massive patch brings support for parsing incoming syslog messages,
remote or local, to determine if format is RFC5424 or the older RFC3164.
For logging syslogd currently defaults to RFC3164 for local files and
supports RFC5424 for sending to remote servers.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We want to use -b for binding to an address:port, like FreeBSD/NetBSD
supports using this option. Unfortunately breaks existing setups in
the wild already.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
We don't need to carry it any longer. Anyone who wants to read them can
access an older GIT version, or released tarball.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The '-n' option is commonly used for remote servers, so let's
consolidate the log rotation under the '-r' flag instead, with
the same syntax as previously established in syslog.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch merges the upstream NetBSD syslog.[ch], which adds syslogp()
family of APIs to support RFC5424. This API will first go into use in
the logger tool, klogd, and syslog_tst, then it will also be exposed
as libsyslog and syslog/syslog.h for end-users.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>