pdbtool test: return failure in case an example pattern didn't match

This patch fixes pdbtool test so it returns non-zero as an exit code
in case the supplied example message for a pattern didn't match.

Reported-By: Evan Rempel <erempel@uvic.ca>
Signed-off-by: Balint Kovacs <blint@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
syslog-format: accept RFC5424 NILVALUE in timestamps

RFC5424 states:

In section 6:
TIMESTAMP       = NILVALUE / FULL-DATE "T" FULL-TIME

In section 6.2.3
   A syslog application MUST use the NILVALUE as TIMESTAMP if the syslog
   application is incapable of obtaining system time.

This patch changes syslog-ng to conform to this requirement as it reported
a parse error instead.

Reported-By: Vincent Brillault <spam@lerya.net>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
jsonparser: allow the use of generic parser related options

This opens the possibility to use the template() option to specify
the input for the parser.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Wire in the SCL install/uninstall hooks

With the migration to a monolithic Makefile, the SCL install and
uninstall hooks were not running. This patch wires them back in.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
scl/Makefile.am: Make sure the installed SCLs are user-rwable

When installing the SCLs, make sure they're both readable and writable
by the installing user. This fixes the case of make distcheck combined
with make uninstall, which had these dirs set to read-list only.

Reported-by: Attila Szalay <sasa@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afamqp: Fix the build when AMQP is disabled

When building with --disable-amqp, don't include dummy.c in
BUILT_SOURCES, as that will lead to a build failure.

Reported-by: Tibor Benke <btibi@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Drop the top-level ChangeLog

Drop the generated ChangeLog, for the following reasons:

 * It's not useful, NEWS covers the user-visible changes in a much more
   digestible format, and the git log is available to everyone who wants
   or needs the more fine grained log.
 * The ChangeLog can only be regenerated from a git checkout, which
   makes it hard to remove it when doing distclean.
 * Not removing it at distclean time makes distcheck fail, and working
   around that is more work than the benefit of having ChangeLog at all.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Add support for number unit suffixes

There are a number of cases in the configuration where one needs to set
a size (think buffer sizes), and counting zeroes is extremely annoying
and unintuitive. For this reason, we introduce number unit suffixes for
kilo-, mega- and giga-: K, M, G, respectively (case-insensitive,
optionally followed by a 'b' or 'B', for byte).

Anywhere where you can specify a number, you'll be able to specify one
with a unit suffix from now on:

 log-fifo-size(200M)

A function to parse longs already existed in basic-funcs (tf_parse_int),
which was moved to lib/misc.c now, and enhanced to recognise the unit
suffixes too.

This also closes #28.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
tests: Add unit tests for num_parse_int()

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
autogen.sh: Enforce https URLs

Before initialising submodules recursive, init them non-recursively, and
enforce https URLs in the rabbitmq-c/codegen submodule. This is a
temporary workaround for an internal issue.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
jsonparser: Throw an error when the JSON input is not an object

syslog-ng assumes that the JSON input the parser receives will be an
object, if it is not, we should throw an error. The most likely case is
a miss-parse, we should not try to be clever there, but fail instead
with a sensible message.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
json-parser: When parsing fails, tag the error with the input

When JSON parsing fails with returning a NULL object, add the original
input to the emitted error message, for easier debugging.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afprog: Fix the grammar so that program() source works again

The grammar of the afprog module was a bit flaky, which resulted in
program() sources not being recognised, because the grammar couldn't
properly terminate the sentence, and skipped it instead. By refactoring
the grammar into the same style the program() destination uses, the
problem went away. This closes #34.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
misc: fixed truncated IP addresses set in $HOST

In case getnameinfo() fails to resolve an address, it automatically returns
the numeric IP address without setting an error condition, which messes up
the logic in resolve_sockaddr() and causes the IP address to be truncated if
use_fqdn() is set to no.  This patch instructs getnameinfo() to return
failure instead by passing NI_NAMEREQD in flags.

References: bugzilla #240
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>