summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2015-10-09 16:10:12 +0200
committerLars Wendler <polynomial-c@gentoo.org>2015-10-09 16:12:02 +0200
commitb2fc2901e8b2e08a19e8b2eca4b29c86e1a93e9b (patch)
tree98cdbc921d1b36d405d3cdc86167b85ad5f7bc7a /app-admin/rsyslog/files
parentpackage.mask: Removed dev-libs/liblognorm mask. (diff)
downloadgentoo-b2fc2901e8b2e08a19e8b2eca4b29c86e1a93e9b.tar.gz
gentoo-b2fc2901e8b2e08a19e8b2eca4b29c86e1a93e9b.tar.bz2
gentoo-b2fc2901e8b2e08a19e8b2eca4b29c86e1a93e9b.zip
app-admin/rsyslog: Bump to version 8.13.0
Package-Manager: portage-2.2.23 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'app-admin/rsyslog/files')
-rw-r--r--app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch130
-rw-r--r--app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch141
-rw-r--r--app-admin/rsyslog/files/8-stable/rsyslog.confd-r130
-rw-r--r--app-admin/rsyslog/files/8-stable/rsyslog.initd-r173
4 files changed, 374 insertions, 0 deletions
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch
new file mode 100644
index 000000000000..f049d53154e8
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch
@@ -0,0 +1,130 @@
+From a88d67df6e55e0a5f484f6aff8aa6e9813c5c31a Mon Sep 17 00:00:00 2001
+From: Janmejay Singh <singh.janmejay@gmail.com>
+Date: Mon, 28 Sep 2015 20:38:05 +0530
+Subject: [PATCH] fixed re_extract bug, which fails the regex-compile for
+ extract as fn-init fails when fn does not have exactly 2 args
+
+
+Fixes: https://github.com/rsyslog/rsyslog/issues/499
+
+---
+ grammar/rainerscript.c | 2 +-
+ tests/Makefile.am | 6 ++++++
+ tests/rscript_re_extract.sh | 14 ++++++++++++++
+ tests/rscript_re_match.sh | 14 ++++++++++++++
+ tests/testsuites/rscript_re_extract.conf | 9 +++++++++
+ tests/testsuites/rscript_re_match.conf | 10 ++++++++++
+ 6 files changed, 54 insertions(+), 1 deletion(-)
+ create mode 100755 tests/rscript_re_extract.sh
+ create mode 100755 tests/rscript_re_match.sh
+ create mode 100644 tests/testsuites/rscript_re_extract.conf
+ create mode 100644 tests/testsuites/rscript_re_match.conf
+
+diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
+index f02e1fe..17f785e 100644
+--- a/grammar/rainerscript.c
++++ b/grammar/rainerscript.c
+@@ -3747,7 +3747,7 @@ initFunc_re_match(struct cnffunc *func)
+ regex_t *re;
+ DEFiRet;
+
+- if(func->nParams != 2) {
++ if(func->nParams < 2) {
+ parser_errmsg("rsyslog logic error in line %d of file %s\n",
+ __LINE__, __FILE__);
+ FINALIZE;
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 914d947..d77728a 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -120,6 +120,8 @@ TESTS += \
+ rscript_replace_complex.sh \
+ rscript_wrap2.sh \
+ rscript_wrap3.sh \
++ rscript_re_extract.sh \
++ rscript_re_match.sh \
+ rs_optimizer_pri.sh \
+ cee_simple.sh \
+ cee_diskqueue.sh \
+@@ -854,6 +856,10 @@ EXTRA_DIST= \
+ testsuites/stop_when_array_has_element.conf \
+ key_dereference_on_uninitialized_variable_space.sh \
+ testsuites/key_dereference_on_uninitialized_variable_space.conf \
++ rscript_re_extract.sh \
++ testsuites/rscript_re_extract.conf \
++ rscript_re_match.sh \
++ testsuites/rscript_re_match.conf \
+ cfg.sh
+
+ # TODO: re-enable
+diff --git a/tests/rscript_re_extract.sh b/tests/rscript_re_extract.sh
+new file mode 100755
+index 0000000..930448c
+--- /dev/null
++++ b/tests/rscript_re_extract.sh
+@@ -0,0 +1,14 @@
++#!/bin/bash
++# added 2015-09-29 by singh.janmejay
++# This file is part of the rsyslog project, released under ASL 2.0
++echo ===============================================================================
++echo \[rscript_re_extract.sh\]: test re_extract rscript-fn
++. $srcdir/diag.sh init
++. $srcdir/diag.sh startup rscript_re_extract.conf
++. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
++echo doing shutdown
++. $srcdir/diag.sh shutdown-when-empty
++echo wait on shutdown
++. $srcdir/diag.sh wait-shutdown
++. $srcdir/diag.sh content-check "*Number is 19597*"
++. $srcdir/diag.sh exit
+diff --git a/tests/rscript_re_match.sh b/tests/rscript_re_match.sh
+new file mode 100755
+index 0000000..d2e212d
+--- /dev/null
++++ b/tests/rscript_re_match.sh
+@@ -0,0 +1,14 @@
++#!/bin/bash
++# added 2015-09-29 by singh.janmejay
++# This file is part of the rsyslog project, released under ASL 2.0
++echo ===============================================================================
++echo \[rscript_re_match.sh\]: test re_match rscript-fn
++. $srcdir/diag.sh init
++. $srcdir/diag.sh startup rscript_re_match.conf
++. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
++echo doing shutdown
++. $srcdir/diag.sh shutdown-when-empty
++echo wait on shutdown
++. $srcdir/diag.sh wait-shutdown
++. $srcdir/diag.sh content-check "*Matched*"
++. $srcdir/diag.sh exit
+diff --git a/tests/testsuites/rscript_re_extract.conf b/tests/testsuites/rscript_re_extract.conf
+new file mode 100644
+index 0000000..6c71e53
+--- /dev/null
++++ b/tests/testsuites/rscript_re_extract.conf
+@@ -0,0 +1,9 @@
++$IncludeConfig diag-common.conf
++template(name="outfmt" type="string" string="*Number is %$.number%*\n")
++
++module(load="../plugins/imtcp/.libs/imtcp")
++input(type="imtcp" port="13514")
++
++set $.number = re_extract($msg, '.* ([0-9]+)$', 0, 1, 'none');
++
++action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+diff --git a/tests/testsuites/rscript_re_match.conf b/tests/testsuites/rscript_re_match.conf
+new file mode 100644
+index 0000000..3e0f36f
+--- /dev/null
++++ b/tests/testsuites/rscript_re_match.conf
+@@ -0,0 +1,10 @@
++$IncludeConfig diag-common.conf
++template(name="outfmt" type="string" string="*Matched*\n")
++
++module(load="../plugins/imtcp/.libs/imtcp")
++input(type="imtcp" port="13514")
++
++if (re_match($msg, '.* ([0-9]+)$')) then {
++ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
++}
++
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch
new file mode 100644
index 000000000000..b42618048e88
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch
@@ -0,0 +1,141 @@
+From 3a10a78edeef9725f69a24d633bb394e365145f0 Mon Sep 17 00:00:00 2001
+From: Janmejay Singh <singh.janmejay@gmail.com>
+Date: Wed, 30 Sep 2015 17:24:38 +0530
+Subject: [PATCH] Fixed lookup-table reload bug, which ignored table-length of
+ reloaded table, resulting in additional entries being invisible while
+ looking-up (binary-search would work with old-table-length). This would be a
+ security-issue or may cause a crash if reloaded table is actually smaller
+ (memory access beyond table).
+
+---
+ runtime/lookup.c | 1 +
+ tests/Makefile.am | 5 +++++
+ tests/diag.sh | 4 ++++
+ tests/lookup_table.sh | 24 ++++++++++++++++++++++++
+ tests/testsuites/lookup_table.conf | 9 +++++++++
+ tests/testsuites/xlate.lkp_tbl | 5 +++++
+ tests/testsuites/xlate_more.lkp_tbl | 6 ++++++
+ 7 files changed, 55 insertions(+)
+ create mode 100755 tests/lookup_table.sh
+ create mode 100644 tests/testsuites/lookup_table.conf
+ create mode 100644 tests/testsuites/xlate.lkp_tbl
+ create mode 100644 tests/testsuites/xlate_more.lkp_tbl
+
+diff --git a/runtime/lookup.c b/runtime/lookup.c
+index 096bf09..5aa00b9 100644
+--- a/runtime/lookup.c
++++ b/runtime/lookup.c
+@@ -203,6 +203,7 @@ lookupReload(lookup_t *pThis)
+ }
+ free(pThis->d.strtab);
+ pThis->d.strtab = newlu.d.strtab; /* hand table AND ALL STRINGS over! */
++ pThis->nmemb = newlu.nmemb;
+ pthread_rwlock_unlock(&pThis->rwlock);
+ errmsg.LogError(0, RS_RET_OK, "lookup table '%s' reloaded from file '%s'",
+ pThis->name, pThis->filename);
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index d77728a..49cb641 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -130,6 +130,7 @@ TESTS += \
+ incltest_dir_wildcard.sh \
+ incltest_dir_empty_wildcard.sh \
+ linkedlistqueue.sh \
++ lookup_table.sh \
+ key_dereference_on_uninitialized_variable_space.sh
+
+
+@@ -860,6 +861,10 @@ EXTRA_DIST= \
+ testsuites/rscript_re_extract.conf \
+ rscript_re_match.sh \
+ testsuites/rscript_re_match.conf \
++ lookup_table.sh \
++ testsuites/lookup_table.conf \
++ testsuites/xlate.lkp_tbl \
++ testsuites/xlate_more.lkp_tbl \
+ cfg.sh
+
+ # TODO: re-enable
+diff --git a/tests/diag.sh b/tests/diag.sh
+index 95d6adb..c489fff 100755
+--- a/tests/diag.sh
++++ b/tests/diag.sh
+@@ -195,6 +195,10 @@ case $1 in
+ echo WaitMainQueueEmpty | ./diagtalker || . $srcdir/diag.sh error-exit $?
+ fi
+ ;;
++ 'issue-HUP') # shut rsyslogd down when main queue is empty. $2 is the instance.
++ kill -HUP `cat rsyslog$2.pid`
++ ./msleep 1000
++ ;;
+ 'shutdown-when-empty') # shut rsyslogd down when main queue is empty. $2 is the instance.
+ if [ "$2" == "2" ]
+ then
+diff --git a/tests/lookup_table.sh b/tests/lookup_table.sh
+new file mode 100755
+index 0000000..fae2fab
+--- /dev/null
++++ b/tests/lookup_table.sh
+@@ -0,0 +1,24 @@
++#!/bin/bash
++# added 2015-09-30 by singh.janmejay
++# This file is part of the rsyslog project, released under ASL 2.0
++echo ===============================================================================
++echo \[lookup_table_reload.sh\]: test for lookup-table and HUP based reloading of it
++. $srcdir/diag.sh init
++cp $srcdir/testsuites/xlate.lkp_tbl $srcdir/xlate.lkp_tbl
++. $srcdir/diag.sh startup lookup_table.conf
++. $srcdir/diag.sh injectmsg 0 3
++. $srcdir/diag.sh wait-queueempty
++. $srcdir/diag.sh content-check "msgnum:00000000: foo_old"
++. $srcdir/diag.sh content-check "msgnum:00000001: bar_old"
++. $srcdir/diag.sh assert-content-missing "baz"
++cp $srcdir/testsuites/xlate_more.lkp_tbl $srcdir/xlate.lkp_tbl
++. $srcdir/diag.sh issue-HUP
++. $srcdir/diag.sh injectmsg 0 3
++echo doing shutdown
++. $srcdir/diag.sh shutdown-when-empty
++echo wait on shutdown
++. $srcdir/diag.sh wait-shutdown
++. $srcdir/diag.sh content-check "msgnum:00000000: foo_new"
++. $srcdir/diag.sh content-check "msgnum:00000001: bar_new"
++. $srcdir/diag.sh content-check "msgnum:00000002: baz"
++. $srcdir/diag.sh exit
+diff --git a/tests/testsuites/lookup_table.conf b/tests/testsuites/lookup_table.conf
+new file mode 100644
+index 0000000..29bd805
+--- /dev/null
++++ b/tests/testsuites/lookup_table.conf
+@@ -0,0 +1,9 @@
++$IncludeConfig diag-common.conf
++
++lookup_table(name="xlate" file="xlate.lkp_tbl")
++
++template(name="outfmt" type="string" string="- %msg% %$.lkp%\n")
++
++set $.lkp = lookup("xlate", $msg);
++
++action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+diff --git a/tests/testsuites/xlate.lkp_tbl b/tests/testsuites/xlate.lkp_tbl
+new file mode 100644
+index 0000000..30e2796
+--- /dev/null
++++ b/tests/testsuites/xlate.lkp_tbl
+@@ -0,0 +1,5 @@
++{
++ "table":[
++ {"index":" msgnum:00000000:", "value":"foo_old" },
++ {"index":" msgnum:00000001:", "value":"bar_old" }]
++}
+diff --git a/tests/testsuites/xlate_more.lkp_tbl b/tests/testsuites/xlate_more.lkp_tbl
+new file mode 100644
+index 0000000..2d3f452
+--- /dev/null
++++ b/tests/testsuites/xlate_more.lkp_tbl
+@@ -0,0 +1,6 @@
++{
++ "table":[
++ {"index":" msgnum:00000000:", "value":"foo_new" },
++ {"index":" msgnum:00000001:", "value":"bar_new" },
++ {"index":" msgnum:00000002:", "value":"baz" }]
++}
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1 b/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1
new file mode 100644
index 000000000000..da48c01cd407
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1
@@ -0,0 +1,30 @@
+# /etc/conf.d/rsyslog
+
+# Configuration file
+#RSYSLOG_CONFIGFILE="/etc/rsyslog.conf"
+
+# PID file
+# If you should ever change this, remember to update
+# "/etc/logrotate.d/rsyslog", too.
+#RSYSLOG_PIDFILE="/run/rsyslogd.pid"
+
+# You can use this configuration option to pass additional options to the
+# start-stop-daemon, see start-stop-daemon(8) for more details.
+# Per default we wait 1000ms after we have started the service to ensure
+# that the daemon is really up and running.
+#RSYSLOG_SSDARGS="--wait 1000"
+
+# The termination timeout (start-stop-daemon parameter "retry") ensures
+# that the service will be terminated within a given time (60 + 5 seconds
+# per default) when you are stopping the service.
+# You need to increase the value when you are working with a large queue.
+# See http://www.rsyslog.com/doc/queues.html for further information.
+#RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5"
+
+
+# Options to rsyslogd
+# See rsyslogd(8) for more details
+# Notes:
+# * Do not specify another PIDFILE but use the variable above to change the location
+# * Do not specify another CONFIGFILE but use the variable above to change the location
+#RSYSLOG_OPTS=""
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1 b/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1
new file mode 100644
index 000000000000..078740d2e893
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1
@@ -0,0 +1,73 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+RSYSLOG_CONFIGFILE=${RSYSLOG_CONFIGFILE:-"/etc/rsyslog.conf"}
+RSYSLOG_PIDFILE=${RSYSLOG_PIDFILE:-"/run/rsyslogd.pid"}
+RSYSLOG_SSDARGS=${RSYSLOG_SSDARGS:-"--wait 1000"}
+RSYSLOG_TERMTIMEOUT=${RSYSLOG_TERMTIMEOUT:-"TERM/60/KILL/5"}
+RSYSLOG_OPTS=${RSYSLOG_OPTS:-""}
+
+command="/usr/sbin/rsyslogd"
+command_args="${RSYSLOG_OPTS} -f \"${RSYSLOG_CONFIGFILE}\" -i \"${RSYSLOG_PIDFILE}\""
+start_stop_daemon_args="${RSYSLOG_SSDARGS}"
+pidfile="${RSYSLOG_PIDFILE}"
+retry="${RSYSLOG_TERMTIMEOUT}"
+
+required_files="${RSYSLOG_CONFIGFILE}"
+
+description="RSYSLOG is the rocket-fast system for log processing (syslog replacement)."
+
+extra_commands="configtest"
+extra_started_commands="rotate"
+
+description_configtest="Run rsyslogd's internal config check."
+
+description_rotate="Sends rsyslogd a signal to re-open its log files."
+
+depend() {
+ need clock hostname localmount
+ provide logger
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_post() {
+ if [ -f "${RSYSLOG_PIDFILE}" ]; then
+ vebegin "Removing stale PID file"
+ rm --force "${RSYSLOG_PIDFILE}"
+ veend $?
+ fi
+}
+
+configtest() {
+ local _command_args="-N 999 -f \"${RSYSLOG_CONFIGFILE}\""
+ local _retval=0
+
+ ebegin "Checking rsyslogd's configuration"
+ eval ${command} ${_command_args} >/dev/null 2>&1
+ _retval=$?
+
+ if [ ${_retval} -ne 0 ]; then
+ eval ${command} ${_command_args}
+ fi
+
+ eend ${_retval} "failed, please correct errors above"
+}
+
+rotate() {
+ ebegin "Re-opening rsyslogd logs"
+ start-stop-daemon --signal SIGHUP --pidfile "${RSYSLOG_PIDFILE}"
+ eend $?
+}