12315 Commits

Author SHA1 Message Date
Rainer Gerhards
c200f1fca0
Merge pull request #2688 from rgerhards/fix-mmgrok
mmgrok: fix potential segfault
2018-05-07 09:12:14 +02:00
Rainer Gerhards
87d0d56314 mmgrok: fix potential segfault
The modules used strtok(), which is not thread-safe. So it will potentially
segfault when multiple instances are spawned (what e.g. happens on busy
systems).

This patch replaces strtok() with its thread-safe counterpart
strtok_r().

see also https://github.com/rsyslog/rsyslog/issues/1359
2018-05-04 14:07:12 +02:00
Rainer Gerhards
0e3f0a5348
Merge pull request #2684 from rgerhards/imklog-internal-errmsg
imklog: better internal bug tracking
2018-05-04 13:08:48 +02:00
Rainer Gerhards
7b92b5e45c
Merge pull request #2686 from rgerhards/coverity-regression
omfwd: fix memory leak in never-released code
2018-05-04 12:01:03 +02:00
Rainer Gerhards
9d58f8e70c maintain ChangeLog 2018-05-04 10:35:26 +02:00
Rainer Gerhards
26f37fa841
Merge pull request #2499 from berenddeschouwer/imklog-ratelimit
Enable ratelimit on imklog
2018-05-04 10:34:16 +02:00
Rainer Gerhards
16284223c2 imklog: better internal bug tracking
there is a sanity check meant to catch coding bugs, but so far
it did not complain loudly enough. Now it's a user-visible message.
2018-05-04 10:05:52 +02:00
Rainer Gerhards
84980e2883 omfwd: fix memory leak in never-released code
This is a regression from
https://github.com/rsyslog/rsyslog/commit/2bd0fb282df92962a9817b

PR https://github.com/rsyslog/rsyslog/pull/2651 introduced that commit.

Note: that commit was merged 17 days ago and is not part of any offically
released version.

Detected by Coverity Scan, CID 190071, 190072.
2018-05-04 10:05:28 +02:00
Rainer Gerhards
5c0172bf88
Merge pull request #2687 from rgerhards/work-around-bsd
testbench: temporarily disable test failing on FreeBSD
2018-05-04 10:04:54 +02:00
Rainer Gerhards
6cdbf9de14 testbench: temporarily disable test failing on FreeBSD
The preloaded library causes some side-effect, which we so far
did not find. We try to avoid making CI always fail, and so we
skip the test on FreeBSD for now.
2018-05-04 09:07:37 +02:00
Berend De Schouwer
e4a8522c7a imklog: add ratelimiting capability
On Linux kernel logs are ratelimited only for messages using
printk_ratelimit().  Some logs do not use this facility, so
we ratelimit kernel ourselves.
2018-05-03 14:09:06 +02:00
Rainer Gerhards
548598ce23 maintain ChangeLog 2018-05-03 09:40:08 +02:00
Rainer Gerhards
2a29aa542c
Merge pull request #2656 from PascalWithopf/relp-long-msg
imrelp: add parameter oversizeMode
2018-05-03 09:24:40 +02:00
PascalWithopf
3ba85e1490 imrelp: adjust test to new error message 2018-05-02 14:59:44 +02:00
PascalWithopf
a94a4147d1 imrelp: maxDataSize dflt set correctly by maxMessageSize
Until now maxDataSize was not set correctly because of the
following order of events.
 * MaxMessageSize default value is set.
 * MaxDataSize default value is set by maxMessageSize.
 * Only now maxMessageSize is set as the configured value.

Because of that, maxDataSize never had the configured maxMessageSize value.
See: https://github.com/rsyslog/rsyslog/issues/1782#issuecomment-352027757

