442 Commits

Author SHA1 Message Date
Stephen Workman
b2e7c05263 Add parse_time() RainerScript function. 2017-11-06 13:01:00 -05:00
Rainer Gerhards
adec568655 cosmetic: fix code style, most importantly indention 2017-10-19 13:30:39 +02:00
Rainer Gerhards
9dab121f7b lookup table: fix fallthrough in case statement
... plus a case where we explicitley give fallthrough attribute
2017-10-19 13:29:45 +02:00
Stephen Workman
0ff332ab87 Remove NULL checks. 2017-10-11 17:19:34 -04:00
Stephen Workman
993f2ca187 Remove use of strftime(), for portability reasons. 2017-10-08 17:50:33 -04:00
Stephen Workman
7b5b6c2295 Use gmtime, and var2Number. 2017-10-05 21:31:26 -04:00
Stephen Workman
8d82d59343 Move formatting code to datetime.c, and update test. 2017-10-05 09:57:19 -04:00
Stephen Workman
e6edbbc598 Wip. 2017-10-04 22:08:49 -04:00
Stephen Workman
8391e0fdf1 Initial testing of format_time(). 2017-10-04 13:04:44 -04:00
Jan Gerhards
0abf897e52 rainerscript: add functions lTrim and rTrim
closes https://github.com/rsyslog/rsyslog/issues/1711
2017-08-09 15:45:30 +02:00
Jan Gerhards
779fce20b3 multiple modules: add better error messages when regcomp is failing
see also: https://github.com/rsyslog/rsyslog/issues/1102
2017-06-26 11:03:00 +02:00
Jiri Vymazal
ea477f961e reverted str2num() bSuccess return to be consistent with past behavior 2017-03-22 14:57:01 +01:00
Jan Gerhards
31ee2057f1 bugfix: str2num mishandling empty strings
If str2num() receives an empty string, misadressing happens.
Under extreme conditions, this theoretically can lead to a segfault.

closes https://github.com/rsyslog/rsyslog/issues/1412
2017-02-13 10:41:43 +01:00
Jan Gerhards
c41f91d249 add num2ipv4 function and test
closes https://github.com/rsyslog/rsyslog/issues/1322
2017-02-11 11:21:05 +01:00
Rainer Gerhards
f55c3cad93 Merge pull request #1405 from jgerhards/i1279
add ipv42num function and test
2017-02-10 17:32:14 +01:00
Jan Gerhards
00c2b4a4ae add ipv42num function and test
closes https://github.com/rsyslog/rsyslog/issues/1279
2017-02-10 15:13:07 +01:00
Rainer Gerhards
e2767839bc rainescript: set/unset statement do not check variable name validity
Only JSON-based variables can be use with set and unset. Unfortunately,
this restriction is not checked. If an invalid variable is given
(e.g. $invalid), this is not detected upon config processing on
startup. During execution phase, this can lead to a segfault, a
memory leak or other types of problems.

