travis: Control file updates

Restrict branch building to a subset of branches that matter (master,
upstream mirrors and the sandbox), so that packaging branches and
similar don't end up using resources and failed builds all over the
place.

While there, also request IRC notifications.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
cfg-lexer: Handle no-magic includes better, without hiding errors

When the @include pragma was converted to use glob(3), a couple of
problematic cases stopped producing errors: if we had an @include
without any magic, it still went through glob(3), which was set up to
ignore errors (so that @include "/etc/syslog-ng/conf.d/" would work,
even when the directory didn't exist).

This hid errors, and made it possible even for explicit, glob-less
@includes to fail silently, making debugging next to impossible.

To fix this, glob() is now called with GLOB_NOMAGIC, so if the pattern
does not contain any magic, it is returned anyway, whether it exists
or not: and then, it will eventually be tried by the ordinary include
mechanism, and produce a failure there, as it is appropriate.

This way, @include "/foo/*" continues to work, and @include
"/nothing.conf" will fail, as it should: errors are only ignored for
inclusions that contain magic characters.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
cfg-lexer: During glob-based inclusion, only treat ENOENT specially

When including files with glob-magic, treat all errors but ENOENT as
fatal.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
travis: Significant Travis CI control file updates

To fix issues with uninstallable packages, and to follow the official
recommendation, run apt-get update as part of the testing
process. Also, to make testing more reliable, install into $HOME, so
that we do not need sudo for running the tests.

Furthermore, restrict the tested branches to a subset: master,
upstream mirrors, the sandbox and merge-queue branches. While there,
also enable IRC notifications.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
messages.h: check positive feedback loop for debug/trace messages too

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
NEWS: Merge the 3.3.7 RCs, and start finalising the release.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Preparations for 3.3.7

VERSION updated to 3.3.7.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
system(): Use follow-freq(1) on FreeBSD prior to 9.1

FreeBSD prior to 9.1 does not have a kqueue-pollable /dev/klog, so
syslog-ng would fall back to using timers, except that follow-freq()
is explicitly set to zero, also diabling timer-based polling. This has
the effect of making syslog-ng not read from /dev/klog at all.

To work around the issue, on FreeBSD prior to 9.1, use follow-freq(1)
for /dev/klog when using the system() source.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
logreader: Error out when follow-freq is 0, and fd is not pollable

In case an FD is not pollable, but follow-freq is 0, error out,
instead of silently not doing anything.

This is accomplished by breaking out the if (self->pollable_state ==
0) branch out of the big if/else chain, and making it a mandatory step
in the end.

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
reader/writer start-watches code simplification

Rearrange and simplify the pollable_state logic, so that it is easier
to follow.

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
fix a missing XML semantic check in PDBLoader

pattnerndb has failed to check if we are within a rule when trying to
add tags and values, so a patterndb xml containing these elements
outside of a rule element would cause syslog-ng (and pdbtool) to
segfault

Signed-off-by: Balint Kovacs <blint@blint.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Merge remote-tracking branch '3.3/master'

Conflicts:
	.travis.yml
	NEWS
	VERSION
	lib/logwriter.c
	lib/messages.h
	modules/dbparser/tests/test_patterndb.c
	scl/system/generate-system-source.sh