Now maxMessageSize is set before being used by maxDataSize as default, as
described here:
https://github.com/rsyslog/rsyslog/pull/1525#issuecomment-384179393
2018-05-02 12:55:22 +02:00
PascalWithopf
97d51326c3 imrelp: check for maxDatasize at right position
The value of maxDataSize is now checked at the right
position and an improved err msg is put out.
2018-05-02 12:38:22 +02:00
Rainer Gerhards
a612824dfe maintain ChangeLog 2018-05-02 10:46:24 +02:00
Rainer Gerhards
820efe4271
Merge pull request #2669 from rgerhards/nsdsel-poll
nsdsel_ptcp: replace select() by poll()
2018-05-02 10:44:16 +02:00
Rainer Gerhards
951ac16cf8
Merge pull request #2670 from PascalWithopf/i2480
add test for issue https://github.com/rsyslog/rsyslog/issues/2480
2018-05-02 10:42:32 +02:00
Rainer Gerhards
0773e1b8f5
Merge pull request #2598 from abwaheed/master
omkafka: added implstats counters for librdkafka returned statistics …
2018-05-02 08:44:33 +02:00
PascalWithopf
7fa60f11f4 imrelp: add new oversizeMode option accept
oversizeMode opion accept added
test for new option added
2018-05-02 08:42:24 +02:00
PascalWithopf
7ed930ff08 imrelp: checks availability before using oversizeMode
imrelp checks if the relp version is supporting oversizeMode.
If not then it is disabled and an error message is put out.
2018-05-02 08:40:26 +02:00
PascalWithopf
e7d5e64ebe codestyle: imrelp added to codestyle check 2018-05-02 08:40:26 +02:00
PascalWithopf
7f78f3c417 imrelp: add parameter oversizeMode
Parameter defines the way oversized messages are handled.
Default is that messages are truncated.
Test was added for message truncation.
2018-05-02 08:40:26 +02:00
PascalWithopf
0becc234f2 imrelp: add test for receiving long messages 2018-05-02 08:34:58 +02:00
PascalWithopf
6d7c6fe631 add test for wtpShutdownAll assertion failure on stop 2018-05-02 08:22:58 +02:00
Rainer Gerhards
dea7f6c7fb testbench: improve hostname-getaddrinfo-fail.sh test
this looks failed even when OK - clarifying things
2018-05-01 13:30:37 +02:00
Rainer Gerhards
62984ecfde maintain ChangeLog 2018-05-01 12:55:15 +02:00
Rainer Gerhards
47a796a40c
Merge pull request #2664 from PascalWithopf/imrelp-maxDataSize
imrelp: maxDataSize can only be set larger than maxMessageSize
2018-05-01 12:46:15 +02:00
Rainer Gerhards
45b45f5f09
Merge pull request #2675 from rgerhards/devopt
improve error reporting and add internal developer option
2018-05-01 12:45:34 +02:00
Rainer Gerhards
c12adee612 maintain ChangeLog 2018-04-28 14:04:21 +02:00
Rainer Gerhards
e011c62317
Merge pull request #2674 from rgerhards/i2399
bugfix: rsyslog aborts on startup when specific config errors are made
2018-04-28 14:01:44 +02:00
Rainer Gerhards
bd6f016db0 add global option internal.developeronly.options
This permits the ability to set some developer-specific behaviour
changes, e.g. for testbench testing or things like this. NEVER to
be used by users.
2018-04-28 12:46:32 +02:00
Rainer Gerhards
2f8d8fb3f5 config processing: improve error reporting
provide better error messages and make sure errors detected by
the script optimizer are also output if rsyslog aborts early
due to config error.

Also a bit of code improvement (errno etc).
2018-04-28 12:15:07 +02:00
Rainer Gerhards
09e3d06c11 bugfix: rsyslog aborts on startup when specific config errors are made
The following errors must be made in rsyslog.conf:
* no action present
* a call statement is used on an undefined ruleset

In this case, rsyslog emits an error message on the missing actions and
then segfaults. Depending on memory layout, it may also continue to run
but do nothing except accepting messages as no action is configured.

This patch make rsyslog properly terminate after the error message. It
is a change in behavior, but there really is no reason why a defunct
instance should be kept running.

