1529 Commits

Author SHA1 Message Date
Jiri Vymazal
937e278fdf Stricter GnuTLS operation
This commit adds to new flags which can be set to allow
1) checking of extendedKeyUsage certificate field
2) stricter checking of certificate name/adresses
2019-08-30 09:40:25 +02:00
Rainer Gerhards
bb7db923ad
iminternal bugfix: race on termination 2019-08-03 14:33:54 +02:00
Rainer Gerhards
689e657090
core/janitor bugfix: properly maintain dynafile cache
When the janitor cleans out timed-out files, it does not
properly indicate the entry is gone. Especially when running
in async mode this can lead to use-after-free and thus
memory corruption or segfault.

see also https://github.com/rsyslog/rsyslog/issues/3756
2019-08-01 15:57:52 +02:00
Thomas Blume
2e9d389419 iminternal: suppress mutex double-unlock
If there is a burst of log messages during a time when rsyslog is unable
to output (either during log rotation, an out-of-space condition, or
some other similar condition), rsyslog can SEGFAULT due to a mutex
double-unlock.
2019-07-11 12:58:10 +02:00
Rainer Gerhards
b9066d1c86
fix leading double space in rsyslog startup messages
see also https://github.com/rsyslog/rsyslog/issues/2979
2019-07-02 16:04:33 +02:00
Rainer Gerhards
b54a377f55
omfile: fix potential hang/segfault on HUP of dynafile action
when omfile was HUPed it did not sufficiently clear all dynafile
cache maintenance data structures. This usually lead to misadressing
and could result in various issues, including a hang of rsyslog
processing or segfaults. It could also have "no effect" by pure
luck of not hitting anything important. This actually seems to
have been the most frequent case.

This seems to be a long-standing bug, but the likelyhood of its
appearance seems to have been increased by commit 62fbef7
introduced in 8.1905. Note: the commit itself has no regression,
just increases the likelyhood to trigger the pre-existing bug.

special thanks to Alexandre Guédon for his help in analyzing
the issue - without him, we would probably still not know
what actually went wrong.

closes https://github.com/rsyslog/rsyslog/issues/3686
2019-06-21 13:14:49 +02:00
Rainer Gerhards
68686a3a51 debug: add instrumentation to investigate 8.1905.0 regression
see also https://github.com/rsyslog/rsyslog/issues/3686
2019-06-21 09:33:06 +02:00
Rainer Gerhards
1c8712415b platform bugfix: HUP did not work reliably on some platforms
... at least not on FreeBSD. The problem was that HUP did not awake
the main loop. We know interrupt it explicitely.
2019-06-14 08:39:44 +02:00
StrongestNumber9
8791323c92 Fixes #3667 2019-05-17 15:16:13 +03:00
Rainer Gerhards
d9d12071f3
change default of internalmsg.severity global parameter, add tests
also fix a problem in handling this parameter when rsyslog processed
internal messages itself (it did not work). As the parameter was
introduced today, we do not flag this follow-up commit as "bugfix".
The issue was noticed when we added the additional tests.

see also https://github.com/rsyslog/rsyslog/issues/3650
see also https://github.com/rsyslog/rsyslog/issues/3639
2019-05-09 12:13:45 +02:00
Rainer Gerhards
b7e18513fd core: harden shutdown processing on FreeBSD
root cause seems to be that SIGTERM is delivered differently under
FreeBSD. This causes the main thread to not be awaken, and so it
takes until the next janitor interval to come back to life - which
can be far too long. Fixed this bug explicitley awaking the main
thread.

also

* re-enable test that did not work because of this
* fix invalid message on SIGTERM in debug log
2019-05-09 11:08:38 +02:00
Rainer Gerhards
160f2d7a52
new global config parameter "internalmsg.severity"
permits to specify a severity filter for internal message. Only
messages with this severity level or more severe are logged.

Orignally this was done in rsyslog.conf as usual: you can filter
rsyslog messages on severity, just like any other. But with systemd,
we now emit primarily to the journal, and this is outside of rsyslog's
rule engine and so regular filters do not apply (at least in regard
to the journal). Logging to journal is good, because finally
folks begin to see the messages (traditional distro configs discard
them, for whatever is the reason).

This commit implements a global setting for a severity-based filter
for internal messages, before submitted to journal. So it's not 100%
of what rsyslog can do, but at least some way to customize.

see also https://github.com/rsyslog/rsyslog/issues/3639
2019-05-07 11:27:08 +02:00
Rainer Gerhards
32c5ade046
fix cosmetic coverity leak report (CID 207601)
While in theory this is a leak, in practice it's extremely unlikely
and irrelevant. Nevertheless, let's fix it ;-)
2019-04-30 08:52:46 +02:00
Rainer Gerhards
62fbef7f72
omfile bugfix: FlushOnTXEnd does not work reliably with dynafiles
The flush was only done to the last dynafile in use at end of
transactions. Dynafiles that were also modified during the
transaction were not flushed.

Special thanks to Duy Nguyen for pointing us to the bug and
suggesting a solution.

