diff -Nru syslog-ng-3.5.2/NEWS syslog-ng-3.5.3/NEWS --- syslog-ng-3.5.2/NEWS 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/NEWS 2013-12-24 19:25:16.000000000 +0000 @@ -1,3 +1,70 @@ +3.5.3 + Tue, 24 Dec 2013 19:53:05 +0100 + + This is the second bug-fix release for the 3.5.x series, with + a number of important changes over the previous release. + Upgrading to this version is highly recommended. + + Bugfixes + ======== + + * Node flag propagation has been fixed, so flags(final) works + the same as it did in 3.3, when embedded log statements are + used too. + + * Improvements were made to the build system, to make it more + reliable when building in parallel. + + * Using the value-pairs() framework, either via the + $(format-json) template function or any of the destinations + that make use of it, will now correctly skip and ignore + empty values, even in SDATA. + + * The configure script will correctly detect newer versions of + json-c too, without compatibility symlinks being present. + + * A file descriptor and memory leak has been fixed in the + syslog() destination. + + * The pdbtool program will warn in test mode when a test + message has no program attribute. [BugZilla #263] + + * If the PID property is overwritten, syslog-ng will now stop + using the cached MSGHDR value, and therefore, use the newly + set PID instead, as it was supposed to. + + * The localport() option of various network destinations has + been restored, and will work correctly now. [BugZilla #266] + + * The upstart service file in contrib has been updated to use + a different process mode (background), as we do not need a + supervisor when running under upstart. This also means that + upstart will be far less confused. + + * Manual pages are now always included in the tarball. + + Credits + ======= + + syslog-ng is developed as a community project, and as such it relies + on volunteers to do the work necessarily to produce syslog-ng. + + Reporting bugs, testing changes, writing code or simply providing + feedback are all important contributions, so please if you are a + user of syslog-ng, contribute. + + These people have helped in this release: + + Andras Mitzki + Balazs Scheidler + Chris Johnson + Fabien Wernli + Gergely Nagy + Lucas McLane + Peter Czanik + Sebastiaan Hoogeveen + Tobias Schwab + 3.5.2 Fri, 29 Nov 2013 17:09:40 +0100 diff -Nru syslog-ng-3.5.2/VERSION syslog-ng-3.5.3/VERSION --- syslog-ng-3.5.2/VERSION 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/VERSION 2013-12-24 19:25:16.000000000 +0000 @@ -1 +1 @@ -3.5.2 +3.5.3 diff -Nru syslog-ng-3.5.2/configure.ac syslog-ng-3.5.3/configure.ac --- syslog-ng-3.5.2/configure.ac 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/configure.ac 2013-12-24 19:25:16.000000000 +0000 @@ -651,7 +651,11 @@ dnl *************************************************************************** if test "x$enable_json" = "xyes" || test "x$enable_json" = "xauto"; then _with_json="yes" - PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION,, [JSON_C_LIBS=""; _with_json="no"]) + PKG_CHECK_MODULES(JSON_C, json-c >= $JSON_C_MIN_VERSION,, [JSON_C_LIBS=""; _with_json="no"]) + if test "x$_with_json" = "xno"; then + _with_json="yes" + PKG_CHECK_MODULES(JSON_C, json >= $JSON_C_MIN_VERSION,, [JSON_C_LIBS=""; _with_json="no"]) + fi if test "x$enable_json" = "xyes" && test "x$_with_json" = "xno"; then AC_MSG_ERROR([Could not find json-c, and json support was explicitly enabled.]) diff -Nru syslog-ng-3.5.2/contrib/upstart/syslog-ng.conf.upstart syslog-ng-3.5.3/contrib/upstart/syslog-ng.conf.upstart --- syslog-ng-3.5.2/contrib/upstart/syslog-ng.conf.upstart 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/contrib/upstart/syslog-ng.conf.upstart 2013-12-24 19:25:16.000000000 +0000 @@ -1,6 +1,6 @@ # syslog-ng - system logging daemon # -# syslog-ng is an replacement for the traditionala syslog daemon, logging messages from applications +# syslog-ng is an replacement for the traditional syslog daemon, logging messages from applications description "system logging daemon" @@ -10,4 +10,4 @@ expect fork respawn -exec syslog-ng +exec syslog-ng --process-mode=background diff -Nru syslog-ng-3.5.2/debian/changelog syslog-ng-3.5.3/debian/changelog --- syslog-ng-3.5.2/debian/changelog 2013-12-02 19:16:38.000000000 +0000 +++ syslog-ng-3.5.3/debian/changelog 2013-12-25 15:44:34.000000000 +0000 @@ -1,3 +1,11 @@ +syslog-ng (3.5.3-1) unstable; urgency=medium + + [ Gergely Nagy ] + * New upstream release. + + Based on 3.5/master, which includes a couple of bison3 fixes. + + -- Gergely Nagy Wed, 25 Dec 2013 15:29:45 +0100 + syslog-ng (3.5.2-1) unstable; urgency=high [ Gergely Nagy ] diff -Nru syslog-ng-3.5.2/debian/patches/debian-changes syslog-ng-3.5.3/debian/patches/debian-changes --- syslog-ng-3.5.2/debian/patches/debian-changes 1970-01-01 00:00:00.000000000 +0000 +++ syslog-ng-3.5.3/debian/patches/debian-changes 2013-12-25 16:09:36.000000000 +0000 @@ -0,0 +1,52 @@ +Description: Debian-specific changes mixed together. + This patch contains all the Debian-specific changes mixed together. To + review them separately, please inspect the Git history (see the + Vcs-Git field in debian/control); the patches against upstream are all + on the patched branch. + . + For more information, please see debian/README.source. +Origin: Debian + +--- syslog-ng-3.5.3.orig/configure.ac ++++ syslog-ng-3.5.3/configure.ac +@@ -271,6 +271,9 @@ if echo "$YACC" | grep bison > /dev/null + if test "$bison_version_major" -lt 2 -o "$bison_version_minor" -lt 4; then + yacc_ok=0 + fi ++ if test "$bison_version_major" -gt 2; then ++ yacc_ok=1 ++ fi + else + yacc_ok=0 + fi +--- syslog-ng-3.5.3.orig/Makefile.am ++++ syslog-ng-3.5.3/Makefile.am +@@ -1,5 +1,6 @@ + SUBDIRS = + AM_MAKEFLAGS = --no-print-directory ++AM_YFLAGS = -Wno-yacc -Wno-other + + AM_TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)" + +--- syslog-ng-3.5.3.orig/Mk/lex-rules.am ++++ syslog-ng-3.5.3/Mk/lex-rules.am +@@ -1,5 +1,5 @@ + %.y: %.ym $(syslog_ng_tools)/merge-grammar.pl $(syslog_ng_tools)/cfg-grammar.y +- $(mkinstalldirs) $(dir $@) ++ $(AM_V_at) $(mkinstalldirs) $(dir $@) + $(AM_V_GEN) $(syslog_ng_tools)/merge-grammar.pl $< > $@ + + .l.c: +--- syslog-ng-3.5.3.orig/lib/cfg-grammar.y ++++ syslog-ng-3.5.3/lib/cfg-grammar.y +@@ -74,6 +74,10 @@ extern struct _ValuePairsTransformSet *l + + %code { + ++# ifndef YYID ++# define YYID(N) N ++# endif ++ + # define YYLLOC_DEFAULT(Current, Rhs, N) \ + do { \ + if (YYID (N)) \ diff -Nru syslog-ng-3.5.2/debian/patches/series syslog-ng-3.5.3/debian/patches/series --- syslog-ng-3.5.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ syslog-ng-3.5.3/debian/patches/series 2013-12-25 15:44:53.000000000 +0000 @@ -0,0 +1 @@ +debian-changes diff -Nru syslog-ng-3.5.2/debian/source_revision syslog-ng-3.5.3/debian/source_revision --- syslog-ng-3.5.2/debian/source_revision 2013-12-02 19:16:39.000000000 +0000 +++ syslog-ng-3.5.3/debian/source_revision 2013-12-25 15:44:34.000000000 +0000 @@ -1 +1 @@ - [@a31bdb7] + [@9695e81] diff -Nru syslog-ng-3.5.2/doc/Makefile.am syslog-ng-3.5.3/doc/Makefile.am --- syslog-ng-3.5.2/doc/Makefile.am 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/doc/Makefile.am 2013-12-24 19:25:16.000000000 +0000 @@ -27,15 +27,19 @@ sysconfdir_e = $(shell echo "${sysconfdir}" | sed -e "s,-,\\\\\\\\-,g") prefix_e = $(shell echo "${prefix}" | sed -e "s,-,\\\\\\\\-,g") -if ENABLE_MAN_PAGES -man_MANS += \ +manpages = \ doc/man/syslog-ng.8 \ doc/man/syslog-ng.conf.5 \ doc/man/pdbtool.1 \ doc/man/loggen.1 \ doc/man/syslog-ng-ctl.1 +if ENABLE_MAN_PAGES +man_MANS += ${manpages} + doc/man/%: doc/man/%.xml $(AM_V_GEN)$(XSLTPROC) --xinclude --output $@ ${XSL_STYLESHEET} $< $(AM_V_at)sed -e 's,/opt/syslog\\*-ng/etc,$(sysconfdir_e),g' -e 's,/opt/syslog\\*-ng/,$(prefix_e)/,g' <$@ >$@.tmp && mv $@.tmp $@ +else +EXTRA_DIST += ${manpages} endif diff -Nru syslog-ng-3.5.2/lib/cfg-tree.c syslog-ng-3.5.3/lib/cfg-tree.c --- syslog-ng-3.5.2/lib/cfg-tree.c 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/lib/cfg-tree.c 2013-12-24 19:25:16.000000000 +0000 @@ -640,6 +640,7 @@ *first_pipe, /* the head of the constructed pipeline */ *last_pipe; /* the current tail of the constructed pipeline */ LogPipe *source_join_pipe = NULL; + gboolean node_properties_propagated = FALSE; if ((node->flags & LC_CATCHALL) != 0) { @@ -680,6 +681,11 @@ /* add pipe to the current pipe_line, e.g. after last_pipe, update last_pipe & first_pipe */ if (sub_pipe_head) { + if (!node_properties_propagated) + { + cfg_tree_propagate_expr_node_properties_to_pipe(node, sub_pipe_head); + node_properties_propagated = TRUE; + } if (!first_pipe && !last_pipe) { /* we only remember the first pipe in case we're not in @@ -732,16 +738,6 @@ } } - if (first_pipe) - { - /* we actually return something as sub_pipe_head, which means that we - * have to propagate flags upwards */ - cfg_tree_propagate_expr_node_properties_to_pipe(node, first_pipe); - } - else if (last_pipe) - { - cfg_tree_propagate_expr_node_properties_to_pipe(node, last_pipe); - } /* NOTE: if flow control is enabled, then we either need to have an @@ -759,6 +755,20 @@ first_pipe = last_pipe = log_pipe_new(); g_ptr_array_add(self->initialized_pipes, first_pipe); } + + if (!node_properties_propagated) + { + /* we never encountered anything that would produce a head_pipe, e.g. + * this sequence only contains a source and nothing else. In that + * case, apply node flags to the last pipe. It should be picked up + * when LogMultiplexer iterates over the branch in + * log_multiplexer_init() as long as last_pipe is linked into the + * pipe_next list and is not forked off at a LogMultiplexer. + * */ + + cfg_tree_propagate_expr_node_properties_to_pipe(node, last_pipe); + node_properties_propagated = TRUE; + } *outer_pipe_tail = last_pipe; *outer_pipe_head = first_pipe; diff -Nru syslog-ng-3.5.2/lib/logmsg.c syslog-ng-3.5.3/lib/logmsg.c --- syslog-ng-3.5.2/lib/logmsg.c 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/lib/logmsg.c 2013-12-24 19:25:16.000000000 +0000 @@ -521,7 +521,7 @@ if (new_entry) log_msg_update_sdata(self, handle, name, name_len); - if (handle == LM_V_PROGRAM) + if (handle == LM_V_PROGRAM || handle == LM_V_PID) log_msg_unset_flag(self, LF_LEGACY_MSGHDR); } diff -Nru syslog-ng-3.5.2/lib/logproto/logproto-framed-server.c syslog-ng-3.5.3/lib/logproto/logproto-framed-server.c --- syslog-ng-3.5.2/lib/logproto/logproto-framed-server.c 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/lib/logproto/logproto-framed-server.c 2013-12-24 19:25:16.000000000 +0000 @@ -270,6 +270,8 @@ { LogProtoFramedServer *self = (LogProtoFramedServer *) s; g_free(self->buffer); + + log_proto_server_free_method(s); } LogProtoServer * diff -Nru syslog-ng-3.5.2/lib/value-pairs.c syslog-ng-3.5.3/lib/value-pairs.c --- syslog-ng-3.5.2/lib/value-pairs.c 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/lib/value-pairs.c 2013-12-24 19:25:16.000000000 +0000 @@ -225,6 +225,9 @@ gboolean inc; SBTHGString *sb; + if (value_len == 0) + return FALSE; + inc = (name[0] == '.' && (vp->scopes & VPS_DOT_NV_PAIRS)) || (name[0] != '.' && (vp->scopes & VPS_NV_PAIRS)) || (log_msg_is_handle_sdata(handle) && (vp->scopes & VPS_SDATA)); diff -Nru syslog-ng-3.5.2/modules/afmongodb/Makefile.am syslog-ng-3.5.3/modules/afmongodb/Makefile.am --- syslog-ng-3.5.2/modules/afmongodb/Makefile.am 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/modules/afmongodb/Makefile.am 2013-12-24 19:25:16.000000000 +0000 @@ -31,7 +31,7 @@ modules_afmongodb_libafmongodb_la_LDFLAGS = \ $(MODULE_LDFLAGS) modules_afmongodb_libafmongodb_la_DEPENDENCIES = \ - $(MODULE_DEPS_LIBS) ${lmc_EXTRA_DEPS} + $(MODULE_DEPS_LIBS) $(CRYPTO_LIBS) ${lmc_EXTRA_DEPS} modules/afmongodb modules/afmongodb/ mod-afmongodb mod-mongodb: \ modules/afmongodb/libafmongodb.la diff -Nru syslog-ng-3.5.2/modules/afsmtp/Makefile.am syslog-ng-3.5.3/modules/afsmtp/Makefile.am --- syslog-ng-3.5.2/modules/afsmtp/Makefile.am 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/modules/afsmtp/Makefile.am 2013-12-24 19:25:16.000000000 +0000 @@ -16,7 +16,7 @@ modules_afsmtp_libafsmtp_la_LDFLAGS = \ $(MODULE_LDFLAGS) modules_afsmtp_libafsmtp_la_DEPENDENCIES= \ - $(MODULE_DEPS_LIBS) + $(MODULE_DEPS_LIBS) $(CRYPTO_LIBS) modules/afsmtp modules/afsmtp/ mod-afsmtp mod-smtp: \ modules/afsmtp/libafsmtp.la diff -Nru syslog-ng-3.5.2/modules/afsocket/afinet-dest.c syslog-ng-3.5.3/modules/afsocket/afinet-dest.c --- syslog-ng-3.5.2/modules/afsocket/afinet-dest.c 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/modules/afsocket/afinet-dest.c 2013-12-24 19:25:16.000000000 +0000 @@ -212,6 +212,9 @@ if ((self->bind_ip && !resolve_hostname(&self->super.bind_addr, self->bind_ip))) return FALSE; + if (self->bind_port) + g_sockaddr_set_port(self->super.bind_addr, afinet_lookup_service(self->super.transport_mapper, self->bind_port)); + if (!resolve_hostname(&self->super.dest_addr, self->hostname)) return FALSE; diff -Nru syslog-ng-3.5.2/modules/afsql/Makefile.am syslog-ng-3.5.3/modules/afsql/Makefile.am --- syslog-ng-3.5.2/modules/afsql/Makefile.am 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/modules/afsql/Makefile.am 2013-12-24 19:25:16.000000000 +0000 @@ -19,7 +19,7 @@ modules_afsql_libafsql_la_LDFLAGS = \ $(MODULE_LDFLAGS) modules_afsql_libafsql_la_DEPENDENCIES = \ - $(MODULE_DEPS_LIBS) + $(MODULE_DEPS_LIBS) $(CRYPTO_LIBS) modules/afsql modules/afsql/ mod-afsql mod-sql: \ modules/afsql/libafsql.la diff -Nru syslog-ng-3.5.2/modules/dbparser/pdbtool/pdbtool.c syslog-ng-3.5.3/modules/dbparser/pdbtool/pdbtool.c --- syslog-ng-3.5.2/modules/dbparser/pdbtool/pdbtool.c 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/modules/dbparser/pdbtool/pdbtool.c 2013-12-24 19:25:16.000000000 +0000 @@ -741,6 +741,12 @@ { example = examples->data; + if (!example->program && verbose_flag) + { + printf ("Warnning, message has no 'program' attribute: message='%s'\n", + example->message); + } + if (example->message && example->program) { PDBInput input; diff -Nru syslog-ng-3.5.2/tests/functional/messagecheck.py syslog-ng-3.5.3/tests/functional/messagecheck.py --- syslog-ng-3.5.2/tests/functional/messagecheck.py 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/tests/functional/messagecheck.py 2013-12-24 19:25:16.000000000 +0000 @@ -73,6 +73,12 @@ if matches[(msg, session)] != count - 1: print_user("not enough messages found, message: %s, session: %d, last_id: %d, count: %d" % (msg, session, matches[(msg, session)], count)) return False + del matches[(msg, session)] + + if len(matches) > 0: + print_user("output contains more messages than expected: %s" % str(matches)) + return False + return True def check_reader_expected(reader, messages, settle_time, syslog_prefix, skip_prefix): diff -Nru syslog-ng-3.5.2/tests/functional/test_input_drivers.py syslog-ng-3.5.3/tests/functional/test_input_drivers.py --- syslog-ng-3.5.2/tests/functional/test_input_drivers.py 2013-11-29 16:19:30.000000000 +0000 +++ syslog-ng-3.5.3/tests/functional/test_input_drivers.py 2013-12-24 19:25:16.000000000 +0000 @@ -43,6 +43,7 @@ }; filter f_final { message("final"); }; +filter f_final_1_to_4 { message("final[1-4]"); }; filter f_final1 { message("final1"); }; filter f_final2 { message("final2"); }; @@ -52,14 +53,33 @@ destination d_final2 { file("test-final2.log"); logstore("test-final2.lgs"); }; destination d_final3 { file("test-final3.log"); logstore("test-final3.lgs"); }; destination d_final4 { file("test-final4.log"); logstore("test-final4.lgs"); }; +destination d_final5 { file("test-final5.log"); logstore("test-final5.lgs"); }; # test final flag + rest -log { source(s_int); source(s_unix); source(s_inet); source(s_inetssl); filter(f_final); +log { source(s_int); source(s_unix); source(s_inet); source(s_inetssl); filter(f_final); + + filter(f_final_1_to_4); log { filter(f_final1); destination(d_final1); flags(final); }; log { filter(f_final2); destination(d_final2); flags(final); }; log { filter(f_final3); destination(d_final3); flags(final); }; log { destination(d_final4); }; + flags(final); +}; + +# fallback, top-level log path for final flags. No messages should be +# delivered from final1-4, because of the final flag above. final5 messages +# will get here, as the filter above excludes that from the previous log +# statement. + +log { source(s_int); source(s_unix); source(s_inet); source(s_inetssl); + + # this filter would match everything from final1 to final5, but the + # flags(final) in the previous statement would stop the processing + # for final1-4 + + filter(f_final); + destination(d_final5); }; filter f_fb { message("fallback"); }; @@ -146,7 +166,8 @@ 'final1', 'final2', 'final3', - 'final4' + 'final4', + 'final5' ) expected = [None,] * len(messages)