pdbtool: fix a double increment within a loop

When displaying debug-csv information, the loop variable was not
only incremented in the for statement, but also within the loop, which
caused an index mismatch when iterating over the dbg_info array

Signed-off-by: Balint Kovacs <blint@blint.hu>
ivykis: updated to 0.30.5
resolve_sockaddr: fixed unsafe use of non-reentrant APIs to resolve IP addresses to names

As it seems the use of the DNS cache hid the fact that we're not thread
safe when resolving IPs to DNS names. This patch attempts to use
getnameinfo() API if available that is thread safe and protects
all other paths with a mutex.

Reported-By: Brian Kroth <bpkroth@gmail.com>
Tested-By: Gergely Nagy <algernon@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
mainloop: #include <iv_event.h>, as we're using it

Reported-by: Ben Lentz <blentz@cswg.com>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
cfg-lexer: Support systems without GLOB_NOMAGIC

GLOB_NOMAGIC is a GNU-ism, and not present on all systems syslog-ng
supports, so for those system, we need a workaround. We can't use
GLOB_NOCHECK, as that would make us have widly different behaviour in
some cases (when there really is a pattern in the @include'd filename).

So, on platforms that do not have GLOB_NOMAGIC, we implement the same
behaviour on our own: if glob() failed with GLOB_NOMATCH, we check if
the filename is a pattern, and if not, add the pattern to the include
list as-is, otherwise silently ignore it.

This means that @include "/etc/syslog-ng/conf.d/*.conf" will work on
these platforms the same way as it does on GNU-enabled ones.

Reported-by: Ben Lentz <blentz@cswg.com>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afsocket: Force syslog() destination to use IPv4

The syslog() source already enforces IPv4, the destination should be
doing the same.

Reported-by: Jan Schaumann <jschauma@netmeister.org>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
[plugin.c] on AIX 5.2 the G_MODULE_SUFFIX contains "so" and the available modules will be empty

correction is that overwrite this define to "a"

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
afsocket: Update sd-daemon.* to systemd 44's version

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
travis: Simplify the config

We don't need a template for the IRC notifications, the default is
good enough.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Make it possible to link crypto stuff directly into libsyslog-ng

There's been a long desire to be able to link libsyslog-ng-crypto
directly into libsyslog-ng, if so desired. To accomplish that, we
introduce a --with-embedded-crypto option to configure, which in turn
produces a WITH_EMBEDDED_CRYPTO automake conditional.

If that conditional is set, then the sources of libsyslog-ng-crypto
get appended to the libsyslog-ng sources, and -crypto is not
built. All users of the -crypto module (afsocket) have been updated to
not try and link in libsyslog-ng-crypto if WITH_EMBEDDED_CRYPTO is
set.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge branch 'upstream/mirror/3.3' into 'merge-queue/3.4'

Conflicts:
	lib/Makefile.am
	lib/plugin.c
cfg: Fix cfg_is_config_version_older()

The function was given a configuration in the cfg argument, tested
that for NULL, but then used the global 'configuration' variable to
compute the config version.

It is very easily possible that the global configuration is NULL, but
cfg isn't, which in this case, led to a segmentation fault.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
syslog-ng-ctl: Fix the linking with modern libtool

The Makefile.am for syslog-ng-ctl relied on lib/gsocket.c and
lib/gsockaddr.c getting compiled to gsocket.lo and gsockaddr.lo,
respectively. This is not always the case, sometimes the library name
gets prepended.

To work around this, add the two source files to syslog_ng_ctl_SOURCES
instead. This way, they'll get compiled again, but the result will
always work, and not rely on fragile convention.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
configure: Add support for GeoIP without pkg-config

If libgeoip is installed without a pkg-config data file, then fall
back to GEOIP_LIBS and GEOIP_CFLAGS, if set.

On systems that do not have the pkg-config data file for libgeoip,
running configure with GEOIP_LIBS and GEOIP_CFLAGS appropriately set,
along with --with-geoip, will enable the module.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
travis: Simplify the config

We only need one apt-get install line, and no template for the IRC
notifications, the default is good enough.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Make it possible to link crypto stuff directly into libsyslog-ng

There's been a long desire to be able to link libsyslog-ng-crypto
directly into libsyslog-ng, if so desired. To accomplish that, we
introduce a --with-embedded-crypto option to configure, which in turn
produces a WITH_EMBEDDED_CRYPTO automake conditional.

If that conditional is set, then the sources of libsyslog-ng-crypto
get appended to the libsyslog-ng sources, and -crypto is not built. In
the non-embedded case CRYPTO_LIBS will be set to
${top_builddir}/lib/libsyslog-ng-crypto.la, otherwise it will be
empty. All users of the -crypto module (afsocket, dbparser &
cryptofuns) have been updated to use $(CRYPTO_LIBS) instead of
hard-coding libsyslog-ng-crypto.la.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Preparations for 3.4.0rc1

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