This commit also contains a bit of cosmetic cleanup inside
the file stream class.

closes https://github.com/rsyslog/rsyslog/issues/2502
2019-04-29 15:56:41 +02:00
Rainer Gerhards
68a00b0bd5
add capability to write full config file (-o cmdline option)
Introduces the capability to create an output config file that explodes
all "includes" into a single file. This provides a much better overview
of how exactly the configuration is crafted. That could often be a great
troubleshooting aid.

This commit also contains some slight not-really-related cleanup.

closes https://github.com/rsyslog/rsyslog/issues/3634
2019-04-28 11:52:51 +02:00
Rainer Gerhards
2ac1cfdac2
command line interface: finally remove old -s, -l options
These options generate warning messages that they will go away
for years now. Nobody has complained about this fact (the message
request that). So we assume it is safe to finally remove them.
This helps to clean up rsyslog code and remove unneeded cruft.
2019-04-17 18:46:23 +02:00
Philippe Duveau
3ec965f8b3 AIX_port: corrects style and compatibility issues (4) 2019-02-14 17:50:00 +01:00
Philippe Duveau
11c6365eba AIX_port: corrects style and compatibility issues (3) 2019-02-14 17:17:37 +01:00
Philippe Duveau
9ad7324dfa AIX_port: second phase 2019-02-14 14:36:05 +01:00
Homero Pawlowski
c456e79a87 Fixed typo in rsyslog.conf.5 2019-01-21 13:39:40 -05:00
Rainer Gerhards
5cc027084f
Merge pull request #3376 from Whissi/issue3346
omusrmsg: don't overwrite previous set _PATH_DEV value
2018-12-30 16:58:48 +01:00
Rainer Gerhards
34241cc1c5
Merge pull request #3328 from jsiwrk/child_exit_report_option
report child process exit status according to config parameter
2018-12-30 12:55:28 +01:00
Thomas Deutschmann
7a90ac51d1
omusrmsg: don't overwrite previous set _PATH_DEV value
Since commit 56ace5e418d149af27586c7c1264fccfbc6badf1, omusrmsg was broken
because "memcpy()" is not a suitable substitute for "strncat()" in this
context, it is actually replacing the previous added content.

Bug: https://bugs.gentoo.org/673004
Closes: https://github.com/rsyslog/rsyslog/issues/3346
2018-12-25 23:58:19 +01:00
Rainer Gerhards
9bd138d299
introduce new versioning scheme for rsyslog
see also https://rainer.gerhards.net/2018/12/rsyslog-version-numbering-change.html
2018-12-22 10:48:53 +01:00
Joan Sala
9315787c6d report child process exit status according to config parameter
Add new global setting 'reportChildProcessExits' with possible values
'none|errors|all' (default 'errors'), and new global function
'glblReportChildProcessExit' to report the exit status of a child
process according to the setting.

Invoke the report function whenever rsyslog reaps a child, namely in:
- rsyslogd.c (SIGCHLD signal handler)
- omprog
- mmexternal
- srutils.c (execProg function, invoked from stream.c and omshell)

Remove redundant "reaped by main loop" info log in omprog.

Promote debug message in mmexternal indicating that the child has
terminated prematurely to a warning log, like in omprog.

Closes #3281
2018-12-21 20:29:01 +01:00
3d9b8df6fb tls(ossl/gtls): add new Option "StreamDriver.PermitExpiredCerts"
The new Option can have one of the following values:
on = Expired certificates are allowed
off = Expired certificates are not allowed
warn = Expired certificates are allowed but warning will be logged (Default)

Includes necessary tests to validate new code.

closes https://github.com/rsyslog/rsyslog/issues/3364
2018-12-21 15:24:41 +01:00
937dbcb801 bugfix tls subsystem: Receiver hang due to insufficient TLS buffersize.
gtls and ossl driver used a default buffersize of 8 x 1024 bytes to store
received TLS packets. When tls read returned more than buffersize, the additional
buffer was not processed until new data arrived on the socket again.

TLS RFCs require up to 16KB buffer for a single TLS record.

closes https://github.com/rsyslog/rsyslog/issues/3325
2018-12-18 14:44:58 +01:00
Josh Soref
bfd9248670 spelling: https 2018-11-14 11:56:57 -05:00
Josh Soref
d642d984d3 canonical url www.rsyslog.com/doc/ 2018-11-14 12:03:20 -05:00
Rainer Gerhards
978cc7692d
AIX: handle forking in a defined way
albeit not necessarily correct - see code comment
2018-11-06 11:53:11 +01:00
Thomas Deutschmann
d5ffe6e10e
build system: don't link liblogging-stdlog when available but not enabled
When liblogging-stdlog was available but configure option "--disable-liblogging-stdlog"
was set, rsyslog was still linking against liblogging-stdlog.

This commit will ensure that rsyslog will only link against liblogging-stdlog when
"--enable-liblogging-stdlog" was set.

