118 Commits

Author SHA1 Message Date
Rainer Gerhards
e00580534b
core bugfix: potential race during HUP
when rsyslog is HUPed immediately after startup and before it is fully
initialized, there is a potential race with the list of loaded modules.

This patch ensures no bad things can happen in that case.

Detected by LLVM TSAN, not seen in practice.

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2020-01-20 08:22:15 +01:00
Rainer Gerhards
58dfe006a8
testbench: improve tests
modernize them, reduce robustness against slow machines, provide some
test framework functional enhancements and optimizie some tests
2020-01-19 16:09:44 +01:00
Rainer Gerhards
deb98fecc1
bugfixes: small issues detected by clang static analyzer 10 2019-12-18 11:37:00 +01: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
Rainer Gerhards
0c74a1902f
cleanup: remove commented-out code
detected by lgtm.com
2019-01-14 13:14:18 +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
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
4bcf65ed05
core: improve error message on module load fail 2018-09-07 11:52:28 +02:00
Rainer Gerhards
6efae3c2fd fix compile warnings under AIX
see also https://github.com/rsyslog/rsyslog/issues/2971
2018-08-31 05:14:01 -05:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Jan Gerhards
debea3785b remove unnecessary debug output
was used while implementing function modules, but were
not removed due to oversight.
2018-04-10 10:31:24 +02:00
Jan Gerhards
22fc00e897 rscript: make function modules loadable
function modules add functions to rainerscript dynamically,
change http_request into such a module (enabled by default).
This module can be used as a sample for future function modules.
2018-03-19 11:49:36 +01:00
Jan Gerhards
05582a24ca modules: use new errmsg interface
see also https://github.com/rsyslog/rsyslog/issues/1684
2018-01-12 09:47:11 +01:00
Rainer Gerhards
8cb0a95a38 code style: fix too-long lines 2017-12-23 18:25:37 +01:00
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
Rainer Gerhards
21f56adfac core: remove unnecessary check
Deteced by Coverity scan, CID 185324
2017-11-13 19:18:09 +01:00
Rainer Gerhards
025ed2a933 impstats bugfix: impstats does not handle HUP
If the parameter "log.file" is specified, impstats writes its own
log file. However, HUP is not handled for this file, which makes
the functionality unusable with log rotation. It is also counter-
intuitive for users.

This patch enables correct HUP processing. As a sideline, it also
introduces a generic HUP processing framework for non-action type
of loadable modules.

closes https://github.com/rsyslog/rsyslog/issues/1662
closes https://github.com/rsyslog/rsyslog/issues/1663
2017-07-20 14:22:19 +02:00
Rainer Gerhards
cc386e092f compatibility: fix warnings that occur on Solaris 2017-04-10 09:09:47 +02:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
cfacd4c30f code cleanup: fix compiler warnings that newly came up
we got a bunch of new ones under updated Fedora
2016-10-11 14:10:25 +02:00
Rainer Gerhards
b68155cd69 older gcc needs unused attribute at different location 2016-06-03 11:22:22 +02:00
Rainer Gerhards
7fd33c26f7 fix defintions for some dummy functions...
... which are primarily used as placeholders when intializing.
2016-06-03 10:24:19 +02:00
Rainer Gerhards
3a5ff24abf turn off some gcc warnings
we probably re-enable some of them later on again
2016-06-02 17:34:32 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
8a8675b223 fix compiler warnings 2016-06-02 10:18:05 +02:00
Rainer Gerhards
93e8b365d9 core: fix minor datatype errors 2016-06-01 11:00:41 +02:00
Rainer Gerhards
ed3bf185cb implement global parameter "debug.unloadModules"
This permits to disable unloading of modules, e.g.
to make valgrind reports more useful (without a need
to recompile).

