Jan Gerhards
f5eef34361
rscript: add int2Hex
...
closes https://github.com/rsyslog/rsyslog/issues/2224
2017-12-24 11:46:57 +01:00
Rainer Gerhards
8cb0a95a38
code style: fix too-long lines
2017-12-23 18:25:37 +01:00
Rainer Gerhards
49f9b26601
Merge pull request #2246 from mrworkman/rscript-is-timestamp
...
Add is_time() RainerScript function.
2017-12-22 12:49:02 +01:00
PascalWithopf
29c9fb1f9a
codestyle: reduce line length to 120
...
lines are still checked for a length of 125 because
these are just some of the lines
2017-12-21 17:09:32 +01:00
PascalWithopf
79de51e4fc
codestyle: reduce max line length to 125
2017-12-20 16:16:57 +01:00
Stephen Workman
027e4f685e
Refactor into separate function.
2017-12-19 09:12:09 -05:00
Stephen Workman
cdc779760b
Add is_time() RainerScript function.
2017-12-19 09:12:09 -05:00
Rainer Gerhards
4642df4388
Merge pull request #2252 from rgerhards/i-352
...
import BSD project and Solaris patches
2017-12-19 08:11:02 +01:00
Rainer Gerhards
1fe5b790ba
Merge pull request #2256 from rgerhards/i-2255
...
script engine: improper string-to-number conversion for negative numbers
2017-12-19 08:10:00 +01:00
Rainer Gerhards
46f4f43b8f
build: permit to disable libcurl for rsyslog core
...
currently, this disables the http_request() script function
see also https://github.com/rsyslog/rsyslog/pull/2146#issuecomment-352412933
see also https://github.com/rsyslog/rsyslog/pull/2146#issuecomment-352413248
2017-12-18 18:56:37 +01:00
Rainer Gerhards
6a140a2cb3
script engine: improper string-to-number conversion for negative numbers
...
Thanks to Stephen Workman for providing a very detailled hint of the
problem and root cause. This patch bases on his recommendation for a
fix.
closes https://github.com/rsyslog/rsyslog/issues/2255
2017-12-18 17:50:32 +01:00
BSD Patch
e7ee458146
lexer.l: import patch used by BSD projects
2017-12-18 13:15:13 +01:00
Rainer Gerhards
49efb53985
rainerscript: new function "http_request"
...
closes https://github.com/rsyslog/rsyslog/issues/1977
2017-12-16 17:47:08 +01:00
Rainer Gerhards
23a41c87d4
Merge pull request #2198 from rgerhards/i-1979
...
config: implement function parse_json()
2017-12-12 16:42:43 +01:00
Rainer Gerhards
0d0ff11991
config: implement function parse_json()
...
It is useful to be able to parse arbitrary JSON strings without the need
of an external message modification module. For example, together with
https://github.com/rsyslog/rsyslog/issues/1977
this can be used to parse out specific fields from Amazon AWS
configuration info. There are also other ample uses for such functionality.
closes https://github.com/rsyslog/rsyslog/issues/1979
2017-12-12 11:35:29 +01:00
Rainer Gerhards
4d1e10ad46
Merge pull request #2191 from jgerhards/rscript_substring
...
rainerscript: implement substring function
2017-12-12 11:07:25 +01:00
Jan Gerhards
effee21a81
rainerscript: implement substring function
2017-12-10 14:24:46 +01:00
Rainer Gerhards
ce06bba15c
RainerScript: implement previous_action_suspended() function
...
This function returns a boolean indicating if the previous action is
suspended (0 - no, 1 - yes). This is useful if arbitrary processing
(other than calling actions) should be made depending on that state.
A prime example for this is probably calling a ruleset.
closes https://github.com/rsyslog/rsyslog/issues/1939
2017-12-09 17:48:28 +01:00
Rainer Gerhards
b63d3051bc
RainerScript: add function script_error() and error-reporting support
...
This permits script functions that could fail to report errors back, so
that the user can handle them if desired. We use an errno-style of
interface. That means script_error() needs to be called after functions
that supports it. It will return either 0 (all OK) or something else
(an error condition).
The commit also modifies the parse_time() function to use the new
interface. First of all, this is useful for users, and secondly we
needed a capability to craft a testbench test.
closes https://github.com/rsyslog/rsyslog/issues/1978
2017-12-09 16:08:36 +01:00
Rainer Gerhards
3c18216588
config processing: ensure proper alignment
...
This came up on arm (raspbian) build, but is probably the right thing
to do in any case!
2017-12-08 14:58:45 +00:00
Jan Gerhards
38d92ff814
rainerscript: bugfix
...
fix a bug causing a crash if rtrim or ltrim were called
with a string containing a blank and one single different character.
closes https://github.com/rsyslog/rsyslog/issues/2127
2017-12-02 18:26:39 +01:00
Rainer Gerhards
1bb9aa4c38
work around flex/bison problems with gcc-7
2017-11-29 12:39:07 +01:00
Rainer Gerhards
047624147c
some primarily cosmetic changes
2017-11-22 12:33:03 +01:00
Rainer Gerhards
dc2e06d6b8
"fix" Coverity scan cosmetic issues
...
Let us get rid of some dismissed CID entries...
2017-11-21 09:15:31 +01:00
PascalWithopf
e485c5c5bc
codestyle: shorten lines to max 130 chars
2017-11-15 09:04:42 +01:00
Rainer Gerhards
d65dc24616
Merge pull request #1925 from mrworkman/rscript-parse-time
...
Add RainerScript parse_time() function to convert date/time strings to UNIX time.
2017-11-08 08:38:56 +01:00
Rainer Gerhards
38084023cc
improve error messages in case of failing to obtain group info
...
Also fixes Coverity Scan CID 185357.
2017-11-07 13:21:09 +01:00
Rainer Gerhards
c45df26475
cleanup: reduce the number of warning-avoidance pragmas
2017-11-07 12:03:04 +01:00
Stephen Workman
b2e7c05263
Add parse_time() RainerScript function.
2017-11-06 13:01:00 -05:00
Rainer Gerhards
0f65df6a12
exp: remove #pragma causing trouble with newer clang
2017-11-04 18:11:26 +01:00
Rainer Gerhards
f6f569651c
rainerscript: check that we really do not have mem leak via assert()
...
This is done because a) it is generally a good idea to have it and
b) we investigate CID 185385 which looks much like a false positive.
2017-11-01 19:35:42 +01:00
Rainer Gerhards
028d87170b
config parser: potential double free on invalid config
...
commit 4aa6be5da6dc9a7bd921d02695f734c4097189a0 was incomplete
Detected by Coverity scan, CID 185388
2017-10-29 19:13:04 +01:00
Rainer Gerhards
4aa6be5da6
config parser: potential double free on invalid config
...
If a the compare operation in a property filter could not properly
be parsed, a double free occured.
Detected by Coverity scan, CID 185388
2017-10-29 10:54:49 +01: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