Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5/f/cfg tree final fix #26

Closed
wants to merge 24 commits into from
Closed

3.5/f/cfg tree final fix #26

wants to merge 24 commits into from

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Dec 1, 2013

This should fix a config compilation problem, and affects both 3.4 and 3.5, and probably be fixed in both.

@algernon: could you please apply this to both 3.4 and 3.5? The bug was reported on the mailing list two weeks ago with the subject: [syslog-ng] syslog-ng 3.5.1 - question about flags(final)...

I'm integrating the same fix to 3.6/master. Thanks.

algernon and others added 24 commits November 21, 2013 13:33
On Linux 3.2, /dev/kmsg is present, is seekable, is pollable with
poll(), but not with epoll(). This leads to a run-time abort, because
syslog-ng can't monitor the file in this case. To fix the situation,
tighten the requirements in system-source, and check not only for
seekability, but pollability too.

Reported-by: Martin Bagge / brother <brother@bsnet.se>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Using /dev/pipe on HP-UX was a mistake, use /dev/log instead, as the
original shell script did.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
It should look for files under both ${top_srcdir} and ${top_builddir},
not twice at the same place.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
The afstreams module has been broken for more than a year, this patch
brings it back from the dead by migrating it to newer APIs and all.

Based on a patch by Balazs Scheidler <bazsi@balabit.hu>.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
On Solaris, uname() can return any positive value, and that indicates
success. Pretty much everywhere else, only 0 does. Thankfully, -1
signals failure everywhere, so check for that.

This makes system() work on Solaris again.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
When syslog-ng creates a pipe, create it with user-specified permissions
or restrictive ones (0600) by default, instead of creating it with broad
read-write permissions (0666) and patching it up later.

Signed-off-by: Budai Laszlo <lbudai@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
On HPUX, during boot the console does not considered as a tty, so syslog-ng does not
call setsid, the tty is not detached and the supervisor is killed at the end of the boot.
setsid() does not and should not depend on isatty(), and anyways setsid() is considered
more unix way than ioctl().

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Viktor Tusa <tusa@balabit.hu>
Signed-off-by: Daniel Gados <gdani@balabit.hu>
The old key was leaked when renaming a persist-state key. This patch fixes
that leak.

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
…n persist_state_load_v4

Signed-off-by: Viktor Juhasz <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
When stats-level() is changed and syslog-ng is reloaded, an assertion failed
in the facility counters unregistration. The reason was that
the unregistration used the 'other' category instead of the one assigned
to the given facility code.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Update the Travis-CI control file for the new branch structure.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
The Linux kernel used to have a bug that caused the afuser driver
to block even if O_NONBLOCK is set in the open flags. It was fixed
a long time ago, and alarm() is incompatible with multithreaded programs,
thus get rid off the alarm() call to detect blocked ttys.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Rearrange the README a little bit, putting the source installation docs
at the top, adding more links, and rewording a few things here and
there.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
When building test programs (anything in ${check_PROGRAMS}) add
-no-install to the list of LDFLAGS, so that libtool stops generating a
useless wrapper for them. This makes debugging the check programs
easier, and also avoids a lot of shell launching for no good reason.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
On 32-bit platforms, explicitly cast struct timeval members to 64-bit,
so the time difference calculations will not be truncated.

Reported-by: Jakub Wilk <jwilk@debian.org>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
The host() and port() options were not declared in the parser, only in
the grammar, thus using them led to a syntax error. Declare them for the
parser too.

Reported-by: Otto Berger <otto@bergerdata.de>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
When the message is not local, do not override - or set - the value of
PROGRAM, there's other ways to do that. Doing an unconditional setting
breaks setups where kernel messages are forwarded between syslog-ng
instances:

The first syslog-ng sees "<4>Some message..." on /proc/kmsg, sets
PROGRAM to "kernel", and sends it over on tcp as "<4>kernel: Some
message...". The second syslog-ng sees that, from the facility it sees
that it's a kernel message, and sets PROGRAM to kernel again.

But when a message is from the kernel, we don't parse the rest, we don't
extract the program, we treat the rest of the message as MESSAGE, so in
this case, we'd end up with "<4>kernel: kernel: Some message", and each
hop would add another "kernel: ".

If we only set this when the message is local, we avoid this. The
downside is, that on the remote end, PROGRAM will not be set.

Reported-by: Matyas Koszik <koszik@atw.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Since OpenSSL needs some initialization to work properly, link afql to
libsyslog-ng-crypto to do that. If we don't do this, then loading
afsql (or any other module that uses OpenSSL) before anything that uses
libsyslog-ng-crypto (like afsocket) will fail and result in a
segmentation fault.

Affected modules are: afsql, afmongodb and afsmtp.

Reported-by: Imre Lazar <imre@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
NEWS & VERSION updated for 3.5.2.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
…to a destination

This patch adds validation that no extra messages get delivered to
a destination.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
This patch fixes the application of node flags during compilation. Earlier
the node flags were either applied to the first_pipe (normal log paths
lacking a source reference) or the last_pipe (log paths that did contain
source references).

The issue is that due to the compilation of junctions, the last_pipe may
not be reachable through LogPipe->pipe_next list, which is iterated in
log_multiplexer_init() when looking for LC_XXX flags. Rather they are
only reachable through an intermediate LogMultiplexer's next_hop list.

This causes the flags to be missed when evaluating the compiled structure.

This patch tries to apply flags to the first LogPipe ever encountered while
compiling the sequence and only resort to the last_pipe if we don't encounter
anything that would start with a sub_pipe_head.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
…ments

The final flag was incorrectly processed for log statements where it was
specified after a set of embedded log statements.

This adds a testcase that validates that.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
@algernon
Copy link
Contributor

algernon commented Dec 1, 2013

Yep, will pick it for those two tomorrow. Thanks for the notice!

@algernon
Copy link
Contributor

algernon commented Dec 2, 2013

Merged it to 3.5, and cherry-picked the patches to 3.4, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants