summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Implement string escaping.Gergely Nagy2012-04-133-8/+166
| | | | | | | | | | | | With this patch, both JSON keys and values will be properly escaped. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * Fix ul_buffer_finalize().Gergely Nagy2012-04-131-2/+3
| | | | | | | | | | | | | | ul_buffer_finalize() was off by one, and instead of overriding the trailing ",", it overwrote the trailing nul-byte. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
| * Format JSON ourselves, without json-c.Gergely Nagy2012-04-136-84/+204
|/ | | | | | | | | | | To make the library thinner, we now format JSON ourselves: there was so little we used from json-c, that doing it ourselves is lighter and faster. With this commit, we have the architecture in place, with only a few little things remaining to be done, such as escaping string values. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* t/: Add a new performance test.Gergely Nagy2012-04-132-1/+74
| | | | | | | The new test case always succeeds, it's purpose is to echo the performance results. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO.org: Add a note about removing the json-c dependency.Gergely Nagy2012-04-111-0/+9
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* configure.ac: Bump version to 0.1.2.libumberlog-0.1.2Gergely Nagy2012-04-081-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Properly handle va_lists, by copying.Gergely Nagy2012-04-083-6/+117
| | | | | | | | | | | | Up until now, the library abused that passing va_list around without copying works on various architectures. On others, that does not. To remedy the issue, the library now parses format strings itself, and copies va_list. This makes it work on all architectures, independent on the internal implementation of va_list, and preserves both API and ABI. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO.org: Add a note about va_copy()Gergely Nagy2012-04-031-0/+7
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Add the logo to the source tree.libumberlog-0.1.1Gergely Nagy2012-04-025-1/+330
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* 0.1.1 release notes.Gergely Nagy2012-04-022-1/+14
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Override __syslog_chk if present, always.Gergely Nagy2012-04-022-21/+3
| | | | | | | Always override __syslog_chk if it is supported by the system, instead of only overriding it if using fortification. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* NEWS: New filelibumberlog-0.1.0Gergely Nagy2012-03-262-1/+6
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Put the man page in section 3, instead of 1Gergely Nagy2012-03-241-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Include the linker script and the API docs in the dist tarball.Gergely Nagy2012-03-241-0/+2
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Fix infinite recursion on FreeBSD.Gergely Nagy2012-03-241-1/+20
| | | | | | | | | | | | | | On FreeBSD, syslog() calls vsyslog(), our own replacement version. So when from syslog(), we call our vsyslog(), which calls the old syslog(), that ends up calling our own vsyslog() again. To work around this issue, use a thread-local static variable that signals whether we're recursing, and if we are, then call the old vsyslog from the new one, thus breaking the loop. This makes the library function correctly on FreeBSD too. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* More portability fixesGergely Nagy2012-03-242-1/+13
| | | | | | | | | | While on glibc-based systems, we need -ldl (for dlopen) and -lrt (for clock_gettime), FreeBSD has both in libc, and does not have these extra libraries. Teach configure about this. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Portability fixesGergely Nagy2012-03-242-5/+5
| | | | | | | | 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>
* README: Yet more updatesGergely Nagy2012-03-241-26/+25
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README: Major update.Gergely Nagy2012-03-241-22/+70
| | | | | | A major update, to make it more README-like, and less dry. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Allow compilation with clang, too.Gergely Nagy2012-03-241-0/+2
| | | | | | | Clang tries to expand the syslog and vsyslog macros when we define our overrides. To work around that, #undef them first. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement proper error handling.Gergely Nagy2012-03-243-63/+139
| | | | | | | | | | | | | | | | Instead of calling abort() if vasprintf() fails, and ignoring possible errors from the JSON library, do handle errors reasonably sanely: check return values, and return an error state from all functions, and propagate it up to the application level, too. This means that the legacy overrides will silently fail, but set errno appropriately in case serializing to JSON fails, and do what the system libc does with syslog otherwise. The new functions can return NULL or non-zero on error, which the application can then handle as it sees fit. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Mark a few internal functions inline.Gergely Nagy2012-03-241-5/+5
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Fix a formatting mistake in the API docs.Gergely Nagy2012-03-231-2/+2
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* .gitignore: Follow the project renameGergely Nagy2012-03-231-2/+2
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Convert the manual page from roff to rst.Gergely Nagy2012-03-233-213/+139
| | | | | | | The advantage of ReStructuredText is that this allows converting the same source into different formats, such as HTML. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Rename the project to libumberlogGergely Nagy2012-03-2312-203/+200
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* .gitignore updatesGergely Nagy2012-03-221-0/+8
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement wrappers for __syslog_chk, when appropriate.Gergely Nagy2012-03-221-0/+33
| | | | | | | | | | | | | When compiled with __USE_FORTIFY_LEVEL, software using <syslog.h> will use the __syslog_chk function instead of syslog(), so we need to wrap that too. To do this properly, the library will wrap __syslog_chk when built with fortification, and use that from both the syslog() and the __syslog_chk() overrides. If built without, it will use the standard syslog() function. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Do not version overridden symbols.Gergely Nagy2012-03-221-5/+0
| | | | | | | Versioning overridden symbols kills the ability to LD_PRELOAD the library. Oops! Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO.org updateGergely Nagy2012-03-221-5/+25
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README.rst: Add an usage sectionGergely Nagy2012-03-221-0/+13
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README.rst: We do need json-c, too!Gergely Nagy2012-03-221-2/+3
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Check (v)asprintf() return values.Gergely Nagy2012-03-222-3/+6
| | | | | | | If (v)asprintf() returns an error, abort() away, because we can't possibly proceed. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Hide two inherited symbols with the version script.Gergely Nagy2012-03-221-0/+5
| | | | | | | We inherit facilitynames and prioritynames from syslog.h, but they should not be exported by us. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README updateGergely Nagy2012-03-221-24/+4
| | | | | | | Removed the feature section, it's documented in the manual page, and it's enough to keep that up-to-date in one place. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement and enable symbol versioning.Gergely Nagy2012-03-222-0/+18
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Rename the manual page to libcee-syslog.3Gergely Nagy2012-03-222-1/+1
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* libcee-syslog.pc: Don't add -ldl to Libs.Gergely Nagy2012-03-221-1/+1
| | | | | | | libcee-syslog is linked against -ldl, no need to add it to the pkg-config .pc file's Libs: too. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Add a manual page.Gergely Nagy2012-03-223-2/+220
| | | | | | | Wrote a manual page explaining the new functions, and also mentioning the few we override. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO updateGergely Nagy2012-03-211-0/+7
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Add the timestamp to the JSON payload too.Gergely Nagy2012-03-216-3/+62
| | | | | | Add high-precision timestamp to the JSON payload (unless disabled). Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* configure: Update with a few more checks.Gergely Nagy2012-03-211-2/+4
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Include the hostname in the JSON payload.Gergely Nagy2012-03-213-1/+24
| | | | | | | 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>
* Export the syslog() wrapper as cee_legacy_syslog()Gergely Nagy2012-03-212-5/+9
| | | | | | | For documentation purposes, and for clarity, export the syslog() wrappers under a sensible name. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* TODO updateGergely Nagy2012-03-201-8/+10
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* README: Remove the list of additional fields.Gergely Nagy2012-03-201-5/+1
| | | | | | | | The list of additional fields will be maintained elsewhere in the documentation (in the man page), remove it from the README, as it was outdated anyway. Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* t: Make sure that discovered fields override supplied ones.Gergely Nagy2012-03-201-0/+31
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement a test suite.Gergely Nagy2012-03-206-4/+151
| | | | | | | | 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>
* TODO updateGergely Nagy2012-03-201-1/+3
| | | | Signed-off-by: Gergely Nagy <algernon@balabit.hu>
* Implement UID/GID discovery.Gergely Nagy2012-03-203-4/+32
| | | | | | | | | | | We now cache the uid and gid upon openlog(), and add it to the automatic fields unless discovery is disabled. The caching can be turned off by passing either the LOG_CEE_NOCACHE or the LOG_CEE_NOCACHE_UID flag to openlog(). The latter also disables caching the gid. Signed-off-by: Gergely Nagy <algernon@balabit.hu>