closes https://github.com/rsyslog/rsyslog/issues/2399
2018-04-28 12:00:34 +02:00
Rainer Gerhards
a95c447fb1 maintain ChangeLog 2018-04-27 15:35:01 +02:00
Rainer Gerhards
b739f8648e
Merge pull request #2671 from rgerhards/debug-nit
cosmetic bugfix: valgrind complain in some error conditions
2018-04-27 15:32:38 +02:00
Rainer Gerhards
eacf601f54
Merge pull request #2667 from rgerhards/i2662
imfile bugfix: statefiles contain invalid JSON
2018-04-27 15:31:22 +02:00
Rainer Gerhards
d09323324f cosmetic bugfix: valgrind complain in some error conditions
When a "call" script statement was used with a non-existing ruleset AND
debug logginf was active for rainerscript.c, valgrind complained and
one debug message could potentially be incorrect (stating a queue
where non was).

This was caused by not initializing a variable which was probed in
debug mode before it was set. Non-debug mode was not affected.

see also https://github.com/rsyslog/rsyslog/issues/2399#issuecomment-384890873
2018-04-27 13:04:51 +02:00
PascalWithopf
57b9eefc46 imrelp: maxDataSize can only be set larger than maxMessageSize
maxDataSize specifies the length which will still be accepted
but is larger than the global parameter maxMessageSize.
2018-04-27 09:40:21 +02:00
Rainer Gerhards
b640a84242 nsdsel_ptcp: replace select() by poll()
This removes us of problems with fds > 1024. The performance will
probably also increase in most cases.

Note this is not a replacement for the epoll drivers, but a general
stability improvement when epoll() is not available for some reason.

see also https://github.com/rsyslog/rsyslog/issues/2615
closes https://github.com/rsyslog/rsyslog/issues/1728
closes https://github.com/rsyslog/rsyslog/issues/1459
2018-04-27 09:10:36 +02:00
Rainer Gerhards
2c50bf0d9d maintain ChangeLog 2018-04-27 09:08:48 +02:00
Rainer Gerhards
f0c89d0e13
Merge pull request #2651 from mikebcom/feature
omfwd: add support for bind-to-address for UDP
2018-04-27 08:58:06 +02:00
Rainer Gerhards
f5a95187b5
Merge pull request #2666 from rgerhards/i2665
core: config optimizer did not handle call_indirect
2018-04-27 08:51:48 +02:00
Rainer Gerhards
81b48e2a72
Merge pull request #2668 from rgerhards/fix2480
core bugfix: segfault on queue shutdown
2018-04-27 08:48:06 +02:00
Rainer Gerhards
8eead67caf
Merge pull request #2648 from jgerhards/errmsg-omshell
omshell: use new errmsg interface
2018-04-26 18:43:57 +02:00
Rainer Gerhards
0683ba76a2 core bugfix: segfault on queue shutdown
if a ruleset queue is in direct mode, a segfault can occur during
rsyslog shutdown. The root cause is that a direct queue does not
have an associated worker thread pool, but the ruleset destructor
does not anticipate that and tries to destruct the worker thread
pool. It needs to do this itself, as otherwise we get a race
between rulesets on shutdown.

This is a regression from
  https://github.com/rsyslog/rsyslog/commit/3fbd901b3e6300010

closes https://github.com/rsyslog/rsyslog/issues/2480
2018-04-26 18:25:32 +02:00
Rainer Gerhards
f71e2f21b4 imfile bugfix: statefiles contain invalid JSON
When imfile rewrites state files, it does not truncate previous
content. If the new content is smaller than the existing one, the
existing part will not be overwritten, resulting in invalid json.
That in turn can lead to some other failures.

closes https://github.com/rsyslog/rsyslog/issues/2662
2018-04-26 17:26:45 +02:00
Rainer Gerhards
0ca21d9190 core: config optimizer did not handle call_indirect
closes https://github.com/rsyslog/rsyslog/issues/2665
2018-04-26 13:17:26 +02:00
Rainer Gerhards
688d05854a maintain ChangeLog 2018-04-20 13:13:21 +02:00