tfgeoip: Handle the failed lookup case gracefully

When a GeoIP lookup fails, do not try to use the result, as trying to
append NULL to a GString results in a GLib warning, which is not nice.

Reported-by: Fabien Wernli
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
system(): Don't use /dev/klog in a FreeBSD jail

When figuring out what to expand system() to, check whether we're in a
jail when running on FreeBSD, and don't include /dev/klog if we are.
This fixes #93.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Merge pull request #99 from algernon/f/system/freebsd-jail

system(): Don't use /dev/klog in a FreeBSD jail
Merge pull request #97 from algernon/h/geoip/fail-gracefully

tfgeoip: Handle the failed lookup case gracefully
syslog-ng.pc.in: Add scldir and datarootdir

The former is primarily for syslog-ng-incubator, the latter is to
silence config.status and for correctness' sake.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Merge pull request #100 from algernon/f/scl/new-variables

syslog-ng.pc.in: Add scldir and datarootdir
dbparser: Validate the current time when ticking

The tick timer did not validate the current time, which could result in
timers being scheduled too far away from the current time.

Systems that have CLOCK_MONOTONIC shouldn't be affected because those do not
go backwards.

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
patterndb: handle time going backwards

When the system time is going backwards, we should try to realign patterndb
time keeping with the system time. To do that, we save the current system
time in last_tick, so an upcoming tick will actually have an effect.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
parse-number: change return value to gint64 instead of glong

Using glong causes potential portability issues as somewhere it is 64bits,
on other platforms it is only 32 bits.

The lexer, which uses the parse-number functions, stores the return value in
gint64, that is always 64 bits, so use that always.

Reported-By: Tamayo, Andres <Andres.Tamayo@viasat.com>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_parse_number: add testcase for a real 64bit value

parse-number had an issue on 32 bit big endian platforms, make sure it is
actually working with 64 bit values, always by adding a testcase that
expects a 64 bit value.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Merge pull request #103 from balabit/h/parse-number-32bit-bigendian-fix

H/parse number 32bit bigendian fix
syslog-ng.pc.in: Move datarootdir higher up

For pkg-config to work correctly, we need to define datarootdir before
using it, so move it higher.

Reported-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>