summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bump symbol versionsHEADlibumberlog-0.3.0masterGergely Nagy2012-08-131-11/+3
| | | | | | | Since we had an ABI bump, maintaining old symbol versions is pointless unless we'd maintain the SONAME too. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Finalised the release dateGergely Nagy2012-08-131-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Fix a few test casesGergely Nagy2012-08-121-21/+22
| | | | | | | | 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>
* Fix test_perfGergely Nagy2012-08-111-2/+3
| | | | | | | 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>
* Preparations for 0.3.0Gergely Nagy2012-08-112-3/+3
| | | | | | | Bump the version in configure.ac, and the library version in lib/Makefile.am, in preparation for the upcoming 0.3.0 release. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Generate xz compressed dist tarballsGergely Nagy2012-08-111-1/+1
| | | | | | | Bump the automake dependency to 1.11, disable gzip tarballs at make dist time, and make dist-xz the default. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Preparations for 0.3.0.Gergely Nagy2012-08-112-5/+43
| | | | | | | The next version will be 0.3.0, due to the significant - and incompatible - changes made so far. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Test reorganisationGergely Nagy2012-08-112-178/+230
| | | | | | | | | | | | 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>
* LOG_UL_NODISCOVER => LOG_UL_NOIMPLICITGergely Nagy2012-08-117-57/+65
| | | | | | | | 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>
* Support disabling discovery for the LD_PRELOAD variantGergely Nagy2012-08-105-3/+58
| | | | | | | | 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>
* Introduce LOG_UL_ALLGergely Nagy2012-08-102-0/+5
| | | | | | | This new flag for ul_set_log_flags() makes it easier to understand what the default is (0 typically does not mean "enable all"). Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Caching-related documentation updateGergely Nagy2012-08-101-10/+10
| | | | | | | Describe it better how caching works (and also correct a few mistakes that were left over when ul_set_log_flags() was introduced). Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Introduce ul_set_log_flags()Gergely Nagy2012-08-106-110/+180
| | | | | | | | | | | | | | 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>
* Split the library into a linkable and an LD_PRELOAD-able partGergely Nagy2012-08-1010-377/+555
| | | | | | | | | | | | 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>
* TODO.org: Not needed anymore.Gergely Nagy2012-08-101-123/+0
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Documentation updateGergely Nagy2012-08-101-2/+1
| | | | | | | | ul_closelog() does not clear flags anymore, in order to mimic closelog() better, so remove the note about clearing from the API docs. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* travis: Build with both clang & gccGergely Nagy2012-08-101-0/+3
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Greatly simplify ul_openlog()Gergely Nagy2012-08-101-12/+22
| | | | | | | | | | Instead of checking the flags for LOG_UL_NODISCOVER in every branch, check it once in the beginning for LOG_UL_NODISCOVER | LOG_UL_NOCACHE, and bail out early. This greatly improves the readability of the code. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Whitespace & coding style cleanupGergely Nagy2012-08-102-6/+7
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Rebuild libumberlog.la when the link script changesMiloslav Trmač2012-07-301-0/+1
| | | | Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Add an explicit cast to avoid a warningMiloslav Trmač2012-07-301-1/+1
| | | | | | ... with -Wsign-compare. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Remove some unused variables.Miloslav Trmač2012-07-302-4/+1
| | | | Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Add prototypes to old_*Miloslav Trmač2012-07-301-4/+4
| | | | | | to minimize the risk of type mistakes. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix ul_recurse indicator, again.Miloslav Trmač2012-07-301-1/+1
| | | | | | | | Don't reset ul_recurse before exiting a recursive invocation. Apparently I have send this patch before, followed by a patch that immediately reverts it, so resending. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Don't set up caches if UL_NO_DISCOVER is setMiloslav Trmač2012-07-301-4/+4
| | | | | | We won't need the data in that case. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Mark missing host name separately from flags.Miloslav Trmač2012-07-302-7/+15
| | | | | | | | | | | 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>
* Initialize [UG]ID to "no value cached"Miloslav Trmač2012-07-302-3/+11
| | | | | | | 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>
* Mark missing [UG]ID cache data separately from flags.Miloslav Trmač2012-07-301-14/+25
| | | | | | | This simplifies the syslog() path a little, and allows us to express "[UG]ID should be cached but no value is set.". Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix return type of _get_gid ()Miloslav Trmač2012-07-301-1/+1
| | | | Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Initialize PID to "no value cached"Miloslav Trmač2012-07-302-2/+20
| | | | | | | 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>
* Mark missing PID cache data separately from flags.Miloslav Trmač2012-07-301-6/+12
| | | | | | | This simplifies the syslog() path a little, and allows us to express "PID should be cached but no value is set.". Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Move the caches into ul_process_dataMiloslav Trmač2012-07-301-19/+25
| | | | | | None of the cache items is thread-specific. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Don't reset flags on closelog()Miloslav Trmač2012-07-302-1/+11
| | | | ... to be compatible with BSD syslog.
* Make "flags" a per-process variableMiloslav Trmač2012-07-301-12/+12
| | | | | | ... to match openlog(3p). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Default ident (log tag) to program_invocation_short_nameMiloslav Trmač2012-07-303-4/+29
| | | | | | | 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>
* Don't include "program": "(null)" if ident is not setMiloslav Trmač2012-07-302-1/+8
| | | | Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Make "ident" (log tag) a per-process variableMiloslav Trmač2012-07-301-4/+7
| | | | | | ... to comply with openlog(3p). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Don't reset facility on closelog()Miloslav Trmač2012-07-302-5/+2
| | | | | | | This is not defined by closelog(3p), and the BSD implementation doesn't do it either. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Change the default facility to LOG_USER.Miloslav Trmač2012-07-302-2/+22
| | | | | | ... to comply with openlog(3p). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Make "facility" set by ul_openlog() per-processMiloslav Trmač2012-07-302-3/+17
| | | | | | ... to match openlog(3). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Rename ul_sys_settings to ul_thread_dataMiloslav Trmač2012-07-301-25/+25
| | | | | | | | ... to clarify its scope, and account for caches contained there. Next commit will add per-process data, and having the smaller-scope structure named "sys" would be confusing. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* configure.ac: Remove obsolete AC_PROG_RANLIBGergely Nagy2012-07-281-1/+0
| | | | | | | We don't use ranlib directly, libtool can - and does - do the check if it needs to. This stops autoreconf -i from warning about it. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* NEWS: Started adding 0.2.2 itemsGergely Nagy2012-07-191-0/+33
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Leave printf format parsing to glibc if possible.Gergely Nagy2012-07-194-8/+134
| | | | | | | | | | | | | 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>
* Whitespace cleanupGergely Nagy2012-07-191-104/+104
| | | | | | | Replace tabs introduced by the last couple of merged commits with spaces. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Handle more types in printf()-like specifiersMiloslav Trmač2012-07-192-2/+48
| | | | | | | Recognize more length modifiers. Document that positional parameters are not supported (it should be possible, I'm just lazy :)). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Let libc manage the syslog mask.Miloslav Trmač2012-07-181-12/+3
| | | | | | | | | | | | | | | | | | | glibc has a per-process, not per-thread, syslog mask, so the per-thread mask in ul_sys_settings may end up desynchronized from the glibc mask, breaking compatibility for LD_PRELOAD. Just call setlogmask (0) to always read the glibc mask, and drop the per-thread cache. An alternative is to use a per-thread mask for ul_* calls and to use the glibc mask for the LD_PRELOAD-overridden functions, but that seems to be unnecessarily complex. ul_setlogmask () is now a trivial wrapper, so we don't need to override setlogmask () at all. We could also drop ul_setlogmask () completely, but that would break the API. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix ul_recurse indicatorMiloslav Trmač2012-07-181-1/+1
| | | | | | Don't reset ul_recurse before exiting a recursive invocation. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix a memory leak on error pathsMiloslav Trmač2012-07-181-4/+3
| | | | Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* Fix checking of vasprintf() return valueMiloslav Trmač2012-07-181-1/+1
| | | | | | | The (res == NULL) check below should not be necessary per (info libc), but doesn't hurt, so I have left it in. Signed-off-by: Miloslav Trmač <mitr@redhat.com>