summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2013-09-03 22:42:46 +0200
committerMichael Biebl <biebl@debian.org>2013-09-03 22:42:46 +0200
commit0c656246c6818b9fd0426411ed1cf926fbbc907d (patch)
treeca5db297c70a912d88b42df3c56a53c304aef5a3
parenta400789c367fd3cd8d0f9588ca2af72dcac47c9c (diff)
downloadrsyslog-0c656246c6818b9fd0426411ed1cf926fbbc907d.tar.gz
Imported Upstream version 7.4.4upstream/7.4.4
-rw-r--r--ChangeLog44
-rw-r--r--action.c2
-rw-r--r--config.h.in4
-rwxr-xr-xconfigure190
-rw-r--r--configure.ac10
-rw-r--r--doc/dev_oplugins.html31
-rw-r--r--doc/imfile.html4
-rw-r--r--doc/manual.html2
-rw-r--r--doc/rsyslog_packages.html17
-rw-r--r--grammar/rainerscript.c2
-rw-r--r--plugins/imfile/imfile.c2
-rw-r--r--plugins/imkmsg/kmsg.c2
-rw-r--r--plugins/imtcp/imtcp.c2
-rw-r--r--plugins/mmaudit/mmaudit.c2
-rw-r--r--plugins/mmjsonparse/mmjsonparse.c2
-rw-r--r--plugins/mmnormalize/mmnormalize.c2
-rw-r--r--plugins/omelasticsearch/omelasticsearch.c26
-rw-r--r--plugins/ommail/ommail.c4
-rw-r--r--plugins/ommongodb/ommongodb.c2
-rw-r--r--plugins/omprog/omprog.c11
-rw-r--r--plugins/omsnmp/omsnmp.c30
-rw-r--r--runtime/Makefile.am7
-rw-r--r--runtime/Makefile.in19
-rw-r--r--runtime/librsgt.c10
-rw-r--r--runtime/librsgt.h3
-rw-r--r--runtime/librsgt_read.c4
-rw-r--r--runtime/msg.c6
-rw-r--r--runtime/msg.h2
-rw-r--r--runtime/queue.c8
-rw-r--r--runtime/stream.c2
-rw-r--r--runtime/stream.h3
-rw-r--r--template.c2
-rw-r--r--template.h2
-rw-r--r--tests/chkseq.c41
-rw-r--r--tools/ompipe.c6
-rw-r--r--tools/rsgtutil.c8
36 files changed, 386 insertions, 128 deletions
diff --git a/ChangeLog b/ChangeLog
index 46afd7e..8023801 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,45 @@
---------------------------------------------------------------------------
+Version 7.4.4 [v7.4-stable] 2013-09-03
+- better error messages in GuardTime signature provider
+ Thanks to Ahto Truu for providing the patch.
+- make rsyslog use the new json-c pkgconfig file if available
+ Thanks to the Gentoo team for the patches.
+- bugfix: imfile parameter "persistStateInterval" was unusable
+ due to a case typo in imfile; work-around was to use legacy config
+ Thanks to Brandon Murphy for reporting this bug.
+- bugfix: TLV16 flag encoding error in signature files from GT provider
+ This fixes a problem where the TLV16 flag was improperly encoded.
+ Unfortunately, existing files already have the bug and may not properly
+ be processed. The fix uses constants from the GuardTime API lib to
+ prevent such problems in the future.
+ Thanks to Ahto Truu for providing the patch.
+- bugfix: slightly malformed SMTP handling in ommail
+- bugfix: segfault in omprog if no template was provided (now dflt is used)
+- bugfix: segfault in ompipe if no template was provided (now dflt is used)
+- bugfix: segfault in omsnmp if no template was provided (now dflt is used)
+- bugfix: some omsnmp optional config params were flagged as mandatory
+- bugfix: segfault in omelasticsearch when resuming queued messages
+ after restarting Elasticsearch
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=464
+- bugfix: imtcp addtlframedelimiter could not be set to zero
+ Thanks to Chris Norton for alerting us.
+- doc bugfix: remove no-longer existing omtemplate from developer doc
+ was specifically mentioned as a sample for creating new plugins
+ Thanks to Yannick Brosseau for alerting us of this problem.
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=473
+---------------------------------------------------------------------------
+Version 7.4.3 [v7.4-stable] 2013-07-18
+- bugfix: queue file size was not correctly processed
+ this could lead to using one queue file per message for sizes >2GiB
+ Thanks to Tomas Heinrich for the patch.
+- bugfix: $QHOUR/$HHOUR were always "00" or "01"
+ regression some time between v5 and here
+ Thanks to forum user rjmcinty for reporting this bug
+- bugfix: testbench tool chkseq did improperly report invalid file
+ This happened when permitted duplicate values existed in the very
+ last lines, right before end-of-file.
+ Thanks to Radu Gheorghe for reporting this bug.
+---------------------------------------------------------------------------
Version 7.4.3 [v7.4-stable] 2013-07-18
- bugfix: memory leak if disk queues were used and json data present
- bugfix: CEE/json data was lost during disk queue operation
@@ -1472,6 +1513,9 @@ expected that interfaces, even new ones, break during the initial
[ported from v4]
---------------------------------------------------------------------------
Version 5.10.2 [V5-STABLE], 201?-??-??
+- bugfix: queue file size was not correctly processed
+ this could lead to using one queue file per message for sizes >2GiB
+ Thanks to Tomas Heinrich for the patch.
- updated systemd files to match current systemd source
- bugfix: spurios error messages from imuxsock about (non-error) EAGAIN
Thanks to Marius Tomaschewski for the patch.
diff --git a/action.c b/action.c
index 259fb66..6b52d70 100644
--- a/action.c
+++ b/action.c
@@ -98,7 +98,7 @@
#include <strings.h>
#include <time.h>
#include <errno.h>
-#include <json/json.h>
+#include <json.h>
#include "dirty.h"
#include "template.h"
diff --git a/config.h.in b/config.h.in
index f050273..1eab168 100644
--- a/config.h.in
+++ b/config.h.in
@@ -183,8 +183,8 @@
/* Define to 1 if you have the <semaphore.h> header file. */
#undef HAVE_SEMAPHORE_H
-/* Define to 1 if you have the `setid' function. */
-#undef HAVE_SETID
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
diff --git a/configure b/configure
index 4ca9818..303c37e 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for rsyslog 7.4.3.
+# Generated by GNU Autoconf 2.68 for rsyslog 7.4.4.
#
# Report bugs to <rsyslog@lists.adiscon.com>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rsyslog'
PACKAGE_TARNAME='rsyslog'
-PACKAGE_VERSION='7.4.3'
-PACKAGE_STRING='rsyslog 7.4.3'
+PACKAGE_VERSION='7.4.4'
+PACKAGE_STRING='rsyslog 7.4.4'
PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com'
PACKAGE_URL=''
@@ -1594,7 +1594,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures rsyslog 7.4.3 to adapt to many kinds of systems.
+\`configure' configures rsyslog 7.4.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1664,7 +1664,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of rsyslog 7.4.3:";;
+ short | recursive ) echo "Configuration of rsyslog 7.4.4:";;
esac
cat <<\_ACEOF
@@ -1909,7 +1909,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-rsyslog configure 7.4.3
+rsyslog configure 7.4.4
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2488,7 +2488,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by rsyslog $as_me 7.4.3, which was
+It was created by rsyslog $as_me 7.4.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3303,7 +3303,7 @@ fi
# Define the identity of the package.
PACKAGE='rsyslog'
- VERSION='7.4.3'
+ VERSION='7.4.4'
cat >>confdefs.h <<_ACEOF
@@ -13352,7 +13352,67 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$JSON_C_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (json) were not met:
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON_C" >&5
+$as_echo_n "checking for JSON_C... " >&6; }
+
+if test -n "$JSON_C_CFLAGS"; then
+ pkg_cv_JSON_C_CFLAGS="$JSON_C_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_JSON_C_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$JSON_C_LIBS"; then
+ pkg_cv_JSON_C_LIBS="$JSON_C_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_JSON_C_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ JSON_C_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+ else
+ JSON_C_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$JSON_C_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (json-c) were not met:
$JSON_C_PKG_ERRORS
@@ -13385,6 +13445,110 @@ $as_echo "yes" >&6; }
fi
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for JSON_C" >&5
+$as_echo_n "checking for JSON_C... " >&6; }
+
+if test -n "$JSON_C_CFLAGS"; then
+ pkg_cv_JSON_C_CFLAGS="$JSON_C_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_JSON_C_CFLAGS=`$PKG_CONFIG --cflags "json-c" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$JSON_C_LIBS"; then
+ pkg_cv_JSON_C_LIBS="$JSON_C_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"json-c\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "json-c") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_JSON_C_LIBS=`$PKG_CONFIG --libs "json-c" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ JSON_C_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "json-c" 2>&1`
+ else
+ JSON_C_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "json-c" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$JSON_C_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (json-c) were not met:
+
+$JSON_C_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables JSON_C_CFLAGS
+and JSON_C_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables JSON_C_CFLAGS
+and JSON_C_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ JSON_C_CFLAGS=$pkg_cv_JSON_C_CFLAGS
+ JSON_C_LIBS=$pkg_cv_JSON_C_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+else
+ JSON_C_CFLAGS=$pkg_cv_JSON_C_CFLAGS
+ JSON_C_LIBS=$pkg_cv_JSON_C_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
case "${host}" in
*-*-linux*)
@@ -14981,7 +15145,7 @@ fi
done
-for ac_func in flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64
+for ac_func in flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17736,7 +17900,7 @@ else
ENABLE_RSYSLOGRT_FALSE=
fi
-RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_FLAGS)"
+RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)"
RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)"
@@ -20602,7 +20766,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by rsyslog $as_me 7.4.3, which was
+This file was extended by rsyslog $as_me 7.4.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20668,7 +20832,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-rsyslog config.status 7.4.3
+rsyslog config.status 7.4.4
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index e16c1f5..017116e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([rsyslog],[7.4.3],[rsyslog@lists.adiscon.com])
+AC_INIT([rsyslog],[7.4.4],[rsyslog@lists.adiscon.com])
AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -33,7 +33,9 @@ PKG_PROG_PKG_CONFIG
# modules we require
PKG_CHECK_MODULES(LIBESTR, libestr >= 0.1.5)
-PKG_CHECK_MODULES([JSON_C], [json])
+PKG_CHECK_MODULES([JSON_C], [json],, [
+ PKG_CHECK_MODULES([JSON_C], [json-c])
+])
case "${host}" in
*-*-linux*)
@@ -119,7 +121,7 @@ AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64])
+AC_CHECK_FUNCS([flock basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64])
# getifaddrs is in libc (mostly) or in libsocket (eg Solaris 11) or not defined (eg Solaris 10)
AC_SEARCH_LIBS([getifaddrs], [socket], [AC_DEFINE(HAVE_GETIFADDRS, [1], [set define])])
@@ -821,7 +823,7 @@ if test "x$enable_rsyslogrt" = "xyes"; then
RSRT_LIBS1="\$(top_builddir)/runtime/librsyslog.la"
fi
AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes)
-RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_FLAGS)"
+RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)"
RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)"
AC_SUBST(RSRT_CFLAGS1)
AC_SUBST(RSRT_LIBS1)
diff --git a/doc/dev_oplugins.html b/doc/dev_oplugins.html
index b33b67f..4a9cd15 100644
--- a/doc/dev_oplugins.html
+++ b/doc/dev_oplugins.html
@@ -18,19 +18,10 @@ means they are primarily thought of being message sinks. In theory, however, out
plugins may aggergate other functionality, too. Nobody has taken this route so far
so if you would like to do that, it is highly suggested to post your plan on the
rsyslog mailing list, first (so that we can offer advise).
-<p>The rsyslog distribution tarball contains two plugins that are extremely well
-targeted for getting started:
-<ul>
-<li>omtemplate
-<li>omstdout
-</ul>
-Plugin omtemplate was specifically created to provide a copy template for new output
-plugins. It is bare of real functionality but has ample comments. Even if you decide
-to start from another plugin (or even from scratch), be sure to read omtemplate source
-and comments first. The omstdout is primarily a testing aide, but offers support for
-the two different parameter-passing conventions plugins can use (plus the way to
-differentiate between the two). It also is not bare of functionaly, only mostly
-bare of it ;). But you can actually execute it and play with it.
+<p>The rsyslog distribution tarball contains the omstdout plugin which is extremely well
+targeted for getting started. Just note that this plugin itself is not meant for
+production use. But it is very simplistic and so a really good starting point to
+grasp the core ideas.
<p>In any case, you should also read the comments in ./runtime/module-template.h.
Output plugins are build based on a large set of code-generating macros. These
macros handle most of the plumbing needed by the interface. As long as no
@@ -38,19 +29,7 @@ special callback to rsyslog is needed (it typically is not), an output plugin do
not really need to be aware that it is executed by rsyslog. As a plug-in programmer,
you can (in most cases) "code as usual". However, all macros and entry points need to be
provided and thus reading the code comments in the files mentioned is highly suggested.
-<p>In short, the best idea is to start with a template. Let's assume you start by
-copying omtemplate. Then, the basic steps you need to do are:
-<ul>
-<li>cp ./plugins/omtemplate ./plugins/your-plugin
-<li>mv cd ./plugins/your-plugin
-<li>vi Makefile.am, adjust to your-plugin
-<li>mv omtemplate.c your-plugin.c
-<li>cd ../..
-<li>vi Makefile.am configure.ac
-<br>search for omtemplate, copy and modify (follow comments)
-</ul>
-<p>Basically, this is all you need to do ... Well, except, of course, coding
-your plugin ;). For testing, you need rsyslog's debugging support. Some useful
+<p>For testing, you need rsyslog's debugging support. Some useful
information is given in "<a href="troubleshoot.html">troubleshooting rsyslog</a>
from the doc set.
<h2>Special Topics</h2>
diff --git a/doc/imfile.html b/doc/imfile.html
index 942fe53..a69f62e 100644
--- a/doc/imfile.html
+++ b/doc/imfile.html
@@ -180,7 +180,7 @@ the current monitor. It has no parameters. If you forget this
directive, no file monitoring will take place.</li>
<li><span style="font-weight: bold;">$InputFilePollInterval
seconds</span><br>
-equivalent to: PollingInterva</li>
+equivalent to: PollingInterval</li>
<li><b>$InputFilePersistStateInterval</b> [lines]</b><br>
Available in 4.7.3+, 5.6.2+<br>
equivalent to: PersistStateInterval
@@ -228,7 +228,7 @@ $InputRunFileMonitor
# ... and so on ...
#
# check for new lines every 10 seconds
-$InputFilePollingInterval 10
+$InputFilePollInterval 10
</textarea>
<p>[<a href="rsyslog_conf.html">rsyslog.conf overview</a>]
[<a href="manual.html">manual index</a>] [<a href="http://www.rsyslog.com/">rsyslog site</a>]</p>
diff --git a/doc/manual.html b/doc/manual.html
index ed22967..dc6453b 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -19,7 +19,7 @@ professional services</a> available directly from the source!</p>
<p><b>Please visit the <a href="http://www.rsyslog.com/sponsors">rsyslog sponsor's page</a>
to honor the project sponsors or become one yourself!</b> We are very grateful for any help towards the
project goals.</p>
-<p><b>This documentation is for version 7.4.3 (v7.4-stable branch) of rsyslog.</b>
+<p><b>This documentation is for version 7.4.4 (v7.4-stable branch) of rsyslog.</b>
Visit the <i><a href="http://www.rsyslog.com/status">rsyslog status page</a></i></b>
to obtain current version information and project status.
</p><p><b>If you like rsyslog, you might
diff --git a/doc/rsyslog_packages.html b/doc/rsyslog_packages.html
index 80ba96c..5bb62fa 100644
--- a/doc/rsyslog_packages.html
+++ b/doc/rsyslog_packages.html
@@ -12,20 +12,29 @@ like to maintain a package for a new distribution, please mail me at
appreciated. While I create the core daemon, the package maintainers are really
filling it with life, making it available to the average user. I am very
grateful for that!</p>
-<p>This list has last been updated on 2008-07-11 by
+<p>This list has last been updated on 2013-07-25 by
<a href="http://www.adiscon.com/en/people/rainer-gerhards.php">Rainer Gerhards</a>.
New packages may appear at any time, so be sure to check this page whenever you
need a new one.</p>
<ul>
+<li><b>Ubuntu</b> (maintained by Adiscon)
+ <ul>
+ <li><a href="http://www.rsyslog.com/ubuntu-repository/">http://www.rsyslog.com/ubuntu-repository/</a>
+ </ul>
+
+<li><b>RHEL/CentOS</b> (maintained by Adiscon)
+ <ul>
+ <li><a href="http://www.rsyslog.com/rhelcentos-rpms/">http://www.rsyslog.com/rhelcentos-rpms/</a>
+ </ul>
+
<li><b>BSD</b> (maintained by infofarmer)
<ul>
- <li><a href="http://www.freshports.org/sysutils/rsyslog/"> http://www.freshports.org/sysutils/rsyslog/</a>
+ <li><a href="http://www.freshports.org/sysutils/rsyslog/">http://www.freshports.org/sysutils/rsyslog/</a>
</ul>
<li><b>CentOS 4.3</b> (maintained by James Bergamin)
<ul>
- <li><a href="http://www.se-community.com/~james/rsyslog/">
-http://www.se-community.com/~james/rsyslog/</a>
+ <li><a href="http://www.se-community.com/~james/rsyslog/">http://www.se-community.com/~james/rsyslog/</a>
</ul>
<li><b>Debian</b> (maintained by Michael Biebl)
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 0f0b469..2b8d600 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -854,7 +854,7 @@ nvlstGetParam(struct nvlst *valnode, struct cnfparamdescr *param,
r = doGetInt(valnode, param, val);
break;
case eCmdHdlrNonNegInt:
- r = doGetPositiveInt(valnode, param, val);
+ r = doGetNonNegInt(valnode, param, val);
break;
case eCmdHdlrPositiveInt:
r = doGetPositiveInt(valnode, param, val);
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index 2e80ffc..45882fb 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -478,7 +478,7 @@ CODESTARTnewInpInst
inst->readMode = pvals[i].val.d.n;
} else if(!strcmp(inppblk.descr[i].name, "maxlinesatonce")) {
inst->maxLinesAtOnce = pvals[i].val.d.n;
- } else if(!strcmp(inppblk.descr[i].name, "persistStateInterval")) {
+ } else if(!strcmp(inppblk.descr[i].name, "persiststateinterval")) {
inst->iPersistStateInterval = pvals[i].val.d.n;
} else if(!strcmp(inppblk.descr[i].name, "maxsubmitatonce")) {
inst->nMultiSub = pvals[i].val.d.n;
diff --git a/plugins/imkmsg/kmsg.c b/plugins/imkmsg/kmsg.c
index 822d3db..172ff4d 100644
--- a/plugins/imkmsg/kmsg.c
+++ b/plugins/imkmsg/kmsg.c
@@ -34,7 +34,7 @@
#include <ctype.h>
#include <sys/klog.h>
#include <sys/sysinfo.h>
-#include <json/json.h>
+#include <json.h>
#include "rsyslog.h"
#include "srUtils.h"
diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c
index 2d9761c..d2a0e56 100644
--- a/plugins/imtcp/imtcp.c
+++ b/plugins/imtcp/imtcp.c
@@ -138,7 +138,7 @@ static struct cnfparamdescr modpdescr[] = {
{ "disablelfdelimiter", eCmdHdlrBinary, 0 },
{ "octetcountedframing", eCmdHdlrBinary, 0 },
{ "notifyonconnectionclose", eCmdHdlrBinary, 0 },
- { "addtlframedelimiter", eCmdHdlrPositiveInt, 0 },
+ { "addtlframedelimiter", eCmdHdlrNonNegInt, 0 },
{ "maxsessions", eCmdHdlrPositiveInt, 0 },
{ "maxlistners", eCmdHdlrPositiveInt, 0 },
{ "maxlisteners", eCmdHdlrPositiveInt, 0 },
diff --git a/plugins/mmaudit/mmaudit.c b/plugins/mmaudit/mmaudit.c
index 6b6b804..c7cff2c 100644
--- a/plugins/mmaudit/mmaudit.c
+++ b/plugins/mmaudit/mmaudit.c
@@ -43,7 +43,7 @@
#include <errno.h>
#include <unistd.h>
#include <ctype.h>
-#include <json/json.h>
+#include <json.h>
#include "conf.h"
#include "syslogd-types.h"
#include "template.h"
diff --git a/plugins/mmjsonparse/mmjsonparse.c b/plugins/mmjsonparse/mmjsonparse.c
index 35f69aa..b16aef0 100644
--- a/plugins/mmjsonparse/mmjsonparse.c
+++ b/plugins/mmjsonparse/mmjsonparse.c
@@ -35,7 +35,7 @@
#include <errno.h>
#include <unistd.h>
#include <ctype.h>
-#include <json/json.h>
+#include <json.h>
#include "conf.h"
#include "syslogd-types.h"
#include "template.h"
diff --git a/plugins/mmnormalize/mmnormalize.c b/plugins/mmnormalize/mmnormalize.c
index fcadc32..f93974a 100644
--- a/plugins/mmnormalize/mmnormalize.c
+++ b/plugins/mmnormalize/mmnormalize.c
@@ -40,7 +40,7 @@
#include <unistd.h>
#include <libestr.h>
#include <libee/libee.h>
-#include <json/json.h>
+#include <json.h>
#include <liblognorm.h>
#include "conf.h"
#include "syslogd-types.h"
diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c
index cb96fb6..aea8e32 100644
--- a/plugins/omelasticsearch/omelasticsearch.c
+++ b/plugins/omelasticsearch/omelasticsearch.c
@@ -224,6 +224,12 @@ checkConn(instanceData *pData)
DBGPRINTF("omelasticsearch: checkConn() curl_easy_init() failed\n");
ABORT_FINALIZE(RS_RET_SUSPENDED);
}
+ /* Bodypart of request not needed, so set curl opt to nobody and httpget, otherwise lib-curl could sigsegv */
+ curl_easy_setopt(curl, CURLOPT_HTTPGET, TRUE);
+ curl_easy_setopt(curl, CURLOPT_NOBODY, TRUE);
+ /* Only enable for debugging
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); */
+
cstr = es_str2cstr(url, NULL);
curl_easy_setopt(curl, CURLOPT_URL, cstr);
free(cstr);
@@ -607,8 +613,11 @@ curlPost(instanceData *pData, uchar *message, int msglen, uchar **tpls)
break;
}
- pData->reply[pData->replyLen] = '\0'; /* byte has been reserved in malloc */
- DBGPRINTF("omelasticsearch: es reply: '%s'\n", pData->reply);
+ DBGPRINTF("omelasticsearch: pData replyLen = '%d'\n", pData->replyLen);
+ if (pData->replyLen > 0) {
+ pData->reply[pData->replyLen] = '\0'; /* Append 0 Byte if replyLen is above 0 - byte has been reserved in malloc */
+ }
+ DBGPRINTF("omelasticsearch: pData reply: '%s'\n", pData->reply);
CHKiRet(checkResult(pData, message));
finalize_it:
@@ -642,12 +651,17 @@ ENDdoAction
BEGINendTransaction
- char *cstr;
+ char *cstr = NULL;
CODESTARTendTransaction
dbgprintf("omelasticsearch: endTransaction init\n");
- cstr = es_str2cstr(pData->batch.data, NULL);
- dbgprintf("omelasticsearch: endTransaction, batch: '%s'\n", cstr);
- CHKiRet(curlPost(pData, (uchar*) cstr, strlen(cstr), NULL));
+ /* End Transaction only if batch data is not empty */
+ if (pData->batch.data != NULL ) {
+ cstr = es_str2cstr(pData->batch.data, NULL);
+ dbgprintf("omelasticsearch: endTransaction, batch: '%s'\n", cstr);
+ CHKiRet(curlPost(pData, (uchar*) cstr, strlen(cstr), NULL));
+ }
+ else
+ dbgprintf("omelasticsearch: endTransaction, pData->batch.data is NULL, nothing to send. \n");
finalize_it:
free(cstr);
dbgprintf("omelasticsearch: endTransaction done with %d\n", iRet);
diff --git a/plugins/ommail/ommail.c b/plugins/ommail/ommail.c
index 6044d2e..0a781e1 100644
--- a/plugins/ommail/ommail.c
+++ b/plugins/ommail/ommail.c
@@ -176,7 +176,7 @@ WriteRcpts(instanceData *pData, uchar *pszOp, size_t lenOp, int iStatusToCheck)
for(pRcpt = pData->md.smtp.lstRcpt ; pRcpt != NULL ; pRcpt = pRcpt->pNext) {
dbgprintf("Sending '%s: <%s>'\n", pszOp, pRcpt->pszTo);
CHKiRet(Send(pData->md.smtp.sock, (char*)pszOp, lenOp));
- CHKiRet(Send(pData->md.smtp.sock, ": <", sizeof(": <") - 1));
+ CHKiRet(Send(pData->md.smtp.sock, ":<", sizeof(":<") - 1));
CHKiRet(Send(pData->md.smtp.sock, (char*)pRcpt->pszTo, strlen((char*)pRcpt->pszTo)));
CHKiRet(Send(pData->md.smtp.sock, ">\r\n", sizeof(">\r\n") - 1));
if(iStatusToCheck >= 0)
@@ -522,7 +522,7 @@ sendSMTP(instanceData *pData, uchar *body, uchar *subject)
CHKiRet(Send(pData->md.smtp.sock, "\r\n", sizeof("\r\n") - 1));
CHKiRet(readResponse(pData, &iState, 250));
- CHKiRet(Send(pData->md.smtp.sock, "MAIL FROM: <", sizeof("MAIL FROM: <") - 1));
+ CHKiRet(Send(pData->md.smtp.sock, "MAIL FROM:<", sizeof("MAIL FROM:<") - 1));
CHKiRet(Send(pData->md.smtp.sock, (char*)pData->md.smtp.pszFrom, strlen((char*)pData->md.smtp.pszFrom)));
CHKiRet(Send(pData->md.smtp.sock, ">\r\n", sizeof(">\r\n") - 1));
CHKiRet(readResponse(pData, &iState, 250));
diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c
index dd99741..64d501d 100644
--- a/plugins/ommongodb/ommongodb.c
+++ b/plugins/ommongodb/ommongodb.c
@@ -33,7 +33,7 @@
#include <stdint.h>
#include <time.h>
#include <mongo.h>
-#include <json/json.h>
+#include <json.h>
/* For struct json_object_iter, should not be necessary in future versions */
#include <json/json_object_private.h>
diff --git a/plugins/omprog/omprog.c b/plugins/omprog/omprog.c
index e425b42..6926165 100644
--- a/plugins/omprog/omprog.c
+++ b/plugins/omprog/omprog.c
@@ -350,14 +350,9 @@ CODESTARTnewActInst
}
}
- if(pData->tplName == NULL) {
- CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*) "RSYSLOG_FileFormat",
- OMSR_NO_RQD_TPL_OPTS));
- } else {
- CHKiRet(OMSRsetEntry(*ppOMSR, 0,
- (uchar*) strdup((char*) pData->tplName),
- OMSR_NO_RQD_TPL_OPTS));
- }
+ CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ?
+ "RSYSLOG_FileFormat" : (char*)pData->tplName),
+ OMSR_NO_RQD_TPL_OPTS));
CODE_STD_FINALIZERnewActInst
cnfparamvalsDestruct(pvals, &actpblk);
ENDnewActInst
diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c
index 79e555b..42d1de6 100644
--- a/plugins/omsnmp/omsnmp.c
+++ b/plugins/omsnmp/omsnmp.c
@@ -112,15 +112,15 @@ static configSettings_t cs;
/* action (instance) parameters */
static struct cnfparamdescr actpdescr[] = {
{ "server", eCmdHdlrString, CNFPARAM_REQUIRED },
- { "port", eCmdHdlrInt, CNFPARAM_REQUIRED },
- { "transport", eCmdHdlrString, CNFPARAM_REQUIRED },
- { "version", eCmdHdlrInt, CNFPARAM_REQUIRED },
- { "community", eCmdHdlrString, CNFPARAM_REQUIRED },
- { "enterpriseoid", eCmdHdlrString, CNFPARAM_REQUIRED },
- { "trapoid", eCmdHdlrString, CNFPARAM_REQUIRED },
- { "messageoid", eCmdHdlrString, CNFPARAM_REQUIRED },
- { "traptype", eCmdHdlrInt, CNFPARAM_REQUIRED },
- { "specifictype", eCmdHdlrInt, CNFPARAM_REQUIRED },
+ { "port", eCmdHdlrInt, 0 },
+ { "transport", eCmdHdlrString, 0 },
+ { "version", eCmdHdlrInt, 0 },
+ { "community", eCmdHdlrString, 0 },
+ { "enterpriseoid", eCmdHdlrString, 0 },
+ { "trapoid", eCmdHdlrString, 0 },
+ { "messageoid", eCmdHdlrString, 0 },
+ { "traptype", eCmdHdlrInt, 0 },
+ { "specifictype", eCmdHdlrInt, 0 },
{ "template", eCmdHdlrGetWord, 0 }
};
static struct cnfparamblk actpblk =
@@ -429,14 +429,10 @@ CODESTARTnewActInst
}
}
- if(pData->tplName == NULL) {
- CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*) "RSYSLOG_FileFormat",
- OMSR_NO_RQD_TPL_OPTS));
- } else {
- CHKiRet(OMSRsetEntry(*ppOMSR, 0,
- (uchar*) strdup((char*) pData->tplName),
- OMSR_NO_RQD_TPL_OPTS));
- }
+ CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ?
+ "RSYSLOG_FileFormat" : (char*)pData->tplName),
+ OMSR_NO_RQD_TPL_OPTS));
+
CODE_STD_FINALIZERnewActInst
cnfparamvalsDestruct(pvals, &actpblk);
ENDnewActInst
diff --git a/runtime/Makefile.am b/runtime/Makefile.am
index dea06fe..34384be 100644
--- a/runtime/Makefile.am
+++ b/runtime/Makefile.am
@@ -97,12 +97,13 @@ librsyslog_la_SOURCES = \
#
if WITH_MODDIRS
-librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" $(PTHREADS_CFLAGS) -I\$(top_srcdir)/tools
+librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\"
else
-librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/\" -I$(top_srcdir) $(PTHREADS_CFLAGS) -I\$(top_srcdir)/tools -I\$(top_srcdir)/grammar
+librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/\" -I\$(top_srcdir) -I\$(top_srcdir)/grammar
endif
#librsyslog_la_LDFLAGS = -module -avoid-version
-librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS)
+librsyslog_la_CPPFLAGS += $(PTHREADS_CFLAGS) $(LIBEE_CFLAGS) $(LIBUUID_CFLAGS) $(JSON_C_CFLAGS) -I\$(top_srcdir)/tools
+librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS) $(LIBEE_LIBS) $(LIBUUID_LIBS) $(JSON_C_LIBS)
#
# regular expression support
diff --git a/runtime/Makefile.in b/runtime/Makefile.in
index 5444489..89e3c93 100644
--- a/runtime/Makefile.in
+++ b/runtime/Makefile.in
@@ -131,7 +131,8 @@ librsgt_la_OBJECTS = $(am_librsgt_la_OBJECTS)
@ENABLE_GUARDTIME_TRUE@am_librsgt_la_rpath =
am__DEPENDENCIES_1 =
librsyslog_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am_librsyslog_la_OBJECTS = librsyslog_la-rsyslog.lo \
librsyslog_la-dnscache.lo librsyslog_la-glbl.lo \
librsyslog_la-conf.lo librsyslog_la-rsconf.lo \
@@ -569,13 +570,23 @@ librsyslog_la_SOURCES = \
../template.c \
../template.h
-@WITH_MODDIRS_FALSE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/\" -I$(top_srcdir) $(PTHREADS_CFLAGS) -I\$(top_srcdir)/tools -I\$(top_srcdir)/grammar
+#librsyslog_la_LDFLAGS = -module -avoid-version
+@WITH_MODDIRS_FALSE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS \
+@WITH_MODDIRS_FALSE@ -D_PATH_MODDIR=\"$(pkglibdir)/\" \
+@WITH_MODDIRS_FALSE@ -I\$(top_srcdir) -I\$(top_srcdir)/grammar \
+@WITH_MODDIRS_FALSE@ $(PTHREADS_CFLAGS) $(LIBEE_CFLAGS) \
+@WITH_MODDIRS_FALSE@ $(LIBUUID_CFLAGS) $(JSON_C_CFLAGS) \
+@WITH_MODDIRS_FALSE@ -I\$(top_srcdir)/tools
# the files with ../ we need to work on - so that they either become part of the
# runtime or will no longer be needed. -- rgerhards, 2008-06-13
#
-@WITH_MODDIRS_TRUE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" $(PTHREADS_CFLAGS) -I\$(top_srcdir)/tools
#librsyslog_la_LDFLAGS = -module -avoid-version
-librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS)
+@WITH_MODDIRS_TRUE@librsyslog_la_CPPFLAGS = -DSD_EXPORT_SYMBOLS \
+@WITH_MODDIRS_TRUE@ -D_PATH_MODDIR=\"$(pkglibdir)/:$(moddirs)\" \
+@WITH_MODDIRS_TRUE@ $(PTHREADS_CFLAGS) $(LIBEE_CFLAGS) \
+@WITH_MODDIRS_TRUE@ $(LIBUUID_CFLAGS) $(JSON_C_CFLAGS) \
+@WITH_MODDIRS_TRUE@ -I\$(top_srcdir)/tools
+librsyslog_la_LIBADD = $(DL_LIBS) $(RT_LIBS) $(LIBEE_LIBS) $(LIBUUID_LIBS) $(JSON_C_LIBS)
@ENABLE_REGEXP_TRUE@lmregexp_la_SOURCES = regexp.c regexp.h
@ENABLE_REGEXP_TRUE@lmregexp_la_CPPFLAGS = $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
@ENABLE_REGEXP_TRUE@lmregexp_la_LDFLAGS = -module -avoid-version
diff --git a/runtime/librsgt.c b/runtime/librsgt.c
index 85fc774..a812456 100644
--- a/runtime/librsgt.c
+++ b/runtime/librsgt.c
@@ -75,7 +75,7 @@ reportGTAPIErr(gtctx ctx, gtfile gf, char *apiname, int ecode)
char errbuf[4096];
snprintf(errbuf, sizeof(errbuf), "%s[%s:%d]: %s",
(gf == NULL) ? (uchar*)"" : gf->sigfilename,
- apiname, ecode, GT_getErrorString(ecode));
+ apiname, ecode, GTHTTP_getErrorString(ecode));
errbuf[sizeof(errbuf)-1] = '\0';
reportErr(ctx, errbuf);
}
@@ -285,7 +285,9 @@ int
tlv8Write(gtfile gf, int flags, int tlvtype, int len)
{
int r;
- r = tlvbufAddOctet(gf, (flags << 5)|tlvtype);
+ assert((flags & RSGT_TYPE_MASK) == 0);
+ assert((tlvtype & RSGT_TYPE_MASK) == tlvtype);
+ r = tlvbufAddOctet(gf, (flags & ~RSGT_FLAG_TLV16) | tlvtype);
if(r != 0) goto done;
r = tlvbufAddOctet(gf, len & 0xff);
done: return r;
@@ -296,7 +298,9 @@ tlv16Write(gtfile gf, int flags, int tlvtype, uint16_t len)
{
uint16_t typ;
int r;
- typ = ((flags|1) << 15)|tlvtype;
+ assert((flags & RSGT_TYPE_MASK) == 0);
+ assert((tlvtype >> 8 & RSGT_TYPE_MASK) == (tlvtype >> 8));
+ typ = ((flags | RSGT_FLAG_TLV16) << 8) | tlvtype;
r = tlvbufAddOctet(gf, typ >> 8);
if(r != 0) goto done;
r = tlvbufAddOctet(gf, typ & 0xff);
diff --git a/runtime/librsgt.h b/runtime/librsgt.h
index bfcc462..bf9c9c3 100644
--- a/runtime/librsgt.h
+++ b/runtime/librsgt.h
@@ -151,7 +151,10 @@ struct rsgtstatefile {
};
/* Flags and record types for TLV handling */
+#define RSGT_FLAG_NONCRIT 0x80
+#define RSGT_FLAG_FORWARD 0x40
#define RSGT_FLAG_TLV16 0x20
+#define RSGT_TYPE_MASK 0x1f
/* error states */
#define RSGTE_IO 1 /* any kind of io error */
diff --git a/runtime/librsgt_read.c b/runtime/librsgt_read.c
index a6e3316..a9a5079 100644
--- a/runtime/librsgt_read.c
+++ b/runtime/librsgt_read.c
@@ -249,7 +249,7 @@ rsgt_tlvRecRead(FILE *fp, tlvrecord_t *rec)
NEXTC;
rec->hdr[0] = c;
rec->tlvtype = c & 0x1f;
- if(c & 0x80) { /* tlv16? */
+ if(c & RSGT_FLAG_TLV16) { /* tlv16? */
rec->lenHdr = 4;
NEXTC;
rec->hdr[1] = c;
@@ -290,7 +290,7 @@ rsgt_tlvDecodeSUBREC(tlvrecord_t *rec, uint16_t *stridx, tlvrecord_t *newrec)
c = rec->data[(*stridx)++];
newrec->hdr[0] = c;
newrec->tlvtype = c & 0x1f;
- if(c & 0x80) { /* tlv16? */
+ if(c & RSGT_FLAG_TLV16) { /* tlv16? */
newrec->lenHdr = 4;
if(rec->tlvlen == *stridx) {r=RSGTE_LEN; goto done;}
c = rec->data[(*stridx)++];
diff --git a/runtime/msg.c b/runtime/msg.c
index a227567..36cbd26 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -41,7 +41,7 @@
#endif
#include <netdb.h>
#include <libestr.h>
-#include <json/json.h>
+#include <json.h>
/* For struct json_object_iter, should not be necessary in future versions */
#include <json/json_object_private.h>
#if HAVE_MALLOC_H
@@ -2495,10 +2495,10 @@ static uchar *getNOW(eNOWType eNow, struct syslogTime *t)
memcpy(pBuf, two_digits[(int)t->hour], 3);
break;
case NOW_HHOUR:
- memcpy(pBuf, two_digits[t->hour/30], 3);
+ memcpy(pBuf, two_digits[t->minute/30], 3);
break;
case NOW_QHOUR:
- memcpy(pBuf, two_digits[t->hour/15], 3);
+ memcpy(pBuf, two_digits[t->minute/15], 3);
break;
case NOW_MINUTE:
memcpy(pBuf, two_digits[(int)t->minute], 3);
diff --git a/runtime/msg.h b/runtime/msg.h
index 6faf066..ac220b6 100644
--- a/runtime/msg.h
+++ b/runtime/msg.h
@@ -30,7 +30,7 @@
#include <pthread.h>
#include <libestr.h>
-#include <json/json.h>
+#include <json.h>
#include "obj.h"
#include "syslogd-types.h"
#include "template.h"
diff --git a/runtime/queue.c b/runtime/queue.c
index abe2be0..935a810 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -2126,12 +2126,12 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */
pThis->iFullDlyMrk = wrk;
}
- DBGOPRINT((obj_t*) pThis, "type %d, enq-only %d, disk assisted %d, maxFileSz %lld, lqsize %d, pqsize %d, child %d, "
- "full delay %d, light delay %d, deq batch size %d starting\n",
- pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->iMaxFileSize,
+ DBGOPRINT((obj_t*) pThis, "type %d, enq-only %d, disk assisted %d, maxFileSz %lld, maxQSize %d, lqsize %d, pqsize %d, child %d, "
+ "full delay %d, light delay %d, deq batch size %d starting, high wtrrmrk %d, low wtrmrk %d\n",
+ pThis->qType, pThis->bEnqOnly, pThis->bIsDA, pThis->iMaxFileSize, pThis->iMaxQueueSize,
getLogicalQueueSize(pThis), getPhysicalQueueSize(pThis),
pThis->pqParent == NULL ? 0 : 1, pThis->iFullDlyMrk, pThis->iLightDlyMrk,
- pThis->iDeqBatchSize);
+ pThis->iDeqBatchSize, pThis->iHighWtrMrk, pThis->iLowWtrMrk);
pThis->bQueueStarted = 1;
if(pThis->qType == QUEUETYPE_DIRECT)
diff --git a/runtime/stream.c b/runtime/stream.c
index 54210e4..94fc0ca 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1605,7 +1605,7 @@ finalize_it:
/* property set methods */
/* simple ones first */
DEFpropSetMeth(strm, bDeleteOnClose, int)
-DEFpropSetMeth(strm, iMaxFileSize, int)
+DEFpropSetMeth(strm, iMaxFileSize, int64)
DEFpropSetMeth(strm, iFileNumDigits, int)
DEFpropSetMeth(strm, tOperationsMode, int)
DEFpropSetMeth(strm, tOpenMode, mode_t)
diff --git a/runtime/stream.h b/runtime/stream.h
index 61d5ede..4f4a430 100644
--- a/runtime/stream.h
+++ b/runtime/stream.h
@@ -158,7 +158,6 @@ BEGINinterface(strm) /* name must also be changed in ENDinterface macro! */
rsRetVal (*Construct)(strm_t **ppThis);
rsRetVal (*ConstructFinalize)(strm_t *pThis);
rsRetVal (*Destruct)(strm_t **ppThis);
- rsRetVal (*SetMaxFileSize)(strm_t *pThis, int64 iMaxFileSize);
rsRetVal (*SetFileName)(strm_t *pThis, uchar *pszName, size_t iLenName);
rsRetVal (*ReadChar)(strm_t *pThis, uchar *pC);
rsRetVal (*UnreadChar)(strm_t *pThis, uchar c);
@@ -176,7 +175,7 @@ BEGINinterface(strm) /* name must also be changed in ENDinterface macro! */
rsRetVal (*SetWCntr)(strm_t *pThis, number_t *pWCnt);
rsRetVal (*Dup)(strm_t *pThis, strm_t **ppNew);
INTERFACEpropSetMeth(strm, bDeleteOnClose, int);
- INTERFACEpropSetMeth(strm, iMaxFileSize, int);
+ INTERFACEpropSetMeth(strm, iMaxFileSize, int64);
INTERFACEpropSetMeth(strm, iMaxFiles, int);
INTERFACEpropSetMeth(strm, iFileNumDigits, int);
INTERFACEpropSetMeth(strm, tOperationsMode, int);
diff --git a/template.c b/template.c
index b675255..9cefa05 100644
--- a/template.c
+++ b/template.c
@@ -34,7 +34,7 @@
#include <string.h>
#include <ctype.h>
#include <assert.h>
-#include <json/json.h>
+#include <json.h>
#include "stringbuf.h"
#include "syslogd-types.h"
#include "template.h"
diff --git a/template.h b/template.h
index 318db6f..87a1c77 100644
--- a/template.h
+++ b/template.h
@@ -30,7 +30,7 @@
#ifndef TEMPLATE_H_INCLUDED
#define TEMPLATE_H_INCLUDED 1
-#include <json/json.h>
+#include <json.h>
#include <libestr.h>
#include "regexp.h"
#include "stringbuf.h"
diff --git a/tests/chkseq.c b/tests/chkseq.c
index b22c899..bea9f83 100644
--- a/tests/chkseq.c
+++ b/tests/chkseq.c
@@ -48,6 +48,7 @@ int main(int argc, char *argv[])
int start = 0, end = 0;
int opt;
int nDups = 0;
+ int reachedEOF;
int edLen; /* length of extra data */
static char edBuf[500*1024]; /* buffer for extra data (pretty large to be on the save side...) */
char *file = NULL;
@@ -126,15 +127,47 @@ int main(int argc, char *argv[])
}
}
- if(nDups != 0)
- printf("info: had %d duplicates (this is no error)\n", nDups);
-
if(i - 1 != end) {
printf("only %d records in file, expected %d\n", i - 1, end);
exit(1);
}
- if(!feof(fp)) {
+ if(feof(fp)) {
+ reachedEOF = 1;
+ } else {
+ /* if duplicates are permitted, we need to do a final check if we have duplicates at the
+ * end of file.
+ */
+ if(dupsPermitted) {
+ i = end;
+ while(!feof(fp)) {
+ if(bHaveExtraData) {
+ scanfOK = fscanf(fp, "%d,%d,%s\n", &val, &edLen, edBuf) == 3 ? 1 : 0;
+ if(edLen != (int) strlen(edBuf)) {
+ printf("extra data length specified %d, but actually is %ld in record %d\n",
+ edLen, (long) strlen(edBuf), i);
+ exit(1);
+ }
+ } else {
+ scanfOK = fscanf(fp, "%d\n", &val) == 1 ? 1 : 0;
+ }
+
+ if(val != i) {
+ reachedEOF = 0;
+ goto breakIF;
+ }
+ }
+ reachedEOF = feof(fp) ? 1 : 0;
+ } else {
+ reachedEOF = 0;
+ }
+ }
+
+breakIF:
+ if(nDups != 0)
+ printf("info: had %d duplicates (this is no error)\n", nDups);
+
+ if(!reachedEOF) {
printf("end of processing, but NOT end of file!\n");
exit(1);
}
diff --git a/tools/ompipe.c b/tools/ompipe.c
index 420e2b1..df8066b 100644
--- a/tools/ompipe.c
+++ b/tools/ompipe.c
@@ -329,6 +329,10 @@ CODESTARTnewActInst
}
}
+ CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*)strdup((pData->tplName == NULL) ?
+ "RSYSLOG_ForwardFormat" : (char*)pData->tplName),
+ OMSR_NO_RQD_TPL_OPTS));
+ /* Old flawed template code
if(pData->tplName == NULL) {
CHKiRet(OMSRsetEntry(*ppOMSR, 0, (uchar*) "RSYSLOG_FileFormat",
OMSR_NO_RQD_TPL_OPTS));
@@ -336,7 +340,7 @@ CODESTARTnewActInst
CHKiRet(OMSRsetEntry(*ppOMSR, 0,
(uchar*) strdup((char*) pData->tplName),
OMSR_NO_RQD_TPL_OPTS));
- }
+ }*/
CODE_STD_FINALIZERnewActInst
cnfparamvalsDestruct(pvals, &actpblk);
ENDnewActInst
diff --git a/tools/rsgtutil.c b/tools/rsgtutil.c
index 095b806..567dcf4 100644
--- a/tools/rsgtutil.c
+++ b/tools/rsgtutil.c
@@ -74,7 +74,7 @@ dumpFile(char *name)
if(fp != stdin)
fclose(fp);
return;
-err: fprintf(stderr, "error %d processing file %s\n", r, name);
+err: fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name);
}
static void
@@ -113,7 +113,7 @@ showSigblkParams(char *name)
return;
err:
if(r != RSGTE_EOF)
- fprintf(stderr, "error %d processing file %s\n", r, name);
+ fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name);
}
static void
@@ -145,7 +145,7 @@ detectFileType(char *name)
if(fp != stdin)
fclose(fp);
return;
-err: fprintf(stderr, "error %d processing file %s\n", r, name);
+err: fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name);
}
static inline int
@@ -327,7 +327,7 @@ done:
return;
err:
- fprintf(stderr, "error %d processing file %s\n", r, name);
+ fprintf(stderr, "error %d (%s) processing file %s\n", r, RSGTE2String(r), name);
if(logfp != NULL)
fclose(logfp);
if(sigfp != NULL)