| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
The test_overrides() test must be run first, otherwise we'll already
likely not have a clean environment to test in. Furthermore, when
testing discovery, make sure that NOIMPLICIT is not set.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
| |
test_perf was still relying on the old behaviour of ul_openlog(): no
more, it uses ul_set_log_flags() now.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moved some tests around between test_umberlog and
test_umberlog_preload, so only those tests remain in
test_umberlog_preload that do test something that the LD_PRELOAD lib
variant provides.
Also added a comment above each test to quickly clarify what they're
meant to test.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
| |
Based on a suggestion by Miloslav Trmač <mitr@redhat.com>, rename
LOG_UL_NODISCOVER to LOG_UL_NOIMPLICIT, and clarify the documentation
slightly.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
| |
When compiled with --disable-discovery, the LD_PRELOAD variant will
have automatic field discovery disabled. This does not affect the
linkable library, which always has them enabled by default.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of piggy-backing on ul_openlog(), and accepting new flags at
openlog()-time, use a separate function, ul_set_log_flags() to achieve
the same.
This way, anyone who wants to flip any of the new flags, will have to
use ul_set_log_flags(), as ul_openlog() ignores them from now on.
This is based on work done by Miloslav Trmač <mitr@redhat.com>, and is
both an API and an ABI breakage.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to satisfy the desire of using libumberlog, specifically
ul_format(), without having to worry about syslog() & friends being
overridden, split the library into two parts:
A linkable library, which provides the new API, but does not override
the legacy syslog() functions; and a new, LD_PRELOAD-able part, which
does override the old ones.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
| |
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
| |
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This simplifies the syslog() path a little, and allows us to express
"host name should be cached but no value is set.".
Because host name field is already emptied by default and in closelog (),
this also means uncached data is used before openlog () and after
closelog ().
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
|
| |
Now syslog () without openlog () will include a correct [UG]ID value instead
of 0. Also reset the cache on closelog ().
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
|
| |
Now syslog () without openlog () will include a correct PID value instead
of 0. Also reset the cache on closelog ().
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
| |
... to be compatible with BSD syslog.
|
|
|
|
|
|
|
| |
This is a glibc variable, so leave the "program" field missing on
platforms that don't support it.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
| |
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
|
| |
This is not defined by closelog(3p), and the BSD implementation doesn't
do it either.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
| |
... to comply with openlog(3p).
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Call glibc's parse_printf_format() to gather information about
argument types. This automatically handles positional parameters and
user-defined printf formats for ordinary parameter types; it doesn't
handle user-defined printf parameter types (such as defined by libdfp
for decimal floating-point).
Also add a (non-comprehensive) test.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
| |
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
| |
... now that \f does not break the test.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
|
|
|
|
|
|
| |
This marginally speeds up build, and simplifies debugging/valgrind runs
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
|
|
|
| |
While assert() is a neat tool, it is not really suitable for testing,
as it gives hardly any indication on what part of the test suite
failed, and why.
For this purpose, an existing testing library, such as Check is a much
better option, so lets use that!
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our openlog() wrapper fills in a couple of variables, and those were
kept around even after a closelog(), and thus, affected ul_format()
calls even after a closelog().
This in turn, made one of the test cases fail, as that was relying on
the default behaviour, which was modified due to an openlog() in an
earlier test case.
We now wrap closelog() aswell, and NULL out our settings to get a
clean state, and add a test case to verify this behaviour aswell.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The priority passed to the syslog() call can contain a facility
embedded, so we need to extract it to find both the facility and the
priority.
This also means that the facility set at openlog()-time can be
overridden later, so _find_facility() has to take the priority value
into account.
This patch makes libumberlog do just the above: extract both priority
and facility from the priority passed to syslog(), and if facility is
0, use the default set at openlog()-time, if any.
Added a test case to test this expected behaviour.
Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
| |
When json-c is not found, instead of failing at configure time,
continue, but disable the test suite.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
| |
With this patch, both JSON keys and values will be properly escaped.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
| |
The new test case always succeeds, it's purpose is to echo the
performance results.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
|
| |
Use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX: both Linux and
FreeBSD have the former, but FreeBSD does not have HOST_NAME_MAX in
limits.h
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
| |
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
| |
If (v)asprintf() returns an error, abort() away, because we can't
possibly proceed.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
| |
Add high-precision timestamp to the JSON payload (unless disabled).
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
|
|
|
| |
Include the hostname (as returned by gethostname()) in the JSON
payload. Test case updated to verify this.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
|
|
| |
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|
|
The test suite uses cee_format() to format the messages, and parses
the resulting string back into JSON, and verifies that certain key
values are what we expect them to be.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
|