value-pairs: Fix a heavy memory leak

Due to a cherry pick that went wrong, when value-pairs was splitting up
the dot-notation into components, each component was mistakenly
strdup()'d twice. The fix was to remove the stray duplication, that
should have been removed when resolving the cherry-pick conflict.

This closes #183.

Reported-by: Fabien Wernli
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
configure.ac: Improved the linux capability check

The Linux capabilities check was dependent only on the existence of
<sys/capability.h>. While there was a check performed for -lcap and its
usability, if that check failed, linux capability support was never
turned off.

This caused problems on recent FreeBSDs, where the header exists, but -
naturally - the library does not. This patch fixes #175, by modifying
the check to turn off the feature if the library is not available.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
configure.ac: Fix --enable-linux-caps

While fixing the auto-detection of Linux capabilities,
--enable-linux-caps got broken. This patch corrects that, so that both
work now.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
dbparser: Update XML version to 4 in pdbtool merge

When merging patterndb files, output patterndb version 4 XML. This
partially addresses #109.

Requested-by: Fabien Wernli
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Preparations for syslog-ng 3.5.6

Bumped the version in VERSION, and added release notes to NEWS.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
NEWS: Fix a few typos

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
lib/Makefile.am: Change how libsyslog-ng.so is versioned

Instead of using the current VERSION for the soname of the library, use
the first two parts of it as a library major version, and then use
libtool's versioning scheme. Comments explaining how that works were
added to lib/Makefile.am. This fixes #190.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge pull request #191 from algernon/f/3.6/library-versioning

lib/Makefile.am: Change how libsyslog-ng.so is versioned
Merge tag 'v3.5.6' into 3.6/master

syslog-ng 3.5.6 release
NEWS.md: Fix a thinko

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Preparations for syslog-ng 3.6.0alpha2

Bumped the version in VERSION, and added noteworthy changes to NEWS.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
basicfuncs: Use gint64 instead of glong

Since parse_number was modified earlier to always use gint64, on 32 bit
platforms, basicfuncs that used parse_number() were broken, because they
were not migrated to gint64 yet. This patch fixes that, by converting
all relevant glongs to gint64.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
contrib/systemd: Correctly require syslog.socket

In order to make sure that the Journal forwards syslog messages to us,
we need to require syslog.socket. We also do not need to list it as our
own.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
modules: Do not count inserted/sent messages as stored ones.

Stored messages are for only queued messages inside syslog-ng.
Merge pull request #198 from talien/f/do-not-count-inserted-messages-as-stored

modules: Do not count inserted/sent messages as stored ones.

This also fixes #142.
lib/cfg.c: Increase the default flush_lines value

The default setting for flush_lines was 0, which meant different things
to different drivers, but was mostly equal to flush-lines(1).

This addresses the other part of #62.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
logthrdestdrv: Move SEQNUM handling here

Instead of handling SEQNUM in all the various drivers that use
LogThreadedDestDriver, move the functionality into the class itself.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
logthrdestdrv: Implement SEQNUM persistence

With this change, LogThreadedDestDriver will store SEQNUM in the persist
file, so we won't start from one again after a reload or a restart. The
key used for storing is the driver-supplied persist_name plus ".seqnum"
appended.

We do the persisting at deinit, and the loading in driver start. We
can't do it at init time, because the formatting function is not set
there yet. Fortunately, we do not need the SEQNUM between init and
start, so we can do it at a later time.

This fixes #178.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge pull request #200 from algernon/f/3.6/logthr-seqnum

SEQNUM persistence for LogThreadedDestDriver modules
logthrdestdrv: Use log_queue_backlog_*()

Instead of using log_msg_ack() and friends, use the log_queue_backlog
family of functions to accept or drop a message, or to rewind the queue.

All users of LogThreadedDestDriver updated, and now they all use the
same mechanism.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>