implements https://github.com/rsyslog/rsyslog/issues/704
2016-03-03 15:33:05 +01:00
Rainer Gerhards
93416d26e6 fix problems found by clang static analyser
These were very theoretic, and enven the potential memory
leak would not have any effect. Thus it was not tried to solve
initially. Doing it now primarily so that static analyzer is
happy.
2016-01-29 18:08:43 +01:00
Rainer Gerhards
c2ac515bce core: do no longer emit compile-time warning if compiled for valgrind 2016-01-13 04:53:19 -05:30
Peter Portante
2470f0f72b Remove use of sizeof(char) and sizeof(uchar)
Remove the use sizeof(char) or sizeof(uchar) in calculations for memory
allocation or string length.  There are no known platforms for which
sizeof(char) or sizeof(uchar) is not 1, and c99 has defined sizeof(char)
to be 1 (section 6.5.3.4 of c99).
2015-12-16 02:18:45 +00:00
Rainer Gerhards
5a53035651 silence compiler warnings 2015-06-26 10:53:26 +02:00
Rainer Gerhards
ca3f961671 core engine: plugin IF extension to support wrkr-level HUP processing 2015-03-30 15:10:13 +02:00
Rainer Gerhards
5158095113 Merge branch 'v8-stable' 2014-07-22 16:21:49 +02:00
Rainer Gerhards
b038fe58cc Merge branch 'v7-stable' into v8-stable 2014-07-22 16:21:34 +02:00
Tomas Heinrich
257d035029 Remove dead code
Error: CLANG_WARNING:
rsyslog-7.4.10/runtime/modules.c:1133:4: warning: Value stored to 'iPathLen' is never read
2014-07-22 16:15:33 +02:00
Tomas Heinrich
b0ec251528 Use uchar instead of char for type size reference
Error: CLANG_WARNING:
rsyslog-7.4.10/runtime/modules.c:1086:26: warning: Result of 'malloc' is converted to a pointer of type 'uchar', which is incompatible with sizeof operand type 'char'
rsyslog-7.4.10/runtime/rsyslog.h:441:34: note: expanded from macro 'CHKmalloc'

Error: CLANG_WARNING:
rsyslog-7.4.10/runtime/modules.c:1109:26: warning: Result of 'malloc' is converted to a pointer of type 'uchar', which is incompatible with sizeof operand type 'char'
rsyslog-7.4.10/runtime/rsyslog.h:441:34: note: expanded from macro 'CHKmalloc'
2014-07-22 16:15:06 +02:00
Tomas Heinrich
7528e7ac1c bugfix: prevent a potential memleak
Error: RESOURCE_LEAK (CWE-772):
rsyslog-7.4.10/runtime/modules.c:394: alloc_fn: Storage is returned from allocation function "malloc(size_t)".
rsyslog-7.4.10/runtime/modules.c:394: var_assign: Assigning: "pNew" = storage returned from "malloc(32UL)".
rsyslog-7.4.10/runtime/modules.c:406: leaked_storage: Variable "pNew" going out of scope leaks the storage it points to.
2014-07-22 16:14:34 +02:00
Rainer Gerhards
5cba7d2f55 Merge branch 'v7-stable' into v8-stable 2014-07-09 11:56:44 +02:00
Rainer Gerhards
ac333cd917 cleanup no longer needed dependency 2014-07-08 20:50:19 +02:00
Rainer Gerhards
382cc3b156 Merge branch 'master' into master-parser-obj 2014-07-08 20:45:54 +02:00
Rainer Gerhards
27ba29abfc implement parse() config object
including the necessary plumbing to support multiple parser
instances
2014-07-08 20:44:43 +02:00
Rainer Gerhards
cfb95b1ac8 bugfix: mishandling of input modules not supporting new input instances
If they did not support this, accidently the output module part of the
module union was written, leading to unpredictable results. Note: all
core modules do support this interface, but some contributed or very
old ones do not.
2014-07-08 18:19:58 +02:00
Rainer Gerhards
b5dcbf9167 refactor: do not require transactional omods to provide doAction() 2013-12-04 12:30:52 +01:00
Rainer Gerhards
fb6dd02afc refactor milestone: create first PoC of commitTransaction() entry point 2013-12-04 11:38:07 +01:00
Rainer Gerhards
9cc097832b failed action detection more precisely for a number of actions
If an action  uses string parameter passing but is non-transactional
it can be executed immediately, giving a quicker indicatio of
action failure.
2013-12-03 10:20:45 +01:00
Rainer Gerhards
64a4358384 add freeWrkrInstance to output module interface 2013-10-29 16:17:46 +01:00