see also https://github.com/rsyslog/rsyslog/issues/1376
closes https://github.com/rsyslog/rsyslog/issues/1377
2017-01-24 13:24:29 +01:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
d8d7fc58cd rainerscript: implement new "call_indirect" statement
closes https://github.com/rsyslog/rsyslog/issues/1318
2016-12-11 12:06:28 +01:00
purnima
d45daa2af0 Rebase,redefine msgDestruct() as smsg_t is used 2016-11-22 14:24:25 +05:30
Janmejay Singh
1320d5ac24 Initialize func-data(and to-be-freed flag) correctly for prifilt function-node (identified in valgrind run in issue #1071), it is almost definitely independent of the problem that user observed, but is a low-value bug anyway. 2016-10-14 16:10:57 +05:30
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
fee6141c51 Merge pull request #1085 from rgerhards/conf-system
build system: do not enable -Werror on release builds
2016-09-05 18:44:15 +02:00
Rainer Gerhards
51c03c66e0 make inline functions C99-compliant
As it seems, different C compilers have different rules/interpretations
on inline functions. The current code base did not properly obey all C99
rules. We fix this by converting some functions to macros and others to
include the necessary C99 plumbing. We also remove some inline attributes
for functions where this seems to be to agressive (aka "function to big").

This fixes build problems in some environments and is a general code
cleanup measure.
2016-09-05 16:47:14 +02:00
Rainer Gerhards
799cbb9524 generate somewhat better syntax error messages on startup 2016-08-24 08:48:21 +02:00
Rainer Gerhards
bbcbb03c64 fix compiler warnings 2016-07-22 15:00:28 +02:00
Rainer Gerhards
9879e391dd check for invalid recursive include
closes https://github.com/rsyslog/rsyslog/issues/1058
2016-06-06 08:40:20 +02:00
Rainer Gerhards
b3940cb966 remove excessive "inline" attributes 2016-06-03 12:24:27 +02:00
Rainer Gerhards
c1f9374931 fix compiler warning 2016-06-03 11:35:08 +02:00
Rainer Gerhards
87063ea683 shut off unevitable compiler warnings in lexer subsystem
they are caused by generated code that we cannot change
2016-06-03 10:43:46 +02:00
Rainer Gerhards
4ac258360c fix gcc compiler warnings (in pretty strict mode) 2016-06-02 17:06:45 +02:00
Rainer Gerhards
a9ff73b628 do not break build if compiler does not understand pragma
this is the case for older gcc
2016-06-02 12:53:21 +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
17553f5195 cleanup: compiler warnings 2016-06-01 09:49:46 +02:00
Rainer Gerhards
070d987a45 fix compiler warnings 2016-06-01 09:49:46 +02:00
Rainer Gerhards
fb6af7689a fix a potentially uninitialized variable access
This is more to keep the compiler calm. We might check when else this
situation could happen.
2016-04-25 14:57:19 +02:00
Rainer Gerhards
e9954dbb5d flex generates code which triggers sign-warnings; disable them
this only affects the generated code, which we do not have control
over
2016-04-25 14:50:16 +02:00
Rainer Gerhards
d001942598 fix missing include file
closes https://github.com/rsyslog/rsyslog/issues/937
2016-04-05 12:35:22 +02:00
Rainer Gerhards
accfa81e5d cleanup: remove compatibility checks for old json-c
as we now use libfastjson, we do no longer need to check for "new"
features, as these are always present in libfastjson (things
like json_object_object_get_ex()).

closes https://github.com/rsyslog/rsyslog/issues/935
2016-04-05 12:16:09 +02:00
Rainer Gerhards
9843f061c6 Merge branch 'fix-cnfcurrfn' of https://github.com/rgerhards/rsyslog into master-candidate 2016-02-19 16:36:39 +01:00
Rainer Gerhards
d54fc97f0d bugfix: invalid definition in parser interface
can lead to build problems on some platforms and may also
lead to runtime problems (though there are no known reports
of any).

Thanks to Radu Gheorghe for bringing this up.
2016-02-19 10:23:46 +01:00
Rainer Gerhards
2e84681731 Merge branch 'fix-leading-underscore' of https://github.com/portante/rsyslog into merge-622 2016-02-17 18:21:37 +01:00
Janmejay Singh
25cc42c2ff pre-merged upstream for a clean merge-back 2016-02-04 16:14:21 +05:30
Sam Hanes
cf635309d5 Fix lexer bug affecting hex number literals.
This fixes a mistake in the lexer rule for hexadecimal number literals that prevented it from recognizing hex numbers containing more than one digit or the digits `8` or `9`.
2016-02-03 01:03:54 -08:00
Rainer Gerhards
3549041b0f Merge branch 'dyn_stats' of https://github.com/janmejay/rsyslog into master-integrate-dynstats
Conflicts:
	.travis.yml
	grammar/rainerscript.c
	plugins/imdiag/imdiag.c
2016-01-28 09:51:25 +01:00
Janmejay Singh
79d1bdbc03 reload_lookup_table second-param(stub-value to be used in case of reload failure) made optional 2015-12-22 01:10:36 +05:30
Janmejay Singh
bf43179381 moved to async(dispatched on a different thread) lookup-table reload (stub param is still mandatory, making it optional requires more work) 2015-12-21 23:42:11 +05:30
Peter Portante
bdc54a180e Accept leading underscores for variable names
The grammar now allows for leading underscores for variable names. This
addresses a problem stemming from the fact that the imjournal module
will create variables using the given name from systemd. All "trusted"
variables in systemd begin with a leading underscore.
2015-12-19 16:16:00 +00:00
Janmejay Singh
c226bb2f96 allocate in multiples of 4-bytes for string-buffer to be used with strlen (because valgrind that travis runs has a problem with strlen inspecting 4 bytes at a time which in the end falls off given allocation-size)
(cross-ported from dyn-stats branch, because valgrind on travis-build-machines doesn't like how strlen probes 4-bytes at a time)
2015-12-18 21:07:00 +05:30