Bug: https://bugs.gentoo.org/667836
2018-11-03 23:21:29 +01:00
Rainer Gerhards
9bece39dc6
SQUASH
debug cleanup: remove some old, no longer used macros
2018-10-30 12:46:04 +01:00
Rainer Gerhards
d09416c95f
core: add operating state file capability (new feature)
adds global(operatingStateFile="fn") and related handling (see doc
for details).

closes https://github.com/rsyslog/rsyslog/issues/1721
2018-10-29 15:59:47 +01:00
Rainer Gerhards
223c03e536
cleanup: remove commented-out code
thanks to lgtm.com for the ability to detect commented out code!
2018-10-27 19:04:30 +02:00
Rainer Gerhards
21c4862623
Merge pull request #3188 from rgerhards/cleanup4
cleanup: remove unneeded code
2018-10-26 15:42:54 +02:00
Rainer Gerhards
f3fa82acd6
core/debug: data written to random fd 2 under some debug settings
This happens only during auto-backgrouding, where we cannot any longer
access stderr. Whatever is opened with fd2 receives some debug messages.
Note that the specific feature is usually turned on only in CI runs.
2018-10-26 11:14:11 +02:00
Rainer Gerhards
45b7a97daa
cleanup: remove unneeded code
The syncdemo program was actually that, a demo program to explain
some concepts. It's not really related to the rsyslog code base.
2018-10-26 09:41:50 +02:00
Rainer Gerhards
3b5ed2d046
cleanup: remove no longer needed code
see also https://github.com/rsyslog/rsyslog/issues/2211
2018-10-25 17:52:45 +02:00
Rainer Gerhards
bbd9e3f8f2
AIX portability: add missing symbol to export file
unfortunately, AIX does not export all public symbols (or I
consistently fail in trying to convince it...)
2018-10-20 11:36:35 +02:00
Rainer Gerhards
997de6f214
bugfix core msg: potential deadlock (and rsyslog hang)
can happen e.g. with headerless messages when app-name
property is used

closes https://github.com/rsyslog/rsyslog/issues/3135
2018-10-17 10:41:11 +02:00
Rainer Gerhards
949181c373
errmsg: remove no longer needed code
object-ish style is no longer needed and can finally be removed

closes https://github.com/rsyslog/rsyslog/issues/1684
2018-09-28 15:03:39 +02:00
Rainer Gerhards
50f239d17d
cleanup: remove no longer needed code 2018-09-22 16:04:13 +02:00
Rainer Gerhards
502759aea0
core: emit TZ warning on startup not on Linux non-container
On Linux it seems common that the TZ variable is NOT properly set.
There are some concerns that the warning related to rsyslog correcting
this confuses users. It also seems that the corrective action rsyslog
takes is right, and so there is no hard need to inform users on that.
In Linux containers, however, the warning seems to be useful as the
timezone setup there seems to be frequently-enough different and
rsyslog's corrective action may not be correct.

So we now check if we are running under Linux and not within a container.
If so, we do not emit the warning. In all other case, we do. This is
based on the assumption that other unixoid systems still should have
TZ properly set.

closes https://github.com/rsyslog/rsyslog/issues/2994
2018-09-17 08:56:09 +02:00
Rainer Gerhards
d4464e2950
Merge pull request #3001 from rgerhards/i2997
AIX: HUP not processed when running as non-service
2018-09-07 16:24:34 +02:00
Rainer Gerhards
31d58a2eee AIX: HUP not processed when running as non-service
When rsyslog is not run as a service (under SRC control), HUP does not
awake the main loop timeout. In theory, it should do so, but in practice
this does not happen. As a work-around we now implement a kind of
ressource-saving busy waiting where we awake every half second to check
if HUP (or something else noteworthy) happened. This should not cause
any real issue in any case, because running rsyslog as a non-service
is very uncommon and probably only happens during testbench runs.

closes https://github.com/rsyslog/rsyslog/issues/2997
2018-09-07 03:25:38 -05:00
Rainer Gerhards
ef6d877540 fix build error e.g. on FreeBSD
regression form 9c0f2d4066b7d5a393f2f5acd080caa4dc4c1144
2018-09-07 10:24:49 +02:00
Rainer Gerhards
d98f1cbb9d AIX: some more rsyslog core symbols need to be exported
seen while working on testbench. Unfortunately, we seem to be unable
to automatically export all global symbols, which is what we really
need.
2018-09-06 11:03:04 -05:00
Rainer Gerhards
9c0f2d4066 build system: fix platform linker options detection
most importantly, it did not work for AIX, which resulted in problems
starting up rsyslog
2018-09-06 03:37:15 -05:00
Rainer Gerhards
0ce02e4a71
omfwd: remove invalid error message
The config plumbing itself provides an error message. The one given here
was also totally wrong ;-)

Thanks to Frank Bicknell for spotting this message and making me alert.
2018-09-04 12:35:11 +02:00
Rainer Gerhards
3ae8dfdd67
Merge pull request #2977 from fbicknel/fbicknel/fix_dynafile_error_message
WiP: Fix errant error message when dynafile param needed
2018-09-04 12:26:46 +02:00